CN105071488B - A kind of charging method and device of the terminal with data exchanging function - Google Patents
A kind of charging method and device of the terminal with data exchanging function Download PDFInfo
- Publication number
- CN105071488B CN105071488B CN201510532478.3A CN201510532478A CN105071488B CN 105071488 B CN105071488 B CN 105071488B CN 201510532478 A CN201510532478 A CN 201510532478A CN 105071488 B CN105071488 B CN 105071488B
- Authority
- CN
- China
- Prior art keywords
- terminal
- usb interface
- data exchange
- charging
- access mode
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 238000001514 detection method Methods 0.000 claims description 23
- 230000005611 electricity Effects 0.000 claims 2
- 206010048669 Terminal state Diseases 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 238000005260 corrosion Methods 0.000 description 1
- 230000007797 corrosion Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- 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
- Charge And Discharge Circuits For Batteries Or The Like (AREA)
Abstract
本发明实施例公开了一种具有数据交换功能的终端的充电方法和装置,该方法包括:检测所述终端是否处于关机状态;当检测到所述终端处于关机状态时,关闭所述终端的USB接口的数据交换访问模式并切换为执行设备充电访问模式。本发明将检测终端是否处于关机状态作为切换终端访问模式的判断条件,不仅实现了对终端的USB接口的访问模式切换,还解决了现有技术中终端的USB接口的标识引脚短路造成的终端无法充电的问题。
The embodiment of the present invention discloses a charging method and device for a terminal with a data exchange function. The method includes: detecting whether the terminal is in the power-off state; when detecting that the terminal is in the power-off state, turning off the USB The data exchange access mode of the interface is switched to the execution device charging access mode. The present invention regards detecting whether the terminal is in the power-off state as the judgment condition for switching the terminal access mode, which not only realizes the switching of the access mode of the USB interface of the terminal, but also solves the terminal problem caused by the short circuit of the identification pin of the USB interface of the terminal in the prior art. The problem of not being able to charge.
Description
技术领域technical field
本发明涉及充电技术,尤其涉及一种具有数据交换功能的终端的充电方法和装置。The invention relates to charging technology, in particular to a charging method and device for a terminal with data exchange function.
背景技术Background technique
当前越来越多的手机等电子终端设备具备数据交换(On-The-Go,OTG)功能,具有OTG功能的终端与OTG设备连接后,可进行设备之间的通信,具有OTG功能的终端与外接电源连接后,可通过外接电源进行终端充电。At present, more and more electronic terminal devices such as mobile phones have the function of data exchange (On-The-Go, OTG). After the external power supply is connected, the terminal can be charged through the external power supply.
以手机终端为例,如图1所示为现有技术提供的手机的通用串行总线(UniversalSerial Bus,USB)接口的示意图,该USB接口具有接地引脚GND、标识引脚ID、正电压数据引脚D+、负电压数据引脚D-和电源引脚VBUS。手机对OTG设备的检测是通过USB接口的标识引脚(ID)进行OTG识别,手机对外接电源的检测是通过USB接口的电源引脚(VBUS)进行识别,因此手机可以通过USB接口准确识别外接OTG设备和外接电源。当OTG设备接入手机的USB接口时,手机的ID引脚会与OTG设备的芯片相连,实现与外接OTG设备的通信。终端的USB接口与外接OTG设备进行通信时,终端处于OTG访问模式;或者,终端的USB接口与外接电源连接以充电时,终端处于设备充电访问模式。Taking a mobile phone terminal as an example, as shown in Figure 1, it is a schematic diagram of a universal serial bus (UniversalSerial Bus, USB) interface of a mobile phone provided by the prior art, the USB interface has a ground pin GND, an identification pin ID, a positive voltage data Pin D+, negative voltage data pin D- and power pin VBUS. The mobile phone detects the OTG device through the OTG identification pin (ID) of the USB interface, and the mobile phone detects the external power supply through the power pin (VBUS) of the USB interface. Therefore, the mobile phone can accurately identify the external power supply through the USB interface. OTG device and external power supply. When the OTG device is connected to the USB interface of the mobile phone, the ID pin of the mobile phone will be connected with the chip of the OTG device to realize communication with the external OTG device. When the USB interface of the terminal communicates with an external OTG device, the terminal is in the OTG access mode; or when the USB interface of the terminal is connected to an external power supply for charging, the terminal is in the device charging access mode.
大多数终端的USB接口都是直接暴露在空气中,且外接设备频繁的插入或拔出USB接口,因此USB接口非常容易受到腐蚀或损耗而造成微短路。The USB interface of most terminals is directly exposed to the air, and external devices are frequently plugged into or pulled out of the USB interface, so the USB interface is very vulnerable to corrosion or wear and tear and cause a micro-short circuit.
具体地,以手机为例,手机USB接口的ID引脚容易被腐蚀以造成微短路,此时ID引脚与周围的金属(如GND引脚)短路。ID引脚对地阻抗正常情况下为1.5M,ID引脚识别的OTG设备的电阻范围在0~180KΩ之间,而GND引脚与ID引脚短路之后,ID引脚的微短电阻在0.1KΩ-10KΩ之间,因此手机系统会将ID引脚的短路识别为OTG设备的接入。当手机系统识别为OTG设备接入时,手机系统会通过VBUS引脚输出5V电源进行OTG检测,即在OTG访问模式下检测、识别OTG设备。若当前时刻外接电源接入手机,由于手机系统处于OTG访问模式,则手机无法实现充电功能。当手机的电量匮乏至关机时,由于ID引脚短路导致手机仍旧处于OTG访问模式,则即使接入外接电源,手机还是无法实现充电。Specifically, taking a mobile phone as an example, the ID pin of the USB interface of the mobile phone is easily corroded to cause a micro-short circuit. At this time, the ID pin is short-circuited with the surrounding metal (such as the GND pin). The impedance of the ID pin to ground is 1.5M under normal circumstances, and the resistance range of the OTG device identified by the ID pin is between 0 and 180KΩ. After the GND pin and the ID pin are short-circuited, the micro-short resistance of the ID pin is 0.1 Between KΩ-10KΩ, so the mobile phone system will recognize the short circuit of the ID pin as the access of the OTG device. When the mobile phone system recognizes that the OTG device is connected, the mobile phone system will output 5V power through the VBUS pin for OTG detection, that is, detect and identify the OTG device in the OTG access mode. If the external power supply is connected to the mobile phone at the current moment, since the mobile phone system is in the OTG access mode, the mobile phone cannot realize the charging function. When the power of the mobile phone is insufficient to shut down, the mobile phone is still in the OTG access mode due to the short circuit of the ID pin, and the mobile phone still cannot be charged even if it is connected to an external power supply.
当前大部分电子终端设备是内置电池,ID引脚短路导致终端即使在关机状态下也无法实现充电,影响用户的正常使用且给用户带来诸多不便。At present, most electronic terminal devices have built-in batteries, and the short circuit of the ID pin makes the terminal unable to charge even when the terminal is turned off, which affects the normal use of the user and brings a lot of inconvenience to the user.
发明内容Contents of the invention
本发明提供一种具有数据交换功能的终端的充电方法和装置,以解决现有技术中终端USB接口短路导致无法充电的问题。The invention provides a charging method and device for a terminal with a data exchange function to solve the problem in the prior art that the USB interface of the terminal cannot be charged due to a short circuit.
第一方面,本发明实施例提供了一种具有数据交换功能的终端的充电方法,包括:In a first aspect, an embodiment of the present invention provides a charging method for a terminal with a data exchange function, including:
检测所述终端是否处于关机状态;Detecting whether the terminal is in a power-off state;
当检测到所述终端处于关机状态时,关闭所述终端的USB接口的数据交换访问模式并切换为执行设备充电访问模式。When it is detected that the terminal is in the power-off state, the data exchange access mode of the USB interface of the terminal is turned off and switched to the device charging access mode.
第二方面,本发明实施例还提供了一种具有数据交换功能的终端的充电装置,其特征在于,包括:In the second aspect, an embodiment of the present invention also provides a charging device for a terminal with a data exchange function, which is characterized in that it includes:
终端状态检测模块,用于检测所述终端是否处于关机状态;A terminal state detection module, configured to detect whether the terminal is in a power-off state;
访问模式切换模块,用于当检测到所述终端处于关机状态时,关闭所述终端的USB接口的数据交换访问模式并切换为执行设备充电访问模式。The access mode switching module is configured to close the data exchange access mode of the USB interface of the terminal and switch to the device charging access mode when it is detected that the terminal is in the power-off state.
本发明提供的一种具有数据交换功能的终端的充电方法和装置,通过检测终端是否处关机状态,当检测到终端处于关机状态时,控制关闭终端的USB接口的数据交换访问模式,并控制切换为执行设备充电访问模式,以控制终端进行充电。本发明将检测终端是否处于关机状态作为切换终端访问模式的判断条件,不仅实现了对终端的USB接口的访问模式切换,还解决了现有技术中终端的USB接口的标识引脚短路造成的终端无法充电的问题。A charging method and device for a terminal with a data exchange function provided by the present invention, by detecting whether the terminal is in the shutdown state, when it is detected that the terminal is in the shutdown state, the data exchange access mode of the USB interface of the terminal is controlled to be turned off, and the switch is controlled. To implement the device charging access mode to control the terminal to charge. The present invention regards detecting whether the terminal is in the power-off state as the judgment condition for switching the terminal access mode, which not only realizes the switching of the access mode of the USB interface of the terminal, but also solves the terminal problem caused by the short circuit of the identification pin of the USB interface of the terminal in the prior art. The problem of not being able to charge.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图做一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为现有技术提供的手机USB接口的示意图;Fig. 1 is the schematic diagram of the mobile phone USB interface that prior art provides;
图2是本发明实施例一提供的一种具有数据交换功能的终端的充电方法的流程示意图;FIG. 2 is a schematic flowchart of a charging method for a terminal with a data exchange function provided by Embodiment 1 of the present invention;
图3是本发明实施例二提供的一种具有数据交换功能的终端的充电方法的流程示意图;3 is a schematic flowchart of a charging method for a terminal with a data exchange function provided by Embodiment 2 of the present invention;
图4是本发明实施例三提供的一种具有数据交换功能的终端的充电装置的结构示意图。FIG. 4 is a schematic structural diagram of a charging device for a terminal with a data exchange function provided by Embodiment 3 of the present invention.
具体实施方式detailed description
为使本发明的目的、技术方案和优点更加清楚,以下将参照本发明实施例中的附图,通过实施方式清楚、完整地描述本发明的技术方案,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described through implementation with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are the embodiment of the present invention. Some, but not all, embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
由现有技术可知,当具有OTG功能的终端的USB接口短路时,无论终端的USB接口有无外接OTG设备插入,终端在关机状态和开机状态下始终处于对OTG设备的检测即数据交换(OTG)访问模式,此时终端无法实现充电。It can be seen from the prior art that when the USB interface of a terminal with OTG function is short-circuited, no matter whether there is an external OTG device inserted into the USB interface of the terminal, the terminal is always in the detection of the OTG device, that is, data exchange (OTG) in the shutdown state and the power-on state. ) access mode, the terminal cannot charge at this time.
在实际操作中,具有OTG功能的终端一般都是在开机状态下进行的OTG通信,终端处于关机状态时不进行OTG通信。所以本发明通过在终端关机时关闭其OTG访问模式的方法,保证在ID引脚失效的情况下可以实现充电,降低用户的不便。In actual operation, a terminal with an OTG function generally performs OTG communication in a power-on state, and does not perform OTG communication when the terminal is in a power-off state. Therefore, the present invention ensures that charging can be realized when the ID pin is invalid by turning off the OTG access mode of the terminal when the terminal is turned off, thereby reducing user inconvenience.
实施例一Embodiment one
图2为本发明实施例一提供的一种具有数据交换功能的终端充电方法的流程示意图。该实施例的技术方案适用于具有OTG功能的终端,根据终端的开机或关机的状态,控制执行数据交换访问模式或执行设备充电访问模式的情况。终端可以为任意具有OTG功能的电子设备,典型的如手机、平板电脑等。该方法可以由具有OTG功能的终端的充电装置来执行,该装置可以采用软件和/或硬件的方式实现,配置在终端中执行。本实施例提供的具有数据交换功能的终端的充电方法具体包括:FIG. 2 is a schematic flowchart of a terminal charging method with a data exchange function provided by Embodiment 1 of the present invention. The technical solution of this embodiment is applicable to a terminal with an OTG function, and controls the execution of the data exchange access mode or the execution of the device charging access mode according to the power-on or power-off status of the terminal. The terminal can be any electronic device with an OTG function, typically such as a mobile phone, a tablet computer, and the like. The method can be executed by a charging device of a terminal having an OTG function, and the device can be implemented in software and/or hardware, and configured to be executed in the terminal. The charging method for a terminal with a data exchange function provided in this embodiment specifically includes:
S110、检测所述终端是否处于关机状态。S110. Detect whether the terminal is in a power-off state.
如上所述,终端的USB接口具有接地引脚GND、标识引脚ID、正电压数据引脚D+、负电压数据引脚D-和电源引脚VBUS。终端需要判断是否处于关机状态,以判定进入相应的数据交换访问模式或设备充电访问模式,并完成相应的操作。As mentioned above, the USB interface of the terminal has a ground pin GND, an identification pin ID, a positive voltage data pin D+, a negative voltage data pin D−, and a power supply pin VBUS. The terminal needs to determine whether it is in the shutdown state, so as to determine whether to enter the corresponding data exchange access mode or device charging access mode, and complete the corresponding operation.
本步骤通过检测终端是否处于关机状态,作为强制终端进入充电状态的判断依据,使终端在关机状态下处于设备充电访问模式。In this step, by detecting whether the terminal is in the power-off state, as a judgment basis for forcing the terminal to enter the charging state, the terminal is in the device charging access mode in the power-off state.
S120、当检测到所述终端处于关机状态时,关闭所述终端的USB接口的数据交换访问模式并切换为执行设备充电访问模式。S120. When it is detected that the terminal is in the power-off state, turn off the data exchange access mode of the USB interface of the terminal and switch to the device charging access mode.
如上所述,当检测到终端处于关机状态时,表明即使终端的USB接口接入OTG设备也无法执行OTG操作,此时强制控制关闭终端USB接口的数据交换访问模式,并控制终端的USB接口切换为执行设备充电访问模式。这样如果USB接口接入有电源设备,则终端可进行充电。As mentioned above, when it is detected that the terminal is in the shutdown state, it means that even if the USB interface of the terminal is connected to the OTG device, the OTG operation cannot be performed. At this time, the data exchange access mode of the USB interface of the terminal is forcibly controlled, and the switching of the USB interface of the terminal is controlled. Access mode for implementing device charging. In this way, if a power supply device is connected to the USB interface, the terminal can be charged.
需要说明的是,终端上设置有数据交换识别电路,该数据交换识别电路用于执行对外接OTG设备的检测、识别和访问,即数据交换识别电路执行数据交换访问模式。因此当检测到终端处于关机状态时,控制关闭终端的USB接口的数据交换访问模式即是控制关闭数据交换识别电路,使数据交换识别电路停止对OTG设备的接入检测、识别和访问。It should be noted that a data exchange identification circuit is provided on the terminal, and the data exchange identification circuit is used to perform detection, identification and access to external OTG devices, that is, the data exchange identification circuit executes a data exchange access mode. Therefore when detecting that the terminal is in the shutdown state, controlling the data exchange access mode of the USB interface of the terminal to close is to control the data exchange identification circuit to be closed, so that the data exchange identification circuit stops the access detection, identification and access to the OTG device.
本步骤中,无论USB接口短路还是正常,只要检测到终端处于关机状态,即强制终端切换为设备充电访问模式,以使在USB接口有电源设备接入时,终端可进行充电。In this step, regardless of whether the USB interface is short-circuited or normal, as long as it is detected that the terminal is powered off, the terminal is forced to switch to the device charging access mode, so that the terminal can charge when a power device is connected to the USB interface.
本实施例将检测终端是否处于关机状态作为切换终端访问模式的判断条件,不仅实现了对终端的USB接口的访问模式切换,还解决了现有技术中终端的USB接口的标识引脚短路造成的终端即使在关机状态下也无法充电的问题。In this embodiment, the detection of whether the terminal is in the power-off state is used as the judgment condition for switching the terminal access mode, which not only realizes the switching of the access mode of the USB interface of the terminal, but also solves the problem caused by the short circuit of the identification pin of the USB interface of the terminal in the prior art. The problem that the terminal cannot be charged even when it is turned off.
实施例二Embodiment two
图3为本发明实施例二提供的一种具有数据交换功能的终端充电方法的流程示意图。该方法可以由具有OTG功能的终端的充电装置来执行,该装置可以采用软件和/或硬件的方式实现,配置在终端中执行。本实施例提供的具有数据交换功能的终端的充电方法具体包括:FIG. 3 is a schematic flowchart of a terminal charging method with a data exchange function provided by Embodiment 2 of the present invention. The method can be executed by a charging device of a terminal having an OTG function, and the device can be implemented in software and/or hardware, and configured to be executed in the terminal. The charging method for a terminal with a data exchange function provided in this embodiment specifically includes:
S210、检测终端是否发送电磁波S210. Detect whether the terminal sends electromagnetic waves
当终端处于开机运行状态时,终端会发送电磁信号进行通信或者搜索附近的网络,因此可以通过检测终端是否发送电磁波来判断终端是否处于开机运行状态。When the terminal is in the power-on state, the terminal will send electromagnetic signals to communicate or search for nearby networks, so it can be determined whether the terminal is in the power-on state by detecting whether the terminal sends electromagnetic waves.
当检测到终端发送电磁波时,判定终端处于开机状态,相应的终端的USB接口执行数据交换访问模式。当检测到终端不发送电磁波时,判定终端处于关机状态,相应的控制关闭USB接口的数据交换访问模式并强制终端切换为执行设备充电访问模式,以便进行充电。When it is detected that the terminal sends electromagnetic waves, it is determined that the terminal is in a power-on state, and the corresponding USB interface of the terminal executes a data exchange access mode. When it is detected that the terminal does not send electromagnetic waves, it is determined that the terminal is in a power-off state, and the corresponding control closes the data exchange access mode of the USB interface and forces the terminal to switch to the device charging access mode for charging.
本步骤中,将终端是否发送电磁波作为检测终端是否处于关机状态的判断依据。In this step, whether the terminal sends electromagnetic waves is used as a judgment basis for detecting whether the terminal is in a power-off state.
S220、当检测到所述终端处于关机状态时,关闭终端的USB接口的数据交换访问模式并切换为执行设备充电访问模式。S220. When it is detected that the terminal is in the power-off state, turn off the data exchange access mode of the USB interface of the terminal and switch to the execution device charging access mode.
当检测到终端处于关机状态时,若当前终端已经处于设备充电访问模式,则控制终端继续执行设备充电访问模式。当检测到终端处于关机状态时,若当前终端处于数据交换访问模式,则关闭终端的USB接口的数据交换访问模式,并控制终端切换为执行设备充电访问模式。When it is detected that the terminal is in the power-off state, if the current terminal is already in the device charging access mode, the terminal is controlled to continue executing the device charging access mode. When it is detected that the terminal is in the power-off state, if the current terminal is in the data exchange access mode, then close the data exchange access mode of the USB interface of the terminal, and control the terminal to switch to the execution device charging access mode.
可选地,关闭终端的USB接口的数据交换访问模式的具体执行过程可以为:断开传输至所述终端中数据交换识别电路的使能信号,以关闭所述数据交换访问模式。Optionally, the specific implementation process of closing the data exchange access mode of the USB interface of the terminal may be: disconnecting the enable signal transmitted to the data exchange identification circuit in the terminal, so as to close the data exchange access mode.
终端控制USB接口处于数据交换访问模式具体是通过输入给数据交换识别电路一个使能信号,使数据交换识别电路处于数据交换模式。当终端控制USB接口处于设备充电访问模式时,终端需控制关闭数据交换识别电路使数据交换识别电路不再处于数据交换访问模式。因此终端可通过断开传输至数据交换识别电路的使能信号,以关闭数据交换识别电路,相应的控制关闭了数据交换访问模式。The terminal controls the USB interface to be in the data exchange access mode specifically by inputting an enable signal to the data exchange identification circuit, so that the data exchange identification circuit is in the data exchange mode. When the terminal controls the USB interface to be in the device charging access mode, the terminal needs to control to close the data exchange identification circuit so that the data exchange identification circuit is no longer in the data exchange access mode. Therefore, the terminal can close the data exchange identification circuit by disconnecting the enable signal transmitted to the data exchange identification circuit, and the corresponding control closes the data exchange access mode.
S230、在设备充电访问模式下,检测所述终端的USB接口的电源引脚的电压是否大于或等于充电电压阈值。S230. In the device charging access mode, detect whether the voltage of the power pin of the USB interface of the terminal is greater than or equal to the charging voltage threshold.
终端的USB接口切换为设备充电访问模式时,USB接口需要确认是否有电源设备接入,以在有电源设备接入时即时进行设备充电。具体地,检测USB接口电源引脚的电压信号是否大于或等于预设充电电压阈值,以确定是否充电。若USB接口的电源引脚的电压信号大于或等于充电电压阈值,可确定终端的USB接口有电源设备接入;若USB接口的电源引脚的电压信号小于充电电压阈值,可确定终端的USB接口无电源设备接入。When the USB interface of the terminal is switched to the device charging access mode, the USB interface needs to confirm whether there is a power supply device connected, so that the device can be charged immediately when the power supply device is connected. Specifically, it is detected whether the voltage signal of the power supply pin of the USB interface is greater than or equal to a preset charging voltage threshold, so as to determine whether to charge. If the voltage signal of the power pin of the USB interface is greater than or equal to the charging voltage threshold, it can be determined that the USB interface of the terminal has a power supply connected; if the voltage signal of the power pin of the USB interface is less than the charging voltage threshold, it can be determined that the USB interface of the terminal No power equipment is connected.
本步骤在设备充电访问模式下,通过检测终端的USB接口的电源引脚的电压信号是否大于或等于充电电压阈值,以确定USB接口是否接入有电源设备。In this step, in the device charging access mode, it is determined whether a power supply device is connected to the USB interface by detecting whether the voltage signal of the power pin of the USB interface of the terminal is greater than or equal to the charging voltage threshold.
S240、当检测到电源引脚的电压小于充电电压阈值,返回并继续检测终端是否发送电磁波。S240. When it is detected that the voltage of the power supply pin is lower than the charging voltage threshold, return and continue to detect whether the terminal sends electromagnetic waves.
当确定终端USB接口无电源设备接入时,可返回并继续检测终端是否发送电磁波。根据检测结果切换终端的访问模式并执行相应控制。When it is determined that no power supply device is connected to the USB interface of the terminal, it can return and continue to detect whether the terminal sends electromagnetic waves. Switch the access mode of the terminal according to the detection result and perform corresponding control.
本步骤可使得终端在USB接口短路的情况下还能够进行电源设备的接入检测,以解决现有技术中USB接口短路导致终端在关机或开机状态下均无法进入设备充电访问模式的问题。This step can enable the terminal to detect the access of the power device when the USB interface is short-circuited, so as to solve the problem in the prior art that the terminal cannot enter the device charging access mode when the USB interface is short-circuited or turned off.
S250、当检测到终端的USB接口的电源引脚的电压大于或等于充电电压阈值时,通过USB接口进行设备充电。S250. When it is detected that the voltage of the power pin of the USB interface of the terminal is greater than or equal to the charging voltage threshold, charge the device through the USB interface.
当终端的USB接口的电源引脚的电压大于或等于充电电源阈值时,说明终端USB接口有电源设备接入,此时在设备充电访问模式下,电源设备通过终端USB接口向终端充电。When the voltage of the power pin of the USB interface of the terminal is greater than or equal to the charging power threshold, it means that a power supply device is connected to the USB interface of the terminal. At this time, in the device charging access mode, the power supply device charges the terminal through the USB interface of the terminal.
需要说明的是,检测终端发送电磁波时,可判定终端处于开机状态,则终端处于数据交换模式。因此步骤S210之后还包括:S260、在数据交换访问模式下,当检测到终端USB接口的标识引脚低于低电平状态,执行与外接设备的数据交换。当终端USB接口的标识引脚低于低电平状态时,说明终端的USB接口处检测到有OTG设备接入,那么此时终端可对接入的OTG设备进行OTG检测、识别和访问,以进行与OTG设备的数据交换。It should be noted that when it is detected that the terminal sends electromagnetic waves, it can be determined that the terminal is in the power-on state, and the terminal is in the data exchange mode. Therefore, after step S210, it also includes: S260, in the data exchange access mode, when it is detected that the identification pin of the USB interface of the terminal is lower than the low level state, perform data exchange with the external device. When the identification pin of the USB interface of the terminal is lower than the low level state, it means that an OTG device is detected at the USB interface of the terminal. At this time, the terminal can perform OTG detection, identification and access to the connected OTG device to Perform data exchange with OTG devices.
本实施例还提供另一种具有数据交换功能的终端的充电方法,与本实施例的上述充电方法的区别在于:通过检测终端的电源是否断开,以检测终端是否处于关机状态。This embodiment also provides another charging method for a terminal with a data exchange function, which is different from the above charging method in this embodiment in that it detects whether the terminal is powered off by detecting whether the power supply of the terminal is off.
显而易见的,当终端处于开机状态时,终端一般都是在向其内部的各个功能模块供电,其内部的供电电源一般都是接通的,相应的终端的USB接口执行数据交换访问模式。终端处于关机状态时,终端绝大部分的功能模块都处于关闭状态,终端内部的供电电源与这些功能模块处于断开状态,因此可以通过终端内部的供电电源的断开情况判定终端的关机状态,相应的控制关闭USB接口的数据交换访问模式并强制终端切换为执行设备充电访问模式,以便进行充电。Obviously, when the terminal is in the power-on state, the terminal is generally supplying power to its internal functional modules, its internal power supply is generally connected, and the corresponding USB interface of the terminal executes data exchange access mode. When the terminal is in the shutdown state, most of the functional modules of the terminal are in the shutdown state, and the power supply inside the terminal is disconnected from these functional modules. Therefore, the shutdown status of the terminal can be judged by the disconnection of the power supply inside the terminal. The corresponding control closes the data exchange access mode of the USB interface and forces the terminal to switch to the device charging access mode for charging.
该充电方法的流程是:首先检测终端电源是否断开,具体的,可以通过检测维持终端工作时必要的功能模块的供电电源是否断开来进行判断,若是,则确定终端处于关机状态;当检测到终端处于关机状态时,关闭终端USB接口的数据交换访问模式并切换为执行设备充电访问模式;在设备充电访问模式下,检测终端的USB接口的电源引脚的电压是否大于或等于充电电压阈值;当检测到电源引脚的电压大于或等于充电电压阈值时,通过USB接口进行设备充电。The process of the charging method is: firstly, detect whether the terminal power supply is disconnected, specifically, it can be judged by detecting whether the power supply of the functional modules necessary to maintain the terminal is disconnected, and if so, determine that the terminal is in the shutdown state; when detecting When the terminal is in the shutdown state, close the data exchange access mode of the USB interface of the terminal and switch to the device charging access mode; in the device charging access mode, detect whether the voltage of the power pin of the USB interface of the terminal is greater than or equal to the charging voltage threshold ; When it is detected that the voltage of the power pin is greater than or equal to the charging voltage threshold, the device is charged through the USB interface.
需要说明的是,若检测到终端的电源没有断开时,则确定终端处于开机状态,终端执行数据交换访问模式。在检测到终端USB接口的标识引脚处于低电平状态时,可确定USB接口有外接OTG设备接入,则终端与外接OTG设备可进行数据交换。It should be noted that, if it is detected that the power supply of the terminal is not disconnected, it is determined that the terminal is in the power-on state, and the terminal executes the data exchange access mode. When it is detected that the identification pin of the USB interface of the terminal is in a low level state, it can be determined that an external OTG device is connected to the USB interface, and then the terminal and the external OTG device can exchange data.
本实施例提供的具有数据交换功能的终端的充电方法,当检测到终端没有发送电磁波或者切断电源时,终端处于关机状态,控制关闭USB接口的数据交换访问模式并切换为执行设备充电访问模式,并当检测到电源引脚的电压大于或等于预设的充电电压阈值时,控制终端进行充电。本实施例将检测终端是否处于关机状态作为切换终端访问模式的判断条件,不仅实现了对终端的USB接口的访问模式切换,还解决了现有技术中终端的USB接口的标识引脚短路造成的终端即使在关机状态下也无法充电的问题。In the charging method for a terminal with a data exchange function provided in this embodiment, when it is detected that the terminal does not send electromagnetic waves or the power is cut off, the terminal is in a shutdown state, and the data exchange access mode of the USB interface is controlled to be turned off and switched to the execution device charging access mode. And when it is detected that the voltage of the power supply pin is greater than or equal to the preset charging voltage threshold, the control terminal is charged. In this embodiment, the detection of whether the terminal is in the power-off state is used as the judgment condition for switching the terminal access mode, which not only realizes the switching of the access mode of the USB interface of the terminal, but also solves the problem caused by the short circuit of the identification pin of the USB interface of the terminal in the prior art. The problem that the terminal cannot be charged even when it is turned off.
实施例三Embodiment three
图4为本发明实施例三提供的一种具有数据交换功能的终端充电装置的结构示意图。该装置可以采用软件和/或硬件的方式执行上述实施例所述的具有OTG功能的终端的充电方法,该装置配置在终端中执行。FIG. 4 is a schematic structural diagram of a terminal charging device with a data exchange function provided by Embodiment 3 of the present invention. The device can implement the method for charging a terminal with an OTG function described in the above-mentioned embodiments in the form of software and/or hardware, and the device is configured to be executed in the terminal.
本实施例三提供的一种具有数据交换功能的终端的充电装置,包括:终端状态检测模块310和访问模式切换模块320。The third embodiment provides a charging device for a terminal with a data exchange function, including: a terminal state detection module 310 and an access mode switching module 320 .
其中,终端状态检测模块310用于检测所述终端是否处于关机状态;访问模式切换模块320用于当检测到所述终端处于关机状态时,关闭所述终端的通用串行总线USB接口的数据交换访问模式并切换为执行设备充电访问模式。Wherein, the terminal state detection module 310 is used to detect whether the terminal is in the shutdown state; the access mode switching module 320 is used to close the data exchange of the Universal Serial Bus USB interface of the terminal when detecting that the terminal is in the shutdown state access mode and switch to perform device charging access mode.
可选的,终端状态检测模块310包括:电磁波检测单元311或电源检测单元312。Optionally, the terminal state detection module 310 includes: an electromagnetic wave detection unit 311 or a power supply detection unit 312 .
其中,电磁波检测单元311用于检测所述终端是否发送电磁波,若否,则确定所述终端处于关机状态;或电源检测单元312用于检测所述终端的电源是否断开,若是,则确定所述终端处于关机状态。Wherein, the electromagnetic wave detection unit 311 is used to detect whether the terminal sends electromagnetic waves, if not, then determine that the terminal is in a power-off state; The terminal is turned off.
可选的,访问模式切换模块320关闭所述终端的USB接口的数据交换访问模式的具体执行过程为:断开传输至所述终端中数据交换识别电路的使能信号,以关闭所述数据交换访问模式。Optionally, the specific implementation process of the access mode switching module 320 closing the data exchange access mode of the USB interface of the terminal is: disconnecting the enable signal transmitted to the data exchange identification circuit in the terminal to close the data exchange access mode.
可选地,所述充电装置还包括:数据模式执行模块330,用于当终端状态检测模块310检测到所述终端处于开机状态之后,在所述数据交换访问模式下,当检测到所述USB接口的标识引脚处于低电平状态,则执行与外接设备的数据交换。Optionally, the charging device further includes: a data mode execution module 330, configured to detect that the USB If the identification pin of the interface is in a low level state, data exchange with the external device is performed.
可选地,所述充电装置还包括:电源引脚检测模块340和充电模式执行模块350。Optionally, the charging device further includes: a power pin detection module 340 and a charging mode execution module 350 .
其中,电源引脚检测模块340用于当所述访问模式切换模块320关闭所述终端USB接口的数据交换访问模式并切换为执行设备充电访问模式之后,在所述设备充电访问模式下,检测所述终端的USB接口的电源引脚的电压是否大于或等于充电电压阈值;充电模式执行模块350用于当检测到所述电源引脚的电压大于或等于所述充电电压阈值时,通过所述USB接口进行设备充电。Wherein, the power pin detection module 340 is used to detect all Whether the voltage of the power supply pin of the USB interface of the terminal is greater than or equal to the charging voltage threshold; the charging mode execution module 350 is used to pass the USB interface to charge the device.
本实施例三提供的一种具有数据交换功能的终端的充电装置,通过终端状态检测模块检测终端是否处于关机状态,当检测到终端处于关机状态时,访问模式切换模块关闭终端的USB接口的数据交换访问模块并切换为执行设备充电访问模式,以控制终端进行充电。本实施例将检测终端是否处于关机状态作为切换终端访问模式的判断条件,不仅实现了对终端的USB接口的访问模式切换,还解决了现有技术中终端的USB接口的标识引脚短路造成的终端无法充电的问题。The third embodiment provides a charging device for a terminal with a data exchange function. The terminal state detection module detects whether the terminal is in the shutdown state. When it is detected that the terminal is in the shutdown state, the access mode switching module closes the data of the USB interface of the terminal. Swap access modules and switch to execute device charging access mode to control terminal for charging. In this embodiment, the detection of whether the terminal is in the power-off state is used as the judgment condition for switching the terminal access mode, which not only realizes the switching of the access mode of the USB interface of the terminal, but also solves the problem caused by the short circuit of the identification pin of the USB interface of the terminal in the prior art. The problem that the terminal cannot be charged.
注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention, and the present invention The scope is determined by the scope of the appended claims.
Claims (6)
- A kind of 1. charging method of the terminal with data exchanging function, it is characterised in that including:Whether detection terminal sends electromagnetic wave or whether power supply disconnects, and the basis for estimation of charged state is forced into as terminal;When detecting that the terminal does not send electromagnetic wave or power supply disconnection, disconnection is transmitted to the data in terminal to exchange and identified The enable signal of circuit, to close data exchange access module, and switch to and perform equipment charge access module.
- 2. charging method according to claim 1, it is characterised in that when detecting that the terminal sends electromagnetic wave or power supply After not disconnecting, in addition to:Under the data exchange access module, when the identified pins for detecting USB interface are in low level state, then perform with The data exchange of external equipment.
- 3. charging method according to claim 1, it is characterised in that when detecting that the terminal do not send electromagnetic wave or electricity When source disconnects, the enable signal transmitted to the data in terminal and exchange identification circuit is disconnected, mould is accessed to close data exchange Formula, and switch to perform equipment charge access module after, in addition to:Under the equipment charge access module, detect the power pins of the USB interface of the terminal voltage whether be more than or Equal to charging voltage threshold value;When the voltage for detecting the power pins is more than or equal to the charging voltage threshold value, entered by the USB interface Row equipment charge.
- A kind of 4. charging device of the terminal with data exchanging function, it is characterised in that including:SOT state of termination detection module, whether send electromagnetic wave for detection terminal or whether power supply disconnect, as terminal force into Enter the basis for estimation of charged state;Access module handover module, for when detecting that the terminal does not send electromagnetic wave or power supply and disconnected, disconnection transmit to The data in terminal exchanges the enable signal of identification circuit, to close data exchange access module, and switches to execution equipment Charge access module.
- 5. charging device according to claim 4, it is characterised in that also include:Data pattern execution module, for after detecting that the terminal sends electromagnetic wave or power supply does not disconnect, in the number According under switched access pattern, when the identified pins for detecting USB interface are in low level state, then the number with external equipment is performed According to exchange.
- 6. charging device according to claim 4, it is characterised in that also include:Power pins detection module, for when detecting that the terminal does not send electromagnetic wave or power supply and disconnected, disconnection transmit to The data in terminal exchanges the enable signal of identification circuit, to close data exchange access module, and switches to execution equipment Charge after access module, under the equipment charge access module, detect the electricity of the power pins of the USB interface of the terminal Whether pressure is more than or equal to charging voltage threshold value;Charge mode execution module, for being more than or equal to the charging voltage threshold value when the voltage for detecting the power pins When, equipment charge is carried out by the USB interface.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510532478.3A CN105071488B (en) | 2015-08-25 | 2015-08-25 | A kind of charging method and device of the terminal with data exchanging function |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510532478.3A CN105071488B (en) | 2015-08-25 | 2015-08-25 | A kind of charging method and device of the terminal with data exchanging function |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105071488A CN105071488A (en) | 2015-11-18 |
CN105071488B true CN105071488B (en) | 2017-11-21 |
Family
ID=54500799
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510532478.3A Expired - Fee Related CN105071488B (en) | 2015-08-25 | 2015-08-25 | A kind of charging method and device of the terminal with data exchanging function |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105071488B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106684967B (en) * | 2016-11-29 | 2019-07-26 | 维沃移动通信有限公司 | A kind of charging method of mobile terminal and mobile terminal |
CN110442539B (en) * | 2019-06-17 | 2021-08-31 | 荣耀终端有限公司 | Mobile phone OTG switching method and device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW535308B (en) * | 2000-05-23 | 2003-06-01 | Canon Kk | Detecting method for detecting internal state of a rechargeable battery, detecting device for practicing said detecting method, and instrument provided with said |
CN203312846U (en) * | 2013-05-16 | 2013-11-27 | 方洪福 | A multifunctional mobile power supply |
-
2015
- 2015-08-25 CN CN201510532478.3A patent/CN105071488B/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN105071488A (en) | 2015-11-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101901201B (en) | Method and device for realizing USB OTG function on electronic equipment | |
CN103618356B (en) | A charging system and charging method for a mobile terminal | |
CN110829523B (en) | Electronic equipment and reverse charging method | |
US9258024B2 (en) | SIM card connector and mobile terminal | |
US8458376B1 (en) | USB peripheral device with automatic mode switch | |
CN101853970A (en) | Method and device for charging through universal serial bus (USB) interface | |
CN101102119A (en) | A charging detection circuit of appliance device and charging detection method | |
JP2017503262A (en) | Method and apparatus for charging an electronic device by USB connection | |
CN105071484B (en) | A kind of charging method and device of the terminal with data exchanging function | |
CN105068959A (en) | A charging method and device for a terminal and a terminal with a data exchange function | |
CN105048018B (en) | The charging method and device of a kind of terminal with data exchanging function | |
JP7064052B2 (en) | mobile computer | |
CN101546918A (en) | Device and method for charging USB | |
CN105162213A (en) | USB controller, and device | |
CN106786960A (en) | Charge control method, device and terminal | |
CN105071489B (en) | A kind of charging method and device of the terminal with data exchanging function | |
CN201039411Y (en) | A mobile phone with self-adapted charging device | |
CN106797414B (en) | A kind of leakage current detection circuit and terminal of terminal | |
CN105071488B (en) | A kind of charging method and device of the terminal with data exchanging function | |
CN106164686B (en) | A Terminal Leakage Current Detection System | |
CN104850512B (en) | No ID pin does the method and device of USB OTG function | |
CN113162131A (en) | Reverse charging system, reverse charging method and terminal equipment | |
CN111342532B (en) | Charging circuit and charger in-place detection method | |
CN105404600A (en) | Method and apparatus giving consideration to USB eye pattern performance and OTG function | |
CN106200442B (en) | Method and device for realizing connection control |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
CP01 | Change in the name or title of a patent holder | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20171121 |
|
CF01 | Termination of patent right due to non-payment of annual fee |