Method for controlling terminal equipment to open USB debugging mode and control equipment

By controlling the device to detect and start the driver, the path node that opens the USB debugging mode is automatically executed, which solves the cumbersome problem of manually turning on the USB debugging mode in the existing technology, and realizes that the debugging mode is automatically turned on without manual participation, improving work efficiency.

CN119556839APending Publication Date: 2025-03-04XIAMEN MEIYABAIKE INFORMATION SECURITY RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411734177.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The USB debugging mode of existing Android phones needs to be manually turned on in the settings menu. The process is cumbersome and the brand is different, especially in large-scale mobile phone collection and remote debugging scenarios, which reduces work efficiency.

Method used

By controlling the device to detect the target terminal device, start the driver to perform simulated touch operations, determine and execute the path nodes required to open the USB debugging mode, and achieve automated opening.

Benefits of technology

The USB debugging mode of the target terminal device can be automatically turned on without manual participation, avoiding the tedious process of manual operation and improving work efficiency, especially in frequent development and testing environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119556839A_ABST
    Figure CN119556839A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information communication, in particular to a method for controlling terminal equipment to open a USB debugging mode and control equipment, and the method comprises the steps: controlling target terminal equipment to start a drive program under the condition that the target terminal equipment connected with the control equipment is detected; target path information corresponding to the target terminal equipment is determined, the target path information comprises M path nodes needed for opening a USB debugging mode of the target terminal equipment, the path nodes are used for indicating control information in a page, needing to be clicked, of the target terminal equipment, and M is a positive integer; and according to the control information respectively indicated by the M path nodes, implementing a simulation touch operation on the target terminal equipment so as to control the target terminal equipment to open a USB debugging mode. According to the method, the USB debugging mode of the target terminal equipment can be automatically started without manual participation, the tedious process of manually starting the debugging mode is avoided, and the working efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of information communication, and in particular to a method and a control device for controlling a terminal device to turn on a USB debugging mode in the technical field of information communication. Background Art

[0002] Currently, the debugging mode of the Universal Serial Bus (USB) of most Android phones requires users to manually enable it in the developer options in the settings menu. This process is not only cumbersome, but also different for each brand. For non-technical personnel, it is difficult to find and enable this option, and sometimes they need to use the Internet to search for the enabling method. Especially in the scenario of large-scale mobile phone collection and remote debugging, frequent manual enabling operations reduce work efficiency. Summary of the invention

[0003] The object of the present invention is to provide a method and a control device for controlling a terminal device to turn on a USB debugging mode. The technical solution adopted is as follows:

[0004] In a first aspect, an embodiment of the present invention provides a method for controlling a terminal device to turn on a USB debugging mode, which is applied to a control device, and the method includes:

[0005] When a target terminal device connected to the control device is detected, controlling the target terminal device to start a driver program, wherein the driver program is used by the control device to perform a simulated touch operation on the target terminal device;

[0006] Determine target path information corresponding to the target terminal device, wherein the target path information includes M path nodes required for opening a USB debugging mode of the target terminal device, the path nodes are used to indicate control information in a page of the target terminal device to be clicked, and M is a positive integer;

[0007] A simulated touch operation is performed on the target terminal device according to the control information respectively indicated by the M path nodes to control the target terminal device to turn on the USB debugging mode.

[0008] In a second aspect, a control device is provided, the control device comprising:

[0009] A control module, configured to, when a target terminal device connected to the control device is detected, control the target terminal device to start a driver program, wherein the driver program is used by the control device to perform a simulated touch operation on the target terminal device;

[0010] A determination module, used to determine target path information corresponding to the target terminal device, wherein the target path information includes M path nodes required for opening the USB debugging mode of the target terminal device, and the path nodes are used to indicate the control information in the page of the target terminal device to be clicked, and M is a positive integer;

[0011] An operation module is used to perform a simulated touch operation on the target terminal device according to the control information respectively indicated by the M path nodes, so as to control the target terminal device to turn on the USB debugging mode.

[0012] According to a third aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.

[0013] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the first aspect or any possible implementation manner described in the first aspect.

[0014] The present invention has the following beneficial effects: when a control device detects a target terminal device connected to the control device, the control device controls the target terminal device to start a driver program, and the driver program is used by the control device to implement a simulated touch operation on the target terminal device; then, the target path information corresponding to the target terminal device is determined, wherein the target path information includes M path nodes required for opening the USB debugging mode of the target terminal device, and the path nodes are used to indicate the control information in the page of the target terminal device to be clicked, and M is a positive integer; in this way, by determining the target path information, the M path nodes required for opening the USB debugging mode of the target terminal device can be clearly determined, so as to accurately obtain the control information in the page of the target terminal device to be clicked; so as to implement a simulated touch operation on the target terminal device according to the control information respectively indicated by the M path nodes, so as to control the target terminal device to open the USB debugging mode. In this way, by simulating a virtual mouse, according to the control information indicated by the M path nodes, a simulated operation is implemented on the display interface of the target terminal device to control the target terminal device to open the USB debugging mode. In this way, the control device simulates the operation of the target terminal device by simulating a virtual mouse, and automatically obtains the M path nodes required to open the USB debugging mode of the target terminal device; thereby, the control information indicated by the M path nodes is used to perform automated motor operation on the display interface of the target terminal device, and the USB debugging mode of the target terminal device can be automatically turned on without human intervention, avoiding the tedious process of manually turning on the debugging mode, especially in an environment where development and testing are frequently performed, greatly improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0016] Figure 1 It is a schematic diagram of an implementation flow of a method for controlling a terminal device to turn on a USB debugging mode provided by an embodiment of the present invention;

[0017] Figure 2 It is another implementation flow diagram of a method for controlling a terminal device to turn on a USB debugging mode provided by an embodiment of the present invention;

[0018] Figure 3 It is another implementation flow diagram of a method for controlling a terminal device to turn on a USB debugging mode provided by an embodiment of the present invention;

[0019] Figure 4 It is another implementation flow diagram of a method for controlling a terminal device to turn on a USB debugging mode provided by an embodiment of the present invention;

[0020] Figure 5 It is a schematic diagram of the structure of a control device provided by an embodiment of the present invention;

[0021] Figure 6 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0022] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the method for controlling a terminal device to turn on the USB debugging mode according to the present invention, its specific implementation, structure, features and effects, in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0023] Among them, in the description of the embodiments of the present invention, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a way to describe the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present invention, "multiple" refers to two or more than two.

[0024] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0025] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0026] The following is a detailed description of a method for controlling a terminal device to turn on a USB debugging mode provided by the present invention in conjunction with the accompanying drawings. Figure 1 , which shows a schematic diagram of an implementation flow of a method for controlling a terminal device to turn on a USB debugging mode provided by an embodiment of the present invention, which is applied to a control device, and the method includes:

[0027] 101. When a target terminal device connected to the control device is detected, control the target terminal device to start a driver program.

[0028] Here, the driver is used by the control device to implement simulated touch operation on the target terminal device. If the USB controller of the control device detects the target terminal device connected to the control device, the driver is started by simulating a virtual mouse to control the target terminal device.

[0029] The target terminal device may be a mobile phone, a computer or a tablet computer, etc. The control device may be a forensic device of the target terminal device.

[0030] In some possible implementations, the control device is connected to the target terminal device through a USB interface. For the target terminal device, based on the USB interfaces of the target terminal device and the control device, the target terminal device is physically connected to the control device; and the USB controller of the control device is used to detect whether the target terminal device is connected. Here, the target terminal device (for example, an Android phone) is physically connected to the control device through a USB interface, and the USB controller of the control device detects whether the target terminal device is connected, so that the USB controller can quickly determine whether a physical connection is established with the target terminal device. In the case of detecting the target terminal device connected to the control device, a virtual mouse is simulated through a data exchange adapter so that the virtual mouse is connected to the target terminal device. Here, if the USB controller of the control device detects that the target terminal device is connected, the target terminal device is connected by using an OTG adapter to simulate a physical keyboard and mouse, that is, simulated as a virtual mouse to access the target terminal device. In this way, by connecting the target terminal device using an OTG adapter, the control device is simulated as a virtual mouse, so that the target terminal device can be accessed through the virtual mouse to achieve control of the target terminal device.

[0031] If the USB controller of the control device detects that the target terminal device has been connected, it connects to the target terminal device by using an "On-the-Go" (OTG) adapter and simulates a virtual mouse to access the target terminal device, thereby facilitating automatic operations on the target terminal device through the virtual mouse.

[0032] 102. Determine target path information corresponding to the target terminal device.

[0033] Here, the target path information includes M path nodes required for opening the USB debugging mode of the target terminal device, and the path nodes are used to indicate the control information in the page of the target terminal device that needs to be clicked, and M is a positive integer;

[0034] The control device pre-stores the path information corresponding to various types of terminal devices, and the path information corresponding to the terminal devices includes the path node information required for opening the USB debugging mode of the terminal devices. For example, first obtain the opening paths of the USB debugging mode of multiple types of mobile phones; then write the opening paths into the control device in the form of a configuration program. In this way, by presetting the detailed opening paths for opening the USB debugging mode of each brand of mobile phone on the control device, an automated configuration program for opening the USB debugging mode can be constructed on the control device.

[0035] In some possible implementations, the above step 102 can be performed by Figure 2 The steps shown achieve:

[0036] 201. Send a model acquisition instruction to the target terminal device.

[0037] Here, the control device sends a model acquisition instruction to the target terminal device, so that the target terminal device feeds back the model of the target terminal device in response to the model acquisition instruction.

[0038] 202. Receive model information of the target terminal device sent by the target terminal device.

[0039] Here, the model information of the target terminal device includes: brand, series, model and version number of the target terminal device.

[0040] 203. Use the path information corresponding to the model information as the target path information.

[0041] Here, since the control device pre-stores the path information corresponding to various types of terminal devices, after receiving the model information fed back by the target terminal device, the corresponding path information can be found according to the model information, that is, the target path information is obtained. In this way, the control device sends a model acquisition instruction to the target terminal device, and then according to the model information of the target terminal device, the control device can find the path information that matches the model information in the path information pre-stored in the control terminal, so as to accurately obtain the target path information.

[0042] 103 , performing a simulated touch operation on the target terminal device according to the control information respectively indicated by the M path nodes, so as to control the target terminal device to turn on a USB debugging mode.

[0043] Here, through the virtual mouse, simulated touch operations are gradually performed on the target terminal device according to the control information respectively indicated by the M path nodes, so as to control the target terminal device to turn on the USB debugging mode.

[0044] In some possible implementations, the above step 103 can be performed by Figure 3 The steps shown achieve:

[0045] 301. Use the first path node among the M path nodes as the current path node.

[0046] Here, according to the model information of the target terminal device, the target path information is found in the path information corresponding to the various models of terminal devices pre-stored in the control device, and the traversal is started from the first path node of the M path nodes included in the target path information to turn on the USB debugging mode of the target terminal device.

[0047] 302 : Send a screenshot instruction to the target terminal device, so that the target terminal device captures the current page image of the target terminal device according to the screenshot instruction.

[0048] Here, the virtual mouse sends a screenshot command to the target terminal device via OTG, and the target terminal device triggers the screenshot shortcut command. The control device accesses the target terminal device by simulating a virtual mouse, thereby automatically controlling the display screen of the target terminal device through the virtual mouse to take a screenshot of the display interface of the target terminal device, thereby obtaining the current page image of the target terminal device.

[0049] 303: Get the current page image.

[0050] Here, based on the media file transfer protocol, the file system of the target terminal device is browsed; and the virtual mouse is controlled to obtain the current page image of the target terminal device from the file system. For example, the virtual mouse browses the file system on the target terminal device through the media file transfer protocol (MTP), obtains the current page image saved in the file system, and copies the current page image from the target terminal device to the control device.

[0051] In some possible implementations, the virtual mouse automatically controls the operation interface of the target terminal device to trigger the operation interface of the target terminal device to generate a screenshot instruction, thereby obtaining the current page image. For example, the virtual mouse sends a keyboard instruction key value to the target terminal device via OTG to trigger the target terminal device to generate a screenshot instruction, thereby automatically taking a screenshot of the display interface of the target terminal device and obtaining the current page image of the target terminal device. In this way, the control device automatically controls the operation interface of the target terminal device by simulating the virtual mouse, thereby being able to accurately obtain the current page image of the target terminal device.

[0052] In some possible implementations, the operation control device of the target terminal device loads the corresponding driver, identifies and processes the virtual mouse, and implements the virtual mouse input to control the cursor movement, click, drag and other operations on the screen of the target terminal device, thereby triggering the target terminal device to generate a screenshot instruction in the operation interface. After the target terminal device generates the screenshot instruction, it automatically takes a screenshot in response to the screenshot instruction to obtain the current page image. In this way, the operation interface of the target terminal device is automatically controlled by the virtual mouse, and operations such as clicking are automatically performed to trigger the generation of the screenshot instruction, so that the current page image of the target terminal device can be accurately obtained.

[0053] In some possible implementations, first, in response to the screenshot instruction, the target terminal device is controlled to generate the current page image and save it in the file system; for example, after the target terminal device is triggered to generate the screenshot instruction, the target terminal device automatically generates the current page image and saves it in the file system of the target terminal device; then, the virtual mouse is used to browse the file system of the target terminal device based on the media file transfer protocol; finally, the virtual mouse is used to read the current page image from the file system. In this way, the virtual mouse reads the current page image from the file system of the target terminal device through the MTP protocol, so that the current page image can be accurately copied to the control device corresponding to the virtual mouse.

[0054] 304 : Identify target control information to be clicked indicated by the current path node from the current page image.

[0055] Here, image recognition is performed on the current page image to obtain the control identifier indicated by the current path node and the position of the control identifier in the current interface of the target terminal device; and the control identifier and the position are determined as the target control information. For example, after obtaining the current page image of the target terminal device, the control device combines optical character recognition (OCR) technology or image search technology to identify the control corresponding to the current page image and the position of the control in the current interface (i.e., the coordinate point in space on the current interface), thereby obtaining the target control information of the target terminal device. If the recognition fails, it means that the current target terminal device does not support the automatic opening of the USB debugging model.

[0056] 305 , controlling the virtual mouse on the target terminal device to move to a position corresponding to the target control information, and performing a simulated click operation, so that the target terminal device switches pages in response to the simulated click operation.

[0057] Here, after the target control information is identified in the current page image, the virtual mouse is controlled to move according to the coordinate points of each control in the target control information on the current page, and a simulated click operation is performed on the current page of the target terminal device to execute M path nodes one by one, and a page switch is performed each time a path node is executed.

[0058] In some possible implementations, the control device simulates a virtual mouse to simulate mouse operations on the display screen of the target terminal device according to the USB controls and control coordinate points. For example, it simulates clicks, drags, and cursor movements on the display screen of the target terminal device according to the USB controls and control coordinate points, so that the target terminal device switches pages in response to the simulated click operations.

[0059] 306 , determining whether the traversal of the M path nodes is completed.

[0060] Here, each time after a path node is executed, it is determined whether M path nodes have been traversed to determine whether the current path node is empty. If the current path node is empty, it indicates that the USB debugging mode of the target terminal device has been turned on.

[0061] 307, if the traversal of the M path nodes is not completed, the next path node is used as a new current path node, and the step of sending a screenshot instruction to the target terminal device to the step of determining whether the traversal of the M path nodes is completed is re-executed.

[0062] Here, if the M path nodes have not been traversed, it means that the USB debugging mode of the target terminal device has not been turned on, then the next path node is executed through the virtual mouse, that is, return to step 302, and repeat steps 302 to 307 until all M path nodes are traversed, that is, until the current path node is determined to be empty, and the traversal is ended.

[0063] 308. If the traversal of the M path nodes is completed, it is determined that the USB debugging mode of the target terminal device is turned on.

[0064] Here, the target terminal device is connected to the control device, and the control device can realize the simulated click operation on the space of the target terminal device, wherein the control can be a button in the display page of the target terminal device, and the path node here can be a pre-set click step, and the USB debugging mode of the target terminal device can be turned on by clicking the steps, for example, the first step is to click the first control, and the second step is to click the second control. When the click steps are all completed, that is, the path nodes are all traversed, and the path nodes are empty at this time, the purpose of turning on the USB debugging mode of the target terminal device is achieved. In this way, the automatic click on the screen of the target terminal device is realized by the control device until the USB debugging mode of the target terminal device is turned on.

[0065] In an embodiment of the present invention, when a control device detects a target terminal device connected to the control device, the control device controls the target terminal device to start a driver program, and the driver program is used by the control device to implement a simulated touch operation on the target terminal device; then, the target path information corresponding to the target terminal device is determined, wherein the target path information includes M path nodes required for opening the USB debugging mode of the target terminal device, and the path nodes are used to indicate the control information in the page of the target terminal device to be clicked, and M is a positive integer; in this way, by determining the target path information, the M path nodes required for opening the USB debugging mode of the target terminal device can be clearly determined, so as to accurately obtain the control information in the page of the target terminal device to be clicked; so as to implement a simulated touch operation on the target terminal device according to the control information respectively indicated by the M path nodes, so as to control the target terminal device to open the USB debugging mode. In this way, by simulating a virtual mouse, according to the control information indicated by the M path nodes, a simulated operation is implemented on the display interface of the target terminal device to control the target terminal device to open the USB debugging mode. In this way, the control device simulates the operation of the target terminal device by simulating a virtual mouse, and automatically obtains the M path nodes required to open the USB debugging mode of the target terminal device; thereby, the control information indicated by the M path nodes is used to perform automated motor operation on the display interface of the target terminal device, and the USB debugging mode of the target terminal device can be automatically turned on without human intervention, avoiding the tedious process of manually turning on the debugging mode, especially in an environment where development and testing are frequently performed, greatly improving work efficiency.

[0066] In some possible implementations, taking the target terminal device as a mobile phone as an example, a method for controlling a terminal device to turn on a USB debugging mode provided by an embodiment of the present invention can be performed by Figure 4 The steps shown achieve:

[0067] 401, construct an automated configuration program for opening the USB debugging mode on the control device.

[0068] Among them, an automated configuration program for opening the USB debugging mode is built on the control device, and the detailed path for opening the USB debugging mode for target terminal devices of various brands is preset.

[0069] 402, physically connect the target terminal device to the control device via the USB interface.

[0070] 403, the target terminal device transfers files with the control device through the MTP protocol.

[0071] Here, the target terminal device selects the MTP file transfer mode, and the device uses the USB controller to transmit data with the target terminal device based on the MTP protocol.

[0072] 404, the control device simulates a virtual mouse to connect to the target terminal device through OTG.

[0073] Here, the control device uses an OTG adapter to connect to the target terminal device to simulate the connected device into a physical keyboard and mouse. When the target terminal device detects the device connection, it starts device identification. The operation control device of the target terminal device loads the corresponding driver, identifies and processes the virtual mouse, and implements mouse input to control the cursor movement, click, drag and other operations on the screen of the target terminal device.

[0074] 405 , the control device obtains the current page image of the target terminal device through the MTP protocol.

[0075] Here, the control device (simulating a virtual mouse) sends the keyboard command key value to the target terminal device via OTG, and the target terminal device triggers the screenshot shortcut command. The control device browses the file control device on the mobile phone via the MTP protocol, obtains the current page image saved in step 405, and copies the screenshot file from the target terminal device to the device.

[0076] 406 , the control device identifies the control and the control coordinate point corresponding to the interface screenshot.

[0077] 407, controlling the device to execute mouse sliding and clicking operations through the OTG method.

[0078] 408, the path node moves downward.

[0079] Here, the path node is moved down and jumps to step 405 to obtain the current path node. If the current path node is empty, it means that the USB debugging mode is turned on and the execution ends. Thus, automatic clicking on the screen of the target terminal device is realized until the USB debugging mode of the target terminal device is turned on.

[0080] The embodiment of the present invention avoids the tedious process of manually opening the debugging mode, which greatly improves work efficiency, especially in an environment where development and testing are frequently performed. Users do not need to go deep into the settings menu, which simplifies the debugging process and makes the opening of the debugging mode more intelligent and convenient. It is also suitable for scenarios such as large-scale mobile phone evidence collection and remote mobile phone debugging, which can significantly reduce manual intervention and improve the automation and efficiency of mobile phone evidence collection.

[0081] The present invention provides a control device. Figure 5 , which shows a schematic diagram of the composition structure of a control device provided by an embodiment of the present invention, the control device 500 includes:

[0082] The control module 501 is used to control the target terminal device to start a driver program when a target terminal device connected to the control device is detected, and the driver program is used for the control device to perform a simulated touch operation on the target terminal device;

[0083] A determination module 502 is used to determine target path information corresponding to the target terminal device, wherein the target path information includes M path nodes required for opening the USB debugging mode of the target terminal device, and the path nodes are used to indicate the control information in the page of the target terminal device to be clicked, and M is a positive integer;

[0084] The operation module 503 is used to perform a simulated touch operation on the target terminal device according to the control information respectively indicated by the M path nodes, so as to control the target terminal device to turn on the USB debugging mode.

[0085] In some possible implementations, the operation module 503 is also used to take the first path node among the M path nodes as the current path node; send a screenshot instruction to the target terminal device so that the target terminal device captures the current page image of the target terminal device according to the screenshot instruction; obtain the current page image; identify the target control information required to be clicked indicated by the current path node from the current page image; control the virtual mouse on the target terminal device to move to the position corresponding to the target control information, and perform a simulated click operation so that the target terminal device switches pages in response to the simulated click operation; determine whether the M path nodes have all been traversed; if the M path nodes have not been traversed, take the next path node as the new current path node, and re-execute the steps of sending the screenshot instruction to the target terminal device to the step of determining whether the M path nodes have all been traversed; if the M path nodes have all been traversed, determine that the USB debugging mode of the target terminal device has been turned on.

[0086] In some possible implementations, the operation module 503 is further used to browse the file system of the target terminal device based on the media file transfer protocol; and control the virtual mouse to obtain the current page image of the target terminal device from the file system.

[0087] In some possible implementations, the control device pre-stores path information corresponding to various types of terminal devices, respectively, and the path information corresponding to the terminal device includes information of path nodes required for opening a USB debugging mode of the terminal device;

[0088] The determination module 502 is further configured to send a model acquisition instruction to the target terminal device; receive the model information of the target terminal device sent by the target terminal device; and use the path information corresponding to the model information as the target path information.

[0089] In some possible implementations, the control device and the target terminal device are connected via a USB interface.

[0090] In some possible implementations, the control module 501 is further configured to, upon detecting a target terminal device connected to the control device, simulate a virtual mouse through a data exchange adapter so that the virtual mouse is connected to the target terminal device.

[0091] In some possible implementations, the operation module 503 is also used to perform image recognition on the current page image to obtain the control identifier indicated by the current path node and the position of the control identifier on the current interface of the target terminal device; and determine the control identifier and the position as the target control information.

[0092] Optionally, the transmission medium can be a wired link (for example, but not limited to, coaxial cable, optical fiber and digital subscriber line (DSL), etc.) or a wireless link (for example, but not limited to, wireless Fidelity (WIFI), Bluetooth and mobile device network, etc.). It should be noted that: the control device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the method embodiments provided in the above embodiments belong to the same concept. The specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0093] Figure 6 is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention. Figure 6 As shown, the computer device 600 includes: a memory 601, a processor 602, and a computer program 603 stored in the memory 601 and running on the processor 602, wherein when the processor 602 executes the computer program 603, the computer device can execute any one of the methods described above for controlling a terminal device to turn on a USB debugging mode.

[0094] In addition, an embodiment of the present invention also protects a control device, which may include a memory and a processor, wherein an executable program code is stored in the memory, and the processor is used to call and execute the executable program code to perform a method provided by an embodiment of the present invention to control a terminal device to turn on a USB debugging mode. This embodiment can divide the functional modules of the control device according to the above method example. For example, it can correspond to each functional module, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic, which is only a logical function division, and there may be other division methods in actual implementation. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.

[0095] It should be understood that the control device provided in this embodiment is used to execute the above-mentioned method of controlling a terminal device to turn on the USB debugging mode, so the same effect as the above-mentioned implementation method can be achieved. In the case of an integrated unit, the control device may include a processing module and a storage module. Among them, when the control device is applied to the device, the processing module can be used to control and manage the actions of the device. The storage module can be used to support the device to execute mutual program codes, etc. Among them, the processing module can be a processor or a controller, which can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of the present invention. The processor can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc., and the storage module can be a memory.

[0096] In addition, the control device provided in the embodiment of the present invention may be a chip, a component or a module, and the chip may include a connected processor and a memory; wherein the memory is used to store instructions, and when the processor calls and executes the instructions, the chip may execute a method for controlling a terminal device to turn on a USB debugging mode provided in the above embodiment. This embodiment also provides a computer-readable storage medium, in which a computer program code is stored, and when the computer program code is run on a computer, the computer executes the above-mentioned related method steps to implement a method for controlling a terminal device to turn on a USB debugging mode provided in the above embodiment.

[0097] The present embodiment also provides a computer program product, when the computer program product is run on a computer, the computer executes the above-mentioned related steps to implement a method for controlling a terminal device to open a USB debugging mode provided by the above embodiment. Among them, the control device, computer-readable storage medium, computer program product or chip provided in the present embodiment are all used to execute the corresponding method provided above, so the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here. Through the description of the above implementation mode, the technicians in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional modules as needed, that is, the internal structure of the control device is divided into different functional modules to complete all or part of the functions described above. In the embodiments provided by the present invention, it should be understood that the disclosed control device and method can be implemented in other ways. For example, the control device embodiment described above is only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another control device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, control device or unit, which may be electrical, mechanical or other forms.

[0098] It should be noted that the sequence of the above-mentioned embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The process depicted in the accompanying drawings does not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or may be advantageous. The various embodiments in this specification are described in a progressive manner, and the same and similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments. The above content is only a specific implementation method of the present invention, but the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered within the protection scope of the present invention.

Claims

1. A method for controlling a terminal device to turn on a USB debugging mode, characterized in that: Applied to a control device, the method comprises: When a target terminal device connected to the control device is detected, controlling the target terminal device to start a driver program, wherein the driver program is used by the control device to perform a simulated touch operation on the target terminal device; Determine target path information corresponding to the target terminal device, wherein the target path information includes M path nodes required for opening a USB debugging mode of the target terminal device, the path nodes are used to indicate control information in a page of the target terminal device to be clicked, and M is a positive integer; A simulated touch operation is performed on the target terminal device according to the control information respectively indicated by the M path nodes to control the target terminal device to turn on the USB debugging mode.

2. The method according to claim 1, characterized in that The performing a simulated touch operation on the target terminal device according to the control information respectively indicated by the M path nodes to control the target terminal device to turn on the USB debugging mode includes: Taking the first path node among the M path nodes as the current path node; Sending a screenshot instruction to the target terminal device, so that the target terminal device captures the current page image of the target terminal device according to the screenshot instruction; Get the current page image; Identify target control information required to be clicked indicated by the current path node from the current page image; Controlling the virtual mouse on the target terminal device to move to a position corresponding to the target control information, and performing a simulated click operation, so that the target terminal device switches pages in response to the simulated click operation; Determine whether the M path nodes are all traversed; If the M path nodes have not been traversed, the next path node is used as a new current path node, and the step of sending a screenshot instruction to the target terminal device to the step of determining whether the M path nodes have all been traversed is re-executed; If the M path nodes are all traversed, it is determined that the USB debugging mode of the target terminal device is turned on.

3. The method according to claim 2, characterized in that The obtaining of the current page image comprises: Based on the media file transfer protocol, browsing the file system of the target terminal device; The virtual mouse is controlled to obtain a current page image of the target terminal device from the file system.

4. The method according to claim 1, characterized in that: The control device pre-stores path information corresponding to various types of terminal devices, respectively, and the path information corresponding to the terminal device includes information of path nodes required for opening a USB debugging mode of the terminal device; The determining the target path information corresponding to the target terminal device includes: Sending a model acquisition instruction to the target terminal device; Receiving model information of the target terminal device sent by the target terminal device; The path information corresponding to the model information is used as the target path information.

5. The method according to claim 1, characterized in that: The control device is connected to the target terminal device via a USB interface.

6. The method according to claim 1, characterized in that The method further comprises: When a target terminal device connected to the control device is detected, a virtual mouse is simulated through a data exchange adapter so that the virtual mouse is connected to the target terminal device.

7. The method according to claim 2, characterized in that: The step of identifying target control information to be clicked indicated by the current path node from the current page image includes: Performing image recognition on the current page image to obtain a control identifier indicated by the current path node and a position of the control identifier on the current interface of the target terminal device; The control identifier and the position are determined as the target control information.

8. A control device, characterized in that: The control device comprises: A control module, configured to, when a target terminal device connected to the control device is detected, control the target terminal device to start a driver program, wherein the driver program is used by the control device to perform a simulated touch operation on the target terminal device; A determination module, used to determine target path information corresponding to the target terminal device, wherein the target path information includes M path nodes required for opening the USB debugging mode of the target terminal device, and the path nodes are used to indicate the control information in the page of the target terminal device to be clicked, and M is a positive integer; An operation module is used to perform a simulated touch operation on the target terminal device according to the control information respectively indicated by the M path nodes, so as to control the target terminal device to turn on the USB debugging mode.