[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN106648857B - A kind of open method and mobile terminal of the OTG function of mobile terminal - Google Patents

A kind of open method and mobile terminal of the OTG function of mobile terminal Download PDF

Info

Publication number
CN106648857B
CN106648857B CN201611079821.4A CN201611079821A CN106648857B CN 106648857 B CN106648857 B CN 106648857B CN 201611079821 A CN201611079821 A CN 201611079821A CN 106648857 B CN106648857 B CN 106648857B
Authority
CN
China
Prior art keywords
mobile terminal
hall switch
otg function
interrupt signal
equipment
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.)
Active
Application number
CN201611079821.4A
Other languages
Chinese (zh)
Other versions
CN106648857A (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201611079821.4A priority Critical patent/CN106648857B/en
Publication of CN106648857A publication Critical patent/CN106648857A/en
Application granted granted Critical
Publication of CN106648857B publication Critical patent/CN106648857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the invention provides the open methods and mobile terminal of a kind of OTG function of mobile terminal, the mobile terminal configuration has the first Hall switch, the described method includes: when mobile terminal is placed into Virtual Reality equipment, the mobile terminal receives the first interrupt signal that the first Hall switch generates, and the VR device configuration has the second Hall switch;For first interrupt signal, the mobile terminal opens OTG function;When receiving the second interrupt signal that second Hall switch generates in preset time range, keeping the OTG function is open state, to solve the problems, such as that the OTG function of mobile terminal in the prior art needs to maintain a normally open state, enable mobile terminal to open OTG function on demand, improves the reliability and safety of the USB interface of mobile terminal.

Description

A kind of open method and mobile terminal of the OTG function of mobile terminal
Technical field
The present embodiments relate to a kind of open methods of the OTG function of field of communication technology more particularly to mobile terminal And mobile terminal.
Background technique
Currently, the realization of smart phone VR (Virtual Reality, virtual reality) function, main still with VR box For carrier, i.e., mobile phone is inserted into VR box, then the presentation by optical system and sensor unit realization image in VR box And human-computer interaction.Mobile phone and VR box are connected by USB (Universal Serial Bus, universal serial bus), on the one hand, Mobile phone can pass through OTG (On-The-Go, a kind of connection between distinct device, carry out the technology of data exchange) function Power supply is provided for VR box;On the other hand, mobile phone will also be communicated by OTG with VR box, carry out data exchange.
According to USB OTG agreement, the warm connection function of Yao Shixian OTG, OTG must maintain a normally open state, and therefore, USB connects The ID pin of mouth can be constantly in electriferous state.But in the actual use process, USB interface is particularly easy to dirty, example Such as, the fiber on clothes, dust in environment etc. enter USB interface, will appear the micro-short circuit phenomenon to run down after dampness.
When micro-short circuit occurs in the ID pin in USB interface, will trigger OTG function makes the voltage of mobile phone USB output 5V, into One step aggravates the degree of micro-short circuit, but also mobile phone can not be charged by USB interface, secondly, micro- short in USB interface Road can also be further exacerbated by the oxidation and corrosion of contact in interface, influence to be electrically connected.
Summary of the invention
The embodiment of the present invention provides the open method and mobile terminal of a kind of OTG function of mobile terminal, with solve due to The problem of OTG function of mobile terminal maintains a normally open state and influences the reliability and safety of USB interface.
In a first aspect, the embodiment of the invention provides a kind of open method of the OTG function of mobile terminal, it is described mobile whole End is configured with the first Hall switch, comprising:
When mobile terminal is placed into Virtual Reality equipment, the mobile terminal receives what the first Hall switch generated First interrupt signal, the VR device configuration have the second Hall switch;
For first interrupt signal, the mobile terminal opens OTG function;
When receiving the second interrupt signal that second Hall switch generates in preset time range, described in holding OTG function is open state.
Second aspect, the embodiment of the invention also provides a kind of mobile terminal, the mobile terminal configuration has the first Hall Switch, comprising:
Receiving module is produced for when mobile terminal to be placed into Virtual Reality equipment, receiving the first Hall switch The first raw interrupt signal, the VR device configuration have the second Hall switch;
Opening module opens the OTG function of the mobile terminal for being directed to first interrupt signal;
Module is kept, the second interrupt signal generated for receiving second Hall switch in preset time range When, keeping the OTG function is open state.
In this way, in embodiments of the present invention, when mobile terminal is placed into Virtual Reality equipment, the mobile terminal The first interrupt signal that can be generated by receiving the first Hall switch, and OTG function is opened for first interrupt signal; Then it when receiving the second interrupt signal that the second Hall switch configured in VR equipment generates in preset time range, protects Holding the OTG function is open state, so that the OTG function of solving mobile terminal in the prior art needs to maintain a normally open state The problem of, enable mobile terminal to open OTG function on demand, improves the reliability and safety of the USB interface of mobile terminal Property;Meanwhile being placed into VR equipment in mobile terminal, by the judgement of Hall effect twice, can effectively identify current Whether equipment is legitimate device, if so, keeping mobile terminal OTG function in the open state, realizes mobile terminal and institute Warm connection function between the VR equipment of connection, better user experience.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without any creative labor, can also be according to these attached drawings Obtain other attached drawings.
Fig. 1 is a kind of flow chart of the open method of the OTG function of mobile terminal of first embodiment of the invention;
Fig. 2 is a kind of flow chart of the open method of the OTG function of mobile terminal of second embodiment of the invention;
Fig. 3 A-3B is the block diagram of the mobile terminal of third embodiment of the invention;
Fig. 4 is the block diagram of the mobile terminal of fourth embodiment of the invention;
Fig. 5 is the structural schematic diagram of the mobile terminal of fifth embodiment of the invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
First embodiment
Referring to Fig.1, a kind of process of the open method of the OTG function of mobile terminal of first embodiment of the invention is shown Figure, the mobile terminal configuration have the first Hall switch, can specifically include following steps:
Step 101, when mobile terminal is placed into Virtual Reality equipment, the mobile terminal receives the first Hall and opens The first interrupt signal generated is closed, the VR device configuration has the second Hall switch;
In embodiments of the present invention, the mobile terminal, which can be smart phone, tablet computer etc., has display screen Electronic equipment.Further, the mobile terminal can also include one or more USB interfaces, can by USB interface with VR equipment is connected.
USB (Universal Serial Bus, universal serial bus) is an external bus standard, can be used for standardizing The electronic equipments such as computer are connected and communicate with other external electronic equipments, are a kind of interfacing having been widely used, USB The plug and play and warm connection function of interface holding equipment.Currently, most of mobile device quotient is on a large scale produced The data line based on the standard is used on mobile terminal.
In embodiments of the present invention, the VR equipment can refer to the VR box for holding movable terminal.When mobile whole After end is placed into the VR box, mobile terminal can cooperate with the VR box, realize phase in the case where OTG function is opened The VR function of answering, that is, generate a kind of simulated environment, and family can be used and be immersed in virtual environment, and the feeling in true border is such as faced in experience.
OTG is the abbreviation of On-The-Go, is the technology that developed recently gets up, be mainly used in a variety of different equipment or Connection between mobile device carries out data exchange.Using OTG technology, can be realized in the case where no Host (main equipment) The data transmission of equipment room realizes the mesh by enriching the function of intelligent terminal to intelligent terminal expanding USB interface accessory 's.For example, mobile phone, tablet computer can be become universal remote control use by extension remote controler accessory.
In embodiments of the present invention, the mobile terminal can be configured with the first Hall switch.Hall switch (Hall It switch) is a kind of device being made into based on Hall effect (Hall effect), by using magnetic field as working medium, by object Exercise parameter be changed into digital voltage form output, be allowed to the function of having sensing and switch.It alives when one piece When metal or wafer are placed vertically in magnetic field, the both ends of thin slice will generate potential difference, and this phenomenon is known as suddenly That effect.Hall switch is exactly to be made on the basis of Hall effect principle using integration packaging and packaging technology, it Electric signal magnetic input signal being converted into can be convenient in practical application, while easily being grasped but also with industrial occasions practical application Make the requirement with reliability.
In embodiments of the present invention, in order to cooperate the work of Hall switch on mobile terminal, can with it is described it is mobile eventually It holds and presets the first magnetic regions in the VR equipment to match, specific location of first magnetic regions in VR equipment can It is different with the difference of the specific location according to the first Hall switch on mobile terminals.Generally, when on mobile terminals After a certain position has configured the first Hall switch, after VR equipment being placed into according to the mobile terminal, first Hall Corresponding position is switched in the VR equipment to determine the regions of the first magnetic regions, so that mobile terminal is placed into VR After equipment, first Hall switch and first magnetic regions interact, to generate Hall effect.
Therefore, when the first Hall switch on mobile terminal is matched in the manner described above with the first magnetic regions in VR equipment It postpones, when mobile terminal to be placed into VR equipment, mobile terminal be can receive into the first of the first Hall switch generation Break signal.Specifically, when mobile terminal is placed into VR equipment, mobile terminal be can receive to the first Hall switch default The first magnetic regions generate the first interrupt signal.
Step 102, for first interrupt signal, the mobile terminal opens OTG function;
In embodiments of the present invention, the OTG function default of the mobile terminal is in close state.Therefore, can pass through Hall effect caused by interacting between the first magnetic regions on the first Hall switch on mobile terminal and VR equipment, Determine whether correct placement enters in VR equipment mobile terminal, to further confirm that whether need to open OTG function.
In embodiments of the present invention, the first interrupt signal is generated after the first Hall switch is by the triggering of the first magnetic regions, Mobile terminal can respond the interrupt signal, temporarily open the OTG function of itself.
Step 103, when receiving the second interrupt signal that second Hall switch generates in preset time range, Keeping the OTG function is open state.
In embodiments of the present invention, after mobile terminal temporarily opens OTG function due to the generation of the first interrupt signal, It can continue waiting for receiving USB peripheral, such as VR equipment, the response message reported, the response message can be by configuring What the second Hall switch in VR equipment was triggered.
If mobile terminal is not received by the response message that VR equipment reports in preset time range, then can recognize Generation for the first interrupt signal is due to caused by user misoperation or as caused by illegal peripheral hardware.At this point, can With the OTG function of turning-off mobile terminal.
If mobile terminal has received the response message that VR equipment reports in preset time range, it may be considered that Mobile terminal has correctly been placed into matched VR equipment, and the two has been completed the process of communication handshake.At this point, Can keep the OTG function is open state, and under OTG function unlatching, is cooperated by mobile terminal and VR equipment, It is common to realize VR function.
In embodiments of the present invention, when mobile terminal is placed into Virtual Reality equipment, the mobile terminal can be with The first interrupt signal generated by receiving the first Hall switch, and OTG function is opened for first interrupt signal;Then When receiving the second interrupt signal that the second Hall switch configured in VR equipment generates in preset time range, institute is kept Stating OTG function is open state, so that the OTG function of solving mobile terminal in the prior art needs to maintain a normally open asking for state Topic, enables mobile terminal to open OTG function on demand, improves the reliability and safety of the USB interface of mobile terminal;Together When, it is placed into VR equipment in mobile terminal, by the judgement of Hall effect twice, can effectively identify that current equipment is No is legitimate device, if so, keep mobile terminal OTG function in the open state, realize mobile terminal with connect Warm connection function between VR equipment, better user experience.
Second embodiment
Referring to Fig. 2, a kind of process of the open method of the OTG function of mobile terminal of second embodiment of the invention is shown Figure, the mobile terminal configuration have the first Hall switch, can specifically include following steps:
Step 201, when mobile terminal is placed into Virtual Reality equipment, the mobile terminal receives the first Hall and opens Close the first interrupt signal generated in preset first magnetic regions;
In embodiments of the present invention, the mobile terminal, which can be smart phone, tablet computer etc., has display screen Electronic equipment.Further, the mobile terminal can also include one or more USB interfaces, can by USB interface with VR equipment is connected.
In embodiments of the present invention, the VR equipment can refer to the VR box for holding movable terminal.When mobile whole After end is placed into the VR box, mobile terminal can cooperate with the VR box, in the case where OTG function is opened, realize Corresponding VR function.
In embodiments of the present invention, the first Hall switch can be configured on the mobile terminal;Meanwhile it being moved to cooperate The work of first Hall switch in dynamic terminal, can also preset the first magnetism in the VR equipment to match with the mobile terminal Region.Specifically, the concrete configuration position of the first Hall switch and the first magnetic regions can be placed into VR according to mobile terminal Relative position after equipment determines, that is, when mobile terminal is when being placed into VR equipment, enable the first Hall switch with First magnetic regions interaction, to generate the first interrupt signal.
After the first Hall switch on mobile terminal generates the first interrupt signal, mobile terminal can capture this in time Signal, and corresponding reaction can be made to the signal.
Step 202, for first interrupt signal, the mobile terminal opens OTG function;
USB interface is made micro-short circuit phenomenon occur in order to avoid normally opened due to OTG function, to influence USB interface Safety and reliability, therefore, the OTG function default of the mobile terminal in the embodiment of the present invention are in close state.
But after mobile terminal is connect with VR equipment by USB, mobile terminal is only in the OTG function of opening itself It is just able to achieve corresponding VR function afterwards.On the one hand, mobile terminal is provided in the case where opening OTG functional status by USB for VR equipment Power supply;On the other hand, mobile terminal can also be realized logical between VR equipment in the case where opening OTG functional status by USB Letter carries out data exchange.
It therefore, can be by mutual between the first magnetic regions on the first Hall switch on mobile terminal and VR equipment Act on caused by Hall effect, determine whether correct placement enters in VR equipment mobile terminal, thus further confirm that whether Need to open OTG function.
In the concrete realization, the first interrupt signal is generated after the first Hall switch is by the triggering of the first magnetic regions, it is mobile Terminal can respond the interrupt signal, temporarily open the OTG function of itself.
Step 203, when receiving the response message that the VR equipment reports in preset time range, described in holding OTG function is open state, the response message generated by second Hall switch in preset second magnetic regions the The triggering of two interrupt signals;
Step 204, discharge to the OTG function make can control resource;
In embodiments of the present invention, can a certain position of VR equipment configure the second Hall switch, and with this second The second magnetic regions are preset on the corresponding mobile terminal of Hall switch, so that entering in VR equipment in mobile terminal correct placement When, the second Hall switch can interact with the second magnetic regions, generate the second interrupt signal.
In the concrete realization, the second magnetic regions on mobile terminal can use the magnetic loud speaker of mobile terminal to replace Generation, i.e., using existing magnetic loud speaker on mobile terminal as the second magnetic regions, without the second magnetic is individually arranged again Property region.Certainly, those skilled in the art can also select other positions to be on mobile terminals arranged the according to actual needs Two magnetic regions, the embodiment of the present invention are not construed as limiting this.
It should be noted that the position that the position of the second magnetic regions setting should be arranged with the first Hall switch keeps one Set a distance influences each other to avoid the two.
When using the magnetic loud speaker of mobile terminal as the second magnetic regions, can in VR equipment with magnetic loud speaker The second Hall switch is arranged in the opposite region in position, so that the second Hall switch can generate second with the magnetic loud speaker Interrupt signal.
In embodiments of the present invention, after the second Hall switch in VR equipment generates the second interrupt signal, the VR is set It is standby to be directed to second interrupt signal, a response message is generated, and be reported to mobile terminal.
If mobile terminal in preset time range, receives the response message that VR equipment reports, it may be considered that mobile Terminal has correctly been placed into matched VR equipment, and the two has been completed the process of communication handshake.At this point it is possible to Keep the OTG function be open state, and discharge to the OTG function make can control resource, so as in the OTG function Under capable of opening, cooperated by mobile terminal and VR equipment, it is common to realize VR function.
Step 205, when detecting that the mobile terminal is removed from the VR equipment, the OTG function is closed;
In embodiments of the present invention, when detecting that mobile terminal is removed from VR equipment, it is believed that hereafter may not be used The OTG function of mobile terminal is reapplied, at this point it is possible to close the OTG function.
In general, mobile terminal when removing from VR equipment, needs to disconnect the connection between VR equipment, it therefore, can be with After detecting that the connection between mobile terminal and VR equipment disconnects, it is believed that mobile terminal is removed from VR equipment, thus OTG function can be closed.
Step 206, if not receiving the second interrupt signal that second Hall switch generates in preset time range When, then close the OTG function of the mobile terminal.
In embodiments of the present invention, after mobile terminal temporarily opens the OTG function of itself due to the first interrupt signal, If the second Hall switch does not generate second terminal signal in preset time range, it may be considered that the first interrupt signal Generation be the false triggering due to caused by user misoperation movement either as caused by illegal peripheral hardware.At this point it is possible to close Close the OTG function of mobile terminal.
In the concrete realization, the response message can be the information of second Hall switch triggering, i.e., due to second Second interrupt signal of Hall switch and the interaction of the second magnetic regions and generation, and then touched for second interrupt signal The response message of hair.
Therefore, if do not receive the response message that the VR equipment reports in preset time range, institute can be closed State the OTG function of mobile terminal.
In embodiments of the present invention, by configuring the first Hall switch and the second magnetic regions on mobile terminals respectively, And the corresponding position in VR equipment configures the first magnetic regions and the second Hall switch, thus by judging whether to receive two The mode of secondary interrupt signal, to confirm whether mobile terminal has correctly been placed into matched VR equipment, if so, can be with On the basis of temporarily opening OTG function, keep the OTG function in the open state;It is temporarily opened if it is not, can then close OTG function solves the problems, such as that the OTG function of mobile terminal in the prior art needs to maintain a normally open state, so that mobile terminal OTG function can be opened on demand, reduce USB interface since OTG function is normally opened and the probability of micro-short circuit occur, improve movement The reliability and safety of the USB interface of terminal.
It should be noted that for simple description, therefore, it is stated as a series of action groups for embodiment of the method It closes, but those skilled in the art should understand that, embodiment of that present invention are not limited by the describe sequence of actions, because according to According to the embodiment of the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art also should Know, the embodiments described in the specification are all preferred embodiments, and the related movement not necessarily present invention is implemented Necessary to example.
3rd embodiment
Referring to Fig. 3 A, one of block diagram of mobile terminal of third embodiment of the invention is shown, the mobile terminal 300 is matched It is equipped with the first Hall switch, the mobile terminal 300 can specifically include following module:
Receiving module 310, for when mobile terminal to be placed into Virtual Reality equipment, the mobile terminal to be received The first interrupt signal that first Hall switch generates, the VR equipment can be configured with the second Hall switch;
Opening module 320, for being directed to first interrupt signal, the mobile terminal opens OTG function;
Module 330 is kept, is interrupted for receiving second Hall switch generates second in preset time range When signal, keeping the OTG function is open state.
In embodiments of the present invention, the VR equipment can have preset first magnetic regions, the receiving module 310 It can specifically include following submodule:
Receiving submodule 311, for when mobile terminal to be placed into Virtual Reality equipment, the mobile terminal to be connect Receive the first interrupt signal that the first Hall switch is generated in preset first magnetic regions.
In embodiments of the present invention, the mobile terminal can have preset second magnetic regions, the holding module 330 can specifically include following submodule:
Submodule 331 being kept, when for receiving response message that the VR equipment reports in preset time range, being protected Holding the OTG function is open state, and the response message can be by second Hall switch in preset second magnetic area The second interrupt signal triggering that domain generates.
In embodiments of the present invention, the holding module 330 can also include following submodule:
Discharge submodule 332, for discharge to the OTG function make can control resource.
On the basis of Fig. 3 A, optionally, referring to Fig. 3 B, the block diagram of the mobile terminal of third embodiment of the invention is shown Two, the mobile terminal 300 can also include following submodule:
First closedown module 340, for when detecting that the mobile terminal is removed from the VR equipment, described in closing OTG function.
In embodiments of the present invention, the mobile terminal 300 can also include following submodule:
Second closedown module 350, for not receiving that second Hall switch generates in preset time range When two interrupt signals, the OTG function of the mobile terminal is closed.
In embodiments of the present invention, second closedown module 350 can specifically include following submodule:
Second closes submodule 351, the response letter reported for not receiving the VR equipment in preset time range When breath, the OTG function of the mobile terminal is closed, the response message can be the information of second Hall switch triggering.
Mobile terminal 300 can be realized each process that mobile terminal is realized in the embodiment of the method for Fig. 1 to Fig. 2, to keep away Exempt to repeat, which is not described herein again.In embodiments of the present invention, described when mobile terminal is placed into Virtual Reality equipment The first interrupt signal that mobile terminal can be generated by receiving the first Hall switch, and it is directed to first interrupt signal, it opens Open OTG function;Then when in receive the second Hall switch generation configured in VR equipment in preset time range second When break signal, keeping the OTG function is open state, to solve the OTG function needs of mobile terminal in the prior art The problem of maintaining a normally open state enables mobile terminal to open OTG function on demand, improves the USB interface of mobile terminal Reliability and safety;Meanwhile being placed into VR equipment in mobile terminal, it, can be effective by the judgement of Hall effect twice Identify whether current equipment is legitimate device, if so, keeping mobile terminal OTG function in the open state, realizes Warm connection function between mobile terminal and the VR equipment connected, better user experience.
Fourth embodiment
Fig. 4 is a kind of block diagram of mobile terminal of fourth embodiment of the invention.Mobile terminal 400 shown in Fig. 4 include: to A few processor 401, memory 402, at least one network interface 404 and user interface 403.It is each in mobile terminal 700 A component is coupled by bus system 405.It is understood that bus system 405 is for realizing the connection between these components Communication.Bus system 405 further includes power bus, control bus and status signal bus in addition in addition to including data/address bus.But For the sake of clear explanation, various buses are all designated as bus system 405 in Fig. 4, mobile terminal 700 further includes component of taking pictures 406, component 406 of taking pictures includes camera.
Wherein, user interface 403 may include display, keyboard or pointing device (for example, mouse, trace ball (trackball), touch-sensitive plate or touch screen etc..
It is appreciated that the memory 402 in the embodiment of the present invention can be volatile memory or nonvolatile memory, It or may include both volatile and non-volatile memories.Wherein, nonvolatile memory can be read-only memory (Read- OnlyMemory, ROM), programmable read only memory (ProgrammableROM, PROM), Erasable Programmable Read Only Memory EPROM (ErasablePROM, EPROM), electrically erasable programmable read-only memory (ElectricallyEPROM, EEPROM) dodge It deposits.Volatile memory can be random access memory (RandomAccessMemory, RAM), and it is slow to be used as external high speed It deposits.By exemplary but be not restricted explanation, the RAM of many forms is available, such as static random access memory (StaticRAM, SRAM), dynamic random access memory (DynamicRAM, DRAM), Synchronous Dynamic Random Access Memory (SynchronousDRAM, SDRAM), double data speed synchronous dynamic RAM (DoubleDataRate SDRAM, DDRSDRAM), enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM, ESDRAM), synchronized links Dynamic random access memory (SynchlinkDRAM, SLDRAM) and direct rambus random access memory (DirectRambusRAM, DRRAM).The memory 402 of the system and method for description of the embodiment of the present invention is intended to include but unlimited In the memory of these and any other suitable type.
In some embodiments, memory 402 stores following element, executable modules or data structures, or Their subset of person or their superset: operating system 4021 and application program 4022.
Wherein, operating system 4021 include various system programs, such as ccf layer, core library layer, driving layer etc., are used for Realize various basic businesses and the hardware based task of processing.Application program 4022 includes various application programs, such as media Player (MediaPlayer), browser (Browser) etc., for realizing various applied business.Realize embodiment of the present invention side The program of method may be embodied in application program 4022.
In embodiments of the present invention, by the program or instruction of calling memory 402 to store, specifically, can be application The program or instruction stored in program 4022, processor 401 are used for the institute when mobile terminal is placed into Virtual Reality equipment It states mobile terminal and receives the first interrupt signal that the first Hall switch generates, the VR device configuration has the second Hall switch;Needle To first interrupt signal, the mobile terminal opens OTG function;When receiving described second in preset time range suddenly When the second interrupt signal that your switch generates, keeping the OTG function is open state.
The method that the embodiments of the present invention disclose can be applied in processor 401, or be realized by processor 401. Processor 401 may be a kind of IC chip, the processing capacity with signal.During realization, the above method it is each Step can be completed by the integrated logic circuit of the hardware in processor 401 or the instruction of software form.Above-mentioned processing Device 401 can be general processor, digital signal processor (DigitalSignalProcessor, DSP), specific integrated circuit (ApplicationSpecific IntegratedCircuit, ASIC), ready-made programmable gate array (FieldProgrammableGateArray, FPGA) either other programmable logic device, discrete gate or transistor logic Device, discrete hardware components.It may be implemented or execute disclosed each method, step and the logical box in the embodiment of the present invention Figure.General processor can be microprocessor or the processor is also possible to any conventional processor etc..In conjunction with the present invention The step of method disclosed in embodiment, can be embodied directly in hardware decoding processor and execute completion, or use decoding processor In hardware and software module combination execute completion.Software module can be located at random access memory, and flash memory, read-only memory can In the storage medium of this fields such as program read-only memory or electrically erasable programmable memory, register maturation.The storage Medium is located at memory 402, and processor 401 reads the information in memory 402, and the step of the above method is completed in conjunction with its hardware Suddenly.
It is understood that the embodiment of the present invention description these embodiments can with hardware, software, firmware, middleware, Microcode or combinations thereof is realized.For hardware realization, processing unit be may be implemented in one or more specific integrated circuit (App LicationSpecificIntegratedCircuits, ASIC), digital signal processor (DigitalSignalProcessing, DSP), digital signal processing appts (DSPDevice, DSPD), programmable logic device (ProgrammableLogicDevice, PLD), field programmable gate array (Field-ProgrammableGateArray, FPGA), general processor, controller, microcontroller, microprocessor, other electronics lists for executing function of the present invention In member or combinations thereof.
For software implementations, can by execute the embodiment of the present invention described in function module (such as process, function etc.) come Realize technology described in the embodiment of the present invention.Software code is storable in memory and is executed by processor.Memory can With portion realizes in the processor or outside the processor.
Optionally, the processor 401 is also used to: the mobile terminal receives the first Hall switch in preset first magnetic Property region generate the first interrupt signal.
Optionally, the processor 401 is also used to: when receive that the VR equipment reports in preset time range answers When answering information, keeping the OTG function is open state, and the response message is by second Hall switch preset second The second interrupt signal triggering that magnetic regions generate.
Optionally, the processor 401 is also used to: discharge to the OTG function make can control resource.
Optionally, the processor 401 is also used to: when detecting that the mobile terminal is removed from the VR equipment, Close the OTG function.
Optionally, the processor 401 is also used to: if not receiving second Hall switch in preset time range When the second interrupt signal generated, then the OTG function of the mobile terminal is closed.
Optionally, the processor 401 is also used to: if not receiving what the VR equipment reported in preset time range When response message, then the OTG function of the mobile terminal is closed, the response message is the letter of second Hall switch triggering Breath.
Mobile terminal 400 can be realized each process that mobile terminal is realized in previous embodiment, to avoid repeating, here It repeats no more.The embodiment of the present invention, when mobile terminal is placed into Virtual Reality equipment, the mobile terminal can pass through The first interrupt signal of the first Hall switch generation is received, and is directed to first interrupt signal, the mobile terminal opens OTG Function;Then when the second interrupt signal for receiving the second Hall switch generation configured in VR equipment in preset time range When, keeping the OTG function is open state, so that the OTG function of solving mobile terminal in the prior art needs to keep normal The problem of open state, enables mobile terminal to open OTG function on demand, improves the reliability of the USB interface of mobile terminal And safety;Meanwhile being placed into VR equipment in mobile terminal, by the judgement of Hall effect twice, can effectively identify Whether current equipment is legitimate device, if so, keeping mobile terminal OTG function in the open state, is realized mobile whole Warm connection function between end and the VR equipment connected, better user experience.
5th embodiment
Fig. 5 is the structural schematic diagram of the mobile terminal of fifth embodiment of the invention.Specifically, the mobile terminal 500 in Fig. 5 It can be mobile phone, tablet computer, personal digital assistant (PersonalDigital Assistant, PDA) or vehicle-mounted computer etc..
Mobile terminal 500 in Fig. 5 includes radio frequency (RadioFrequency, RF) circuit 510, memory 520, input list Member 530, display unit 540, processor 560, voicefrequency circuit 570, WiFi (WirelessFidelity) module 580 and power supply 590, mobile terminal 500 further includes component 550 of taking pictures, and component 550 of taking pictures includes camera.
Wherein, input unit 530 can be used for receiving the number or character information of user's input, and generation and mobile terminal The related signal input of 500 user setting and function control.Specifically, in the embodiment of the present invention, which can To include touch panel 531.Touch panel 531, also referred to as touch screen collect the touch operation of user on it or nearby (for example user uses the operations of any suitable object or attachment on touch panel 531 such as finger, stylus), and according to preparatory The formula of setting drives corresponding attachment device.Optionally, touch panel 531 may include touch detecting apparatus and touch controller Two parts.Wherein, the touch orientation of touch detecting apparatus detection user, and touch operation bring signal is detected, by signal Send touch controller to;Touch controller receives touch information from touch detecting apparatus, and is converted into contact coordinate, The processor 560 is given again, and can be received order that processor 560 is sent and be executed.Furthermore, it is possible to using resistance-type, The multiple types such as condenser type, infrared ray and surface acoustic wave realize touch panel 531.In addition to touch panel 531, input unit 530 can also include other input equipments 532, other input equipments 532 can include but is not limited to physical keyboard, function key One of (such as volume control button, switch key etc.), trace ball, mouse, operating stick etc. are a variety of.
Wherein, display unit 540 can be used for showing information input by user or be supplied to the information and movement of user The various menu interfaces of terminal 500.Display unit 540 may include display panel 541, optionally, can use LCD or organic hair The forms such as optical diode (OrganicLight-EmittingDiode, OLED) configure display panel 541.
It should be noted that touch panel 531 can cover display panel 541, touch display screen is formed, when the touch display screen is examined After measuring touch operation on it or nearby, processor 560 is sent to determine the type of touch event, is followed by subsequent processing device 560 provide corresponding visual output according to the type of touch event in touch display screen.
Touch display screen includes Application Program Interface viewing area and common control viewing area.The Application Program Interface viewing area And arrangement mode of the common control viewing area does not limit, can be arranged above and below, left-right situs etc. can distinguish two it is aobvious Show the arrangement mode in area.The Application Program Interface viewing area is displayed for the interface of application program.Each interface can be with The interface elements such as the icon comprising at least one application program and/or widget desktop control.The Application Program Interface viewing area Or the empty interface not comprising any content.This commonly uses control viewing area for showing the higher control of utilization rate, for example, Application icons such as button, interface number, scroll bar, phone directory icon etc. are set.
Wherein processor 560 is the control centre of mobile terminal 500, utilizes various interfaces and connection whole mobile phone Various pieces, by running or executing the software program and/or module that are stored in first memory 521, and calling storage Data in second memory 522 execute the various functions and processing data of mobile terminal 500, thus to mobile terminal 500 Carry out integral monitoring.Optionally, processor 560 may include one or more processing units.
In embodiments of the present invention, by call store the first memory 521 in software program and/or module and/ Or the data in the second memory 522, processor 560 are used for the institute when mobile terminal is placed into Virtual Reality equipment It states mobile terminal and receives the first interrupt signal that the first Hall switch generates, the VR device configuration has the second Hall switch;Needle To first interrupt signal, the mobile terminal opens OTG function;When receiving described second in preset time range suddenly When the second interrupt signal that your switch generates, keeping the OTG function is open state.
Optionally, the processor 560 is also used to: the mobile terminal receives the first Hall switch in preset first magnetic Property region generate the first interrupt signal.
Optionally, the processor 560 is also used to: when receive that the VR equipment reports in preset time range answers When answering information, keeping the OTG function is open state, and the response message is by second Hall switch preset second The second interrupt signal triggering that magnetic regions generate.
Optionally, the processor 560 is also used to: discharge to the OTG function make can control resource.
Optionally, the processor 560 is also used to: when detecting that the mobile terminal is removed from the VR equipment, Close the OTG function.
Optionally, the processor 560 is also used to: if not receiving second Hall switch in preset time range When the second interrupt signal generated, then the OTG function of the mobile terminal is closed.
Optionally, the processor 560 is also used to: if not receiving what the VR equipment reported in preset time range When response message, then the OTG function of the mobile terminal is closed, the response message is the letter of second Hall switch triggering Breath.
As it can be seen that the embodiment of the present invention, when mobile terminal is placed into Virtual Reality equipment, the mobile terminal can be with The first interrupt signal generated by receiving the first Hall switch, and it is directed to first interrupt signal, the mobile terminal is opened Open OTG function;Then when in receive the second Hall switch generation configured in VR equipment in preset time range second When break signal, keeping the OTG function is open state, to solve the OTG function needs of mobile terminal in the prior art The problem of maintaining a normally open state enables mobile terminal to open OTG function on demand, improves the USB interface of mobile terminal Reliability and safety;Meanwhile being placed into VR equipment in mobile terminal, it, can be effective by the judgement of Hall effect twice Identify whether current equipment is legitimate device, if so, keeping mobile terminal OTG function in the open state, realizes Warm connection function between mobile terminal and the VR equipment connected, better user experience.
Those of ordinary skill in the art may be aware that the embodiment in conjunction with disclosed in the embodiment of the present invention describe it is each Exemplary unit and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered Think beyond the scope of this invention.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In embodiment provided by the present invention, it should be understood that disclosed device and method can pass through others Mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, only A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of device or unit It connects, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In 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, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, ROM, RAM, magnetic or disk etc. are various can store program code Medium.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.

Claims (12)

1. a kind of open method of the OTG function of mobile terminal, the mobile terminal configuration have the first Hall switch, feature exists In, comprising:
When mobile terminal is placed into Virtual Reality equipment, the mobile terminal receives first that the first Hall switch generates Interrupt signal, the VR device configuration have the second Hall switch;
For first interrupt signal, the mobile terminal opens OTG function;
When receiving the second interrupt signal that second Hall switch generates in preset time range, the OTG is kept Function is open state;
The method also includes:
If do not receive the second interrupt signal that second Hall switch generates in preset time range, described in closing The OTG function of mobile terminal.
2. the method according to claim 1, wherein the VR equipment has preset first magnetic regions, institute Stating the step of mobile terminal receives the first interrupt signal that the first Hall switch generates includes:
The mobile terminal receives the first interrupt signal that the first Hall switch is generated in preset first magnetic regions.
3. the method according to claim 1, wherein the mobile terminal have preset second magnetic regions, It is described when receiving the second interrupt signal that second Hall switch generates in preset time range, keep the OTG Function be open state the step of include:
When receiving the response message that the VR equipment reports in preset time range, the OTG function is kept to open State, the response message are touched by second Hall switch in the second interrupt signal that preset second magnetic regions generate Hair.
4. according to the method described in claim 3, it is characterized in that, in the step for keeping the OTG function as open state After rapid, further includes:
Discharge to the OTG function make can control resource.
5. according to the method described in claim 4, it is characterized by further comprising:
When detecting that the mobile terminal is removed from the VR equipment, the OTG function is closed.
6. the method according to claim 1, wherein if described do not receive described in preset time range When the second interrupt signal that two Hall switch generate, then the step of closing the OTG function of the mobile terminal, includes:
If do not receive the response message that the VR equipment reports in preset time range, the mobile terminal is closed OTG function, the response message are the information of second Hall switch triggering.
7. a kind of mobile terminal, the mobile terminal configuration has the first Hall switch characterized by comprising
Receiving module, for when mobile terminal to be placed into Virtual Reality equipment, the mobile terminal to receive first suddenly The first interrupt signal that your switch generates, the VR device configuration have the second Hall switch;
Opening module, for being directed to first interrupt signal, the mobile terminal opens OTG function;
Module is kept, when for receiving the second interrupt signal of the second Hall switch generation in preset time range, Keeping the OTG function is open state;
The terminal further include:
Second closedown module interrupts letter for not receiving second Hall switch generates second in preset time range Number when, close the OTG function of the mobile terminal.
8. mobile terminal according to claim 7, which is characterized in that the VR equipment has preset first magnetic area Domain, the receiving module include:
Receiving submodule, for when mobile terminal to be placed into Virtual Reality equipment, the mobile terminal to receive first The first interrupt signal that Hall switch is generated in preset first magnetic regions.
9. mobile terminal according to claim 7, which is characterized in that the mobile terminal has preset second magnetic area Domain, the holding module include:
Submodule is kept, when for receiving response message that the VR equipment reports in preset time range, described in holding OTG function is open state, the response message generated by second Hall switch in preset second magnetic regions the The triggering of two interrupt signals.
10. mobile terminal according to claim 9, which is characterized in that the holding module further include:
Discharge submodule, for discharge to the OTG function make can control resource.
11. mobile terminal according to claim 10, which is characterized in that further include:
First closedown module, for closing the OTG function when detecting that the mobile terminal is removed from the VR equipment Energy.
12. mobile terminal according to claim 7, which is characterized in that second closedown module includes:
Second closes submodule, when for not receiving response message that the VR equipment reports in preset time range, closes The OTG function of the mobile terminal is closed, the response message is the information of second Hall switch triggering.
CN201611079821.4A 2016-11-29 2016-11-29 A kind of open method and mobile terminal of the OTG function of mobile terminal Active CN106648857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611079821.4A CN106648857B (en) 2016-11-29 2016-11-29 A kind of open method and mobile terminal of the OTG function of mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611079821.4A CN106648857B (en) 2016-11-29 2016-11-29 A kind of open method and mobile terminal of the OTG function of mobile terminal

Publications (2)

Publication Number Publication Date
CN106648857A CN106648857A (en) 2017-05-10
CN106648857B true CN106648857B (en) 2019-11-01

Family

ID=58813510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611079821.4A Active CN106648857B (en) 2016-11-29 2016-11-29 A kind of open method and mobile terminal of the OTG function of mobile terminal

Country Status (1)

Country Link
CN (1) CN106648857B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107300965A (en) * 2017-05-12 2017-10-27 青岛海信移动通信技术股份有限公司 The implementation method and device of a kind of USB interface waterproof
CN108462792A (en) * 2017-07-31 2018-08-28 维沃移动通信有限公司 A kind of control method and mobile terminal of mobile terminal
CN107749924B (en) * 2017-10-27 2021-01-01 努比亚技术有限公司 VR equipment operation method for connecting multiple mobile terminals and corresponding VR equipment
CN108681514B (en) * 2018-05-02 2020-04-10 Oppo广东移动通信有限公司 Device detection method and device, storage medium and electronic device
WO2020019170A1 (en) 2018-07-24 2020-01-30 华为技术有限公司 Terminal, and type c interface anti-corrosion method
CN114996187B (en) * 2022-05-06 2024-07-26 东莞市步步高教育软件有限公司 OTG function control method and device, computer equipment and storage medium

Citations (5)

* 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
CN102281482A (en) * 2011-07-11 2011-12-14 浙江大学 Function extension method and device thereof for earphone jack of smart phone
CN103744821A (en) * 2014-01-10 2014-04-23 广东欧珀移动通信有限公司 Method and device for realizing USB OTG (Universal Serial Bus On-The-Go) function of mobile terminal
CN105183168A (en) * 2015-09-17 2015-12-23 惠州Tcl移动通信有限公司 Head-wearing type virtual reality device based on mobile terminal and starting method thereof
CN105391858A (en) * 2015-11-04 2016-03-09 深圳维爱特科技有限公司 Virtual reality glass unit, and control method, apparatus and system thereof

Patent Citations (5)

* 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
CN102281482A (en) * 2011-07-11 2011-12-14 浙江大学 Function extension method and device thereof for earphone jack of smart phone
CN103744821A (en) * 2014-01-10 2014-04-23 广东欧珀移动通信有限公司 Method and device for realizing USB OTG (Universal Serial Bus On-The-Go) function of mobile terminal
CN105183168A (en) * 2015-09-17 2015-12-23 惠州Tcl移动通信有限公司 Head-wearing type virtual reality device based on mobile terminal and starting method thereof
CN105391858A (en) * 2015-11-04 2016-03-09 深圳维爱特科技有限公司 Virtual reality glass unit, and control method, apparatus and system thereof

Also Published As

Publication number Publication date
CN106648857A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN106648857B (en) A kind of open method and mobile terminal of the OTG function of mobile terminal
CN106844067B (en) A kind of processing method and mobile terminal of content
CN106843739B (en) A kind of display control method and mobile terminal of mobile terminal
CN106843654B (en) A kind of method and mobile terminal of terminal multi-job operation
CN106844265B (en) A kind of control method and mobile terminal of general-purpose serial bus USB interface
CN106227488B (en) A kind of display methods and mobile terminal of reminder message
CN106959797B (en) A kind of setting method and mobile terminal notifying footmark
CN105867830B (en) A kind of processing method and mobile terminal based on fingerprint recognition
CN104375741A (en) Information processing method and electronic device
CN106371745B (en) A kind of interface switching method and mobile terminal
CN108268389A (en) The insertion detection method and mobile terminal of a kind of equipment
CN105893130B (en) A kind of processing method and mobile terminal of application program for mobile terminal
CN108366169A (en) A kind of processing method and mobile terminal of notification message
CN106547358B (en) A kind of display methods and terminal of terminal time information
CN105930089B (en) A kind of method and mobile terminal switching mobile terminal display interface
CN106371693B (en) A kind of method and mobile terminal showing navigation information
CN107526523B (en) A kind of the operation interface control method and mobile terminal of mobile terminal
CN106055071B (en) A kind of display control method and mobile terminal of notification message
CN109088961A (en) sensor control circuit and electronic device
CN108268395A (en) A kind of method and mobile terminal of data communication
CN106293386B (en) A kind of method and mobile terminal of hide application program
CN106684967B (en) A kind of charging method and mobile terminal of mobile terminal
CN111803938B (en) Game interface processing method, terminal device, electronic device and storage medium
CN108268402A (en) Protection circuit, guard method and the mobile terminal of Type-C interfaces
CN108270255B (en) A kind of charging method and mobile terminal

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
GR01 Patent grant
GR01 Patent grant