CN108536479A - Method and apparatus for restarting Android device - Google Patents
Method and apparatus for restarting Android device Download PDFInfo
- Publication number
- CN108536479A CN108536479A CN201810342874.3A CN201810342874A CN108536479A CN 108536479 A CN108536479 A CN 108536479A CN 201810342874 A CN201810342874 A CN 201810342874A CN 108536479 A CN108536479 A CN 108536479A
- Authority
- CN
- China
- Prior art keywords
- android device
- android
- computer
- instruction
- tcp port
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/40—Bus structure
- G06F13/4063—Device-to-bus coupling
- G06F13/4068—Electrical coupling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4411—Configuring for operating with peripheral devices; Loading of device drivers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72403—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
- H04M1/72409—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
- H04M1/72412—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories using two-way short-range wireless interfaces
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0042—Universal serial bus [USB]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M2250/00—Details of telephonic subscriber devices
- H04M2250/06—Details of telephonic subscriber devices including a wireless LAN interface
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Signal Processing (AREA)
- Human Computer Interaction (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the present application discloses the method and apparatus for restarting Android device.One specific implementation mode of this method includes:Detect the USB interface of object-computer;Android device is accessed on USB interface in response to detecting, the instruction of the destination TCP port by ADB to Android device transmission for monitoring Android device;In response to detecting that object-computer is disconnected with the Android device accessed, the wireless connection with Android device is established by destination TCP port, by being wirelessly connected, instruction of restarting is sent to Android device.The embodiment, which realizes, restarts Android device.
Description
Technical field
The invention relates to field of computer technology, and in particular to the method and apparatus for restarting Android device.
Background technology
Currently, Android device usually passes through USB (Universal Serial Bus, universal serial bus) data lines and meter
Calculation machine connects.During the connection process, the case where Android device is disconnected with computer frequent occurrence.In this case, past
Toward need manpower intervention (such as manually plug USB data line or restart Android device manually) so that Android device again with calculating
Machine connects.
Invention content
The embodiment of the present application proposes the method and apparatus for restarting Android device.
In a first aspect, the embodiment of the present application provides a kind of method for restarting Android device, this method includes:Detection
The USB interface of object-computer;Android device has been accessed on USB interface in response to detecting, passes through ADB (Android Debug
Bridge, Android debug bridge) send the target TCP (Transmission for monitoring Android device to Android device
Control Protocol, transmission control protocol) port instruction;In response to the Android for detecting object-computer Yu having accessed
Equipment disconnects, and the wireless connection with Android device is established by destination TCP port, by being wirelessly connected, to Android device
Send instruction of restarting.
In some embodiments, the USB interface of object-computer is detected, including:The USB interface of object-computer is carried out
Poll detects;In response to detecting on USB interface there is equipment access, whether detection device is Android device.
In some embodiments, the destination TCP port for monitoring Android device is being sent to Android device by ADB
Before instruction, further include:Run ADB clients.
In some embodiments, the wireless connection with Android device is established by destination TCP port, including:Pass through target
TCP port and WLAN are established with Android device to be wirelessly connected.
In some embodiments, it is established and is wirelessly connected with Android device by destination TCP port and WLAN, packet
It includes:Obtain the internet protocol address of Android device;It is established and is connected with Android device based on IP address and destination TCP port.
Second aspect, the embodiment of the present application provide a kind of device for restarting Android device, which includes:Detection
Unit is configured to the USB interface of detection object-computer;Instruction sending unit is monitored, is configured in response to detecting USB
Android device is accessed on interface, the finger of the destination TCP port by ADB to Android device transmission for monitoring Android device
It enables;Instruction of restarting transmission unit is configured in response to detecting that object-computer is disconnected with the Android device accessed,
The wireless connection with Android device is established by destination TCP port, by being wirelessly connected, instruction of restarting is sent to Android device.
In some embodiments, detection unit is further configured to:Inspection is polled to the USB interface of object-computer
It surveys;In response to detecting on USB interface there is equipment access, whether detection device is Android device.
In some embodiments, which further includes:Running unit is configured to operation ADB clients.
In some embodiments, instruction of restarting transmission unit is further configured to:Pass through destination TCP port and wireless office
Domain net is established with Android device and is wirelessly connected.
In some embodiments, instruction of restarting transmission unit includes:Subelement is obtained, is configured to obtain Android device
Internet protocol address;Subelement is connected, is configured to establish company with Android device based on IP address and destination TCP port
It connects.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, which includes:One or more processing
Device;Storage device, for storing one or more programs;When said one or multiple programs are by said one or multiple processors
It executes so that said one or multiple processors realize the method as described in any realization method in first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer-readable medium, are stored thereon with computer program, on
State the method realized when program is executed by processor as described in any realization method in first aspect.
Method and apparatus provided by the embodiments of the present application for restarting Android device, by detecting object-computer
USB interface;Then, Android device has been accessed on USB interface in response to detecting, sent to Android device for supervising by ADB
Listen the instruction of the destination TCP port of Android device;It disconnects and connecting in response to the Android device for detecting object-computer and having accessed
It connects, the wireless connection with Android device is established by destination TCP port, finally, by being wirelessly connected, weight is sent to Android device
Open instruction.By restarting Android device, disconnecting caused by non-hardware reason can be solved.
Description of the drawings
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 is that this application can be applied to exemplary system architecture figures therein;
Fig. 2 is the flow chart according to one embodiment of the method for restarting Android device of the application;
Fig. 3 is the schematic diagram according to an application scenarios of the method for restarting Android device of the application;
Fig. 4 is the flow chart according to another embodiment of the method for restarting Android device of the application;
Fig. 5 is the structural schematic diagram according to one embodiment of the device for restarting Android device of the application;
Fig. 6 is adapted for the structural schematic diagram of the computer system for realizing the embodiment of the present application.
Specific implementation mode
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to
Convenient for description, is illustrated only in attached drawing and invent relevant part with related.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 shows the method for being used to restart Android device that can apply the embodiment of the present application or is set for restarting Android
The exemplary system architecture 100 of standby device.
As shown in Figure 1, system architecture 100 may include Android device 101, USB data line 102, network 103 and computer
104.Network 103 between Android device 101 and computer 104 provide communication link medium.Network 103 can be each
Type wireless communication link, such as wireless wide area network, WLAN.
Computer 104 can be communicated by USB data line 102 or network 103 with Android device 104.It can on computer 104
To install various applications, such as Android debugging acid ADB kits, USB driving etc..
Android device 101 can be equipped with the electronic equipment of Android operation system, such as Android mobile phone, Android tablet are electric
Brain, Android analog machine etc..
USB data line 102 can be used for connecting the USB interface and external equipment (such as Android device 101) of computer 104
Various types of connection cables.Computer 104 can be carried out data transmission by USB data line and external equipment.
It should be noted that the method for restarting Android device that the embodiment of the present application is provided is generally by computer
104 execute, correspondingly, the device for restarting Android device is generally also disposed in computer 104.
It should be understood that the number of the Android device, USB data line, network and computer in Fig. 1 is only schematical.
According to needs are realized, can have any number of Android device, USB data line, network and computer.According to actual needs,
Server can also be set.
With continued reference to Fig. 2, the stream of one embodiment of the method for restarting Android device according to the application is shown
Journey 200.This is used to restart the method for Android device, includes the following steps:
Step 201, the USB interface of object-computer is detected.
In the present embodiment, the executive agent (such as computer 104 shown in FIG. 1) of the method for restarting Android device
The state of the USB interface of object-computer is inquired.Wherein, object-computer can be above-mentioned executive agent itself, this
When, the state for the USB interface that above-mentioned executive agent can be local to it is inquired.In addition, object-computer can also be area
Not in any one computer of above-mentioned executive agent.At this point, above-mentioned executive agent is communicated to connect with the computer, above-mentioned execution
Main body can inquire the state of the USB interface of the computer.Wherein, USB is connection computer system and external equipment
A kind of serial bus standard.USB interface is widely used on the information communications product such as PC and mobile device.
In the present embodiment, above-mentioned executive agent can in several ways to the state of the USB interface of the computer into
Row inquiry.As an example, above-mentioned executive agent can receive object-computer transmission for having indicated whether that Android device connects
The information entered.
Step 202, Android device has been accessed on USB interface in response to detecting, be used for Android device transmission by ADB
Monitor the instruction of the destination TCP port of Android device.
In the present embodiment, above-mentioned executive agent can be sent to the Android device of access by ADB and be set for monitoring Android
The instruction of standby destination TCP port.After Android device receives instruction, destination TCP port is monitored.Wherein, ADB is a kind of
Android debugging acid.ADB includes the ADB clients run on computer and runs on the ADB server-sides in Android device.
TCP is a kind of connection-oriented, reliable transport layer communication protocol based on byte stream.TCP port can be for Transmission Control Protocol
Communication provides the port of service.Destination TCP port can be the TCP port specified by technical staff.Such as port 5555.
Step 203, in response to detecting that object-computer is disconnected with the Android device accessed, pass through target TCP
The wireless connection with Android device is established in port, and by being wirelessly connected, instruction of restarting is sent to Android device.
In the present embodiment, above-mentioned object-computer may be disconnected with the Android device of access due to various reasons.Its
In, the reason of disconnecting can be hardware reason (such as USB interface damage), can also be (such as the software punching of software reason
It is prominent).
Above-mentioned executive agent can be by detecting above-mentioned USB interface, it is determined whether disconnects and connecting with the Android device accessed
It connects.In response to detecting that object-computer is disconnected with the Android device accessed, pass through destination TCP port foundation and Android
The wireless connection of equipment.Wherein, wireless connection can be WLAN connection or wireless wide area network connection.
As an example, can be by server to realize that wireless wide area network connects.In practice, above-mentioned executive agent can be with
Server is connected by wan communication, and above-mentioned Android device can pass through LAN connection with server.Specific steps at this time
To may include:
The first step configures the first virtual server agent and the second virtual server agent in the server.First is virtual
Proxy server can generate a fixed network address, and the fixed network address is exposed to server and is connect with Android device
LAN in.
Second step, above-mentioned executive agent send the first application layer connection for being directed toward Android device by wide area network to server
Request.After server receives first application-level request, the second application layer corresponding with the first application layer connection request is built
It asks and second application-level request is sent to by Android device by LAN.Android device receives the second application-level request
Afterwards, it can be connect by ADB with server.
Third walks, and Android device builds the first virtual protocol client, by local TCP port, establish finger daemon with
First virtual protocol client pass through between TCP connection.Later, the second virtual protocol client is created and by the first Virtual Agent
Reason client is bound with the second virtual protocol client, and the two is bridged.Android device is taken by the second virtual protocol
It is engaged in end, calling external TCP port, using the first virtual protocol of the fixed network network address and server of server in a local network
Server establishes ADB connections.When being successfully established ADB with server and connecting, sends ADB to server and be successfully connected information.
In some optional realization methods of the present embodiment, established by destination TCP port wireless with Android device
Connection, including:It is established and is wirelessly connected with Android device by destination TCP port and WLAN.In these realization methods,
It is established and is wirelessly connected with Android device by destination TCP port and WLAN, network structure can be simplified.
In some optional realization methods of the present embodiment, set with Android by destination TCP port and WLAN
Standby establish is wirelessly connected, including:Obtain the internet protocol address of Android device;Based on IP address and destination TCP port with
Android device establishes connection.In these realization methods, by ICP/IP protocol, establishes and connect with Android device.
It is the application scenarios according to the method for restarting Android device of the embodiment of the present application with continued reference to Fig. 3, Fig. 3
One schematic diagram 300.In the application scenarios of Fig. 3, PC executes step 301 and detects local USB interface.Android mobile phone
Execute the USB interface of step 302 access PC.PC detects that Android mobile phone accesses, and executes and passes through ADB to Android
Mobile phone sends the instruction 303 of the TCP port 5555 for monitoring Android mobile phone.Android mobile phone executes step 304 and monitors TCP port
5555.Android mobile phone is executed step 305 disconnection and is connect with the USB of PC due to software conflict.PC executes step
306 by detect USB interface D+ and D- voltage, detect and disconnected with Android mobile phone.PC is sent out to Android device
Wireless connection instruction 307 is sent, is established and is wirelessly connected with Android mobile phone by the TCP port 5555 of Android mobile phone.PC is logical
It crosses wireless connection and sends instruction of restarting 308 to Android device.
The method that above-described embodiment of the application provides detects the USB interface of object-computer first;Later, in response to
It detects and has accessed Android device on USB interface, the target TCP by ADB to Android device transmission for monitoring Android device
The instruction of port;After Android device receives instruction, destination TCP port can be monitored;In response to detecting that target calculates
Machine is disconnected with the Android device accessed, the wireless connection with Android device is established by destination TCP port, by wireless
Connection sends instruction of restarting to Android device.By restarting Android device, in connection caused by non-hardware reason can be solved
It is disconnected.
With further reference to Fig. 4, it illustrates the flows 400 of another embodiment of the method for restarting Android device.
This is used to restart the flow 400 of the method for Android device, includes the following steps:
Step 401, detection is polled to the USB interface of object-computer.
In the present embodiment, above-mentioned executive agent is polled detection to one or more USB interfaces of object-computer.
In practice, USB interface is usually connect by a quadded cable with external equipment.Wherein, it is used for data transmission
Twisted-pair feeder is labeled as D+ and D-.When no equipment accesses, D+ and D- are in low level;Once equipment is accessed, D+ or D-
Voltage is raised, and determination has external equipment access.Specifically, above-mentioned executive agent can periodically detect USB interface D+'s and D-
Voltage.In response to detecting that D+ D- voltages are raised, determination has external equipment access.
Step 402, in response to detecting on USB interface there is equipment access, whether detection device is Android device.
In the present embodiment, above-mentioned executive agent has equipment access in response to detecting on USB interface, passes through USB enumeration
Process obtains the device descriptor of the external equipment of access.Finally, by the parsing of the device descriptor to external equipment, really
Whether locking equipment is Android device.
Step 403, Android device has been accessed on USB interface in response to detecting, be used for Android device transmission by ADB
Monitor the instruction of the destination TCP port of Android device.
In practice, the connection type given tacit consent to after ADB operations is to be connected by USB data line.Above-mentioned executive agent passes through ADB
Send above-mentioned monitoring instruction.After Android device receives monitoring instruction, destination TCP port is monitored to receive message.Target
TCP port can be used for any TCP port of remote debugging.As an example, destination TCP port can be port
5555。
Step 404, in response to detecting that object-computer is disconnected with the Android device accessed, pass through target TCP
The wireless connection with Android device is established in port, and by being wirelessly connected, instruction of restarting is sent to Android device.
In the present embodiment, object-computer may be disconnected with the Android device accessed due to various reasons.Example
Such as, electrical unstable, software conflict, interface contact are bad etc..Above-mentioned executive agent in response to detect object-computer with
The Android device of access disconnects, and the wireless connection with Android device is established by destination TCP port.It is above-mentioned to hold in practice
By sending the instruction for including destination TCP port to Android device, the foundation with Android device is wirelessly connected row main body.Later,
By being wirelessly connected, instruction of restarting is sent to Android device.After Android device receives instruction of restarting, instruction of restarting is executed.
In the method that above-described embodiment of the application provides, by being polled detection to local USB interface to main
It is dynamic to find external equipment access.Later, whether it is Android device by enumeration process detection device.Later, by ADB to Android
Equipment sends the instruction of the destination TCP port for monitoring Android device;In this way, if detecting that object-computer is set with Android
It is standby to disconnect, it can be established and be wirelessly connected by above-mentioned destination TCP port and Android device.Thus by being wirelessly connected, to Android
Equipment sends instruction of restarting.In the process, it realizes for the active detecting of external equipment and identification and by restarting peace
Tall and erect equipment can solve disconnecting caused by non-hardware reason.
In some optional embodiments of embodiment or embodiment as shown in Figure 4 as shown in Figure 2, for weight
In the method for opening Android device, in the instruction for sending the destination TCP port for monitoring Android device to Android device by ADB
Before, it can further include:Run ADB clients.
In these realization methods, ADB is a multiduty command-line tool, can pass through it and Android device progress
Communication.ADB clients can be run in several ways.As an example, above-mentioned execution can be made by shell-command by user
Main body runs ADB clients.Wherein, shell can be the system interface that above-mentioned executive agent provides, user can by it with
Above-mentioned executive agent interacts.As an example, can also control above-mentioned executive agent by DDMS by user runs ADB client
End.Wherein, DDMS (Dalvik Debug Monitor Service, virtual machine debug monitoring service) is in Android development environment
Tool.
After the operation of ADB clients, the operation of ADB server-side processes can be checked whether there is.If not provided, a service can be started
End process.After the operation of server-side process, it can be bound with local TCP port 5037.Above-mentioned executive agent and peace are realized with this
The ADB of tall and erect equipment is communicated to connect.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, this application provides one kind for restarting peace
One embodiment of the device of tall and erect equipment, the device embodiment is corresponding with embodiment of the method shown in Fig. 2, which specifically may be used
To be applied in various electronic equipments.
As shown in figure 5, the device 500 shown in the present embodiment for restarting Android device includes:Detection unit 501, prison
Listen instruction sending unit 502 and instruction of restarting transmission unit 503.Wherein, detection unit 501 is configured to detection object-computer
USB interface;It monitors instruction sending unit 502 to be configured to access Android device on USB interface in response to detecting, pass through
ADB sends the instruction of the destination TCP port for monitoring Android device to Android device;Instruction of restarting transmission unit 503 configures
For in response to detecting that object-computer is disconnected with the Android device accessed, being established and being pacified by destination TCP port
The wireless connection of tall and erect equipment sends instruction of restarting by being wirelessly connected to Android device.
In the present embodiment, detection unit 501, monitor instruction sending unit 502 and instruction of restarting transmission unit 503 tool
Body processing and its caused technique effect can be respectively with reference to step 201, step 202 and the steps 203 in 2 corresponding embodiment of figure
Related description, details are not described herein.
In some optional realization methods of the present embodiment, detection unit 501 is further configured to:Target is calculated
The USB interface of machine is polled detection;In response to detecting on USB interface there is equipment access, whether detection device is that Android is set
It is standby.
In some optional realization methods of the present embodiment, which further includes:Running unit (is not marked in figure
Go out).Wherein, running unit is configured to operation ADB clients.
In some optional realization methods of the present embodiment, instruction of restarting transmission unit 503 is further configured to lead to
It crosses destination TCP port and WLAN and establishes wireless connection with Android device.
In some optional realization methods of the present embodiment, instruction of restarting transmission unit 503 includes:Obtain subelement and
Connect subelement.Wherein, subelement is obtained to be configured to obtain the internet protocol address of Android device;Connection subelement is matched
It sets and is connected for being established with Android device based on IP address and destination TCP port.
The device that above-described embodiment of the application provides, first, above-mentioned detection unit 501 detect USB interface;Later, it supervises
It listens instruction sending unit 502 to access Android device on USB interface in response to detecting, is sent and used to Android device by ADB
In the instruction for the destination TCP port for monitoring Android device;Finally, instruction of restarting transmission unit 503 is in response to detecting target meter
Calculation machine is disconnected with the Android device accessed, is established the wireless connection with Android device by destination TCP port, is passed through nothing
Line connects, and instruction of restarting is sent so that Android device is restarted to Android device.
Below with reference to Fig. 6, it illustrates the computer systems 600 suitable for the electronic equipment for realizing the embodiment of the present application
Structural schematic diagram.Electronic equipment shown in Fig. 6 is only an example, to the function of the embodiment of the present application and should not use model
Shroud carrys out any restrictions.
As shown in fig. 6, computer system 600 includes central processing unit (CPU) 601, it can be read-only according to being stored in
Program in memory (ROM) 602 or be loaded into the program in random access storage device (RAM) 603 from storage section 608 and
Execute various actions appropriate and processing.In RAM 603, also it is stored with system 600 and operates required various programs and data.
CPU 601, ROM 602 and RAM 603 are connected with each other by bus 604.Input/output (I/O) interface 605 is also connected to always
Line 604.
It is connected to I/O interfaces 605 with lower component:Importation 606 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 607 of spool (CRT), liquid crystal display (LCD) etc. and loud speaker etc.;Storage section 608 including hard disk etc.;
And the communications portion 609 of the network interface card including LAN card, modem etc..Communications portion 609 via such as because
The network of spy's net executes communication process.Driver 610 is also according to needing to be connected to I/O interfaces 605.Detachable media 611, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on driver 610, as needed in order to be read from thereon
Computer program be mounted into storage section 608 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed by communications portion 609 from network, and/or from detachable media
611 are mounted.When the computer program is executed by central processing unit (CPU) 601, executes and limited in the system of the application
Above-mentioned function.
It should be noted that computer-readable medium shown in the application can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two arbitrarily combines.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or arbitrary above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to:Electrical connection with one or more conducting wires, just
It takes formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type and may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In this application, can be any include computer readable storage medium or storage journey
The tangible medium of sequence, the program can be commanded the either device use or in connection of execution system, device.And at this
In application, computer-readable signal media may include in a base band or as the data-signal that a carrier wave part is propagated,
Wherein carry computer-readable program code.Diversified forms may be used in the data-signal of this propagation, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By instruction execution system, device either device use or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to:Wirelessly, electric wire, optical cable, RF etc. or above-mentioned
Any appropriate combination.
Flow chart in attached drawing and block diagram, it is illustrated that according to the system of the various embodiments of the application, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part for a part for one module, program segment, or code of table, above-mentioned module, program segment, or code includes one or more
Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box
The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical
On can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depended on the functions involved.Also it wants
It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule
The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction
It closes to realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard
The mode of part is realized.Described unit can also be arranged in the processor, for example, can be described as:A kind of processor packet
It includes detection unit, monitor instruction sending unit and instruction of restarting transmission unit.Wherein, the title of these units is under certain conditions
The restriction to the unit itself is not constituted, " USB of detection object-computer connects for example, detection unit is also described as
The unit of mouth ".
As on the other hand, present invention also provides a kind of computer-readable medium, which can be
Included in computer described in above-described embodiment;Can also be individualism, and without be incorporated the electronic equipment in.On
It states computer-readable medium and carries one or more program, when the computer is held by one for said one or multiple programs
When row so that the computer:Detect the USB interface of object-computer;In response to detecting that having accessed Android on USB interface sets
It is standby, the instruction of the destination TCP port by ADB to Android device transmission for monitoring Android device;In response to detecting target
Computer is disconnected with the Android device accessed, is established the wireless connection with Android device by destination TCP port, is passed through
It is wirelessly connected, instruction of restarting is sent to Android device.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.People in the art
Member should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic
Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature
Other technical solutions of arbitrary combination and formation.Such as features described above has similar work(with (but not limited to) disclosed herein
Can technical characteristic replaced mutually and the technical solution that is formed.
Claims (12)
1. a kind of method for restarting Android device, including:
Detect the general-purpose serial bus USB interface of object-computer;
Android device has been accessed on the USB interface in response to detecting, bridge ADB is debugged by Android and is sent out to the Android device
Send the instruction of the object transmission control protocol TCP port for monitoring the Android device;
In response to detecting that the object-computer is disconnected with the Android device accessed, pass through the target TCP
The wireless connection with the Android device is established in port, and by the wireless connection, instruction of restarting is sent to the Android device.
2. according to the method described in claim 1, wherein, the USB interface of the detection object-computer, including:
Detection is polled to the USB interface of the object-computer;
There is equipment access on the USB interface in response to detecting, detects whether the equipment is Android device.
3. according to the method described in claim 1, wherein, being sent to the Android device for monitoring by ADB described
Before the instruction for stating the destination TCP port of Android device, further include:
Run ADB clients.
4. according to the method described in one of claim 1-3, wherein described to be established and the peace by the destination TCP port
The wireless connection of tall and erect equipment, including:
It is established and is wirelessly connected with the Android device by the destination TCP port and WLAN.
5. according to the method described in claim 4, wherein, it is described by the destination TCP port and WLAN with it is described
Android device, which is established, to be wirelessly connected, including:
Obtain the internet protocol address of the Android device;
It is established and is connected with the Android device based on the IP address and the destination TCP port.
6. a kind of device for restarting Android device, including:
Detection unit is configured to the USB interface of detection object-computer;
Instruction sending unit is monitored, is configured to access Android device on the USB interface in response to detecting, passes through ADB
The instruction of the destination TCP port for monitoring the Android device is sent to the Android device;
Instruction of restarting transmission unit is configured to the Android device in response to detecting the object-computer Yu having accessed
Disconnect, by the destination TCP port establish with the wireless connection of the Android device, by the wireless connection, to
The Android device sends instruction of restarting.
7. device according to claim 6, wherein the detection unit is further configured to:
Detection is polled to the USB interface of the object-computer;
There is equipment access on the USB interface in response to detecting, detects whether the equipment is Android device.
8. device according to claim 6, wherein described device further includes:
Running unit is configured to operation ADB clients.
9. according to the device described in one of claim 6-8, wherein the instruction of restarting transmission unit is further configured to:
It is established and is wirelessly connected with the Android device by the destination TCP port and WLAN.
10. device according to claim 9, wherein the instruction of restarting transmission unit includes:
Subelement is obtained, is configured to obtain the internet protocol address of the Android device;
Subelement is connected, is configured to establish connection with the Android device based on the IP address and the destination TCP port.
11. a kind of electronic equipment, including:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors so that one or more of processors are real
The now method as described in any in claim 1-5.
12. a kind of computer-readable medium, is stored thereon with computer program, wherein real when described program is executed by processor
The now method as described in any in claim 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810342874.3A CN108536479A (en) | 2018-04-17 | 2018-04-17 | Method and apparatus for restarting Android device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810342874.3A CN108536479A (en) | 2018-04-17 | 2018-04-17 | Method and apparatus for restarting Android device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108536479A true CN108536479A (en) | 2018-09-14 |
Family
ID=63480759
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810342874.3A Pending CN108536479A (en) | 2018-04-17 | 2018-04-17 | Method and apparatus for restarting Android device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108536479A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111726413A (en) * | 2020-06-28 | 2020-09-29 | 北京百度网讯科技有限公司 | Equipment connection method and device |
WO2021003694A1 (en) * | 2019-07-10 | 2021-01-14 | Micro Focus Llc | Device debugging connection control and maintenance |
CN117573214A (en) * | 2024-01-17 | 2024-02-20 | 深圳前海深蕾半导体有限公司 | Method and device for fusing serial device and Android system frame |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN201213018Y (en) * | 2008-07-16 | 2009-03-25 | 航天信息股份有限公司 | High speed dutiable-goods declaring device |
CN101625668A (en) * | 2008-07-11 | 2010-01-13 | 航天信息股份有限公司 | High-speed tax device and method for transmitting local side bonded data |
CN102946645A (en) * | 2012-10-17 | 2013-02-27 | 深圳市中兴移动通信有限公司 | Communication method between PC (Personal Computer) and Android equipment, as well as equipment |
CN103064812A (en) * | 2012-12-24 | 2013-04-24 | 珠海市君天电子科技有限公司 | Method and device for quick connection of mobile device and computer |
CN103955414A (en) * | 2014-04-24 | 2014-07-30 | 深圳市道通科技有限公司 | Self-restoration method and device of USB (universal serial bus) Host fault |
CN103970700A (en) * | 2014-05-28 | 2014-08-06 | 四川效率源信息安全技术有限责任公司 | Device and method for simultaneously recovering and extracting data of multiple pieces of Android equipment |
CN104468260A (en) * | 2014-11-13 | 2015-03-25 | 百度在线网络技术(北京)有限公司 | Recognition method, device and system for mobile terminal device |
CN105893193A (en) * | 2015-12-08 | 2016-08-24 | 乐视移动智能信息技术(北京)有限公司 | Connection control method of adb (Android Debug Bridge) and related equipment |
US20160255493A1 (en) * | 2015-02-27 | 2016-09-01 | T-Mobile U.S.A., Inc. | Remote device modification |
US20160274900A1 (en) * | 2015-03-20 | 2016-09-22 | ZeroTurnaround AS | System and Method for Fast Restarting of User Apps |
CN107453943A (en) * | 2017-07-05 | 2017-12-08 | 深圳市捷高软件信息有限公司 | A kind of network interface card detection and self-repairing circuit |
CN107483696A (en) * | 2017-07-12 | 2017-12-15 | 武汉卡比特信息有限公司 | A kind of mobile phone and the communication means and system of computer equipment |
-
2018
- 2018-04-17 CN CN201810342874.3A patent/CN108536479A/en active Pending
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101625668A (en) * | 2008-07-11 | 2010-01-13 | 航天信息股份有限公司 | High-speed tax device and method for transmitting local side bonded data |
CN201213018Y (en) * | 2008-07-16 | 2009-03-25 | 航天信息股份有限公司 | High speed dutiable-goods declaring device |
CN102946645A (en) * | 2012-10-17 | 2013-02-27 | 深圳市中兴移动通信有限公司 | Communication method between PC (Personal Computer) and Android equipment, as well as equipment |
CN103064812A (en) * | 2012-12-24 | 2013-04-24 | 珠海市君天电子科技有限公司 | Method and device for quick connection of mobile device and computer |
CN103955414A (en) * | 2014-04-24 | 2014-07-30 | 深圳市道通科技有限公司 | Self-restoration method and device of USB (universal serial bus) Host fault |
CN103970700A (en) * | 2014-05-28 | 2014-08-06 | 四川效率源信息安全技术有限责任公司 | Device and method for simultaneously recovering and extracting data of multiple pieces of Android equipment |
CN104468260A (en) * | 2014-11-13 | 2015-03-25 | 百度在线网络技术(北京)有限公司 | Recognition method, device and system for mobile terminal device |
US20160255493A1 (en) * | 2015-02-27 | 2016-09-01 | T-Mobile U.S.A., Inc. | Remote device modification |
US20160274900A1 (en) * | 2015-03-20 | 2016-09-22 | ZeroTurnaround AS | System and Method for Fast Restarting of User Apps |
CN105893193A (en) * | 2015-12-08 | 2016-08-24 | 乐视移动智能信息技术(北京)有限公司 | Connection control method of adb (Android Debug Bridge) and related equipment |
CN107453943A (en) * | 2017-07-05 | 2017-12-08 | 深圳市捷高软件信息有限公司 | A kind of network interface card detection and self-repairing circuit |
CN107483696A (en) * | 2017-07-12 | 2017-12-15 | 武汉卡比特信息有限公司 | A kind of mobile phone and the communication means and system of computer equipment |
Non-Patent Citations (3)
Title |
---|
LISHBO: "Android中通过WiFi执行adb命令", 《HTTPS:https://WWW.CNBLOGS.COM/LISHBO/P/9956050.HTML》 * |
吴明;贺观: "《跨座式单轨交通信号系统》", 30 April 2016 * |
团支书: "【ADB命令第二篇】之利用reboot命令重启手机", 《HTTP:https://WWW.MIUI.COM/ARTICLE-56-1.HTML》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021003694A1 (en) * | 2019-07-10 | 2021-01-14 | Micro Focus Llc | Device debugging connection control and maintenance |
US12001319B2 (en) | 2019-07-10 | 2024-06-04 | Micro Focus Llc | Device debugging connection control and maintenance |
CN111726413A (en) * | 2020-06-28 | 2020-09-29 | 北京百度网讯科技有限公司 | Equipment connection method and device |
CN117573214A (en) * | 2024-01-17 | 2024-02-20 | 深圳前海深蕾半导体有限公司 | Method and device for fusing serial device and Android system frame |
CN117573214B (en) * | 2024-01-17 | 2024-04-19 | 深圳前海深蕾半导体有限公司 | Method and device for fusing serial device and Android system frame |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3575975B1 (en) | Method and apparatus for operating smart network interface card | |
WO2020134634A1 (en) | Program debugging method, program debugging apparatus, terminal device, and storage medium | |
CN106919485B (en) | System based on hardware testing tool configured on server | |
CN108536479A (en) | Method and apparatus for restarting Android device | |
CN110399253A (en) | Delay machine treating method and apparatus | |
CN110896362B (en) | Fault detection method and device | |
WO2021120544A1 (en) | Method and apparatus for debugging device | |
CN112272118A (en) | Network repairing method, device, storage medium and electronic equipment | |
CN110881224B (en) | Network long connection method, device, equipment and storage medium | |
GB2500961A (en) | A device for monitoring activity of a computing device | |
CN109818994A (en) | Information processing method and device for agent side | |
CN116701168A (en) | Peripheral interface testing method, device, equipment and storage medium | |
CN109299124A (en) | Method and apparatus for more new model | |
CN107181606B (en) | Method and apparatus for controlling network nodes | |
CN103152216B (en) | The method of testing of system and device in a kind of the Internet | |
CN111737084A (en) | Information monitoring method and device, intelligent equipment, computer equipment and medium | |
CN114257632B (en) | Method and device for reconnecting broken wire, electronic equipment and readable storage medium | |
CN112383904B (en) | Pair-free quick peripheral calling method and device | |
CN109120433A (en) | Method and apparatus for containerization deployment host | |
CN110633182B (en) | System, method and device for monitoring server stability | |
CN115378803B (en) | Log management method, device, blockchain node and storage medium | |
CN115842762B (en) | Equipment debugging method, device and system | |
CN111490885B (en) | Method for processing equipment error information, electronic equipment and storage medium | |
CN118796578A (en) | Test method, test device, computing equipment and storage medium | |
CN109347869B (en) | Method, device, medium and electronic equipment for generating inter-cluster communication security factor |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180914 |
|
RJ01 | Rejection of invention patent application after publication |