Embodiment
In order to make technical problem solved by the invention, technical scheme and beneficial effect clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
See Fig. 1, it is the schematic flow sheet of the first embodiment of data transmission method of the present invention.
The method comprises:
Step S11, the browser of terminal one receives data and downloads instruction, and obtains downloading data.
In embodiments of the present invention, terminal one can be desktop computer, notebook computer or other-end.Downloading data is all kinds resource of user by Network Capture, comprises installation file type and non-installation file type.
In this step, user assigns the download instruction of data in terminal one, and the browser of terminal one receives this instruction, then obtains this downloading data, and is stored in terminal one this locality, records corresponding local memory address simultaneously.Store and can not be discovered by user with the action of record, simplify the use flow process of user with this, promote Consumer's Experience.
Step S12, the browser of terminal one receives by download data transmissions to the instruction of terminal two, and this terminal two is mobile terminal.
In this step, obtain after downloading data, whether terminal one can send by the request of obtained download data transmissions to terminal two to user.This terminal two is mobile terminal, and mobile terminal can be mobile phone, panel computer, MP3, MP4 etc.
In this step, terminal one is while sending this request, also the option whether repeating this transmission action can be added, when user receives the request of network resource transmission to mobile terminal, have selected the option repeating this transmission action simultaneously, then terminal one no longer sends this identical request to user within the scope of certain hour, but directly repeats transmission action.When terminal one to receive download data transmissions to the instruction of terminal two, then carry out step S13.
Step S13, the browser of terminal one calls local Android debugging bridge ADB, by download data transmissions to terminal two.
In this step, when user accepts the request of download data transmissions to mobile terminal, the browser of terminal one calls local Android debugging bridge ADB and is transferred to mobile terminal by being stored in local download.
The mobile terminal of Android system and the communication of computer terminal one generally need to debug bridge ADB by Android and have come, and namely the transfer of data in terminal one in mobile terminal, will need to start ADB and perform corresponding instruction, complete the transmission of specific data.
ADB (AndroidDebugBridge, Android debugging bridge) is specifically used for doing two pieces thing below:
1. follow the tracks of all Android terminal one having connected computer or the simulation instance operated on developer's machine.
2. the demand for meeting client realizes abundant control command.Client comprises order line user or the helper as DDMS, and control command comprises " adbshell ", " adbpull " etc.These control commands are referred to as " service " in ADB.
The embodiment of the present invention receives data by the browser of terminal one and downloads instruction, and obtain downloading data, receive download data transmissions to the instruction of terminal two, call local Android debugging bridge ADB, by download data transmissions to terminal two, breach the restriction that terminal two needs to be obtained by the client in terminal one downloading data, meet the diversified resource acquisition demand of user, simultaneously simple to operation, save the trouble of installing given client end.
See Fig. 2, it is the schematic flow sheet of the second embodiment of data transmission method of the present invention.
The method comprises:
Step S21, the browser of terminal one receives data and downloads instruction, and obtains downloading data.
Step S22, the browser of terminal one receives by download data transmissions to the instruction of terminal two, and this terminal two is mobile terminal.
Step S21 to S22 is identical with the corresponding step in the first embodiment of data transmission method of the present invention, repeats no more here.
Step S23, the type of the browser determination downloading data of terminal one.
In this step, the browser of terminal one can judge that the file type of this downloading data, file type comprise installation file type (file suffixes is generally .APK) and non-installation file type.
Step S24, the browser of terminal one obtains the local store path of downloading data.
In this step, the browser of terminal one will obtain the local store path of this downloading data in terminal one.
Step S25, the browser of terminal one is based on the type of downloading data and local store path, and the ADB generating described downloading data encapsulates instruction.
In this step, the browser of terminal one generates corresponding ADB based on the file type of this downloading data and local store path and encapsulates instruction.Such as, when this downloading data belongs to installation file, it is adbinstall (local store path /) * .apk that the ADB generated encapsulates instruction; When this downloading data belongs to non-installation file, the ADB that generates encapsulate instruction be adbpush [filename]/local store path/.
Step S26, the browser of terminal one encapsulates instruction based on ADB, calls local Android debugging bridge ADB, with by download data transmissions to terminal two.
In this step, the browser of terminal one calls local Android debugging bridge ADB, corresponding ADB is encapsulated instruction issuing to ADB, makes ADB perform this download data transmissions to terminal two.
Such as, browser can use ConnectToNativeHost function call ADB, calls successfully, uses port.postMessage function that corresponding ADB is encapsulated instruction issuing and performs the instruction received to ADB, ADB, complete download data transmissions terminal two.
In this step, encapsulate instruction according to different ADB, can also comprise the following steps:
Step S261, if ADB encapsulates instruction for installing instruction, then browser encapsulates instruction based on ADB, calls ADB by download data transmissions and is installed on terminal two.
In this step, when downloading data is installation file, the ADB that browser generates encapsulates instruction for installing instruction, and now, browser calls ADB, makes ADB complete download data transmissions and is installed on terminal two.
Step S262, if it is transfer instruction that ADB encapsulates instruction, then browser encapsulates instruction based on ADB, calls ADB by download data transmissions to terminal two.
In this step, when downloading data is conventional data, it is transfer instruction that the ADB that browser generates encapsulates instruction, and now, browser calls ADB, makes ADB complete download data transmissions to terminal two.
The embodiment of the present invention receives data by the browser of terminal one and downloads instruction, and obtain downloading data, receive download data transmissions to the instruction of terminal two, determine the type of downloading data, obtain the local store path of downloading data, based on type and the local store path of downloading data, the ADB generating described downloading data encapsulates instruction, instruction is encapsulated based on ADB, call local Android debugging bridge ADB, with by download data transmissions to terminal two, downloading data can directly be installed or be transferred to terminal two by realization, simple to operation, promote customer experience.
See Fig. 3, it is the schematic flow sheet of the 3rd embodiment of data transmission method of the present invention.
The method comprises the following steps:
Step S31, the browser of terminal one receives data and downloads instruction, and obtains downloading data.
Step S32, the browser of terminal one receives by download data transmissions to the instruction of terminal two, and this terminal two is mobile terminal.
Step S31 to S32 is identical with the corresponding step in the first embodiment of data transmission method of the present invention, repeats no more here.
Step S33, if browser does not detect that terminal one stores ADB, then obtains ADB, and this ADB is stored in terminal one.
In this step, there is not ADB when browser recognizes terminal one this locality, then download by prompting user or automatically obtain ADB from network download or other modes and leave terminal one in, for future use.
Step S34, whether browser sense terminals one and terminal two establish a communications link.
In this step, browser calls the connection of ADB sense terminals one and terminal two, sees the terminal two whether existing and be connected with terminal one.
Step S35, if testing result is no, then browser prompts user sets up the communication connection between terminal one and terminal two; If testing result is yes, then performs browser and call local Android debugging bridge ADB, by download data transmissions to the step of terminal two
In this step, if ADB detects the terminal two not existing and be connected with terminal one, browser prompts user accesses terminal two by the USB (UniversalSerialBus, USB) of terminal one, sets up the communication connection of terminal one and terminal two.The terminal two be connected with terminal one is there is, at execution step S36 if detect
Step S36, the browser of terminal one calls local Android debugging bridge ADB, by download data transmissions to terminal two.
Step S36 is identical with the corresponding step in the first embodiment of data transmission method of the present invention, repeats no more here.
By there is not ADB when browser recognizes terminal one in the embodiment of the present invention, then obtain ADB and leave terminal one in, call ADB and identify whether to there is the terminal two be connected with terminal one, if not, browser prompts user accesses terminal two by the logical USB of getting lines crossed of terminal one, complete terminal one and the connection of terminal two, achieve ADB and obtain and the intellectuality being connected terminal two, make operating process more smooth.
See Fig. 4, it is the structural representation of the first embodiment of terminal of the present invention.
The browser of this terminal can the corresponding each step of browser of terminal one in the first embodiment to perform the above method, specifically comprises:
Downloading data acquisition module 110, indicates receiver module 120 to be connected with transmission, downloads instruction, and obtain downloading data for receiving data.
In the embodiment of the present invention, after user assigns the download instruction of data, this downloading data acquisition module 110 receives this instruction, then obtains this downloading data, and is stored in terminal one this locality, records corresponding local memory address simultaneously.Store and can not be discovered by user with the action of record, simplify the use flow process of user with this, promote Consumer's Experience.
Transmission instruction receiver module 120, is connected with calling module 130, for receiving download data transmissions to the instruction of mobile terminal.
In the embodiment of the present invention, obtain after downloading data, whether transmission instruction receiver module 120 can send by the request of obtained download data transmissions to mobile terminal to user, and receives this transmission and indicate.
In the embodiment of the present invention, this transmission instruction receiver module 120 is while sending this request, also the option whether repeating this transmission action can be added, when user receives the request of network resource transmission to mobile terminal, have selected the option repeating this transmission action simultaneously, then terminal no longer sends this identical request to user within the scope of certain hour, but directly repeats transmission action.
Calling module 130, for calling local Android debugging bridge ADB, by download data transmissions to mobile terminal.
In the embodiment of the present invention, when user accepts the request of download data transmissions to mobile terminal, this calling module 130 calls local Android debugging bridge ADB and is transferred to mobile terminal by being stored in local download.
The browser of the terminal of the embodiment of the present invention receives data by the browser of terminal one and downloads instruction, and obtain downloading data, receive download data transmissions to the instruction of terminal two, call local Android debugging bridge ADB, by download data transmissions to terminal two, breach the restriction that terminal two needs to be obtained by the client in terminal one downloading data, meet the diversified resource acquisition demand of user, simultaneously simple to operation, save the trouble of installing given client end.
See Fig. 5, it is the structural representation of the second embodiment of terminal of the present invention.
The browser of this terminal can the corresponding each step of browser of terminal one in the second embodiment to perform the above method, specifically comprises:
Downloading data acquisition module 210, indicates receiver module 220 to be connected with transmission, downloads instruction, and obtain downloading data for receiving data.
Transmission instruction receiver module 220, is connected with downloading data determination type module 230, for receiving download data transmissions to the instruction of mobile terminal.
Downloading data acquisition module 210 is identical with the respective modules in the first embodiment of the browser of data transmission terminal of the present invention with transmission instruction receiver module 220, repeats no more here.
Downloading data determination type module 230, is connected with downloading data path acquisition module 240, for determining the type of described downloading data.
In the embodiment of the present invention, this downloading data determination type module 230 can judge the file type of this downloading data, and file type comprises installation file type (file suffixes is generally .APK) and non-installation file type.
Downloading data path acquisition module 240, is connected, for obtaining the local store path of downloading data with encapsulation directive generation module 250.
In the embodiment of the present invention, this downloading data path acquisition module 240 will obtain the local store path of this downloading data in terminal one.
Encapsulation directive generation module 250, is connected with calling module 260, for based on the type of downloading data and described local store path, generates the ADB encapsulation instruction of downloading data.
In the embodiment of the present invention, this encapsulation directive generation module 250 generates corresponding ADB based on the file type of this downloading data and local store path and encapsulates instruction.Such as, when this downloading data belongs to installation file, it is adbinstall (local store path /) * .apk that the ADB generated encapsulates instruction; When this downloading data belongs to non-installation class file, the ADB that generates encapsulate instruction be adbpush [filename]/local store path/.
Calling module 260, for encapsulating instruction based on ADB, calls local Android debugging bridge ADB, with by download data transmissions to mobile terminal.
This calling module 260 calls local Android debugging bridge ADB, corresponding ADB is encapsulated instruction issuing to ADB, makes ADB perform this download data transmissions to mobile terminal.
Such as, calling module 260 can use ConnectToNativeHost function call ADB, calls successfully, uses port.postMessage function that corresponding ADB is encapsulated instruction issuing to ADB, ADB performs the instruction received, and completes download data transmissions mobile terminal.
Encapsulate instruction according to different ADB, this calling module can also comprise:
First call unit 261, if encapsulate instruction for installing instruction for described ADB, then browser encapsulates instruction based on this ADB, calls ADB by download data transmissions and is installed on mobile terminal;
In the embodiment of the present invention, when downloading data is installation data, the ADB that encapsulation directive generation module 250 generates encapsulates instruction for installing instruction, now, calls first module 261 and calls ADB, make ADB complete download data transmissions and be installed on terminal two.
Second call unit 262, if encapsulating instruction for ADB is transfer instruction, then browser encapsulates instruction based on this ADB, calls ADB by download data transmissions to mobile terminal.
In the embodiment of the present invention, when downloading data is non-installation data, it is transfer instruction that the ADB that encapsulation directive generation module 250 generates encapsulates instruction, now, calls second unit 262, makes ADB complete download data transmissions to terminal two.
The browser of the terminal of the embodiment of the present invention receives data by the browser of terminal one and downloads instruction, and obtain downloading data, receive download data transmissions to the instruction of terminal two, determine the type of downloading data, obtain the local store path of downloading data, based on type and the local store path of downloading data, the ADB generating described downloading data encapsulates instruction, instruction is encapsulated based on ADB, call local Android debugging bridge ADB, with by download data transmissions to terminal two, downloading data can directly be installed or be transferred to terminal two by realization, simple to operation, promote customer experience.
See Fig. 6, it is the structural representation of the 3rd embodiment of terminal of the present invention.
The browser of this terminal can the corresponding each step of browser of terminal one in the 3rd embodiment to perform the above method, specifically comprises:
Downloading data acquisition module 310, indicates receiver module 320 to be connected with transmission, downloads instruction, and obtain downloading data for receiving data.
Transmission instruction receiver module 320, is connected with ADB acquisition module 330, for receiving download data transmissions to the instruction of mobile terminal.
Downloading data acquisition module 310 is identical with the respective modules in the first embodiment of the browser of data transmission terminal of the present invention with transmission instruction receiver module 320, repeats no more here.
ADB acquisition module 330, is connected with linkage identification module 340, if for not detecting that terminal storage has ADB, then obtain ADB, and this ADB is stored in terminal.
In the embodiment of the present invention, there is not ADB when ADB acquisition module 330 recognizes terminal one this locality, then download by prompting user or automatically obtain ADB from network download or other modes and leave terminal one in, for future use.
Whether detection module 340, is connected with processing module 350, establish a communications link with described terminal two for detecting described terminal one.
In the embodiment of the present invention, linkage identification module 340 calls the connection of ADB sense terminals and mobile terminal, sees the mobile terminal whether existing and established a communications link with terminal.
Processing module 350, be connected with calling module 360, if be no for testing result, then prompting user sets up the communication connection between terminal and mobile terminal, if testing result is yes, then performed by calling module 360 and call local Android and debug bridge ADB, by download data transmissions to the step of mobile terminal.
In the embodiment of the present invention, if ADB detects the mobile terminal not existing and be connected with terminal, connect module 350 and pointed out user to access mobile terminal by the logical USB that gets lines crossed of terminal, set up the communication connection of terminal and mobile terminal.If detect, the communication connection of terminal and mobile terminal is set up, then performed by calling module 360 and call local Android and debug bridge ADB, by download data transmissions to the step of mobile terminal.
Calling module 360, for calling local Android debugging bridge ADB, by download data transmissions to mobile terminal.
Calling module 360 is identical with the respective modules in the first embodiment of the browser of data transmission terminal of the present invention, repeats no more here.
By there is not ADB when browser recognizes terminal one in the browser of the terminal of the embodiment of the present invention, then obtain ADB and leave terminal one in, call ADB and identify whether to there is the terminal two be connected with terminal one, if not, browser prompts user accesses terminal two by the logical USB of getting lines crossed of terminal one, complete terminal one and the connection of terminal two, achieve ADB and obtain and the intellectuality being connected terminal two, make operating process more smooth.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-OnlyMemory, ROM) or random store-memory body (RandomAccessMemory, RAM) etc.
Above disclosedly be only a kind of preferred embodiment of the present invention, certainly the interest field of the present invention can not be limited with this, one of ordinary skill in the art will appreciate that all or part of flow process realizing above-described embodiment, and according to the equivalent variations that the claims in the present invention are done, still belong to the scope that invention is contained.