patents.google.com

CN105068959A - A charging method and device for a terminal and a terminal with a data exchange function - Google Patents

  • ️Wed Nov 18 2015
A charging method and device for a terminal and a terminal with a data exchange function Download PDF

Info

Publication number
CN105068959A
CN105068959A CN201510528743.0A CN201510528743A CN105068959A CN 105068959 A CN105068959 A CN 105068959A CN 201510528743 A CN201510528743 A CN 201510528743A CN 105068959 A CN105068959 A CN 105068959A Authority
CN
China
Prior art keywords
pin
terminal
usb interface
level
identification
Prior art date
2015-08-25
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.)
Pending
Application number
CN201510528743.0A
Other languages
Chinese (zh)
Inventor
李路路
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
2015-08-25
Filing date
2015-08-25
Publication date
2015-11-18
2015-08-25 Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
2015-08-25 Priority to CN201510528743.0A priority Critical patent/CN105068959A/en
2015-11-18 Publication of CN105068959A publication Critical patent/CN105068959A/en
Status Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B40/00Technologies aiming at improving the efficiency of home appliances, e.g. induction cooking or efficient technologies for refrigerators, freezers or dish washers

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Power Engineering (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a terminal and a charging method and a device of the terminal with a data exchange function, wherein the terminal comprises: the USB interface comprises a power supply pin, a data pin, an identification pin and a grounding pin; the length of the identification pin of the USB interface is smaller than that of the power supply pin of the USB interface. According to the invention, the length of the identification pin of the USB interface of the terminal is set to be smaller than the length of the power pin of the USB interface, so that in the process of inserting the data exchange OTG patch cord into the USB interface of the terminal, the level value of the power pin of the USB interface of the terminal can be monitored firstly, and the terminal is controlled to be switched into an equipment charging access mode when the power pin is monitored to be a set high level. The invention not only realizes the access mode switching of the USB interface of the terminal, but also enables the OTG patch cord to be used as a charging wire, thereby solving the problems in the prior art.

Description

一种终端以及具有数据交换功能的终端的充电方法和装置A charging method and device for a terminal and a terminal with a data exchange function

技术领域technical field

本发明涉及充电技术,尤其涉及一种终端以及具有数据交换功能的终端的充电方法和装置。The present invention relates to charging technology, in particular to a charging method and device for a terminal and a terminal with a data exchange function.

背景技术Background technique

随着数据交换OTG(OnTheGo)技术的发展,越来越多的电子终端设备具有了OTG功能,使得更多的用户在终端与终端之间进行数据传输和控制时,操作更加便捷。以手机为例进行示例,如图1所示为现有技术提供的手机USB接口的示意图,该USB接口具有接地引脚GND、标识引脚ID、正电压数据引脚D+、负电压数据引脚D-和电源引脚VBUS。对于支持OTG功能的手机,一般是通过OTG转接线将OTG设备与手机的USB接口进行连接,当OTG转接线接入手机的USB接口时,终端处于OTG访问模式,从而实现了对外接OTG设备的检测、识别和通信。With the development of data exchange OTG (OnTheGo) technology, more and more electronic terminal equipment has OTG function, which makes the operation more convenient for more users to perform data transmission and control between terminals. Taking a mobile phone as an example, Figure 1 is a schematic diagram of a mobile phone USB interface provided by the prior art, the USB interface has a ground pin GND, an identification pin ID, a positive voltage data pin D+, and a negative voltage data pin D- and power supply pin VBUS. For mobile phones that support the OTG function, the OTG device is generally connected to the USB interface of the mobile phone through an OTG adapter cable. Detection, identification and communication.

目前终端访问外接设备时往往使用OTG转接线作为数据线进行数据交换。当OTG转接线接入手机的USB接口时,由于OTG转接线中的标识引脚(ID)与接地引脚(GND)相连,即标识引脚(ID)短路,因此使得所述OTG转接线与终端相连时,终端首先进行OTG设备检测,若有OTG设备接入则切换为执行数据交换访问模式。终端USB接口的VBUS引脚输出5伏电压,与OTG设备进行数据交换。At present, when a terminal accesses an external device, an OTG adapter cable is often used as a data cable for data exchange. When the OTG transfer line is connected to the USB interface of the mobile phone, because the identification pin (ID) in the OTG transfer line is connected to the ground pin (GND), that is, the identification pin (ID) is short-circuited, so the OTG transfer line is connected to the ground pin (GND). When the terminal is connected, the terminal first detects the OTG device, and if there is an OTG device connected, it switches to the data exchange access mode. The VBUS pin of the terminal USB interface outputs 5 volts to exchange data with the OTG device.

现有的OTG转接线存在功能单一,无法用于终端充电等其他操作,在终端进行不同的操作时需要多个连接线的问题,降低了用户体验的满意度。The existing OTG adapter cable has a single function, cannot be used for other operations such as terminal charging, and needs multiple connection cables when performing different operations on the terminal, which reduces the satisfaction of user experience.

发明内容Contents of the invention

本发明提供一种终端以及具有数据交换功能的终端的充电方法和装置,以解决现有技术中终端无法通过OTG线进行充电的问题。The invention provides a charging method and device for a terminal and a terminal with a data exchange function, so as to solve the problem in the prior art that the terminal cannot be charged through an OTG line.

第一方面,本发明实施例提供了一种终端,包括:通用串行总线USB接口,所述USB接口包括电源引脚、数据引脚、标识引脚和接地引脚;In a first aspect, an embodiment of the present invention provides a terminal, including: a Universal Serial Bus USB interface, where the USB interface includes a power pin, a data pin, an identification pin, and a ground pin;

其中,所述USB接口的标识引脚的长度小于所述USB接口的电源引脚的长度。Wherein, the length of the identification pin of the USB interface is smaller than the length of the power pin of the USB interface.

第二方面,本发明实施例提供了一种具有数据交换功能的终端的充电方法,所述终端为第一方面所述的终端,所述方法包括:In a second aspect, an embodiment of the present invention provides a charging method for a terminal with a data exchange function, where the terminal is the terminal described in the first aspect, and the method includes:

监测所述终端的USB接口的电源引脚和标识引脚的电平值;Monitor the level values of the power supply pin and the identification pin of the USB interface of the terminal;

在插入过程中,若监测到所述电源引脚为设定高电平时,控制所述终端切换至设备充电访问模式;During the insertion process, if it is detected that the power supply pin is set to a high level, control the terminal to switch to the device charging access mode;

在所述插入过程中,若监测到所述电源引脚小于设定高电平时,则获取所述标识引脚的电平,根据所述标识引脚的电平执行相应控制。During the insertion process, if it is detected that the power supply pin is lower than the set high level, the level of the identification pin is obtained, and corresponding control is performed according to the level of the identification pin.

第三方面,本发明实施例还提供了一种具有数据交换功能的终端的充电装置,所述终端第一方面所述的终端,所述装置包括:In a third aspect, an embodiment of the present invention also provides a charging device for a terminal with a data exchange function. The terminal is the terminal described in the first aspect, and the device includes:

终端引脚监测模块,用于监测所述终端的USB接口的电源引脚和标识引脚;The terminal pin monitoring module is used to monitor the power supply pin and identification pin of the USB interface of the terminal;

充电模式切换模块,用于在插入过程中,若监测到所述电源引脚为设定高电平时,控制所述终端切换至设备充电访问模式;The charging mode switching module is used to control the terminal to switch to the device charging access mode if it is detected that the power supply pin is set to a high level during the insertion process;

标识引脚控制模块,用于在所述插入过程中,若监测到所述电源引脚小于设定高电平时,则获取所述标识引脚的电平,根据所述标识引脚的电平执行相应控制。The identification pin control module is used to obtain the level of the identification pin if it is detected that the power supply pin is lower than the set high level during the insertion process, and according to the level of the identification pin Execute corresponding controls.

本发明实施例提供的一种终端以及具有数据交换功能的终端的充电方法和装置,通过将终端的USB接口的标识引脚的长度设置为小于所述USB接口的电源引脚的长度,使得在数据交换OTG转接线插入所述终端的USB接口的过程中,首先可以监测到电源引脚的电平值,并在监测到电源引脚为设定高电平时控制所述终端切换至设备充电访问模式,或者在监测到电源引脚小于设定高电平时获取标识引脚的电平,并根据所述标识引脚的电平执行相应控制。本发明实施例不仅实现了对终端的USB接口的访问模式切换,而且使OTG转接线具有可作为充电线使用的功能,解决了现有技术中终端无法通过OTG转接线进行充电的问题。The embodiment of the present invention provides a terminal and a charging method and device for a terminal with a data exchange function, by setting the length of the identification pin of the USB interface of the terminal to be shorter than the length of the power supply pin of the USB interface, so that when the In the process of inserting the data exchange OTG adapter cable into the USB interface of the terminal, the level value of the power pin can be monitored first, and when the power pin is detected to be set at a high level, the terminal can be controlled to switch to the device charging access mode, or obtain the level of the identification pin when it is detected that the power supply pin is lower than the set high level, and perform corresponding control according to the level of the identification pin. The embodiment of the present invention not only realizes the switching of the access mode of the USB interface of the terminal, but also enables the OTG adapter cable to have the function of being used as a charging cable, which solves the problem that the terminal cannot be charged through the OTG adapter cable in the prior art.

附图说明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 universal serial bus USB interface of the mobile phone that prior art provides;

图2为本发明实施例一提供的一种终端USB接口中引脚的示意图;2 is a schematic diagram of pins in a terminal USB interface provided by Embodiment 1 of the present invention;

图3是本发明实施例一提供的一种具有数据交换功能的终端的充电方法的流程图;FIG. 3 is a flow chart of a charging method for a terminal with a data exchange function provided by Embodiment 1 of the present invention;

图4是本发明实施例二提供的一种具有数据交换功能的终端的充电方法的流程图;FIG. 4 is a flowchart of a charging method for a terminal with a data exchange function provided by Embodiment 2 of the present invention;

图5是本发明实施例三提供的一种具有数据交换功能的终端的充电装置的示意图。FIG. 5 is a schematic 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接口的电源引脚会输出5V电压,用于对OTG设备进行检测。当OTG转接线将外接电源接入终端时,此时终端无法通过OTG转接线进行充电。It can be seen from the above prior art that when the OTG adapter cable is connected to the USB interface of the terminal, the terminal is in the data exchange access mode, and the power pin of the USB interface of the terminal will output 5V voltage for detecting the OTG device. When the OTG adapter cable connects the external power supply to the terminal, the terminal cannot be charged through the OTG adapter cable at this time.

实施例一Embodiment one

图2为本发明实施例一提供的一种终端USB接口中引脚的示意图。如图2所示,本发明实施例一提供的一种终端,包括:通用串行总线USB接口,所述USB接口包括电源引脚VBUS、数据引脚、标识引脚ID和接地引脚GND,其中,所述数据引脚包括:正电压数据引脚D+、负电压数据引脚D-。可选的,所述终端可以为任意具有OTG功能的电子设备,例如手机、平板电脑等。FIG. 2 is a schematic diagram of pins in a terminal USB interface provided by Embodiment 1 of the present invention. As shown in Figure 2, a terminal provided by Embodiment 1 of the present invention includes: a universal serial bus USB interface, the USB interface including a power supply pin VBUS, a data pin, an identification pin ID and a ground pin GND, Wherein, the data pins include: a positive voltage data pin D+, and a negative voltage data pin D-. Optionally, the terminal may be any electronic device with an OTG function, such as a mobile phone, a tablet computer, and the like.

其中,所述USB接口的标识引脚ID的长度小于所述USB接口的电源引脚VBUS的长度。这样设置可以使得当终端的USB接口有OTG转接线插入时,终端USB接口的电源引脚VBUS比标识引脚ID先接触到OTG转接线的对应引脚。Wherein, the length of the identification pin ID of the USB interface is smaller than the length of the power supply pin VBUS of the USB interface. Such setting can make when the USB interface of the terminal is inserted with an OTG adapter cable, the power supply pin VBUS of the terminal USB interface contacts the corresponding pin of the OTG adapter cable before the identification pin ID.

需要说明的是,还可选将终端的USB接口的电源引脚的长度设置为大于其他引脚的长度,使得OTG转接线与终端USB接口连接时,终端USB接口的电源引脚比其他引脚先接触到OTG转接线的对应引脚。由此可在监测到终端电源引脚为设定高电平时直接控制终端执行设备充电访问模式。It should be noted that it is also optional to set the length of the power pin of the USB interface of the terminal to be greater than the length of other pins, so that when the OTG adapter cable is connected to the USB interface of the terminal, the power pin of the USB interface of the terminal is longer than other pins. First touch the corresponding pin of the OTG adapter cable. Therefore, when it is detected that the power supply pin of the terminal is set to a high level, the terminal can be directly controlled to execute the device charging access mode.

在此,对终端USB接口中各个引脚的具体长度不作限定,只要能够保证终端USB接口的电源引脚比其他引脚先接触到OTG转接线的对应引脚即可,此时在监测到终端电源引脚为设定高电平时直接控制终端执行设备充电访问模式。Here, the specific length of each pin in the USB interface of the terminal is not limited, as long as it can be ensured that the power supply pin of the USB interface of the terminal touches the corresponding pin of the OTG adapter cable before other pins. When the power pin is set to a high level, it directly controls the terminal to execute the device charging access mode.

可选终端USB接口的标识引脚的长度小于或等于所述USB接口的电源引脚的长度的三分之二,以免由于OTG转接线插入终端USB接口时,由于插入的方向倾斜等原因造成所述终端USB接口的标识引脚ID先接触OTG转接线,使终端可能切换为数据交换访问模式。The length of the identification pin of the optional terminal USB interface is less than or equal to two-thirds of the length of the power supply pin of the USB interface, so as to prevent the OTG adapter cable from being inserted into the terminal USB interface due to reasons such as the direction of insertion is inclined. The identification pin ID of the USB interface of the terminal is first contacted with the OTG adapter cable, so that the terminal may be switched to the data exchange access mode.

本发明实施例一提供的一种终端,通过改变终端USB接口中标识引脚的长度,使得终端USB接口的电源引脚比其他引脚先接触到OTG转接线的对应引脚。在OTG转接线插入终端USB接口的过程中,能够使终端先监测USB接口电源引脚的状态,以根据电源引脚的状态执行相应控制,可以避免插入OTG转接线后,终端处于数据交换访问模式的情况。本实施例能够拓展OTG转接线的功能,使其可以作为充电线使用。In the terminal provided by Embodiment 1 of the present invention, by changing the length of the identification pin in the USB interface of the terminal, the power supply pin of the USB interface of the terminal contacts the corresponding pin of the OTG adapter cable before other pins. During the process of inserting the OTG adapter cable into the terminal USB interface, the terminal can first monitor the status of the power pin of the USB interface to perform corresponding control according to the status of the power pin, which can avoid the terminal being in the data exchange access mode after the OTG adapter cable is inserted Case. This embodiment can expand the function of the OTG adapter cable so that it can be used as a charging cable.

需要说明的是,还可选将OTG转接线的标识引脚ID的长度设置为小于其他引脚的长度,或者,将OTG转接线的电源引脚的长度设置为大于其他引脚的长度,使得OTG转接线与终端USB接口连接时,终端USB接口的电源引脚线比其标识引脚先接触到OTG转接线的对应引脚。由此可在监测到终端电源引脚为设定高电平时直接控制终端执行设备充电访问模式。It should be noted that it is also optional to set the length of the identification pin ID of the OTG adapter cable to be shorter than the length of other pins, or to set the length of the power supply pin of the OTG adapter cable to be longer than the length of other pins, so that When the OTG adapter cable is connected to the terminal USB interface, the power pin of the terminal USB interface touches the corresponding pin of the OTG adapter cable before its identification pin. Therefore, when it is detected that the power supply pin of the terminal is set to a high level, the terminal can be directly controlled to execute the device charging access mode.

实施例二Embodiment two

图3是本发明实施例二提供的一种具有数据交换功能的终端的充电方法的流程图,该实施例的技术方案可适用于终端通过OTG转接线进行充电的情况。终端可以为上述实施例中所述终端。该方法可以由具有OTG功能的终端的充电装置来执行,该装置可以采用软件和/或硬件的方式实现,配置在终端中执行。如图3所示,该具有数据交换功能的终端的充电方法包括如下操作:3 is a flow chart of a charging method for a terminal with a data exchange function provided by Embodiment 2 of the present invention. The technical solution of this embodiment is applicable to the case where the terminal is charged through an OTG adapter cable. The terminal may be the terminal described in the foregoing embodiments. 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. As shown in Figure 3, the charging method of the terminal with data exchange function includes the following operations:

S110、监测所述终端的USB接口的电源引脚和标识引脚的电平值。S110. Monitor the level values of the power supply pin and the identification pin of the USB interface of the terminal.

本步骤具体可以是当OTG转接线插入终端的USB接口过程中,由于所述USB接口的标识引脚ID的长度小于所述USB接口的电源引脚VBUS的长度,所以终端电源引脚VBUS比其标识引脚ID先接触到OTG转接线的对应引脚。所以可先对终端的USB接口的电源引脚的电平值进行监测,判断所述终端的USB接口是否连接到电源设备,即能否为所述终端进行充电。This step can specifically be that when the OTG transfer wire is inserted into the USB interface process of the terminal, since the length of the identification pin ID of the USB interface is less than the length of the power supply pin VBUS of the USB interface, the terminal power supply pin VBUS is smaller than its length. The identification pin ID first touches the corresponding pin of the OTG adapter cable. Therefore, the level value of the power pin of the USB interface of the terminal can be monitored first to determine whether the USB interface of the terminal is connected to a power supply device, that is, whether the terminal can be charged.

S120、在插入过程中,监测到所述电源引脚为设定高电平时,控制所述终端切换至设备充电访问模式。S120. During the insertion process, when it is detected that the power pin is at a set high level, control the terminal to switch to a device charging access mode.

当有电源设备通过OTG转接线插入时,终端的电源引脚为高电平。因此本步骤中当监测到电源引脚为设定高电平时,则可控制终端切换至设备充电访问模式,以通过电源设备为终端进行充电。示例性,所述设定高电平可以为5V。When a power supply device is plugged in through an OTG adapter cable, the power pin of the terminal is at a high level. Therefore, in this step, when it is detected that the power pin is set to a high level, the terminal can be controlled to switch to the device charging access mode, so as to charge the terminal through the power supply device. Exemplarily, the set high level may be 5V.

S130、在所述插入过程中,若监测到所述电源引脚小于设定高电平时,则获取所述标识引脚的电平,根据所述标识引脚的电平执行相应控制。S130. During the insertion process, if it is detected that the power supply pin is lower than the set high level, acquire the level of the identification pin, and perform corresponding control according to the level of the identification pin.

对于步骤110,若监测到电源引脚小于设定高电平时,终端不需要切换为设备充电访问模式。此时随着OTG转接线的插入动作,终端USB接口的标识引脚与OTG转接线的对应引脚接触,终端可监测并获取到标识引脚的电平状态,并根据标识引脚的电平状态执行相应控制。For step 110, if it is detected that the power pin is lower than the set high level, the terminal does not need to switch to the device charging access mode. At this time, with the insertion action of the OTG adapter cable, the identification pin of the terminal USB interface is in contact with the corresponding pin of the OTG adapter cable, and the terminal can monitor and obtain the level status of the identification pin, and according to the level of the identification pin The state executes the corresponding control.

本发明实施例二提供的一种具有数据交换功能的终端的充电方法,在OTG转接线插入所述终端的USB接口的过程中,首先会监测到所述终端的USB接口的电源引脚电平值。当监测到所述电源引脚为设定高电平时,控制所述终端切换至设备充电访问模式;当监测到所述电源引脚小于设定高电平时,则获取所述标识引脚的电平,根据所述标识引脚的电平执行相应控制。本实施例不仅实现了对终端的USB接口的访问模式切换,而且使OTG转接线可作为充电线使用,解决了现有技术中终端无法通过OTG转接线进行充电的问题。In the charging method of a terminal with data exchange function provided by Embodiment 2 of the present invention, in the process of inserting the OTG adapter cable into the USB interface of the terminal, the power pin level of the USB interface of the terminal will be monitored first value. When it is detected that the power supply pin is at the set high level, control the terminal to switch to the device charging access mode; Level, perform corresponding control according to the level of the identification pin. This embodiment not only realizes the switching of the access mode of the USB interface of the terminal, but also enables the OTG adapter cable to be used as a charging cable, which solves the problem that the terminal cannot be charged through the OTG adapter cable in the prior art.

实施例三Embodiment three

图4为本发明实施例三提供的一种具有数据交换功能的终端的充电方法的流程图。该方法可以由具有OTG功能的终端的充电装置来执行,该装置可以采用软件和/或硬件的方式实现,配置在终端中执行。如图4所示,本发明实施例提供的具有数据交换功能的终端的充电方法,包括如下操作:FIG. 4 is a flow chart of a charging method for a terminal with a data exchange function provided by Embodiment 3 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. As shown in FIG. 4, the charging method for a terminal with a data exchange function provided by an embodiment of the present invention includes the following operations:

S201、监测所述终端的USB接口的电源引脚和标识引脚的电平值。S201. Monitor the level values of the power supply pin and the identification pin of the USB interface of the terminal.

S202、在插入过程中,若监测到所述电源引脚为设定高电平时,控制所述终端切换至设备充电访问模式。S202. During the insertion process, if it is detected that the power pin is at a set high level, control the terminal to switch to a device charging access mode.

S203、在所述插入过程中,若监测到所述电源引脚小于设定高电平时,则获取所述标识引脚的电平。S203. During the insertion process, if it is detected that the power supply pin is lower than the set high level, acquire the level of the identification pin.

具体的,若监测到所述电源引脚小于设定高电平时,可确定OTG转接线并未将电源设备接入终端时,此时当终端USB接口的标识引脚与OTG转接线的标识引脚接触时,可获取所述终端标识引脚的电平。Specifically, if it is detected that the power supply pin is lower than the set high level, it can be determined that the OTG transfer cable does not connect the power supply device to the terminal. When the pin is in contact, the level of the terminal identification pin can be obtained.

S204、检测所述标识引脚的电压值是否为设定低电平。S204. Detect whether the voltage value of the identification pin is a set low level.

当OTG转接线将OTG设备接入终端时,终端的标识引脚的电压值通常为低电平,可将终端切换为OTG访问模式。当OTG转接线未将OTG设备接入终端时,终端的标识引脚的电压值并非为低电平,不需要将终端切换为OTG访问模式。因此本步骤可为是否将终端切换为数据交换访问模式提供依据。When the OTG adapter cable connects the OTG device to the terminal, the voltage value of the identification pin of the terminal is usually at a low level, and the terminal can be switched to the OTG access mode. When the OTG adapter cable does not connect the OTG device to the terminal, the voltage value of the identification pin of the terminal is not low, and there is no need to switch the terminal to the OTG access mode. Therefore, this step can provide a basis for whether to switch the terminal to the data exchange access mode.

若是,则执行S205;若否,则返回执行S201,即继续对所述终端的USB接口的电源引脚和标识引脚的电平值进行监测,以根据监测结果进行相应操作。If yes, execute S205; if not, return to execute S201, that is, continue to monitor the level values of the power supply pin and the identification pin of the USB interface of the terminal, so as to perform corresponding operations according to the monitoring results.

S205、控制所述终端切换为数据交换访问模式。当终端USB接口的标识引脚为设定低电平时,说明终端的USB接口处监测到有OTG设备接入,那么此时终端可以对接入的OTG设备进行OTG检测、识别和访问,进而与OTG设备进行数据交换。S205. Control the terminal to switch to a data exchange access mode. When the identification pin of the USB interface of the terminal is set to a low level, it means that the USB interface of the terminal detects that there is an OTG device connected, then at this time the terminal can perform OTG detection, identification and access to the connected OTG device, and then communicate with the OTG device. OTG equipment for data exchange.

可选的,将所述终端切换为执行数据交换访问模式之后,控制所述终端的USB接口的电源引脚输出电压。具体的,当终端的USB接口处有OTG设备接入时,控制所述终端的USB接口的电源引脚输出预设电压值,供给外接OTG设备,以实现终端与OTG设备的数据通信。示例性的,所述预设电压值可以为5V,在此只是对预设电压值进行示例而并非具体限定。Optionally, after the terminal is switched to the data exchange access mode, the power supply pin of the USB interface of the terminal is controlled to output voltage. Specifically, when an OTG device is connected to the USB interface of the terminal, the power supply pin of the USB interface of the terminal is controlled to output a preset voltage value, which is supplied to an external OTG device, so as to realize data communication between the terminal and the OTG device. Exemplarily, the preset voltage value may be 5V, which is only an example of the preset voltage value and not specifically limited.

本实施例提供的一种具有数据交换功能的终端的充电方法,在OTG转接线插入终端USB接口的过程中,监测所述终端的USB接口的电源引脚和标识引脚的电平值,若监测到所述电源引脚为设定高电平时,控制所述终端充电;若监测到所述电源引脚小于设定高电平时,则获取所述标识引脚的电平,并监测和判断所述标识引脚的电压值是否为设定低电平,为进行数据交换与否提供依据。本实施例根据电源引脚和标识引脚的电平值的监测和判定结果对终端的USB接口的访问模式切换,而且使OTG转接线具有可作为充电线使用的功能,解决了现有技术中终端无法通过OTG转接线进行充电的问题。This embodiment provides a charging method for a terminal with a data exchange function. During the process of inserting the OTG adapter cable into the USB interface of the terminal, monitor the level values of the power supply pin and the identification pin of the USB interface of the terminal. When it is detected that the power supply pin is at a set high level, control the charging of the terminal; if it is detected that the power supply pin is lower than the set high level, then obtain the level of the identification pin, and monitor and judge Whether the voltage value of the identification pin is set to a low level provides a basis for data exchange or not. This embodiment switches the access mode of the USB interface of the terminal according to the monitoring and judgment results of the level values of the power supply pin and the identification pin, and makes the OTG transfer line have the function that can be used as a charging line, which solves the problem in the prior art. The problem that the terminal cannot be charged through the OTG adapter cable.

实施例四Embodiment four

图5为本发明实施例四提供的一种具有数据交换功能的终端的充电装置的示意图。该装置可以采用软件和/或硬件的方式执行上述实施例所述的具有OTG功能的终端的充电方法,该装置配置在终端中执行。FIG. 5 is a schematic diagram of a charging device for a terminal with a data exchange function provided by Embodiment 4 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和标识引脚控制模块330。This embodiment provides a charging device for a terminal with a data exchange function, the terminal is the terminal described in the first embodiment above, and the charging device includes: a terminal pin monitoring module 310, a charging mode switching module 320 and an identification pin control module 330 .

其中,终端引脚监测模块310用于监测所述终端的USB接口的电源引脚和标识引脚;充电模式切换模块320用于在插入过程中,监测到所述电源引脚为设定高电平时,控制所述终端切换至设备充电访问模式;标识引脚控制模块330用于在所述插入过程中,若监测到所述电源引脚小于设定高电平时,则获取所述标识引脚的电平,根据所述标识引脚的电平执行相应控制。Wherein, the terminal pin monitoring module 310 is used to monitor the power pin and identification pin of the USB interface of the terminal; Usually, control the terminal to switch to the device charging access mode; the identification pin control module 330 is used to obtain the identification pin if it detects that the power supply pin is lower than the set high level during the insertion process level, perform corresponding control according to the level of the identification pin.

可选地所述设定高电平为5V。Optionally, the set high level is 5V.

可选地所述标识引脚控制模块包括:引脚电平获取单元331、引脚电平检测单元332及数据模式切换单元333。Optionally, the identification pin control module includes: a pin level acquisition unit 331 , a pin level detection unit 332 and a data mode switching unit 333 .

其中,引脚电平获取单元331用于获取所述标识引脚的电平;引脚电平检测单元332用于检测所述标识引脚的电压值是否为设定低电平;数据模式切换单元333用于当检测到所述标识引脚的电压值为设定低电平时,控制所述终端切换为数据交换访问模式。Wherein, the pin level acquisition unit 331 is used to acquire the level of the identification pin; the pin level detection unit 332 is used to detect whether the voltage value of the identification pin is a set low level; data mode switching The unit 333 is configured to control the terminal to switch to the data exchange access mode when it is detected that the voltage value of the identification pin is set to a low level.

可选地所述充电装置还可以包括:引脚电压输出单元。Optionally, the charging device may further include: a pin voltage output unit.

其中,引脚电压输出单元用于在所述数据访问切换单元342将所述终端切换为执行数据交换访问模式之后,控制所述终端的USB接口的电源引脚输出电压。Wherein, the pin voltage output unit is used to control the output voltage of the power pin of the USB interface of the terminal after the data access switching unit 342 switches the terminal to the data exchange access mode.

本实施例提供的一种具有数据交换功能的终端的充电装置,在OTG转接线插入所述终端的USB接口的过程中,终端引脚监测模块首先监测到所述终端的USB接口电源引脚的电平值,当所述电源引脚为设定高电平时,充电模式切换模块控制所述终端切换至设备充电访问模式,当所述电源引脚小于设定高电平时,则标识引脚控制模块获取所述标识引脚的电平并根据所述标识引脚的电平执行相应控制。本实施例不仅实现了对终端的USB接口的访问模式切换,而且使OTG转接线可作为充电线使用,解决了现有技术中终端无法通过OTG转接线进行充电的问题。This embodiment provides a charging device for a terminal with a data exchange function. During the process of inserting the OTG adapter cable into the USB interface of the terminal, the terminal pin monitoring module first monitors the power supply pin of the USB interface of the terminal. level value, when the power supply pin is at a set high level, the charging mode switching module controls the terminal to switch to the device charging access mode, and when the power supply pin is lower than the set high level, the identification pin controls The module obtains the level of the identification pin and performs corresponding control according to the level of the identification pin. This embodiment not only realizes the switching of the access mode of the USB interface of the terminal, but also enables the OTG adapter cable to be used as a charging cable, which solves the problem that the terminal cannot be charged through the OTG adapter cable in the prior art.

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。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 (8)

1.一种终端,其特征在于,包括:通用串行总线USB接口,所述USB接口包括电源引脚、数据引脚、标识引脚和接地引脚;1. A kind of terminal, it is characterized in that, comprises: Universal Serial Bus USB interface, described USB interface comprises power supply pin, data pin, identification pin and grounding pin; 其中,所述USB接口的标识引脚的长度小于所述USB接口的电源引脚的长度。Wherein, the length of the identification pin of the USB interface is smaller than the length of the power pin of the USB interface. 2.根据权利要求1所述的终端,其特征在于,所述USB接口的标识引脚的长度小于或等于所述USB接口的电源引脚的长度的三分之二。2. The terminal according to claim 1, wherein the length of the identification pin of the USB interface is less than or equal to two-thirds of the length of the power supply pin of the USB interface. 3.一种具有数据交换功能的终端的充电方法,所述终端为权利要求1或2所述的终端,其特征在于,所述方法包括:3. A charging method for a terminal with a data exchange function, the terminal being the terminal according to claim 1 or 2, characterized in that the method comprises: 监测所述终端的USB接口的电源引脚和标识引脚的电平值;Monitor the level values of the power supply pin and the identification pin of the USB interface of the terminal; 在插入过程中,若监测到所述电源引脚为设定高电平时,控制所述终端切换至设备充电访问模式;During the insertion process, if it is detected that the power supply pin is set to a high level, control the terminal to switch to the device charging access mode; 在所述插入过程中,若监测到所述电源引脚小于设定高电平时,则获取所述标识引脚的电平,根据所述标识引脚的电平执行相应控制。During the insertion process, if it is detected that the power supply pin is lower than the set high level, the level of the identification pin is obtained, and corresponding control is performed according to the level of the identification pin. 4.根据权利要求3所述的充电方法,其特征在于,所述设定高电平为5V。4. The charging method according to claim 3, wherein the set high level is 5V. 5.根据权利要求3所述的充电方法,其特征在于,获取所述标识引脚的电平,根据所述标识引脚的电平执行相应控制包括:5. The charging method according to claim 3, wherein obtaining the level of the identification pin, and performing corresponding control according to the level of the identification pin comprises: 获取所述标识引脚的电平;Obtain the level of the identification pin; 检测所述标识引脚的电压值是否为设定低电平;Detecting whether the voltage value of the identification pin is a set low level; 若是,则控制所述终端切换为数据交换访问模式。If yes, control the terminal to switch to the data exchange access mode. 6.一种具有数据交换功能的终端的充电装置,所述终端为权利要求1或2所述的终端,其特征在于,所述装置包括:6. A charging device for a terminal with data exchange function, the terminal is the terminal according to claim 1 or 2, characterized in that the device comprises: 终端引脚监测模块,用于监测所述终端的USB接口的电源引脚和标识引脚;The terminal pin monitoring module is used to monitor the power supply pin and identification pin of the USB interface of the terminal; 充电模式切换模块,用于在插入过程中,若监测到所述电源引脚为设定高电平时,控制所述终端切换至设备充电访问模式;The charging mode switching module is used to control the terminal to switch to the device charging access mode if it is detected that the power supply pin is set to a high level during the insertion process; 标识引脚控制模块,用于在所述插入过程中,若监测到所述电源引脚小于设定高电平时,则获取所述标识引脚的电平,根据所述标识引脚的电平执行相应控制。The identification pin control module is used to obtain the level of the identification pin if it is detected that the power supply pin is lower than the set high level during the insertion process, and according to the level of the identification pin Execute corresponding controls. 7.根据权利要求6所述的充电装置,其特征在于,所述设定高电平为5V。7. The charging device according to claim 6, wherein the set high level is 5V. 8.根据权利要求6所述的充电装置,其特征在于,所述标识引脚控制模块包括:8. The charging device according to claim 6, wherein the identification pin control module comprises: 引脚电平获取单元,用于获取所述标识引脚的电平;a pin level acquisition unit, configured to acquire the level of the identified pin; 引脚电平检测单元,用于检测所述标识引脚的电压值是否为设定低电平;A pin level detection unit, configured to detect whether the voltage value of the identified pin is a set low level; 数据模式切换单元,用于当检测到所述标识引脚的电压值为设定低电平时,控制所述终端切换为数据交换访问模式。The data mode switching unit is configured to control the terminal to switch to a data exchange access mode when it is detected that the voltage value of the identification pin is set to a low level.

CN201510528743.0A 2015-08-25 2015-08-25 A charging method and device for a terminal and a terminal with a data exchange function Pending CN105068959A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510528743.0A CN105068959A (en) 2015-08-25 2015-08-25 A charging method and device for a terminal and a terminal with a data exchange function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510528743.0A CN105068959A (en) 2015-08-25 2015-08-25 A charging method and device for a terminal and a terminal with a data exchange function

Publications (1)

Publication Number Publication Date
CN105068959A true CN105068959A (en) 2015-11-18

Family

ID=54498335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510528743.0A Pending CN105068959A (en) 2015-08-25 2015-08-25 A charging method and device for a terminal and a terminal with a data exchange function

Country Status (1)

Country Link
CN (1) CN105068959A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106532310A (en) * 2016-12-13 2017-03-22 北京小米移动软件有限公司 Improved standard USB interface, USB structure and terminal
CN106774769A (en) * 2016-12-21 2017-05-31 浙江大华技术股份有限公司 The changing method and device of a kind of terminal work mode, handheld terminal
WO2018045684A1 (en) * 2016-09-09 2018-03-15 广州视源电子科技股份有限公司 Interface device, and method and apparatus for secure access
WO2018113128A1 (en) * 2016-12-20 2018-06-28 华为技术有限公司 Method for recognizing plug-and-play device, and electronic device
CN109086236A (en) * 2017-06-14 2018-12-25 国基电子(上海)有限公司 Power source charges path switching circuit and its electronic equipment
CN109086234A (en) * 2018-07-26 2018-12-25 上海闻泰电子科技有限公司 Device identification method, device, identification equipment and storage medium
CN110442539A (en) * 2019-06-17 2019-11-12 华为技术有限公司 Mobile phone OTG switching method and apparatus
CN111339007A (en) * 2020-02-28 2020-06-26 深圳市广和通无线股份有限公司 USB device control method and device, computer device and storage medium
CN111835050A (en) * 2019-04-22 2020-10-27 北京小米移动软件有限公司 Charging terminal, method and device
CN112042174A (en) * 2018-12-07 2020-12-04 华为技术有限公司 Intelligent support and mode starting method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101901201A (en) * 2010-08-06 2010-12-01 中兴通讯股份有限公司 Method and device for realizing USB OTG function on electronic equipment
CN101924808A (en) * 2010-08-18 2010-12-22 萨基姆移动电话研发(宁波)有限公司 Mobile terminal
CN103345460A (en) * 2013-06-26 2013-10-09 惠州Tcl移动通信有限公司 Communication module for achieving hot plug and terminal
US20140051479A1 (en) * 2011-04-22 2014-02-20 Qirui Li Electronic device with usb interface and method for starting usb communication therefor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101901201A (en) * 2010-08-06 2010-12-01 中兴通讯股份有限公司 Method and device for realizing USB OTG function on electronic equipment
CN101924808A (en) * 2010-08-18 2010-12-22 萨基姆移动电话研发(宁波)有限公司 Mobile terminal
US20140051479A1 (en) * 2011-04-22 2014-02-20 Qirui Li Electronic device with usb interface and method for starting usb communication therefor
CN103345460A (en) * 2013-06-26 2013-10-09 惠州Tcl移动通信有限公司 Communication module for achieving hot plug and terminal

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018045684A1 (en) * 2016-09-09 2018-03-15 广州视源电子科技股份有限公司 Interface device, and method and apparatus for secure access
CN106532310A (en) * 2016-12-13 2017-03-22 北京小米移动软件有限公司 Improved standard USB interface, USB structure and terminal
WO2018113128A1 (en) * 2016-12-20 2018-06-28 华为技术有限公司 Method for recognizing plug-and-play device, and electronic device
CN108475245A (en) * 2016-12-20 2018-08-31 华为技术有限公司 Plug and play device identification method and electronic device
CN106774769A (en) * 2016-12-21 2017-05-31 浙江大华技术股份有限公司 The changing method and device of a kind of terminal work mode, handheld terminal
CN106774769B (en) * 2016-12-21 2021-09-21 浙江大华技术股份有限公司 Terminal working mode switching method and device and handheld terminal
CN109086236A (en) * 2017-06-14 2018-12-25 国基电子(上海)有限公司 Power source charges path switching circuit and its electronic equipment
US10998737B2 (en) 2017-06-14 2021-05-04 Ambit Microsystems (Shanghai) Ltd. Intelligent switch system
CN109086234A (en) * 2018-07-26 2018-12-25 上海闻泰电子科技有限公司 Device identification method, device, identification equipment and storage medium
CN112042174B (en) * 2018-12-07 2022-03-29 华为技术有限公司 Intelligent support and mode starting method
CN112042174A (en) * 2018-12-07 2020-12-04 华为技术有限公司 Intelligent support and mode starting method
CN111835050A (en) * 2019-04-22 2020-10-27 北京小米移动软件有限公司 Charging terminal, method and device
CN110442539B (en) * 2019-06-17 2021-08-31 荣耀终端有限公司 Mobile phone OTG switching method and device
CN110442539A (en) * 2019-06-17 2019-11-12 华为技术有限公司 Mobile phone OTG switching method and apparatus
CN111339007A (en) * 2020-02-28 2020-06-26 深圳市广和通无线股份有限公司 USB device control method and device, computer device and storage medium
CN111339007B (en) * 2020-02-28 2021-10-08 深圳市广和通无线股份有限公司 USB device control method and device, computer device and storage medium

Similar Documents

Publication Publication Date Title
CN105068959A (en) 2015-11-18 A charging method and device for a terminal and a terminal with a data exchange function
EP3416062B1 (en) 2020-02-05 Method and terminal device for establishing connection between devices with universal serial bus usb type-c interface
JP6643994B2 (en) 2020-02-12 Method and apparatus for charging an electronic device via a USB connection
CN110851387B (en) 2022-08-19 Interface function configuration method and electronic equipment
CN103618356B (en) 2016-10-19 A charging system and charging method for a mobile terminal
CN104272216A (en) 2015-01-07 Electronic device and control method thereof
CN103106167A (en) 2013-05-15 Universal Serial Bus (USB) equipment and control method thereof
CN106786960B (en) 2019-10-25 Charging control method, device and terminal
KR20160030261A (en) 2016-03-16 Apparatus and method to change current limit
CN105071484B (en) 2018-11-20 A kind of charging method and device of the terminal with data exchanging function
CN109478176A (en) 2019-03-15 A kind of methods, devices and systems of USB Type-C port device identification opposite equip.
CN105048018B (en) 2017-07-21 The charging method and device of a kind of terminal with data exchanging function
CN201039411Y (en) 2008-03-19 A mobile phone with self-adapted charging device
CN108681514A (en) 2018-10-19 Equipment detection method, device, storage medium and electronic equipment
CN108054794A (en) 2018-05-18 Charging and discharging method and device for intelligent terminal, terminal and storage medium
CN105896639B (en) 2020-11-20 Charging control method and electronic equipment
US10802991B2 (en) 2020-10-13 Pluggable module identification system
US9864714B2 (en) 2018-01-09 Electronic system for performing recharging and data communication
CN106856289B (en) 2020-04-07 Electronic equipment and circuit thereof, switching equipment and circuit thereof and signal processing system
CN105824732A (en) 2016-08-03 USB detection method and detection system
CN107706977B (en) 2021-01-08 Method for detecting charging current and charging device
CN216530587U (en) 2022-05-13 Power supply connector for supplying power to master equipment and slave equipment
CN105098854A (en) 2015-11-25 Charging method and electronic device
CN103838343B (en) 2017-04-19 Data interface, electronic device and method for expanding current output quantity of data interface
JP2015207155A (en) 2015-11-19 Electronic apparatus

Legal Events

Date Code Title Description
2015-11-18 C06 Publication
2015-11-18 PB01 Publication
2015-12-16 C10 Entry into substantive examination
2015-12-16 SE01 Entry into force of request for substantive examination
2019-07-12 RJ01 Rejection of invention patent application after publication

Application publication date: 20151118

2019-07-12 RJ01 Rejection of invention patent application after publication