CN110442539A - Mobile phone OTG switching method and apparatus - Google Patents

Mobile phone OTG switching method and apparatus Download PDF

Info

Publication number
CN110442539A
CN110442539A CN201910521576.5A CN201910521576A CN110442539A CN 110442539 A CN110442539 A CN 110442539A CN 201910521576 A CN201910521576 A CN 201910521576A CN 110442539 A CN110442539 A CN 110442539A
Authority
CN
China
Prior art keywords
mobile phone
otg
mode
current value
thresholding
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
CN201910521576.5A
Other languages
Chinese (zh)
Other versions
CN110442539B (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.)
Honor Device Co Ltd
Original Assignee
Huawei Technologies Co 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910521576.5A priority Critical patent/CN110442539B/en
Publication of CN110442539A publication Critical patent/CN110442539A/en
Application granted granted Critical
Publication of CN110442539B publication Critical patent/CN110442539B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • 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
    • 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/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Landscapes

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

Abstract

The embodiment of the present application provides a kind of mobile phone OTG switching method and apparatus, in the case where mobile phone is in OTG mode, detects the current value of power bus Vbus pin in the general-purpose serial bus USB interface of the mobile phone;It is understood that, if the current value is too small, it is considered that without constituting current loop in Vbus pin, mobile phone is accessed without other electronic equipments, and then can consider that mobile phone false triggering enters OTG mode, therefore when current value is less than the first thresholding, the mobile phone is from OTG pattern switching to charge mode, when current value is greater than the second threshold value, mobile phone executes the OTG identification process under the OTG mode, avoids because of the phenomenon that entering OTG mode and can not charge normal of mobile phone mistake.

Description

Mobile phone OTG switching method and apparatus
Technical field
This application involves the communication technology more particularly to a kind of mobile phone OTG switching method and apparatus.
Background technique
With the development of universal serial bus (universal serial bus, USB) technology, gradually produces and be based on OTG (On-The-Go) technology of USB, OTG technology can be no PC (personal computer, PC) the case where Under, realize the data transmission of electric room.For example, digital camera can be made to be directly connected on printer by OTG technology, The photo printing taken is come out.
In the prior art, in order to realize OTG function, usually at the end USB of electronic equipment (such as mobile phone, tablet computer etc.) Mouthful add pin ID so that electronic equipment can use to the setting of pin ID realize identification between other electronic equipments and Data interaction.In concrete application, by taking electronic equipment is to be able to achieve the mobile phone of OTG function as an example, usb protocol is provided: the ID of mobile phone When pin is high level, mobile phone enters charge mode, which can specifically refer to: mobile phone can be charged by USB; When the ID pin of mobile phone is low level, mobile phone be in OTG mode, which can specifically refer to: mobile phone can by USB and Other electronic equipments execute OTG process flow, and the Vbus pin of mobile phone USB exports 5V or so electricity to other electronic equipments Pressure.
But in the prior art, often occur normally filling after being able to achieve the mobile phone access charge power supply of OTG function The phenomenon of electricity, to influence user's use.
Summary of the invention
The application provides a kind of mobile phone OTG switching method and apparatus, and avoiding the occurrence of mobile phone access charge power supply later can not The phenomenon that charging normal.
The application first aspect provides a kind of mobile phone OTG switching method, comprising: in the case where mobile phone is in OTG mode, The mobile phone detects the current value of power bus Vbus pin in the general-purpose serial bus USB interface of the mobile phone;When the current value is small When the first thresholding, the mobile phone is from the OTG pattern switching to charge mode.When the current value is greater than the second thresholding, the mobile phone Execute the OTG identification process under the OTG mode;Wherein, which is less than second threshold value.
In a kind of illustrative mode, which includes: the arbitrary value between 0 to 1 milliampere.
In a kind of illustrative mode, which includes: the arbitrary value between 1 milliampere to 10 milliamperes.
In a kind of illustrative mode, when the current value is less than the first thresholding, the mobile phone is from the OTG pattern switching to filling Power mode includes: when the current value is less than the first thresholding, which terminates OTG identification process, and closes the Vbus pin Output voltage.
The application second aspect provides one mode switching device, comprising: detection module, for being in OTG mould in mobile phone In the case where formula, the current value of power bus Vbus pin in the general-purpose serial bus USB interface of the mobile phone is detected.Switch mould Block is used for when the current value is less than the first thresholding, by the mobile phone from the OTG pattern switching to charge mode.Execution module is used In when the current value is greater than the second thresholding, the OTG identification process under the OTG mode is executed, wherein first threshold value is less than Second threshold value.
In a kind of illustrative mode, which includes: the arbitrary value between 0 to 1 milliampere;The second thresholding packet It includes: the arbitrary value between 1 milliampere to 10 milliamperes.
In a kind of illustrative mode, which includes: switching submodule, for when the current value is less than first In limited time, terminate the OTG identification process of the mobile phone, and close the output voltage of the Vbus pin.
The application third aspect provides a kind of mobile phone, including processor, memory and transceiver, and the memory is for storing Instruction, which is used for and other equipment communication, and the processor is for executing the instruction stored in the memory, so that the hand Machine executes such as the described in any item methods of the application first aspect.
The application fourth aspect provides a kind of computer readable storage medium, which has finger It enables, when the instruction is performed, so that computer executes such as the described in any item methods of the application first aspect.
The 5th aspect of the application provides a kind of computer program product, which includes instruction, when this refers to Order is performed, so that computer executes such as the described in any item methods of the application first aspect.
The aspect of the application the 6th provides a kind of system on chip or System on Chip/SoC, the system on chip or System on Chip/SoC and can answer For the network equipment, the system on chip or System on Chip/SoC include: at least one communication interface, at least one processor, at least One memory, the communication interface, memory and processor are deposited by bus bar, the processor by executing in the memory The instruction of storage, so that method described in the application first aspect can be performed in the network equipment.
The embodiment of the present application provides a kind of mobile phone OTG switching method and apparatus, inventor has found that the prior art In why often there is being able to achieve the phenomenon that can not charging normal after the mobile phone access charge power supply of OTG function, be because The mobile phone mistake enters OTG mode, and specifically, in USB pin, ID pin is adjacent with ground connection (GND) pin, and at this In the use process of mobile phone, which be may be in moist or dust environment, so that USB port is corroded, USB Adjacent ID pin and GND pin may be because that corrosion causes short circuit in port, so that the level of the ID pin of mobile phone is pulled low, Mobile phone mistake enters OTG mode, and then causes mobile phone that can not charge normal.Based on the discovery, in the embodiment of the present application, in hand In the case that machine is in OTG mode, which detects power bus Vbus pin in the general-purpose serial bus USB interface of the mobile phone Current value;If being appreciated that, the current value is too small, it is believed that without constituting current loop in Vbus pin, i.e., without it His electronic equipment accesses mobile phone, and then can consider that mobile phone false triggering enters OTG mode, therefore when current value is less than first In limited time, mobile phone is from OTG pattern switching to charge mode, and when current value is greater than the second threshold value, mobile phone executes the OTG mode Under OTG identification process, thus avoid because the entering OTG mode of mobile phone mistake and the phenomenon that can not charge normal.
Detailed description of the invention
Fig. 1 is the circuit diagram of the pattern switching application scenarios of the embodiment of the present application;
Fig. 2 is the flow chart of mobile phone OTG switching method provided by the embodiments of the present application;
Fig. 3 is the illustrative view of functional configuration of mobile phone OTG switching device provided by the embodiments of the present application;
Fig. 4 is the structural schematic diagram of mobile phone provided by the embodiments of the present application.
Specific embodiment
Term used in following embodiment is intended merely to for the purpose of describing particular embodiments, and is not intended as pair The limitation of the application.As the description of the present application and it is used in the attached claims, odd number expression form " one It is a ", "an", "the", " above-mentioned ", "the" and " this " be intended to also include such as " one or more " this expression-form, remove It is non-hereinafter clearly to have opposite instruction thereon.It is also understood that in the following embodiment of the application, "at least one", " one It is a or multiple " refer to one, two or more.Term "and/or" is indicated for describing the incidence relation of affiliated partner There may be three kinds of relationships;For example, A and/or B, can indicate: individualism A exists simultaneously A and B, the feelings of individualism B Condition, wherein A, B can be odd number or plural number.Character "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or".
The reference " one embodiment " described in the present specification or " some embodiments " etc. mean the one of the application It include special characteristic, structure or the feature in conjunction with embodiment description in a or multiple embodiments.As a result, in the present specification The sentence " in one embodiment " of difference appearance, " in some embodiments ", " in some other embodiment ", " In In other embodiment " etc. it is uninevitable all referring to identical embodiment, mean " one or more but not all Embodiment ", only otherwise in addition especially emphasize.The terms "include", "comprise", " having " and their deformation are all Mean " including but not limited to ", only otherwise in addition especially emphasizes.
The following present the electronic equipment for having OTG function, for the user interface of such electronic equipment and for making With the embodiment of such electronic equipment.In some embodiments, electronic equipment can be also such as personal comprising other functions The portable electronic device of digital assistants and/or music player functionality, such as mobile phone, have wireless telecommunications function at tablet computer The wearable electronic (such as smartwatch) of energy.The exemplary embodiment of portable electronic device includes but is not limited to carry Or the portable electronic device of other operating systems.Above-mentioned portable electronic device It is also possible to other portable electronic devices, laptop computer (laptop) etc..It is to be further understood that other one In a little embodiments, above-mentioned electronic equipment may not be portable electronic device, but desktop computer.Mobile phone mobile phone mobile phone hand Hand set mobile phone mobile phone mobile phone
Mobile phone involved in the embodiment of the present application may include hardware layer, operate in operating system layer on hardware layer, And operate in application layer on operating system layer.The hardware layer includes central processing unit (central processing Unit, CPU), the hardware such as memory management unit (memory management unit, MMU) and memory (also referred to as main memory).It should Operating system can be any one or more computer operating system that business processing is realized by process (process), example Such as, (SuSE) Linux OS, Unix operating system, Android operation system, iOS operating system or Windows operating system etc.. The application layer includes the application such as browser, address list, word processor, instant communication software.
In concrete application, (OTG equipment is referred to as) in the mobile phone for having OTG function, OTG equipment often occurs It is existing that the OTG that can not be charged normal is set the phenomenon that having no idea to charge normal after USB interface accesses charge power supply In standby processing mode, it will usually which directly replacement USB interface results in waste of resources.
And inventor has found not charging normal after OTG equipment access charge power supply, it may be possible to because of OTG device Errors Cause into OTG mode.Specifically, in USB pin, ID pin is adjacent with ground connection (GND) pin, and makes in mobile phone With in the process, mobile phone be may be in moist or dust environment, so that the USB port of mobile phone is corroded, USB port In adjacent ID pin and GND pin may be because that corrosion causes short circuit so that the level of ID pin is pulled low, mobile phone mistake Into OTG mode.And it is common, charge mode and OTG mode in mobile phone are the modes of mutual exclusion, specifically, for charging The mobile phone of mode does not respond on cell phone software then if there is the request of OTG, continues charge mode;Similarly, for being in The mobile phone of OTG mode does not respond on cell phone software then if there is charge request, continues OTG mode.So as to cause there is hand The phenomenon that can not being charged normal after machine access charge power supply.
Based on the discovery, the embodiment of the present application detects the current value of Vbus pin using the gallon unit in mobile phone, And then determine mobile phone whether false triggering OTG mode.Specifically, Fig. 1 is the pattern switching application scenarios of the embodiment of the present application Circuit diagram, as shown in Figure 1, the mobile phone of the embodiment of the present application may include USB connector 10, processor 20 and gallon Unit 30.
Specifically, USB connector 10 may include five pins: ID pin, GND pin, D- pin, D+ pin and Vbus Pin.Wherein, one end of gallon unit 30 connects Vbus pin, and the other end of gallon unit 30 connects processor 20, processor 20 can detect the current value of Vbus pin by gallon unit 30;ID pin is connect with processor 20, is led to Cross processor 20 it is available or control ID pin level state (high level or low level) etc.;D- pin, D+ pin and place It manages device 20 to connect, in the case where USB connector is connected to other electronic equipments, which can pass through D- pin And/or D+ pin and progress data communication of processor 20 of mobile phone etc.;Vbus pin is also connect with processor 20, passes through processor 20 available or control Vbus pin level states (high level or low level) etc.;GND pin is connect with processor 20, real Existing USB connector 10 and the common ground connection of processor 20 etc..
Connection in the embodiment of the present application can be the connection that the modes such as welding, coupling are realized, the embodiment of the present application is to this It is not especially limited.
Common, when the ID pin of mobile phone is high level, mobile phone is in charge mode, and mobile phone can charge normal, show The voltage of the ID pin of example can be 1.8V or higher;When the ID pin of mobile phone is low level, mobile phone is in OTG mode, Mobile phone can execute OTG process flow, and Vbus exports the voltage of about 5V, while D- pin or D+ pin can be connect with mobile phone Electronic equipment carry out communication interaction.
It should be noted that, when the ID pin of mobile phone is low level, indicating that the mobile phone is that OTG master sets in OTG mode It is standby, adaptation, other electronic equipments for carrying out OTG communication with the mobile phone are OTG from equipment, and main equipment can be sent to from equipment Control instruction, from equipment can according to the control instruction carry out corresponding operation, it is exemplary, from equipment be printer the case where Under, which can be the instruction for being used to indicate printing, and printer can execute printing in response to the control instruction.
It is appreciated that being realized if other electronic equipments are also able to achieve OTG function in mobile phone and other electronic equipments After OTG connection, mobile phone can be realized according to the setting of the ID pin of the setting and other electronic equipments of the ID pin of mobile phone With the OTG roles of other electronic equipments replacement (as main equipment or as from equipment), the embodiment of the present application does not make this to have Body limits.
In practical application, processor 20 can be used as the executing subject for executing mobile phone OTG switching method, and processor 20 can be with It is the central processing unit etc. of mobile phone.Gallon unit 30 can be determined according to actual application scenarios, exemplary, electric current Probe unit 30 can be made of electrical parts such as resistance, transistors.It is appreciated that can be managed by Vbus in common mobile phone Gallon unit 30 between foot and processor 20 realizes the detection to the electric current of Vbus pin, and passes through analog-digital converter (Analog-to-Digital Converte, ADC) carries out the reading of register, so as to obtain the electric current of Vbus pin Value.The embodiment of the present application is not especially limited processor 20 and gallon unit 30.
Fig. 2 is the flow chart for the mobile phone OTG switching method that the embodiment of the present application one provides, as shown in Fig. 2, based on Fig. 1's Circuit configuration, method provided in this embodiment may comprise steps of:
Step S101: in the case where mobile phone is in OTG mode, it is total which detects power supply in the USB interface of the mobile phone The current value of line Vbus pin.
In the embodiment of the present application, OTG mode can specifically refer to: mobile phone can execute OTG by USB and other electronic equipments Process flow, and the Vbus pin of mobile phone USB exports 5V or so voltage to other electronic equipments.
In concrete application, it can determine whether mobile phone enters OTG mode by the level state of the ID pin of USB port, Specifically, mobile phone ID pin be low level situation under, it is believed that mobile phone is in OTG mode.
It is appreciated that can also determine whether mobile phone enters OTG mode by other means in practical application, for example, In After mobile phone accesses charge power supply, if mobile phone can not charge normal, it is also assumed that mobile phone is in OTG mode, the embodiment of the present application It is not specifically limited to whether determining mobile phone enters OTG mode.
In the embodiment of the present application, in the case where mobile phone is in OTG mode, mobile phone detects the universal serial bus of the mobile phone The current value of power bus Vbus pin in USB interface.Specifically, referring to Fig.1, can by Vbus pin and processor 20 it Between gallon unit 30 realize the detection to the electric current of Vbus pin, and pass through analog-digital converter (analog-to- Digital converte, ADC) reading of register is carried out, so as to obtain the current value of Vbus pin.It is appreciated that Power bus Vbus pin in the general-purpose serial bus USB interface of the mobile phone can also be detected in practical application by other means Current value, the embodiment of the present application is not especially limited this.
Step S102: when the current value is less than the first threshold value, the mobile phone is from the OTG pattern switching to charging Mode.
In the embodiment of the present application, the first thresholding can be determined according to actual application scenarios, in concrete application, if Vbus is managed The current value of foot is too small, it is believed that without constituting current loop in Vbus pin, i.e., mobile phone is accessed without other electronic equipments, Therefore, the first thresholding can be 0 or lesser value, and the first thresholding of the embodiment of the present application is not especially limited.In view of usual The electric current accuracy of identification of gallon unit be 1mA, in the case that the actual current of Vbus pin is 0, the electric current that detects Value is likely to be at 0~1mA, although actually there is no accesses from setting for Vbus pin that is, detect that Vbus pin is not 0 It is standby, therefore, in order to avoid the precision because of gallon unit caused by Vbus pin testing current mistake, in some realities of the application It applies in example, above-mentioned first thresholding can be between 0~1 milliampere.
In the embodiment of the present application, in the case where the current value of Vbus pin is less than the first thresholding, it is believed that not from Equipment accesses mobile phone, does not have current drain on VBus access, and mobile phone is because original false triggerings such as interface short circuit enter OTG mould Formula, therefore mobile phone, from OTG pattern switching to charge mode, mobile phone can charge normal in charge mode.
In an optional implementation manner, when the current value is less than the first threshold value, the mobile phone is from the OTG Pattern switching includes: to charge mode
When the current value is less than the first thresholding, which terminates OTG identification process, and closes the output of the Vbus pin Voltage.
In the embodiment of the present application, when mobile phone is in OTG mode, mobile phone can execute OTG identification process automatically, specifically, The state that mobile phone will be in carry out communication interaction from equipment, and mobile phone exports the defeated of about 5V to from equipment by Vbus pin Therefore specific implementation of the mobile phone from OTG pattern switching to charge mode may is that mobile phone terminates OTG identification stream by voltage out Journey, and close the output voltage of Vbus pin.In concrete application, mobile phone can be terminated by the software program in processor OTG identification process, can also terminate the OTG identification process of mobile phone by other means, and the embodiment of the present application is not made this specifically It limits.
Step S103: when the current value is greater than the second thresholding, which executes the OTG identification process under the OTG mode.
In the embodiment of the present application, the second thresholding is greater than the first thresholding, and the second thresholding can be true according to actual application scenarios It is fixed, in concrete application, if the access of Vbus pin from equipment, specifically, can be USB flash disk or other OTG from equipment from equipment, Vbus pin with from equipment may be constructed current loop, usually have higher current value in current loop, therefore, the second thresholding can To be higher value, the second thresholding of the embodiment of the present application is not especially limited.In practical application, it is contemplated that common gallon The electric current accuracy of identification of unit be 1mA and from the current drain size of equipment usually all in 10mA or more, therefore, the application reality It applies in a kind of implementation of example, the second thresholding is between 1 milliampere to 10 milliamperes, the case where current value is greater than second thresholding Under, it can determine that Vbus pin has been accessed from equipment.
In the embodiment of the present application, in the case where current value is greater than the second thresholding, it is believed that mobile phone has been accessed from equipment, Therefore mobile phone can execute the OTG identification process under OTG mode.
In conclusion the embodiment of the present application provides a kind of mobile phone OTG switching method and apparatus, inventor sends out after study Existing, the mobile phone for why often occurring being able to achieve OTG function in the prior art accesses what charge power supply can not charge normal later Phenomenon is to enter OTG mode because of the mobile phone mistake, specifically, in USB pin, ID pin and ground connection (GND) pin It is adjacent, and in the use process of the mobile phone, which may be in moist or dust environment, so that USB port Corroded, adjacent ID pin and GND pin may be because that corrosion causes short circuit in USB port, so that the ID pin of mobile phone Level be pulled low, mobile phone mistake enters OTG mode, and then causes mobile phone that can not charge normal.Based on the discovery, the application In embodiment, in the case where mobile phone is in OTG mode, which detects electric in the general-purpose serial bus USB interface of the mobile phone The current value of source bus Vbus pin;If being appreciated that, the current value is too small, it is believed that without constituting electric current in Vbus pin Mobile phone is accessed without other electronic equipments in circuit, and then can consider that mobile phone false triggering enters OTG mode, therefore when electricity When flow valuve is less than the first thresholding, mobile phone is from OTG pattern switching to charge mode, when current value is greater than the second threshold value, mobile phone The OTG identification process under the OTG mode is executed, to avoid because mobile phone mistake enters OTG mode and can not normally fill The phenomenon of electricity occurs.
Fig. 3 shows the illustrative view of functional configuration of the mobile phone OTG switching device of the embodiment of the present application, as shown in figure 3, the dress It sets and includes:
Detection module 310, for detecting the general-purpose serial bus USB of the mobile phone in the case where mobile phone is in OTG mode The current value of power bus Vbus pin in interface.
Switching module 320, for when the current value is less than the first thresholding, by the mobile phone from the OTG pattern switching to filling Power mode.
Execution module 320, for when the current value is greater than the second thresholding, executing the OTG identification stream under the OTG mode Journey, wherein first threshold value is less than second threshold value.
In a kind of illustrative mode, which includes: the arbitrary value between 0 to 1 milliampere;The second thresholding packet It includes: the arbitrary value between 1 milliampere to 10 milliamperes.
In a kind of illustrative mode, which includes: switching submodule, for when the current value is less than first In limited time, terminate the OTG identification process of the mobile phone, and close the output voltage of the Vbus pin.
The embodiment of the present application provides a kind of mobile phone OTG switching method and apparatus, inventor has found that the prior art In why often there is being able to achieve the phenomenon that can not charging normal after the mobile phone access charge power supply of OTG function, be because The mobile phone mistake enters OTG mode, and specifically, in USB pin, ID pin is adjacent with ground connection (GND) pin, and at this In the use process of mobile phone, which be may be in moist or dust environment, so that USB port is corroded, USB Adjacent ID pin and GND pin may be because that corrosion causes short circuit in port, so that the level of the ID pin of mobile phone is pulled low, Mobile phone mistake enters OTG mode, and then causes mobile phone that can not charge normal.Based on the discovery, in the embodiment of the present application, in hand In the case that machine is in OTG mode, which detects power bus Vbus pin in the general-purpose serial bus USB interface of the mobile phone Current value;If being appreciated that, the current value is too small, it is believed that without constituting current loop in Vbus pin, i.e., without it His electronic equipment accesses mobile phone, and then can consider that mobile phone false triggering enters OTG mode, therefore when current value is less than first In limited time, mobile phone is from OTG pattern switching to charge mode, and when current value is greater than the second threshold value, mobile phone executes the OTG mode Under OTG identification process, thus avoid because the entering OTG mode of mobile phone mistake and the phenomenon that can not charge normal.
Fig. 4 shows a kind of mobile phone provided by the embodiments of the present application, as shown in figure 4, the mobile phone includes processor 410, deposits Reservoir 420 and transceiver 430, for storing instruction, which is used for and other equipment communication, at this for the memory 420 Reason device 410 is for executing the instruction stored in the memory, so that the mobile phone executes the method being somebody's turn to do such as any one of the application.
The embodiment of the present application also provides a kind of computer readable storage medium, which has finger It enables, when the instruction is performed, so that computer executes the method being somebody's turn to do such as any one of the application.
The embodiment of the present application also provides a kind of computer program product, which includes instruction, when this refers to Order is performed, so that computer executes the method being somebody's turn to do such as any one of the application.
The embodiment of the present application also provides a kind of system on chip or System on Chip/SoC, the system on chip or System on Chip/SoC and can answer For the network equipment, the system on chip or System on Chip/SoC include: at least one communication interface, at least one processor, at least One memory, the communication interface, memory and processor are deposited by bus bar, the processor by executing in the memory The instruction of storage, so that the method being somebody's turn to do in the application can be performed in the network equipment.
In several embodiments provided herein, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, only For a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine Or it is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed phase Coupling, direct-coupling or communication connection between mutually can be through some interfaces, the INDIRECT COUPLING or communication of device or unit Connection can be electrical property, mechanical or other forms.
Unit may or may not be physically separated as illustrated by the separation member for this, show as unit Component may or may not be physical unit, it can it is in one place, or may be distributed over multiple nets On network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can store and computer-readable deposit at one In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer It is each that equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the application The part steps of embodiment this method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (read-only Memory, ROM), random access memory (random access memory, RAM), magnetic or disk etc. is various to deposit Store up the medium of program code.

Claims (10)

1. a kind of mobile phone OTG switching method characterized by comprising
In the case where mobile phone is in OTG mode, the mobile phone detects power supply in the general-purpose serial bus USB interface of the mobile phone The current value of bus Vbus pin;
When the current value is less than the first threshold value, the mobile phone is from the OTG pattern switching to charge mode;
When the current value is greater than the second threshold value, the mobile phone executes the OTG identification process under the OTG mode;
Wherein, first threshold value is less than second threshold value.
2. the method according to claim 1, wherein first thresholding includes: any between 0 to 1 milliampere Value.
3. method according to claim 1 or 2, which is characterized in that second thresholding include: 1 milliampere to 10 milliamperes it Between arbitrary value.
4. method according to claim 1 or 2, which is characterized in that it is described when the current value is less than the first threshold value, The mobile phone includes: from the OTG pattern switching to charge mode
When the current value is less than the first thresholding, the mobile phone terminates OTG identification process, and closes the defeated of the Vbus pin Voltage out.
5. a kind of mobile phone OTG switching device characterized by comprising
Detection module, for detecting the general-purpose serial bus USB interface of the mobile phone in the case where mobile phone is in OTG mode The current value of middle power bus Vbus pin;
Switching module is used for when the current value is less than the first thresholding, by the mobile phone from the OTG pattern switching to charging Mode;
Execution module, for executing the OTG identification process under the OTG mode when the current value is greater than the second thresholding;
Wherein, first threshold value is less than second threshold value.
6. device according to claim 5, which is characterized in that first thresholding includes: any between 0 to 1 milliampere Value.
7. device according to claim 5 or 6, which is characterized in that second thresholding include: 1 milliampere to 10 milliamperes it Between arbitrary value.
8. device according to claim 5 or 6, which is characterized in that the switching module includes:
Switching submodule for when the current value is less than the first thresholding, terminating the OTG identification process of the mobile phone, and is closed Close the output voltage of the Vbus pin.
9. a kind of mobile phone, which is characterized in that including processor, memory and transceiver, the memory for storing instruction, institute State transceiver for and other equipment communication, the processor be used for execute the instruction stored in the memory so that described Mobile phone executes method according to any of claims 1-4.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has instruction, when Described instruction is performed, so that computer executes method according to any of claims 1-4.
CN201910521576.5A 2019-06-17 2019-06-17 Mobile phone OTG switching method and device Active CN110442539B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910521576.5A CN110442539B (en) 2019-06-17 2019-06-17 Mobile phone OTG switching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910521576.5A CN110442539B (en) 2019-06-17 2019-06-17 Mobile phone OTG switching method and device

Publications (2)

Publication Number Publication Date
CN110442539A true CN110442539A (en) 2019-11-12
CN110442539B CN110442539B (en) 2021-08-31

Family

ID=68429224

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910521576.5A Active CN110442539B (en) 2019-06-17 2019-06-17 Mobile phone OTG switching method and device

Country Status (1)

Country Link
CN (1) CN110442539B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221546A (en) * 2007-01-12 2008-07-16 奇岩电子股份有限公司 Device for automatically detecting universal serial bus main unit or peripherals
CN104778144A (en) * 2015-04-21 2015-07-15 广东欧珀移动通信有限公司 OTG-based (On-The-Go-based) intelligent terminal operation control method and OTG-based intelligent terminal operation control device
CN105068959A (en) * 2015-08-25 2015-11-18 广东欧珀移动通信有限公司 Terminal and charging method and apparatus for terminal with data exchange function
CN105071489A (en) * 2015-08-25 2015-11-18 广东欧珀移动通信有限公司 Charging method and apparatus of terminal having data exchange function
CN105071484A (en) * 2015-08-25 2015-11-18 广东欧珀移动通信有限公司 Charging method and apparatus of terminal having data exchange function
CN105071488A (en) * 2015-08-25 2015-11-18 广东欧珀移动通信有限公司 Charging method and apparatus of terminal having data exchange function
CN105182154A (en) * 2015-08-25 2015-12-23 广东欧珀移动通信有限公司 Universal serial bus interface detection circuit and method
CN106844265A (en) * 2017-02-06 2017-06-13 维沃移动通信有限公司 The control method and mobile terminal of a kind of general-purpose serial bus USB interface

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221546A (en) * 2007-01-12 2008-07-16 奇岩电子股份有限公司 Device for automatically detecting universal serial bus main unit or peripherals
CN104778144A (en) * 2015-04-21 2015-07-15 广东欧珀移动通信有限公司 OTG-based (On-The-Go-based) intelligent terminal operation control method and OTG-based intelligent terminal operation control device
CN105068959A (en) * 2015-08-25 2015-11-18 广东欧珀移动通信有限公司 Terminal and charging method and apparatus for terminal with data exchange function
CN105071489A (en) * 2015-08-25 2015-11-18 广东欧珀移动通信有限公司 Charging method and apparatus of terminal having data exchange function
CN105071484A (en) * 2015-08-25 2015-11-18 广东欧珀移动通信有限公司 Charging method and apparatus of terminal having data exchange function
CN105071488A (en) * 2015-08-25 2015-11-18 广东欧珀移动通信有限公司 Charging method and apparatus of terminal having data exchange function
CN105182154A (en) * 2015-08-25 2015-12-23 广东欧珀移动通信有限公司 Universal serial bus interface detection circuit and method
CN106844265A (en) * 2017-02-06 2017-06-13 维沃移动通信有限公司 The control method and mobile terminal of a kind of general-purpose serial bus USB interface

Also Published As

Publication number Publication date
CN110442539B (en) 2021-08-31

Similar Documents

Publication Publication Date Title
CN106571657B (en) Terminal, converter, and connection conversion system and method
CN104951034B (en) Mobile terminal and its USB interface condition control method and device
CN104246759A (en) Application programming interface testing services
US9436785B1 (en) Hierarchical preset and rule based configuration of a system-on-chip
CN106970864A (en) On-chip system, mobile terminal and the method for operating on-chip system
EP1723532B1 (en) Multiple burst protocol device controller
JP2014056287A (en) Electronic apparatus and method of determining power source device by electronic apparatus
US10846256B2 (en) Multi-endpoint device sideband communication system
KR20170043269A (en) Method for operating universal flash stroage (ufs) device, method for operating ufs host, and method for operating ufs systrem having them
CN101772761A (en) Electronic device interface control system
CN102147831A (en) Logic verification method and device
US8990461B2 (en) On-The-Go (OTG) USB devices configuration method for identifying configuration of other connected devices by reacting to change in resistance value on a resistive line
CN107480084A (en) Type C mobile terminals charge and data transmission method, device and storage medium
US10042692B1 (en) Circuit arrangement with transaction timeout detection
CN106502558A (en) Terminal device and its method of operating and operation device
CN109491909A (en) A kind of CPLD refreshes verification method, device, terminal and storage medium
CN108600542A (en) Gyro calibiatio i method and device
CN108226754A (en) Method, apparatus, computing device and the storage medium of generative circuit layout
CN110442539A (en) Mobile phone OTG switching method and apparatus
CN111830394A (en) Charging circuit fault detection method, electronic device and computer readable storage medium
CN109542198B (en) Method and equipment for controlling power-on of PCIE card
WO2023045389A1 (en) Network card adaptation circuit, network card adaptation method, and related apparatus
CN104572515B (en) Tracking module, method, system and on-chip system chip
CN106940684B (en) Method and device for writing data according to bits
CN104778144B (en) Intelligent terminal method of controlling operation thereof and device based on OTG

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210423

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Applicant after: Honor Device Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Applicant before: HUAWEI TECHNOLOGIES Co.,Ltd.

GR01 Patent grant
GR01 Patent grant