WO2018107947A1 - Charging method and apparatus, and storage medium - Google Patents

Charging method and apparatus, and storage medium Download PDF

Info

Publication number
WO2018107947A1
WO2018107947A1 PCT/CN2017/112391 CN2017112391W WO2018107947A1 WO 2018107947 A1 WO2018107947 A1 WO 2018107947A1 CN 2017112391 W CN2017112391 W CN 2017112391W WO 2018107947 A1 WO2018107947 A1 WO 2018107947A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
power
current
remaining power
external device
Prior art date
Application number
PCT/CN2017/112391
Other languages
French (fr)
Chinese (zh)
Inventor
马整平
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018107947A1 publication Critical patent/WO2018107947A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/44Methods for charging or discharging
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Definitions

  • the present invention relates to the field of electronic device technologies, and in particular, to a charging method, device, and storage medium.
  • a terminal having a fast charging function of a mobile power source, a DC-DC (direct current-direct current) boosting device, and a general-purpose input/output (GPIO) are used between the mobile power function module and the terminal battery.
  • GPIO general-purpose input/output
  • General Purpose Input Output controls whether the mobile power function module is externally charged; generally, the mobile power function module is turned on by default, usually charging and discharging to the terminal, the battery is lower than a certain percentage of the power and charging to a certain amount of power Turn off the fast charging function when the percentage is exceeded.
  • the terminal may be faulty: after the terminal enters the sleep state, the terminal is connected to the external device, which may cause the terminal to discharge until the external device is full or the terminal hardware is turned off. If the terminal is connected to an external device when the terminal is at a low voltage and the available charging power reaches the above percentage power, the terminal battery voltage may be too low.
  • Embodiments of the present invention provide a charging method, device, and storage medium.
  • an embodiment of the present invention provides a charging method, including: detecting whether a terminal is in a dormant state when a first preset duration arrives; and waking up the terminal if the terminal is in a dormant state, detecting the terminal The current remaining power of the power supply; when the remaining power is greater than the first preset threshold, determining a second preset duration according to the preset power according to a preset rule; controlling the terminal to enter the sleep state again, and The second preset duration starts the timing; when the second preset duration is reached, the step of detecting whether the terminal is in the sleep state is returned.
  • determining, according to the preset rule, the second preset duration according to the remaining power includes: acquiring a total power of the power, and calculating the total power and a charging current of the external device. a ratio of the difference between the remaining power and the first preset threshold; calculating a product of the difference percentage and the ratio, and using the product as the second preset duration.
  • the method further includes: stopping the pair when the remaining power is less than or equal to the first preset threshold The external device is charged.
  • the method further includes: detecting the power source when the remaining power is less than or equal to a second preset threshold And output voltage value; determining a corresponding current limiting current according to the mapping relationship between the output voltage value and the charging current; and when the external device is connected, charging the external device with the current limiting current.
  • the method further includes: detecting a current remaining power; determining whether the remaining power is less than a third preset threshold a value; if the remaining power is greater than or equal to the third preset threshold, charging the external device with a rated output current.
  • the embodiment of the present invention provides a charging apparatus, where the apparatus includes: a first detecting unit configured to detect whether the terminal is in a sleep state when the first preset duration arrives; and configured to be a second preset When the duration is reached, returning to the step of detecting whether the terminal is in a sleep state; a second detecting unit, configured to: if the terminal is in a dormant state, wake up the terminal, and detect a current remaining power of the power of the terminal; the first determining unit is configured to: when the remaining power is greater than a first preset threshold And determining, according to the preset rule, the second preset duration according to the remaining power; the first control unit is configured to control the terminal to enter the sleep state again, and start timing with the second preset duration.
  • the first determining unit is configured to acquire a total power of the power source, calculate a ratio of the total power amount to power consumption of the external device, and calculate the remaining power amount and the first a percentage difference of the preset threshold value; calculating a product of the difference percentage and the ratio, and using the product as the second preset duration.
  • the first control unit is configured to, after the second detecting unit detects the current remaining power of the power source of the terminal, when the remaining power is less than or equal to the first preset At the threshold, the charging of the external device is stopped.
  • the device further includes: a third detecting unit, a second determining unit, and a second control unit; wherein the third detecting unit is configured to detect at the second detecting unit After the current remaining power of the power source of the terminal, when the remaining power is less than or equal to the second preset threshold, detecting an output voltage value of the power source; the second determining unit is configured to be according to the output voltage The mapping relationship between the value and the charging current determines a corresponding current limiting current; the second control unit is configured to charge the external device with the current limiting current when the external device is accessed.
  • the second detecting unit is further configured to: after the second control unit charges the external device with the current limiting current, detect a current remaining power; and determine the remaining Whether the electric quantity is less than a third preset threshold; the second control unit is further configured to charge the external device with a rated output current if the remaining electric quantity is greater than or equal to the third preset threshold .
  • an embodiment of the present invention provides a storage medium having stored thereon a computer program, the computer program being executed by a processor to implement the steps of any of the above methods.
  • the embodiment of the present invention provides a charging method, a device, and a storage medium. First, when the first preset duration arrives, it is detected whether the terminal is in a dormant state. If the terminal is in a dormant state, the terminal is awakened, and the current remaining power of the terminal is detected.
  • the current remaining power of the power supply in the sleep state avoids that when the terminal is in the sleep state and the remaining power is less than or equal to the first preset threshold, the external device is not stopped in time to prevent the power from being over-discharged; then, when the remaining battery is discharged
  • the threshold is greater than the first preset threshold
  • the second preset duration is determined according to the preset power according to the preset rule, and the control terminal enters the sleep state again, and starts the second preset duration, and returns when the second preset duration arrives.
  • the step of detecting whether the terminal is in the dormant state can be seen that the terminal can update the remaining power of the power source when the terminal is in the sleep state, thereby achieving a reasonable wake-up time and ensuring energy saving of the terminal.
  • FIG. 1 is a schematic diagram of a first flow chart of a charging method in an embodiment of the present invention
  • FIG. 2 is a second schematic flowchart of a charging method in an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a third process of a charging method in an embodiment of the present invention.
  • FIG. 4 is a schematic structural view of a charging device according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
  • the charging method can be applied to a charging device, and the charging device can be built in or externally connected to the terminal.
  • the terminal can be a smart phone, a tablet computer, a notebook computer or the like.
  • the terminal has a power source capable of supplying power to the terminal itself, and also outputting power to the external device, so that the external device performs charging.
  • the terminal when the terminal charges the external device, the terminal internally sets a detection period. When the detection period arrives, the terminal wakes up itself to detect the current remaining power of the power source. Then, in the embodiment of the present invention, if the current detection period timing duration is the first preset duration, the foregoing method may be:
  • FIG. 1 is a schematic diagram of a first flow chart of a charging method according to an embodiment of the present invention. Referring to FIG. 1 , the method includes:
  • the terminal starts a preset timer after the external device accesses the charging, and when the first preset duration of the timer is reached, the terminal detects whether it is in the sleep state. In the embodiment of the present invention, when the terminal is in the sleep state, the terminal can continue to output power to the external device.
  • the first preset duration may be 3s, 5s, 10s, etc., and is not specifically limited in the embodiment of the present invention.
  • S102 If the terminal is in a sleep state, wake up the terminal, and detect the current remaining power of the power source;
  • the terminal wakes itself up when detecting that it is in the sleep state, and detects the current remaining power of its own power source.
  • the power of the power supply is defined by a percentage.
  • the detection of the current remaining power of the power supply can be obtained by detecting the output voltage of the power supply, or by detecting the power of the power supply. Of course, other detection methods can also be used.
  • the embodiment of the present invention is not specifically limited.
  • the first preset threshold is a cutoff power value of the power supply of the terminal to the external device, such as 25%, 20%, 15%, etc., and the cutoff power value is set to prevent the power source from being over-discharged, for different characteristics.
  • the cutoff power can be set to a different value, and is set according to the technical features corresponding to the specific power supply model, which is not specifically limited in the embodiment of the present invention.
  • the terminal calculates the second preset duration when determining that the current remaining power is greater than the first preset threshold.
  • the second preset duration is the time interval from the next wake-up detection.
  • the detection period may be an equal-length period, that is, the first preset duration is equal to the second preset duration, or may be an unequal-length period, that is, the first preset duration is not equal to the second preset duration.
  • the embodiment of the invention is not specifically limited.
  • the S103 may include: acquiring the total power of the power source, and calculating the total The ratio of the power to the power consumption of the external device; calculating the percentage difference between the remaining power and the first preset threshold; calculating the product of the difference percentage and the ratio, and taking the product as the second preset duration.
  • the terminal according to its own configuration information, the total available power supply itself total C, and then, calculates the total amount of total C and an external device outside the charging current I, i.e., the ratio of the input current value of the external device, then Since the power of the power source is expressed as a percentage, the percentage difference between the remaining power P now and the first preset threshold P stop is calculated, and the difference percentage is multiplied by the ratio, and the product is taken as the second.
  • the preset duration is used in this way, iteratively obtains the preset duration, that is, the more the remaining power, the longer the preset duration, and the lower the wake-up frequency.
  • the second preset time length t described above can be obtained by the following formula (1).
  • t is the duration of a second predetermined
  • C total is the total power supply
  • the I outside the charging current of the external device P now the current remaining power
  • P stop first predetermined threshold i.e., an external device The value of the charge cutoff.
  • S104 The control terminal enters the sleep state again, and starts timing with the second preset duration
  • the terminal controls itself to enter the sleep state again, and starts timing with the second preset duration, waiting for the next wakeup when the second preset duration arrives.
  • the terminal when the second preset duration arrives, the terminal returns to S101 to detect whether the terminal is in the sleep state again. If yes, S102 to S105 are executed again, and the loop is continued until the remaining power is less than or equal to the first preset threshold, and S106 is performed. .
  • S106 Stop charging the external device when the remaining power is less than or equal to the first preset threshold.
  • the terminal when determining that the current remaining power is less than or equal to the first preset threshold, the terminal indicates that the current remaining power of the terminal power is insufficient to support charging the external device, so, at this time, the terminal stops. Charge external devices.
  • FIG. 2 is a schematic diagram of a second process of a charging method according to an embodiment of the present invention. Referring to FIG. 2, the method includes:
  • S203 The terminal determines whether the remaining power is less than or equal to the first preset threshold; if the remaining power is greater than the first preset threshold, the process goes to S204; if the remaining power is less than or equal to the first preset threshold, the jump Go to S209;
  • the terminal acquires the total power of the power source, and calculates a ratio of the total power to the charging current of the external device.
  • S205 The terminal calculates a percentage difference between the remaining power and the first preset threshold.
  • S206 The terminal calculates a product of the difference percentage and the ratio, and uses the product as the second preset duration;
  • S207 The terminal control terminal enters the sleep state again, and starts timing with the second preset duration
  • the terminal when the first preset duration arrives, the terminal is detected to be in a dormant state. If the terminal is in the dormant state, the terminal wakes up the terminal, detects the current remaining power of the terminal, and wakes up the terminal and updates the sleep state.
  • the current remaining power of the power source avoids that when the terminal is in the sleep state and the remaining power is less than or equal to the first preset threshold, the external device is not stopped in time to prevent the power from being over-discharged; then, when the remaining power is greater than the first
  • a preset threshold is used, according to a preset rule, the second preset duration is determined according to the remaining power, the control terminal enters the sleep state again, and the second preset duration is started, and when the second preset duration arrives, the detection terminal is returned. If the terminal is in the dormant state, it can be seen that when the terminal is in the dormant state, the remaining power of the power source can be updated, a reasonable wake-up time is realized, and the energy saving of the terminal is ensured.
  • the solution of the embodiment of the present invention can reduce the terminal when connecting the external device. The failure rate increases the terminal life.
  • FIG. 3 is a schematic diagram of a third process of the charging method in the embodiment of the present invention. Referring to FIG. 3, after the foregoing S102, the method further includes:
  • the terminal determines whether the remaining power is less than or equal to a second preset threshold, where the second preset threshold is greater than the first preset threshold, and The difference between the first preset threshold is less than the preset value, that is, the first preset threshold is near the first preset threshold, for example, the first preset threshold is 25%, and the second pre- The threshold value may be set to 30%; the first preset threshold is 20%, and the second preset threshold may be 23%. Of course, there may be other cases, which are not specifically limited in the embodiment of the present invention. .
  • the terminal detects the output voltage value of the power source.
  • S302 Determine a corresponding current limiting current according to a mapping relationship between the output voltage value and the charging current;
  • S302 to S303 may be that, since the output voltage value is different under the condition that the power source is different in the remaining power, then, in order to prevent the output voltage from being pulled low at the moment when the external device is accessed, when the remaining power reaches the second preset threshold After that, according to the mapping relationship between the output voltage value and the charging current, the corresponding current limiting current is determined, so that the output current of the terminal is configured as a current limiting current. Thus, when the external device accesses the terminal, the terminal can use the current limiting current pair. The external device is charging.
  • the mapping relationship between the output voltage value and the charging current may be one-to-one mapping between the output voltage value and the charging current value, or may be a mapping of the output voltage value and the charging current step, that is, an output current value mapping.
  • the range of the value of a charging current of course, there may be other cases, the strength of the present invention is not specifically limited.
  • the terminal may further determine whether to resume full-load charging according to the remaining power of the terminal. Then, after S303, the method may further include: detecting a current remaining power; determining whether the remaining power is less than a third preset threshold; and if the remaining power is greater than or equal to a third preset threshold, the rated output current is external device Charge it.
  • the terminal After the terminal accesses the external device for a period of time, such as 3s and 5s, the terminal detects the current remaining power again, and determines whether the remaining power is less than the third preset threshold.
  • the third preset threshold may be If the preset threshold is consistent, it may be greater than the preset first threshold. If the remaining power is greater than or equal to the third preset threshold, it indicates that the remaining power of the terminal is sufficient to fully charge the external device. The terminal charges the external device with the rated output current.
  • the terminal may further perform S103 to S106.
  • the second preset threshold is set in the vicinity of the first preset threshold, that is, the external charging cutoff threshold, and when the remaining power is less than or equal to the second preset threshold, the power is detected.
  • Output voltage value and then, according to the mapping relationship between the output voltage value and the charging current, determine the corresponding current limiting current, and when the external device is connected, the external device is charged with the current limiting current, thus avoiding the large load
  • the output voltage of the terminal power supply is instantaneously pulled down, resulting in a failure of the terminal screen or hardware shutdown.
  • a third preset threshold that is, whether the remaining power of the terminal can be fully charged to the external device, and if so, the rated output current of the power source Charge the external device to improve the efficiency of the terminal's external charging.
  • an embodiment of the present invention provides a charging apparatus, which is applied to the terminal described in one or more embodiments.
  • the apparatus 400 includes: a first detecting unit 401 configured to detect whether a terminal is in a sleep state when a first preset duration arrives; The method further includes: when the second preset duration is reached, returning to the step of detecting whether the terminal is in a dormant state; the second detecting unit 402 is configured to wake up the terminal and detect the current remaining power of the power of the terminal if the terminal is in the dormant state; The determining unit 403 is configured to: when the remaining power is greater than the first preset threshold, determine a second preset duration according to the preset power according to the preset rule; the first control unit 404 is configured to control the terminal to enter the sleep state again, and The timing is started with the second preset duration.
  • the first determining unit 403 is configured to obtain a total power of the power source, calculate a ratio of the total power to the power consumption of the external device, and calculate a difference between the remaining power and the first preset threshold. The percentage of the value; the product of the difference percentage and the ratio is calculated, and the product is taken as the second preset duration.
  • the first control unit 404 is configured to stop the external device when the second detecting unit detects the current remaining power of the power source of the terminal, and when the remaining power is less than or equal to the first preset threshold. Charging.
  • the apparatus further includes: a third detecting unit, a second determining unit, and a second control unit; wherein the third detecting unit is configured to detect, at the second detecting unit, the current remaining power of the terminal After the power is discharged, when the remaining power is less than or equal to the second preset threshold, the output voltage value of the power source is detected; and the second determining unit is configured to determine a corresponding current limiting current according to the mapping relationship between the output voltage value and the charging current; The second control unit is configured to charge the external device with a current limiting current when the external device is accessed.
  • the second detecting unit is further configured to: after the second control unit charges the external device with the current limiting current, detect the current remaining power; and determine whether the remaining power is less than the third preset threshold.
  • the second control unit is further configured to charge the external device with the rated output current if the remaining power is greater than or equal to the third preset threshold.
  • the first detecting unit 401, the second detecting unit 402, the first determining unit 403, the first control unit 404, the third detecting unit, the second determining unit, and the second control unit may be processed by the charging device.
  • the processor needs to read the instructions stored in the storage medium to perform its functions.
  • FIG. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
  • the terminal 500 may include: at least one processor 501, at least one communication bus 502, a user interface 503, at least one external communication interface 504, and a memory. 505.
  • the communication bus 502 is configured to implement connection communication between these components.
  • the user interface 503 can include a display and a keyboard.
  • External communication interface 504 is optional It can include standard wired and wireless interfaces.
  • the memory 505 stores at least a computer program such that when the processor 501 runs the computer program, the steps of the foregoing method are performed.
  • the processor 501 is configured to execute when the computer program is executed:
  • the control terminal enters the sleep state again, and starts timing with the second preset duration; when the second preset duration reaches, returns to the step of detecting whether the terminal is in the sleep state.
  • the processor 501 is configured to: when the computer program is executed, perform: obtaining a total power of the power source, calculating a ratio of the total power to the power consumption of the external device; calculating the remaining power and the first preset threshold The percentage difference; the product of the difference percentage and the ratio is calculated, and the product is taken as the second preset duration.
  • the processor 501 when the processor 501 is configured to run the computer program, after the second detecting unit detects the current remaining power of the power source of the terminal, when the remaining power is less than or equal to the first preset threshold When it stops charging the external device.
  • the processor 501 when the processor 501 is configured to run the computer program, after the second detecting unit detects the current remaining power of the power of the terminal, when the remaining power is less than or equal to the second preset threshold The output voltage value of the power source is detected; the corresponding current limiting current is determined according to the mapping relationship between the output voltage value and the charging current; when the external device is connected, the external device is charged with the current limiting current.
  • the processor 501 is configured to: when the computer program is executed, perform: after the second control unit charges the external device with the current limiting current, detect the current remaining power; and determine whether the remaining power is less than the Three preset thresholds; if the remaining power is greater than or equal to the third preset threshold, the external device is charged at the rated output current.
  • the processor may be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), and a programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), CPU (Central) At least one of the processing unit), the controller, the microcontroller, and the microprocessor; the electronic device configured to implement the functions of the processor may be other devices, which are not specifically limited in the embodiment of the present invention.
  • ASIC Application Specific Integrated Circuit
  • DSP Digital Signal Processor
  • DSPD Digital Signal Processing Device
  • PLD programmable Logic Device
  • FPGA Field Programmable Gate Array
  • CPU Central
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed.
  • the coupling, or direct coupling, or communication connection of the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms. of.
  • the units described above as separate components may or may not be physically separated.
  • the components displayed as the unit may be, or may not be, physical units; they may be located in one place or on multiple network units; some or all of the units may be selected according to actual needs to implement the solution of the embodiment. purpose.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated into one unit;
  • the unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the foregoing program may be stored in a computer readable storage medium, and when executed, the program includes The foregoing steps of the method embodiment; and the foregoing storage medium includes: a removable storage device, a read only memory (ROM), a magnetic disk, or an optical disk, and the like, which can store program codes.
  • ROM read only memory
  • the above-described integrated unit of the present invention may be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a standalone product.
  • the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions.
  • a computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes various media that can store program codes, such as a mobile storage device, a ROM, a magnetic disk, or an optical disk.
  • an embodiment of the present invention further provides a storage medium on which a computer program is stored, the steps of the foregoing method being executed by the processor.
  • the solution provided by the embodiment of the present invention detects whether the terminal is located when the first preset duration arrives.
  • the sleep state if the terminal is in the sleep state, wake up the terminal, detect the current remaining power of the power of the terminal, wake up the terminal, and update the current remaining power of the power source in the sleep state, thereby avoiding that the terminal is in the sleep state and the remaining power is less than or
  • the first preset threshold is equal to the first
  • the external device is not stopped in time to prevent the power from being over-discharged.
  • the second power is determined according to the preset rule.
  • the preset duration the control terminal enters the sleep state again, and starts the second preset duration.
  • the step of detecting whether the terminal is in the sleep state is returned. It can be seen that the terminal can update the power supply when in the sleep state. The remaining power achieves a reasonable wake-up time and ensures energy saving of the terminal.

Landscapes

  • Engineering & Computer Science (AREA)
  • Manufacturing & Machinery (AREA)
  • Chemical & Material Sciences (AREA)
  • Chemical Kinetics & Catalysis (AREA)
  • Electrochemistry (AREA)
  • General Chemical & Material Sciences (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

Disclosed is a charging method, the method comprising: when a first pre-set duration is reached, detecting whether a terminal is in a sleep state; if the terminal is in the sleep state, waking up the terminal and detecting the current remaining electric quantity of a power source of the terminal; when the remaining electric quantity is greater than a first pre-set threshold value, determining a second pre-set duration according to the remaining electric quantity based on a pre-set rule; controlling the terminal so that same enters the sleep state again, and initiating timing with the second pre-set duration; and when the second pre-set duration is reached, returning to the step of detecting whether a terminal is in a sleep state. Further disclosed are a charging apparatus and a storage medium.

Description

一种充电方法、装置及存储介质Charging method, device and storage medium
相关申请的交叉引用Cross-reference to related applications
本申请基于申请号为201611152372.1、申请日为2016年12月14日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The present application is based on a Chinese patent application filed on Jan. 14, 2016, the entire disclosure of which is hereby incorporated by reference.
技术领域Technical field
本发明涉及电子设备技术领域,尤其涉及一种充电方法、装置及存储介质。The present invention relates to the field of electronic device technologies, and in particular, to a charging method, device, and storage medium.
背景技术Background technique
随着电子技术的快速发展,很多终端都兼具有移动电源的快速充电功能。With the rapid development of electronic technology, many terminals have the fast charging function of mobile power.
在相关技术中,兼具移动电源的快速充电功能的终端,移动电源功能模块和终端电池间采用直流-直流(DC-DC,direct current-direct current)升压装置,通过通用输入/输出(GPIO,General Purpose Input Output)控制该移动电源功能模块是否对外充电;一般地,移动电源功能模块默认为打开状态,通常充放电至该终端中电量低于某个百分比电量以及在充电至电量的某个百分比时,关闭该快速充电功能。In the related art, a terminal having a fast charging function of a mobile power source, a DC-DC (direct current-direct current) boosting device, and a general-purpose input/output (GPIO) are used between the mobile power function module and the terminal battery. , General Purpose Input Output) controls whether the mobile power function module is externally charged; generally, the mobile power function module is turned on by default, usually charging and discharging to the terminal, the battery is lower than a certain percentage of the power and charging to a certain amount of power Turn off the fast charging function when the percentage is exceeded.
可见,相关技术如果在以下两种情况下连接外部设备时,可能导致终端故障:终端进入休眠状态后该终端连接外部设备,可能导致该终端一直对外放电直至外部设备充满或该终端硬件关机的情况下;或者在终端处于低电压且可用充电电量达到上述百分比电量时该终端连接外部设备,可能导致终端的电池电压过低的情况下。It can be seen that if the related technology is connected to the external device in the following two situations, the terminal may be faulty: after the terminal enters the sleep state, the terminal is connected to the external device, which may cause the terminal to discharge until the external device is full or the terminal hardware is turned off. If the terminal is connected to an external device when the terminal is at a low voltage and the available charging power reaches the above percentage power, the terminal battery voltage may be too low.
所以,相关技术中并不存在一种合理的终端对外部设备充电的方案。 Therefore, there is no reasonable solution for the terminal to charge the external device in the related art.
发明内容Summary of the invention
本发明实施例提供一种充电方法、装置及存储介质。Embodiments of the present invention provide a charging method, device, and storage medium.
第一方面,本发明实施例提供一种充电方法,包括:当第一预设时长到达时,检测终端是否处于休眠状态;如果所述终端处于休眠状态,唤醒所述终端,检测所述终端的电源当前的剩余电量;当所述剩余电量大于第一预设门限值时,按照预设规则,根据所述剩余电量确定第二预设时长;控制所述终端再次进入休眠状态,并以所述第二预设时长启动计时;当所述第二预设时长达到时,返回检测终端是否处于休眠状态的步骤。In a first aspect, an embodiment of the present invention provides a charging method, including: detecting whether a terminal is in a dormant state when a first preset duration arrives; and waking up the terminal if the terminal is in a dormant state, detecting the terminal The current remaining power of the power supply; when the remaining power is greater than the first preset threshold, determining a second preset duration according to the preset power according to a preset rule; controlling the terminal to enter the sleep state again, and The second preset duration starts the timing; when the second preset duration is reached, the step of detecting whether the terminal is in the sleep state is returned.
在本发明其它实施例中,所述按照预设规则,根据所述剩余电量确定第二预设时长,包括:获取所述电源的总电量,计算所述总电量与所述外部设备的充电电流的比值;计算所述剩余电量与所述第一预设门限值的差值百分比;计算所述差值百分比与所述比值的乘积,将所述乘积作为所述第二预设时长。In other embodiments of the present invention, determining, according to the preset rule, the second preset duration according to the remaining power, includes: acquiring a total power of the power, and calculating the total power and a charging current of the external device. a ratio of the difference between the remaining power and the first preset threshold; calculating a product of the difference percentage and the ratio, and using the product as the second preset duration.
在本发明其它实施例中,在所述检测所述终端的电源当前的剩余电量之后,所述方法还包括:当所述剩余电量小于或等于所述第一预设门限值时,停止对所述外部设备充电。In other embodiments of the present invention, after the detecting the current remaining power of the power source of the terminal, the method further includes: stopping the pair when the remaining power is less than or equal to the first preset threshold The external device is charged.
在本发明其它实施例中,在所述检测所述终端的电源当前的剩余电量之后,所述方法还包括:当所述剩余电量小于或等于第二预设门限值时,检测所述电源的输出电压值;根据所述输出电压值和充电电流的映射关系,确定对应的限流电流;当所述外部设备接入时,以所述限流电流对所述外部设备进行充电。In other embodiments of the present invention, after the detecting the current remaining power of the power source of the terminal, the method further includes: detecting the power source when the remaining power is less than or equal to a second preset threshold And output voltage value; determining a corresponding current limiting current according to the mapping relationship between the output voltage value and the charging current; and when the external device is connected, charging the external device with the current limiting current.
在本发明其它实施例中,所述以所述限流电流对所述外部设备进行充电之后,所述方法还包括:检测当前的剩余电量;判断所述剩余电量是否小于第三预设门限值;如果所述剩余电量大于或者等于所述第三预设门限值,以额定输出电流对所述外部设备进行充电。In another embodiment of the present invention, after the charging the current device with the current limiting current, the method further includes: detecting a current remaining power; determining whether the remaining power is less than a third preset threshold a value; if the remaining power is greater than or equal to the third preset threshold, charging the external device with a rated output current.
第二方面,本发明实施例提供一种充电装置,所述装置包括:第一检测单元,配置为当第一预设时长到达时,检测终端是否处于休眠状态;还配置为当第二预设时长达到时,返回检测终端是否处于休眠状态的步骤; 第二检测单元,配置为如果所述终端处于休眠状态,唤醒所述终端,检测所述终端的电源当前的剩余电量;第一确定单元,配置为当所述剩余电量大于第一预设门限值时,按照预设规则,根据所述剩余电量确定所述第二预设时长;第一控制单元,配置为控制所述终端再次进入休眠状态,并以所述第二预设时长启动计时。In a second aspect, the embodiment of the present invention provides a charging apparatus, where the apparatus includes: a first detecting unit configured to detect whether the terminal is in a sleep state when the first preset duration arrives; and configured to be a second preset When the duration is reached, returning to the step of detecting whether the terminal is in a sleep state; a second detecting unit, configured to: if the terminal is in a dormant state, wake up the terminal, and detect a current remaining power of the power of the terminal; the first determining unit is configured to: when the remaining power is greater than a first preset threshold And determining, according to the preset rule, the second preset duration according to the remaining power; the first control unit is configured to control the terminal to enter the sleep state again, and start timing with the second preset duration.
在本发明其它实施例中,所述第一确定单元,配置为获取所述电源的总电量,计算所述总电量与所述外部设备功耗的比值;计算所述剩余电量与所述第一预设门限值的差值百分比;计算所述差值百分比与所述比值的乘积,将所述乘积作为所述第二预设时长。In another embodiment of the present invention, the first determining unit is configured to acquire a total power of the power source, calculate a ratio of the total power amount to power consumption of the external device, and calculate the remaining power amount and the first a percentage difference of the preset threshold value; calculating a product of the difference percentage and the ratio, and using the product as the second preset duration.
在本发明其它实施例中,所述第一控制单元,配置为在所述第二检测单元检测所述终端的电源当前的剩余电量之后,当所述剩余电量小于或等于所述第一预设门限值时,停止对所述外部设备充电。In another embodiment of the present invention, the first control unit is configured to, after the second detecting unit detects the current remaining power of the power source of the terminal, when the remaining power is less than or equal to the first preset At the threshold, the charging of the external device is stopped.
在本发明其它实施例中,所述装置,还包括:第三检测单元、第二确定单元以及第二控制单元;其中,所述第三检测单元,配置为在所述第二检测单元检测所述终端的电源当前的剩余电量之后,当所述剩余电量小于或等于第二预设门限值时,检测所述电源的输出电压值;所述第二确定单元,配置为根据所述输出电压值和充电电流的映射关系,确定对应的限流电流;所述第二控制单元,配置为当所述外部设备接入时,以所述限流电流对所述外部设备进行充电。In another embodiment of the present invention, the device further includes: a third detecting unit, a second determining unit, and a second control unit; wherein the third detecting unit is configured to detect at the second detecting unit After the current remaining power of the power source of the terminal, when the remaining power is less than or equal to the second preset threshold, detecting an output voltage value of the power source; the second determining unit is configured to be according to the output voltage The mapping relationship between the value and the charging current determines a corresponding current limiting current; the second control unit is configured to charge the external device with the current limiting current when the external device is accessed.
在本发明其它实施例中,所述第二检测单元,还配置为在所述第二控制单元以所述限流电流对所述外部设备进行充电之后,检测当前的剩余电量;判断所述剩余电量是否小于第三预设门限值;所述第二控制单元,还配置为如果所述剩余电量大于或者等于所述第三预设门限值,以额定输出电流对所述外部设备进行充电。In another embodiment of the present invention, the second detecting unit is further configured to: after the second control unit charges the external device with the current limiting current, detect a current remaining power; and determine the remaining Whether the electric quantity is less than a third preset threshold; the second control unit is further configured to charge the external device with a rated output current if the remaining electric quantity is greater than or equal to the third preset threshold .
第三方面,本发明实施例一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一方法的步骤。In a third aspect, an embodiment of the present invention provides a storage medium having stored thereon a computer program, the computer program being executed by a processor to implement the steps of any of the above methods.
本发明实施例提供一种充电方法、装置及存储介质,首先,通过当第一预设时长到达时,检测终端是否处于休眠状态,如果终端处于休眠状态,唤醒终端,检测终端的电源当前的剩余电量,通过唤醒终端,并更新处于 休眠状态的电源的当前剩余电量,避免了在终端处于休眠状态且剩余电量小于或等于第一预设门限值时,未及时停止对外部设备充电而导致防止电源过度放电;然后,当剩余电量大于第一预设门限值时,按照预设规则,根据剩余电量确定第二预设时长,控制终端再次进入休眠状态,并启动第二预设时长,等第二预设时长到达时,返回检测终端是否处于休眠状态的步骤,可见,终端在处于休眠状态时能够更新电源的剩余电量,实现了合理的唤醒时间,保证了终端的节能。The embodiment of the present invention provides a charging method, a device, and a storage medium. First, when the first preset duration arrives, it is detected whether the terminal is in a dormant state. If the terminal is in a dormant state, the terminal is awakened, and the current remaining power of the terminal is detected. Power, wake up the terminal, and update at The current remaining power of the power supply in the sleep state avoids that when the terminal is in the sleep state and the remaining power is less than or equal to the first preset threshold, the external device is not stopped in time to prevent the power from being over-discharged; then, when the remaining battery is discharged When the threshold is greater than the first preset threshold, the second preset duration is determined according to the preset power according to the preset rule, and the control terminal enters the sleep state again, and starts the second preset duration, and returns when the second preset duration arrives. The step of detecting whether the terminal is in the dormant state can be seen that the terminal can update the remaining power of the power source when the terminal is in the sleep state, thereby achieving a reasonable wake-up time and ensuring energy saving of the terminal.
附图说明DRAWINGS
图1为本发明实施例中的充电方法的第一种流程示意图;1 is a schematic diagram of a first flow chart of a charging method in an embodiment of the present invention;
图2为本发明实施例中的充电方法的第二种流程示意图;2 is a second schematic flowchart of a charging method in an embodiment of the present invention;
图3为本发明实施例中的充电方法的第三种流程示意图;3 is a schematic diagram of a third process of a charging method in an embodiment of the present invention;
图4为本发明实施例中的充电装置的结构示意图;4 is a schematic structural view of a charging device according to an embodiment of the present invention;
图5为本发明实施例中的终端的结构示意图。FIG. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present invention will be clearly and completely described in the following with reference to the accompanying drawings.
本发明实施例提供了一种充电方法,该充电方法可以应用于一充电装置,该充电装置可以内置或者外接于终端,这里,终端可以为智能手机、平板电脑、笔记本电脑等。该终端中具有一电源,该电源能够为终端自身供电,也可以为外部设备输出电能,使得外部设备进行充电。The charging method can be applied to a charging device, and the charging device can be built in or externally connected to the terminal. Here, the terminal can be a smart phone, a tablet computer, a notebook computer or the like. The terminal has a power source capable of supplying power to the terminal itself, and also outputting power to the external device, so that the external device performs charging.
在实际应用中,终端在对外部设备充电时,内部设定一检测周期,每当检测周期到达,终端就会唤醒自身,以检测自身电源当前的剩余电量。那么,在本发明实施例中,假设当前的检测周期定时时长为第一预设时长,上述方法可以为:In practical applications, when the terminal charges the external device, the terminal internally sets a detection period. When the detection period arrives, the terminal wakes up itself to detect the current remaining power of the power source. Then, in the embodiment of the present invention, if the current detection period timing duration is the first preset duration, the foregoing method may be:
图1为本发明实施例中的充电方法的第一种流程示意图,参见图1所示,该方法包括: FIG. 1 is a schematic diagram of a first flow chart of a charging method according to an embodiment of the present invention. Referring to FIG. 1 , the method includes:
S101:当第一预设时长到达时,检测终端是否处于休眠状态;S101: When the first preset duration arrives, detecting whether the terminal is in a dormant state;
这里,终端在使用过程中,在外部设备接入充电后,启动预设的定时器,当该定时器定时的第一预设时长达到时,终端检测自身是否处于休眠状态。在本发明实施例中,终端在处于休眠状态时,仍可以持续向外部设备输出电能。第一预设时长可以是3s、5s、10s等,本发明实施例不做具体限定。Here, the terminal starts a preset timer after the external device accesses the charging, and when the first preset duration of the timer is reached, the terminal detects whether it is in the sleep state. In the embodiment of the present invention, when the terminal is in the sleep state, the terminal can continue to output power to the external device. The first preset duration may be 3s, 5s, 10s, etc., and is not specifically limited in the embodiment of the present invention.
S102:如果终端处于休眠状态,唤醒终端,检测自身电源当前的剩余电量;S102: If the terminal is in a sleep state, wake up the terminal, and detect the current remaining power of the power source;
这里,终端在检测到自身处于休眠状态时,唤醒自身,同时检测自身电源当前的剩余电量。在实际应用中,一般来说,电源的电量以百分比来定义,电源当前的剩余电量的检测可以通过检测电源的输出电压获得,也可以通过检测电源的电量获得,当然,还可以为其它检测方式,本发明实施例不做具体限定。Here, the terminal wakes itself up when detecting that it is in the sleep state, and detects the current remaining power of its own power source. In practical applications, in general, the power of the power supply is defined by a percentage. The detection of the current remaining power of the power supply can be obtained by detecting the output voltage of the power supply, or by detecting the power of the power supply. Of course, other detection methods can also be used. The embodiment of the present invention is not specifically limited.
S103:当剩余电量大于第一预设门限值时,按照预设规则,根据剩余电量确定第二预设时长;S103: When the remaining power is greater than the first preset threshold, determining a second preset duration according to the remaining power according to a preset rule;
其中,第一预设门限值为终端的电源对外部设备充电的截止电量值,如25%、20%、15%等,该截止电量值是为了防止电源过度放电而设置的,对于不同特性的终端的电源来说,该截止电量可以选择不同的值,以具体电源型号对应的技术特征来设定,本发明实施例不作具体限定。The first preset threshold is a cutoff power value of the power supply of the terminal to the external device, such as 25%, 20%, 15%, etc., and the cutoff power value is set to prevent the power source from being over-discharged, for different characteristics. For the power supply of the terminal, the cutoff power can be set to a different value, and is set according to the technical features corresponding to the specific power supply model, which is not specifically limited in the embodiment of the present invention.
这里,终端在确定当前的剩余电量大于第一预设门限值时,计算第二预设时长。第二预设时长即为与下一次唤醒检测的时间间隔。其中,检测周期可以为等长周期,即第一预设时长与第二预设时长相等,也可以为不等长周期,也就是说第一预设时长与第二预设时长不相等,本发明实施例不做具体限定。Here, the terminal calculates the second preset duration when determining that the current remaining power is greater than the first preset threshold. The second preset duration is the time interval from the next wake-up detection. The detection period may be an equal-length period, that is, the first preset duration is equal to the second preset duration, or may be an unequal-length period, that is, the first preset duration is not equal to the second preset duration. The embodiment of the invention is not specifically limited.
在具体实施的过程中,由于频繁唤醒休眠中的终端会导致待机电流增大,增大功耗,那么,为了降低功耗,减少频繁唤醒终端,S103可以包括:获取电源的总电量,计算总电量与外部设备功耗的比值;计算剩余电量与第一预设门限值的差值百分比;计算差值百分比与比值的乘积,将乘积作为第二预设时长。 In a specific implementation process, since frequently awakening the terminal in the sleep causes the standby current to increase and the power consumption is increased, in order to reduce the power consumption and reduce the frequent wake-up of the terminal, the S103 may include: acquiring the total power of the power source, and calculating the total The ratio of the power to the power consumption of the external device; calculating the percentage difference between the remaining power and the first preset threshold; calculating the product of the difference percentage and the ratio, and taking the product as the second preset duration.
具体来说,终端根据自身的配置信息,可以获得自身电源的总电量C,然后,计算总电量C与外部设备的充电电流I,也就是外部设备的输入电流值的比值,接下来,由于电源的电量都以百分比进行表示的,所以,计算剩余电量Pnow与第一预设门限值Pstop的差值百分比,再将差值百分比与上述比值相乘,将乘积作为第二预设时长。如此,便迭代得到预设时长,也就是说剩余电量越多,预设时长越长,唤醒频率越低。Specifically, the terminal according to its own configuration information, the total available power supply itself total C, and then, calculates the total amount of total C and an external device outside the charging current I, i.e., the ratio of the input current value of the external device, then Since the power of the power source is expressed as a percentage, the percentage difference between the remaining power P now and the first preset threshold P stop is calculated, and the difference percentage is multiplied by the ratio, and the product is taken as the second. The preset duration. In this way, iteratively obtains the preset duration, that is, the more the remaining power, the longer the preset duration, and the lower the wake-up frequency.
例如,上述第二预设时长t可以通过以下公式(1)计算获得。For example, the second preset time length t described above can be obtained by the following formula (1).
Figure PCTCN2017112391-appb-000001
Figure PCTCN2017112391-appb-000001
其中,t为第二预设时长,C为电源的总电量,I为外部设备的充电电流,Pnow为当前的剩余电量,Pstop为第一预设门限值,即对外部设备充电的截止电量值。Wherein, t is the duration of a second predetermined, C total is the total power supply, the I outside the charging current of the external device, P now the current remaining power, P stop first predetermined threshold, i.e., an external device The value of the charge cutoff.
S104:控制终端再次进入休眠状态,并以第二预设时长启动计时;S104: The control terminal enters the sleep state again, and starts timing with the second preset duration;
这里,终端确定出第二预设时长之后,便再次控制自身进入休眠状态,并以第二预设时长启动计时,等待第二预设时长到达时的下一次唤醒。Here, after determining the second preset duration, the terminal controls itself to enter the sleep state again, and starts timing with the second preset duration, waiting for the next wakeup when the second preset duration arrives.
S105:当第二预设时长达到时,返回S101中检测终端是否处于休眠状态的步骤。S105: When the second preset duration is reached, return to the step of detecting whether the terminal is in a sleep state in S101.
这里,当第二预设时长到达时,终端返回S101,再次检测终端是否处于休眠状态,若是,再次执行S102至S105,如此循环,直到剩余电量小于或等于第一预设门限值,执行S106。Here, when the second preset duration arrives, the terminal returns to S101 to detect whether the terminal is in the sleep state again. If yes, S102 to S105 are executed again, and the loop is continued until the remaining power is less than or equal to the first preset threshold, and S106 is performed. .
S106:当剩余电量小于或等于第一预设门限值时,停止对外部设备充电。S106: Stop charging the external device when the remaining power is less than or equal to the first preset threshold.
这里,在S102之后,终端在确定当前的剩余电量小于或者等于第一预设门限值时,则表明终端电源当前的剩余电量已经不足以支持对外部设备进行充电,所以,此时,终端停止对外部设备充电。Here, after S102, when determining that the current remaining power is less than or equal to the first preset threshold, the terminal indicates that the current remaining power of the terminal power is insufficient to support charging the external device, so, at this time, the terminal stops. Charge external devices.
下面以具体实例来对本发明实施例提供的充电方法进行说明。The charging method provided by the embodiment of the present invention will be described below by way of specific examples.
图2为本发明实施例中的充电方法的第二种流程示意图,参见图2所示,该方法包括: 2 is a schematic diagram of a second process of a charging method according to an embodiment of the present invention. Referring to FIG. 2, the method includes:
S201:当第一预设时长到达时,终端检测自身是否处于休眠状态;S201: When the first preset duration arrives, the terminal detects whether the user is in a dormant state;
S202:如果终端处于休眠状态,终端唤醒自身,并检测自身电源当前的剩余电量;S202: If the terminal is in a dormant state, the terminal wakes itself up and detects the current remaining power of the power source;
S203:终端判断剩余电量是否小于或等于第一预设门限值;如果剩余电量大于第一预设门限值,跳转至S204;如果剩余电量小于或等于第一预设门限值,跳转至S209;S203: The terminal determines whether the remaining power is less than or equal to the first preset threshold; if the remaining power is greater than the first preset threshold, the process goes to S204; if the remaining power is less than or equal to the first preset threshold, the jump Go to S209;
S204:终端获取电源的总电量,计算总电量与外部设备的充电电流的比值;S204: The terminal acquires the total power of the power source, and calculates a ratio of the total power to the charging current of the external device.
S205:终端计算剩余电量与第一预设门限值的差值百分比;S205: The terminal calculates a percentage difference between the remaining power and the first preset threshold.
S206:终端计算差值百分比与比值的乘积,将乘积作为第二预设时长;S206: The terminal calculates a product of the difference percentage and the ratio, and uses the product as the second preset duration;
S207:终端控制终端再次进入休眠状态,并以第二预设时长启动计时;S207: The terminal control terminal enters the sleep state again, and starts timing with the second preset duration;
S208:当所述第二预设时长达到时,返回S201;S208: When the second preset duration is reached, return to S201;
S209:停止对外部设备充电。S209: Stop charging the external device.
本发明实施例中,通过当第一预设时长到达时,检测终端是否处于休眠状态,如果终端处于休眠状态,唤醒终端,检测终端的电源当前的剩余电量,通过唤醒终端,并更新处于休眠状态的电源的当前剩余电量,避免了在终端处于休眠状态且剩余电量小于或等于第一预设门限值时,未及时停止对外部设备充电而导致防止电源过度放电;然后,当剩余电量大于第一预设门限值时,按照预设规则,根据剩余电量确定第二预设时长,控制终端再次进入休眠状态,并启动第二预设时长,等第二预设时长到达时,返回检测终端是否处于休眠状态的步骤,可见,终端在处于休眠状态时能够更新电源的剩余电量,实现了合理的唤醒时间,保证了终端的节能;采用本发明实施例的方案能够降低终端在连接外部设备时的故障发生率,延长终端寿命。In the embodiment of the present invention, when the first preset duration arrives, the terminal is detected to be in a dormant state. If the terminal is in the dormant state, the terminal wakes up the terminal, detects the current remaining power of the terminal, and wakes up the terminal and updates the sleep state. The current remaining power of the power source avoids that when the terminal is in the sleep state and the remaining power is less than or equal to the first preset threshold, the external device is not stopped in time to prevent the power from being over-discharged; then, when the remaining power is greater than the first When a preset threshold is used, according to a preset rule, the second preset duration is determined according to the remaining power, the control terminal enters the sleep state again, and the second preset duration is started, and when the second preset duration arrives, the detection terminal is returned. If the terminal is in the dormant state, it can be seen that when the terminal is in the dormant state, the remaining power of the power source can be updated, a reasonable wake-up time is realized, and the energy saving of the terminal is ensured. The solution of the embodiment of the present invention can reduce the terminal when connecting the external device. The failure rate increases the terminal life.
基于前述实施例,在实际应用中,由于终端在放电过程中电量低于某电量百分比,即上述第一预设门限值时,终端不能对外充电,那么,如果第一预设门限值划分对应的电压太低,就会在大负载接入的瞬间拉低电源 的输出电压,导致终端硬件关机,而如果第一预设门限值划分对应的电压太高,则会出现终端过早就关闭对外放电功能,使得终端明明存在剩余很多电量,但却不能给外部设备充电的情况发生。那么,为了解决这个问题,图3为本发明实施例中的充电方法的第三种流程示意图,参见图3所示,上述S102之后,该方法还包括:Based on the foregoing embodiment, in the actual application, if the terminal is unable to externally charge when the power of the terminal is lower than a certain percentage of power, that is, the first preset threshold, the first preset threshold is divided. If the corresponding voltage is too low, the power will be pulled down at the moment of large load access. The output voltage causes the terminal hardware to shut down. If the voltage corresponding to the first preset threshold is too high, the terminal will turn off the external discharge function too early, so that the terminal clearly has a lot of power remaining, but it cannot be externally The charging of the device occurs. Then, in order to solve this problem, FIG. 3 is a schematic diagram of a third process of the charging method in the embodiment of the present invention. Referring to FIG. 3, after the foregoing S102, the method further includes:
S301:当剩余电量小于或等于第二预设门限值时,检测电源的输出电压值;S301: When the remaining power is less than or equal to the second preset threshold, detecting an output voltage value of the power source;
这里,终端在S102检测到电源当前的剩余电量之后,判断该剩余电量是否小于或者等于第二预设门限值,其中,第二预设门限值大于第一预设门限值,并与第一预设门限值之差小于预设值,也就是说第一预设门限值在第一预设门限值附近,比如,第一预设门限值为25%,第二预设门限值就可以为30%;第一预设门限值为20%,第二预设门限值就可以为23%,当然,还可以有其它情况,本发明实施例不做具体限定。当剩余电量小于或等于第二预设门限值时,终端检测电源的输出电压值。Here, after detecting the current remaining power of the power source, the terminal determines whether the remaining power is less than or equal to a second preset threshold, where the second preset threshold is greater than the first preset threshold, and The difference between the first preset threshold is less than the preset value, that is, the first preset threshold is near the first preset threshold, for example, the first preset threshold is 25%, and the second pre- The threshold value may be set to 30%; the first preset threshold is 20%, and the second preset threshold may be 23%. Of course, there may be other cases, which are not specifically limited in the embodiment of the present invention. . When the remaining power is less than or equal to the second preset threshold, the terminal detects the output voltage value of the power source.
S302:根据输出电压值和充电电流的映射关系,确定对应的限流电流;S302: Determine a corresponding current limiting current according to a mapping relationship between the output voltage value and the charging current;
S303:当外部设备接入时,以限流电流对外部设备进行充电。S303: When the external device is connected, the external device is charged with the current limiting current.
这里S302至S303可以为,由于电源在不同剩余电量的情况下,输出电压值也不同,那么,为了防止输出电压在外部设备接入的瞬间被拉低,在当剩余电量到达第二预设门限后,根据输出电压值和充电电流的映射关系,确定对应的限流电流,使得终端的输出电流被配置为限流电流,如此,当外部设备接入终端时,终端就可以以限流电流对外部设备进行充电。Here, S302 to S303 may be that, since the output voltage value is different under the condition that the power source is different in the remaining power, then, in order to prevent the output voltage from being pulled low at the moment when the external device is accessed, when the remaining power reaches the second preset threshold After that, according to the mapping relationship between the output voltage value and the charging current, the corresponding current limiting current is determined, so that the output current of the terminal is configured as a current limiting current. Thus, when the external device accesses the terminal, the terminal can use the current limiting current pair. The external device is charging.
在实际应用中,上述输出电压值和充电电流的映射关系就可以为输出电压值与充电电流值一一映射,也可以为输出电压值与充电电流阶梯映射,也就是说,一个输出电流值映射一个充电电流的取值范围,当然,还可以有其它情况,本发明是实力不做具体限定。In practical applications, the mapping relationship between the output voltage value and the charging current may be one-to-one mapping between the output voltage value and the charging current value, or may be a mapping of the output voltage value and the charging current step, that is, an output current value mapping. The range of the value of a charging current, of course, there may be other cases, the strength of the present invention is not specifically limited.
在一实施例中,在外部设备接入时进行限流处理后,终端还可以根据自身的剩余电量决定是否恢复满载充电。那么,在S303之后,上述方法还可以包括:检测当前的剩余电量;判断剩余电量是否小于第三预设门限值;如果剩余电量大于或者等于第三预设门限值,以额定输出电流对外部设备 进行充电。In an embodiment, after the current limiting process is performed when the external device is accessed, the terminal may further determine whether to resume full-load charging according to the remaining power of the terminal. Then, after S303, the method may further include: detecting a current remaining power; determining whether the remaining power is less than a third preset threshold; and if the remaining power is greater than or equal to a third preset threshold, the rated output current is external device Charge it.
这里,终端在对外部设备接入一段时间,如3s、5s之后,再次检测当前的剩余电量,判断剩余电量是否小于第三预设门限值,这里,第三预设门限值可以与第一预设门限值一致,也可以为大于预设第一门限值,那么,如果剩余电量大于或者等于第三预设门限值,则表明终端的剩余电量足以满载为外部设备充电,那么,终端以额定输出电流对外部设备进行充电。Here, after the terminal accesses the external device for a period of time, such as 3s and 5s, the terminal detects the current remaining power again, and determines whether the remaining power is less than the third preset threshold. Here, the third preset threshold may be If the preset threshold is consistent, it may be greater than the preset first threshold. If the remaining power is greater than or equal to the third preset threshold, it indicates that the remaining power of the terminal is sufficient to fully charge the external device. The terminal charges the external device with the rated output current.
在具体实施过程中,在S303之后,终端还可以执行S103至S106。In a specific implementation process, after S303, the terminal may further perform S103 to S106.
在本发明实施例中,通过在第一预设门限,即对外充电截止门限值附近设置第二预设门限值,当剩余电量小于或等于第二预设门限值时,检测电源的输出电压值,然后,根据输出电压值和充电电流的映射关系,确定对应的限流电流,并在外部设备接入时,以限流电流对外部设备进行充电,如此,避免了在大负载的外部设备接入时,终端电源的输出电压被瞬间拉低,从而导致终端花屏或者硬件关机的故障出现。进一步地,在外部设备的充电稳定后,判断剩余电量是否大于第三预设门限值,也就是说判断终端的剩余电量是否能够对外部设备进行满载充电,若是,则以电源的额定输出电流对外部设备充电,以提高终端对外充电的效率。In the embodiment of the present invention, the second preset threshold is set in the vicinity of the first preset threshold, that is, the external charging cutoff threshold, and when the remaining power is less than or equal to the second preset threshold, the power is detected. Output voltage value, and then, according to the mapping relationship between the output voltage value and the charging current, determine the corresponding current limiting current, and when the external device is connected, the external device is charged with the current limiting current, thus avoiding the large load When an external device is connected, the output voltage of the terminal power supply is instantaneously pulled down, resulting in a failure of the terminal screen or hardware shutdown. Further, after the charging of the external device is stabilized, it is determined whether the remaining power is greater than a third preset threshold, that is, whether the remaining power of the terminal can be fully charged to the external device, and if so, the rated output current of the power source Charge the external device to improve the efficiency of the terminal's external charging.
基于同一发明构思,本发明实施例提供了一种充电装置,应用于上述一个或者多个实施例所述的终端中。Based on the same inventive concept, an embodiment of the present invention provides a charging apparatus, which is applied to the terminal described in one or more embodiments.
图4为本发明实施例中的充电装置的结构示意图,参见图4所示,该装置400包括:第一检测单元401,配置为当第一预设时长到达时,检测终端是否处于休眠状态;还配置为当第二预设时长达到时,返回检测终端是否处于休眠状态的步骤;第二检测单元402,配置为如果终端处于休眠状态,唤醒终端,检测终端的电源当前的剩余电量;第一确定单元403,配置为当剩余电量大于第一预设门限值时,按照预设规则,根据剩余电量确定第二预设时长;第一控制单元404,配置为控制终端再次进入休眠状态,并以第二预设时长启动计时。4 is a schematic structural diagram of a charging apparatus according to an embodiment of the present invention. As shown in FIG. 4, the apparatus 400 includes: a first detecting unit 401 configured to detect whether a terminal is in a sleep state when a first preset duration arrives; The method further includes: when the second preset duration is reached, returning to the step of detecting whether the terminal is in a dormant state; the second detecting unit 402 is configured to wake up the terminal and detect the current remaining power of the power of the terminal if the terminal is in the dormant state; The determining unit 403 is configured to: when the remaining power is greater than the first preset threshold, determine a second preset duration according to the preset power according to the preset rule; the first control unit 404 is configured to control the terminal to enter the sleep state again, and The timing is started with the second preset duration.
在本发明其它实施例中,第一确定单元403,配置为获取电源的总电量,计算总电量与外部设备功耗的比值;计算剩余电量与第一预设门限值的差 值百分比;计算差值百分比与比值的乘积,将乘积作为第二预设时长。In other embodiments of the present invention, the first determining unit 403 is configured to obtain a total power of the power source, calculate a ratio of the total power to the power consumption of the external device, and calculate a difference between the remaining power and the first preset threshold. The percentage of the value; the product of the difference percentage and the ratio is calculated, and the product is taken as the second preset duration.
在本发明其它实施例中,第一控制单元404,配置为在第二检测单元检测终端的电源当前的剩余电量之后,当剩余电量小于或等于第一预设门限值时,停止对外部设备充电。In other embodiments of the present invention, the first control unit 404 is configured to stop the external device when the second detecting unit detects the current remaining power of the power source of the terminal, and when the remaining power is less than or equal to the first preset threshold. Charging.
在本发明其它实施例中,上述装置,还包括:第三检测单元、第二确定单元以及第二控制单元;其中,第三检测单元,配置为在第二检测单元检测终端的电源当前的剩余电量之后,当剩余电量小于或等于第二预设门限值时,检测电源的输出电压值;第二确定单元,配置为根据输出电压值和充电电流的映射关系,确定对应的限流电流;第二控制单元,配置为当外部设备接入时,以限流电流对外部设备进行充电。In other embodiments of the present invention, the apparatus further includes: a third detecting unit, a second determining unit, and a second control unit; wherein the third detecting unit is configured to detect, at the second detecting unit, the current remaining power of the terminal After the power is discharged, when the remaining power is less than or equal to the second preset threshold, the output voltage value of the power source is detected; and the second determining unit is configured to determine a corresponding current limiting current according to the mapping relationship between the output voltage value and the charging current; The second control unit is configured to charge the external device with a current limiting current when the external device is accessed.
在本发明其它实施例中,第二检测单元,还配置为在第二控制单元以限流电流对外部设备进行充电之后,检测当前的剩余电量;判断剩余电量是否小于第三预设门限值;第二控制单元,还配置为如果剩余电量大于或者等于第三预设门限值,以额定输出电流对外部设备进行充电。In another embodiment of the present invention, the second detecting unit is further configured to: after the second control unit charges the external device with the current limiting current, detect the current remaining power; and determine whether the remaining power is less than the third preset threshold. The second control unit is further configured to charge the external device with the rated output current if the remaining power is greater than or equal to the third preset threshold.
实际应用时,所述第一检测单元401、第二检测单元402、第一确定单元403、第一控制单元404、第三检测单元、第二确定单元以及第二控制单元可由充电装置中的处理器实现。当然,处理器需要读取存储在存储介质中的指令来实现其功能。In practical applications, the first detecting unit 401, the second detecting unit 402, the first determining unit 403, the first control unit 404, the third detecting unit, the second determining unit, and the second control unit may be processed by the charging device. Implemented. Of course, the processor needs to read the instructions stored in the storage medium to perform its functions.
这里需要指出的是:以上装置实施例项的描述,与上述方法描述是类似的,具有同方法实施例相同的有益效果,因此不做赘述。对于本发明装置实施例中未披露的技术细节,本领域的技术人员请参照本发明方法实施例的描述而理解,为节约篇幅,这里不再赘述。It should be noted here that the description of the above device embodiment items is similar to the above method description, and has the same beneficial effects as the method embodiments, and therefore will not be described again. For the technical details that are not disclosed in the embodiments of the present invention, those skilled in the art should refer to the description of the method embodiments of the present invention, and the details are not described herein.
基于同一发明构思,本发明实施例提供了一种终端,与上述一个或者多个实施例中的终端一致。图5为本发明实施例中的终端的结构示意图,参见图5所示,该终端500可以包括:至少一个处理器501、至少一个通信总线502、用户接口503、至少一个外部通信接口504和存储器505。其中,通信总线502配置为实现这些组件之间的连接通信。其中,用户接口503可以包括显示屏(Display)和键盘(Keyboard)。外部通信接口504可选的 可以包括标准的有线接口和无线接口。存储器505至少存储有计算机程序,以便处理器501运行所述计算机程序时,执行前述方法的步骤。Based on the same inventive concept, an embodiment of the present invention provides a terminal that is consistent with a terminal in one or more of the foregoing embodiments. FIG. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention. Referring to FIG. 5, the terminal 500 may include: at least one processor 501, at least one communication bus 502, a user interface 503, at least one external communication interface 504, and a memory. 505. Among them, the communication bus 502 is configured to implement connection communication between these components. The user interface 503 can include a display and a keyboard. External communication interface 504 is optional It can include standard wired and wireless interfaces. The memory 505 stores at least a computer program such that when the processor 501 runs the computer program, the steps of the foregoing method are performed.
具体地,所述处理器501配置为运行所述计算机程序时,执行:Specifically, the processor 501 is configured to execute when the computer program is executed:
当第一预设时长到达时,检测终端是否处于休眠状态;如果终端处于休眠状态,唤醒终端,检测终端的电源当前的剩余电量;当剩余电量大于第一预设门限值时,按照预设规则,根据剩余电量确定第二预设时长;控制终端再次进入休眠状态,并以第二预设时长启动计时;当第二预设时长达到时,返回检测终端是否处于休眠状态的步骤。When the first preset duration arrives, detecting whether the terminal is in a dormant state; if the terminal is in a dormant state, waking up the terminal, detecting the current remaining power of the terminal power; when the remaining power is greater than the first preset threshold, according to the preset The rule determines the second preset duration according to the remaining power; the control terminal enters the sleep state again, and starts timing with the second preset duration; when the second preset duration reaches, returns to the step of detecting whether the terminal is in the sleep state.
在本发明其它实施例中,处理器501配置为运行所述计算机程序时,执行:获取电源的总电量,计算总电量与外部设备功耗的比值;计算剩余电量与第一预设门限值的差值百分比;计算差值百分比与比值的乘积,将乘积作为第二预设时长。In other embodiments of the present invention, the processor 501 is configured to: when the computer program is executed, perform: obtaining a total power of the power source, calculating a ratio of the total power to the power consumption of the external device; calculating the remaining power and the first preset threshold The percentage difference; the product of the difference percentage and the ratio is calculated, and the product is taken as the second preset duration.
在本发明其它实施例中,处理器501配置为运行所述计算机程序时,执行:在第二检测单元检测终端的电源当前的剩余电量之后,当剩余电量小于或等于第一预设门限值时,停止对外部设备充电。In another embodiment of the present invention, when the processor 501 is configured to run the computer program, after the second detecting unit detects the current remaining power of the power source of the terminal, when the remaining power is less than or equal to the first preset threshold When it stops charging the external device.
在本发明其它实施例中,处理器501配置为运行所述计算机程序时,执行:在第二检测单元检测终端的电源当前的剩余电量之后,当剩余电量小于或等于第二预设门限值时,检测电源的输出电压值;根据输出电压值和充电电流的映射关系,确定对应的限流电流;当外部设备接入时,以限流电流对外部设备进行充电。In other embodiments of the present invention, when the processor 501 is configured to run the computer program, after the second detecting unit detects the current remaining power of the power of the terminal, when the remaining power is less than or equal to the second preset threshold The output voltage value of the power source is detected; the corresponding current limiting current is determined according to the mapping relationship between the output voltage value and the charging current; when the external device is connected, the external device is charged with the current limiting current.
在本发明其它实施例中,处理器501配置为运行所述计算机程序时,执行:在第二控制单元以限流电流对外部设备进行充电之后,检测当前的剩余电量;判断剩余电量是否小于第三预设门限值;如果剩余电量大于或者等于第三预设门限值,以额定输出电流对外部设备进行充电。In other embodiments of the present invention, the processor 501 is configured to: when the computer program is executed, perform: after the second control unit charges the external device with the current limiting current, detect the current remaining power; and determine whether the remaining power is less than the Three preset thresholds; if the remaining power is greater than or equal to the third preset threshold, the external device is charged at the rated output current.
在实际应用中,上述处理器可以为特定用途集成电路(ASIC,Application Specific Integrated Circuit)、数字信号处理器(DSP,Digital Signal Processor)、数字信号处理装置(DSPD,Digital Signal Processing Device)、可编程逻辑装置(PLD,Programmable Logic Device)、现场可编程门阵列(FPGA,Field Programmable Gate Array)、中央处理器(CPU,Central  Processing Unit)、控制器、微控制器、微处理器中的至少一种;可以理解地,配置为实现上述处理器的功能的电子器件还可以为其它器件,本发明实施例不作具体限定。In practical applications, the processor may be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), and a programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), CPU (Central) At least one of the processing unit), the controller, the microcontroller, and the microprocessor; the electronic device configured to implement the functions of the processor may be other devices, which are not specifically limited in the embodiment of the present invention.
这里需要指出的是:以上终端实施例项的描述,与上述方法描述是类似的,具有同方法实施例相同的有益效果,因此不做赘述。对于本发明终端实施例中未披露的技术细节,本领域的技术人员请参照本发明方法实施例的描述而理解,为节约篇幅,这里不再赘述。It should be noted here that the description of the above terminal embodiment item is similar to the above method description, and has the same beneficial effects as the method embodiment, and therefore will not be described again. For the technical details that are not disclosed in the embodiment of the present invention, those skilled in the art should refer to the description of the method embodiment of the present invention, and the details are not described herein.
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本发明的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。应理解,在本发明的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。It is to be understood that the phrase "one embodiment" or "an embodiment" or "an" Thus, "in one embodiment" or "in an embodiment" or "an" In addition, these particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present invention, the size of the sequence numbers of the above processes does not mean the order of execution, and the order of execution of each process should be determined by its function and internal logic, and should not be taken to the embodiments of the present invention. The implementation process constitutes any limitation. The serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其它变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其它要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It is to be understood that the term "comprises", "comprising", or any other variants thereof, is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes those elements. It also includes other elements not explicitly listed, or elements that are inherent to such a process, method, article, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, or direct coupling, or communication connection of the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms. of.
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的, 作为单元显示的部件可以是、或也可以不是物理单元;既可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated. The components displayed as the unit may be, or may not be, physical units; they may be located in one place or on multiple network units; some or all of the units may be selected according to actual needs to implement the solution of the embodiment. purpose.
另外,在本发明各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; The unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。It will be understood by those skilled in the art that all or part of the steps of implementing the foregoing method embodiments may be performed by hardware related to program instructions. The foregoing program may be stored in a computer readable storage medium, and when executed, the program includes The foregoing steps of the method embodiment; and the foregoing storage medium includes: a removable storage device, a read only memory (ROM), a magnetic disk, or an optical disk, and the like, which can store program codes.
或者,本发明上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, the above-described integrated unit of the present invention may be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a standalone product. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions. A computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention. The foregoing storage medium includes various media that can store program codes, such as a mobile storage device, a ROM, a magnetic disk, or an optical disk.
基于此,本发明实施例还提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时上述方法的步骤。Based on this, an embodiment of the present invention further provides a storage medium on which a computer program is stored, the steps of the foregoing method being executed by the processor.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.
工业实用性Industrial applicability
本发明实施例提供的方案,当第一预设时长到达时,检测终端是否处 于休眠状态,如果终端处于休眠状态,唤醒终端,检测终端的电源当前的剩余电量,通过唤醒终端,并更新处于休眠状态的电源的当前剩余电量,避免了在终端处于休眠状态且剩余电量小于或等于第一预设门限值时,未及时停止对外部设备充电而导致防止电源过度放电;同时,当剩余电量大于第一预设门限值时,按照预设规则,根据剩余电量确定第二预设时长,控制终端再次进入休眠状态,并启动第二预设时长,等第二预设时长到达时,返回检测终端是否处于休眠状态的步骤,可见,终端在处于休眠状态时能够更新电源的剩余电量,实现了合理的唤醒时间,保证了终端的节能。 The solution provided by the embodiment of the present invention detects whether the terminal is located when the first preset duration arrives. In the sleep state, if the terminal is in the sleep state, wake up the terminal, detect the current remaining power of the power of the terminal, wake up the terminal, and update the current remaining power of the power source in the sleep state, thereby avoiding that the terminal is in the sleep state and the remaining power is less than or When the first preset threshold is equal to the first, the external device is not stopped in time to prevent the power from being over-discharged. At the same time, when the remaining power is greater than the first preset threshold, the second power is determined according to the preset rule. The preset duration, the control terminal enters the sleep state again, and starts the second preset duration. When the second preset duration arrives, the step of detecting whether the terminal is in the sleep state is returned. It can be seen that the terminal can update the power supply when in the sleep state. The remaining power achieves a reasonable wake-up time and ensures energy saving of the terminal.

Claims (11)

  1. 一种充电方法,包括:A charging method comprising:
    当第一预设时长到达时,检测终端是否处于休眠状态;When the first preset duration arrives, detecting whether the terminal is in a dormant state;
    如果所述终端处于休眠状态,唤醒所述终端,检测所述终端的电源当前的剩余电量;If the terminal is in a sleep state, wake up the terminal, and detect a current remaining power of the power of the terminal;
    当所述剩余电量大于第一预设门限值时,按照预设规则,根据所述剩余电量确定第二预设时长;When the remaining power is greater than the first preset threshold, determining a second preset duration according to the remaining power according to a preset rule;
    控制所述终端再次进入休眠状态,并以所述第二预设时长启动计时;Controlling the terminal to enter a sleep state again, and starting timing with the second preset duration;
    当所述第二预设时长达到时,返回检测终端是否处于休眠状态的步骤。When the second preset duration is reached, returning to the step of detecting whether the terminal is in a sleep state.
  2. 根据权利要求1所述的方法,其中,所述按照预设规则,根据所述剩余电量确定第二预设时长,包括:The method according to claim 1, wherein the determining, according to the preset rule, the second preset duration according to the remaining power, comprises:
    获取所述电源的总电量,计算所述总电量与所述外部设备的充电电流的比值;Obtaining a total power of the power source, and calculating a ratio of the total power amount to a charging current of the external device;
    计算所述剩余电量与所述第一预设门限值的差值百分比;Calculating a percentage difference between the remaining power and the first preset threshold;
    计算所述差值百分比与所述比值的乘积,将所述乘积作为所述第二预设时长。Calculating a product of the difference percentage and the ratio, and using the product as the second preset duration.
  3. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:
    当所述剩余电量小于或等于所述第一预设门限值时,停止对所述外部设备充电。When the remaining power is less than or equal to the first preset threshold, the charging of the external device is stopped.
  4. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:
    当所述剩余电量小于或等于第二预设门限值时,检测所述电源的输出电压值;Detecting an output voltage value of the power source when the remaining power is less than or equal to a second preset threshold;
    根据所述输出电压值和充电电流的映射关系,确定对应的限流电流;Determining a corresponding current limiting current according to a mapping relationship between the output voltage value and a charging current;
    当所述外部设备接入时,以所述限流电流对所述外部设备进行充电。When the external device is accessed, the external device is charged with the current limiting current.
  5. 根据权利要求4所述的方法,其中,所述方法还包括:The method of claim 4 wherein the method further comprises:
    所述以所述限流电流对所述外部设备进行充电之后,检测当前的剩余 电量;After the charging device is used to charge the external device, detecting the current remaining Electricity
    判断所述剩余电量是否小于第三预设门限值;Determining whether the remaining power is less than a third preset threshold;
    如果所述剩余电量大于或者等于所述第三预设门限值,以额定输出电流对所述外部设备进行充电。If the remaining power is greater than or equal to the third preset threshold, the external device is charged with a rated output current.
  6. 一种充电装置,包括:A charging device comprising:
    第一检测单元,配置为当第一预设时长到达时,检测终端是否处于休眠状态;还配置为当第二预设时长达到时,返回检测终端是否处于休眠状态的步骤;The first detecting unit is configured to detect whether the terminal is in a sleep state when the first preset duration arrives, and is configured to return to the step of detecting whether the terminal is in a sleep state when the second preset duration is reached;
    第二检测单元,配置为如果所述终端处于休眠状态,唤醒所述终端,检测所述终端的电源当前的剩余电量;a second detecting unit, configured to wake up the terminal and detect a current remaining power of the power of the terminal if the terminal is in a sleep state;
    第一确定单元,配置为当所述剩余电量大于第一预设门限值时,按照预设规则,根据所述剩余电量确定所述第二预设时长;The first determining unit is configured to: when the remaining power is greater than the first preset threshold, determine the second preset duration according to the remaining power according to a preset rule;
    第一控制单元,配置为控制所述终端再次进入休眠状态,并以所述第二预设时长启动计时。The first control unit is configured to control the terminal to enter the sleep state again, and start timing with the second preset duration.
  7. 根据权利要求6所述的装置,其中,所述第一确定单元,配置为获取所述电源的总电量,计算所述总电量与所述外部设备功耗的比值;计算所述剩余电量与所述第一预设门限值的差值百分比;计算所述差值百分比与所述比值的乘积,将所述乘积作为所述第二预设时长。The device according to claim 6, wherein the first determining unit is configured to acquire a total amount of power of the power source, calculate a ratio of the total amount of power to a power consumption of the external device, and calculate the remaining amount of power and a percentage difference of the first preset threshold value; calculating a product of the difference percentage and the ratio, and using the product as the second preset duration.
  8. 根据权利要求6所述的装置,其中,所述第一控制单元,配置为当所述剩余电量小于或等于所述第一预设门限值时,停止对所述外部设备充电。The apparatus according to claim 6, wherein the first control unit is configured to stop charging the external device when the remaining power is less than or equal to the first preset threshold.
  9. 根据权利要求6所述的装置,其中,所述装置还包括:第三检测单元、第二确定单元以及第二控制单元;其中,The apparatus according to claim 6, wherein the apparatus further comprises: a third detecting unit, a second determining unit, and a second control unit; wherein
    所述第三检测单元,配置为在当所述剩余电量小于或等于第二预设门限值时,检测所述电源的输出电压值;The third detecting unit is configured to detect an output voltage value of the power source when the remaining power is less than or equal to a second preset threshold;
    所述第二确定单元,配置为根据所述输出电压值和充电电流的映射关系,确定对应的限流电流;The second determining unit is configured to determine a corresponding current limiting current according to a mapping relationship between the output voltage value and a charging current;
    所述第二控制单元,配置为当所述外部设备接入时,以所述限流电流 对所述外部设备进行充电。The second control unit is configured to use the current limiting current when the external device is connected The external device is charged.
  10. 根据权利要求9所述的装置,其中,所述第二检测单元,还配置为在所述第二控制单元以所述限流电流对所述外部设备进行充电之后,检测当前的剩余电量;判断所述剩余电量是否小于第三预设门限值;The apparatus according to claim 9, wherein the second detecting unit is further configured to detect a current remaining power after the second control unit charges the external device with the current limiting current; Whether the remaining power is less than a third preset threshold;
    所述第二控制单元,还配置为如果所述剩余电量大于或者等于所述第三预设门限值,以额定输出电流对所述外部设备进行充电。The second control unit is further configured to charge the external device with a rated output current if the remaining power is greater than or equal to the third preset threshold.
  11. 一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至5任一项所述方法的步骤。 A storage medium having stored thereon a computer program, the computer program being executed by a processor to perform the steps of the method of any one of claims 1 to 5.
PCT/CN2017/112391 2016-12-14 2017-11-22 Charging method and apparatus, and storage medium WO2018107947A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611152372.1A CN108232346B (en) 2016-12-14 2016-12-14 Charging method and device
CN201611152372.1 2016-12-14

Publications (1)

Publication Number Publication Date
WO2018107947A1 true WO2018107947A1 (en) 2018-06-21

Family

ID=62557925

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/112391 WO2018107947A1 (en) 2016-12-14 2017-11-22 Charging method and apparatus, and storage medium

Country Status (2)

Country Link
CN (1) CN108232346B (en)
WO (1) WO2018107947A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110278147A (en) * 2019-06-20 2019-09-24 深圳市中创工业互联网有限公司 A kind of power-saving method of gateway, device and economize on electricity gateway
CN117078326A (en) * 2023-10-17 2023-11-17 深圳鹏城新能科技有限公司 Lease charging method, system and medium for photovoltaic energy storage device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102180096A (en) * 2010-01-15 2011-09-14 通用汽车环球科技运作有限责任公司 Method of monitoring vehicle batteries
CN103455126A (en) * 2013-09-16 2013-12-18 贝壳网际(北京)安全技术有限公司 Method and client device for determining residual service life of battery and mobile terminal
CN103970095A (en) * 2014-04-23 2014-08-06 浙江理工大学 Crop monitoring system and method based on intelligent mobile phone
CN104184179A (en) * 2013-05-28 2014-12-03 中兴通讯股份有限公司 Battery control method and device, and wireless terminal
CN104219747A (en) * 2014-09-03 2014-12-17 深圳市中兴移动通信有限公司 Method and device for adjusting wakeup time according to power information and terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5527895B2 (en) * 2010-11-18 2014-06-25 パナソニック株式会社 Secondary battery control device and control method
CN103887570B (en) * 2012-12-21 2016-03-02 联想(北京)有限公司 A kind of method for managing power supply, power-supply management system and electronic equipment
CN105490343A (en) * 2016-01-05 2016-04-13 台州台鹰电动汽车有限公司 Intelligent maintaining system and maintaining method for storage battery

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102180096A (en) * 2010-01-15 2011-09-14 通用汽车环球科技运作有限责任公司 Method of monitoring vehicle batteries
CN104184179A (en) * 2013-05-28 2014-12-03 中兴通讯股份有限公司 Battery control method and device, and wireless terminal
CN103455126A (en) * 2013-09-16 2013-12-18 贝壳网际(北京)安全技术有限公司 Method and client device for determining residual service life of battery and mobile terminal
CN103970095A (en) * 2014-04-23 2014-08-06 浙江理工大学 Crop monitoring system and method based on intelligent mobile phone
CN104219747A (en) * 2014-09-03 2014-12-17 深圳市中兴移动通信有限公司 Method and device for adjusting wakeup time according to power information and terminal

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110278147A (en) * 2019-06-20 2019-09-24 深圳市中创工业互联网有限公司 A kind of power-saving method of gateway, device and economize on electricity gateway
CN110278147B (en) * 2019-06-20 2023-10-20 深圳市中创工业互联网有限公司 Power saving method and device for gateway and power saving gateway
CN117078326A (en) * 2023-10-17 2023-11-17 深圳鹏城新能科技有限公司 Lease charging method, system and medium for photovoltaic energy storage device
CN117078326B (en) * 2023-10-17 2024-02-02 深圳鹏城新能科技有限公司 Lease charging method, system and medium for photovoltaic energy storage device

Also Published As

Publication number Publication date
CN108232346B (en) 2021-03-02
CN108232346A (en) 2018-06-29

Similar Documents

Publication Publication Date Title
US9411402B2 (en) Power control system and power control method
WO2021136383A1 (en) Charging control method and apparatus, electronic device and computer storage medium
JP2004152304A (en) System and method for holding state data of personal computer in standby state at ac power supply failure
WO2020103017A1 (en) Power-on process control method, power-on process control apparatus and terminal device
JPWO2017022169A1 (en) Battery control device, electronic device, battery pack, and battery control method
WO2018107947A1 (en) Charging method and apparatus, and storage medium
US20120042183A1 (en) Apparatus for adjusting computer power mode
US20140040649A1 (en) Charging Method and an Electronic Apparatus Using Thereof
JP6243556B2 (en) Method and apparatus for electronic device power supply
TWI579686B (en) Electronic device with power controll function
US7612536B2 (en) Pre-set discharging of batteries
US9356459B2 (en) Method for charging battery and electronic device thereof
CN101727167B (en) power switching circuit
US9124131B2 (en) Dynamic control of the power sourcing capability of a power source
US8773083B2 (en) Detection of insufficient current sourcing capability of supplied power
CN107179819B (en) Method for preventing battery from swelling and electronic device thereof
CN103257597B (en) Control method and electronic equipment
TW201415318A (en) A power management device of a touchable control system
Tsai et al. Reducing the standby power consumption of a pc monitor
CN113010004A (en) Abnormal power consumption processing method and device and electronic equipment
TW201512828A (en) Electronic device and power management method thereof
TWI489263B (en) Power manage method and system thereof
CN106325461B (en) Information processing method and electronic equipment
CN109445566B (en) OTG (on-the-go) power-saving processing method and system, storage medium and mobile terminal
JP2015222928A (en) Portable terminal, power consumption monitoring method, and power consumption monitoring program

Legal Events

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

Ref document number: 17881473

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17881473

Country of ref document: EP

Kind code of ref document: A1