CN109992430A - A kind of data transmission method, first terminal and second terminal - Google Patents

A kind of data transmission method, first terminal and second terminal Download PDF

Info

Publication number
CN109992430A
CN109992430A CN201910152605.5A CN201910152605A CN109992430A CN 109992430 A CN109992430 A CN 109992430A CN 201910152605 A CN201910152605 A CN 201910152605A CN 109992430 A CN109992430 A CN 109992430A
Authority
CN
China
Prior art keywords
terminal
application process
port
permission
preset program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910152605.5A
Other languages
Chinese (zh)
Other versions
CN109992430B (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 CN201910152605.5A priority Critical patent/CN109992430B/en
Publication of CN109992430A publication Critical patent/CN109992430A/en
Application granted granted Critical
Publication of CN109992430B publication Critical patent/CN109992430B/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/54Interprogram communication
    • G06F9/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space

Abstract

The present invention provides a kind of data transmission method, first terminal and second terminals, are related to technical field of data processing.Wherein, this method comprises: in the case where connecting second terminal, preset program bag is sent to by second terminal by the first application process;According to the store path of preset program bag, pass through the process creation order with target permission, start preset program bag, creation has the second application process of target permission in second terminal, and the Permission Levels of target permission are greater than or equal to the Permission Levels that system strategy executes permission;Receive the process connection request of second terminal;Generate the socket of second terminal;Pass through the corresponding second port of the first application process and second terminal transmission objectives data.In the present invention, the second application process execution permission with higher, therefore, the second application process will not system strategy process identical by Permission Levels or more low rights forcibly close, so that the disconnecting between the process of can avoid, improves data transmission efficiency.

Description

A kind of data transmission method, first terminal and second terminal
Technical field
The present invention relates to technical field of data processing more particularly to a kind of data transmission method, first terminal and second eventually End.
Background technique
Currently, there are many management applications for being directed to android terminal, such as mobile phone assistant, mobile phone house keeper etc. on the market.It is logical Often, user can download the management application for being directed to Android mobile phone in desktop computer, then can be by desktop computer and peace Zhuo Shouji is attached, and then desktop computer can realize that the data between Android mobile phone are transmitted by management application, example Contact person, short message, message registration data are such as exported or import, so as to be managed to the data in second terminal.
In general, in practical applications, for being equipped with the management terminal of android terminal management application, the management terminal with Before android terminal carries out data transmission, management terminal usually requires to send an APK (Android to android terminal Package, Android program installation kit), the application program in the APK can be matched with management application, so as to realize Data transmission between two terminals.
However, due to being limited by Android system or manufacturer, the execution permission of the corresponding application process of APK application program Usually lower, therefore, which is easily forced by system strategies such as the power saving of higher-rights, speed-raisings in running background It exits, is interrupted so as to cause the data transmission channel between management terminal and android terminal, and then management terminal and android terminal Between need to establish data transmission channel again, can continue data transmission, in this way, reduce data transmission effect Rate.
Summary of the invention
The present invention provides a kind of data transmission method, first terminal and second terminal, to solve the corresponding application process of APK It is lower to execute permission, easily by the system strategies compulsory withdrawal such as the power saving of higher-rights, speed-raising, causes in data transmission procedure It is disconnected, the low problem of data transmission efficiency.
In order to solve the above-mentioned technical problem, the present invention is implemented as follows:
In a first aspect, being applied to first terminal the embodiment of the invention provides a kind of data transmission method, comprising:
In the case where connecting second terminal, preset program bag is sent to described second eventually by the first application process It holds, includes the method function for realizing data transmission in the preset program bag;
According to the store path of the preset program bag in the second terminal, created by the process with target permission Order is built, starts the preset program bag in the second terminal, created in the second terminal with the target Second application process of permission, the Permission Levels of the target permission are greater than or equal to the permission etc. that system strategy executes permission Grade;
The second terminal is received when second application process creates completion, it is corresponding by second application process First port send process connection request;
According to the port numbers of the Internet protocol address of the second terminal and the first port, described second is generated eventually The socket at end, with the connection established between first application process and second application process;
Pass through the corresponding second port of first application process and the second terminal transmission objectives data.
Second aspect, the embodiment of the invention also provides a kind of data transmission methods, are applied to second terminal, comprising:
In the case where connecting first terminal, receives the first terminal and pass through the preset program that the first application process is sent It wraps, includes the method function for realizing data transmission in the preset program bag;
When the second application process with target permission creates completion in the second terminal, answered by described second Process connection request is sent to the first terminal with the corresponding first port of process, second application process is described first The preset program bag is sent to the second terminal by terminal, and in the second terminal according to the preset program bag Store path starts the preset program by the process creation order with the target permission in the second terminal Packet creates, and the Permission Levels of the target permission are greater than or equal to the Permission Levels that system strategy executes permission;
By the first port and the first terminal transmission objectives data, the target data is the first terminal The process connection request is received, and according to the port of the Internet protocol address of the second terminal and the first port Number, the socket of the second terminal is generated, with the company established between first application process and second application process After connecing, pass through the data of the corresponding second port of first application process and second terminal transmission.
The third aspect, the embodiment of the invention also provides a kind of first terminal, which includes:
First sending module, in the case where connecting second terminal, by the first application process by preset program bag It is sent to the second terminal, includes the method function for realizing data transmission in the preset program bag;
Creation module, for the store path according to the preset program bag in the second terminal, by with mesh The process creation order for marking permission, starts the preset program bag, in the second terminal to create in the second terminal The second application process with the target permission is built, the Permission Levels of the target permission are executed greater than or equal to system strategy The Permission Levels of permission;
First receiving module passes through institute for receiving the second terminal when second application process creates completion State the process connection request that the corresponding first port of the second application process is sent;
Generation module, for according to the Internet protocol address of the second terminal and the port numbers of the first port, The socket of the second terminal is generated, with the connection established between first application process and second application process;
First transmission module, for being transmitted by the corresponding second port of first application process and the second terminal Target data.
Fourth aspect, the embodiment of the invention also provides a kind of second terminal, which includes:
Second receiving module passes through the first application in the case where connecting first terminal, receiving the first terminal The preset program bag that process is sent includes the method function for realizing data transmission in the preset program bag;
Second sending module, for creating completion in the second terminal in the second application process with target permission When, by the corresponding first port of second application process to the first terminal send process connection request, described second The preset program bag is sent to the second terminal for the first terminal by application process, and according to the preset program bag Store path in the second terminal, by the process creation order with the target permission, in the second terminal The middle starting preset program bag creates, and the Permission Levels of the target permission are greater than or equal to system strategy and execute permission Permission Levels;
Second transmission module, for passing through the first port and the first terminal transmission objectives data, the target Data are that the first terminal receives the process connection request, and according to the Internet protocol address of the second terminal and The port numbers of the first port generate the socket of the second terminal, to establish first application process and described the After connection between two application processes, transmitted by the corresponding second port of first application process and the second terminal Data.
5th aspect, the embodiment of the invention also provides a kind of terminal, which includes processor, memory and is stored in On the memory and the computer program that can run on the processor, the computer program are executed by the processor The step of Shi Shixian data transmission method of the present invention.
6th aspect, the embodiment of the invention also provides a kind of computer readable storage medium, the computer-readable storages Computer program is stored on medium, and the step of data transmission method of the present invention is realized when computer program is executed by processor Suddenly.
In embodiments of the present invention, first terminal can pass through the first application process in the case where connecting second terminal Preset program bag is sent to second terminal, includes the method function for realizing data transmission in preset program bag, then the One terminal can be ordered according to store path of the preset program bag in second terminal by the process creation with target permission It enables, starts preset program bag in second terminal, to create second application process with target permission in second terminal, In, the Permission Levels of target permission are greater than or equal to the Permission Levels that system strategy executes permission, can receive second later eventually End is when the second application process creates completion, the process connection request sent by the corresponding first port of the second application process, And the socket of second terminal can be generated according to the Internet protocol address of second terminal and the port numbers of first port, with The connection between the first application process and the second application process is established, and then first terminal can be corresponding by the first application process Second port and second terminal transmission objectives data.In embodiments of the present invention, the process with target permission can be passed through Creation order, in second terminal creation have target permission the second application process, the Permission Levels of target permission be higher than or Equal to the Permission Levels that system strategy executes permission, it that is to say that the second application process has not less than systems plans such as power saving, speed-raisings The slightly execution permission of process, therefore, the second application process in the process of running, will not be identical by Permission Levels or more low rights System strategy process forcibly closes, so as to avoid in the connection generation between the first application process and the second application process It is disconnected, and then can be improved the efficiency of data transmission.
Detailed description of the invention
Fig. 1 shows the flow chart of one of the embodiment of the present invention one data transmission method;
Fig. 2 shows the flow charts of one of the embodiment of the present invention two data transmission method;
Fig. 3 shows the flow chart of one of the embodiment of the present invention three data transmission method;
Fig. 4 shows the structural block diagram of one of the embodiment of the present invention four first terminal;
Fig. 5 shows the structural block diagram of one of the embodiment of the present invention five second terminal;
Fig. 6 shows the hardware structural diagram of one of each embodiment of present invention terminal.
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.
Embodiment one
Referring to Fig.1, the flow chart of the data transmission method of the embodiment of the present invention one is shown, which can be with Applied to first terminal, it can specifically include following steps:
Step 101, in the case where connecting second terminal, preset program bag is sent to second by the first application process Terminal includes the method function for realizing data transmission in preset program bag.
In embodiments of the present invention, for carrying out data transmission with second terminal can be installed in first terminal One application, the system of first terminal are starting this first in application, can create and run the first application process.When user needs When carrying out data transmission, first terminal and second terminal can be attached, and start the first application, so that first terminal is created The first application process is built, and then in the case where first terminal connects second terminal, the first application process can be according to specified Store path in second terminal is pushed to preset program bag under the specified storage catalogue in second terminal by the first application It is stored.
Wherein, which is equivalent to an application program installation kit, including what is transmitted for realizing data Method function.The preset program bag may be mounted in second terminal after starting in second terminal, that is to say in second terminal In be mounted with one can with the target application it is mating carry out using, with realize data transmission second application.Second application can To be carried out data transmission by running method function therein, can specifically include in this method function how to the spy received Fixed number according to the method function handled, how specific data is sent to the method function of terminal etc. of connection, the present invention Embodiment is not especially limited this.
Step 102, the store path according to preset program bag in second terminal is created by the process with target permission Build order, start preset program bag in second terminal, in second terminal create have target permission second application into Journey, the Permission Levels of target permission are greater than or equal to the Permission Levels that system strategy executes permission.
In embodiments of the present invention, first terminal can be performed locally the process creation with target permission and order Enable, include store path of the preset program bag in second terminal in the order line of the process creation order, first terminal with In the case that second terminal connects, first terminal executes the process creation order, can start the storage road in second terminal The preset program bag stored under diameter.The preset program bag starts and installs in second terminal, is equivalent to and pacifies in second terminal One second application is filled, the system of second terminal is starting this second in application, can create and run the second application process. And since the second application process is created by the process creation order with target permission, the second application process Also there is target permission.
In practical applications, target permission can be higher than times that system strategy executes the Permission Levels of permission for Permission Levels One permission, such as target permission can be shell (shell) permission, and shell permission is the higher ranked execution of one of terminal Permission, Permission Levels are roughly equivalent to adb (Android Debug Bridge, Android debug bridge) permission.In terminal usually It is set with the execution permission of many grades, such as Permission Levels highest root (root) permission, Permission Levels are lower than root authority Administrator (administrator) permission, Permission Levels be lower than Administrator right shell permission, Permission Levels Lower than application permission etc. that system strategy permission, the Permission Levels of shell permission are lower than system strategy permission.Wherein, permission The resource type and resource quantity that the different execution permission of grade can be called independently are different, the higher execution of Permission Levels The resource type and resource quantity that permission can be called independently are more.For the application program in general application program installation kit, Such as the application program in APK, the execution permission of the corresponding application process of the application program are usually junior application power Limit, limited aspect mainly have: the application program installation kit needs user to confirm during installation, and the application program is corresponding The process that application process can be executed permission with greater degree forcibly closes.
Correspondingly, the Permission Levels for the target permission having due to the second application process are higher, in preset program bag When being installed, user is allowed to confirm without playing the modes such as frame by display, and the second application process will not equally be had The process of shell permission forcibly closes.
Step 103, receive second terminal the second application process create complete when, pass through the second application process corresponding the The process connection request that Single port is sent.
In embodiments of the present invention, second terminal can be in the second application process with target permission in second terminal When creation is completed, process connection request, and then first are sent to first terminal by the corresponding first port of the second application process Terminal can receive the process connection request.
Step 104, according to the port numbers of the Internet protocol address of second terminal and first port, second terminal is generated Socket, with the connection established between the first application process and the second application process.
In embodiments of the present invention, first terminal, can be with after the process connection request for receiving second terminal transmission Eventually by the port numbers of the Internet protocol address (Internet Protocol, IP) of second terminal and first port composition second The socket (socket) at end, and the socket is saved, so far, the connection between the first application process and the second application process is built It is vertical to complete, so that the first application process can carry out data interaction with the second application process.
Step 105, pass through the corresponding second port of the first application process and second terminal transmission objectives data.
In embodiments of the present invention, the connection between the first application process and the second application process is established after completion, First application process can send target data to the corresponding first port of the second application process by second port, to realize Data transmission between first application process and the second application process.In practical applications, target data for example can be user The data such as the picture, text, the video that need to transmit, in addition, target data can be local data, naturally it is also possible to be from service The application data that device obtains, the present invention is not especially limit this.
In embodiments of the present invention, first terminal can pass through the first application process in the case where connecting second terminal Preset program bag is sent to second terminal, includes the method function for realizing data transmission in preset program bag, then the One terminal can be ordered according to store path of the preset program bag in second terminal by the process creation with target permission It enables, starts preset program bag in second terminal, to create second application process with target permission in second terminal, In, the Permission Levels of target permission are greater than or equal to the Permission Levels that system strategy executes permission, can receive second later eventually End is when the second application process creates completion, the process connection request sent by the corresponding first port of the second application process, And the socket of second terminal can be generated according to the Internet protocol address of second terminal and the port numbers of first port, with The connection between the first application process and the second application process is established, and then first terminal can be corresponding by the first application process Second port and second terminal transmission objectives data.In embodiments of the present invention, the process with target permission can be passed through Creation order, in second terminal creation have target permission the second application process, the Permission Levels of target permission be higher than or Equal to the Permission Levels that system strategy executes permission, it that is to say that the second application process has not less than systems plans such as power saving, speed-raisings The slightly execution permission of process, therefore, the second application process in the process of running, will not be identical by Permission Levels or more low rights System strategy process forcibly closes, so as to avoid in the connection generation between the first application process and the second application process It is disconnected, and then can be improved the efficiency of data transmission.
Embodiment two
Referring to Fig. 2, the flow chart of the data transmission method of the embodiment of the present invention two is shown, which can be with Applied to second terminal, it can specifically include following steps:
Step 201, it in the case where connecting first terminal, receives first terminal and passes through the preset of the first application process transmission Program bag includes the method function for realizing data transmission in preset program bag.
In embodiments of the present invention, for carrying out data transmission with second terminal can be installed in first terminal One application, the system of first terminal are starting this first in application, can create and run the first application process.When user needs When carrying out data transmission, first terminal and second terminal can be attached, and start the first application, so that first terminal is created The first application process is built, and then in the case where first terminal connects second terminal, the first application process can be according to specified Preset program bag is pushed to the specified storage catalogue in second terminal by the first application by the store path in second terminal, Correspondingly, second terminal, which can receive first terminal, passes through the preset program bag that the first application process is sent, and can refer to Determine to store the preset program bag under storage catalogue.
Step 202, it when the second application process with target permission creates completion in second terminal, is answered by second Process connection request is sent to first terminal with the corresponding first port of process;Second application process is first terminal by preset journey Sequence packet is sent to second terminal, and the store path according to preset program bag in second terminal, by with target permission Process creation order starts preset program bag in second terminal and creates, and the Permission Levels of target permission are greater than or equal to The Permission Levels of system strategy execution permission.
In embodiments of the present invention, first terminal can be performed locally the process creation with target permission and order Enable, include store path of the preset program bag in second terminal in the order line of the process creation order, first terminal with In the case that second terminal connects, first terminal executes the process creation order, can start the storage road in second terminal The preset program bag stored under diameter.The preset program bag starts and installs in second terminal, is equivalent to and pacifies in second terminal One second application is filled, the system of second terminal is starting this second in application, can create and run the second application process. And since the second application process is created by the process creation order with target permission, the second application process Also there is target permission.
Further, when the second application process with target permission creates completion in second terminal, second terminal Can by the corresponding first port of the second application process to first terminal send process connection request, with in first terminal First application process is attached, to realize the interaction between the first application process.
Step 203, pass through first port and first terminal transmission objectives data;Target data be first terminal receive into Journey connection request, and according to the port numbers of the Internet protocol address of second terminal and first port, generate the set of second terminal Word is connect, to pass through the first application process corresponding after the connection established between the first application process and the second application process The data of Two-port netwerk and second terminal transmission.
In embodiments of the present invention, first terminal, can be with after the process connection request for receiving second terminal transmission By the socket of the port numbers of the Internet protocol address of second terminal and first port composition second terminal, and save the socket Word, so far, connection between the first application process and the second application process, which is established, to be completed, so that the first application process can be with the Two application processes carry out data interaction.Connection between the first application process and the second application process is established after completion, the Two application processes can send target data to the corresponding second port of the first application process by first port, to realize the Data transmission between two application processes and the first application process.
In embodiments of the present invention, second terminal can receive first terminal and pass through in the case where connecting first terminal The preset program bag that first application process is sent includes the method function for realizing data transmission in preset program bag, then It can be corresponding by the second application process when the second application process with target permission creates completion in second terminal First port sends process connection request to first terminal, which is that preset program bag is sent to by first terminal Second terminal, and the store path according to preset program bag in second terminal are ordered by the process creation with target permission It enables, starts preset program bag in second terminal and create, wherein the Permission Levels of target permission are greater than or equal to system plan The Permission Levels of permission are slightly executed, and then second terminal can pass through first port and first terminal transmission objectives data, the mesh Mark data are that first terminal receives process connection request, and according to the Internet protocol address of second terminal and first port Port numbers generate the socket of second terminal, to lead to after the connection established between the first application process and the second application process Cross the data of the corresponding second port of the first application process and second terminal transmission.In embodiments of the present invention, tool can be passed through There is the process creation order of target permission, creation has the second application process of target permission, target permission in second terminal Permission Levels be greater than or equal to system strategy execute permission Permission Levels, that is to say the second application process have not less than save The execution permission of the system strategies processes such as electricity, speed-raising, therefore, the second application process in the process of running, will not be by Permission Levels Identical or more low rights system strategy processes forcibly close, so as to avoid the first application process and the second application process it Between connection interrupt, and then can be improved data transmission efficiency.
Embodiment three
Referring to Fig. 3, the flow chart of the data transmission method of the embodiment of the present invention three is shown, which can be with Applied to the data transmission system including first terminal and second terminal, it can specifically include following steps:
Step 301, first terminal is sent out preset program bag by the first application process in the case where connecting second terminal It send to second terminal;It include the method function for realizing data transmission in preset program bag.
In embodiments of the present invention, second terminal and the first terminal can debug the corresponding general string of bridge by Android Row bus mode or the connection of local net mode.Specifically, Android debugging bridge is divided into two kinds of bridge modes, and one kind can pass through Wired bridge mode of USB (Universal Serial Bus, universal serial bus) connection, there are also one kind can pass through local Net the wireless bridging mode of connection.For wired bridge mode, user needs to click USB (Universal in second terminal Serial Bus, universal serial bus) debugging option, so that second terminal can open USB debugging port, USB debugs port After unlatching, first terminal could be bridged by adb and second terminal.For wireless bridging mode, user then needs One terminal and second terminal are all connected to the same local area network, such as are connected to the corresponding WiFi of the same local area network (Wireless FidelitV, Wireless Fidelity), so that first terminal could be bridged by adb and second terminal.Wherein, Second terminal can be the mobile terminal for being equipped with Android (Android) system.
First terminal can create and run the first application process in the case where connecting second terminal, and then first answers Adb push (push) order can be executed with process, specified is deposited so as to push in second terminal by preset program bag It is stored under storage catalogue.In practical applications, the preset program bag namely the program bag of a jar format, the preset program Packet is compiled by an executable dex file, includes the entrance that a main function is executed as program in dex file, The method function that the main function that is to say for realizing data transmission.In addition, in a particular application, which can Think the catalogue that the process with shell permission has permission to access, such as can be/data/local/tmp catalogue, correspondingly, The adb push order specifically can be adb push server.jar/data/local/tmp, wherein server.jar is For the packet name of preset program bag.
Step 302, second terminal receives first terminal and is sent out by the first application process in the case where connecting first terminal The preset program bag sent.
In embodiments of the present invention.After first terminal sends preset program bag to second terminal, second terminal accordingly may be used To receive the preset program bag, and the preset program bag can be stored under specified storage catalogue.At this point, first terminal can be with Preset program bag is provided to second terminal as server-side, correspondingly, second terminal, which can be used as client, receives the preset journey Sequence packet.
Step 303, first terminal will be directed to the preset first port of the second application process and be mapped to first in second terminal The corresponding second port of application process.
In embodiments of the present invention, each application process would generally pass through port preset in terminal and other equipment Data interaction is carried out, therefore, when the first application process in first terminal needs to be counted by second port and second terminal When the second application process according to transmission, and in second terminal needs to carry out data transmission by first port and first terminal, the The first application process in one terminal can be got through and the second application process in second terminal by adb reverse order Between interface channel.
Specifically, the first application process can execute adb reverse tcp:port1 tcp:port2 order, by The corresponding second port of the first application process is mapped to for the preset first port of the second application process in two terminals.Wherein, Port1 is the port numbers of first port in second terminal, and port2 is the port numbers of second port in first terminal, tcp Used in (Transmission Control Protocol transmission control protocol) carries out data transmission between two ports Communication protocol.
First terminal can realize the reverse proxy of port by adb reverse order, so that first terminal and second The role of terminal changes, and second terminal will be used as client, sends one to the second port of first terminal and is used to indicate Data transmit ready process connection request, and first terminal then can be used as server-side, receive that second terminal sends into Journey connection request, so that first terminal is without standby always, and then without constantly going confirmation second terminal by way of poll Data transmission prepare it is whether ready, so as to the joint efficiency between raising process.
Step 304, second port is set listening state by first terminal.
In embodiments of the present invention, since first terminal can be used as the passive server-side for receiving data, first eventually End can set listening state for second port, be sent to monitor second terminal by second port by first port Process connection request.
Step 305, store path of the first terminal according to preset program bag in second terminal, by with target permission Process creation order, start preset program bag in second terminal, have the of target permission to create in second terminal Two application processes, the Permission Levels of target permission are greater than or equal to the Permission Levels that system strategy executes permission.
In embodiments of the present invention, by taking target permission is shell permission as an example, first terminal can be in adb shell mould The process creation order with shell permission is executed in formula, to create second application with shell permission in second terminal Process.In a particular application, which can order for app_process (application process processing).Specifically, One terminal can execute following order lines in adb shell mode:
Export CLASSPATH=/data/local/tmp/server.jar
app_process/data/local/tmp com.example.Server
Wherein ,/data/local/tmp is storage catalogue of the preset program bag in second terminal, and server.jar is pre- The packet name of program bag is set, com.example.Server is the instance objects of a class that can apply data transmission method function. So far, preset program bag start completion in second terminal, the dex file in preset program bag can be run, so as to reality The creation of existing second application process.
Since the second application process is created that in adb shell mode, the second application process has shell Permission, correspondingly, the second application process will not be strong lower than the process of shell permission by the corresponding Permission Levels of certain system strategies System is closed, such as " key acceleration ", " process cleaning " etc. improve strategy and power saving strategy of the speed of service etc., so as to To avoid the disconnecting between process.
Further, due to that preset program bag directly can be pushed to second terminal by adb push order, and can To directly initiate the preset program bag by app_process order, answered so as to create second directly in second terminal With process, therefore before the second application process and the first application process are attached, do not need to install in second terminal APK, and then a series of confirmation operation is carried out to the installation of APK without user, it goes out in this way, can be in avoid second terminal When screen state, user does not know that the bullet frame for having installation APK in second terminal needs to confirm, and then can grasp to avoid because APK is installed Connection failure caused by user confirms is obtained not in time.
Step 306, second terminal is led to when the second application process with target permission creates completion in second terminal It crosses the corresponding first port of the second application process and sends process connection request to first terminal.
In embodiments of the present invention, client of the second terminal as active transmission information, in target permission It, can be by the corresponding first port of the second application process, actively to the when two application processes create completion in second terminal One terminal sends process connection request, to inform that it is ready that the data transmission of second terminal prepares to first terminal, can start Transmit data.
Step 307, first terminal receives second eventually by second port in the case where second port is in listening state End passes through the process connection request that the corresponding first port of the second application process is sent when the second application process creates completion.
In embodiments of the present invention, since port mapping has been carried out in first terminal, first terminal can be from Two-port netwerk listens to the process connection request that second terminal is sent by first port, at this point, first terminal can know second The data transmission of terminal prepares ready.
Step 308, first terminal is according to the Internet protocol address of second terminal and the port numbers of first port, generates the The socket of two terminals, with the connection established between the first application process and the second application process.
In embodiments of the present invention, first terminal, can be with after the process connection request for receiving second terminal transmission By the socket (socket) of the port numbers of the Internet protocol address of second terminal and first port composition second terminal, and protect The socket is deposited, so far, the connection between the first application process and the second application process, which is established, to be completed, thus the first application process Data interaction can be carried out with the second application process.
When the connection between the first application process and the second application process, which is established, to be completed, first terminal and second terminal Role's it will happen again conversion, at this point, first terminal, which can be used as client, sends data or request data to second terminal, Second terminal then can be used as server-side and receive the data that first terminal is sent, or in response to the request of data of first terminal, Data are sent to first terminal.
Step 309, first terminal passes through second port and second terminal transmission objectives data.
In embodiments of the present invention, any data that target data can be generated or be stored for first terminal, correspondingly, the One terminal can by second port to second terminal send target data, and then second terminal can by first port connect Receive the target data.Certainly, target data may be any data that second terminal is generated or stored, correspondingly, first Terminal can send the acquisition request of target data to second terminal, and then second terminal is after receiving the acquisition request, Target data can be sent to the second port of first terminal by first port.
Step 310, second terminal passes through first port and first terminal transmission objectives data.
In embodiments of the present invention, when target data is any data that second terminal is generated or stored, first terminal The acquisition request of target data can be sent to second terminal, and then second terminal is after receiving the acquisition request, it can be with Target data is sent to the second port of first terminal by first port.When target data is that first terminal is generated or stored Any data when, first terminal can send target data to second terminal by second port, and then second terminal can be with By first port receive the target data.It that is to say that the first application process can be realized by second port to answer with second With between process data transmission, correspondingly, the second application process can by first port realize with the first application process it Between data transmission.
In embodiments of the present invention, first terminal can pass through the first application process in the case where connecting second terminal Preset program bag is sent to second terminal, includes the method function for realizing data transmission in preset program bag, then the It is corresponding that one terminal can will be mapped to the first application process for the preset first port of the second application process in second terminal Second port, and monitor second port, so first terminal can according to store path of the preset program bag in second terminal, By the process creation order with target permission, start preset program bag in second terminal, to create in second terminal The second application process with target permission, wherein the Permission Levels of target permission are greater than or equal to system strategy and execute permission Permission Levels, later second terminal the second application process create complete when, the second application process corresponding the can be passed through Process connection request is sent first terminal by Single port, and first terminal can be according to the Internet protocol of second terminal after receiving The port numbers of address and first port generate the socket of second terminal, to establish the first application process and the second application process Between connection, and then first terminal can pass through the corresponding second port of the first application process and second terminal transmission objectives number According to.In embodiments of the present invention, can be by the process creation order with target permission, creation has mesh in second terminal The second application process of permission is marked, the Permission Levels of target permission are greater than or equal to the Permission Levels that system strategy executes permission, That is to say that the second application process has the execution permission not less than the system strategies process such as power saving, speed-raising, therefore, second apply into Journey in the process of running, will not system strategy process identical by Permission Levels or more low rights forcibly close, so as to keep away The connection exempted between the first application process and the second application process is interrupted, and then can be improved the efficiency of data transmission.Separately Outside, first terminal can by the way of reverse proxy mapped port, so that first terminal is without standby always, and then without logical Whether the mode of overpolling constantly goes the data transmission of confirmation second terminal to prepare ready, so as to the company between raising process Connect efficiency.
Example IV
Referring to Fig. 4, a kind of structural block diagram of first terminal 400 of the embodiment of the present invention four is shown, can specifically include:
First sending module 401, in the case where connecting second terminal, by the first application process by preset program Packet is sent to the second terminal, includes the method function for realizing data transmission in the preset program bag;
Creation module 402, for the store path according to the preset program bag in the second terminal, by having The process creation order of target permission starts the preset program bag, in the second terminal in the second terminal Second application process with the target permission is created, the Permission Levels of the target permission are held greater than or equal to system strategy The Permission Levels of row permission;
First receiving module 403 passes through for receiving the second terminal when second application process creates completion The process connection request that the corresponding first port of second application process is sent;
Generation module 404, for according to the Internet protocol address of the second terminal and the port of the first port Number, the socket of the second terminal is generated, with the company established between first application process and second application process It connects;
First transmission module 405, for passing through the corresponding second port of first application process and the second terminal Transmission objectives data.
Optionally, referring to Fig. 4, the first terminal 400 further include:
Mapping block 406 is mapped to for will be directed to the preset first port of the second application process in the second terminal The corresponding second port of first application process;
Setup module 407, for setting listening state for the second port;
Correspondingly, first receiving module 403 includes:
Receiving submodule 4031, for passing through the second end in the case where the second port is in listening state Mouth receives the second terminal when second application process creates completion, passes through second application process corresponding first The process connection request that port is sent.
First terminal provided in an embodiment of the present invention can be realized first terminal in the embodiment of the method for Fig. 1 and Fig. 3 and realize Each process, to avoid repeating, which is not described herein again.
In embodiments of the present invention, first terminal can by the first sending module, in the case where connecting second terminal, Preset program bag is sent to second terminal by the first application process, includes being transmitted for realizing data in preset program bag Method function, then first terminal can be led to by creation module according to store path of the preset program bag in second terminal The process creation order with target permission is crossed, starts preset program bag in second terminal, to create tool in second terminal There is the second application process of target permission, wherein the Permission Levels of target permission are greater than or equal to system strategy and execute permission Permission Levels, later can by the first receiving module, receive second terminal the second application process create complete when, by the The process connection request that the corresponding first port of two application processes is sent, and can be by generation module according to the mutual of second terminal The port numbers of networking protocol address and first port generate the socket of second terminal, to establish the first application process and second Connection between application process, and then first terminal can pass through the first application process corresponding by the first generation module Two-port netwerk and second terminal transmission objectives data.In embodiments of the present invention, the process creation with target permission can be passed through Order, creation has the second application process of target permission in second terminal, and the Permission Levels of target permission are greater than or equal to System strategy executes the Permission Levels of permission, that is to say the second application process have not less than the system strategies such as power saving, speed-raising into The execution permission of journey, therefore, the second application process in the process of running, will not systems identical by Permission Levels or more low rights Tactful process forcibly closes, so as to avoid the connection between the first application process and the second application process from interrupting, into And it can be improved the efficiency of data transmission.
Embodiment five
Referring to Fig. 5, a kind of structural block diagram of second terminal 500 of the embodiment of the present invention five is shown, can specifically include:
Second receiving module 501 is answered in the case where connecting first terminal, receiving the first terminal by first The preset program bag sent with process includes the method function for realizing data transmission in the preset program bag;
Second sending module 502, for being created in the second terminal in the second application process with target permission When completion, process connection request is sent to the first terminal by the corresponding first port of second application process, it is described The preset program bag is sent to the second terminal for the first terminal by the second application process, and according to the preset journey The store path of sequence packet in the second terminal, by the process creation order with the target permission, described second Start the preset program bag in terminal to create, the Permission Levels of the target permission are executed greater than or equal to system strategy The Permission Levels of permission;
Second transmission module 503, for passing through the first port and the first terminal transmission objectives data, the mesh Mark data receive the process connection request for the first terminal, and according to the Internet protocol address of the second terminal With the port numbers of the first port, generate the socket of the second terminal, with establish first application process with it is described After connection between second application process, passed by the corresponding second port of first application process and the second terminal Defeated data.
Optionally, the second terminal and the first terminal debug the corresponding universal serial bus mode of bridge by Android Or local net mode connection.
Second terminal provided in an embodiment of the present invention can be realized second terminal in the embodiment of the method for Fig. 2 and Fig. 3 and realize Each process, to avoid repeating, which is not described herein again.
In embodiments of the present invention, second terminal is in the case where connecting first terminal, can by the second receiving module, It receives first terminal and passes through the preset program bag that the first application process is sent, include for realizing data transmission in preset program bag Method function, may then pass through the second sending module, in the second application process with target permission in second terminal When creation is completed, process connection request is sent to first terminal by the corresponding first port of the second application process, this second is answered It is that preset program bag is sent to second terminal, and the storage according to preset program bag in second terminal by first terminal with process Path is started preset program bag in second terminal and is created by the process creation order with target permission, wherein The Permission Levels of target permission are greater than or equal to the Permission Levels that system strategy executes permission, and then second terminal can be by the Two transmission modules, by first port and first terminal transmission objectives data, which is that first terminal receives process Connection request, and according to the port numbers of the Internet protocol address of second terminal and first port, generate the socket of second terminal Word, to pass through the first application process corresponding second after the connection established between the first application process and the second application process The data of port and second terminal transmission.In embodiments of the present invention, can by the process creation order with target permission, Creation has the second application process of target permission in second terminal, and the Permission Levels of target permission are greater than or equal to system plan The Permission Levels for slightly executing permission that is to say that the second application process has holding not less than system strategies processes such as power saving, speed-raisings Row permission, therefore, the second application process in the process of running, will not system strategy identical by Permission Levels or more low rights into Journey forcibly closes, so as to avoid the connection between the first application process and the second application process from interrupting, and then can The efficiency of improve data transfer.
Embodiment six
A kind of hardware structural diagram of Fig. 6 terminal of each embodiment to realize the present invention,
The terminal 600 includes but is not limited to: radio frequency unit 601, network module 602, audio output unit 603, input are single Member 604, sensor 605, display unit 606, user input unit 607, interface unit 608, memory 609, processor 610, And the equal components of power supply 611.It will be understood by those skilled in the art that terminal structure shown in Fig. 6 not structure paired terminal It limits, terminal may include perhaps combining certain components or different component layouts than illustrating more or fewer components. In embodiments of the present invention, terminal include but is not limited to mobile phone, tablet computer, laptop, palm PC, car-mounted terminal, Wearable device and pedometer etc..
Wherein, processor 610, in the case where connecting second terminal, by the first application process by preset program Packet is sent to the second terminal, includes the method function for realizing data transmission in the preset program bag;According to described The store path of preset program bag in the second terminal, by the process creation order with target permission, described Start the preset program bag in two terminals, with create in the second terminal with the target permission second application into Journey, the Permission Levels of the target permission are greater than or equal to the Permission Levels that system strategy executes permission;Radio frequency unit 601 is used In receiving the second terminal when second application process creates completion, pass through second application process corresponding first The process connection request that port is sent;Processor 610 is also used to according to the Internet protocol address of the second terminal and described The port numbers of first port generate the socket of second terminal, with establish first application process and it is described second application into Connection between journey;Pass through the corresponding second port of first application process and the second terminal transmission objectives data.
In embodiments of the present invention, first terminal can pass through the first application process in the case where connecting second terminal Preset program bag is sent to second terminal, includes the method function for realizing data transmission in preset program bag, then the One terminal can be ordered according to store path of the preset program bag in second terminal by the process creation with target permission It enables, starts preset program bag in second terminal, to create second application process with target permission in second terminal, In, the Permission Levels of target permission are greater than or equal to the Permission Levels that system strategy executes permission, can receive second later eventually End is when the second application process creates completion, the process connection request sent by the corresponding first port of the second application process, And the socket of second terminal can be generated according to the Internet protocol address of second terminal and the port numbers of first port, with The connection between the first application process and the second application process is established, and then first terminal can be corresponding by the first application process Second port and second terminal transmission objectives data.In embodiments of the present invention, the process with target permission can be passed through Creation order, in second terminal creation have target permission the second application process, the Permission Levels of target permission be higher than or Equal to the Permission Levels that system strategy executes permission, it that is to say that the second application process has not less than systems plans such as power saving, speed-raisings The slightly execution permission of process, therefore, the second application process in the process of running, will not be identical by Permission Levels or more low rights System strategy process forcibly closes, so as to avoid in the connection generation between the first application process and the second application process It is disconnected, and then can be improved the efficiency of data transmission.
It should be understood that the embodiment of the present invention in, radio frequency unit 601 can be used for receiving and sending messages or communication process in, signal Send and receive, specifically, by from base station downlink data receive after, to processor 610 handle;In addition, by uplink Data are sent to base station.In general, radio frequency unit 601 includes but is not limited to antenna, at least one amplifier, transceiver, coupling Device, low-noise amplifier, duplexer etc..In addition, radio frequency unit 601 can also by wireless communication system and network and other set Standby communication.
Terminal provides wireless broadband internet by network module 602 for user and accesses, and such as user is helped to receive and dispatch electricity Sub- mail, browsing webpage and access streaming video etc..
Audio output unit 603 can be received by radio frequency unit 601 or network module 602 or in memory 609 The audio data of storage is converted into audio signal and exports to be sound.Moreover, audio output unit 603 can also provide and end The relevant audio output of specific function (for example, call signal receives sound, message sink sound etc.) that end 600 executes.Sound Frequency output unit 603 includes loudspeaker, buzzer and receiver etc..
Input unit 604 is for receiving audio or video signal.Input unit 604 may include graphics processor (Graphics Processing Unit, GPU) 6041 and microphone 6042, graphics processor 6041 is in video acquisition mode Or the image data of the static images or video obtained in image capture mode by image capture apparatus (such as camera) carries out Reason.Treated, and picture frame may be displayed on display unit 606.Through graphics processor 6041, treated that picture frame can be deposited Storage is sent in memory 609 (or other storage mediums) or via radio frequency unit 601 or network module 602.Mike Wind 6042 can receive sound, and can be audio data by such acoustic processing.Treated audio data can be The format output that mobile communication base station can be sent to via radio frequency unit 601 is converted in the case where telephone calling model.
Terminal 600 further includes at least one sensor 605, such as optical sensor, motion sensor and other sensors. Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to ambient light Light and shade adjusts the brightness of display panel 6061, and proximity sensor can close display panel when terminal 600 is moved in one's ear 6061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (generally three axis) and add The size of speed can detect that size and the direction of gravity when static, can be used to identify terminal posture (such as horizontal/vertical screen switching, Dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;Sensor 605 can be with Including fingerprint sensor, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, hygrometer, thermometer, Infrared sensor etc., details are not described herein.
Display unit 606 is for showing information input by user or being supplied to the information of user.Display unit 606 can wrap Display panel 6061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 6061.
User input unit 607 can be used for receiving the number or character information of input, and generates and set with the user of terminal It sets and the related key signals of function control inputs.Specifically, user input unit 607 include touch panel 6071 and other Input equipment 6072.Touch panel 6071, also referred to as touch screen, collect user on it or nearby touch operation (such as User is using any suitable objects or attachment such as finger, stylus on touch panel 6071 or near touch panel 6071 Operation).Touch panel 6071 may include both touch detecting apparatus and touch controller.Wherein, touch detecting apparatus is examined The touch orientation of user is surveyed, and detects touch operation bring signal, transmits a signal to touch controller;Touch controller from Touch information is received on touch detecting apparatus, and is converted into contact coordinate, then gives processor 610, receives processor 610 The order sent simultaneously is executed.Furthermore, it is possible to using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves Realize touch panel 6071.In addition to touch panel 6071, user input unit 607 can also include other input equipments 6072. Specifically, other input equipments 6072 can include but is not limited to physical keyboard, function key (such as volume control button, switch Key etc.), trace ball, mouse, operating stick, details are not described herein.
Further, touch panel 6071 can be covered on display panel 6061, when touch panel 6071 is detected at it On or near touch operation after, send processor 610 to determine the type of touch event, be followed by subsequent processing device 610 according to touching The type for touching event provides corresponding visual output on display panel 6061.Although in Fig. 6, touch panel 6071 and display Panel 6061 is the function that outputs and inputs of realizing terminal as two independent components, but in certain embodiments, it can The function that outputs and inputs of terminal is realized so that touch panel 6071 and display panel 6061 is integrated, is not limited herein specifically It is fixed.
Interface unit 608 is the interface that external device (ED) is connect with terminal 600.For example, external device (ED) may include it is wired or Wireless head-band earphone port, external power supply (or battery charger) port, wired or wireless data port, memory card port, For connecting port, the port audio input/output (I/O), video i/o port, ear port of the device with identification module Etc..Interface unit 608 can be used for receiving the input (for example, data information, electric power etc.) from external device (ED) and will One or more elements that the input received is transferred in terminal 600 or can be used for terminal 600 and external device (ED) it Between transmit data.
Memory 609 can be used for storing software program and various data.Memory 609 can mainly include storing program area The storage data area and, wherein storing program area can (such as the sound of application program needed for storage program area, at least one function Sound playing function, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as Audio data, phone directory etc.) etc..In addition, memory 609 may include high-speed random access memory, it can also include non-easy The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 610 is the control centre of terminal, using the various pieces of various interfaces and the entire terminal of connection, is led to It crosses operation or executes the software program and/or module being stored in memory 609, and call and be stored in memory 609 Data execute the various functions and processing data of terminal, to carry out integral monitoring to terminal.Processor 610 may include one Or multiple processing units;Preferably, processor 610 can integrate application processor and modem processor, wherein application processing The main processing operation system of device, user interface and application program etc., modem processor mainly handles wireless communication.It can manage Solution, above-mentioned modem processor can not also be integrated into processor 610.
Terminal 600 can also include the power supply 611 (such as battery) powered to all parts, it is preferred that power supply 611 can be with It is logically contiguous by power-supply management system and processor 610, thus by power-supply management system realize management charging, electric discharge, with And the functions such as power managed.
In addition, terminal 600 includes some unshowned functional modules, details are not described herein.
Preferably, the embodiment of the present invention also provides a kind of terminal, including processor 610, and memory 609 is stored in storage On device 609 and the computer program that can be run on processor 610, realized when which is executed by processor 610 Each process of data transmission method embodiment is stated, and identical technical effect can be reached, it is no longer superfluous here to avoid repeating It states.
The embodiment of the present invention also provides a kind of computer readable storage medium, and meter is stored on computer readable storage medium Calculation machine program, the computer program realize each process of above-mentioned data transmission method embodiment, and energy when being executed by processor Reach identical technical effect, to avoid repeating, which is not described herein again.Wherein, computer readable storage medium is deposited Ru read-only Reservoir (Read-Only Memory, abbreviation ROM), random access memory (Random Access Memory, abbreviation RAM), Magnetic or disk etc..
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or device.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal (can be mobile phone, computer, service Device, air conditioner or network equipment etc.) method that executes each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much Form belongs within protection of the invention.

Claims (10)

1. a kind of data transmission method is applied to first terminal, which is characterized in that the described method includes:
In the case where connecting second terminal, preset program bag is sent to by the second terminal, institute by the first application process Stating includes the method function transmitted for realizing data in preset program bag;
According to the store path of the preset program bag in the second terminal, ordered by the process creation with target permission It enables, starts the preset program bag, in the second terminal created in the second terminal with the target permission The second application process, the Permission Levels of the target permission are greater than or equal to the Permission Levels that system strategy executes permission;
Receive the second terminal second application process create complete when, pass through second application process corresponding the The process connection request that Single port is sent;
According to the port numbers of the Internet protocol address of the second terminal and the first port, the second terminal is generated Socket, with the connection established between first application process and second application process;
Pass through the corresponding second port of first application process and the second terminal transmission objectives data.
2. the method according to claim 1, which is characterized in that it is described according to the preset program bag in the second terminal In store path the preset program is started by the process creation order with target permission in the second terminal Packet, the step of to create second application process with the target permission in the second terminal before, further includes:
It will be corresponding first application process will to be mapped to for the preset first port of the second application process in the second terminal Second port;
Listening state is set by the second port;
Correspondingly, receiving the second terminal when second application process creates completion, pass through second application process The step of process connection request that corresponding first port is sent, comprising:
In the case where the second port is in listening state, the second terminal is received described by the second port When the creation of second application process is completed, pass through the process connection request of the corresponding first port transmission of second application process.
3. a kind of data transmission method is applied to second terminal, which is characterized in that the described method includes:
In the case where connecting first terminal, receives the first terminal and passes through the preset program bag that the first application process is sent, It include the method function for realizing data transmission in the preset program bag;
The second application process with target permission in the second terminal create completion when, by it is described second application into The corresponding first port of journey sends process connection request to the first terminal, and second application process is the first terminal The preset program bag is sent to the second terminal, and the storage according to the preset program bag in the second terminal Path starts the preset program bag wound by the process creation order with the target permission in the second terminal It builds, the Permission Levels of the target permission are greater than or equal to the Permission Levels that system strategy executes permission;
By the first port and the first terminal transmission objectives data, the target data is first terminal reception To the process connection request, and according to the port numbers of the Internet protocol address of the second terminal and the first port, Generate the socket of the second terminal, with the connection established between first application process and second application process it Afterwards, pass through the data of the corresponding second port of first application process and second terminal transmission.
4. the method according to claim 1, which is characterized in that the second terminal and the first terminal pass through Android tune Try the corresponding universal serial bus mode of bridge or the connection of local net mode.
5. a kind of first terminal, which is characterized in that the first terminal includes:
First sending module, for being sent preset program bag by the first application process in the case where connecting second terminal It include the method function for realizing data transmission to the second terminal, in the preset program bag;
Creation module, for the store path according to the preset program bag in the second terminal, by being weighed with target The process creation order of limit starts the preset program bag in the second terminal, to create tool in the second terminal There is the second application process of the target permission, the Permission Levels of the target permission are greater than or equal to system strategy and execute permission Permission Levels;
First receiving module, for receive the second terminal second application process create complete when, pass through described the The process connection request that the corresponding first port of two application processes is sent;
Generation module, for generating according to the Internet protocol address of the second terminal and the port numbers of the first port The socket of the second terminal, with the connection established between first application process and second application process;
First transmission module, for passing through the corresponding second port of first application process and the second terminal transmission objectives Data.
6. first terminal according to claim 5, which is characterized in that the first terminal further include:
Mapping block is mapped to described first for will be directed to the preset first port of the second application process in the second terminal The corresponding second port of application process;
Setup module, for setting listening state for the second port;
Correspondingly, first receiving module includes:
Receiving submodule, for receiving institute by the second port in the case where the second port is in listening state Second terminal is stated when second application process creates completion, passes through the corresponding first port of second application process and sends Process connection request.
7. a kind of second terminal, which is characterized in that the second terminal includes:
Second receiving module passes through the first application process in the case where connecting first terminal, receiving the first terminal The preset program bag sent includes the method function for realizing data transmission in the preset program bag;
Second sending module, for the second application process with target permission in the second terminal create completion when, Process connection request, second application are sent to the first terminal by the corresponding first port of second application process The preset program bag is sent to the second terminal for the first terminal by process, and according to the preset program bag in institute The store path in second terminal is stated, by the process creation order with the target permission, is opened in the second terminal It moves the preset program bag to create, the Permission Levels of the target permission are greater than or equal to the power that system strategy executes permission Limit grade;
Second transmission module, for passing through the first port and the first terminal transmission objectives data, the target data The process connection request is received for the first terminal, and according to the Internet protocol address of the second terminal and described The port numbers of first port generate the socket of the second terminal, are answered with establishing first application process with described second After the connection between process, pass through the number of the corresponding second port of first application process and second terminal transmission According to.
8. the second terminal according to claim 7, which is characterized in that the second terminal and the first terminal pass through peace The corresponding universal serial bus mode of Zhuo debugging bridge or the connection of local net mode.
9. a kind of terminal, which is characterized in that including processor, memory and be stored on the memory and can be in the processing The computer program run on device is realized when the computer program is executed by the processor as any in Claims 1-4 The step of data transmission method described in item.
10. a kind of computer readable storage medium, which is characterized in that store computer journey on the computer readable storage medium Sequence, the computer program realize data transmission method according to any one of claims 1 to 4 when being executed by processor Step.
CN201910152605.5A 2019-02-28 2019-02-28 Data transmission method, first terminal and second terminal Active CN109992430B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910152605.5A CN109992430B (en) 2019-02-28 2019-02-28 Data transmission method, first terminal and second terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910152605.5A CN109992430B (en) 2019-02-28 2019-02-28 Data transmission method, first terminal and second terminal

Publications (2)

Publication Number Publication Date
CN109992430A true CN109992430A (en) 2019-07-09
CN109992430B CN109992430B (en) 2021-07-20

Family

ID=67129958

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910152605.5A Active CN109992430B (en) 2019-02-28 2019-02-28 Data transmission method, first terminal and second terminal

Country Status (1)

Country Link
CN (1) CN109992430B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114968456A (en) * 2022-05-07 2022-08-30 麒麟合盛网络技术股份有限公司 Method and device for controlling terminal
CN116010127A (en) * 2023-02-24 2023-04-25 荣耀终端有限公司 Message processing method, device and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060032265A (en) * 2004-10-11 2006-04-17 오재연 Microsoft's outlook based data sync. and transfer software for mobile phone
CN102385519A (en) * 2011-09-04 2012-03-21 上海量明科技发展有限公司 Method and system for installing software
CN103279706A (en) * 2013-06-07 2013-09-04 北京奇虎科技有限公司 Method and device for intercepting installation of Android application program in mobile terminal
US20130254024A1 (en) * 2012-03-21 2013-09-26 Bunndle, Inc. Systems and Methods for Cross-Platform Software Bundling
CN103858130A (en) * 2013-08-23 2014-06-11 华为终端有限公司 Method, apparatus and terminal for administration of permission
CN105786606A (en) * 2016-03-03 2016-07-20 深圳市创想天空科技股份有限公司 Data transferring method and system for intelligent terminals
CN106155727A (en) * 2015-04-17 2016-11-23 腾讯科技(深圳)有限公司 The update method of a kind of application program, device and terminal
CN106570358A (en) * 2016-11-18 2017-04-19 广东欧珀移动通信有限公司 Method and device for setting application permissions
CN107038068A (en) * 2017-02-28 2017-08-11 努比亚技术有限公司 Processing method is killed in terminal and its application
CN108280342A (en) * 2017-01-03 2018-07-13 北京搜狗科技发展有限公司 Using synchronous method with device, for applying synchronous device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060032265A (en) * 2004-10-11 2006-04-17 오재연 Microsoft's outlook based data sync. and transfer software for mobile phone
CN102385519A (en) * 2011-09-04 2012-03-21 上海量明科技发展有限公司 Method and system for installing software
US20130254024A1 (en) * 2012-03-21 2013-09-26 Bunndle, Inc. Systems and Methods for Cross-Platform Software Bundling
CN103279706A (en) * 2013-06-07 2013-09-04 北京奇虎科技有限公司 Method and device for intercepting installation of Android application program in mobile terminal
CN103858130A (en) * 2013-08-23 2014-06-11 华为终端有限公司 Method, apparatus and terminal for administration of permission
CN106155727A (en) * 2015-04-17 2016-11-23 腾讯科技(深圳)有限公司 The update method of a kind of application program, device and terminal
CN105786606A (en) * 2016-03-03 2016-07-20 深圳市创想天空科技股份有限公司 Data transferring method and system for intelligent terminals
CN106570358A (en) * 2016-11-18 2017-04-19 广东欧珀移动通信有限公司 Method and device for setting application permissions
CN108280342A (en) * 2017-01-03 2018-07-13 北京搜狗科技发展有限公司 Using synchronous method with device, for applying synchronous device
CN107038068A (en) * 2017-02-28 2017-08-11 努比亚技术有限公司 Processing method is killed in terminal and its application

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
JINXIN ZHANG: "A detection system of Android application based on permission analysis", 《2014 COMMUNICATIONS SECURITY CONFERENCE (CSC 2014)》 *
任午令 等编著: "《计算机网络技术与应用》", 31 August 2006, 浙江大学出版社 *
周之鼎: "基于安卓平台移动终端隐私信息防护系统的研究与实现", 《中国优秀硕士学位论文全文数据库信息科技辑》 *
王荣桂: ""分享那些"演示"功能"", 《电脑知识与技术(经验技巧)》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114968456A (en) * 2022-05-07 2022-08-30 麒麟合盛网络技术股份有限公司 Method and device for controlling terminal
CN114968456B (en) * 2022-05-07 2024-03-08 麒麟合盛网络技术股份有限公司 Method and device for controlling terminal
CN116010127A (en) * 2023-02-24 2023-04-25 荣耀终端有限公司 Message processing method, device and storage medium
CN116010127B (en) * 2023-02-24 2023-08-29 荣耀终端有限公司 Message processing method, device and storage medium

Also Published As

Publication number Publication date
CN109992430B (en) 2021-07-20

Similar Documents

Publication Publication Date Title
CN107770760B (en) A kind of method and mobile terminal of the type identifying bluetooth equipment
CN109587789A (en) Accidental access method, mobile terminal and the network equipment
CN109815110A (en) A kind of network port management method, device, terminal device and storage medium
CN107911445A (en) A kind of information push method, mobile terminal and storage medium
CN108494030A (en) A kind of wireless charging method, terminal and transmitting end equipment
CN110058836A (en) A kind of output method and terminal device of audio signal
CN109888928A (en) A kind of terminal and wireless charging control method
CN108494639A (en) Network access method and mobile terminal
CN110267145A (en) A kind of state display method and terminal device
CN109831359A (en) A kind of detection method and its terminal device of data network connection state
CN107423598B (en) A kind of solution lock control method and mobile terminal
CN109061342A (en) A kind of fast charge plug test method and device
CN108769202A (en) A kind of information push method and its server and terminal device
CN109992430A (en) A kind of data transmission method, first terminal and second terminal
CN109831582A (en) Non- response events processing method and terminal
CN107979385B (en) A kind of radio-frequency front-end data processing method and mobile terminal
WO2021175148A1 (en) Target behavior identification method, and electronic device
CN110096203A (en) A kind of screenshot method and mobile terminal
CN110083588A (en) A kind of dissemination method, dispositions method and the relevant device of Redis management system
CN109745699A (en) A kind of method and terminal device responding touch control operation
CN109995943A (en) A kind of information processing method and terminal device
CN113238868A (en) Task processing method, device, server, equipment, system and storage medium
CN108540951A (en) A kind of recharge method and mobile terminal
CN110430573A (en) A kind of information authentication method, electronic equipment and network side equipment
CN109889568A (en) A kind of data export method, server, client and system

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