CN107346905A - Method of supplying power to and device - Google Patents
- ️Tue Nov 14 2017
CN107346905A - Method of supplying power to and device - Google Patents
Method of supplying power to and device Download PDFInfo
-
Publication number
- CN107346905A CN107346905A CN201610296885.3A CN201610296885A CN107346905A CN 107346905 A CN107346905 A CN 107346905A CN 201610296885 A CN201610296885 A CN 201610296885A CN 107346905 A CN107346905 A CN 107346905A Authority
- CN
- China Prior art keywords
- power supply
- supply device
- power
- voltage
- turned Prior art date
- 2016-05-06 Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000012905 input function Methods 0.000 claims abstract description 34
- 238000001514 detection method Methods 0.000 claims description 51
- 230000000694 effects Effects 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 35
- 238000010586 diagram Methods 0.000 description 12
- 238000012545 processing Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 230000002093 peripheral effect Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000005352 clarification Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02J—CIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
- H02J7/00—Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02J—CIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
- H02J7/00—Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
- H02J7/0068—Battery or charger load switching, e.g. concurrent charging and load supply
-
- H—ELECTRICITY
- H01—ELECTRIC ELEMENTS
- H01M—PROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
- H01M10/00—Secondary cells; Manufacture thereof
- H01M10/42—Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
- H01M10/44—Methods for charging or discharging
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02E—REDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
- Y02E60/00—Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
- Y02E60/10—Energy storage using batteries
Landscapes
- Engineering & Computer Science (AREA)
- Power Engineering (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
本发明提供了一种供电方法及装置,其中,该方法包括:判断对第一供电设备进行供电的设备是否是该第一供电设备;在判断结果为是的情况下,控制第一供电设备的充电输入功能关闭和/或控制第一供电设备的供电输出功能关闭。通过本发明,解决了相关技术中存在的消耗电池电量,增大系统功耗,存在安全隐患的问题,达到了避免不必要的电量消耗以及系统功耗,提高供电设备的安全性的效果。
The present invention provides a power supply method and device, wherein the method includes: judging whether the equipment that supplies power to the first power supply equipment is the first power supply equipment; The charging input function is turned off and/or the power supply output function of the first power supply device is controlled to be turned off. The present invention solves the problems of consuming battery power, increasing system power consumption, and potential safety hazards in the related art, and achieves the effects of avoiding unnecessary power consumption and system power consumption, and improving the safety of power supply equipment.
Description
技术领域technical field
本发明涉及通信领域,具体而言,涉及一种供电方法及装置。The present invention relates to the communication field, in particular, to a power supply method and device.
背景技术Background technique
目前的移动终端中,增加充电宝功能已经比较常见,而且供电标准都需要支持BC1.2标准,一般有三种供电方式:第一种是以标准下行端口(Standard downstream port,简称为SDP)的方式向外部供电,第二种是不支持连环充电的专用充电端口(Dedicated charger port,简称为DCP)方式向外部供电,第三种是支持连环充电的DCP方式向外供电。In the current mobile terminals, it is common to add power bank functions, and the power supply standard needs to support the BC1.2 standard. Generally, there are three power supply methods: the first is the standard downstream port (SDP for short) method To supply power to the outside, the second is a dedicated charging port (Dedicated charger port, referred to as DCP) that does not support serial charging to supply power to the outside, and the third is the DCP that supports serial charging to supply power to the outside.
其中,第一种供电方式是将移动终端通过通用串行总线(Universal Serial Bus,简称为USB)的id管脚下拉,枚举为USB主设备,然后以SDP的方式给从设备供电,这种供电方式一般最高供电为5V/500mA,供电的电流较小,充电时间较长。Among them, the first power supply method is to pull down the id pin of the mobile terminal through the Universal Serial Bus (USB for short), enumerate it as a USB master device, and then supply power to the slave device in the form of SDP. The power supply mode generally has a maximum power supply of 5V/500mA, the power supply current is small, and the charging time is long.
第二种供电方式是将移动终端以DCP的方式向外供电,这种供电可以支持5V/1A、5V/2A等大电流充电,但是由于终端内部的一些因素,不支持连环充电,即给自己充电的同时不可以向外供电,这样会造成用户体验较差的问题。The second power supply method is to supply power to the mobile terminal in the form of DCP. This power supply can support high-current charging such as 5V/1A, 5V/2A, etc., but due to some internal factors in the terminal, it does not support serial charging. It is not possible to supply power to the outside while charging, which will cause poor user experience.
第三种供电方式既支持DCP供电又支持连环充电,但是连环充电的时候会存在用户误将USB的供电口连接到USB充电口的问题,这样不仅会消耗电池电量,增大系统功耗,而且会存在安全隐患。而针对该问题,目前尚未提出有效的解决方案。The third power supply method supports both DCP power supply and serial charging, but there will be a problem that the user mistakenly connects the USB power supply port to the USB charging port during serial charging, which will not only consume battery power and increase system power consumption, but also There will be safety hazards. For this problem, no effective solution has been proposed yet.
发明内容Contents of the invention
本发明实施例提供了一种供电方法及装置,以至少解决相关技术中存在的消耗电池电量,增大系统功耗,存在安全隐患的问题。Embodiments of the present invention provide a power supply method and device to at least solve the problems of battery power consumption, system power consumption increase, and potential safety hazards in the related art.
根据本发明的一个实施例,提供了一种供电方法,包括:判断对第一供电设备进行供电的设备是否是所述第一供电设备;在判断结果为是的情况下,控制所述第一供电设备的充电输入功能关闭和/或控制所述第一供电设备的供电输出功能关闭。According to an embodiment of the present invention, a power supply method is provided, including: judging whether the device that supplies power to the first power supply device is the first power supply device; if the judgment result is yes, controlling the first power supply device The charging input function of the power supply device is turned off and/or the power supply output function of the first power supply device is controlled to be turned off.
可选地,判断对所述第一供电设备进行供电的设备是否是所述第一供电设备包括:在确定对所述第一供电设备进行供电的供电方式是专用充电端口DCP时,关闭所述第一供电设备的供电输出功能;在预定时间之后,检测所述第一供电设备是否仍能接收到电能;在检测结果为不能接收到电能的情况下,确定在关闭所述第一供电设备的供电输出功能之前为所述第一供电设备进行供电的设备是所述第一供电设备;和/或,在检测结果为仍能接收到电能的情况下,确定为所述第一供电设备进行供电的设备不是所述第一供电设备。Optionally, determining whether the device that supplies power to the first power supply device is the first power supply device includes: when it is determined that the power supply mode that supplies power to the first power supply device is a dedicated charging port DCP, closing the The power supply output function of the first power supply device; after a predetermined time, detect whether the first power supply device can still receive electric energy; if the detection result is unable to receive electric energy, determine that the first power supply device is turned off The device that provided power to the first power supply device before the power supply output function is the first power supply device; and/or, in the case that the detection result is still able to receive electric energy, determine to provide power to the first power supply device The device is not the first power supply device.
可选地,上述方法还包括:通过如下方式确定对所述第一供电设备进行供电的供电方式是所述DCP:在确定成功连接了对所述第一供电设备进行供电的设备之后,在所述第一供电设备的充电输入端口的数据引脚D+上使能第一电压值的电压源,并在D-上使能第一电流值的电流源;在检测到所述D-上的电压为所述第一电压值时,关闭所述电压源和所述电流源,并在所述D-上使能第二电压值的电压源以及在所述D+上使能第二电流值的电流源;在检测到所述D+上的电压为所述第二电压值时,确定所述供电方式为所述DCP。Optionally, the above method further includes: determining that the power supply mode for supplying power to the first power supply device is the DCP in the following manner: after determining that the device that supplies power to the first power supply device is successfully connected, at the Enable the voltage source of the first voltage value on the data pin D+ of the charging input port of the first power supply device, and enable the current source of the first current value on D-; when the voltage on the D- is detected When it is the first voltage value, turn off the voltage source and the current source, and enable the voltage source of the second voltage value on the D- and enable the current of the second current value on the D+ A source; when it is detected that the voltage on D+ is the second voltage value, determine that the power supply mode is the DCP.
可选地,控制所述第一供电设备的充电输入功能关闭包括:去使能所述第一供电设备的低压差线性稳压器LDO,其中,所述LDO用于连接所述第一供电设备的充电输入端口与电池。Optionally, controlling the charging input function of the first power supply device to be turned off includes: disabling a low dropout linear regulator LDO of the first power supply device, wherein the LDO is used to connect to the first power supply device The charging input port and the battery.
可选地,在控制所述第一供电设备的充电输入功能关闭和/或控制所述第一供电设备的供电输出功能关闭之后,所述方法还包括:确定断开所述第一供电设备与对所述第一供电设备进行供电的设备的连接;开启所述第一供电设备的充电输入功能和/或供电输出功能。Optionally, after controlling the charging input function of the first power supply device to be turned off and/or controlling the power supply output function of the first power supply device to be turned off, the method further includes: determining to disconnect the first power supply device from the Connecting a device that supplies power to the first power supply device; enabling a charging input function and/or a power supply output function of the first power supply device.
根据本发明的另一个实施例,还提供了一种供电装置,包括:判断模块,用于判断对第一供电设备进行供电的设备是否是所述第一供电设备;关闭模块,用于在所述判断模块的判断结果为是的情况下,控制所述第一供电设备的充电输入功能关闭和/或控制所述第一供电设备的供电输出功能关闭。According to another embodiment of the present invention, there is also provided a power supply device, including: a judging module, configured to judge whether the device that supplies power to the first power supply device is the first power supply device; a shutdown module, configured to If the judging result of the judging module is yes, control the charging input function of the first power supply device to be turned off and/or control the power supply output function of the first power supply device to be turned off.
可选地,所述判断模块包括:关闭单元,用于在确定对所述第一供电设备进行供电的供电方式是专用充电端口DCP时,关闭所述第一供电设备的供电输出功能;检测单元,用于在预定时间之后,检测所述第一供电设备是否仍能接收到电能;第一确定单元,用于在检测结果为不能接收到电能的情况下,确定在关闭所述第一供电设备的供电输出功能之前为所述第一供电设备进行供电的设备是所述第一供电设备;和/或,在检测结果为仍能接收到电能的情况下,确定为所述第一供电设备进行供电的设备不是所述第一供电设备。Optionally, the judging module includes: a shutdown unit, configured to shut down the power supply output function of the first power supply device when it is determined that the power supply mode for supplying power to the first power supply device is a dedicated charging port DCP; the detection unit , configured to detect whether the first power supply device can still receive electric energy after a predetermined time; a first determining unit, configured to determine whether the first power supply device can still receive electric energy after the detection result is unable to receive electric energy The device that provided power to the first power supply device before the power supply output function is the first power supply device; and/or, in the case that the detection result is still able to receive electric energy, it is determined that the first power supply device performs The powered device is not the first powered device.
可选地,判断模块还包括第二确定单元,用于通过如下方式确定对所述第一供电设备进行供电的供电方式是所述DCP:在确定成功连接了对所述第一供电设备进行供电的设备之后,在所述第一供电设备的充电输入端口的数据引脚D+上使能第一电压值的电压源,并在D-上使能第一电流值的电流源;在检测到所述D-上的电压为所述第一电压值时,关闭所述电压源和所述电流源,并在所述D-上使能第二电压值的电压源以及在所述D+上使能第二电流值的电流源;在检测到所述D+上的电压为所述第二电压值时,确定所述供电方式为所述DCP。Optionally, the judging module further includes a second determining unit, configured to determine that the power supply mode for supplying power to the first power supply device is the DCP in the following manner: when it is determined that the power supply to the first power supply device is successfully connected After the device, the voltage source of the first voltage value is enabled on the data pin D+ of the charging input port of the first power supply device, and the current source of the first current value is enabled on D-; When the voltage on the D- is the first voltage value, turn off the voltage source and the current source, and enable the voltage source of the second voltage value on the D- and enable the voltage source on the D+ A current source with a second current value; when it is detected that the voltage on D+ is the second voltage value, it is determined that the power supply mode is the DCP.
可选地,所述关闭模块包括:去使能单元,用于去使能所述第一供电设备的低压差线性稳压器LDO,其中,所述LDO用于连接所述第一供电设备的充电输入端口与电池。Optionally, the shutdown module includes: a disabling unit, configured to disable a low dropout linear regulator LDO of the first power supply device, wherein the LDO is used to connect to the first power supply device Charging input port and battery.
可选地,所述装置还包括:确定模块,用于在控制所述第一供电设备的充电输入功能关闭和/或控制所述第一供电设备的供电输出功能关闭之后,确定断开所述第一供电设备与对所述第一供电设备进行供电的设备的连接;开启模块,用于开启所述第一供电设备的充电输入功能和/或供电输出功能。Optionally, the apparatus further includes: a determining module, configured to determine to disconnect the A connection between the first power supply device and a device that supplies power to the first power supply device; an enabling module, configured to enable a charging input function and/or a power supply output function of the first power supply device.
通过本发明,由于在检测出第一供电设备自充电时,会控制第一供电设备的充电输入功能关闭和/或控制第一供电设备的供电输出功能关闭,从而消除第一供电设备的自充电情况,避免了不必要的电量浪费,解决了相关技术中存在的消耗电池电量,增大系统功耗,存在安全隐患的问题,达到了避免不必要的电量消耗以及系统功耗,提高供电设备的安全性的效果。Through the present invention, when the self-charging of the first power supply device is detected, the charging input function of the first power supply device is controlled to be closed and/or the power supply output function of the first power supply device is controlled to be closed, thereby eliminating the self-charging of the first power supply device situation, avoiding unnecessary waste of power, solving the problems of battery power consumption, increasing system power consumption, and potential safety hazards in related technologies, and achieving avoidance of unnecessary power consumption and system power consumption, and improving the efficiency of power supply equipment safety effect.
附图说明Description of drawings
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described here are used to provide a further understanding of the present invention and constitute a part of the application. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations to the present invention. In the attached picture:
图1是根据本发明实施例的供电方法的流程图;Fig. 1 is a flowchart of a power supply method according to an embodiment of the present invention;
图2是根据本发明实施例的供电装置的结构框图;Fig. 2 is a structural block diagram of a power supply device according to an embodiment of the present invention;
图3是根据本发明实施例的供电装置中判断模块22的结构框图;FIG. 3 is a structural block diagram of a judging module 22 in a power supply device according to an embodiment of the present invention;
图4是根据本发明实施例的供电装置中检测单元32的结构框图;FIG. 4 is a structural block diagram of a detection unit 32 in a power supply device according to an embodiment of the present invention;
图5是根据本发明实施例的供电装置中关闭模块24的结构框图;5 is a structural block diagram of the shutdown module 24 in the power supply device according to an embodiment of the present invention;
图6是根据本发明实施例的供电装置的优选结构框图;Fig. 6 is a preferred structural block diagram of a power supply device according to an embodiment of the present invention;
图7是根据本发明实施例的充电宝的结构框图;Fig. 7 is a structural block diagram of a power bank according to an embodiment of the present invention;
图8是根据本发明实施例的充电宝设备检测到有充电设备插入时进行的检测流程图;Fig. 8 is a detection flowchart performed when the power bank device detects that a charging device is plugged in according to an embodiment of the present invention;
图9是根据本发明实施例的充电宝设备检测到有充电设备拔出时进行的检测流程图。Fig. 9 is a flow chart of detection performed when the charging treasure device detects that the charging device is pulled out according to an embodiment of the present invention.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。Hereinafter, the present invention will be described in detail with reference to the drawings and examples. It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first" and "second" in the description and claims of the present invention and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence.
在本实施例中提供了一种供电方法,图1是根据本发明实施例的供电方法的流程图,如图1所示,该流程包括如下步骤:In this embodiment, a power supply method is provided. FIG. 1 is a flowchart of a power supply method according to an embodiment of the present invention. As shown in FIG. 1, the process includes the following steps:
步骤S102,判断对第一供电设备进行供电的设备是否是该第一供电设备;Step S102, judging whether the device that supplies power to the first power supply device is the first power supply device;
步骤S104,在判断结果为是的情况下,控制第一供电设备的充电输入功能关闭和/或控制第一供电设备的供电输出功能关闭。Step S104, if the judgment result is yes, control the charging input function of the first power supply device to be turned off and/or control the power supply output function of the first power supply device to be turned off.
其中,执行上述操作的可以是第一供电设备。在上述实施例中,控制充电输入功能关闭可以包括两种情况,一种是,当在执行S102的过程中,就已经执行了关闭充电输入功能的操作时,控制充电输入功能关闭是控制充电输入功能维持关闭状态;另一种是,在执行完S102之后,充电输入功能是开启的状态时,控制充电输入功能关闭是执行对充电输入功能的关闭操作,并在关闭充电输入功能之后,维持关闭状态。同样的,控制供电输出功能关闭也可以与上述描述类型的两种情况,一种是,当在执行S102的过程中,就已经执行了关闭供电输出功能的操作时,控制供电输出功能关闭是控制供电输出功能维持关闭状态;另一种是,在执行完S102之后,供电输出功能是开启的状态时,控制供电输出功能关闭是执行对供电输出功能的关闭操作,并在关闭供电输出功能之后,维持关闭状态。Wherein, it may be the first power supply device that performs the above operations. In the above-mentioned embodiment, controlling the charging input function to be turned off may include two situations. One is, when the operation of turning off the charging input function has been performed during the execution of S102, controlling the charging input function to be turned off is to control the charging input function. The function remains closed; the other is that after the execution of S102, when the charging input function is turned on, controlling the charging input function to turn off is to execute the closing operation of the charging input function, and after turning off the charging input function, keep it off state. Similarly, controlling the shutdown of the power supply output function can also be the same as the two situations described above. One is that when the operation of turning off the power supply output function has been performed during the execution of S102, the control of the shutdown of the power supply output function is the control The power supply output function remains in the closed state; the other is that after the execution of S102, when the power supply output function is in the open state, controlling the power supply output function to close is to perform a close operation on the power supply output function, and after closing the power supply output function, Stay closed.
由上述步骤可知,在检测出第一供电设备自充电时,会控制第一供电设备的充电输入功能关闭和/或控制第一供电设备的供电输出功能关闭,从而消除第一供电设备的自充电情况,避免了不必要的电量浪费,解决了相关技术中存在的消耗电池电量,增大系统功耗,存在安全隐患的问题,达到了避免不必要的电量消耗以及系统功耗,提高供电设备的安全性的效果。It can be seen from the above steps that when the self-charging of the first power supply device is detected, the charging input function of the first power supply device is controlled to be turned off and/or the power supply output function of the first power supply device is controlled to be turned off, thereby eliminating the self-charging of the first power supply device situation, avoiding unnecessary waste of power, solving the problems of battery power consumption, increasing system power consumption, and potential safety hazards in related technologies, and achieving avoidance of unnecessary power consumption and system power consumption, and improving the efficiency of power supply equipment safety effect.
在一个可选的实施例中,上述步骤S102中,判断对第一供电设备进行供电的设备是否是第一供电设备时,可以通过如下方式进行判断:在确定对第一供电设备进行供电的供电方式是专用充电端口DCP时,关闭所述第一供电设备的供电输出功能;在预定时间之后,检测第一供电设备是否仍能接收到电能(即,判断第一供电设备是否是自充电,如果能够接收到电能,说明第一供电设备不是自充电;如果不能够接收到电能,说明第一供电设备是自充电);在检测结果为不能接收到电能的情况下,确定在关闭第一供电设备的供电输出功能之前为第一供电设备进行供电的设备是第一供电设备;和/或,在检测结果为仍能接收到电能的情况下,确定为第一供电设备进行供电的设备不是第一供电设备。其中,上述的预定时间需要根据具体情况进行设置。在本实施例中,通过判断外部供电设备的供电方式来确定第一供电设备是否有可能处于自充电的状态,并通过控制第一供电设备的供电输出功能还进一步进行确定,从而提高了确定第一供电设备是否是自充电的准确性。In an optional embodiment, in the above step S102, when judging whether the device that supplies power to the first power supply device is the first power supply device, the judgment can be made in the following manner: when determining the power supply that supplies power to the first power supply device When the method is a dedicated charging port DCP, turn off the power supply output function of the first power supply device; after a predetermined time, detect whether the first power supply device can still receive electric energy (that is, determine whether the first power supply device is self-charging, if If the power can be received, it means that the first power supply device is not self-charging; if the power cannot be received, it means that the first power supply device is self-charging); if the detection result is that the power cannot be received, it is determined that the first power supply device is turned off The device that supplied power to the first power supply device before the output function of the power supply is the first power supply device; and/or, in the case that the detection result is that it can still receive power, it is determined that the device that supplies power to the first power supply device is not the first power supply device power supply equipment. Wherein, the aforementioned predetermined time needs to be set according to specific situations. In this embodiment, it is determined whether the first power supply device may be in a self-charging state by judging the power supply mode of the external power supply device, and further determination is made by controlling the power supply output function of the first power supply device, thereby improving the determination of the second power supply device. An accuracy of whether the powered device is self-charging.
在一个可选的实施例中,确定外部供电设备的供电方式的方法可以有多种,例如,可以通过如下方式确定:在确定成功连接了对第一供电设备进行供电的设备之后,在第一供电设备的充电输入端口的数据引脚D+上使能第一电压值(例如:0.5v-0.7v)的电压源,并在D-上使能第一电流值(例如:25μa-175μa)的电流源;在检测到上述D-上的电压为第一电压值时,确定上述供电方式为DCP或充电下行端口CDP;和/或,在检测到上述D-上的电压为0时,确定上述供电方式为标准下行端口SDP;当确定上述供电方式为DCP或CDP时,可以通过如下方式继续确定具体是DCP还是CDP:关闭上述电压源和电流源,并在D-上使能第二电压值(例如:0.5v-0.7v)的电压源以及在D+上使能第二电流值(例如:50μa)的电流源;在检测到上述D+上的电压为第二电压值时,确定上述供电方式为DCP;和/或,在检测到上述D+上的电压为0时,确定上述供电方式为CDP。In an optional embodiment, there may be multiple methods for determining the power supply mode of the external power supply device. For example, it may be determined in the following manner: after it is determined that the device that Enable the voltage source of the first voltage value (for example: 0.5v-0.7v) on the data pin D+ of the charging input port of the power supply device, and enable the first current value (for example: 25μa-175μa) on D- A current source; when it is detected that the voltage on D- is the first voltage value, determine that the power supply mode is DCP or charging downlink port CDP; and/or, when it is detected that the voltage on D- is 0, determine that the above-mentioned The power supply method is the standard downlink port SDP; when it is determined that the above power supply method is DCP or CDP, you can continue to determine whether it is DCP or CDP in the following way: turn off the above voltage source and current source, and enable the second voltage value on D- (for example: 0.5v-0.7v) voltage source and a current source that enables a second current value (for example: 50μa) on D+; when it is detected that the voltage on D+ is the second voltage value, determine the above power supply mode is DCP; and/or, when it is detected that the voltage on D+ is 0, it is determined that the power supply mode is CDP.
在一个可选的实施例中,控制上述第一供电设备的充电输入功能关闭包括:去使能第一供电设备的低压差线性稳压器(low dropoutregulator,简称为LDO),其中,该LDO用于连接第一供电设备的充电输入端口与电池,在本实施例中,LDO相当于第一供电设备的充电输入功能的软开关,当LDO使能时,该第一供电设备的充电输入功能为打开;当LDO去使能时,该第一供电设备的充电输入功能为关闭。需要说明的是,采用LDO作为软开关仅是一种优选的方式,也可以采用其他的器件作为控制第一供电设备的充电输入功能开合的开关。In an optional embodiment, controlling the charging input function of the first power supply device to be turned off includes: disabling a low dropout regulator (low dropout regulator, LDO for short) of the first power supply device, wherein the LDO uses To connect the charging input port of the first power supply device to the battery, in this embodiment, the LDO is equivalent to the soft switch of the charging input function of the first power supply device. When the LDO is enabled, the charging input function of the first power supply device is open; when the LDO is disabled, the charging input function of the first power supply device is closed. It should be noted that using an LDO as a soft switch is only a preferred manner, and other devices may also be used as a switch for controlling the charging input function of the first power supply device.
在一个可选的实施例中,在控制上述第一供电设备的充电输入功能关闭和/或控制第一供电设备的供电输出功能关闭之后,上述方法还包括:确定断开上述第一供电设备与对第一供电设备进行供电的设备的连接;开启上述第一供电设备的充电输入功能和/或供电输出功能。在本实施例中,在确定第一供电设备退出自充电状态后,需要恢复第一供电设备的正常功能,即,需要将第一供电设备上关闭的功能恢复正常。In an optional embodiment, after controlling the charging input function of the first power supply device to be turned off and/or controlling the power supply output function of the first power supply device to be turned off, the method further includes: determining to disconnect the first power supply device from the Connecting a device that supplies power to the first power supply device; enabling the charging input function and/or power supply output function of the first power supply device. In this embodiment, after it is determined that the first power supply device has exited the self-charging state, it is necessary to restore the normal function of the first power supply device, that is, it is necessary to restore the disabled function of the first power supply device to normal.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is Better implementation. Based on such an understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products are stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to enable a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention.
在本实施例中还提供了一种供电装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a power supply device is also provided, which is used to implement the above embodiments and preferred implementation modes, and what has already been described will not be repeated. As used below, the term "module" may be a combination of software and/or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
图2是根据本发明实施例的供电装置的结构框图,如图2所示,该装置包括判断模块22和关闭模块24,下面对该装置进行说明。Fig. 2 is a structural block diagram of a power supply device according to an embodiment of the present invention. As shown in Fig. 2 , the device includes a judging module 22 and a closing module 24, and the device will be described below.
判断模块22,用于判断对第一供电设备进行供电的设备是否是第一供电设备;关闭模块24,连接至上述判断模块22,用于在上述判断模块22的判断结果为是的情况下,控制第一供电设备的充电输入功能关闭和/或控制第一供电设备的供电输出功能关闭。The judging module 22 is configured to judge whether the device that supplies power to the first power supply device is the first power supply device; the closing module 24 is connected to the judging module 22, and is used to determine whether the judgment result of the judging module 22 is yes, Controlling the charging input function of the first power supply device to turn off and/or controlling the power supply output function of the first power supply device to turn off.
图3是根据本发明实施例的供电装置中判断模块22的结构框图,如图3所示,该判断模块22包括关闭单元32、检测单元34和第一确定单元36,下面对该判断模块22进行说明。Fig. 3 is the structural block diagram of judging module 22 in the power supply device according to the embodiment of the present invention, as shown in Fig. 3, this judging module 22 comprises closing unit 32, detecting unit 34 and first determining unit 36, below this judging module 22 for clarification.
关闭单元32,用于在确定对第一供电设备进行供电的供电方式是专用充电端口DCP时,关闭所述第一供电设备的供电输出功能;检测单元34,连接至上述关闭单元32,用于在预定时间之后,检测第一供电设备是否仍能接收到电能;第一确定单元36,连接至上述检测单元34,用于在检测结果为不能接收到电能的情况下,确定在关闭第一供电设备的供电输出功能之前为第一供电设备进行供电的设备是第一供电设备;和/或,在检测结果为仍能接收到电能的情况下,确定为第一供电设备进行供电的设备不是第一供电设备。The closing unit 32 is configured to close the power supply output function of the first power supply equipment when it is determined that the power supply mode for supplying power to the first power supply equipment is the dedicated charging port DCP; the detection unit 34 is connected to the above closing unit 32 for After a predetermined time, detect whether the first power supply device can still receive electric energy; the first determination unit 36 is connected to the above-mentioned detection unit 34, and is used to determine whether the first power supply device is closed when the detection result is unable to receive electric energy. The device that supplies power to the first power supply device before the power supply output function of the device is the first power supply device; and/or, in the case that the detection result is still capable of receiving power, it is determined that the device that supplies power to the first power supply device is not the first power supply device 1. Power supply equipment.
图4是根据本发明实施例的供电装置中判断模块22的优选结构框图,如图4所示,该判断模块22还包括第二确定单元42,下面对该判断模块22进行说明:Fig. 4 is a preferred structural block diagram of the judging module 22 in the power supply device according to an embodiment of the present invention. As shown in Fig. 4, the judging module 22 also includes a second determining unit 42, and the judging module 22 will be described below:
第二确定单元42,连接至上述关闭单元32,用于通过如下方式确定对第一供电设备进行供电的供电方式是DCP:在确定成功连接了对第一供电设备进行供电的设备之后,在上述第一供电设备的充电输入端口的数据引脚D+上使能第一电压值的电压源,并在D-上使能第一电流值的电流源;在检测到上述D-上的电压为第一电压值时,关闭上述电压源和电流源,并在D-上使能第二电压值的电压源以及在D+上使能第二电流值的电流源;在检测到上述D+上的电压为第二电压值时,确定上述供电方式为DCP。The second determining unit 42 is connected to the above-mentioned closing unit 32, and is used to determine that the power supply method for supplying power to the first power supply device is DCP in the following manner: after determining that the device that supplies power to the first power supply device is successfully connected, in the above-mentioned The voltage source of the first voltage value is enabled on the data pin D+ of the charging input port of the first power supply device, and the current source of the first current value is enabled on D-; When a voltage value is reached, the above-mentioned voltage source and current source are turned off, and the voltage source of the second voltage value is enabled on D- and the current source of the second current value is enabled on D+; when the voltage on the above-mentioned D+ is detected to be When the second voltage value is used, it is determined that the power supply mode is DCP.
图5是根据本发明实施例的供电装置中关闭模块24的结构框图,如图5所示,该关闭模块24包括去使能单元52,下面对该去使能单元52进行说明:FIG. 5 is a structural block diagram of the shutdown module 24 in the power supply device according to an embodiment of the present invention. As shown in FIG. 5 , the shutdown module 24 includes a disabling unit 52, and the disabling unit 52 will be described below:
去使能单元52,用于去使能上述第一供电设备的低压差线性稳压器LDO,其中,该LDO用于连接第一供电设备的充电输入端口与电池。The disabling unit 52 is configured to disable the LDO of the first power supply device, wherein the LDO is used to connect the charging input port of the first power supply device to the battery.
图6是根据本发明实施例的供电装置的优选结构框图,如图6所示,该装置除包括图2所示的所有模块外,还包括确定模块62和开启模块64,下面对该装置进行说明。Fig. 6 is a preferred structural block diagram of a power supply device according to an embodiment of the present invention. As shown in Fig. 6, in addition to all the modules shown in Fig. 2, the device also includes a determination module 62 and an opening module 64, the following will describe the device Be explained.
确定模块62,连接至上述关闭模块24,用于在控制上述第一供电设备的充电输入功能关闭和/或控制第一供电设备的供电输出功能关闭之后,确定断开第一供电设备与对该第一供电设备进行供电的设备的连接;开启模块64,连接至上述确定模块62,用于开启上述第一供电设备的充电输入功能和/或供电输出功能。The determining module 62 is connected to the above-mentioned shutdown module 24, and is used to determine to disconnect the first power supply device and the The first power supply equipment connects the equipment for power supply; the opening module 64 is connected to the determination module 62 and is used to open the charging input function and/or power supply output function of the first power supply equipment.
上述的图2-图6所示的装置均可以应用于第一供电设备中,该第一供电设备可以是充电宝。The above devices shown in Figs. 2-6 can all be applied to the first power supply device, and the first power supply device can be a power bank.
下面以充电宝为例对本发明进行详细说明:The present invention will be described in detail below by taking charging treasure as an example:
图7是根据本发明实施例的充电宝的结构框图,如图7所示,该充电宝包括微处理模块72(对应于上述的关闭模块24和开启模块64)、升压输出模块74、USB检测模块76(对应于上述的判断模块22和确定模块62)、充电控制模块78、电压检测模块710以及一个输出可控的LDO 712。下面对各模块进行说明:Fig. 7 is a structural block diagram of a charging treasure according to an embodiment of the present invention. As shown in Fig. The detection module 76 (corresponding to the judgment module 22 and the determination module 62 mentioned above), the charging control module 78 , the voltage detection module 710 and an LDO 712 with a controllable output. Each module is described below:
微处理模块72可以由一个单片机或者微处理器构成(例如,中央处理器(Central Processing Unit,简称为CPU)芯片),主要进行软件指令的执行以及整个系统的控制。The micro-processing module 72 may be composed of a single-chip microcomputer or a microprocessor (for example, a central processing unit (Central Processing Unit, referred to as CPU) chip), and mainly executes software instructions and controls the entire system.
升压输出模块74以一个boost升压芯片实现,其内部可以由一个直流-直流(Direct Current-Direct Current,简称为DC-DC)升压电路实现,主要是对内部输出电压进行升压,使升压后的电压输出为标准值(例如,5V)。The boost output module 74 is implemented with a boost boost chip, and its interior can be realized by a DC-DC (Direct Current-Direct Current, referred to as DC-DC) boost circuit, mainly to boost the internal output voltage, so that The boosted voltage output is a standard value (for example, 5V).
USB检测模块76、充电控制模块78、电压检测模块710以及LDO712,这四个模块既可以以一个功能强大的充电芯片实现,也可以各自用单独芯片实现。The USB detection module 76, the charging control module 78, the voltage detection module 710 and the LDO712, these four modules can be implemented with a powerful charging chip, or can be implemented with a separate chip.
其中,上述的微处理模块72可以通过I2C总线(也可以使用其他的外设控制总线,如串行外设接口(Serial Peripheral Interface,简称为SPI),通用异步接受器/发送器(Universal AsynchronousReceiver/Transmitter,简称为UART)等)控制升压输出模块74和充电控制模块78,并通过通用目的输入输出(General Purpose InputOutput,简称为GPIO)接收来自于充电控制模块78的中断信息。升压输出模块74通过对内部电压的升压处理,使USB输出管脚Vbus可以输出5V电压,其D+及D-(图7中的DP、DM分别指USB的D+、D-)管脚进行短接,使USB输出符合BC1.2中的DCP充电协议,模拟标准适配器。USB检测模块76通过检测输入端D+及D-电压变化,对插入的USB充电类型进行区分。输出可控的LDO 712,由充电控制芯片进行控制,进行使能和禁止操作。电压检测模块710用于检测外电是否正常,通过高低电平上报给充电控制模块78。充电控制模块78通过采集电压检测模块710及USB检测模块76,通过中断反映给微处理模块72,微处理模块72进行逻辑处理后通过I2C控制充电控制模块78对LDO 712进行使能控制。Wherein, the above-mentioned microprocessing module 72 can pass through the I2C bus (other peripheral hardware control buses can also be used, such as Serial Peripheral Interface (Serial Peripheral Interface, referred to as SPI), Universal Asynchronous Receiver/Transmitter (Universal Asynchronous Receiver/Transmitter) Transmitter (abbreviated as UART) etc.) control boost output module 74 and charging control module 78, and receive interrupt information from charging control module 78 through general purpose input and output (General Purpose Input Output, abbreviated as GPIO). The boost output module 74 makes the USB output pin Vbus output a 5V voltage by boosting the internal voltage, and its D+ and D- (DP and DM in FIG. 7 refer to D+ and D- of the USB respectively) pin Short circuit, so that the USB output complies with the DCP charging protocol in BC1.2, simulating a standard adapter. The USB detection module 76 distinguishes the USB charging type inserted by detecting the voltage change of the input terminals D+ and D−. The output controllable LDO 712 is controlled by the charging control chip to enable and disable operations. The voltage detection module 710 is used to detect whether the external power is normal, and report to the charging control module 78 through high and low levels. The charging control module 78 collects the voltage detection module 710 and the USB detection module 76, and reflects it to the microprocessing module 72 through an interrupt. The microprocessing module 72 performs logic processing and then controls the charging control module 78 to enable the LDO 712 through I2C.
其中,USB检测模块76的实现电路需要按照BC1.2协议实现,其检测流程包括:Wherein, the implementation circuit of the USB detection module 76 needs to be implemented according to the BC1.2 protocol, and its detection process includes:
1.Vbus检测。为确保针对连接至USB端口的任何设备进行正确排序,可以使连接器的Vbus和GND引脚比D+和D-引脚长。这样可确保长的引脚首先与插入设备保持接触。所以,发生任何检测之前,必须首先检测到Vbus,在本系统中,是由电压检测模块710进行Vbus检测的,电压检测模块710可以由一个电压比较器实现。1. Vbus detection. To ensure proper sequencing for any device connected to the USB port, the connector's Vbus and GND pins can be made longer than the D+ and D- pins. This ensures that the long pins stay in contact with the inserted device first. Therefore, before any detection occurs, the Vbus must be detected first. In this system, the Vbus detection is performed by the voltage detection module 710, which can be realized by a voltage comparator.
2.首次检测。该检测中,终端设备(例如,上述的充电宝)区分具有充电标签的500mA以上端口(CDP和DCP)与500mA以下端口(SDP)。终端设备需要在D+上使能0.5v至0.7v电压源,在D-上使能25μa至175μa流入电流源。如果连接的是DCP或CDP,在D-上将出现0.5v至0.7v电平;如果连接的是SDP,D-电压将下降至零。终端设备切入一个比较器,将D-电压与0.25v至0.4v进行比较。如果D-电压高于0.4v但低于逻辑低电平门限0.8v,终端设备则认为有充电端口出现。2. First detection. In this detection, the terminal device (for example, the above-mentioned power bank) distinguishes between ports with charging labels above 500mA (CDP and DCP) and ports below 500mA (SDP). End equipment needs to enable a 0.5v to 0.7v voltage source on D+ and a 25µa to 175µa sink current source on D-. If a DCP or CDP is connected, a 0.5v to 0.7v level will appear on D-; if an SDP is connected, the D- voltage will drop to zero. The end device switches into a comparator that compares the D- voltage to 0.25v to 0.4v. If the D- voltage is higher than 0.4v but lower than the logic low threshold of 0.8v, the end device considers that a charging port is present.
3.二次充电器检测。在该检测中,在关闭上述2中的电压源和电流源后,终端设备需要辨别CDP和DCP。按照反序执行上述测试,在D-作用0.5v至0.7v电压源,在D+作用50μa电流源。如果连接的是DCP,D+将出现0.5v至0.7v电平;如果连接的是CDP,D+电压为零。3. Secondary charger detection. In this detection, after turning off the voltage source and current source in the above 2, the terminal device needs to distinguish the CDP and DCP. Perform the above tests in reverse order, apply a 0.5v to 0.7v voltage source on D-, and apply a 50μa current source on D+. If a DCP is connected, D+ will have a level of 0.5v to 0.7v; if a CDP is connected, the D+ voltage will be zero.
以上检测逻辑都在USB检测模块76中以硬件电路实现,在检测时,可以由微处理模块73控制检测的开始,在D+、D-移除后,USB检测模块76以逻辑电平的变化的形式反映给充电控制模块78,最终充电控制模块78通过系统中断的方式上报给微处理模块72。The above detection logics are all implemented with hardware circuits in the USB detection module 76. During detection, the start of the detection can be controlled by the microprocessing module 73. The form is reflected to the charging control module 78, and finally the charging control module 78 reports to the microprocessing module 72 through a system interruption.
上述的USB输出端口是符合BC1.2标准的DCP端口。The aforementioned USB output port is a DCP port conforming to the BC1.2 standard.
上述的LDO 712可以是一个可以输出高阻态,并进行控制的LDO模块。The aforementioned LDO 712 may be an LDO module capable of outputting a high-impedance state and performing control.
图8是根据本发明实施例的充电宝设备检测到有充电设备插入时进行的检测流程图,如图8所示,该流程包括如下步骤:Fig. 8 is a flow chart of detection performed when the power bank device detects that a charging device is plugged in according to an embodiment of the present invention. As shown in Fig. 8, the process includes the following steps:
步骤S802,默认状态下,升压输出模块74及可控的LDO 712都是打开的,所以在有外电(即,外部的充电设备)插入的时候,微处理模块72首先会读取电压检测模块710的状态,电压检测模块710检测Vbus;Step S802, by default, both the boost output module 74 and the controllable LDO 712 are turned on, so when an external power (that is, an external charging device) is plugged in, the microprocessing module 72 will first read the voltage detection module The state of 710, the voltage detection module 710 detects Vbus;
步骤S804,通过检测Vbus判断外电是否存在,若存在转至步骤S806,否则,转至步骤S818;Step S804, judge whether the external power exists by detecting Vbus, if there is, go to step S806, otherwise, go to step S818;
步骤S806,电压检测模块710通过电压比较,确认外部供电是否正常,如果正常则控制USB检测模块76对D+、D-进行检测;Step S806, the voltage detection module 710 confirms whether the external power supply is normal through voltage comparison, and if it is normal, controls the USB detection module 76 to detect D+ and D-;
步骤S808,判断外部的充电设备的充电方式是否是DCP,若是,转至步骤S810,否则,转至步骤S818;Step S808, judging whether the charging method of the external charging device is DCP, if so, go to step S810, otherwise, go to step S818;
步骤S810,当确定充电方式是DCP时,将升压输出模块74关闭50ms,其中,该50ms为可控LDO 712以及电压检测模块710两个芯片的反应时间之和(当LDO 712和电压检测模块710的反应时间之和为其他值时,需要对上述关闭时间进行相应的调整),具体可以从芯片手册中查询芯片的开关时间,上述关闭时间一般需要取开关时间最大值之和;Step S810, when it is determined that the charging mode is DCP, turn off the boost output module 74 for 50ms, wherein, the 50ms is the sum of the response times of the two chips of the controllable LDO 712 and the voltage detection module 710 (when the LDO 712 and the voltage detection module When the sum of the response time of the 710 is other values, the above closing time needs to be adjusted accordingly), and the switching time of the chip can be queried from the chip manual. The above closing time generally needs to be the sum of the maximum switching time;
步骤S812,读取电压检测模块710的状态,判断外电此时是否存在,若不存在,转至步骤S814,否则,转至步骤S816;Step S812, read the state of the voltage detection module 710, and judge whether the external power exists at this time, if not, go to step S814, otherwise, go to step S816;
步骤S814,关闭LDO 712,使其输出高阻;Step S814, closing the LDO 712 to make its output high impedance;
步骤S816,将升压输出模块74打开;Step S816, turn on the boost output module 74;
步骤S818,结束。Step S818, end.
正常状态下,系统没有检测到此时的状态时自充电状态,升压输出模块及可控LDO都是打开的,所以拔出时无论充电端或者被充电端都不进行任何处理,如果检测到上次的状态是自充电状态,此时用户将充电线拔出后,充电宝需要退出自充电状态,图9是根据本发明实施例的充电宝设备检测到有充电设备拔出时进行的检测流程图。如图9所示,该流程包括如下步骤:Under normal conditions, when the system does not detect the self-charging state at this time, the boost output module and the controllable LDO are both turned on, so no processing is performed on the charging end or the charged end when it is pulled out. The last state was the self-charging state. At this time, after the user pulls out the charging cable, the power bank needs to exit the self-charging state. Figure 9 is the detection performed when the power bank device detects that the charging device is pulled out according to the embodiment of the present invention. flow chart. As shown in Figure 9, the process includes the following steps:
步骤S902,充电宝退出自充电状态;Step S902, the power bank exits the self-charging state;
步骤S904,USB检测模块76检测到USB拔出事件后,会通过中断的方式通知微处理模块72此时有USB拔出事件;Step S904, after the USB detection module 76 detects the USB pull-out event, it will notify the microprocessing module 72 that there is a USB pull-out event by means of an interruption;
步骤S906,微处理模块72将LDO使能,使其输出正常;Step S906, the microprocessing module 72 enables the LDO to make its output normal;
步骤S908,结束。Step S908, end.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above-mentioned modules can be realized by software or hardware. For the latter, it can be realized by the following methods, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules can be combined in any combination The forms of are located in different processors.
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:The embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the above-mentioned storage medium may be configured to store program codes for performing the following steps:
S1,判断对第一供电设备进行供电的设备是否是该第一供电设备;S1. Determine whether the device that supplies power to the first power supply device is the first power supply device;
S2,在判断结果为是的情况下,控制第一供电设备的充电输入功能关闭和/或控制第一供电设备的供电输出功能关闭。S2, if the judgment result is yes, control the charging input function of the first power supply device to be turned off and/or control the power supply output function of the first power supply device to be turned off.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the above-mentioned storage medium may include but not limited to: U disk, read-only memory (Read-Only Memory, ROM for short), random access memory (Random Access Memory, RAM for short), Various media that can store program codes such as removable hard disks, magnetic disks, or optical disks.
可选地,在本实施例中,处理器根据存储介质中已存储的程序代码执行上述各方法实施例中的步骤。Optionally, in this embodiment, the processor executes the steps in the foregoing method embodiments according to the program code stored in the storage medium.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。Optionally, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementation manners, and details are not repeated in this embodiment.
通过上述实施例,当用户误将充电设备的供电输出端口接入充电输入端口后,系统会进行自检测,并通过微处理器关闭可控LDO,使系统在此场景下不存在漏电的情况,从而避免不必要的电量消耗以及系统功耗,提高供电设备的安全性。Through the above-mentioned embodiment, when the user mistakenly connects the power supply output port of the charging device to the charging input port, the system will perform self-test, and turn off the controllable LDO through the microprocessor, so that the system does not have leakage in this scenario. Therefore, unnecessary power consumption and system power consumption are avoided, and the safety of power supply equipment is improved.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that each module or each step of the above-mentioned present invention can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network formed by multiple computing devices Alternatively, they may be implemented in program code executable by a computing device so that they may be stored in a storage device to be executed by a computing device, and in some cases in an order different from that shown here The steps shown or described are carried out, or they are separately fabricated into individual integrated circuit modules, or multiple modules or steps among them are fabricated into a single integrated circuit module for implementation. As such, the present invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims (10)
1.一种供电方法,其特征在于,包括:1. A power supply method, characterized in that, comprising: 判断对第一供电设备进行供电的设备是否是所述第一供电设备;judging whether the device that supplies power to the first power supply device is the first power supply device; 在判断结果为是的情况下,控制所述第一供电设备的充电输入功能关闭和/或控制所述第一供电设备的供电输出功能关闭。If the judgment result is yes, the charging input function of the first power supply device is controlled to be turned off and/or the power supply output function of the first power supply device is controlled to be turned off. 2.根据权利要求1所述的方法,其特征在于,判断对所述第一供电设备进行供电的设备是否是所述第一供电设备包括:2. The method according to claim 1, wherein judging whether the device that supplies power to the first power supply device is the first power supply device comprises: 在确定对所述第一供电设备进行供电的供电方式是专用充电端口DCP时,关闭所述第一供电设备的供电输出功能;When it is determined that the power supply mode for supplying power to the first power supply device is a dedicated charging port DCP, turn off the power supply output function of the first power supply device; 在预定时间之后,检测所述第一供电设备是否仍能接收到电能;After a predetermined time, detecting whether the first power supply device can still receive electric energy; 在检测结果为不能接收到电能的情况下,确定在关闭所述第一供电设备的供电输出功能之前为所述第一供电设备进行供电的设备是所述第一供电设备;和/或,在检测结果为仍能接收到电能的情况下,确定为所述第一供电设备进行供电的设备不是所述第一供电设备。If the detection result is that the electric energy cannot be received, it is determined that the device that supplies power to the first power supply device before the power supply output function of the first power supply device is turned off is the first power supply device; and/or, in If the detection result is that electric energy can still be received, it is determined that the device that supplies power to the first power supply device is not the first power supply device. 3.根据权利要求2所述的方法,其特征在于,所述方法还包括:通过如下方式确定对所述第一供电设备进行供电的供电方式是所述DCP:3. The method according to claim 2, further comprising: determining that the power supply mode for supplying power to the first power supply device is the DCP in the following manner: 在确定成功连接了对所述第一供电设备进行供电的设备之后,在所述第一供电设备的充电输入端口的数据引脚D+上使能第一电压值的电压源,并在D-上使能第一电流值的电流源;After it is determined that the device that supplies power to the first power supply device is successfully connected, enable a voltage source with a first voltage value on the data pin D+ of the charging input port of the first power supply device, and enable a voltage source on D- enabling a current source of a first current value; 在检测到所述D-上的电压为所述第一电压值时,关闭所述电压源和所述电流源,并在所述D-上使能第二电压值的电压源以及在所述D+上使能第二电流值的电流源;When it is detected that the voltage on the D- is the first voltage value, the voltage source and the current source are turned off, and the voltage source of the second voltage value is enabled on the D- and the A current source of a second current value is enabled on D+; 在检测到所述D+上的电压为所述第二电压值时,确定所述供电方式为所述DCP。When it is detected that the voltage on D+ is the second voltage value, it is determined that the power supply mode is the DCP. 4.根据权利要求1所述的方法,其特征在于,控制所述第一供电设备的充电输入功能关闭包括:4. The method according to claim 1, wherein controlling the charging input function of the first power supply device to be turned off comprises: 去使能所述第一供电设备的低压差线性稳压器LDO,其中,所述LDO用于连接所述第一供电设备的充电输入端口与电池。Disabling the LDO of the first power supply device, wherein the LDO is used to connect the charging input port of the first power supply device to the battery. 5.根据权利要求1至4中任一项所述的方法,其特征在于,在控制所述第一供电设备的充电输入功能关闭和/或控制所述第一供电设备的供电输出功能关闭之后,所述方法还包括:5. The method according to any one of claims 1 to 4, characterized in that, after controlling the charging input function of the first power supply device to be turned off and/or controlling the power supply output function of the first power supply device to be turned off , the method also includes: 确定断开所述第一供电设备与对所述第一供电设备进行供电的设备的连接;determining to disconnect the first power supply device from a device that supplies power to the first power supply device; 开启所述第一供电设备的充电输入功能和/或供电输出功能。Turn on the charging input function and/or the power supply output function of the first power supply device. 6.一种供电装置,其特征在于,包括:6. A power supply device, characterized in that, comprising: 判断模块,用于判断对第一供电设备进行供电的设备是否是所述第一供电设备;A judging module, configured to judge whether the device that supplies power to the first power supply device is the first power supply device; 关闭模块,用于在所述判断模块的判断结果为是的情况下,控制所述第一供电设备的充电输入功能关闭和/或控制所述第一供电设备的供电输出功能关闭。A shutdown module, configured to control the charging input function of the first power supply device to be turned off and/or control the power supply output function of the first power supply device to be turned off when the judging result of the judging module is yes. 7.根据权利要求6所述的装置,其特征在于,所述判断模块包括:7. The device according to claim 6, wherein the judging module comprises: 关闭单元,用于在确定对所述第一供电设备进行供电的供电方式是专用充电端口DCP时,关闭所述第一供电设备的供电输出功能;A closing unit, configured to close the power supply output function of the first power supply equipment when it is determined that the power supply mode for supplying power to the first power supply equipment is a dedicated charging port DCP; 检测单元,用于在预定时间之后,检测所述第一供电设备是否仍能接收到电能;a detection unit, configured to detect whether the first power supply device can still receive electric energy after a predetermined time; 第一确定单元,用于在检测结果为不能接收到电能的情况下,确定在关闭所述第一供电设备的供电输出功能之前为所述第一供电设备进行供电的设备是所述第一供电设备;和/或,在检测结果为仍能接收到电能的情况下,确定为所述第一供电设备进行供电的设备不是所述第一供电设备。The first determination unit is configured to determine that the first power supply device is the first power supply device that supplies power to the first power supply device before the power supply output function of the first power supply device is turned off when the detection result is that power cannot be received. device; and/or, in a case where the detection result is that the power can still be received, determining that the device that supplies power to the first power supply device is not the first power supply device. 8.根据权利要求7所述的装置,其特征在于,所述判断模块还包括第二确定单元,用于通过如下方式确定对所述第一供电设备进行供电的供电方式是所述DCP:8. The device according to claim 7, wherein the judging module further comprises a second determining unit, configured to determine that the power supply mode for supplying power to the first power supply device is the DCP in the following manner: 在确定成功连接了对所述第一供电设备进行供电的设备之后,在所述第一供电设备的充电输入端口的数据引脚D+上使能第一电压值的电压源,并在D-上使能第一电流值的电流源;After it is determined that the device that supplies power to the first power supply device is successfully connected, enable a voltage source with a first voltage value on the data pin D+ of the charging input port of the first power supply device, and enable a voltage source on D- enabling a current source of a first current value; 在检测到所述D-上的电压为所述第一电压值时,关闭所述电压源和所述电流源,并在所述D-上使能第二电压值的电压源以及在所述D+上使能第二电流值的电流源;When it is detected that the voltage on the D- is the first voltage value, the voltage source and the current source are turned off, and the voltage source of the second voltage value is enabled on the D- and the A current source of a second current value is enabled on D+; 在检测到所述D+上的电压为所述第二电压值时,确定所述供电方式为所述DCP。When it is detected that the voltage on D+ is the second voltage value, it is determined that the power supply mode is the DCP. 9.根据权利要求6所述的装置,其特征在于,所述关闭模块包括:9. The device according to claim 6, wherein the closing module comprises: 去使能单元,用于去使能所述第一供电设备的低压差线性稳压器LDO,其中,所述LDO用于连接所述第一供电设备的充电输入端口与电池。The disabling unit is configured to disable the LDO of the first power supply device, wherein the LDO is used to connect the charging input port of the first power supply device to the battery. 10.根据权利要求6至9中任一项所述的装置,其特征在于,还包括:10. The device according to any one of claims 6 to 9, further comprising: 确定模块,用于在控制所述第一供电设备的充电输入功能关闭和/或控制所述第一供电设备的供电输出功能关闭之后,确定断开所述第一供电设备与对所述第一供电设备进行供电的设备的连接;A determination module, configured to determine that disconnecting the first power supply device is related to the first The connection of the equipment powered by the power supply equipment; 开启模块,用于开启所述第一供电设备的充电输入功能和/或供电输出功能。An enabling module, configured to enable the charging input function and/or the power supply output function of the first power supply device.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610296885.3A CN107346905B (en) | 2016-05-06 | 2016-05-06 | Power supply method and device |
PCT/CN2016/102321 WO2017190474A1 (en) | 2016-05-06 | 2016-10-18 | Power supply method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610296885.3A CN107346905B (en) | 2016-05-06 | 2016-05-06 | Power supply method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107346905A true CN107346905A (en) | 2017-11-14 |
CN107346905B CN107346905B (en) | 2023-01-31 |
Family
ID=60202647
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610296885.3A Active CN107346905B (en) | 2016-05-06 | 2016-05-06 | Power supply method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107346905B (en) |
WO (1) | WO2017190474A1 (en) |
Cited By (2)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108491342A (en) * | 2018-02-08 | 2018-09-04 | 青岛海信移动通信技术股份有限公司 | A kind of method and terminal carrying out access switching |
CN112702176A (en) * | 2020-12-22 | 2021-04-23 | 海光信息技术股份有限公司 | I2C bus power supply control circuit, control method and chip |
Citations (10)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002169618A (en) * | 2000-11-30 | 2002-06-14 | Ricoh Co Ltd | Constant-voltage power circuit and electronic equipment incorporating the constant-voltage power circuit |
JP2005018416A (en) * | 2003-06-26 | 2005-01-20 | Toshiba Corp | Electronic equipment and power source control method |
CN1934765A (en) * | 2004-03-29 | 2007-03-21 | 日新电机株式会社 | Uninterruptible power supply apparatus and power failure compensating system |
US20130134787A1 (en) * | 2011-11-30 | 2013-05-30 | Kazuyuki Sakakibara | Battery system |
JP2013121205A (en) * | 2011-12-06 | 2013-06-17 | Shimizu Corp | Self-sustained operation system and method of distributed power supply |
CN203387203U (en) * | 2013-05-09 | 2014-01-08 | 上海斐讯数据通信技术有限公司 | Charging switching system possessing USB on-the-go (OTG) function |
CN204578123U (en) * | 2015-02-15 | 2015-08-19 | 庄景阳 | The charge protection device of human body sensing power-off and mobile phone, portable power source, Mobile phone housing, charger, data wire |
CN104953631A (en) * | 2014-03-26 | 2015-09-30 | 中兴通讯股份有限公司 | Current control method and terminal device |
CN105140985A (en) * | 2015-08-05 | 2015-12-09 | 青岛海信移动通信技术股份有限公司 | Mobile terminal, direct-charge power adapter and charging method |
CN105449731A (en) * | 2014-09-25 | 2016-03-30 | 中兴通讯股份有限公司 | Portable power source device and charge-discharge processing method |
Family Cites Families (3)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101126781B (en) * | 2006-08-18 | 2010-11-10 | 鸿富锦精密工业(深圳)有限公司 | USB apparatus power consumption test device |
JP2010079775A (en) * | 2008-09-29 | 2010-04-08 | Nec Infrontia Corp | Usb low-order unit and usb system |
JP6024288B2 (en) * | 2012-08-27 | 2016-11-16 | 株式会社バッファロー | Information processing system and external device |
-
2016
- 2016-05-06 CN CN201610296885.3A patent/CN107346905B/en active Active
- 2016-10-18 WO PCT/CN2016/102321 patent/WO2017190474A1/en active Application Filing
Patent Citations (10)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002169618A (en) * | 2000-11-30 | 2002-06-14 | Ricoh Co Ltd | Constant-voltage power circuit and electronic equipment incorporating the constant-voltage power circuit |
JP2005018416A (en) * | 2003-06-26 | 2005-01-20 | Toshiba Corp | Electronic equipment and power source control method |
CN1934765A (en) * | 2004-03-29 | 2007-03-21 | 日新电机株式会社 | Uninterruptible power supply apparatus and power failure compensating system |
US20130134787A1 (en) * | 2011-11-30 | 2013-05-30 | Kazuyuki Sakakibara | Battery system |
JP2013121205A (en) * | 2011-12-06 | 2013-06-17 | Shimizu Corp | Self-sustained operation system and method of distributed power supply |
CN203387203U (en) * | 2013-05-09 | 2014-01-08 | 上海斐讯数据通信技术有限公司 | Charging switching system possessing USB on-the-go (OTG) function |
CN104953631A (en) * | 2014-03-26 | 2015-09-30 | 中兴通讯股份有限公司 | Current control method and terminal device |
CN105449731A (en) * | 2014-09-25 | 2016-03-30 | 中兴通讯股份有限公司 | Portable power source device and charge-discharge processing method |
CN204578123U (en) * | 2015-02-15 | 2015-08-19 | 庄景阳 | The charge protection device of human body sensing power-off and mobile phone, portable power source, Mobile phone housing, charger, data wire |
CN105140985A (en) * | 2015-08-05 | 2015-12-09 | 青岛海信移动通信技术股份有限公司 | Mobile terminal, direct-charge power adapter and charging method |
Cited By (3)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108491342A (en) * | 2018-02-08 | 2018-09-04 | 青岛海信移动通信技术股份有限公司 | A kind of method and terminal carrying out access switching |
CN112702176A (en) * | 2020-12-22 | 2021-04-23 | 海光信息技术股份有限公司 | I2C bus power supply control circuit, control method and chip |
CN112702176B (en) * | 2020-12-22 | 2022-11-29 | 海光信息技术股份有限公司 | A kind of I2C bus power supply control circuit, control method and chip |
Also Published As
Publication number | Publication date |
---|---|
CN107346905B (en) | 2023-01-31 |
WO2017190474A1 (en) | 2017-11-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2214077B1 (en) | 2018-03-21 | Method and device for charging of mobile devices |
CN103107569B (en) | 2016-01-06 | Method and device for performing system power management |
US9483093B2 (en) | 2016-11-01 | Electronic device and method for controlling a setting of a maximum consumption current |
US9201480B2 (en) | 2015-12-01 | Method and system for determining an arbitrary charging protocol in USB charging ports |
TWI497272B (en) | 2015-08-21 | Usb hub for supplying power and method thereof |
EP3086433A1 (en) | 2016-10-26 | Charging method, alternating current adaptor, charging management device and terminal |
US10241935B2 (en) | 2019-03-26 | Portable device, cable assembly, and USB system |
CN103019352B (en) | 2015-03-18 | Universal serial bus power supply method, device end device and system applying same |
US20120194124A1 (en) | 2012-08-02 | Wireless Battery Charging System |
US20130154551A1 (en) | 2013-06-20 | Charging port |
US20160372936A1 (en) | 2016-12-22 | Automatic scheme to detect Multi-Standard Charger Types |
CN105449757B (en) | 2018-03-02 | Prevent the method and device that adapter or portable power source disconnect in charging process |
US20100060233A1 (en) | 2010-03-11 | Charger with USB detection |
CN106230070B (en) | 2020-01-10 | Charging method and device |
KR20140113904A (en) | 2014-09-25 | Device Charging Over USB Using a Plurality of Handshakes |
CN105829990A (en) | 2016-08-03 | Method and apparatus for charging electronic device with USB connection |
US20160028252A1 (en) | 2016-01-28 | Multi-Standard Compliant USB Battery Charging Scheme with Detection of Host Disconnection in ACA-DOCK Mode |
CN101853970A (en) | 2010-10-06 | Method and device for charging through universal serial bus (USB) interface |
KR20160143077A (en) | 2016-12-14 | Electronic apparatus and method for controlling power supply of the same |
CN106329625B (en) | 2019-12-10 | charging method and device |
CN107346905B (en) | 2023-01-31 | Power supply method and device |
CN104953631A (en) | 2015-09-30 | Current control method and terminal device |
CN115549232A (en) | 2022-12-30 | Charging method and device of electronic equipment, electronic equipment and keyboard |
CN106774769B (en) | 2021-09-21 | Terminal working mode switching method and device and handheld terminal |
TW201814543A (en) | 2018-04-16 | Apparatus and method for USB charge and communication |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
2017-11-14 | PB01 | Publication | |
2017-11-14 | PB01 | Publication | |
2019-05-28 | SE01 | Entry into force of request for substantive examination | |
2019-05-28 | SE01 | Entry into force of request for substantive examination | |
2023-01-31 | GR01 | Patent grant | |
2023-01-31 | GR01 | Patent grant | |
2024-12-03 | TG01 | Patent term adjustment | |
2024-12-03 | TG01 | Patent term adjustment |