Debugging method and device
By integrating a dynamic SDK into the target application and establishing a connection with the debugging end based on the CDP protocol, the problem of complicated debugging tool configuration in cross-platform frameworks is solved, and efficient and flexible debugging capabilities of the target application are achieved.
Patent Information
- Application Number
- CN202511903484.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-03-20
AI Technical Summary
Existing cross-platform frameworks have complex code debugging tool configurations, and the Chrome browser's Devtools tool only provides debugging capabilities for H5 pages or WebView pages, which is difficult to meet the debugging needs of various application scenarios.
By acquiring network information from the debugging end, and utilizing the dynamic software development kit (SDK) integrated in the target application, a logical connection is established with the debugging end based on the Browser Developer Tools Protocol (CDP), and debugging operations are performed on the target application in response to debugging commands.
It enables efficient debugging of target applications in cross-platform frameworks, simplifies the configuration process of debugging tools, and improves the flexibility and effectiveness of debugging.
Smart Images

Figure CN121705154A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and in particular to a debugging method and device. BACKGROUND
[0002] Currently, there are two kinds of Debugger debugging for code in cross-end frameworks: 1. using existing debugging tools, such as Android WebView, debugging through adb + chrome devtools. 2. developing based on CDP (ChromeDevTools Protocol) respectively, and debugging using Chrome browser Devtools tools through android adb or Hongmeng hdc, such as weex, react native, etc.
[0003] However, the adb service environment configuration is relatively complex, and the Chrome browser Devtools tool itself only provides debugger capability for H5 pages or WebView pages. SUMMARY
[0004] Embodiments of the present application provide a debugging method, device, equipment and storage medium.
[0005] According to a first aspect, embodiments of the present application provide a debugging method, which comprises: obtaining network information associated with a debugging terminal; establishing a logical connection with the debugging terminal based on the network information by using a dynamic software development kit (SDK) integrated in a target application, wherein the dynamic SDK is developed based on a browser developer tool protocol; and executing a debugging instruction on the target application in response to receiving the debugging instruction sent by the debugging terminal.
[0006] According to a second aspect, embodiments of the present application provide a debugging device, which comprises: an obtaining module, a connecting module and a debugging module, wherein the obtaining module is configured to obtain network information associated with a debugging terminal; the connecting module is configured to establish a logical connection with the debugging terminal based on the network information by using a dynamic software development kit (SDK) integrated in a target application, wherein the dynamic SDK is developed based on a browser developer tool protocol; and the debugging module is configured to execute a debugging instruction on the target application in response to receiving the debugging instruction sent by the debugging terminal.
[0007] According to a third aspect, embodiments of the present application provide a debugging system, which comprises: a debugging terminal and a terminal to be debugged, wherein the terminal to be debugged is configured to execute the debugging method of any of the embodiments of the first aspect; and the debugging terminal is configured to establish a logical connection with the terminal to be debugged and debug a target application of the terminal to be debugged.
[0008] According to a fourth aspect, the embodiments of the present application provide an electronic device, comprising one or more processors; a storage device having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the debugging method according to any one of the embodiments of the first aspect.
[0009] According to a fifth aspect, the embodiments of the present application provide a computer readable medium having a computer program stored thereon, the program being executed by a processor to implement the debugging method according to any one of the embodiments of the first aspect.
[0010] According to a sixth aspect, the embodiments of the present application provide a computer program product comprising a computer program, the computer program being executed by a processor to implement the debugging method according to any one of the embodiments of the first aspect.
[0011] The present application obtains network information associated with the debugging terminal; establishes a logical connection with the debugging terminal based on the network information and the dynamic software development kit (SDK) integrated in the target application, wherein the dynamic SDK is developed based on a browser developer tool protocol; in response to receiving a debugging instruction sent by the debugging terminal, executes the debugging instruction on the target application, that is, by integrating the dynamic SDK (i.e., a native cross-terminal framework, which can be implemented based on a native language such as Java, C++, JS, etc.) developed based on the CDP protocol into the target application being debugged, and establishing a logical connection with the debugging terminal based on the network information of the debugging terminal, the debugging of the target application is realized.
[0012] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0013] Figure 1 is an exemplary system architecture diagram in which the present application can be applied; Figure 2 is a flowchart of one embodiment of the debugging method according to the present application; Figure 3 is a flowchart of another embodiment of the debugging method according to the present application; Figure 4 is a schematic diagram of one application scenario of the debugging method according to the present application; Figure 5 is a flowchart of one embodiment of the debugging device according to the present application; Figure 6a is a flowchart of one embodiment of the debugging system according to the present application; Figure 6b is a flowchart of another embodiment of the debugging system according to the present application; Figure 6c is a flow chart of another embodiment of the debugging system according to the present application Figure 7 is a structural schematic diagram of a computer system of a server suitable for implementing embodiments of the present application. DETAILED DESCRIPTION
[0014] Exemplary embodiments of the present application are described herein below with reference to the accompanying drawings, in which various details of the present application are set forth to facilitate an understanding. It should be readily apparent to those of ordinary skill in the art that the embodiments described herein can be practiced without such details. Similarly, some
[0015] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
[0016] Figure 1 An exemplary system architecture 100 to which embodiments of the debugging method of the present application can be applied is shown.
[0017] As shown in Figure 1 The system architecture 100 can include debugged terminals 101, 102, 103, a network 104 and a debugger terminal 105. The network 104 is a medium to provide communication links between the debugged terminals 101, 102, 103 and the debugger terminal 105. The network 104 can include various connection types, such as wired, wireless communication links or fiber optic cables, etc.
[0018] The debugged terminals 101, 102, 103 interact with the debugger terminal 105 through the network 104 to receive or send messages, etc. Various application platforms can be installed on the debugged terminals 101, 102, 103.
[0019] The debugged terminals 101, 102, 103 or the debugger terminal 105 can be hardware or software. When the debugged terminals 101, 102, 103 or the debugger terminal 105 are hardware, they can be various electronic devices with display screens, including but not limited to mobile phones, notebook computers, scanning devices. When the debugged terminals 101, 102, 103 or the debugger terminal 105 are software, they can be installed in the above-mentioned electronic devices. They can be implemented as multiple software or software modules (e.g. to provide debugging services) or as a single software or software module. No specific limitation is made herein.
[0020] It should be noted that the debugging method provided by the embodiments of the present disclosure can be executed by the debugging terminal 105. Accordingly, each part (for example, each unit, subunit, module, and sub-module) included in the debugging device can be all arranged in the server 105, or can be arranged in the server 105 and the terminal devices 101, 102, and 103 respectively.
[0021] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the above-mentioned embodiments is only illustrative. According to the implementation needs, there can be any number of terminal devices, networks, and servers.
[0022] Figure 2 A flow 200 that can be applied to the embodiments of the debugging method of the present application is shown. In the present embodiment, the debugging method is applied to the debugging terminal, and can specifically include the following steps: Step 201: Obtain the network information associated with the debugging terminal.
[0023] In the present embodiment, the execution subject (for example, the server 105 shown in Figure 1 The manner in which the execution subject (for example, the server 105 shown in
[0024] The network information associated with the debugging terminal is the network information required for establishing a logical connection between the debugging terminal and the debugging terminal. The network information associated with the debugging terminal can be determined based on the local network information, or can be determined based on the debugging description information of the server connected by the debugging terminal, depending on the physical connection manner of the debugging terminal and the debugging terminal.
[0025] The network information can include an IP address, a port number, and the like.
[0026] In some optional manners, obtaining the network information associated with the debugging terminal includes: identifying an identification code displayed by the debugging terminal to obtain the network information associated with the debugging terminal.
[0027] In the present implementation manner, the network information associated with the debugging terminal can be represented by an identification code, for example, a two-dimensional code, a three-dimensional code, and the like. The execution subject can identify the identification code displayed by the debugging terminal by using an identification device to obtain the network information associated with the debugging terminal.
[0028] The type of the identification device corresponds to the type of the identification code.
[0029] Specifically, the type of the identification code is a two-dimensional code, and the identification device is a scanning device. The execution subject can scan the two-dimensional code displayed by the debugging terminal by using the scanning device to obtain the network information associated with the debugging terminal.
[0030] The implementation mode improves the efficiency and flexibility of obtaining network information by identifying the identification code displayed by the debugging terminal to obtain network information associated with the debugging terminal.
[0031] In step 202, a dynamic software development kit (SDK) integrated in the target application is used to establish a logical connection with the debugging terminal based on the network information.
[0032] In this embodiment, after obtaining the network information associated with the debugging terminal, the subject can use the dynamic software development kit (SDK) integrated in the target application to establish a logical connection with the debugging terminal based on the network information.
[0033] The dynamic SDK is a technology that allows an application to obtain and update configuration parameters or functional modules from a remote server at runtime. It enables the application to change its behavior without releasing a new version, thereby enhancing the flexibility, maintainability and scalability of the application.
[0034] Here, the dynamic SDK can be developed based on the browser developer tool protocol, such as CDP (Chrome DevTools Protocol), in combination with the language of the target application.
[0035] The language in the dynamic SDK can use JS language, i.e. JavaScript language, so the dynamic SDK can run in a JS virtual machine, which can be used to receive debugging pause, debugging continue and other protocol instructions, i.e. debugging instructions, and execute corresponding code operations.
[0036] Specifically, the dynamic SDK can be developed based on C++ to develop the CDP protocol, and a virtual machine interface layer is provided above the protocol layer to interface with the virtual machine to implement interfaces such as setting code pause, setting continue code, and obtaining source code. Each virtual machine interfaces with the interface to complete the complete implementation of the CDP protocol. In the CDP protocol layer, the code conversion part can provide a SourceMap code line analysis layer to convert the compiled code into source code lines, which can provide an interface to the virtual machine, which can be accessed according to its own situation.
[0037] Correspondingly, the debugging panel of the debugging terminal browser can be developed locally by Chrome DevTools Frontend, which can solve the problem of disorder of the inspect panel.
[0038] CDP is a remote debugging protocol that allows developers to communicate with a running Chrome browser to inspect the browser state, control its behavior, and collect debugging information. CDP can control not only the Chrome browser, but also any tool that implements the protocol, such as Node.js, Firefox (only in nightly version), and all Chromium-based browsers, such as 360 Extreme Browser, Opera, Edge, Sogou Browser, etc.
[0039] CDP mainly implements communication based on HTTP (HyperText Transfer Protocol) and Web logic. Specifically, the debugging port of the Chrome instance can be accessed through an HTTP request. For example, after starting the CDP service, the relevant information can be obtained by accessing "http: / / localhost:9222 / json / version" through the browser. HTTP is mainly responsible for overviewing the current Tabs information. The conversation of each Tab uses WebSocket to establish a connection and receive event messages of enabled domains. When Chromium / Chrome is started, it will start the CDP protocol server and print its WebSocket URL (Uniform Resource Locator) to STDERR (Standard Error). The client can create a WebSocket to connect to the URL and start sending CDP commands.
[0040] In step 203, in response to receiving the debugging instruction sent by the debugging terminal, the debugging instruction is executed on the target application.
[0041] In this embodiment, after the connection is established, if the execution subject receives the debugging instruction sent by the debugging terminal, the debugging instruction can be executed on the target application.
[0042] The debugging instruction can include various types, such as breakpoint pause, single-step execution, continue execution, etc.
[0043] In some optional manners, the method further includes generating, by the dynamic SDK, a debugging log based on the debugging process and sending the debugging log to the debugging terminal for display.
[0044] In this implementation, the execution subject can generate a debugging log based on the debugging process by using the dynamic SDK, and send the debugging log to the debugging terminal for display.
[0045] In addition, the execution subject can also use the dynamic SDK to develop other personalizations, for example, generating custom shortcut instructions using the dynamic SDK; configuring custom debugging functions using the dynamic SDK, and the like.
[0046] The implementation manner generates a debugging log based on a debugging process using the dynamic SDK and sends the debugging log to the debugging terminal for display, so that the debugging terminal can view the debugging process in a timely manner.
[0047] Figure 3 A flow 300 of an embodiment of the debugging method that can be applied to the present application is shown. In the present embodiment, the debugging method comprises the following steps: Step 301: Obtain network information associated with the debugging terminal.
[0048] In the present embodiment, the implementation details and technical effects of step 301 can be referred to the description of step 201, which will not be repeated here.
[0049] Step 302: Determine a target uniform resource locator (URL) based on the network information and a physical connection manner of the debugging terminal and the terminal being debugged.
[0050] In the present embodiment, the physical connection manner of the debugging terminal and the terminal being debugged can include data line connection, network connection, and the like, the data line connection can include Universal Serial Bus (USB) connection, Type-C connection, and the like, and the network type of the network connection can include local area network, wide area network, and the like.
[0051] Further, the execution subject can determine the target URL according to the network information and the physical connection manner of the debugging terminal and the terminal being debugged.
[0052] Specifically, if the debugging terminal and the terminal being debugged are connected through a USB data line, the network information can include a port number, and the execution subject can determine the target URL according to a localhost and the port number. If the debugging terminal and the terminal being debugged are connected through a network, the network information can include a port number and an IP address, and the execution subject can determine the target URL according to the port number and the IP address.
[0053] Step 303: Establish a logical connection with the debugging terminal using the dynamic SDK integrated in the target application based on the target URL.
[0054] In the present embodiment, after the target URL is determined, the execution subject can establish a logical connection with the debugging terminal using the dynamic SDK integrated in the target application according to the target URL, that is, establish a logical connection with the debugging terminal based on the CDP protocol according to the target URL.
[0055] Specifically, if the physical connection manner between the debugging end and the debugged end is a data line connection, after the debugging end and the debugged end establish a Socket connection, the debugging end can open a debugging browser through a preset script, for example, a shell script, jump to a debugging address, open a page indicated by the debugging address, and transmit a debugging instruction based on the CDP protocol after the page is opened.
[0056] In some optional manners, based on the target URL, a dynamic SDK integrated in the target application is utilized to establish a logical connection with the debugging end, including: a dynamic SDK integrated in the target application is utilized to establish a Socket connection with a server corresponding to the target URL.
[0057] In the implementation manner, if it is determined that the physical connection manner is a network connection and the network type is a wide area network, the associated network information can be determined based on the debugging description information of the server connected by the debugging end.
[0058] The execution subject can utilize a dynamic SDK integrated in the target application, that is, establish a Socket connection with a server corresponding to the target URL based on the CDP protocol.
[0059] Here, the debugging end also establishes a Socket connection with the server.
[0060] The server is configured to perform protocol forwarding between the debugging end and the debugged end to realize information relay between the debugging end and the debugged end.
[0061] Here, the protocol forwarding is a process in which a network device follows a specific communication rule (protocol) to deliver data from one node to the next node, that is, the server performs information relay between the debugging end and the debugged end based on the CDP protocol to establish a logical connection between the debugging end and the debugged end.
[0062] Further, after the debugging end and the debugged end both establish a Socket connection with the server, the execution subject can send an open browser instruction to the server, the server can forward the open browser instruction to the debugging end, and the debugging end can open a debugging browser through a preset script, for example, a shell script, jump to a debugging address, open a page indicated by the debugging address, and transmit a debugging instruction based on the CDP protocol after the page is opened.
[0063] The implementation manner establishes a Socket connection with a server corresponding to the target URL by utilizing a dynamic SDK integrated in the target application, and realizes network connection between the debugging end and the debugged end whose network type is a wide area network.
[0064] In some optional manners, based on the target URL, a logical connection is established between the dynamic SDK integrated in the target application and the debugging terminal, including: based on the target URL, a socket connection is established between the dynamic SDK integrated in the target application and the debugging terminal.
[0065] In the implementation manner, if it is determined that the physical connection manner is network connection and the network type is a local area network, the associated network information can be determined based on the network information of the debugging terminal.
[0066] The execution subject can establish a socket connection directly between the debugging terminal corresponding to the target URL based on the CDP protocol by using the dynamic SDK integrated in the target application.
[0067] Further, after the debugging terminal and the debugging terminal establish a socket connection, the debugging terminal can open a debugging browser through a preset script, for example, a shell script, jump to a debugging address, open a page indicated by the debugging address, and transmit a debugging instruction based on the CDP protocol after the page is opened.
[0068] The implementation manner establishes a socket connection between the debugging terminal corresponding to the target URL by using the dynamic SDK integrated in the target application, and establishes network connection between the debugging terminal and the debugging terminal of which the network type is a local area network.
[0069] In step 304, a debugging instruction sent by the debugging terminal is received, and the target application is executed according to the debugging instruction.
[0070] In the embodiment, the implementation details and technical effects of step 304 can be referred to the description of step 203, and will not be described here.
[0071] It can be seen from Figure 3 that, compared with Figure 2 the corresponding embodiment, the flow 300 of the debugging method in the embodiment determines a target uniform resource locator URL based on network information and a physical connection manner of the debugging terminal and the debugging terminal, establishes a logical connection between the dynamic SDK integrated in the target application and the debugging terminal based on the target URL, and executes a debugging instruction on the target application in response to receiving a debugging instruction sent by the debugging terminal, which improves the accuracy of the determined target URL and improves the effectiveness of debugging.
[0072] Further reference is made to Figure 4 , Figure 4 is a schematic diagram of an application scenario of the debugging method according to the embodiment.
[0073] The debugging client 401 can install a browser based on the Chrome protocol, such as Chrome, Chromium, or Microsoft Edge. The network information 402 associated with the debugging client 401 is represented by a QR code. The debugging client 401 displays the QR code, and the client being debugged 403, after recognizing the QR code, can determine the target URL 404 based on the network information. Based on the target URL, it uses the dynamic SDK 405 to establish a logical connection 406 with the debugging client. The dynamic SDK is developed based on the CDP protocol. After establishing the logical connection, the client being debugged can open the debugging service and send a browser discovery service request. The inspect page in the debugging client's browser displays the target application and its connection status. The debugging client can automatically open its browser and automatically redirect to the Devtools code debugging page, at which point the debugging function is complete. Furthermore, Devtools can send a request for source code and related CDP protocol information (protocol forwarding is performed over WAN) according to the CDP protocol. After receiving the message, the client being debugged sends the debugging source code and the CDP protocol for handling responses, such as pausing code breakpoint debugging. The current step and the entire subsequent interaction are protocol-level interactions. After the debugged end returns to the source code and the code is paused, the debugger displays a breakpoint.
[0074] Further reference Figure 5 As an implementation of the methods shown in the above figures, this application provides an embodiment of a debugging device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0075] like Figure 5 As shown, the debugging device 500 in this embodiment includes: an acquisition module 501, a connection module 502, and a debugging module 503.
[0076] The acquisition module 501 can be configured to acquire network information associated with the debugging terminal.
[0077] The connection module 502 can be configured to establish a logical connection with the debugging terminal based on network information using the dynamic software development kit (SDK) integrated in the target application. The dynamic SDK is developed based on the browser developer tools protocol.
[0078] The debugging module 503 can be configured to execute the debugging command on the target application in response to receiving the debugging command sent by the debugging terminal.
[0079] In some optional manners of the embodiment, the connection module further comprises a determination unit and a connection unit. The determination unit can be configured to determine a target uniform resource locator (URL) based on the network information and the physical connection manner between the debugging end and the debugged end. The connection unit can be configured to establish a logical connection between the debugging end and the debugging end by using the dynamic SDK integrated in the target application based on the target URL.
[0080] In some optional manners of the embodiment, the connection unit is further configured to establish a socket connection between the debugging end and the server corresponding to the target URL by using the dynamic SDK integrated in the target application.
[0081] In some optional manners of the embodiment, the connection unit is further configured to establish a socket connection between the debugging end and the server corresponding to the target URL by using the dynamic SDK integrated in the target application.
[0082] In some optional manners of the embodiment, the obtaining module is further configured to identify the identification code displayed by the debugging end to obtain the network information associated with the debugging end.
[0083] In some optional manners of the embodiment, the apparatus further comprises a sending module configured to generate a debugging log based on the debugging process by using the dynamic SDK, and send the debugging log to the debugging end for display.
[0084] Further referring to Figure 6a , as an implementation of the method shown in the above figures, the present disclosure provides an embodiment of a debugging system.
[0085] As shown in Figure 6a , the debugging system 600 of the embodiment comprises a debugging end and a debugged end.
[0086] The debugged end 601 is configured to perform the debugging method described in any of the above embodiments. The debugging end 602 is configured to establish a logical connection with the debugged end and debug the target application of the debugged end.
[0087] In some optional manners, the debugging end is further configured to, in response to determining that the physical connection manner between the debugging end and the debugged end is network connection and the network type is wide area network, determine and display the associated network information based on the debugging description information of the connected server. The server is configured to respectively establish a socket connection with the debugging end and the debugged end, and perform protocol forwarding between the debugging end and the debugged end.
[0088] In the implementation manner, the debugging end is further configured to, in response to determining that the physical connection manner between the debugging end and the debugged end is network connection and the network type is wide area network, determine and display the network information according to the debugging description information of the connected server.
[0089] The debugging description information is used to indicate, identify, locate, and configure the debugging target (such as a browser page, web application, or mini-program), and may include information such as IP address and port number.
[0090] The system also includes a server, which is used to establish Socket connections with both the debugging end and the debugged end, and to forward protocols between the debugging end and the debugged end to achieve information relay.
[0091] Specifically, such as Figure 6b As shown, the network type between the debugging end (such as a PC, i.e., a Personal Computer) and the debugged end (such as a mobile phone) is a wide area network. The debugging end and the server end (such as a server) establish a Socket connection based on the CDP protocol (specifically, through a PC Socket client to establish a connection with the server Socket). The debugging end can generate a QR code based on the debugging description information of the connected server and display it. The debugged end can identify the QR code through an identification device to obtain network information. Further, the debugged end can determine the target URL based on the network information, and based on the target URL, use the dynamic SDK to establish a Socket connection with the server based on the CDP protocol (specifically, through a mobile phone Socket client to establish a connection with the server Socket). The server is used for protocol forwarding to complete relay communication. After the debugging end and the debugged end establish a logical connection through the server, the debugged end can send a command to open a browser to the server. The server forwards the command to the debugging end. The debugging end can open the debugging browser through a shell script, and at the same time jump to the debugging address and open the page indicated by the debugging address, i.e., the Devtools debugging page. After the page is opened, the debugging end and the debugged end can interact based on the CDP protocol. For example, the debugging end can transmit input debugging commands based on the CDP protocol and obtain source code from the Devtools debugging page, while the debugged end can pass the debugging commands to the JS virtual machine for execution.
[0092] This implementation method achieves a logical connection between the debugging end and the debugged end under wide area network conditions.
[0093] In some alternative methods, the debugging end can also be further used to respond to the determination that the physical connection between the debugging end and the debugged end is a network connection and the network type is a local area network. The debugging end can determine and display the associated network information based on the local network information.
[0094] Specifically, such as Figure 6cAs shown, the network type between the debugging end (such as a PC) and the debugged end (such as a mobile phone) is a local area network, and the debugging end can generate a two-dimensional code according to the local network information and display the two-dimensional code; the debugged end can identify the two-dimensional code through a recognition device to obtain the network information associated with the debugging end; further, the debugged end can determine a target URL according to the associated network information, and establish a Socket connection (specifically, a connection between a PC Socket client and a mobile phone Socket client) with the debugging end based on the CDP protocol according to the target URL and the dynamic SDK; after the Socket connection is established, the debugging end can open a debugging browser through a shell script, jump to a debugging address, and open a page indicated by the debugging address, that is, a Devtools debugging page, and the page starts to interact based on the CDP protocol after being opened. For example, the debugging end can input a debugging instruction based on the CDP protocol and obtain source code from the Devtools debugging page, and the debugged end can input the debugging instruction into a JS virtual machine for execution.
[0095] The implementation manner realizes logical connection between the debugging end and the debugged end under the local area network condition.
[0096] It should be noted that, in the technical solution of the present disclosure, the collection, collection, updating, analysis, processing, use, transmission, storage and the like of user personal information are in line with the relevant legal regulations, are used for legal purposes, and do not violate public order and good customs. Necessary measures are taken for user personal information to prevent illegal access to user personal information data, and the safety of user personal information, network security and national security are maintained.
[0097] According to the embodiments of the present application, the present application also provides an electronic device and a readable storage medium.
[0098] As Figure 7 shown, is a block diagram 700 of an electronic device according to the debugging method of the embodiments of the present application. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown in the figures, their connections and relationships, and their functions, are merely examples, and are not intended to limit the implementations of the present application described and / or claimed in this document.
[0099] As Figure 7As shown, the electronic device includes one or more processors 701, a memory 702, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 7 Take the 701 processor as an example.
[0100] The memory 702 is the non-transitory computer-readable storage medium provided in this application. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the debugging method provided in this application. The non-transitory computer-readable storage medium of this application stores computer instructions for causing a computer to perform the debugging method provided in this application.
[0101] Memory 702, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the debugging method in the embodiments of this application (e.g., appendix). Figure 5 The acquisition module 501, connection module 502, and debugging module 503 are shown. The processor 701 executes various functional applications and data processing of the server by running non-transient software programs, instructions, and modules stored in the memory 702, thereby implementing the debugging method in the above method embodiments.
[0102] Memory 702 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created during the use of the debugged electronic device. Furthermore, memory 702 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 702 may optionally include memory remotely located relative to processor 701, and these remote memories can be connected to the debugged electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0103] The electronic device of the debugging method can further include an input device 703 and an output device 704. The processor 701, the memory 702, the input device 703, and the output device 704 can be connected through a bus or other means, Figure 7 The connection through the bus is taken as an example.
[0104] The input device 703 can receive input digital or character information, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, and the like. The output device 704 can include a display device, an auxiliary lighting device (for example, an LED), a tactile feedback device (for example, a vibration motor), and the like. The display device can include, but is not limited to, a liquid crystal display (LCD), a light-emitting diode (LED) display, and a plasma display. In some embodiments, the display device can be a touch screen.
[0105] Various embodiments of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, specially designed ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0106] These computer programs (also known as programs, software, software applications or code) include machine instructions for a programmable processor, and can be implemented in a high-level procedural and / or object-oriented programming language, and / or in assembly / machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus and / or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and / or data to a programmable processor.
[0107] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0108] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0109] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
[0110] According to the technical scheme of the embodiment of the present application, the storage space is effectively reduced, and the storage cost is saved.
[0111] It should be understood that various forms of flow shown above can be used, with reordering, adding or removing steps. For example, the steps recited in the specification can be performed in parallel, or in a different order, or can be omitted, as long as the desired result of the technology disclosed in the present application is achieved, which is not limited herein.
[0112] The specific implementation described above does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent replacement and improvement within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A debugging method applied to a device being debugged, the method comprising: Obtain network information associated with the debugging terminal; Using the dynamic software development kit (SDK) integrated in the target application, a logical connection is established with the debugging terminal based on the network information, wherein the dynamic SDK is developed based on the browser developer tools protocol; In response to receiving a debugging instruction from the debugging terminal, the debugging instruction is executed on the target application.
2. The method according to claim 1, wherein, The step of establishing a logical connection between the debugging terminal and the network information using the dynamic software development kit (SDK) integrated in the target application includes: Based on the network information and the physical connection method between the debugging terminal and the debugged terminal, the target Uniform Resource Locator (URL) is determined; Based on the target URL, a logical connection is established between the target application and the debugging terminal using the dynamic SDK integrated in the target application.
3. The method according to claim 2, wherein, The associated network information is determined based on the debugging description information of the server connected to the debugging terminal. The step of establishing a logical connection between the debugging terminal and the target application using the dynamic SDK integrated within the target URL includes: Using the dynamic SDK integrated in the target application, a socket connection is established with the server corresponding to the target URL. The server is used to forward protocols between the debugging end and the debugged end.
4. The method according to claim 2, wherein, The associated network information is determined based on the local network information of the debugging terminal. The step of establishing a logical connection between the debugging terminal and the target application using the dynamic SDK integrated within the target URL includes: Using the dynamic SDK integrated in the target application, a socket connection is established with the debugging client corresponding to the target URL.
5. The method according to claim 1, wherein, The network information associated with the debugging terminal is characterized by an identifier code. Obtaining the network information associated with the debugging terminal includes: The identification code displayed on the debugging terminal is identified to obtain the network information associated with the debugging terminal.
6. The method according to any one of claims 1-5, further comprising: The dynamic SDK is used to generate debug logs based on the debugging process, and the debug logs are sent to the debugging terminal for display.
7. A debugging device, applied to a device under debugging, the device comprising: The acquisition module is configured to acquire network information associated with the debugger. The connection module is configured to establish a logical connection with the debugging terminal based on the network information using the dynamic software development kit (SDK) integrated in the target application, wherein the dynamic SDK is developed based on the browser developer tools protocol. The debugging module is configured to execute the debugging command on the target application in response to receiving the debugging command sent by the debugging terminal.
8. A debugging system, the debugging system comprising a debugging end and a debugged end, wherein, The debugged terminal is used to perform the method as described in any one of claims 1-6; The debugging terminal is used to establish a logical connection with the debugging terminal and to debug the target application on the debugging terminal.
9. The system according to claim 8, wherein, The debugging system also includes: a server, The debugging terminal is further configured to respond to determining that the physical connection between the debugging terminal and the debugged terminal is a network connection and the network type is a wide area network, and to determine and display the associated network information based on the debugging description information of the connected server. The server is used to establish socket connections with the debugging end and the debugged end respectively, and to perform protocol forwarding between the debugging end and the debugged end.
10. The system according to claim 8, wherein, The debugging terminal is further configured to respond to determining that the physical connection between the debugging terminal and the debugged terminal is a network connection and the network type is a local area network, and to determine and display the associated network information based on the local network information.
11. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores information that can be 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-6.
12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.
13. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.