CN104778144A - OTG-based (On-The-Go-based) intelligent terminal operation control method and OTG-based intelligent terminal operation control device - Google Patents

OTG-based (On-The-Go-based) intelligent terminal operation control method and OTG-based intelligent terminal operation control device Download PDF

Info

Publication number
CN104778144A
CN104778144A CN201510191715.4A CN201510191715A CN104778144A CN 104778144 A CN104778144 A CN 104778144A CN 201510191715 A CN201510191715 A CN 201510191715A CN 104778144 A CN104778144 A CN 104778144A
Authority
CN
China
Prior art keywords
intelligent terminal
usb interface
otg
otg function
voltage
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.)
Granted
Application number
CN201510191715.4A
Other languages
Chinese (zh)
Other versions
CN104778144B (en
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.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201510191715.4A priority Critical patent/CN104778144B/en
Publication of CN104778144A publication Critical patent/CN104778144A/en
Application granted granted Critical
Publication of CN104778144B publication Critical patent/CN104778144B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention is applicable to the field of communication technology, and provides an OTG-based (On-The-Go-based) intelligent terminal operation control method and an OTG-based intelligent terminal operation control device. The method includes the following steps: under the condition that the OTG function of an intelligent terminal is switched off, if a universal serial bus (USB) interrupt request is received, then the voltage value of a USB interface is acquired; when the voltage value of the USB interface is within a preset range, the intelligent terminal is charged by an external device connected with the USB interface. The OTG function of the intelligent terminal is switched off by default, the voltage value of the USB interface is acquired when the USB interrupt request is received, the intelligent terminal is charged by the external device connected with the USB interface when the voltage value of the USB interface is within the preset range, consequently, the intelligent terminal is prevented from being always in the OTG mode due to the corrosion of the USB interface, and the intelligent terminal still can be normally charged under the condition that the OTG USB interface is corroded.

Description

Based on intelligent terminal method of controlling operation thereof and the device of OTG
Technical field
The invention belongs to communication technical field, particularly relate to the intelligent terminal method of controlling operation thereof based on OTG and device.
Background technology
Traditional USB (Universal Serial Bus, USB (universal serial bus)) use the framework of master-slave mode, usb host end (i.e. PC (Personal Computer, personal computer)) is " master ", and USB peripheral equipment be " from ".Traditional application is all, by USB, peripheral equipment is connected to PC, and carries out exchanges data under the control of PC.USB peripheral equipment can not start data transmission voluntarily.
OTG (On-The-Go) technology is exactly when not having PC, realizes the data transmission of equipment room.Such as, digital camera is directly connected on printer, by OTG technology, connects the USB port of two equipment rooms, is printed immediately by the photograph taken; Also by the data in digital camera, can be sent on the portable hard drive of USB interface by OTG.
But, the USB interface that the OTG function of intelligent terminal is corresponding is easily corroded owing to often plugging use or be exposed to outer for a long time, make USB interface short circuit, and then make the intelligent terminal with OTG function continue access device to be detected, cause intelligent terminal be in OTG pattern always and cannot charge normal.
Summary of the invention
Given this, the embodiment of the present invention provides a kind of intelligent terminal method of controlling operation thereof based on OTG and device, to solve the problem that cannot charge normal because USB interface corrosion causes intelligent terminal to be in OTG pattern always in prior art.
On the one hand, embodiments provide a kind of intelligent terminal method of controlling operation thereof based on OTG, comprising:
When the OTG function of described intelligent terminal is closed, if receive general-purpose serial bus USB interrupt request, then obtain the magnitude of voltage of USB interface;
When the magnitude of voltage of described USB interface is in preset range, charged by the external equipment be connected with described USB interface.
Second aspect, embodiments provides a kind of intelligent terminal operating control device based on OTG, comprising:
Voltage acquisition unit, for when the OTG function of described intelligent terminal is closed, if receive general-purpose serial bus USB interrupt request, then obtains the magnitude of voltage of USB interface;
Charhing unit, for when the magnitude of voltage of described USB interface is in preset range, is charged by the external equipment be connected with described USB interface.
The beneficial effect that the embodiment of the present invention compared with prior art exists is: the embodiment of the present invention closes the OTG function of intelligent terminal by acquiescence, when receiving USB interrupt request, obtain the magnitude of voltage of USB interface, when the magnitude of voltage of USB interface is in preset range, charged by the external equipment be connected with USB interface, prevent from thus, because USB interface corrosion causes intelligent terminal to be in OTG pattern always, under the situation that intelligent terminal is corroded in the USB interface of OTG, also normally to complete charging.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the realization flow figure of the intelligent terminal method of controlling operation thereof based on OTG that the embodiment of the present invention provides;
Fig. 2 is the realization flow figure of the intelligent terminal method of controlling operation thereof based on OTG that another embodiment of the present invention provides;
Fig. 3 is the realization flow figure of the intelligent terminal method of controlling operation thereof based on OTG that another embodiment of the present invention provides;
Fig. 4 is the realization flow figure of the intelligent terminal method of controlling operation thereof based on OTG that another embodiment of the present invention provides;
Fig. 5 is the structured flowchart of the intelligent terminal operating control device based on OTG that the embodiment of the present invention provides.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Fig. 1 shows the realization flow figure of the intelligent terminal method of controlling operation thereof based on OTG that the embodiment of the present invention provides, and details are as follows:
In step S101, when the OTG function of described intelligent terminal is closed, if receive general-purpose serial bus USB interrupt request, then obtain the magnitude of voltage of USB interface.
Intelligent terminal in the embodiment of the present invention has OTG function.In embodiments of the present invention, the reason sending USB interrupt request includes but not limited to: USB interface access power-supply device, USB interface access OTG equipment or USB interface short circuit because of corrosion.Wherein, OTG equipment refers to the equipment with OTG function, includes but not limited to smart mobile phone, panel computer, PDA (Personal Digital Assistant, personal digital assistant), video camera or printer.When receiving USB interrupt request, obtain the magnitude of voltage of USB interface, to determine that whether the current external equipment be connected with USB is for power-supply device.
In step s 102, when the magnitude of voltage of described USB interface is in preset range, charged by the external equipment be connected with described USB interface.
Such as, preset range is 4.5V ~ 5V, then, when the magnitude of voltage of USB interface is between 4.5V ~ 5V, judge that the magnitude of voltage of USB interface is produced by power-supply device, namely the current external equipment be connected with USB interface is power-supply device.Here, power-supply device includes but not limited to charge power supply, portable power source, PC or notebook computer.When judging the current external equipment be connected with USB interface as power-supply device, charged by the external equipment be connected with USB interface.
Fig. 2 shows the realization flow figure of the intelligent terminal method of controlling operation thereof based on OTG that another embodiment of the present invention provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.With reference to Fig. 2:
In step s 201, the OTG function of described intelligent terminal is closed;
In step S202, when the OTG function of described intelligent terminal is closed, if receive general-purpose serial bus USB interrupt request, then obtain the magnitude of voltage of USB interface;
In step S203, when the magnitude of voltage of described USB interface is in preset range, charged by the external equipment be connected with described USB interface.
In embodiments of the present invention, acquiescence closes the OTG function of intelligent terminal, prevents thus because USB interface corrosion causes intelligent terminal to be in OTG pattern always.
Fig. 3 shows the realization flow figure of the intelligent terminal method of controlling operation thereof based on OTG that another embodiment of the present invention provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.With reference to Fig. 3:
In step S301, close the OTG function of intelligent terminal;
In step s 302, when the OTG function of described intelligent terminal is closed, if receive general-purpose serial bus USB interrupt request, then the magnitude of voltage of USB interface is obtained;
In step S303, judge that the magnitude of voltage of USB interface is whether in preset range, if so, performs step S304; If not, step S305 is performed;
In step s 304, the external equipment by being connected with USB interface charges;
In step S305, directly start the OTG function of intelligent terminal.
As an alternative embodiment of the invention, when the magnitude of voltage of USB interface is not in preset range, directly starts the OTG function of intelligent terminal, make intelligent terminal and external equipment carry out data transmission by OTG.
Fig. 4 shows the realization flow figure of the intelligent terminal method of controlling operation thereof based on OTG that another embodiment of the present invention provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.With reference to Fig. 4:
In step S401, close the OTG function of intelligent terminal;
In step S402, when the OTG function of described intelligent terminal is closed, if receive general-purpose serial bus USB interrupt request, then obtain the magnitude of voltage of USB interface;
In step S403, judge that the magnitude of voltage of USB interface is whether in preset range, if so, performs step S404; If not, step S405 is performed;
In step s 404, the external equipment by being connected with USB interface charges;
In step S405, judge whether the instruction of the startup OTG function receiving user's input, if so, perform step S406; If not, step S407 is performed;
In step S406, start the OTG function of intelligent terminal;
In step S 407, the closed condition of the OTG function of intelligent terminal is kept.
As one embodiment of the present of invention, when the magnitude of voltage of USB interface is not in preset range, show that the current external equipment be connected with USB interface is not power-supply device, now, USB interface may access OTG equipment, or USB interface short circuit due to corrosion.In this case, inquire whether user starts OTG function.If do not receive the instruction of the startup OTG function of user's input, then show that current USB interrupt request sends due to USB interface corrosion short circuit to a great extent, therefore keep the closed condition of the OTG function of intelligent terminal; If receive the instruction of the startup OTG function of user's input, then start the OTG function of intelligent terminal, make intelligent terminal and external equipment carry out data transmission by OTG.
The embodiment of the present invention closes the OTG function of intelligent terminal by acquiescence, when receiving USB interrupt request, obtain the magnitude of voltage of USB interface, when the magnitude of voltage of USB interface is in preset range, charged by the external equipment be connected with USB interface, prevent from thus, because USB interface corrosion causes intelligent terminal to be in OTG pattern always, under the situation that intelligent terminal is corroded in the USB interface of OTG, also normally to complete charging.
Should be understood that in embodiments of the present invention, the size of the sequence number of above-mentioned each process does not also mean that the priority of execution sequence, and the execution sequence of each process should be determined with its function and internal logic, and should not form any restriction to the implementation process of the embodiment of the present invention.
Fig. 5 shows the structured flowchart of the intelligent terminal operating control device based on OTG that the embodiment of the present invention provides, and this device may be used for the intelligent terminal operating control device based on OTG shown in service chart 1 to Fig. 4.This device can be intelligent terminal, also for being built in the device in intelligent terminal, can not limit at this.For convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.
With reference to Fig. 5, this device comprises:
Voltage acquisition unit 51, for when the OTG function of described intelligent terminal is closed, if receive general-purpose serial bus USB interrupt request, then obtains the magnitude of voltage of USB interface;
Charhing unit 52, for when the magnitude of voltage of described USB interface is in preset range, is charged by the external equipment be connected with described USB interface.
Preferably, described device also comprises:
OTG function closing unit 53, for closing the OTG function of described intelligent terminal.
Preferably, described device also comprises:
OTG function on unit 54, for when the magnitude of voltage of described USB interface is not in described preset range, directly starts the OTG function of described intelligent terminal.
Preferably, described OTG function on unit 54 specifically for:
When the magnitude of voltage of described USB interface is not in described preset range, judge whether the instruction of the startup OTG function receiving user's input;
If receive the instruction of described startup OTG function, then start the OTG function of described intelligent terminal, otherwise keep the state that the OTG function of described intelligent terminal is closed.
The embodiment of the present invention closes the OTG function of intelligent terminal by acquiescence, when receiving USB interrupt request, obtain the magnitude of voltage of USB interface, when the magnitude of voltage of USB interface is in preset range, charged by the external equipment be connected with USB interface, prevent from thus, because USB interface corrosion causes intelligent terminal to be in OTG pattern always, under the situation that intelligent terminal is corroded in the USB interface of OTG, also normally to complete charging.
Those of ordinary skill in the art can recognize, in conjunction with unit and the algorithm steps of each example of embodiment disclosed herein description, can realize with the combination of electronic hardware or computer software and electronic hardware.These functions perform with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can use distinct methods to realize described function to each specifically should being used for, but this realization should not thought and exceeds scope of the present invention.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the device of foregoing description and the specific works process of unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
In several embodiments that the application provides, should be understood that disclosed apparatus and method can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of unit or communication connection can be electrical, machinery or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.
If described function using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part of the part that technical scheme of the present invention contributes to prior art in essence in other words or this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform all or part of step of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, ROM (read-only memory) (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. various can be program code stored medium.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should described be as the criterion with the protection domain of claim.

Claims (8)

1., based on an intelligent terminal method of controlling operation thereof of OTG, it is characterized in that, comprising:
When the OTG function of described intelligent terminal is closed, if receive general-purpose serial bus USB interrupt request, then obtain the magnitude of voltage of USB interface;
When the magnitude of voltage of described USB interface is in preset range, charged by the external equipment be connected with described USB interface.
2. the method for claim 1, is characterized in that, when the described OTG function at described intelligent terminal is closed, if receive general-purpose serial bus USB interrupt request, then before obtaining the magnitude of voltage of USB interface, described method also comprises:
Close the OTG function of described intelligent terminal.
3. method as claimed in claim 2, it is characterized in that, after the magnitude of voltage of described acquisition USB interface, described method also comprises:
When the magnitude of voltage of described USB interface is not in described preset range, directly start the OTG function of described intelligent terminal.
4. method as claimed in claim 3, is characterized in that, when the magnitude of voltage of described USB interface is not in described preset range, the OTG function directly starting described intelligent terminal comprises:
When the magnitude of voltage of described USB interface is not in described preset range, judge whether the instruction of the startup OTG function receiving user's input;
If receive the instruction of described startup OTG function, then start the OTG function of described intelligent terminal, otherwise keep the state that the OTG function of described intelligent terminal is closed.
5., based on an intelligent terminal operating control device of OTG, it is characterized in that, comprising:
Voltage acquisition unit, for when the OTG function of described intelligent terminal is closed, if receive general-purpose serial bus USB interrupt request, then obtains the magnitude of voltage of USB interface;
Charhing unit, for when the magnitude of voltage of described USB interface is in preset range, is charged by the external equipment be connected with described USB interface.
6. device as claimed in claim 5, it is characterized in that, described device also comprises:
OTG function closing unit, for closing the OTG function of described intelligent terminal.
7. device as claimed in claim 6, it is characterized in that, described device also comprises:
OTG function on unit, for when the magnitude of voltage of described USB interface is not in described preset range, directly starts the OTG function of described intelligent terminal.
8. device as claimed in claim 7, is characterized in that, described OTG function on unit specifically for:
When the magnitude of voltage of described USB interface is not in described preset range, judge whether the instruction of the startup OTG function receiving user's input;
If receive the instruction of described startup OTG function, then start the OTG function of described intelligent terminal, otherwise keep the state that the OTG function of described intelligent terminal is closed.
CN201510191715.4A 2015-04-21 2015-04-21 Intelligent terminal method of controlling operation thereof and device based on OTG Active CN104778144B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510191715.4A CN104778144B (en) 2015-04-21 2015-04-21 Intelligent terminal method of controlling operation thereof and device based on OTG

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510191715.4A CN104778144B (en) 2015-04-21 2015-04-21 Intelligent terminal method of controlling operation thereof and device based on OTG

Publications (2)

Publication Number Publication Date
CN104778144A true CN104778144A (en) 2015-07-15
CN104778144B CN104778144B (en) 2018-06-19

Family

ID=53619618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510191715.4A Active CN104778144B (en) 2015-04-21 2015-04-21 Intelligent terminal method of controlling operation thereof and device based on OTG

Country Status (1)

Country Link
CN (1) CN104778144B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108628426A (en) * 2017-03-17 2018-10-09 立锜科技股份有限公司 Operation mode decision circuitry and its method
CN110442539A (en) * 2019-06-17 2019-11-12 华为技术有限公司 Mobile phone OTG switching method and apparatus

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006060527A3 (en) * 2004-11-30 2006-09-08 Advanced Micro Devices Inc Usb on-the-go controller
CN1894681A (en) * 2003-11-22 2007-01-10 诺基亚公司 Interface for serial data communication
CN101359316A (en) * 2007-08-03 2009-02-04 大唐移动通信设备有限公司 Method and apparatus for implementing general-purpose serial bus USB OTG
CN101901201A (en) * 2010-08-06 2010-12-01 中兴通讯股份有限公司 Method and device for realizing USB OTG function on electronic equipment
CN104461999A (en) * 2014-12-10 2015-03-25 上海畅联智融通讯科技有限公司 Circuit for automatically implementing functions of USB (universal serial bus) boot disks and OTG (on-the-go) function

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1894681A (en) * 2003-11-22 2007-01-10 诺基亚公司 Interface for serial data communication
WO2006060527A3 (en) * 2004-11-30 2006-09-08 Advanced Micro Devices Inc Usb on-the-go controller
CN101359316A (en) * 2007-08-03 2009-02-04 大唐移动通信设备有限公司 Method and apparatus for implementing general-purpose serial bus USB OTG
CN101901201A (en) * 2010-08-06 2010-12-01 中兴通讯股份有限公司 Method and device for realizing USB OTG function on electronic equipment
CN104461999A (en) * 2014-12-10 2015-03-25 上海畅联智融通讯科技有限公司 Circuit for automatically implementing functions of USB (universal serial bus) boot disks and OTG (on-the-go) function

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
罗欣武: "USB2.0主机/设备控制器IP设计和OTG研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108628426A (en) * 2017-03-17 2018-10-09 立锜科技股份有限公司 Operation mode decision circuitry and its method
CN108628426B (en) * 2017-03-17 2021-04-27 立锜科技股份有限公司 Operation mode judging circuit and method thereof
CN110442539A (en) * 2019-06-17 2019-11-12 华为技术有限公司 Mobile phone OTG switching method and apparatus
CN110442539B (en) * 2019-06-17 2021-08-31 荣耀终端有限公司 Mobile phone OTG switching method and device

Also Published As

Publication number Publication date
CN104778144B (en) 2018-06-19

Similar Documents

Publication Publication Date Title
US20160266625A1 (en) Method for Providing Power to an Electronic Device
CN103378378B (en) A kind of charging method and device
EP2669761A2 (en) System, apparatus, and method of performing charging operation in host mode
WO2017113683A1 (en) Usb data line comprising extension interface and control method thereof
WO2017176303A1 (en) Intelligent power dongle
EP2980958B1 (en) Charging control method and electronic device for supporting the same
CN108228509B (en) USB interface switching device and electronic equipment
CN102750248A (en) USB (Universal Serial Bus) equipment working mode switching method and USB equipment
CN103473202B (en) USB OTG, electronic equipment and the method realizing OTG function
EP3148039A1 (en) Fast charging method, power source adapter and mobile terminal
CN104572217A (en) Updating method and system of wearable intelligent device
CN105068959A (en) Terminal and charging method and apparatus for terminal with data exchange function
CN105071484A (en) Charging method and apparatus of terminal having data exchange function
KR101821016B1 (en) Apparatus, system and method for allocating identifiers to components of a control system
US20180097315A1 (en) Power adapter, terminal device, charging system, and charging method
CN105048018A (en) Charging method and device for terminal having on-the-go (OTG) function
US20120089763A1 (en) Computer and usb interface module thereof
CN104778144A (en) OTG-based (On-The-Go-based) intelligent terminal operation control method and OTG-based intelligent terminal operation control device
WO2021018208A1 (en) Firmware upgrade method and apparatus, electronic device, and storage medium
CN112558741A (en) Protection method, protection device, electronic apparatus, readable storage medium, and chip
US7996697B2 (en) Matching system of electronic device and peripheral device and matching method thereof
CN104281462A (en) Firmware upgrade configuration saving system and method
CN105357579A (en) Online upgrading method for set top box, related device and set top box
CN106155254B (en) Method, electronic equipment and the system equipment of power management
WO2017004876A1 (en) Method and terminal for configuring output current

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

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 523841 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

CP03 Change of name, title or address