CN102662897B - Mobile terminal and data interaction method between mobile terminals - Google Patents

Mobile terminal and data interaction method between mobile terminals Download PDF

Info

Publication number
CN102662897B
CN102662897B CN201210094069.6A CN201210094069A CN102662897B CN 102662897 B CN102662897 B CN 102662897B CN 201210094069 A CN201210094069 A CN 201210094069A CN 102662897 B CN102662897 B CN 102662897B
Authority
CN
China
Prior art keywords
mobile terminal
usb
device attribute
memory function
data interaction
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
CN201210094069.6A
Other languages
Chinese (zh)
Other versions
CN102662897A (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.)
Beijing Eren Eben Information Technology Co Ltd
Original Assignee
Beijing Eren Eben Information Technology 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 Beijing Eren Eben Information Technology Co Ltd filed Critical Beijing Eren Eben Information Technology Co Ltd
Priority to CN201210094069.6A priority Critical patent/CN102662897B/en
Publication of CN102662897A publication Critical patent/CN102662897A/en
Application granted granted Critical
Publication of CN102662897B publication Critical patent/CN102662897B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to a mobile terminal and a data interaction method between mobile terminals. The method comprises the steps that: A. a first mobile terminal receives port connection information from a connection port, wherein the first mobile terminal is in communication connection with a second mobile terminal by the connection port; B. the equipment attribute of the first mobile terminal is determined based on the port connection information, wherein the equipment attribute comprises a host computer attribute and a slave attribute; and C. data interaction is carried out between the first mobile terminal and the second mobile terminal based on the determined equipment attribute. By executing the invention, data interaction can be directly carried out between two mobile terminals. On occasions of not increasing hardware, for any mobile terminal, the other one terminal connected with the mobile terminal can be directly used as a U disc to use the USB (universal serial bus) memory function, so that the reading and/or writing operation can be directly carried out, the compatibility is good and the application diversify is achieved.

Description

The method of data interaction between a kind of mobile terminal and mobile terminal
Technical field
The present invention relates to communication technical field, more particularly, relate to the method for data interaction between a kind of mobile terminal and mobile terminal.
Background technology
Along with the development of electronic technology, intelligent mobile terminal (as panel computer, smart mobile phone etc.) tightly associates with the life of people, go out business office, daily communication of people all will depend on intelligent mobile terminal, and it is that the life of people brings a lot of convenience.Existing intelligent mobile terminal is all with the USB memory function of USB flash disk, can be used as USB flash disk to use, but there is certain difference with common standard U disk, must enable and could be used its USB memory function by equipment such as PCs (PC) as USB flash disk by software.
In addition, seldom having the intelligent mobile terminal that directly can connect USB flash disk at present on the market, namely enablely connect USB flash disk, also must be standard U disk.For a certain mobile terminal, another intelligent mobile terminal connected directly can not be served as USB flash disk and use its USB memory function, its poor compatibility, application receives certain restriction.So the immediate data between two intelligent mobile terminals is restricted alternately, it is urgent problem in the industry.
Summary of the invention
The technical problem to be solved in the present invention is, for the defect that directly cannot exchange data in prior art between mobile terminal, the method of data interaction between a kind of mobile terminal is provided, makes directly to carry out read and/or write between two mobile terminals, to realize exchanges data.
The technical problem to be solved in the present invention is, for the defect that directly cannot exchange data in prior art between mobile terminal, provides a kind of mobile terminal, and it can using the external storage equipment of the USB memory card of another mobile terminal as oneself.
The technical solution adopted for the present invention to solve the technical problems is: the method providing data interaction between a kind of mobile terminal, comprises the following steps:
A, the first mobile terminal receive the Port Connection Information from connectivity port, and wherein said first mobile terminal is connected with the second communication of mobile terminal by described connectivity port;
B, determine that based on described Port Connection Information the device attribute of described first mobile terminal, wherein said device attribute comprise Host Properties and from device attribute;
C, between described first mobile terminal and described second mobile terminal, carry out data interaction based on determined device attribute.
In the method for data interaction between mobile terminal of the present invention, described step C comprises:
When the device attribute determining described first mobile terminal is Host Properties, perform following steps:
C11, monitor the On/Off state of the USB memory function of described second mobile terminal;
C12, open when the USB memory function of described second mobile terminal, activate the memory function of described second mobile terminal, enable described first mobile terminal carries out read and/or write to the USB memory card in described second mobile terminal.
In the method for data interaction between mobile terminal of the present invention, in described step C12,
The memory function of described second mobile terminal of described activation comprises for described second mobile terminal allocation block equipment, and the second mobile terminal described in carry makes it as the memory cell of described first mobile terminal;
Or the memory function of described second mobile terminal of described activation comprises and directly the memory cell of the second mobile terminal as described first mobile terminal being conducted interviews.
In the method for data interaction between mobile terminal of the present invention, also comprise after described step C12:
C13, to close when the USB memory function of described second mobile terminal, the second mobile terminal described in described first mobile terminal soft unloading.
In the method for data interaction between mobile terminal of the present invention,
Described step C comprises:
When determining that the device attribute of described first mobile terminal is for during from device attribute, performs following steps:
The instruction of the USB memory function of C21, described first mobile terminal of reception unlatching, and the USB memory function of described first mobile terminal is opened based on described instruction.
In the method for data interaction between mobile terminal of the present invention, also comprise after described step C21:
C22, receive reading and/or write command of described second mobile terminal, the USB memory card of described first mobile terminal carries out read and/or write.
In the method for data interaction between mobile terminal of the present invention, it is characterized in that, described first mobile terminal and the second mobile terminal are the mobile terminals using Android operation system.
The present invention solves another technical scheme that its technical problem adopts: construct a kind of mobile terminal, comprising:
First monitoring module, for receiving the Port Connection Information of the connectivity port from described mobile terminal, wherein said connectivity port comprises HPI and from equipment interface;
Device attribute judge module, for when described mobile terminal is connected with another communication of mobile terminal by connectivity port, determine the device attribute of described mobile terminal based on described Port Connection Information, wherein said device attribute comprises Host Properties and from device attribute;
Data interaction administrative unit, for based on determined device attribute, manages the data interaction between described mobile terminal and another mobile terminal described.
In mobile terminal of the present invention, described data interaction administrative unit comprises:
Second monitoring module, for when the device attribute determining described mobile terminal is Host Properties, the On/Off state of the USB memory function of monitoring another mobile terminal described;
Active module, opens for the USB memory function when another mobile terminal described, and activate the memory function of another mobile terminal described, enable described mobile terminal carries out read and/or write to the USB memory card in another mobile terminal described.
In mobile terminal of the present invention, in described active module,
The memory function of another mobile terminal described in described activation comprises for another mobile terminal allocation block equipment described, and another mobile terminal described in carry makes it as the memory cell of described mobile terminal; Or the memory function of another mobile terminal described in described activation comprises and directly the memory cell of another mobile terminal as described mobile terminal being conducted interviews.
In mobile terminal of the present invention, described data interaction administrative unit also comprises:
Close and store notification module, for when the USB memory function of another mobile terminal described is closed, send and close notice from device storage function;
Reseting module, for closing notice from device storage function, another mobile terminal described in enable described mobile terminal soft unloading based on described.
In mobile terminal of the present invention, described mobile terminal comprises USB memory module, for when the device attribute determining described mobile terminal is from device attribute, as the external memory cell of another mobile terminal.
Implement the present invention, there is following beneficial effect:
The immediate data that can realize between two mobile terminals is mutual, when not increasing hardware, for wherein arbitrary mobile terminal, another mobile terminal connected directly can be served as USB flash disk and use its USB memory function, namely directly read and/or write can be carried out, compatible good, make application variation.
Further, owing to being provided with the second monitoring module and active module, the physical connection between two mobile terminals is made not disconnect, be only when closing (forbidding) USB memory function as the mobile terminal from equipment, when user for reactivating USB memory function so that the mobile terminal as main frame can to when carrying out read/write operation from the USB memory card in equipment, reconnecting without the need to pulling out USB connecting line, only need reactivate USB memory function.Second monitoring module once detect from the USB memory function of equipment is opened, and active module is about to from the memory cell of equipment as main frame.Thus the USB hot plug overcoming prior art only can hot plug in processing hardware, user is enabled and defect that " the soft plug " forbidden cannot process.
Accompanying drawing explanation
Below in conjunction with drawings and Examples, the invention will be further described, in accompanying drawing:
Fig. 1 is the structural representation of mobile terminal according to an embodiment of the invention;
Fig. 2 is the structural representation of mobile terminal according to another embodiment of the present invention;
Fig. 3 is the flow chart of steps of the method for data interaction between mobile terminal of the present invention;
Fig. 4 is the flow chart of the method for data interaction between mobile terminal according to an embodiment of the invention;
Fig. 5 is the flow chart according to one embodiment of the invention method of judgment device attribute in the terminal;
Fig. 6 is the flow chart detecting the method for whether opening from equipment USB memory function according to one embodiment of the invention in the terminal;
Fig. 7 is the flow chart detecting the method that USB joint is extracted according to one embodiment of the invention in the terminal;
Fig. 8 is the flow chart detecting the method for whether closing from equipment USB memory function according to one embodiment of the invention in the terminal.
Detailed description of the invention
As shown in Figure 1, in one embodiment of this invention, mobile terminal 100 comprises the first monitoring module 110, device attribute judge module 120, data interaction administrative unit 130, HPI 140 and from equipment interface 150.In the present invention, described mobile terminal mainly refers to intelligent mobile terminal, as panel computer, smart mobile phone etc.
HPI 140 comprises suitable circuit, logic, interface and/or code, for being connected with another communication of mobile terminal.When the HPI 140 of mobile terminal 100 is connected with the connectivity port of another mobile terminal, mobile terminal 100 is as main frame, and the USB memory card in another mobile terminal can be used as the external memory cell of mobile terminal 100.
Suitable circuit, logic, interface and/or code is comprised, for being connected with another communication of mobile terminal from equipment interface 150.When being connected with the connectivity port of another mobile terminal from equipment interface 150 of mobile terminal 100, mobile terminal 100 is as from equipment, and the USB memory card in mobile terminal 100 can be used as the external memory cell of this another mobile terminal.
First monitoring module 110 comprises suitable circuit, logic and/or code, and for receiving the Port Connection Information from mobile terminal 100 connectivity port, wherein this connectivity port comprises HPI 140 and from equipment interface 150.The HPI 140 that Port Connection Information comprises mobile terminal 100 be connected to another mobile terminal from equipment interface, or the HPI being connected to another mobile terminal from equipment interface 150 of mobile terminal 100.
Device attribute judge module 120 comprises suitable circuit, logic and/or code, for when mobile terminal 100 is connected with another communication of mobile terminal by connectivity port (such as HPI 140 or from equipment interface 150), based on the device attribute of aforementioned Port Connection Information determination mobile terminal 100.Wherein device attribute comprises Host Properties and from device attribute, when the HPI 140 of mobile terminal 100 be connected to another mobile terminal from equipment interface, the device attribute of mobile terminal 100 is Host Properties; When the HPI being connected to another mobile terminal from equipment interface 150 of mobile terminal 100, the device attribute of mobile terminal 100 is from device attribute.
Data interaction administrative unit 130, for based on determined device attribute, manages the data interaction between mobile terminal 100 and another mobile terminal.Specifically, data interaction administrative unit 130 comprises the second monitoring module 132, active module 134, closes storage notification module 136 and reseting module 138.Wherein:
Second monitoring module 132 comprises suitable circuit, logic and/or code, for when the device attribute determining mobile terminal 100 is Host Properties, monitors the On/Off state of the USB memory function of another mobile terminal.
Active module 134 comprises suitable circuit, logic and/or code, for when the device attribute of mobile terminal 100 is Host Properties, and when determining that the USB memory function of another mobile terminal is opened, activate the memory function of another mobile terminal, make mobile terminal 100 can carry out read and/or write to the USB memory card in another mobile terminal.
In one embodiment of this invention, the memory function activating another mobile terminal comprises for another mobile terminal allocation block equipment, and another mobile terminal of carry makes it as the memory cell of mobile terminal 100.Particularly, have the memory device of file system to use as one by another mobile terminal.
In another embodiment, the memory function activating another mobile terminal comprises and directly the memory cell of another mobile terminal as mobile terminal 100 being conducted interviews.Particularly, use as a memory device without file system by another mobile terminal.
Close storage notification module 136 and comprise suitable circuit, logic and/or code, for when the device attribute of mobile terminal 100 is Host Properties, when second monitoring module 132 of mobile terminal 100 monitors the USB memory function closedown of another mobile terminal, send to the reseting module 138 in mobile terminal 100 and close notice from device storage function.
Reseting module 138 comprises suitable circuit, logic and/or code, and for closing notice based on what receive from device storage function, another mobile terminal of soft unloading, so that the second monitoring module 132 re-starts monitoring.In addition, the soft unloading described in the present invention, just unload by disconnecting from software, what do not comprise physical connection removes unloading; Described by from software disconnect unload, be: when memory device has file system, notice upper level applications be about to disconnect memory device, wait for upper level applications synchronously get out rear unloading of file system; When memory device does not have file system, wait for that upper level applications synchronously gets out rear direct disconnection memory device.
In one embodiment of this invention, first monitoring module is always in running status, second monitoring module is after the first monitoring module 110 receives the Port Connection Information from mobile terminal 100 connectivity port, often (such as in 0.01 second to 1 second, select an interval time at regular intervals, such as every 0.01 second, 0.05 second, 0.1 second, 0.2 second, 0.5 second, 0.8 second or 1 second etc.) inquire about periodically from the USB memory function of equipment (another mobile terminal) and whether open, and constantly inquire about when closing from the USB memory function of equipment (another mobile terminal) always, until stop inquiry when the USB memory function of equipment (another mobile terminal) is opened.
Particularly, after mobile terminal 100 disconnects with another mobile terminal, the first monitoring module is policing port link information again, and the second monitoring module quits work.
When mobile terminal 100 and another mobile terminal do not disconnect, but close USB memory function from equipment (another mobile terminal), in this case, the first monitoring module continues policing port connection state; Meanwhile, whether the second monitoring module is often periodically inquired about at regular intervals and can be used from the USB memory function of equipment (another mobile terminal), until USB memory function can with or disconnect from equipment (another mobile terminal).
In technical solution of the present invention, owing to being provided with the second monitoring module and active module, the physical connection between two mobile terminals is made not disconnect, be only when closing (forbidding) USB memory function as the mobile terminal from equipment, when user for reactivating USB memory function so that the mobile terminal as main frame can to when carrying out read/write operation from the USB memory card in equipment, reconnecting without the need to pulling out USB connecting line, only need reactivate USB memory function.Second monitoring module once detect from the USB memory function of equipment is opened, and active module is from equipment allocation block module, will hang up the memory cell as main frame from equipment.Thus the USB hot plug overcoming prior art only can hot plug in processing hardware, enables and forbid the defect that " the soft plug " of USB memory function cannot process to user.
As shown in Figure 2, mobile terminal 200 is compared with the mobile terminal 100 shown in Fig. 1, and except adding USB memory module 210 and USB memory function ON/OFF administration module 220, remainder is identical with mobile terminal 100.
USB memory module 210 comprises suitable circuit, logic and/or code, for when the device attribute determining mobile terminal 200 is from device attribute, as the external memory cell of another mobile terminal.In one embodiment of this invention, USB memory module 210 comprises USB storage chip.
USB memory function ON/OFF administration module 220 comprises suitable circuit, interface, logic and/or code, the USB memory function sent for receiving user opens or closes instruction, and perform this instruction, open using convenient mobile terminal 100 as from control during equipment or close its USB memory function.In one embodiment of this invention, USB memory function ON/OFF administration module 220 comprises USB controller, USB controller driver, USB storage chip driver.
In one embodiment of this invention, the first monitoring module 110, device attribute judge module 120, data interaction administrative unit 130 (comprise the second monitoring module 132, active module 134, closedowns stores notification module 136 and reseting module 138 is arranged in the central processing unit of mobile terminal.In another embodiment, above-mentioned module also can be separately positioned in multiple processors of mobile terminal.
It should be noted that, although Fig. 1 and Fig. 2 respectively illustrates some modules of mobile terminal 100 and mobile terminal 200, know as is known to the person skilled in the art, mobile terminal 100 and mobile terminal 200 also can comprise other modules, such as but not limited to communication module (radio communication and/or wire communication module), GPS module, audio/video processing module, memory module, user's control panel etc.Book and clear and definite focal point for the purpose of simplifying the description, be not described, but this does not affect technical scheme of the present invention in the application to the module irrelevant with technical solution of the present invention.
In one embodiment of this invention, mobile terminal 100 and the HPI 140 on 200 with from equipment interface 150 can be two interfaces (on such as panel computer, such as E people E basis, iPad etc.) be separated.Such as panel computer, if its main frame (host) interface is connected with another mobile terminal, then panel computer is as main frame; If it is connected from equipment (device) interface with another mobile terminal, then panel computer is as from equipment.
In an alternative embodiment of the invention, HPI 140 and also can be integrated (as smart mobile phone) on a port from equipment interface 150.Such as smart mobile phone, be generally only provided with a small USB interface, as the dual-purpose USB-OTG slot of a Mini.When the USB joint dual-purpose USB-OTG slot on smart mobile phone being connected with another mobile terminal and drawing, if the connection of this USB joint makes the ID pin short circuit grounding of dual-purpose USB-OTG slot, then this smart mobile phone is as main frame, and another mobile terminal is as from equipment; If the connection of this USB joint does not make the ID pin of dual-purpose USB-OTG slot change, be still in vacant state, then this smart mobile phone is as from equipment, and another mobile terminal is as main frame.
For above-mentioned two kinds of embodiments, correspondingly, the first monitoring module 110 in mobile terminal 100 and 200 and device attribute judge module 120 also do corresponding design.
Below in conjunction with Fig. 3 and Fig. 4, the operating process of mobile terminal 100 and mobile terminal 200 is described in detail.
As shown in Figure 3, the method 300 of data interaction between mobile terminal of the present invention comprises the steps:
Steps A, the first mobile terminal receives the Port Connection Information from connectivity port.Particularly, when the first mobile terminal is connected with the second communication of mobile terminal by its connectivity port, the first monitoring module 110 in the first mobile terminal receives the Port Connection Information from the first mobile terminal connectivity port.This connectivity port comprises HPI 140 and from equipment interface 150.The HPI 140 that Port Connection Information comprises the first mobile terminal be connected to the second mobile terminal from equipment interface, or the HPI being connected to the second mobile terminal from equipment interface 150 of the first mobile terminal.
Step B, the device attribute judge module 120 in the first mobile terminal determines the device attribute of the first mobile terminal based on Port Connection Information, wherein device attribute comprises Host Properties and from device attribute.Particularly, when the HPI 140 of the first mobile terminal be connected to the second mobile terminal from equipment interface, the device attribute of the first mobile terminal is Host Properties; When the HPI being connected to the second mobile terminal from equipment interface 150 of the first mobile terminal, the device attribute of the first mobile terminal is from device attribute.
Step C, carries out data interaction based on determined device attribute between the first mobile terminal and the second mobile terminal, and the 130 pairs of data interactive operations of the data interaction administrative unit wherein in the first mobile terminal manage.
As shown in Figure 4, in one embodiment of this invention, the method 400 of data interaction between mobile terminal of the present invention comprises the steps:
After beginning step, carry out steps A and step B, these two steps are identical with shown in Fig. 3, repeat no more herein.
Step C0, based on the device attribute of the first mobile terminal determined in step B, is divided into two parts in step C0 by the processing procedure of method 400.
When the device attribute determining the first mobile terminal is Host Properties, then perform step C11 to C13; And when determining that the device attribute of the first mobile terminal is for during from device attribute, then perform step C21 to C22.Specific as follows:
On the one hand, when the device attribute determining described first mobile terminal is Host Properties, in step C11, the second monitoring module 132 in the first mobile terminal monitors the On/Off state of the USB memory function of the second mobile terminal.And in step C11a, determine whether the USB memory function of the second mobile terminal opens.If the second mobile terminal USB memory function is opened, then enter step C12.If the second mobile terminal USB memory function is not opened (namely closing or forbidding), then return step C11, continue the On/Off state of the USB memory function of monitoring second mobile terminal.
In step C12, the active module 134 in the first mobile terminal activates the memory function of the second mobile terminal, makes the first mobile terminal can carry out read and/or write to the USB memory card in the second mobile terminal.In one embodiment of this invention, it is the second mobile terminal allocation block equipment that the memory function activating the second mobile terminal comprises, and carry second mobile terminal makes it as the memory cell of the first mobile terminal (i.e. main frame).
Afterwards, in step C12a, according to the instruction of user, the first mobile terminal carries out read and/or write to the USB memory card in the second mobile terminal.After carrying out read and/or write, the second mobile terminal USB memory function is closed in user's general operation, and now described closedown second mobile terminal USB memory function is soft unloading, namely just disconnect unloading from software, what do not comprise physical connection removes unloading.Afterwards, in step C12b, the second monitoring module 132 in the first mobile terminal determines whether the second mobile terminal USB memory function closes.If the second mobile terminal USB memory function is closed (or forbidding), then enter step C13; If the second mobile terminal USB memory function is not closed, then return step C12a, wait for the instruction of user, to carry out read and/or write to the USB memory card in the second mobile terminal.
In step C13, close storage notification module 136 in first mobile terminal and send the second mobile terminal (namely from equipment) USB memory function closedown notice to reseting module 138, reseting module 138 closes notice based on the second mobile terminal (namely from equipment) the USB memory function received, soft unloading second mobile terminal, so that the second monitoring module 132 re-starts monitoring.Afterwards, recirculation performs step C11.If the physical connection of the first mobile terminal and the second mobile terminal disconnects by user, then the method 400 all terminates.
On the other hand, when determining that the device attribute of described first mobile terminal is for during from device attribute, in step C21, USB memory function ON/OFF administration module 220 in first mobile terminal receives the instruction of the USB memory function of unlatching first mobile terminal that user is sent by user's control panel (not shown), and opens the USB memory function of the first mobile terminal based on this instruction.Afterwards, in step C22, the USB memory function ON/OFF administration module 220 in the first mobile terminal receives reading and/or write command from the second mobile terminal, and the USB memory card of the first mobile terminal carries out read and/or write.Afterwards, method 400 continues.
In the inventive solutions, the continuation of method 400 can comprise:
In one embodiment, the physical connection of the first mobile terminal and the second mobile terminal does not disconnect, and method 400 turns back to step C11 from step C13, and the first mobile terminal continues the On/Off state of the USB memory function of monitoring second mobile terminal.
In another embodiment, first mobile terminal is as main frame, and the physical connection of the first mobile terminal and the second mobile terminal disconnects, then method 400 returns steps A from step C13, the first monitoring module 110 in first mobile terminal monitors the state of connectivity port, receive from the Port Connection Information of connectivity port, with the operation of data interaction between two mobile terminals carrying out next round.
In another embodiment, first mobile terminal is as from equipment, and the physical connection of the first mobile terminal and the second mobile terminal disconnects, then method 400 returns steps A from step C22, the first monitoring module 110 in first mobile terminal monitors the state of connectivity port, receive from the Port Connection Information of connectivity port, with the operation of data interaction between two mobile terminals carrying out next round.
In one embodiment of this invention, the first mobile terminal and the second mobile terminal are the mobile terminals using Android operation system, such as panel computer, mobile phone, PDA etc.
Fig. 5 is the flow chart according to one embodiment of the invention method 500 of judgment device attribute in the terminal.In the embodiment shown in fig. 5, HPI be on a port integrated from equipment interface.Whether the first monitoring module 110 in mobile terminal monitors connectivity port has USB joint to insert.When there being USB joint to insert connectivity port, be dual-purpose USB-OTG slot for this connectivity port, in step 510, the first monitoring module 110 detects the type of the USB joint inserting dual-purpose USB-OTG slot.Afterwards, in step 520, first monitoring module 110 judges that the insertion of USB joint makes the ID pin short circuit grounding of dual-purpose USB-OTG slot, or the ID pin of dual-purpose USB-OTG slot is in vacant state, if the ID pin of dual-purpose USB-OTG slot is in vacant state, shows that the joint inserted is the standard USB joint of 4 pins, then enter step 540, determine that the device attribute of this mobile terminal is from device attribute, start from equipment USB memory function; If make the ID pin short circuit grounding of dual-purpose USB-OTG slot, show that the joint inserted is the standard OTG joint of 5 pins, then enter step 530, determine that the device attribute of this mobile terminal is Host Properties, start host function, open the second monitoring module 132.
In another embodiment of the invention, HPI with from equipment interface be two connectivity ports be separated, in this case, the first monitoring module 110 directly can judge its device attribute according to the type of connectivity port.
Fig. 6 is the flow chart detecting the method 600 of whether opening from equipment USB memory function according to one embodiment of the invention in the terminal.In the embodiment shown in fig. 6, when mobile terminal is as main frame, the second monitoring module 132 is enabled.After beginning step 610, in step 620, whether the second monitoring module 132 judges to open device node successful.If unsuccessful, then return step 620; If success, then enter step 630, the block function of enable USB.Afterwards, mount USB storage device in step 640, make another mobile terminal of being connected with mobile terminal as the external memory cell of this mobile terminal.
Fig. 7 is the flow chart detecting the method 700 that USB joint is extracted according to one embodiment of the invention in the terminal.
In the embodiment shown in fig. 7, HPI be on a port integrated from equipment interface.Whether the first monitoring module 110 in mobile terminal monitors connectivity port has USB joint to extract.When there being USB joint to extract connectivity port, be dual-purpose USB-OTG slot for this connectivity port, in step 710, the first monitoring module 110 detects the type of extracting the USB joint of dual-purpose USB-OTG slot.That is, the first monitoring module 110 judges before USB joint is extracted, and the ID pin short circuit grounding of dual-purpose USB-OTG slot, is still in vacant state.
In step 720, judge the ID pin whether short circuit grounding of dual-purpose USB-OTG slot.If so, show that the joint inserted is the standard OTG joint of 5 pins, then determine that the device attribute of this mobile terminal is Host Properties, enter step 730 subsequently, reset and stop the operation of the second monitoring module 132; If not, then step 740 is entered.
In step 740, judge whether the ID pin of dual-purpose USB-OTG slot is in vacant state.If so, show that the joint inserted is the standard USB joint of 4 pins, then determine that the device attribute of this mobile terminal is from device attribute, enter step 750 subsequently, close from equipment USB memory function; If not, then step 710 is returned.
Fig. 8 is the flow chart detecting the method 800 of whether closing from equipment USB memory function according to one embodiment of the invention in the terminal.
In the embodiment shown in fig. 8, whether the second monitoring module 132 monitor user ' in mobile terminal closes the USB memory function from equipment.After beginning step 810, the second monitoring module 132 judges that whether system read-write file is overtime, if not, then returns step 820 and continues to judge; If so, then enter step 830, the second monitoring module 132 sends out time out event.Afterwards, in step 840, soft unloading circumscribed USB memory cell.
Between mobile terminal of the present invention, the system of data interaction mainly comprises main frame, from equipment, monitoring module and activation memory module.In main frame, set up a monitoring module and an activation memory module in technical scheme of the present invention, store notification module and reseting module as preferably increasing to close in addition.
Monitoring module, comprises the first monitoring module and the second monitoring module.Wherein whether the first monitoring module is used for monitoring host computer (host) interface and is connected from equipment (device) interface (when being connected with main frame (host) mouth from equipment (device) mouth, a response can be excited to notify the first monitoring module); Second monitoring module is used for monitoring and (notes memory function own before equipment connection from equipment USB memory function, distinguish with connecting rear overall this memory function of USB flash disk of working as, the latter is called USB memory function in this application) whether enabled by user.
Active module, when being enabled by user from equipment USB memory function for monitoring when the second monitoring module, activating (namely has when this function of USB flash disk from equipment itself from device storage function, that it be have activated now in the present invention), make from one of equipment memory cell becoming main process equipment.
Close and store notification module, during for monitoring user's disconnection when the second monitoring module from equipment USB memory function, notice main frame.
Reseting module, during for monitoring user's closedown when the second monitoring module from equipment USB memory function, soft unloading is from equipment, so that monitoring module re-starts monitoring.
In one embodiment, implementation method step of the present invention is as follows: connect main frame with from equipment (by main frame (host) interface of the first mobile terminal be connected the second mobile terminal from equipment (device) interface, here, first mobile terminal is main frame, second mobile terminal is from equipment), main frame is enumerated by USB and is detected and connected from equipment, host-initiated monitoring module, wait for and being enabled by user from the USB memory function of equipment, enable after the USB memory function of equipment user, namely main frame activates from equipment USB memory function, make from one of equipment memory cell becoming main frame.When user closes (forbidding) from equipment USB memory function, soft unloading is from equipment, so that monitoring module re-starts monitoring.
In various embodiments of the present invention, at host monitor to after equipment connection, whether what by USB, main frame enumerated that judgement connects can use, as available from equipment, system will be sent by Android linux kernel and connect notice, and this notice can monitored module receive and process.Monitoring specifically to as if the proprietary device node of of main frame subordinate, particularly, this device node has certain characteristic, can reflect from device storage functional availability.This device node is the block node of main frame, is functionally equivalent to a software module, and whether control the monitoring of startup second monitoring module can with (namely whether user opens from equipment USB memory function) from device node.If available, perform the operation of active module, after performing activation manipulation, will give from equipment allocation block equipment, the memory cell as main frame will be hung up from equipment.When user forbids after equipment USB memory function, kernel notification monitoring module, namely monitoring module unloads memory cell, software reset's main equipment second monitoring module, performs next monitoring, circulates and so forth.
In order to realize the support of the USB flash disk to poor compatibility, system increases a monitoring module specially, increases Activiation method, makes it to be used.In addition, the support of smart machine compound USB flash disk is comprised: a. kernel is supported: kernel increases partial code, connect for monitoring module provides and disconnect notice; B. a monitoring module is increased; C. increase and activate memory module.

Claims (12)

1. a method for data interaction between mobile terminal, is characterized in that, comprises the following steps:
A, the first mobile terminal receive the Port Connection Information from connectivity port, wherein said first mobile terminal is connected with the second communication of mobile terminal by described connectivity port, the HPI that described Port Connection Information comprises the first mobile terminal be connected to the second mobile terminal from equipment interface, or the HPI being connected to the second mobile terminal from equipment interface of the first mobile terminal;
B, the first mobile terminal determine the device attribute of described first mobile terminal based on described Port Connection Information, and wherein said device attribute comprises Host Properties and from device attribute;
C, the first mobile terminal carry out data interaction based on determined device attribute between described first mobile terminal and described second mobile terminal;
Wherein, described first mobile terminal and described second mobile terminal are panel computer or smart mobile phone, and
The HPI of described first mobile terminal be integrated in a connectivity port from equipment interface, this connectivity port is dual-purpose USB-OTG slot; In step B, based on described Port Connection Information, described first mobile terminal determines that the device attribute of described first mobile terminal comprises: by judging that the insertion of USB joint makes the ID pin short circuit grounding of dual-purpose USB-OTG slot, or the ID pin of dual-purpose USB-OTG slot is in vacant state to determine the device attribute of the first mobile terminal;
Or
The HPI of described first mobile terminal with from equipment interface be two connectivity ports be separated, in step B, based on described Port Connection Information, described first mobile terminal determines that the device attribute of described first mobile terminal comprises: by judging that the HPI of the first mobile terminal is connected with USB joint, or be connected with USB joint to determine the device attribute of the first mobile terminal from equipment interface.
2. the method for data interaction between mobile terminal according to claim 1, is characterized in that, described step C comprises:
When the device attribute determining described first mobile terminal is Host Properties, perform following steps:
C11, monitor the On/Off state of the USB memory function of described second mobile terminal;
C12, open when the USB memory function of described second mobile terminal, activate the memory function of described second mobile terminal, enable described first mobile terminal carries out read and/or write to the USB memory card in described second mobile terminal.
3. the method for data interaction between mobile terminal according to claim 2, is characterized in that, in described step C12,
The memory function of described second mobile terminal of described activation comprises for described second mobile terminal allocation block equipment, second mobile terminal described in carry makes it as the memory cell of described first mobile terminal, has the memory device of file system to use so that the second mobile terminal is used as one;
Or the memory function of described second mobile terminal of described activation comprises and directly the memory cell of the second mobile terminal as described first mobile terminal being conducted interviews, so that the second mobile terminal is used as a memory device without file system to use.
4. the method for data interaction between mobile terminal according to claim 3, is characterized in that, also comprises after described step C12:
C13, to close when the USB memory function of described second mobile terminal, the second mobile terminal described in described first mobile terminal soft unloading; Wherein
Described soft unloading comprises: when the second mobile terminal is used as have the memory device of file system to use time, notice upper level applications by disconnection second mobile terminal, wait for upper level applications synchronously get out rear unloading of file system; When the second mobile terminal being used as the memory device without file system to use, wait for that upper level applications synchronously gets out rear direct disconnection second mobile terminal.
5. the method for data interaction between mobile terminal according to claim 1, is characterized in that, described step C comprises:
When determining that the device attribute of described first mobile terminal is for during from device attribute, performs following steps:
The instruction of the USB memory function of C21, described first mobile terminal of reception unlatching, and the USB memory function of described first mobile terminal is opened based on described instruction.
6. the method for data interaction between mobile terminal according to claim 5, is characterized in that, also comprises after described step C21:
C22, receive reading and/or write command of described second mobile terminal, the USB memory card of described first mobile terminal carries out read and/or write.
7. the method for data interaction between mobile terminal according to any one of claim 1 to 6, is characterized in that, described first mobile terminal and the second mobile terminal are the mobile terminals using Android operation system.
8. a mobile terminal, is characterized in that, comprising:
First monitoring module, for receiving the Port Connection Information of the connectivity port from described mobile terminal, wherein said connectivity port comprises HPI and from equipment interface;
Device attribute judge module, for when described mobile terminal is connected with another communication of mobile terminal by connectivity port, the device attribute of described mobile terminal is determined based on described Port Connection Information, wherein said device attribute comprises Host Properties and from device attribute, the HPI that described Port Connection Information comprises described mobile terminal be connected to another mobile terminal described from equipment interface, or the HPI being connected to another mobile terminal described from equipment interface of described mobile terminal;
Data interaction administrative unit, for based on determined device attribute, manages the data interaction between described mobile terminal and another mobile terminal described;
Wherein, described mobile terminal is panel computer or smart mobile phone, and
Described HPI be integrated in a connectivity port from equipment interface, this connectivity port is dual-purpose USB-OTG slot; Describedly determine that the device attribute of described mobile terminal comprises based on described Port Connection Information: by judging that the insertion of USB joint makes the ID pin short circuit grounding of dual-purpose USB-OTG slot, or the ID pin of dual-purpose USB-OTG slot is in vacant state to determine the device attribute of mobile terminal;
Or
Described HPI with from equipment interface be two connectivity ports be separated, describedly determine that the device attribute of described mobile terminal comprises based on described Port Connection Information: by judging that the HPI of mobile terminal is connected with USB joint, or be connected with USB joint to determine the device attribute of mobile terminal from equipment interface.
9. mobile terminal according to claim 8, is characterized in that, described data interaction administrative unit comprises:
Second monitoring module, for when the device attribute determining described mobile terminal is Host Properties, the On/Off state of the USB memory function of monitoring another mobile terminal described;
Active module, opens for the USB memory function when another mobile terminal described, and activate the memory function of another mobile terminal described, enable described mobile terminal carries out read and/or write to the USB memory card in another mobile terminal described.
10. mobile terminal according to claim 9, is characterized in that, in described active module,
The memory function of another mobile terminal described in described activation comprises for another mobile terminal allocation block equipment described, another mobile terminal described in carry makes it as the memory cell of described mobile terminal, has the memory device of file system to use so that another mobile terminal is used as one;
Or the memory function of another mobile terminal described in described activation comprises and directly the memory cell of another mobile terminal as described mobile terminal being conducted interviews, so that another mobile terminal is used as a memory device without file system to use.
11. mobile terminals according to claim 10, is characterized in that, described data interaction administrative unit also comprises:
Close and store notification module, for when the USB memory function of another mobile terminal described is closed, send and close notice from device storage function;
Reseting module, for closing notice from device storage function, another mobile terminal described in enable described mobile terminal soft unloading based on described; Wherein
Described soft unloading comprises: when another mobile terminal is used as have the memory device of file system to use time, notice upper level applications be about to disconnect another mobile terminal, wait for upper level applications synchronously get out rear unloading of file system; When another mobile terminal being used as the memory device without file system to use, wait for that upper level applications synchronously gets out rear another mobile terminal of direct disconnection.
12. mobile terminals according to claim 8, is characterized in that, described mobile terminal comprises USB memory module, for when the device attribute determining described mobile terminal is from device attribute, as the external memory cell of another mobile terminal.
CN201210094069.6A 2012-03-31 2012-03-31 Mobile terminal and data interaction method between mobile terminals Active CN102662897B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210094069.6A CN102662897B (en) 2012-03-31 2012-03-31 Mobile terminal and data interaction method between mobile terminals

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210094069.6A CN102662897B (en) 2012-03-31 2012-03-31 Mobile terminal and data interaction method between mobile terminals

Publications (2)

Publication Number Publication Date
CN102662897A CN102662897A (en) 2012-09-12
CN102662897B true CN102662897B (en) 2015-04-29

Family

ID=46772393

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210094069.6A Active CN102662897B (en) 2012-03-31 2012-03-31 Mobile terminal and data interaction method between mobile terminals

Country Status (1)

Country Link
CN (1) CN102662897B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102231878B (en) * 2011-06-21 2017-09-29 中兴通讯股份有限公司 Data card start-up method and data card
CN103064812B (en) * 2012-12-24 2016-04-06 珠海市君天电子科技有限公司 Method and device for quickly connecting mobile equipment and computer
CN103473198A (en) * 2013-09-13 2013-12-25 吴涛 Method for sharing and transmitting files between mobile terminals
CN103593309B (en) * 2013-10-21 2016-06-15 杭州魔品科技股份有限公司 A kind of PC of solution end occurs the method for off-line problem with Android mobile phone in being connected
CN104660395B (en) * 2013-11-25 2019-03-01 北京壹人壹本信息科技有限公司 A kind of method of data synchronization, system and equipment
CN104035902B (en) * 2014-07-02 2017-11-10 广东欧珀移动通信有限公司 A kind of method and communication system for accessing data
CN105117363B (en) * 2015-08-10 2017-08-29 广东欧珀移动通信有限公司 A kind of method and system of lifting USB OTG compatibility
CN105956458A (en) * 2016-04-28 2016-09-21 乐视控股(北京)有限公司 Interaction control method and device for terminals
CN105955666A (en) * 2016-04-29 2016-09-21 乐视控股(北京)有限公司 Electronic device and method for providing data to another electronic device directly connected with the electronic device
CN106686115A (en) * 2017-01-19 2017-05-17 上海数果科技有限公司 High-safety high-efficiency mobile terminal data inter-transmission system based on USB (universal serial bus) interface
CN111698366B (en) * 2020-05-08 2021-03-19 北京连山科技股份有限公司 Mobile phone hardware extension method based on USB interface
CN113852760A (en) * 2021-09-26 2021-12-28 联想(北京)有限公司 Control method and control device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1553733A (en) * 2003-05-30 2004-12-08 ΰ Mobile with universal series bus USB storing function
CN1755656A (en) * 2004-09-27 2006-04-05 江苏新科电子集团有限公司 Data transmission and control system employing USB and relative method thereof
CN1858748A (en) * 2006-05-22 2006-11-08 上海怀瑾计算机科技有限公司 Method for realizing directly access USB master facility end file from slave facility end at USB
CN201509250U (en) * 2009-09-18 2010-06-16 天津三星光电子有限公司 Digital camera with USB host machine expanding function

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1553733A (en) * 2003-05-30 2004-12-08 ΰ Mobile with universal series bus USB storing function
CN1755656A (en) * 2004-09-27 2006-04-05 江苏新科电子集团有限公司 Data transmission and control system employing USB and relative method thereof
CN1858748A (en) * 2006-05-22 2006-11-08 上海怀瑾计算机科技有限公司 Method for realizing directly access USB master facility end file from slave facility end at USB
CN201509250U (en) * 2009-09-18 2010-06-16 天津三星光电子有限公司 Digital camera with USB host machine expanding function

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种USB从设备访问主设备的方法;张志,余松煜;《计算机工程》;20080205;第34卷(第3期);全文 *

Also Published As

Publication number Publication date
CN102662897A (en) 2012-09-12

Similar Documents

Publication Publication Date Title
CN102662897B (en) Mobile terminal and data interaction method between mobile terminals
CN100583076C (en) Hot plug detection method of mobile memory card
CN102081581B (en) Power management system and method
CN108885601B (en) USB multi-host endpoint reflector hub
CN101883446B (en) Secure digital (SD) control chip and data communication method
CN102902650A (en) Data sharing and transfer systems and methods
CN102970432B (en) A kind of mobile terminal and the method controlling SIM card hot plug thereof
CN107003974B (en) Interface detection method and device
WO2010133051A1 (en) Method and device for auto-adapting wireless data cards of multiple modes
CN102073602B (en) Computer system, connection control device as well as connecting and disconnecting method
CN104063348A (en) Device and method for realizing compatible USB (Universal Serial Bus) communication and audio communication
CN112799985B (en) USB interface control method, USB control circuit and intelligent networking equipment mainboard
US20200166980A1 (en) Intelligent storage device and method for accessing intelligent storage device
CN1331037C (en) Storing card with multi-interfae function and transmitting mode selective method
CN101923505A (en) Test system and method of peripheral component interconnection rapid slot
CN103049403B (en) Method for communication between embedded terminal device and cell phone
WO2016065821A1 (en) Multifunctional portable data card and data transmission method
US20030172263A1 (en) Passive adapter for portable memory cards
EP2620899B1 (en) Smart chip and method for smart chip data communications
US8602314B2 (en) Memory card adapter
CN100422973C (en) Controller with dual interfaces based on single chip
CN110764956B (en) SD or MMC interface testing device and method based on FPGA
CN109388601B (en) Control method of OTG power supply and charging automatic switching module
CN101505332A (en) Optimized processing method for sleeping/waking SD card by smart phone
CN2840564Y (en) Mobile telephone

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant