Remote debugging method, device and equipment for equipment
By establishing a signaling channel between the client and server of the IoT device, receiving and forwarding Android debugging ADB instructions, the problem of inefficient debugging caused by the diversity of IoT devices and off-site distribution is solved, and convenient remote ADB is realized debug.
Patent Information
- Application Number
- CN202310087448.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-13
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2043-01-13
AI Technical Summary
In platforms with complex ecological environment, the diversity of IoT devices leads to the acceptance and debugging of hardware and software that requires a lot of manpower, inefficiency, and lack of convenient remote debugging solutions.
By establishing a signaling channel between the client and server of the IoT device, receiving and forwarding Android debugging ADB instructions, and obtaining and executing the listening port, remote ADB debugging of IoT devices is realized.
It realizes convenient remote ADB debugging, reduces manpower consumption, improves debugging efficiency, and is suitable for diverse and off-site distribution of IoT devices.
Smart Images

Figure CN116132490B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a remote debugging method, apparatus and device for a device. Background Art
[0002] With the development of IoT devices, the types of hardware and software of IoT devices are becoming more and more diverse. In some platforms with complex ecological environments, when they are connected to multiple suppliers at the same time, they have to conduct hardware and software acceptance and debugging of the devices provided by these suppliers. If such acceptance and debugging are all done face-to-face in the local area network, it is obviously very labor-intensive and inefficient.
[0003] Based on this, a convenient remote debugging solution for the device is needed. Summary of the invention
[0004] The embodiments of this specification provide a remote debugging solution for a device to solve the following technical problem: a convenient remote debugging solution for a device is required.
[0005] To solve the above technical problems, one or more embodiments of this specification are implemented as follows:
[0006] In a first aspect, an embodiment of the present specification provides a remote debugging method for a device, which is applied to a client in an Internet of Things device, and the method includes: establishing a signaling channel with a server; receiving an Android debugging ADB instruction forwarded by the server through the signaling channel; obtaining a listening port; and passing the ADB instruction to the listening port so that the Internet of Things device obtains and executes the ADB instruction from the listening port.
[0007] In a second aspect, an embodiment of the present specification provides a remote debugging method for a device, which is applied to a server, and the method includes: establishing a signaling channel with a client in an IoT device; receiving an Android debugging ADB command sent by a debugging device; and forwarding the ADB command to the IoT device through the signaling channel.
[0008] In a third aspect, corresponding to the first aspect, an embodiment of the present specification provides a remote debugging device for a device, which is applied to a client in an Internet of Things device, and the device includes: a first establishment module, which establishes a signaling channel with a server; a first receiving module, which receives an Android debugging ADB instruction forwarded by the server through the signaling channel; a first acquisition module, which acquires a listening port; and a first sending module, which passes the ADB instruction to the listening port so that the Internet of Things device acquires and executes the ADB instruction from the listening port.
[0009] In a fourth aspect, an embodiment of the present specification provides a remote debugging device for a device, which is applied to a server, and the device includes: a second establishment module, which establishes a signaling channel with a client in an Internet of Things device; a second acquisition module, which receives an Android debugging ADB instruction sent by the debugging device; and a second sending module, which forwards the ADB instruction to the Internet of Things device through the signaling channel.
[0010] In a fifth aspect, an embodiment of the present specification provides an electronic device, including:
[0011] at least one processor; and,
[0012] a memory communicatively connected to the at least one processor; wherein,
[0013] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect or the second aspect.
[0014] In a sixth aspect, an embodiment of the present specification provides a non-volatile computer storage medium storing computer executable instructions. When a computer reads the computer executable instructions in the storage medium, the instructions enable one or more processors to execute the method described in the first aspect or the second aspect.
[0015] At least one of the above-mentioned technical solutions adopted in one or more embodiments of the present specification can achieve the following beneficial effects: by establishing a signaling channel with the server; receiving the Android debugging ADB command forwarded by the server through the signaling channel; obtaining the listening port; passing the ADB command to the listening port, so that the IoT device can obtain and execute the ADB command from the listening port, thereby realizing remote ADB debugging of the IoT device, which is more convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0017] Figure 1 A schematic diagram of the architecture of the system provided in the embodiments of this specification;
[0018] Figure 2 A flowchart of a remote debugging method for a device provided in an embodiment of this specification;
[0019] Figure 3 A schematic diagram of a port mapping provided in an embodiment of this specification;
[0020] Figure 4 A flow engineering diagram of another remote debugging method for a device provided in an embodiment of this specification;
[0021] Figure 5 A schematic diagram of the structure of a remote debugging device for a device is provided for an embodiment of this specification;
[0022] Figure 6 A schematic diagram of the structure of another remote debugging device for a device provided in an embodiment of this specification;
[0023] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0024] The embodiments of this specification provide a remote debugging method, apparatus, device, and storage medium for a device.
[0025] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0026] With the development of the Internet, the types of IoT devices are becoming more and more diverse. This diversity is reflected in the diversity of the hardware and software of IoT devices (for example, the operating systems carried by IoT devices). At this time, when an open platform needs to connect to multiple types of Internet devices, it is inevitable that it needs to be compatible with these IoT devices at the same time. Once an update occurs, these different types of IoT devices need to be debugged one by one (including testing and acceptance, etc.).
[0027] This update may be bidirectional, that is, after the hardware or software of the IoT device itself is updated, the platform needs to be aligned and debugged; after the relevant functions in the platform are updated, the IoT devices (possibly multiple) connected to it also need to be debugged to see if the updated functions can adapt to these IoT devices. These IoT devices often belong to different manufacturers and are widely distributed in physical space.
[0028] At present, the debugging of devices is usually carried out in a local area network using Android debugbridge (ADB), and it is often necessary to go to these different manufacturers to test in person. When the platform's ecological environment is complex and the number of manufacturers is large, it takes a lot of manpower and material resources, which is very inconvenient. Based on this, the embodiments of this specification provide a convenient remote debugging solution for devices.
[0029] like Figure 1 As shown, Figure 1 This is a schematic diagram of the architecture of the system provided in the embodiments of this specification. In this diagram, there are three parts in total: a client on the IoT device, a server on the management device, and an ADB service.
[0030] Among them, there may be multiple different types of IoT devices (for example, IoT device 1 and IoT device N) at the same time, and the same client is installed in these different types of IoT devices.
[0031] The management device includes a server corresponding to the client, and communicates with the multiple IoT devices simultaneously through the server. Usually, the management device and the IoT devices are in different places and it is difficult to connect directly through a local area network.
[0032] The ADB test device is also connected to the server in the management device. The debugger can issue debugging instructions in the ADB test device and receive the returned debugging results for analysis. In addition, the ADB test device can be the same device as the management device. That is, the management device can provide the functions of the server and the ADB test at the same time.
[0033] The following describes the client and server in the aforementioned system respectively.
[0034] In the first aspect, Figure 2 As shown, Figure 2 A flowchart of a remote debugging method for a device provided in an embodiment of this specification is applied to a client in an Internet of Things device, and the method includes:
[0035] S201, establish a signaling channel with the server.
[0036] The IoT devices in the embodiments of this specification generally refer to Android devices, and the hardware and software functions of Android devices are not specifically limited. A client with corresponding functions can be pre-installed on the Android device. The corresponding functions should at least include the following two functions: establishing a signaling channel with the server, and forwarding ADB commands to the Android device.
[0037] Signaling refers to the control instructions in the communication system, which can establish a temporary communication channel (i.e., signaling channel) between designated terminals (i.e., between the client and the management device) and maintain the normal operation of the network itself. The transmission of signaling must comply with certain regulations and rules, i.e., signaling protocols and signaling methods, which can be agreed upon in advance.
[0038] In the embodiment of the present application, the signaling is transmitted through a pre-configured port number. For example, when the server is open to the outside, by configuring port mapping, the form of port mapping can be (access port, internal port). Among them, the access port provides the function of connecting to the client externally, and the internal port provides the function of connecting to the ADB debugging service.
[0039] The corresponding access port is provided to the outside, and the client establishes a signaling channel with the server through the access port. The server receives and sends data from the client through the access port. Furthermore, the server forwards all data from the access port to the internal port and forwards it to the ADB debugging device through the aforementioned port mapping, thereby establishing a complete signaling channel.
[0040] like Figure 3 As shown, Figure 3 This is a schematic diagram of a port mapping provided in an embodiment of this specification. This port mapping can support the server to open multiple external access ports at the same time. In addition, an internal port can also support mapping with multiple external ports at the same time.
[0041] S203, receiving the Android debugging ADB instruction forwarded by the server through the signaling channel.
[0042] As mentioned above, the server itself does not have the ADB function. The server receives the Android debugging ADB commands sent from the debugging device and forwards them through the signaling channel. After the signaling channel is established, the ADB commands sent from the debugging device will be accessed through the internal port of the server and forwarded to the client through the aforementioned signaling channel to be received by the client.
[0043] S205, obtaining a listening port.
[0044] The monitoring port is the port in the IoT device that uses the ADB program to monitor the execution process and execution results when executing the ADB command. For example, in the usual default situation, the ADB port can be 5555.
[0045] However, in actual applications, in order to adapt to the diversity of IoT devices, users can configure most ADB listening ports by themselves and save or upload the configuration results locally in advance.
[0046] Therefore, when obtaining the listening port, the corresponding listening port can be directly obtained locally. Alternatively, the user informs the server of the listening port in advance, and the server updates the configuration, obtains the updated listening port from the server, and saves it locally, and then the updated listening port can be obtained locally.
[0047] For example, the listening port in the default mode may be "5555", but in some devices, the port may be occupied or prohibited. In that case, the listening port number may be configured in advance on the server to be another port. Usually, the other port may be a less used port. For example, a port number with a larger numerical value "10001" may be used as the updated listening port, and then the client obtains the updated listening port 10001 and saves it locally, so that the updated listening port 10001 is obtained locally when forwarding ADB instructions.
[0048] In one implementation, after configuring the listening port, the server can also carry the listening port in the ADB instruction, so that the client can directly obtain the listening port carried by the ADB instruction. In this implementation, in order to achieve the correspondence of the ADB function, the internal port configured in the port mapping is usually used as the ADB listening port.
[0049] For example, after the server configures the port mapping to (80, 10001), the client communicates with the server through port 80, and the server communicates with the debugging device through port 10001. In this case, the internal port number "10001" has already identified the function of this signaling channel: it is used to implement ADB command debugging. Therefore, the internal port number "10001" in the port mapping configured by the server can be carried in the ADB command. When the client receives the ADB command, it can use the internal port number "10001" as the listening port for the IoT device to implement ADB debugging, thereby achieving accurate routing distribution.
[0050] S207: pass the ADB instruction to the listening port so that the IoT device obtains and executes the ADB instruction from the listening port.
[0051] ADB commands can include device startup and shutdown commands (including connection, device viewing, disconnection, restart, root, etc.), device application commands (including viewing applications, installing / uninstalling applications, clearing application data), logs, screenshots / recording, backups, and stress testing, etc. These commands can be used to implement UI automation testing, DEBUG testing, and compatibility testing.
[0052] After the IoT device executes these instructions, it will generate corresponding execution results, and then the client can obtain the execution results of the ADB instructions from the listening port; and send the execution results to the management device through the aforementioned signaling channel, which is forwarded to the ADB debugging device by the management device, thereby realizing remote debugging.
[0053] The first part of the above describes the execution process of the client. In the second aspect, Figure 4 As shown, Figure 4 A flow engineering diagram of a remote debugging method for another device provided in an embodiment of this specification is applied to a server, and the method includes:
[0054] S401, establishing a signaling channel with a client in an IoT device.
[0055] As mentioned above, the device where the server is located can establish a signaling channel with the client in various forms.
[0056] In particular, when the device where the server is located and the IoT device are in different places and cannot be connected to the local area network, in a specific implementation, this signaling channel is realized through the aforementioned port mapping. That is, when the server is open to the outside, by configuring the port mapping, the form of the port mapping can be (access port, internal port). Among them, the access port provides the function of connecting to the client externally, and the internal port provides the function of connecting to the ADB debugging service. In other words, in this way, the signaling channel is established based on the "access port" contained in the pre-configured port mapping.
[0057] S403, receiving an Android debugging ADB instruction sent by the debugging device.
[0058] The debugging device can provide ADB debugging functions to multiple external IoT devices at the same time. The server device receives ADB instructions based on the communication connection established in advance with the debugging device. This communication connection can be implemented based on IP address, domain name or port.
[0059] In one embodiment, the debugging device can be the same device as the device where the server is located, that is, the device where the server is located can also provide ADB services to the outside. In this embodiment, the signaling channel established based on port mapping can actually be implemented by configuring two port numbers on the server.
[0060] As mentioned above, the form of port mapping can be (access port, internal port). At this time, when the debugging device can be the same device as the device where the server is located, the access port can be any port, which is used to provide the function of external docking client, and the internal port is the port of the ADB service. The port of the ADB service is generally a fixed port by default.
[0061] When the user needs to modify the port of the ADB service, the user can use the corresponding ADB command to modify it. For example, the user can use "ANDROID_ADB_SERVER_PORT, 10001" to modify the port number of the ADB service to "10001".
[0062] S405: forwarding the ADB instruction to the IoT device through the signaling channel.
[0063] For example, when the signaling channel is established based on the port mapping, the command issued by the ADB service flows out through the aforementioned internal port, and the server can obtain the ADB command based on the segment port mapping, and send the ADB command through the aforementioned port mapping through the "external port", and then send the ADB command to the IoT device based on the signaling channel established by the "external port".
[0064] After the client in the IoT device receives the ADB command, it can be executed on the device where the client is located and generate a corresponding execution result. Then, the execution result returned by the client can be received through the signaling channel and forwarded to the debugging device.
[0065] In one implementation, the management device may simultaneously connect to multiple different IoT devices using one system or application (for example, the same application A may be installed on these different IoT devices), and these IoT devices are in different physical spaces.
[0066] If the system or application is iterated, it is necessary to test the compatibility of the new credit on these devices. In the conventional way, the multiple IoT devices need to be tested one by one in the local area network. In the scheme of the present application, the following method can be adopted: first configure the aforementioned port mapping, and the multiple devices establish a signaling channel with the device where the server is located through the aforementioned port mapping; then forward the ADB instructions to the corresponding multiple IoT devices through the multiple signaling channels; accordingly, forward the execution results to the debugging device, including: forwarding the received multiple execution results to the debugging device, so that the debugging device can test the compatibility of the multiple IoT devices.
[0067] For example, there are three IoT devices located in Beijing, Shanghai, and Hangzhou. The ADB service device and the server device are the same device, and the default port of the ADB service is 10001.
[0068] At this time, when the compatibility test of these three devices is required, the one-to-one port mapping (80, 10001), (90, 10001), (100, 10001) can be pre-configured. The three IoT devices in Beijing, Shanghai and Hangzhou are accessed through three external ports respectively to establish a signaling connection with the server. Among them, the access port in Beijing is 80, the access port in Shanghai is 90, and the access port in Hangzhou is 100. The one-to-one correspondence here refers to the one-to-one correspondence between the access port in the configured port mapping and the IoT device.
[0069] When the ADB service issues an ADB command, it flows out through port 10001, and based on the aforementioned three port mappings, the ADB command is forwarded simultaneously through ports 80, 90, and 100. In this way, the aforementioned three IoT devices can receive the ADB command through their respective channels and execute it.
[0070] After the execution result is generated, the client on the IoT device obtains the execution result based on the listening port, and returns the command result to the access port of the server based on the respective signaling channels. At this time, the server sends the execution results received based on access ports 80, 90 and 100 to port 10001 through the port mapping, so that the ADB service can obtain the multiple execution results at the same time through port 10001, and test the compatibility of the multiple IoT devices based on the execution results.
[0071] In addition, in this way of testing the compatibility of multiple IoT devices, the IoT device corresponding to the execution result can also be identified through the one-to-one correspondence between the external port number and the IoT device. Continuing with the previous example, if the test result returned by port 80 received by the debugging device fails, this one-to-one correspondence can quickly locate that it is the IoT device in Beijing that failed the compatibility test, thereby achieving a fast ADB compatibility test.
[0072] In a third aspect, corresponding to the first aspect, the embodiments of this specification further provide a remote debugging device for a device. Figure 5 As shown, Figure 5 A schematic diagram of a remote debugging device for a device is provided for an embodiment of the present specification, and is applied to a client in an IoT device. The device includes:
[0073] The first establishment module 501 establishes a signaling channel with the server;
[0074] A first receiving module 503 receives an Android debugging ADB instruction forwarded by the server through the signaling channel;
[0075] The first acquisition module 505 acquires the monitoring port;
[0076] The first sending module 507 transmits the ADB instruction to the listening port so that the IoT device obtains and executes the ADB instruction from the listening port.
[0077] Optionally, the device further includes an updating module 509, and the server obtains an updated listening port and stores it locally; correspondingly, the first obtaining module 505 obtains the updated listening port locally.
[0078] Optionally, when the Android debugging ADB instruction carries a listening port, the first acquisition module 505 acquires the listening port carried by the ADB instruction, wherein the listening port is determined based on the port mapping configured by the server.
[0079] Optionally, the first sending module 507 obtains the execution result of the ADB instruction from the listening port; and sends the execution result to the management device through the signaling channel.
[0080] In a third aspect, corresponding to the second aspect, the embodiments of this specification also provide another remote debugging device for a device. Figure 6 As shown, Figure 6 A schematic diagram of a remote debugging device for another device provided in an embodiment of this specification is applied to a server, and the device includes:
[0081] A second establishing module 601 is used to establish a signaling channel with a client in the IoT device;
[0082] The second receiving module 603 receives an Android debugging ADB command sent by the debugging device;
[0083] The second forwarding module 605 forwards the ADB instruction to the IoT device through the signaling channel.
[0084] Optionally, the second establishing module 601 establishes a signaling channel with a client in the IoT device based on a preconfigured port mapping.
[0085] Optionally, the second forwarding module 605 receives the execution result returned by the client through the signaling channel, and forwards the execution result to the debugging device.
[0086] Optionally, when there are multiple signaling channels, the second forwarding module 605 forwards the ADB instructions to the corresponding multiple IoT devices through the multiple signaling channels respectively, and forwards the received multiple execution results to the debugging device, so that the debugging device can test the compatibility of the multiple IoT devices.
[0087] like Figure 7 As shown, Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification, the device includes:
[0088] at least one processor; and,
[0089] a memory communicatively connected to the at least one processor; wherein,
[0090] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect or the second aspect.
[0091] Based on the same idea, an embodiment of this specification also provides a non-volatile computer storage medium corresponding to the above method, storing computer executable instructions. When the computer reads the computer executable instructions in the storage medium, the instructions enable one or more processors to execute the method described in the first aspect or the second aspect.
[0092] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0093] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0094] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0095] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0096] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0097] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0098] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0099] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0100] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0101] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0102] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0103] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0104] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0105] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0106] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0107] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.
Claims
1. A remote debugging method for a device, applied to a client in an Internet of Things device, the method include: Establish a signaling channel with the server. The server is on the management device and corresponds to the client. The server itself does not have ADB function. Receive the Android debugging ADB command forwarded by the server through the signaling channel, wherein, when the server is open to the outside, by configuring port mapping, the port mapping is in the form of an access port and an internal port, the access port provides a function of connecting to an external client, and the internal port provides a function of connecting to an ADB debugging service. Through the aforementioned port mapping, the server forwards all data from the access port to the internal port, and the ADB command issued by the debugging device will be accessed through the internal port of the server; Get the listening port; The ADB instruction is passed to the listening port so that the IoT device obtains and executes the ADB instruction from the listening port.
2. The method according to claim 1, in, The method further comprises: Obtaining an updated listening port from the server and saving it locally; Correspondingly, obtaining the listening port includes: obtaining an updated listening port from the local.
3. The method according to claim 1, in, When the Android debugging ADB instruction carries a listening port, obtaining the listening port includes: The listening port carried by the ADB instruction is obtained, wherein the listening port is determined based on the port mapping configured by the server.
4. The method according to claim 1, in, The method further comprises: Obtaining the execution result of the ADB command from the monitoring port; The execution result is sent to the management device through the signaling channel.
5. A remote debugging method for a device, applied to a server, the method include: Establish a signaling channel with the client in the IoT device. The server is on the management device. The server corresponds to the client and does not have the ADB function. Receive the Android debugging ADB command sent by the debugging device; The ADB command is forwarded to the IoT device through the signaling channel, wherein, when the server is open to the outside, port mapping is configured, and the port mapping is in the form of an access port and an internal port. The access port provides a function of connecting to an external client, and the internal port provides a function of connecting to an ADB debugging service. Through the aforementioned port mapping, the server forwards all data from the access port to the internal port, and the ADB command issued from the debugging device will be accessed through the internal port of the server.
6. The method of claim 5, establishing a signaling channel with a client in an IoT device, include: Based on the pre-configured port mapping, a signaling channel is established with the client in the IoT device.
7. The method according to claim 5, in, The method further comprises: The execution result returned by the client is received through the signaling channel, and the execution result is forwarded to the debugging device.
8. The method according to claim 7, in, When there are multiple signaling channels, forwarding the ADB instruction to the IoT device through the signaling channel includes: Forwarding the ADB command to the corresponding multiple IoT devices respectively through the multiple signaling channels; Correspondingly, forwarding the execution result to the debugging device includes: forwarding the received multiple execution results to the debugging device so that the debugging device tests the compatibility of the multiple Internet of Things devices.
9. A remote debugging device for a device, applied to a client in an Internet of Things device, the device include: The first establishment module establishes a signaling channel with the server. The server is on the management device and corresponds to the client. The server itself does not have the ADB function. A first receiving module receives the Android debugging ADB command forwarded by the server through the signaling channel, wherein, when the server is open to the outside, port mapping is configured, and the port mapping is in the form of an access port and an internal port. The access port provides a function of connecting to an external client, and the internal port provides a function of connecting to an ADB debugging service. The server forwards all data from the access port to the internal port through the aforementioned port mapping, and the ADB command issued by the debugging device is accessed through the internal port of the server; The first acquisition module acquires the listening port; The first sending module transmits the ADB instruction to the listening port so that the Internet of Things device obtains and executes the ADB instruction from the listening port.
10. A remote debugging device for a device, applied to a server, wherein the device include: The second establishment module establishes a signaling channel with the client in the IoT device. The server is on the management device. The server corresponds to the client, and the server itself does not have the ADB function. The second acquisition module receives the Android debugging ADB command sent by the debugging device; The second sending module forwards the ADB command to the IoT device through the signaling channel, wherein, when the server is open to the outside, by configuring port mapping, the port mapping is in the form of access port and internal port, the access port provides the function of connecting to the external client, and the internal port provides the function of connecting to the ADB debugging service. Through the aforementioned port mapping, the server forwards all data from the access port to the internal port, and the ADB command issued by the debugging device will be accessed through the internal port of the server.
11. An electronic device, include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
