CN108572929B - Method and device for starting debugging mode of equipment - Google Patents
Method and device for starting debugging mode of equipment Download PDFInfo
- Publication number
- CN108572929B CN108572929B CN201710135014.8A CN201710135014A CN108572929B CN 108572929 B CN108572929 B CN 108572929B CN 201710135014 A CN201710135014 A CN 201710135014A CN 108572929 B CN108572929 B CN 108572929B
- Authority
- CN
- China
- Prior art keywords
- terminal
- target port
- path information
- target
- 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.)
- Active
Links
Images
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/10—Program control for peripheral devices
- G06F13/102—Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a method and a device for starting a debugging mode of equipment. Wherein, the method comprises the following steps: when a first terminal receives a connection instruction for indicating connection with a second terminal, enumerating a first target port of the second terminal, wherein the first target port is used for establishing communication connection with the second terminal; under the condition that enumeration of the first target port fails, enumerating path information of a second target port of the second terminal so as to send a starting instruction for starting a preset debugging mode of the second terminal to the second terminal through the second target port; under the condition that enumeration of the path information of the second target port is successful, establishing communication connection with the second terminal through the path information; and sending a starting instruction to the second terminal through the communication connection so that the second terminal starts a preset debugging mode according to the starting instruction. The invention solves the technical problem of complex operation flow of starting the debugging mode of the equipment in the related technology.
Description
Technical Field
The invention relates to the field of communication, in particular to a method and a device for starting a debugging mode of equipment.
Background
At present, when computer (PC) assistant software is connected with and manages terminal equipment, a user needs to manually open a debugging mode on the terminal equipment, for example, when a flashing sprite is connected with and manages a mobile phone, the user needs to manually open a Universal Serial BUS (USB) debugging mode at a mobile phone end, so that the software needs to display different interactions and prompts according to models, and the user needs to complete the operation of opening the USB debugging mode step by step according to displayed contents, thereby bringing inconvenience to software developers and users.
Fig. 1 is a flowchart of a development method of a debugging mode of a device according to a related art. As shown in fig. 1, the method comprises the steps of:
and step S101, the PC assistant starts to connect an Android (Android) mobile phone.
Step S102, enumerate ADB ports.
After the PC assistant starts to connect the android device, enumerating the ADB port, if enumerating the ADB port is successful, executing step S103, and if enumerating the ADB port is failed, executing step S104.
And step S103, completing debugging of the PC assistant and the android device.
After the ADB port is enumerated, if the ADB port is enumerated successfully, debugging of the PC assistant and the android device is completed.
And step S104, enumerating the android hardware device information.
After enumerating the ADB port, if enumerating the ADB port fails, android hardware device information is enumerated, which includes a Vendor identification code (Vendor ID, abbreviated VID), a Product identification code (Product ID, abbreviated PID), and the like. And if the android hardware device information is enumerated successfully, executing the step S105, and if the android hardware device information is enumerated unsuccessfully, executing the step S107.
And step S105, matching models through hardware information.
After the android hardware device information is enumerated, if the android hardware device information is enumerated successfully, the model is matched through the hardware information.
And S106, displaying the step of manually opening the USB debugging mode corresponding to the model.
And after the models are matched, displaying the step of manually opening the USB debugging by the user through the pop-up box according to the matched models.
And step S107, determining that the mobile phone is not connected.
And if the information of the android hardware equipment fails to be enumerated, displaying prompt information for prompting that the mobile phone is not connected.
The existing method for starting the debugging mode of the equipment is troublesome, the matching relation between hardware information and the machine type needs to be collected and mapped, and meanwhile, the steps of designing and customizing the display according to the machine type are needed, so that the technical cost of the operation flow for starting the debugging of the equipment is high; the matching of the new machine type can not be on line at the first time to cause error prompt, so that certain technical environment limitation exists.
In view of the above problem of the operation procedure for starting the device debugging, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for starting a debugging mode of equipment, which are used for at least solving the technical problem that the operation flow for starting the debugging mode of the equipment in the related technology is complex.
According to an aspect of the embodiments of the present invention, a method and an apparatus for starting a debug mode of a device are provided. The starting method of the debugging mode of the equipment comprises the following steps: when a first terminal receives a connection instruction for indicating connection with a second terminal, enumerating a first target port of the second terminal, wherein the first target port is used for establishing communication connection with the second terminal; under the condition that enumeration of the first target port fails, enumerating path information of a second target port of the second terminal so as to send a starting instruction for starting a preset debugging mode of the second terminal to the second terminal through the second target port; under the condition that enumeration of the path information of the second target port is successful, establishing communication connection with the second terminal through the path information; and sending a starting instruction to the second terminal through the communication connection so that the second terminal starts a preset debugging mode according to the starting instruction.
According to another aspect of the embodiment of the invention, a device for starting a debugging mode of equipment is also provided. The device includes: the first enumeration unit is used for enumerating a first target port of a second terminal when the first terminal receives a connection instruction for indicating connection with the second terminal, wherein the first target port is used for establishing communication connection with the second terminal; the second enumeration unit is used for enumerating path information of a second target port of the second terminal under the condition that enumeration of the first target port fails, so as to send a starting instruction for starting a preset debugging mode of the second terminal to the second terminal through the second target port; the first establishing unit is used for establishing communication connection with the second terminal through the path information under the condition that the path information of the second target port is enumerated successfully; and the sending unit is used for sending a starting instruction to the second terminal through the communication connection so that the second terminal starts the preset debugging mode according to the starting instruction.
In the embodiment of the invention, when a first terminal receives a connection instruction for indicating connection with a second terminal, a first target port of the second terminal is enumerated, wherein the first target port is used for establishing communication connection with the second terminal; under the condition that enumeration of the first target port fails, enumerating path information of a second target port of the second terminal so as to send a starting instruction for starting a preset debugging mode of the second terminal to the second terminal through the second target port; under the condition that enumeration of the path information of the second target port is successful, establishing communication connection with the second terminal through the path information; the starting instruction is sent to the second terminal through the communication connection, so that the second terminal starts the preset debugging mode according to the starting instruction, the purpose of starting the preset debugging mode of the equipment is achieved, the technical effect of simplifying the operation flow of starting equipment debugging is achieved, and the technical problem that the operation flow of starting the equipment debugging mode in the related technology is complex is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a flowchart of a development method of a debugging mode of a device according to a related art;
FIG. 2 is a diagram of a hardware environment for a method for enabling a debug mode of a device according to an embodiment of the present invention;
FIG. 3 is a flow chart of a method for turning on a debug mode of a device according to an embodiment of the present invention;
FIG. 4 is a flow chart of another method for turning on a debug mode of a device according to an embodiment of the present invention;
fig. 5 is a flowchart of a method for enumerating path information of a second target port of a second terminal according to an embodiment of the present invention;
fig. 6 is a flowchart of another method for enumerating path information of a second target port of a second terminal according to an embodiment of the present invention;
FIG. 7 is a flow chart of another method for turning on a debug mode of a device according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a device for enabling a debug mode of an apparatus according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a device for enabling a debug mode of an apparatus according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of a device for enabling a debug mode of an apparatus according to an embodiment of the present invention;
FIG. 11 is a diagram of a device for enabling a debug mode of an apparatus according to an embodiment of the present invention;
FIG. 12 is a diagram of a device for enabling a debug mode of an apparatus according to an embodiment of the present invention;
FIG. 13 is a diagram of a device for enabling a debug mode of an apparatus according to an embodiment of the present invention; and
fig. 14 is a block diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
According to an embodiment of the present invention, an embodiment of a method for starting a debug mode of a device is provided.
Alternatively, in this embodiment, the method for turning on the debug mode of the device may be applied to a hardware environment formed by the server 202 and the terminal 204 as shown in fig. 2. Fig. 2 is a schematic diagram of a hardware environment of a method for turning on a debug mode of a device according to an embodiment of the present invention. As shown in fig. 1, a server 202 is connected to a terminal 204 through a network including, but not limited to: the terminal 204 is not limited to a PC, a mobile phone, a tablet computer, etc. the terminal may be a wide area network, a metropolitan area network, or a local area network. The method for starting the debugging mode of the device according to the embodiment of the present invention may be executed by the server 202, or may be executed by the terminal 204, or may be executed by both the server 202 and the terminal 204. The terminal 204 executing the method for starting the debugging mode of the device according to the embodiment of the present invention may also be executed by a target client installed thereon.
Fig. 3 is a flowchart of a method for turning on a debug mode of a device according to an embodiment of the present invention. As shown in fig. 3, the method may include the steps of:
step S302, enumerating a first target port of a second terminal when the first terminal receives a connection instruction for instructing to connect to the second terminal.
In the technical solution provided in step S302 of the present invention, when the first terminal receives a connection instruction for instructing to connect to the second terminal, enumerating a first target port of the second terminal, where the first target port is used for establishing a communication connection with the second terminal.
In this embodiment, the first terminal may be a PC, for example, a PC assistant is installed on the first terminal, the second terminal may be an Android device, the second terminal has a first target port, the first target port may be an Android Debug Bridge (ADB) port, and the first terminal establishes a connection with the second terminal through the first target port. The ADB is a tool in an android software development toolkit, and the tool can be used for directly operating and managing an android simulator or a real android device. When the first terminal is connected with the second terminal, enumerating the first target ports of the second terminal, that is, enumerating the first target ports of the second terminal one by one. Optionally, when the first terminal receives an instruction for instructing to establish a connection with the second terminal, and starts to connect the second terminal, enumerating a first target port of the second terminal.
Optionally, the ADB command module is configured to enumerate a first target port of the second terminal when the first terminal receives a connection instruction for instructing to connect to the second terminal, and may communicate with the android device by calling the ADB tool to obtain information of the android device. Through this module, can enumerate the ADB port of android device, the PC assistant is connected with android device through this ADB port.
And if the enumeration of the first target port is successful, establishing communication connection with the second terminal through the first target port, and if the enumeration of the first target port is failed, executing step S304.
Step S304, enumerating path information of a second target port of the second terminal, so as to send a start instruction for starting a preset debug mode of the second terminal to the second terminal through the second target port.
In the technical solution provided in step S304 of the present invention, when enumeration of the first target port fails, the path information of the second target port of the second terminal is enumerated, so as to send an opening instruction for opening a preset debug mode of the second terminal to the second terminal through the second target port.
The second terminal has a second destination port. In the case that enumeration of the first target port fails, that is, in the case that enumeration of the first target port does not occur, path information of the second target port is enumerated, and the path information may be a path name of the second target port.
Optionally, when the second target port is of a preset type and the path information of the second target port includes preset characters, it is determined that the path information enumerating the second terminal port is successful, for example, the USB device must be of a STORAGE disk (STORAGE) type or a Compact Disc Read-only memory (CD-ROM) type, and it is valid that the path name includes "prod _ android _ phone," where the "prod _ android _ phone" is used to indicate that the second terminal is an android device.
Optionally, the second terminal is an android device, the second target port is a USB port, and the device driver module searches for a path name of the USB port of the android device.
And step S306, establishing communication connection with the second terminal through the path information.
In the technical solution provided in step S306 of the present invention, when the path information of the second target port is enumerated successfully, a communication connection is established with the second terminal through the path information.
When the path information of the second target port is enumerated successfully, that is, when the path information of the second target port is enumerated, the communication connection is established with the second terminal through the path information, and an opening instruction for opening a preset debugging mode of the second terminal can be sent to the second terminal to open the preset debugging mode. The preset debugging mode is a function for development work, the function can copy data between the first terminal and the second terminal, and an application program is installed on the second terminal, a log is read, and the like.
Optionally, the USB port communication module communicates with the android device by using the pathname of the USB port obtained by the device driving module. The USB port communication module can send a starting instruction to the android device to start the USB debugging mode. The USB debugging mode is a function provided by android and used for development work, and data can be copied between a computer and the android device, an application program can be installed on the android device, log data can be read, and the like.
Step S308, sending a starting instruction to the second terminal through the communication connection, so that the second terminal starts a preset debugging mode according to the starting instruction.
In the technical solution provided in step S308 of the present invention, a start instruction is sent to the second terminal through the communication connection, so that the second terminal starts the preset debugging mode according to the start instruction.
And sending a starting instruction for starting a preset debugging mode of the second terminal to the second terminal through the second target port. And after the communication connection is established with the second terminal through the path information, sending a starting instruction to the second terminal through the communication connection, so that the second terminal automatically starts a preset debugging mode according to the starting instruction.
After the second terminal starts the preset debugging mode according to the starting instruction, the connection of the second terminal can be restarted, and at the moment, the first target port can enumerate to the second terminal to establish connection and further communication.
Optionally, in the above embodiment, by calling the ADB command module, the device driver module and the USB port communication module, the purpose of automatically opening the USB debugging mode of the android device can be achieved by performing the integration of the flow, the matching relationship between the hardware information and the model is avoided from being collected and mapped, meanwhile, the steps of designing and customizing the display according to the model are avoided, the problem of high technical cost is caused, the problem of error prompt caused by the fact that the new model cannot be matched on line at the first time is also avoided, customized adaptation for various versions of the android device is not required, and the operation and maintenance cost is greatly reduced. According to the embodiment, the user does not need to participate, the user experience is greatly improved, the technical effect of simplifying the operation flow of starting the equipment debugging mode is achieved, and the technical problem that the operation flow of starting the equipment debugging mode in the related technology is complex is solved.
Through the steps S302 to S308, when the first terminal receives a connection instruction for instructing to connect to the second terminal, enumerating a first target port of the second terminal, where the first target port is used for establishing a communication connection with the second terminal; under the condition that enumeration of the first target port fails, enumerating path information of a second target port of the second terminal so as to send a starting instruction for starting a preset debugging mode of the second terminal to the second terminal through the second target port; under the condition that enumeration of the path information of the second target port is successful, establishing communication connection with the second terminal through the path information; the starting instruction is sent to the second terminal through the communication connection, so that the second terminal starts the preset debugging mode according to the starting instruction, the technical problem that the operation flow for starting the equipment debugging mode in the related technology is complex can be solved, and the technical effect of simplifying the operation flow for starting the equipment debugging mode is achieved.
As an optional implementation manner, after sending the opening instruction to the second terminal through the communication connection, receiving the connection instruction again, and enumerating the first target port; and under the condition that the enumeration of the first target port is successful, establishing communication connection with the second terminal through the first target port.
Fig. 4 is a flowchart of a method for turning on a debug mode of another device according to an embodiment of the present invention. As shown in fig. 4, the method further comprises the steps of:
in step S401, the connection command is received again.
In the technical solution provided by step S401 of the present invention, a connection instruction for instructing to connect to the second terminal is received.
And sending a starting instruction to the second terminal through the communication connection so that the second terminal receives the connection instruction again after starting the preset debugging mode according to the starting instruction. Optionally, the first terminal receives a connection instruction, and starts to connect to the second terminal. When the first terminal is a PC and the second terminal is an android device, the PC assistant starts to connect the android device.
In step S402, after receiving the connection instruction, enumerating the first target port.
In the technical solution provided by step S402 of the present invention, after receiving the connection instruction, enumerating the first target port.
After receiving the connection instruction again, the first terminal connects with the second terminal, enumerates the first target ports, that is, enumerates the first target ports one by one. In case enumeration of the first target port is successful, step S403 is performed.
Step S403, establishing a communication connection with the second terminal through the first target port under the condition that enumeration of the first target port is successful.
In the technical solution provided in step S403 of the present invention, when enumeration of the first target port is successful, a communication connection is established with the second terminal through the first target port.
And under the condition that the enumeration of the first target port is successful, that is, under the condition that the enumeration of the first target port is successful, the first terminal establishes communication connection with the second terminal through the first target port, and optionally, the PC assistant establishes communication connection with the android device through the ADB port.
In the embodiment, the starting instruction is sent to the second terminal through the communication connection, so that the second terminal receives the connection instruction again after starting the preset debugging mode according to the starting instruction; enumerating the first target port after receiving the connection instruction; and under the condition that the enumeration of the first target port is successful, establishing communication connection with the second terminal through the first target port.
As an optional implementation manner, in step S304, the enumerating path information of the second target port of the second terminal includes: sequentially enumerating a plurality of second target ports until path information of the second target ports is successfully enumerated, wherein: under the condition that any one second target port is enumerated, judging whether the second target port accords with a preset type or not, and judging whether the path information comprises preset characters or not; and if the enumerated second target port is judged to be in accordance with the preset type and the path information is judged to comprise the preset character, determining that the path information enumerating the second target port is successful.
Fig. 5 is a flowchart of a method for enumerating path information of a second target port of a second terminal according to an embodiment of the present invention. As shown in fig. 5, the method comprises the steps of:
step S501, determining whether the second target port conforms to a preset type, and determining whether the path information includes a preset character.
In the technical solution provided in step S501 of the present invention, when any one second target port is enumerated, it is determined whether the second target port conforms to a preset type, and it is determined whether the path information includes a preset character.
The second target port comprises a plurality of second target ports, and after the first target port of the second terminal is enumerated, the plurality of second target ports are enumerated in sequence until the path to the second target port is enumerated successfully. And under the condition that any one second target port is enumerated, judging whether the second target port accords with a preset type or not, and judging whether the path information comprises preset characters or not, wherein the preset characters can be used for indicating the type of the second terminal. If the second target port is determined to be in accordance with the preset type and the path information includes the preset character, step S502 is executed.
Optionally, the second target port is a USB port, and if any USB port is enumerated, it is determined whether the USB port is a STORAGE type or a CDROM type, and it is determined whether a path name of the USB port includes a "prod _ android _ phone", if it is determined that the USB port is the STORAGE type or the CDROM type, and it is determined that the path name of the USB port includes the "prod _ android _ phone", step S502 is executed.
Step S502, it is determined that enumerating the path information of the second target port is successful.
In the technical solution provided in step S502 of the present invention, if it is determined that the enumerated second target port conforms to the preset type and it is determined that the path information includes the preset character, it is determined that the path information enumerating the second target port is successful.
After judging whether the second target port accords with the preset type and judging whether the path information comprises the preset character, if the second target port accords with the preset type and the path information comprises the preset character, determining that the path information enumerating the second target port is successful. And if the second target port is judged to be not in accordance with the preset type and the path information does not comprise the preset character, determining that the path information enumerating the second target port fails.
In this embodiment, a plurality of second target ports are enumerated in sequence until path information of the second target ports is enumerated successfully, and under the condition that any one second target port is enumerated, whether the second target port conforms to a preset type is judged, and whether the path information includes a preset character is judged; if the enumerated second target port is judged to be in accordance with the preset type and the path information is judged to comprise the preset character, the path information of the second target port is determined to be enumerated successfully, and the purpose of enumerating the path information of the second target port of the second terminal is achieved; under the condition that enumeration of the path information of the second target port is successful, establishing communication connection with the second terminal through the path information; and sending a starting instruction to the second terminal through the communication connection so that the second terminal starts a preset debugging mode according to the starting instruction, thereby simplifying the operation flow of starting equipment debugging.
As an optional implementation manner, in step S304, the enumerating path information of the second target port of the second terminal includes: enumerating a plurality of second target ports; and under the condition that a plurality of second target ports are enumerated, if the second target ports which accord with the preset type and the path information comprises preset characters exist in the plurality of second target ports, determining that the path information for enumerating the second target ports is successful.
Fig. 6 is a flowchart of another method for enumerating path information of a second target port of a second terminal according to an embodiment of the present invention. As shown in fig. 6, the method comprises the steps of:
step S601 enumerates a plurality of second target ports.
In the technical solution provided by step S601 of the present invention, a plurality of second target ports are enumerated.
The second destination port includes a plurality of second destination ports. After enumerating the first target port of the second terminal, in case of failure in enumerating the first target port, enumerating a plurality of second target ports, that is, enumerating all the second target ports.
Step S602, determining whether a second target port that meets the preset type and has path information including a preset character exists in the plurality of second target ports.
In the technical solution provided in step S602 of the present invention, when a plurality of second target ports are enumerated, it is determined whether there is a second target port that meets a preset type and has path information including a preset character in the plurality of second target ports.
If it is determined that the second target ports conform to the preset type and the path information includes the second target port with the preset character, the step S603 is executed.
Optionally, the plurality of second target ports are a plurality of USB ports, determining whether there is a USB port conforming to STORAGE type or CDROM type in the plurality of USB ports and the path name includes "prod _ android _ phone", and if it is determined that there is a USB port conforming to STORAGE type or CDROM type in the plurality of USB ports and the path name includes "prod _ android _ phone", performing step S603.
Step S603, it is determined that enumerating the path information of the second target port is successful.
In the technical solution provided in step S603 of the present invention, if it is determined that there is a second target port that meets the preset type and whose path information includes preset characters in the plurality of second target ports, it is determined that enumerating the path information of the second target port is successful.
After judging whether a second target port which accords with the preset type and has the path information including the preset characters exists in the second target ports, if the second target port which accords with the preset type and has the path information including the preset characters exists in the second target ports, determining that the path information enumerating the second target ports is successful, and determining that the path information enumerating the second target ports is successful.
Optionally, the path names of all USB device ports are enumerated, wherein the USB device must be of STORAGE type or CDROM type, and it is valid that "prod _ android _ phone" is included in the path name.
The embodiment provides for enumerating a plurality of second target ports; under the condition that a plurality of second target ports are enumerated, judging whether the second target ports which accord with the preset type and the path information comprises preset characters exist in the plurality of second target ports; if the second target ports which accord with the preset type and the path information comprises the preset characters are judged to exist in the plurality of second target ports, the path information of the second target ports is successfully enumerated, the purpose of enumerating the path information of the second target ports of the second terminal is achieved, and under the condition that the path information of the second target ports is successfully enumerated, communication connection is established with the second terminal through the path information; and sending a starting instruction to the second terminal through the communication connection so that the second terminal starts a preset debugging mode according to the starting instruction, thereby simplifying the operation flow of starting equipment debugging.
As an optional implementation manner, after enumerating the path information of the second target port, in a case that enumerating the path information of the second target port fails, it is determined that the first terminal and the second terminal are not connected.
Optionally, after enumerating the path information of the second target port, if the path information of the second target port is not enumerated, it indicates that the first terminal and the second terminal are not connected, and displays a prompt message for indicating that the first terminal and the second terminal are not connected, for example, when the second terminal is a mobile phone, displays "mobile phone is not connected", and further prompts the user to take further solution measures.
As an optional implementation manner, the step S306, establishing a communication connection with the second terminal through the path information includes: establishing a communication pipeline with the second terminal through the path information; step S308, sending the opening instruction to the second terminal through the communication connection includes: and sending an opening instruction to the second terminal through the communication pipeline.
When a communication connection is established with the second terminal through the path information, a communication pipe is established with the second terminal through the path information, the sending process sends a large amount of data into the communication pipe in a character stream form, and the receiving process can receive the data from the communication pipe. The starting instruction is used for starting a preset debugging mode of the second terminal, when the starting instruction is sent to the second terminal through communication connection, the starting instruction is sent to the second terminal through the communication pipeline established by the path information and the second terminal, the preset debugging mode can be automatically started after the second terminal receives the starting instruction, the technical effect of simplifying the operation flow of starting the equipment debugging mode is achieved, and the technical problem that the operation flow of starting the equipment debugging mode in the related technology is complex is solved.
As an optional implementation manner, the first terminal is a computer device, the second terminal is an android device, the first target port is an ADB port, and the second target port is a USB port.
Optionally, when the computer device receives a connection instruction for instructing to connect the android device, enumerating an ADB port of the android device, where the ADB port is used for establishing a communication connection with the android device; under the condition that enumeration of the ADB port fails, enumerating path information of a USB port of the android device so as to send a starting instruction for starting a USB debugging mode of the android device to the android device through the USB port; under the condition that enumeration of path information of the USB port is successful, establishing communication connection with android equipment through the path information; the starting instruction is sent to the android device through communication connection, so that the android device starts a USB debugging mode according to the starting instruction, the matching relation between hardware information and machine types is avoided from being collected and mapped, meanwhile, the steps of designing and customizing the display according to the machine types are avoided, the problem that the technical cost is high is caused, the problem that error prompt is caused due to the fact that the new machine types cannot be matched in an online mode at the first time is also avoided, customized adaptation does not need to be made for various versions of the android device, and the operation and maintenance cost is greatly reduced. According to the embodiment, the user does not need to participate, the user experience is greatly improved, the technical effect of simplifying the operation flow of starting the equipment debugging mode is achieved, and the technical problem that the operation flow of starting the equipment debugging mode in the related technology is complex is solved.
Example 2
The technical solution of the present invention will be described below with reference to preferred embodiments. Specifically, the first terminal is taken as a computer device, the second terminal is taken as an android device, the first target port is an ADB port, and the second target port is a USB port.
According to the embodiment, the USB port of the android device is searched, the starting instruction for starting the USB debugging mode of the android device is sent to the android device through the USB port, the USB debugging mode of the android device is directly started, and the purpose of automatically starting the USB debugging mode of the android device without user operation is achieved.
The method for starting the debug mode of the device according to this embodiment may be executed by the ADB command module, the device driver module, the USB port communication module, and the client module.
The ADB command module is mainly used for communicating with the android device by calling an ADB tool so as to acquire the information of the android device. An ADB port of the android device can be enumerated through the ADB command module, and the PC assistant is connected with the android device through the ADB port.
And the device driving module is mainly used for searching the path name of the USB port of the android device and is used for the communication between the USB port communication module and the android device.
And the USB port communication module is used for communicating with the android device by using the path name of the USB port obtained by the device driving module. The USB port communication module can send a starting instruction to the android device to start the USB debugging mode.
The client module, namely, the user software, carries out the integration of flow through calling ADB command module, equipment driver module and USB port communication module and can reach the purpose of automatically opening the USB debugging mode of android device, reaches the technical effect of simplifying the operation flow of opening the device debugging mode.
Fig. 7 is a flowchart of a method for turning on a debug mode of another device according to an embodiment of the present invention. As shown in fig. 7, the method comprises the steps of:
in step S701, the PC assistant starts to connect the android device.
The method for starting and connecting the android device by the PC assistant can be that the PC assistant receives a connection instruction for indicating connection with the android device when starting, and the android device can be an android mobile phone.
Step S702 enumerates ADB ports.
After the PC helper initiates the connection of the android device, the ADB port is enumerated. If enumeration of the ADB port is successful, step S703 is performed, and if enumeration of the ADB port is failed, step S704 is performed.
And step S703, completing the connection between the PC assistant and the android device.
After enumerating the ADB port, if enumerating the ADB port is successful, the connection of the PC assistant and the android device is completed.
Step S704, enumerate the path name of the USB port.
After the ADB port is enumerated, if the enumeration of the ADB port fails, the path names of the ports of all USB devices are enumerated, where the USB devices must be of STORAGE type or CDROM type, and the path names include "prod _ android _ phone" to determine that the USB ports are valid, and determine that the path names enumerate the USB ports are successful, then step S705 is executed. If the USB device is not STORAGE type or CDROM type and the path name does not include "prod _ android _ phone", determining that the USB port is invalid, determining that enumerating the path name of the USB port fails, and performing step S706.
Step S705, an instruction to open the USB debug mode is sent through the USB port.
After enumerating the path names of the USB ports, if the path names enumerate to the USB ports, establishing a communication pipeline through the path names, sending an opening instruction to the android device in the communication pipeline, and after the opening instruction is successfully sent to the android device, automatically opening the USB debugging mode by the android device.
After an instruction for opening the USB debugging mode is sent to the USB port, the USB debugging mode is opened, the android device is restarted and connected, the connection instruction connected with the android device is received again, and at the moment, the ADB port can enumerate the android device to be connected and communicated.
And step S706, determining that the android device is not connected.
After the path names of the USB ports are enumerated, if the path names of the USB ports are not enumerated, the fact that the connection with the android device is not achieved is indicated, and prompt information of 'the android device is not connected' is displayed;
this embodiment is through seeking the USB port of android device to reach the purpose of opening USB debugging mode automatically through port communication, avoided needing to collect and map the matching relation of hardware information and model, avoided simultaneously needing to design and customization show step according to the model, lead to the higher problem of technical cost, still avoided the unable problem that leads to the wrong suggestion of coming on the line very first time of matching of new model, need not do the customization adaptation for the various editions of android device, operation maintenance cost has greatly been reduced. According to the embodiment, the user does not need to participate, the user experience is greatly improved, the technical effect of simplifying the operation flow of starting the equipment debugging mode is achieved, and the technical problem that the operation flow of starting the equipment debugging mode in the related technology is complex is solved.
This embodiment can be applied to the genius product of brushing the machine, through the USB debugging mode of automatic open android device, removes the complicated interaction of product from, reduces user's use threshold, effectively promotes the experience of product.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (which may be an android device, a computer, a network, or a network device) to execute the method according to the embodiments of the present invention.
Example 3
According to the embodiment of the invention, the device for starting the debugging mode of the equipment is also provided, wherein the device is used for implementing the method for starting the debugging mode of the equipment. Fig. 8 is a schematic diagram of a device for starting a debugging mode according to an embodiment of the present invention. As shown in fig. 8, the device for turning on the debug mode may include: a first enumeration unit 10, a second enumeration unit 20, a first setup unit 30 and a sending unit 40.
A first enumeration unit 10, configured to enumerate a first target port of a second terminal when a first terminal receives a connection instruction for instructing to connect to the second terminal, where the first target port is used to establish a communication connection with the second terminal.
The first enumeration unit 10 is configured to enumerate a first target port of a second terminal when the first terminal is connected to the second terminal, that is, the first enumeration unit 10 enumerates the first target ports of the second terminal one by one. Optionally, the first enumeration unit 10 is configured to enumerate a first target port of the second terminal when the first terminal receives an instruction indicating that a connection is established with the second terminal and starts to connect to the second terminal.
Optionally, the ADB command module is configured to enumerate a first target port of the second terminal when the first terminal receives a connection instruction for instructing to connect to the second terminal, and may communicate with the android device by calling the ADB tool to obtain information of the android device. Through this module, can enumerate the ADB port of android device, the PC assistant is connected with android device through this ADB port.
The second enumeration unit 20 is configured to enumerate path information of a second target port of the second terminal under the condition that enumeration of the first target port fails, so as to send an opening instruction for opening a preset debug mode of the second terminal to the second terminal through the second target port.
The second enumeration unit 20 is configured to enumerate path information of the second target port in a case where enumeration of the first target port fails, that is, in a case where enumeration of the first target port does not occur, where the path information may be a path name of the second target port.
Optionally, when the second target port is of a preset type and the path information of the second target port includes a preset character, the second enumeration unit 20 determines that the path information enumerating the second terminal port is successful, for example, the USB device must be of a STORAGE type or a read-only optical disc type, and it is valid that the path name includes "prod _ android _ phone," where the "prod _ android _ phone" is used to indicate that the second terminal is an android device.
The first establishing unit 30 is configured to establish a communication connection with the second terminal through the path information when the path information of the second target port is enumerated successfully.
When the second enumeration unit 20 successfully enumerates the path information of the second target port, that is, when the second enumeration unit 20 enumerates the path information of the second target port, the first establishing unit 30 establishes a communication connection with the second terminal through the path information, and may send an opening instruction for opening a preset debug mode of the second terminal to open the preset debug mode.
And the sending unit 40 is configured to send a start instruction to the second terminal through the communication connection, so that the second terminal starts the preset debugging mode according to the start instruction.
The sending unit 40 is configured to send a start instruction to the second terminal through the communication connection after establishing the communication connection with the second terminal through the path information, so that the second terminal automatically starts the preset debugging mode according to the start instruction.
After the second terminal starts the preset debugging mode according to the starting instruction, the connection of the second terminal can be restarted, and at the moment, the first target port can enumerate to the second terminal to establish connection and further communication.
Fig. 9 is a schematic diagram of a device for starting a debugging mode according to an embodiment of the present invention. As shown in fig. 9, the device for turning on the debug mode may include: a first enumeration unit 10, a second enumeration unit 20, a first setup unit 30 and a sending unit 40. Wherein, the device still includes: a receiving unit 50, a third enumeration unit 60 and a second establishing unit 70.
It should be noted that the first enumeration unit 10, the second enumeration unit 20, the first establishing unit 30, and the sending unit 40 in this embodiment are the same as the schematic diagram of the device debugging mode starting apparatus in the embodiment shown in fig. 8, and are not described herein again.
A receiving unit 50 for receiving the connection instruction again after transmitting the open instruction to the second terminal through the communication connection.
After the sending unit 40 sends a turn-on instruction to the second terminal through the communication connection so that the second terminal turns on the preset debugging mode according to the turn-on instruction, the receiving unit 50 receives the connection instruction again. Optionally, the first terminal receives a connection instruction, and starts to connect to the second terminal. When the first terminal is a PC and the second terminal is an android device, the PC assistant starts to connect the android device.
A third enumeration unit 60 configured to enumerate the first target port after receiving the connection instruction.
After the receiving unit 50 receives the connection instruction again, the first terminal is connected to the second terminal, and the third enumeration unit 60 enumerates the first target ports, that is, the third enumeration unit 60 enumerates the first target ports one by one.
A second establishing unit 70, configured to establish a communication connection with the second terminal through the first target port when enumeration of the first target port is successful.
When the third enumeration unit 60 enumerates the first target port successfully, that is, when the third enumeration unit 60 enumerates the first target port, the second establishing unit 70 enables the first terminal to establish a communication connection with the second terminal through the first target port, and optionally, the second establishing unit 70 enables the PC assistant to establish a communication connection with the android device through the ADB port.
Fig. 10 is a schematic diagram of a device for starting a debugging mode according to an embodiment of the present invention. As shown in fig. 10, the device for turning on the debug mode may include: a first enumeration unit 10, a second enumeration unit 20, a first setup unit 30 and a sending unit 40. Wherein the second enumeration unit 20 includes: a first enumeration module 21, a determination module 22 and a determination module 23.
It should be noted that the first enumeration unit 10, the second enumeration unit 20, the first establishing unit 30, and the sending unit 40 in this embodiment are the same as the schematic diagram of the device debugging mode starting apparatus in the embodiment shown in fig. 8, and are not described herein again.
A first enumeration module 21 for enumerating a plurality of second target ports.
The second destination port includes a plurality of second destination ports. After the first enumeration unit 10 enumerates the first target port of the second terminal, if enumeration of the first target port fails, the first enumeration module 21 enumerates a plurality of second target ports, that is, the first enumeration module 21 enumerates all the second target ports.
The determining module 22 is configured to determine whether a second target port that meets a preset type and whose path information includes a preset character exists in the plurality of second target ports under the condition that the plurality of second target ports are enumerated.
When the first enumeration module 21 enumerates a plurality of second target ports, the determining module 22 determines whether a second target port that conforms to the preset type and has path information including a preset character exists in the plurality of second target ports.
Optionally, the plurality of second target ports are a plurality of USB ports, and the determining module 22 determines whether there is a USB port that conforms to STORAGE type or CDROM type and includes "prod _ android _ phone" in the path name.
The determining module 23 is configured to determine that enumeration of the path information of the second target port is successful when it is determined that the second target port that meets the preset type and includes the preset character exists in the plurality of second target ports.
After the determining module 22 determines whether there is a second target port that meets the preset type and whose path information includes the preset character in the plurality of second target ports, if the determining module 22 determines that there is a second target port that meets the preset type and whose path information includes the preset character in the plurality of second target ports, the determining module 23 determines that the path information enumerates the second target port is successful, and determines that the path information enumerates the second target port is successful.
Optionally, the first enumeration module 21 enumerates path names of all USB device ports, wherein the USB device must be of STORAGE type or CDROM type, and the path name contains "prod _ android _ phone" to be valid.
Fig. 11 is a schematic diagram of a device for starting a debugging mode according to an embodiment of the present invention. As shown in fig. 11, the device for turning on the debug mode may include: a first enumeration unit 10, a second enumeration unit 20, a first setup unit 30 and a sending unit 40. Wherein the second enumeration unit 20 includes: a second enumeration module 24.
It should be noted that the first enumeration unit 10, the second enumeration unit 20, the first establishing unit 30, and the sending unit 40 in this embodiment are the same as the schematic diagram of the device debugging mode starting apparatus in the embodiment shown in fig. 8, and are not described herein again.
A second enumeration module 24, configured to enumerate a plurality of second target ports in sequence until path information of the second target ports is successfully enumerated, where: under the condition that any one second target port is enumerated, judging whether the second target port accords with a preset type or not, and judging whether the path information comprises preset characters or not; and when the enumerated second target port is judged to accord with the preset type and the path information is judged to comprise the preset character, determining that the path information of the second target port is enumerated successfully.
Optionally, the second target port is a USB port, and the second enumeration module 24, when enumerating to any USB port, determines whether the USB port is a STORAGE type or a CDROM type, and determines whether a path name of the USB port includes "prod _ android _ phone", and if the USB port is a STORAGE type or a CDROM type, and determines that the path name of the USB port includes "prod _ android _ phone", determines that the path name enumerates the USB port successfully.
Fig. 12 is a schematic diagram of a device for starting a debugging mode according to an embodiment of the present invention. As shown in fig. 12, the device for turning on the debug mode may include: a first enumeration unit 10, a second enumeration unit 20, a first setup unit 30 and a sending unit 40. The device also includes: a determination unit 80.
The determining unit 80 is configured to determine that the first terminal and the second terminal are not connected when enumeration of the path information of the second target port fails after enumeration of the path information of the second target port.
After the second enumeration unit 20 enumerates the path information of the second target port, if the second enumeration unit 20 does not enumerate the path information of the second target port, it indicates that the first terminal is not connected to the second terminal, the determining unit 80 determines that the first terminal is not connected to the second terminal, and displays a prompt message for indicating that the first terminal is not connected to the second terminal, for example, when the second terminal is a mobile phone, displays "mobile phone is not connected", and further prompts the user to take further solution measures.
Fig. 13 is a schematic diagram of a device for starting a debugging mode according to an embodiment of the present invention. As shown in fig. 13, the device for turning on the debug mode may include: a first enumeration unit 10, a second enumeration unit 20, a first setup unit 30 and a sending unit 40. Wherein, the first establishing unit 30 includes: a building block 31. The transmission unit 40 includes: a sending module 41.
And the establishing module 31 is used for establishing a communication pipeline with the second terminal through the path information.
The establishing module 31 establishes a communication pipe with the second terminal through the path information, the sending process sends a large amount of data into the communication pipe in a character stream form, and the receiving process can receive data from the communication pipe. The opening instruction is used for opening a preset debugging mode of the second terminal.
And a sending module 41, configured to send an open instruction to the second terminal through the communication pipe.
The sending module 41 sends the start instruction to the second terminal through the communication pipeline, and sends the start instruction to the second terminal through the communication pipeline established between the path information and the second terminal, and the second terminal automatically starts the preset debugging mode after receiving the start instruction, so that the technical effect of simplifying the operation flow of starting the device debugging mode is achieved, and the technical problem that the operation flow of starting the device debugging mode in the related art is complex is solved.
Optionally, the first terminal is a computer device, the second terminal is an android device, the first target port is an ADB port, and the second target port is a USB port.
Optionally, the first enumeration unit 10 is configured to enumerate an ADB port of the android device when the computer device receives a connection instruction for instructing to connect the android device, where the ADB port is used to establish a communication connection with the android device; the second enumeration unit 20 is configured to enumerate path information of a USB port of the android device when enumeration of the ADB port fails, so as to send an open instruction for opening a USB debug mode of the android device to the android device through the USB port; the first establishing unit 30 is configured to establish a communication connection with the android device through path information when enumeration of the path information of the USB port is successful; the sending unit 40 is used for sending an opening instruction to the android device through communication connection, so that the android device opens a USB debugging mode according to the opening instruction, the matching relation between hardware information and machine types is avoided from being collected and mapped, meanwhile, the steps of designing and customizing the display according to the machine types are avoided, the problem that the technical cost is high is caused, the problem that error prompt is caused due to the fact that the new machine types cannot be matched in an online mode at the first time is avoided, customized adaptation does not need to be made for various versions of the android device, and the operation maintenance cost is greatly reduced. According to the embodiment, the user does not need to participate, the user experience is greatly improved, the technical effect of simplifying the operation flow of starting the equipment debugging mode is achieved, and the technical problem that the operation flow of starting the equipment debugging mode in the related technology is complex is solved.
It should be noted that the first enumeration unit 10 in this embodiment may be configured to execute step S302 in embodiment 1 of this application, the second enumeration unit 20 in this embodiment may be configured to execute step S304 in embodiment 1 of this application, the first establishing unit 30 in this embodiment may be configured to execute step S306 in embodiment 1 of this application, and the sending unit 40 in this embodiment may be configured to execute step S308 in embodiment 1 of this application.
It should be noted here that the above units and modules are the same as the examples and application scenarios realized by the corresponding steps, but are not limited to the disclosure of the above embodiment 1. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
In this embodiment, when a first terminal receives a connection instruction for instructing connection of a second terminal, a first enumeration unit 10 enumerates a first target port of the second terminal, where the first target port is used to establish a communication connection with the second terminal, and when the enumeration of the first target port fails, a second enumeration unit 20 enumerates path information of a second target port of the second terminal, so as to send an open instruction for opening a preset debug mode of the second terminal to the second terminal through the second target port, and when the enumeration of the path information of the second target port succeeds, a first establishment unit 30 establishes a communication connection with the second terminal through the path information, and a sending unit 40 sends an open instruction to the second terminal through the communication connection, so that the second terminal opens the preset debug mode according to the open instruction, thereby achieving the purpose of opening the preset debug mode of the device, therefore, the technical effect of simplifying the operation flow of starting the equipment debugging is achieved, and the technical problem that the operation flow of starting the equipment debugging mode in the related technology is complex is solved.
It should be noted here that the above units and modules are the same as the examples and application scenarios realized by the corresponding steps, but are not limited to the disclosure of the above embodiment 1. It should be noted that the modules described above as a part of the apparatus may be run in a hardware environment as shown in fig. 2, may be implemented by software, and may also be implemented by hardware, where the hardware environment includes a network environment.
Example 4
According to the embodiment of the invention, the invention also provides a network or a terminal for implementing the starting method of the debugging mode of the equipment.
Fig. 14 is a block diagram of a terminal according to an embodiment of the present invention. As shown in fig. 14, the terminal may include: one or more processors 141 (only one of which is shown), memory 143, and transmission means 145, as shown in fig. 14, the terminal may further include input and output devices 147.
The memory 143 may be configured to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for starting the debug mode of the device in the embodiment of the present invention, and the processor 141 executes various functional applications and data processing by running the software programs and modules stored in the memory 143, that is, the method for starting the debug mode of the device is implemented. Memory 143 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 143 may further include memory located remotely from processor 141, which may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 145 is used for receiving or transmitting data via a network, and may also be used for data transmission between the processor and the memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 145 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 145 is a Radio Frequency (RF) module for communicating with the internet by wireless.
Wherein, in particular, the memory 143 is used for storing application programs.
Processor 141 may invoke an application stored in memory 143 via transport 145 to perform the following steps:
when a first terminal receives a connection instruction for indicating connection with a second terminal, enumerating a first target port of the second terminal, wherein the first target port is used for establishing communication connection with the second terminal;
under the condition that enumeration of the first target port fails, enumerating path information of a second target port of the second terminal so as to send a starting instruction for starting a preset debugging mode of the second terminal to the second terminal through the second target port;
under the condition that enumeration of the path information of the second target port is successful, establishing communication connection with the second terminal through the path information;
and sending a starting instruction to the second terminal through the communication connection so that the second terminal starts a preset debugging mode according to the starting instruction.
Processor 141 is also configured to perform the following steps: after sending the opening instruction to the second terminal through the communication connection, receiving the connection instruction again; enumerating the first target port after receiving the connection instruction; and under the condition that the enumeration of the first target port is successful, establishing communication connection with the second terminal through the first target port.
Processor 141 is also configured to perform the following steps: enumerating a plurality of second target ports; under the condition that a plurality of second target ports are enumerated, judging whether the second target ports which accord with the preset type and the path information comprises preset characters exist in the plurality of second target ports; and if the second target ports which accord with the preset type and the path information comprises the preset characters exist in the plurality of second target ports, determining that the path information enumerating the second target ports is successful.
Processor 141 is also configured to perform the following steps: sequentially enumerating a plurality of second target ports until path information of the second target ports is successfully enumerated, wherein: under the condition that any one second target port is enumerated, judging whether the second target port accords with a preset type or not, and judging whether the path information comprises preset characters or not; and if the enumerated second target port is judged to be in accordance with the preset type and the path information is judged to comprise the preset character, determining that the path information enumerating the second target port is successful.
Processor 141 is also configured to perform the following steps: after enumerating the path information of the second target port, determining that the first terminal and the second terminal are not connected under the condition that the enumeration of the path information of the second target port fails.
Processor 141 is also configured to perform the following steps: establishing a communication pipeline with the second terminal through the path information; sending the open command to the second terminal over the communication connection includes: and sending an opening instruction to the second terminal through the communication pipeline.
By adopting the embodiment of the invention, the scheme for starting the debugging mode of the equipment is provided, when the first terminal receives the connection instruction for indicating the connection of the second terminal, a first target port of the second terminal is enumerated, wherein the first target port is used for establishing communication connection with the second terminal; under the condition that enumeration of the first target port fails, enumerating path information of a second target port of the second terminal so as to send a starting instruction for starting a preset debugging mode of the second terminal to the second terminal through the second target port; under the condition that enumeration of the path information of the second target port is successful, establishing communication connection with the second terminal through the path information; the starting instruction is sent to the second terminal through the communication connection, so that the second terminal starts the preset debugging mode according to the starting instruction, the purpose of starting the preset debugging mode of the equipment is achieved, the technical effect of simplifying the operation flow of starting equipment debugging is achieved, and the technical problem that the operation flow of starting the equipment debugging mode in the related technology is complex is solved.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 14 is only an illustration, and the terminal may be a terminal device such as an intelligent Android device (e.g., an Android device, an iOS Android device, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 14 is a diagram illustrating a structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 14, or have a different configuration than shown in FIG. 14.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Example 5
The embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the storage medium may be used to execute a program code of a method for turning on a debug mode of a device.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
when a first terminal receives a connection instruction for indicating connection with a second terminal, enumerating a first target port of the second terminal, wherein the first target port is used for establishing communication connection with the second terminal;
under the condition that enumeration of the first target port fails, enumerating path information of a second target port of the second terminal so as to send a starting instruction for starting a preset debugging mode of the second terminal to the second terminal through the second target port;
under the condition that enumeration of the path information of the second target port is successful, establishing communication connection with the second terminal through the path information;
and sending a starting instruction to the second terminal through the communication connection so that the second terminal starts a preset debugging mode according to the starting instruction.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after sending the opening instruction to the second terminal through the communication connection, receiving the connection instruction again; enumerating the first target port after receiving the connection instruction; and under the condition that the enumeration of the first target port is successful, establishing communication connection with the second terminal through the first target port.
Optionally, the storage medium is further arranged to store program code for performing the steps of: enumerating a plurality of second target ports; under the condition that a plurality of second target ports are enumerated, judging whether the second target ports which accord with the preset type and the path information comprises preset characters exist in the plurality of second target ports; and if the second target ports which accord with the preset type and the path information comprises the preset characters exist in the plurality of second target ports, determining that the path information enumerating the second target ports is successful.
Optionally, the storage medium is further arranged to store program code for performing the steps of: sequentially enumerating a plurality of second target ports until path information of the second target ports is successfully enumerated, wherein: under the condition that any one second target port is enumerated, judging whether the second target port accords with a preset type or not, and judging whether the path information comprises preset characters or not; and if the enumerated second target port is judged to be in accordance with the preset type and the path information is judged to comprise the preset character, determining that the path information enumerating the second target port is successful.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after enumerating the path information of the second target port, determining that the first terminal and the second terminal are not connected under the condition that the enumeration of the path information of the second target port fails.
Optionally, the storage medium is further arranged to store program code for performing the steps of: establishing a communication pipeline with the second terminal through the path information; sending the open command to the second terminal over the communication connection includes: and sending an opening instruction to the second terminal through the communication pipeline.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, network or network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed target client can be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (12)
1. A method for starting a debugging mode of a device is characterized by comprising the following steps:
when a first terminal receives a connection instruction for indicating connection with a second terminal, enumerating a first target port of the second terminal, wherein the first target port is used for establishing communication connection with the second terminal;
under the condition that enumeration of the first target port fails, enumerating path information of a second target port of the second terminal so as to send a starting instruction for starting a preset debugging mode of the second terminal to the second terminal through the second target port;
under the condition that enumeration of the path information of the second target port is successful, establishing communication connection with the second terminal through the path information;
sending the starting instruction to the second terminal through the communication connection so that the second terminal starts the preset debugging mode according to the starting instruction;
enumerating path information for the second target port of the second terminal includes:
sequentially enumerating a plurality of second target ports until path information of the second target ports is successfully enumerated, wherein:
under the condition that any one second target port is enumerated, judging whether the second target port accords with a preset type or not, and judging whether the path information comprises preset characters or not;
and if the enumerated second target port is judged to be in accordance with the preset type and the path information is judged to comprise the preset character, determining that the path information enumerating the second target port is successful.
2. The method of claim 1, wherein after sending the turn-on instruction to the second terminal over the communication connection, the method further comprises:
receiving the connection instruction again;
enumerating the first target port after receiving the connection instruction;
and under the condition that enumeration of the first target port is successful, establishing communication connection with the second terminal through the first target port.
3. The method of claim 1, wherein enumerating path information for the second target port of the second terminal comprises:
enumerating a plurality of second target ports;
under the condition that the plurality of second target ports are enumerated, judging whether the second target ports which accord with a preset type exist in the plurality of second target ports, wherein the path information comprises the second target ports of preset characters;
and if the second target ports which accord with the preset type and the path information comprises the second target ports of the preset characters are judged to exist in the plurality of second target ports, determining that the path information enumerating the second target ports is successful.
4. The method of claim 1, wherein after enumerating path information for the second target port, the method further comprises:
and under the condition that the path information of the second target port is not enumerated, determining that the first terminal is not connected with the second terminal.
5. The method of claim 1,
establishing a communication connection with the second terminal through the path information includes: establishing a communication pipeline with the second terminal through the path information;
sending the open instruction to the second terminal over the communication connection comprises: and sending the starting instruction to the second terminal through the communication pipeline.
6. The method according to any one of claims 1 to 5, wherein the first terminal is a computer device, the second terminal is an android device, the first target port is an ADB port, and the second target port is a USB port.
7. An apparatus for starting a commissioning mode of a device, comprising:
the terminal comprises a first enumeration unit, a second enumeration unit and a third enumeration unit, wherein the first enumeration unit is used for enumerating a first target port of a second terminal when a first terminal receives a connection instruction for indicating connection of the second terminal, and the first target port is used for establishing communication connection with the second terminal;
a second enumeration unit, configured to enumerate path information of a second target port of the second terminal under a condition that enumeration of the first target port fails, so as to send, to the second terminal through the second target port, a start instruction for starting a preset debug mode of the second terminal;
a first establishing unit, configured to establish a communication connection with the second terminal through the path information when enumeration of the path information of the second target port is successful;
a sending unit, configured to send the start instruction to the second terminal through the communication connection, so that the second terminal starts the preset debugging mode according to the start instruction;
the second enumeration unit includes:
a second enumeration module, configured to enumerate a plurality of second target ports in sequence until path information of the second target ports is successfully enumerated, where: under the condition that any one second target port is enumerated, judging whether the second target port accords with a preset type or not, and judging whether the path information comprises preset characters or not; and when the enumerated second target port is judged to accord with the preset type and the path information is judged to comprise the preset character, determining that the path information enumerating the second target port is successful.
8. The apparatus of claim 7, further comprising:
a receiving unit configured to receive the connection instruction again after transmitting the open instruction to the second terminal through the communication connection;
a third enumeration unit, configured to enumerate the first target port after receiving the connection instruction;
and a second establishing unit, configured to establish a communication connection with the second terminal through the first target port when enumeration of the first target port is successful.
9. The apparatus of claim 7, wherein the second enumeration unit comprises:
a first enumeration module for enumerating a plurality of second target ports;
a determining module, configured to determine whether a second target port that meets a preset type exists in the plurality of second target ports when the plurality of second target ports are enumerated, where the path information includes a second target port of a preset character;
and the determining module is configured to determine that enumeration of the path information of the second target port is successful when it is determined that the second target port which conforms to the preset type and includes the preset character exists in the plurality of second target ports.
10. The apparatus of claim 7, wherein after enumerating path information for the second target port, the apparatus further comprises:
a determining unit, configured to determine that the first terminal and the second terminal are not connected when enumeration of path information of the second target port fails.
11. The apparatus of claim 7,
the first establishing unit includes: the establishing module is used for establishing a communication pipeline with the second terminal through the path information;
the transmission unit includes: and the sending module is used for sending the opening instruction to the second terminal through the communication pipeline.
12. The apparatus according to any one of claims 7 to 11, wherein the first terminal is a computer device, the second terminal is an android device, the first target port is an ADB port, and the second target port is a USB port.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710135014.8A CN108572929B (en) | 2017-03-07 | 2017-03-07 | Method and device for starting debugging mode of equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710135014.8A CN108572929B (en) | 2017-03-07 | 2017-03-07 | Method and device for starting debugging mode of equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108572929A CN108572929A (en) | 2018-09-25 |
CN108572929B true CN108572929B (en) | 2022-01-04 |
Family
ID=63577018
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710135014.8A Active CN108572929B (en) | 2017-03-07 | 2017-03-07 | Method and device for starting debugging mode of equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108572929B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110764840B (en) * | 2019-09-29 | 2023-11-03 | 望海康信(北京)科技股份公司 | Method, device and system for wirelessly debugging android device |
CN110753051B (en) * | 2019-10-22 | 2021-06-22 | 四川长虹电器股份有限公司 | Outdoor intelligent advertising machine safety debugging system and debugging method |
CN114070721B (en) * | 2021-11-16 | 2023-07-28 | 中国联合网络通信集团有限公司 | Module information determining method, terminal and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103064812A (en) * | 2012-12-24 | 2013-04-24 | 珠海市君天电子科技有限公司 | Method and device for quick connection of mobile device and computer |
CN104834612A (en) * | 2015-04-20 | 2015-08-12 | 杭州魔品科技有限公司 | Method for enabling USB debugging mode in Android mobile phone |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150370680A1 (en) * | 2014-06-20 | 2015-12-24 | Halo-Digi Technology Co., Ltd. | Method for transmitting human input event and electrical device |
-
2017
- 2017-03-07 CN CN201710135014.8A patent/CN108572929B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103064812A (en) * | 2012-12-24 | 2013-04-24 | 珠海市君天电子科技有限公司 | Method and device for quick connection of mobile device and computer |
CN104834612A (en) * | 2015-04-20 | 2015-08-12 | 杭州魔品科技有限公司 | Method for enabling USB debugging mode in Android mobile phone |
Also Published As
Publication number | Publication date |
---|---|
CN108572929A (en) | 2018-09-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102662697B (en) | Software upgrading method and device | |
CN107820603A (en) | A kind of firmware update and controller | |
CN108572929B (en) | Method and device for starting debugging mode of equipment | |
CN106020875B (en) | Firmware update management method and device of embedded terminal | |
CN103605529B (en) | The treating method and apparatus of application program | |
CN103970566A (en) | Router firmware updating method and device | |
CN106201563A (en) | The method and apparatus that the collocation method of start-up parameter and device, mainboard start | |
WO2010133051A1 (en) | Method and device for auto-adapting wireless data cards of multiple modes | |
CN110493028A (en) | A kind of clustered deploy(ment) method, system, device and computer readable storage medium | |
CN103164237A (en) | Firmware upgrade method and system | |
CN103200022B (en) | A kind of data download abnormality eliminating method, equipment and system | |
CN105589699A (en) | Serial number information update method, device and terminal | |
CN103092648B (en) | A kind of image upgrade method, system and subscriber equipment and personal computer | |
CN111756858A (en) | Remote development processing system, method and device of embedded equipment | |
CN113360379B (en) | Program test environment creation method and program test environment creation apparatus | |
CN112817883A (en) | Method, device and system for adapting interface platform and computer readable storage medium | |
CN112015651A (en) | Data processing method and device | |
KR101102316B1 (en) | Application providing device, system and method for instolling application in mobile device using the same, and mobile device thereof | |
CN109039765B (en) | Network configuration method and device | |
JP2006113754A (en) | Software update device and method | |
CN115766429A (en) | Matching method and device of system and edge computing gateway | |
CN115469964A (en) | Method and device for determining mapping relation between block device and virtual machine disk character | |
CN111638896B (en) | Upgrade method, upgrade device, storage medium, processor and mobile terminal | |
CN112423068A (en) | Smart television debugging method and device, mobile terminal and readable storage medium | |
CN113051178A (en) | Test data construction method, device, equipment and medium |
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 |