An application debugging method, system, device and medium

By debugging multiple sub-application modules in a production environment, the problem of low debugging efficiency in existing technologies is solved, achieving efficient application debugging and supporting parallel and continuous debugging of multiple sub-application modules.

CN113722204BActive Publication Date: 2025-11-28HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010819208.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-05-26
Filing Date
2020-08-14
Publication Date
2025-11-28
Estimated Expiration
2040-08-14

AI Technical Summary

Technical Problem

In existing technologies, debugging of already deployed applications is difficult to perform efficiently in a production environment, and it requires reproducing the exception in the development environment and loading the code into the IDE for local debugging, resulting in low efficiency.

Method used

This invention provides an application debugging method that allows users to directly debug multiple sub-application modules in a production environment through an application debugging system. The system supports users in selecting identifiers for multiple sub-application modules and presents the debugging progress and results through a graphical user interface, thus avoiding the need to reproduce exceptions and redeploy applications in the development environment.

Benefits of technology

It improves application debugging efficiency, reduces the time cost of reproducing exceptions and redeploying in the development environment, supports parallel debugging of multiple sub-application modules, and enhances the continuity and availability of debugging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113722204B_ABST
    Figure CN113722204B_ABST
Patent Text Reader

Abstract

The application provides an application debugging method for debugging an application deployed in a production environment, the application comprising sub-application modules running in the production environment to provide services, the method comprising: receiving identification of a plurality of sub-application modules input or selected by a user, debugging code blocks of the plurality of sub-application modules according to the identification of the plurality of sub-application modules, and presenting a debugging result to the user. The method supports the user to select or input a plurality of sub-application modules to be debugged, and debugs the plurality of sub-application modules in the production environment, thereby improving the efficiency of application debugging and making the user more convenient to debug the application.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to the Chinese Patent Application No. 202010456122.7, filed on May 26, 2020, and entitled "Application Debugging Method, Device, and Medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the technical field of application development, and in particular, to an application debugging method, an application debugging system, a computing device, and a computer-readable storage medium. BACKGROUND

[0003] An application is a collection of computer programs written for a certain special application purpose of a user. An application usually goes through multiple stages such as development, testing, and online from the project approval to the delivery to the customer. In each stage of development, testing, and online, a corresponding environment such as a development environment, a testing environment, and a production environment is usually configured.

[0004] Developers often need to debug an application, which includes detecting errors in the program code of the application by using artificial or compiled methods, and then correcting the program code according to the errors found in the debugging process. Currently, the industry usually debugs the program code of an application in the development environment through an integrated development environment (IDE).

[0005] For an application that has been online (i.e., has been deployed to a production environment), how to efficiently debug the application has become a problem that the industry focuses on. SUMMARY

[0006] The present application provides an application debugging method, which realizes directly debugging multiple sub-application modules of an application in a production environment, and improves the debugging efficiency. The present application also provides an application debugging system, a computing device, a computer-readable storage medium, and a computer program product corresponding to the above method.

[0007] In a first aspect, the present application provides an application debugging method. The application to be debugged is deployed in a production environment. The production environment refers to an environment that provides services formally. In some embodiments, the production environment can be a data center owned by a customer, or a public cloud platform purchased or leased by the customer, and the like.

[0008] The application comprises sub-application modules that run in the production environment to provide services. A sub-application module refers to a functional module that implements one or more functions through a computer executable code block. In some embodiments, for example, in an application based on a micro-service architecture, the sub-application modules that the application comprises can be micro-services. A sub-application module can also be one or more source code files in form.

[0009] The method can be performed by an application debugging system. The application debugging system receives an identification of a plurality of sub-application modules selected or input by a user. Each sub-application module comprises a code block for implementing a function of the application. The application debugging system then debugs the code blocks of the plurality of sub-application modules according to the identification of the plurality of sub-application modules. The application debugging system then presents a debugging result to the user.

[0010] The method can support the user to select and debug a plurality of sub-application modules of an application, thereby improving the debugging efficiency of the application. Further, in the method, the user can directly debug in the production environment without the need to reproduce the exception generated by the running of the application in the development environment, thereby improving the debugging efficiency. In some embodiments, the method supports cloud debugging of the application, without the need to load the code blocks of the sub-application modules to an integrated development environment (IDE) for local debugging of the application in the development environment through the IDE, and without the need to redeploy the application after debugging to the production environment, thereby saving time and further improving the debugging efficiency.

[0011] In some possible implementations, the application debugging system can present a debugging progress chart of the application to the user through a graphical user interface (GUI) during the debugging process, thereby achieving the presentation of the debugging result (specifically, an intermediate debugging result) to the user.

[0012] The debugging progress chart comprises one or more of the following information: a sub-application module that has been debugged, a sub-application module that is being debugged, a sub-application module that has a debugging error, a reminder information of a debugging error, a debugging error type, and a request / response flow of a sub-application module. A debugging error refers to an error of a code block of a sub-application module that occurs during the running of the code block, which is detected by the application debugging system through debugging and reported to the user. The debugging error type can include error types such as missing parameters, parameter type errors, and parameter validation exceptions.

[0013] On one hand, the debugging progress graph can help the user quickly know the debugging status, and on the other hand, the debugging progress graph can provide a reference for the user to determine the next or next group of sub-application modules to be debugged, and provide a reference for the user to modify the code block of the sub-application module with a debugging error.

[0014] In some possible implementation ways, the application debugging system can present the stack information and / or the variables of the sub-application module being debugged in the debugging process to the user, thereby achieving presenting the debugging result (specifically, the intermediate debugging result) to the user. It should be noted that the application debugging system can dynamically present the stack information and / or the variables of the sub-application module being debugged in the debugging process to the user as the debugging process proceeds.

[0015] The stack information can include the identification of the executed function in the call stack. Further, the stack information can also include the identification of the currently executed function and the like.

[0016] By presenting the stack information and the variables, the user can determine whether the code block of the sub-application module is abnormal based on whether the value of the variable is the same as the expected value, thereby providing help for application debugging.

[0017] In some possible implementation ways, the application debugging system can receive the identification of the plurality of sub-application modules selected by the user through the GUI. Of course, the application debugging system can receive the identification of the plurality of sub-application modules input by the user through the command user interface (CUI).

[0018] When the application debugger is different from the application developer, the debugging through the GUI is more friendly to the application debugger. When the application debugger is the same as the application developer, the process of the debugging through the CUI is simpler.

[0019] In some possible implementation ways, before receiving the identification of the plurality of sub-application modules input or selected by the user, the application debugging system can also present a list of sub-application modules of the application to the user through the user interface (such as the CUI and / or the GUI), and / or present a topology graph of the sub-application modules of the application to the user through the user interface (such as the GUI).

[0020] In this way, the user can input or select the identification of the plurality of sub-application modules, so as to debug the plurality of sub-application modules.

[0021] In some possible implementation manners, the application debugging system can acquire structural information of the application, the structural information comprising at least one of an identifier of the application, an identifier of a sub-application module (for example, a microservice), and an identifier of a resource to which the sub-application module (for example, a microservice) belongs. When the at least one sub-application module of the application comprises a plurality of copies, the identifier of the resource to which the sub-application module belongs can be an identifier of a resource to which each copy of the sub-application module belongs. The resource can be a physical machine or a virtual machine (VM), a container, or the like deployed on the physical machine. Then, the application debugging system constructs a topology graph of the sub-application module of the application according to the structural information of the application. The topology graph of the sub-application module represents a calling relationship between each sub-application module of the application.

[0022] Compared with presenting the sub-application modules of the application in the form of a list, the topology graph can also present the calling relationship between the sub-application modules, which can assist the user in determining which sub-application module or sub-application modules to debug.

[0023] In some possible implementation manners, considering that the sub-application modules available at different times can change, the interaction module 102 can also acquire updated structural information, adjust the topology graph of the sub-application module of the application according to the updated structural information, and present the adjusted topology graph of the sub-application module to the user.

[0024] The method can enable the user to obtain a newer topology graph as much as possible, and avoid the user from debugging a sub-application module that has failed, thereby reducing the debugging efficiency and wasting resources.

[0025] In some possible implementation manners, each sub-application module of the application corresponds to an agent, and the agent of each sub-application module is configured to receive a debugging instruction and start debugging a code block in the corresponding sub-application module according to the debugging instruction.

[0026] The sub-application module (for example, a microservice) generates a process at runtime, and the agent of the sub-application module is essentially equivalent to an independent thread hosted in the process at runtime. When the application debugging system debugs the sub-application module of the application, the process is not blocked, and the interaction is directly performed through the thread hosted in the process, so that the debugging of the sub-application module in a production environment can be implemented.

[0027] In some possible implementation manners, considering that the debugging process is implemented based on a session, the application debugging system can generate a plurality of debugging instructions according to the identifiers of the plurality of sub-application modules. The debugging instruction can include a debugging session establishment instruction. The application debugging system can establish a plurality of debugging sessions with a plurality of agents of the plurality of sub-application modules to be debugged according to the plurality of debugging instructions. Then, a debugging response of the agent of each sub-application module to be debugged is acquired, and the debugging response is used to generate the debugging result. In this way, the debugging of the plurality of sub-application modules is implemented.

[0028] By using the method, the plurality of sub-application modules can be directly debugged in the production environment, and the application debugging efficiency is greatly improved.

[0029] In some possible implementation manners, the debugging initiated by each agent is an independent thread in a running process of the corresponding sub-application module. When the application debugging system debugs the sub-application modules of the application, the process is not blocked, and the interaction is directly performed through the thread hosted in the process. In this way, the debugging of the sub-application modules in the production environment is implemented, and the time cost caused by the re-execution of the environment in the development environment, the loading of the code block to the IDE for local debugging, and the re-deployment of the application after the exception is eliminated is avoided, and the debugging efficiency is further improved.

[0030] In some possible implementation manners, the production environment includes at least one node, and one or more sub-application modules of the application are deployed in each node. The application debugging system can route each debugging instruction to a node agent of a node where each sub-application module to be debugged is located, and then route each debugging instruction to the agent corresponding to each sub-application module to be debuged by the node agent.

[0031] In this way, the application debugging system is supported to simultaneously debug a plurality of sub-application modules, and the application debugging efficiency is improved.

[0032] In some possible implementation manners, the agent corresponding to each sub-application module and the node agent of each node are code blocks deployed in the production environment at the same time as the application.

[0033] The agent corresponding to each sub-application module is used to debug the corresponding sub-application module, the debugging process can be parallel, and therefore the debugging efficiency can be improved. The node agent provides another transmission path (in addition to the load balancing server) of the debugging instruction and the debugging response, avoids that the debugging instructions of the same sub-application module are balanced to the agents of different copies of the sub-application module, guarantees the continuity of the debugging process, and improves the availability in the multi-copy scenario.

[0034] In some possible implementation manners, each sub-application module of the application runs in an independent container, and the sub-application modules running in the containers interact through interfaces of the containers. This method runs each sub-application module in an independent container, guarantees the independence of the sub-application modules, and further guarantees the independence of the agents of the sub-application modules, so that the debugging of the agents of the sub-application modules can be parallel, and the debugging efficiency is improved.

[0035] In some possible implementation manners, the plurality of sub-application modules include code blocks written in different programming languages. Each debugging instruction is encapsulated as a debugging message and routed to the agent corresponding to the sub-application module to be debugged. The agent corresponding to each sub-application module is configured to convert the debugging message into a debugging message corresponding to the programming language of the sub-application module.

[0036] In some possible implementation manners, the application debugging system can deploy a language debugging module of a corresponding programming language in the agent of a corresponding sub-application module, so as to implement the debugging of the heterogeneous application.

[0037] In a second aspect, the application provides an application debugging method. The application to be debugged is deployed in a production environment, and sub-application modules of the application run in the production environment to provide services. The method can be implemented by an interactive module of an application debugging system, for example, an IDE or a browser.

[0038] Specifically, the interactive module can present a sub-application module list of the application and / or a topology diagram of the sub-application modules to a user through a GUI. The sub-application module list and / or the topology diagram of the sub-application modules are used for the user to select a plurality of sub-application modules to be debugged. Then, the interactive module presents a debugging result of the plurality of sub-application modules selected by the user to the user according to a debugging selection operation of the user on the GUI.

[0039] The method can support the debugging of a plurality of sub-application modules of an application at the same time, and improves the debugging efficiency of the application. In the method, the user can directly debug in the production environment, without the need to reproduce an exception generated by running of the application in the production environment in a development environment, or the need to load code blocks included in the sub-application modules to an IDE, and debug the application locally in the development environment through the IDE, or the need to redeploy the application after debugging to the production environment, thereby saving time and further improving the debugging efficiency.

[0040] In a third aspect, the application provides a method for presenting an application debugging result. The application to be debugged is deployed in a production environment, and sub-application modules of the application run in the production environment to provide services. The method can be implemented by an interactive module of an application debugging system, for example, an IDE or a browser.

[0041] Specifically, the interaction module receives a debugging selection operation of a user through a GUI, and then presents a debugging progress graph of the application to the user on the GUI. The debugging progress graph represents a debugging progress of the application debugging system on one or more sub-application modules selected by the user, and includes one or more of the following information: a sub-application module that has been debugged, a sub-application module that is being debugged, a sub-application module that has a debugging error, a prompt information of the debugging error, a type of the debugging error, and a request / response flow of the sub-application module.

[0042] On one hand, the debugging progress graph can help the user quickly know the debugging status, and on the other hand, the debugging progress graph can provide a reference for the user to determine the next sub-application module or the next group of sub-application modules to be debugged, and to modify the code block of the sub-application module that has a debugging error.

[0043] In a fourth aspect, the application provides an application debugging system. An application to be debugged is deployed in a production environment, and the application includes sub-application modules running in the production environment to provide services. The system includes:

[0044] An interaction module configured to receive an identification of a plurality of sub-application modules input or selected by a user, wherein each sub-application module includes a code block for implementing a function of the application;

[0045] A debugging module configured to debug the code blocks of the plurality of sub-application modules according to the identification of the plurality of sub-application modules;

[0046] The interaction module is further configured to present a debugging result to the user.

[0047] In some possible implementation manners, the interaction module is configured to:

[0048] present a debugging progress graph of the application to the user through a GUI, wherein the debugging progress graph includes one or more of the following information: a sub-application module that has been debugged, a sub-application module that is being debugged, a sub-application module that has a debugging error, a prompt information of the debugging error, a type of the debugging error, and a request / response flow of the sub-application module.

[0049] In some possible implementation manners, the interaction module is configured to:

[0050] present stack information and / or variables of the sub-application module being debugged in the debugging process to the user.

[0051] In some possible implementation manners, the interaction module is specifically configured to:

[0052] receive an identification of the plurality of sub-application modules selected by the user through a graphical user interface (GUI), or receive an identification of the plurality of sub-application modules input by the user through a command user interface (CUI).

[0053] In some possible implementation manners, the interaction module is further configured to:

[0054] Before receiving the identification of the plurality of sub-application modules input or selected by the user, present a list of sub-application modules of the application to the user through a user interface, and / or present a topology graph of the sub-application modules of the application to the user through the user interface.

[0055] In some possible implementation manners, the interaction module is further configured to:

[0056] obtain structure information of the application;

[0057] construct a topology graph of the sub-application modules of the application according to the structure information of the application, the topology graph of the sub-application modules representing a calling relationship between the sub-application modules of the application.

[0058] In some possible implementation manners, the interaction module is further configured to:

[0059] obtain updated structure information of the application;

[0060] adjust the topology graph of the sub-application modules of the application according to the updated structure information;

[0061] present the adjusted topology graph of the sub-application modules to the user.

[0062] In some possible implementation manners, each sub-application module of the application corresponds to an agent, and the agent of each sub-application module is configured to receive a debugging instruction and start debugging a code block in the corresponding sub-application module according to the debugging instruction.

[0063] In some possible implementation manners, the interaction module is further configured to:

[0064] generate a plurality of debugging instructions according to the identification of the plurality of sub-application modules;

[0065] The debugging module is specifically configured to:

[0066] establish a plurality of debugging sessions with a plurality of agents in the plurality of sub-application modules to be debugged according to the plurality of debugging instructions;

[0067] obtain a debugging response of the agent of each sub-application module to be debugged, the debugging response being used to generate the debugging result.

[0068] In some possible implementation manners, the debugging initiated by each agent is an independent thread in a running process of the corresponding sub-application module.

[0069] In some possible implementation manners, the production environment includes at least one node, and one or more sub-application modules of the application are deployed in each node, and the debugging module is specifically configured to:

[0070] Each debugging instruction is routed to a node agent of a node where each sub-application module to be debugged is located, and then each debugging instruction is routed to the agent corresponding to each sub-application module to be debugged by the node agent.

[0071] In some possible implementation manners, the agent corresponding to each sub-application module and the node agent of each node are code blocks deployed in the production environment at the same time as the application.

[0072] In some possible implementation manners, each sub-application module of the application runs in an independent container, and the sub-application modules running in the containers interact through interfaces of the containers.

[0073] In some possible implementation manners, the plurality of sub-application modules include code blocks written in different programming languages, each debugging instruction is encapsulated as a debugging message and routed to the agent corresponding to the sub-application module to be debugged, and the agent corresponding to each sub-application module is configured to convert the debugging message into a debugging message corresponding to the programming language of the sub-application module.

[0074] In a fifth aspect, the present application provides a computing device, which includes a processor, a memory and a display. The processor and the memory are in communication with each other. The processor is configured to execute instructions stored in the memory, so that the computing device performs the method in any implementation manner of the first aspect, the second aspect or the third aspect.

[0075] In a sixth aspect, the present application provides a computer readable storage medium, which stores computer program instructions. When the computer program instructions are executed by a computing device, the computing device performs the method in any implementation manner of the first aspect, the second aspect or the third aspect.

[0076] In a seventh aspect, the present application provides a computer program product containing instructions, which, when executed on a computing device, cause the device to perform the method in any implementation manner of the first aspect, the second aspect or the third aspect.

[0077] On the basis of the implementation manners of the aspects described above, the present application can be further combined to provide more implementation manners. BRIEF DESCRIPTION OF DRAWINGS

[0078] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced as follows.

[0079] Figure 1 An architecture diagram of an application debugging system provided by the embodiments of the present application is provided.

[0080] Figure 2A An application scenario diagram of an application debugging system provided by the embodiments of the present application is provided.

[0081] Figure 2B An application scenario diagram of an application debugging system provided by the embodiments of the present application is provided.

[0082] Figure 2C An application scenario diagram of an application debugging system provided by the embodiments of the present application is provided.

[0083] Figure 3 A flowchart of an application debugging method provided by the embodiments of the present application is provided.

[0084] Figure 4 A schematic diagram of a debugging selection interface provided by the embodiments of the present application is provided.

[0085] Figure 5 A schematic diagram of another debugging selection interface provided by the embodiments of the present application is provided.

[0086] Figure 6 A schematic diagram of a debugging result display interface provided by the embodiments of the present application is provided.

[0087] Figure 7 A structural schematic diagram of a computing device provided by the embodiments of the present application is provided. DETAILED DESCRIPTION

[0088] The terms “first” and “second” in the embodiments of the present application are only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features limited by “first” and “second” can explicitly or implicitly include one or more of the features.

[0089] First, some technical terms involved in the embodiments of the present application are introduced.

[0090] Application (application, APP) is a set of computer programs written for a certain special application purpose of a user, which can be a single application program or a set of multiple application programs forming application software. For example, in the office field, the application can be a single text editing application, or an application composed of a text editing application, a table editing application and a graphics editing application.

[0091] An application usually includes a plurality of sub-application modules. A sub-application module refers to a functional module that implements one or more functions through a computer executable code block, and the sub-application module can be one or more source code files. The sub-application module can run in a production environment to provide services. The production environment refers to an environment in which services are formally provided. The production environment includes at least one node, which refers to a server, a terminal computing device, or other computing nodes with computing capabilities.

[0092] For a complex application with multiple functions, a developer can use a micro services architecture (MSA) for development to improve development efficiency. The micro services architecture refers to splitting functional modules of an application into independent micro services. Based on this, a sub-application module can be a micro service of an application. A micro service is a collection of one or a group of relatively small and independent functional units. Micro services interact with each other through interface calls. In this way, the decoupling of each functional module of the application can be achieved. When the application needs to add, delete, or modify a function, the developer can add, delete, or modify the corresponding micro service. A sub-application module can also be one or more micro services. Micro services run in a production environment to provide corresponding services.

[0093] For an application that has been deployed in a production environment, if there is a problem such as a running exception, the application usually needs to be debugged. Debugging refers to error checking of program code of an application through various means such as single-step execution, setting breakpoints, and printing variable contents.

[0094] Currently, the debugging method of the related art for an application deployed in a production environment is usually to load the program code of the application to an integrated development environment (IDE), to locally debug the program code of the application in the development environment through the IDE, to solve the determined problem after the local debugging, and to re-deploy the application online. This debugging method for the online application has many problems. On the one hand, the abnormality generated by the running of the application in the production environment may not be reproduced in the development environment, and the developer needs to perform additional work to reproduce the abnormality generated by the running of the application in the production environment in the development environment, and to debug the program code of the application according to the abnormality, which increases the debugging difficulty and reduces the debugging efficiency. On the other hand, loading the program code of the application to the IDE for local debugging, and re-deploying the application after the debugging to the production environment, increases the additional time cost, and further reduces the debugging efficiency. Moreover, the developer only debugs one sub-application module of the application at a time, which greatly affects the debugging efficiency of the application. How to efficiently debug the online (i.e., deployed to the production environment) application has become a problem focused by the industry.

[0095] Therefore, the embodiments of the present application provide a more efficient application debugging method. The method can be executed by an application debugging system. Specifically, for an application deployed in a production environment to be debugged, the application debugging system receives the identifiers of a plurality of sub-application modules input or selected by a user, debugs the code blocks of the plurality of sub-application modules according to the identifiers of the plurality of sub-application modules, and presents the debugging result to the user.

[0096] The method can support the user to select a plurality of sub-application modules to be debugged at a time, debug the plurality of sub-application modules of the application, and improve the debugging efficiency of the application. In the method, the user can directly debug in the production environment, without the need to reproduce the abnormality generated by the running of the application in the production environment in the development environment, which improves the debugging efficiency. Moreover, in some embodiments, the method supports cloud debugging of the application, without the need to load the code blocks included in the sub-application modules to the IDE, to locally debug the application in the development environment through the IDE, or to re-deploy the application after the debugging to the production environment, which saves time and further improves the debugging efficiency.

[0097] In order to make the technical solutions of the present application clearer and easier to understand, the system architecture of the application debugging method provided by the embodiments of the present application is introduced below with reference to the drawings.

[0098] As shown in FIG. 1, the system architecture of the application debugging method provided by the embodiments of the present application includes an application debugging system 100 and a plurality of sub-application modules 200. Figure 1As shown, the application debugging system 100 is communicatively coupled with the data center 300, and is configured to debug at least one application 200 deployed in the data center 300. The data center 300 provides a production environment, and the application 200 is deployed in the production environment. The application 200 includes a plurality of sub-application modules, each of which includes a code block for implementing a function of the application 200.

[0099] The sub-application modules of the application 200 can be distributedly deployed in at least one node of the data center 300. For example, in an example, n sub-application modules of the application 200 are distributedly deployed in k nodes (also referred to as hosts) of the data center, where k is less than or equal to n. It should be noted that the sub-application modules can be directly deployed in the nodes, i.e., in physical machines, or can be deployed in virtual machines or containers on the nodes. When each sub-application module of the application 200 is deployed in an independent container, the sub-application module running in the container can interact through an interface of the container. Figure 1

[0100] Each sub-application module has a module agent (also referred to as a microservice agent when the sub-application module is a microservice), and each node has a node agent (host agent). The module agent is referred to as an agent in the embodiments of the present application.

[0101] The agent is a code block deployed in the production environment together with the application 200. The code block is used for the agent of the sub-application module to interact with the outside and debug the sub-application module at runtime. The sub-application module (e.g., a microservice) generates a process at runtime, and the agent of the sub-application module at runtime is essentially equivalent to an independent thread hosted in the process. When the application debugging system 100 debugs the sub-application module of the application, the above process is not blocked, and the interaction is directly performed through the thread hosted in the process, so that the debugging of the sub-application module in the production environment can be implemented.

[0102] ​In some implementations, the agent can be created by code injection. Code injection is a technique of inserting independent running code into a target process and making it run. Code injection can be generally configured by environment variables. Taking the Java platform as an example, the environment variable can be JAVA_TOOL_OPTIONS, by assigning the environment variable to the name of the code file to be inserted, for example, export JAVA_TOOL_OPTIONS = "-agent-lib: hprof", when the process of the sub-application module (such as a microservice) is started, the code in the inserted code file is written into the virtual memory space of the above process, and the thread corresponding to the inserted code is also started with the process. The thread can run all the time before the process of the host is terminated.

[0103] The host agent is a code block deployed in the production environment at the same time as the application 200. The host agent is used to forward messages from the sub-application module on the node or forward messages to the sub-application module on the node. The host agent runtime can generate a process. The program code corresponding to the process can be deployed to the node when the code block of the sub-application module of the application 200 is deployed to the node. When the process of the sub-application module on the node is started, the host agent is also started.

[0104] The application debugging system 100 includes an interaction module 102 and a debugging module 104. The interaction module 102 is configured to receive a plurality of identifiers of sub-application modules selected or input by a user, for example, receive a plurality of identifiers of sub-application modules selected by a user through a graphical user interface (GUI), or receive a plurality of identifiers of sub-application modules input by a user through a command user interface (CUI). The debugging module 104 is configured to debug code blocks of the plurality of sub-application modules according to the plurality of identifiers of the sub-application modules. The interaction module 102 is further configured to present a debugging result to the user.

[0105] In Figure 1 In the illustrated embodiment, the interaction module 102 can be an IDE that provides an application debugging function. The IDE can be used not only to edit the program code of the application 200 and debug the program code during development, but also to debug the application 200 that has been online. The interaction module 102 can also be an interaction module that can provide a function of debugging the application 200 that has been online, such as a browser loaded with a user interface for debugging the application 200 or an interaction module dedicated to application debugging. For ease of description, the interaction module 102 is taken as an IDE in the following description.

[0106] In some implementations, the modules of the application debugging system 100 can be distributedly deployed in different environments. For example, as shown in FIG. 1A, the interaction module 102 can be deployed in a terminal computing device, and the debugging module 104 can be deployed in a cloud computing cluster (including at least one cloud computing device, such as a cloud server, etc.). Figure 2A

[0107] In the scenario of FIG. 1A, the interaction module 102 can be a local IDE. The local also refers to a local device. The local device includes a terminal computing device (such as a user terminal of a notebook computer, etc.) under direct control of a user. The local IDE refers to an IDE installed in the local device in a client form. In some examples, the local IDE can include visual studio, eclipse, etc. The debugging module 104 can be a cloud debugger. The local IDE can install a plug-in to connect with the cloud debugger through the plug-in, thereby debugging the application 200. Figure 2A It should be noted that the local IDE usually has a local debugger, which is independent of the cloud debugger. Based on this, the user can debug the application program code developed locally through the local debugger, and debug the application 200 that has been online through the cloud debugger.

[0108]

[0109] In other implementations, the modules of the application debugging system 100 can also be deployed in the same environment. For example, as shown in FIG. 1B, the interaction module 102 and the debugging module 104 can be deployed in the same cloud computing cluster, for example, a public cloud provided by a cloud service provider. The interaction module 102 can be a cloud IDE, and the debugging module 104 can be a cloud debugger. Figure 2B The cloud service provider can integrate the cloud debugger and the cloud IDE into one cloud service to provide for the user to use, or can provide the cloud IDE and the cloud debugger as two cloud services for the user to use. In some cases, the cloud service provider can provide the cloud debugger as a value-added service of the cloud IDE. After the user purchases or leases the value-added service, the cloud service provider combines the value-added service in the cloud IDE to provide for the user to use.

[0110]

[0111] Of course, as shown in FIG. 1C, the interaction module 102 and the debugging module 104 can also be deployed in different cloud computing clusters. For example, the interaction module 102 can be deployed in a public cloud provided by a first cloud service provider, and the debugging module 104 can be deployed in a private cloud provided by a second cloud service provider. Figure 2C ​​​As shown, the interaction module 102 and the debugging module 104 can also be deployed in different cloud computing clusters, for example, different public clouds provided by different cloud service providers. The interaction module 102 is a cloud IDE, and the debugging module 104 is a cloud debugger. Different cloud service providers provide cloud IDEs and cloud debuggers for users to use respectively.

[0112] Further, the application 200 debugged by the application debugging system 100 can be deployed in the same or different cloud computing clusters as the interaction module 102 and / or the debugging module 104, or can be independently deployed in any data center (for example, a data center owned by the user), and the foregoing Figure 2A 、 Figure 2B 、 Figure 2C Exemplarily, a case where the application 200 is deployed in the data center 300 is shown.

[0113] When the application 200 is deployed in the form of a cluster (such as kubernetes, k8s) in a self-owned data center or a third-party data center, the user manually runs a command to run a set of daemon processes (such as log collection processes fluentd and logstash, system monitoring processes collectd and ganglia gmond, system management processes kube-proxy and kube-dns, etc.) on each node of the cluster. In this way, the host agent is realized to run on the node.

[0114] When the application 200 and the cloud debugger are deployed in the same cloud computing cluster, a cloud container engine (CCE) can be used to create and run containers, and each container runs a sub-application module of the application 200. Specifically, the CCE provides a container creation interface for the user, and the interface also carries a host agent deployment control. When the user selects the host agent deployment control, the CCE can automatically deploy the host agent on each node of the cluster when creating the container.

[0115] Figure 1is exemplarily described by deploying one replica for each sub-application module of the application 200. In some implementations, in order to guarantee the availability of the sub-application modules, multiple replicas of at least one sub-application module of the application 200 can be deployed. Correspondingly, each replica includes an agent. The host agent can broadcast the debugging message to the agents of the multiple replicas. Further, when multiple replicas of one sub-application module are deployed on different nodes, the debugging module 104 first routes the debugging message to the different nodes, and then the host agents on the different nodes broadcast the debugging message to the corresponding agents respectively.

[0116] The agent of one replica of the sub-application module can start the debugging of the sub-application module according to the debugging message (specifically, the debugging instruction in the debugging message), generate a debugging response to the debugging instruction, and the application debugging system 100 generates a debugging result according to the debugging response, so as to realize the debugging of the sub-application module. It should be noted that when returning the debugging response, the agent of one replica of the sub-application module can first return the debugging response to the host agent, and then return the debugging response to the application debugging system 100 through the host agent.

[0117] The host agent provides another transmission path (other than the load balancing server) of the debugging instruction and the debugging response, avoids that the debugging instruction of the same sub-application module is balanced to the agents of different replicas of the application sub-module, guarantees the continuity of the debugging process, and improves the availability in the multiple replica scenario.

[0118] Next, the application debugging method provided by the embodiments of the present application is described in detail from the perspective of the application debugging system 100.

[0119] Referring to the flowchart of the application debugging method shown in Figure 3 The method includes the following steps.

[0120] S302: The application debugging system 100 receives the identifiers of the multiple sub-application modules selected or input by the user.

[0121] The application debugging system 100 (specifically, the interaction module 102) can present the user with a list of sub-application modules of the application 200 and / or a topology graph of the sub-application modules of the application 200 through a user interface. The topology graph of the sub-application modules is used to identify the calling relationship between the sub-application modules of the application 200. The user can select multiple sub-application modules through the user interface (for example, the GUI), and the application debugging system 100 receives the identifiers of the multiple sub-application modules selected by the user through the user interface (for example, the GUI).

[0122] In some possible implementations, the user can directly input the identification of the plurality of sub-application modules through the above-mentioned user interface (for example, CUI), and the interaction module 102 of the application debugging system 100 receives the identification of the plurality of sub-application modules input by the user through the user interface (for example, CUI) to debug the plurality of sub-application modules.

[0123] The topology graph presented by the interaction module 102 can be constructed according to the structure information of the application 200. The structure information includes at least one of the identification of the application, the identification of the sub-application module (for example, microservice), and the identification of the resource to which the sub-application module (for example, microservice) belongs. When at least one sub-application module of the application 200 includes a plurality of copies, the identification of the resource to which the sub-application module belongs can be the identification of the resource to which each copy of the sub-application module belongs. The resource can be a physical machine (physical machine) or a virtual machine (virtual machine), a container (container) and the like deployed on the physical machine. The structure information can be used to index the sub-application modules available in the application 200.

[0124] In some implementations, the application debugging system 100 can also store the structure information of the application, including any one or more of the identification of the application, the identification of the sub-application module, and the identification of the resource. These identifications can be stored in the form of key-value pairs (i.e., key:value). In order to facilitate understanding, a specific example is described below. In this example, the application 200 is a microservice-based application, and the structure information specifically includes the following information:

[0125] apps:appId:{appId},{appName,appId}

[0126] tiers:appId:{appId}:tierId:{tierId},{tierName,language,technologies,os}

[0127] resources:appId:{appId}:tierId:{tierId}:resourceId:{resourceId},{created,hostName,ip,ports,resourceId}.

[0128] wherein apps represents applications, tiers represents microservices, and resources represents resources. appName represents the name of an application, and appId represents the identity of an application, which is unique. The appId can be generated according to the identity of a project, projectId, and the appName. For example, the appId can be generated by concatenating the projectId and the default field, the appName, and then processing the concatenation using a message digest 5 (MD5) algorithm. In an example, the appId can be the MD5 value of {projectId} | default | {appName}. tierId represents the identity of a microservice, and tierName represents the name of a microservice. The tierId can be generated according to the tierName, for example, the tierId can be generated by processing the tierName and the default field using the MD5 algorithm. The resourceId represents the identity of a resource, which can be obtained according to the identity of a container, containerId. For example, the resourceId can be the MD5 value of the containerId.

[0129] After the sub-application module of the application 200 is started, the agent of the sub-application module is also started. The agent resides in the process of the sub-application module and has the same life cycle as the process of the sub-application module. The agent can send the structure information to the application debugging system 100 when the sub-application module is still available. The application debugging system 100 can store the structure information, for example, store the structure information in a cache such as a Redis cache. In this way, the interaction module 102 can obtain the structure information from the Redis cache and construct the topology graph of the sub-application module of the application according to the structure information.

[0130] When sending the structure information, the agent can first send the structure information to the host agent. The host agent can aggregate the structure information sent by different agents and then store the aggregated structure information. Considering that the available sub-application modules of the application 200 can change at different times, the agent can also update the structure information. For example, the agent can periodically send the structure information to update the structure information stored by the application debugging system 100. Correspondingly, the interaction module 102 can also obtain the updated structure information, adjust the topology graph of the sub-application module of the application 200 according to the updated structure information, and present the adjusted topology graph of the sub-application module 200 to the user.

[0131] The debugging process of the application 200 by the application debugging system 100 is implemented based on a debug session. After the user triggers a debug session establishment operation, the interaction module 102 can present a list of sub-application modules of the application 200 and / or a topology diagram of the sub-application modules of the application 200 to the user through the user interface, and the user can select multiple sub-application modules through the list or the topology diagram, and the application debugging system 100 establishes a debug session according to the identifiers of the multiple sub-application modules. For ease of understanding, the following is exemplarily described based on the application 200 in a micro-service architecture.

[0132] Figure 4 An example of a debugging selection interface is provided. As shown in Figure 4 , the interface 400 displays a start debugging control 404. The start debugging control 404 is used to start debugging of the application and establish a debug session. Specifically, when the start debugging control 404 is triggered (e.g., clicked by the user), a debug session establishment page 408 is presented in the interface 400, for example, in the form of a pop-up window. The debug session establishment page 408 provides an application selection control. After the application 200 is selected through the application selection control, the debug session establishment page 408 displays a list of micro-services of the application 200. The list includes micro-service 1, micro-service 2, …, and micro-service 5. The user can select multiple micro-services from the list to establish multiple debug sessions, each debug session corresponding to a micro-service.

[0133] In some implementations, the interface 400 also displays a topology viewing control 406. When the topology viewing control 406 is triggered, a topology diagram of the micro-services is displayed for the user to view. Referring to Figure 5 , when the topology control 406 is triggered, the interface 400 also displays a topology diagram 410 of the micro-services. As shown in the topology diagram 410, the circles represent the micro-services, and the dashed arrows between the circles represent the calling relationship between the micro-services. For example, in the example of the debugging selection interface Figure 5 , the application 200 includes multiple micro-services, including micro-service 1, micro-service 2, …, and micro-service 5. Micro-service 1 calls micro-service 2 and micro-service 4, micro-service 2 calls micro-service 3, and micro-service 4 calls micro-service 3 and micro-service 5.

[0134] Compared with presenting the micro-services of the application 200 in the form of a list, the topology diagram 410 can also present the calling relationship between the micro-services, which can assist the user in determining which micro-service or micro-services to debug. Among them, Figure 5 is exemplarily described by presenting the list and the topology diagram 410 in the interface 400. In some implementations, the interface 400 can also present either the list or the topology diagram 410, and switch to the other when needed through the corresponding control.

[0135] exist Figure 4 , Figure 5 In the illustrated embodiment, the debug session establishment page 408 in interface 400 also displays a confirmation control 409. After the user selects multiple microservices through the microservice selection control, clicking the above-mentioned confirmation control 409 will trigger the debug session establishment operation for the selected multiple microservices.

[0136] S304: The application debugging system 100 debugs the code blocks of multiple sub-application modules based on the identifiers of multiple sub-application modules.

[0137] When a user triggers the establishment of debug sessions for multiple sub-application modules, the application debugging system 100 (specifically, the interaction module 102) can generate multiple debugging instructions based on the received identifiers of the multiple sub-application modules. These debugging instructions include debug session establishment instructions. The application debugging system 100 can then establish multiple debug sessions with the agents of the multiple sub-application modules to be debugged based on these debug session establishment instructions.

[0138] In this system, multiple debug sessions correspond one-to-one with the agents of multiple sub-application modules. Each debug session has a unique debug session ID. Based on this debug session ID, the agent of the interaction module 102 and the sub-application module can be uniquely identified. By carrying the aforementioned debug session ID in the debug message, it can be ensured that the debug message can be correctly transmitted to the agent of the sub-application module or the interaction module 102.

[0139] In some implementations, the interaction module 102 can also present breakpoint setting controls, stack information viewing controls, variable display controls, variable tracing controls, or single-step execution controls, etc., through a user interface such as a GUI. These controls can be provided by, for example... Figure 4 The debugging session setup page shown can also be presented through a separate debugging configuration page. For example, users can trigger debugging operations such as setting breakpoints using the controls presented on the separate debugging configuration page. The interaction module 102 generates debugging instructions based on the debugging operations triggered by the user through the controls. These debugging instructions include one or more of the following: instructions for setting breakpoints, instructions for viewing stack information, instructions for displaying a variable, instructions for tracing a variable, or instructions for single-stepping. Each debugging instruction can be encapsulated in multiple debugging messages.

[0140] The debugging module 104 can send a plurality of debugging messages to the agents of the plurality of sub-application modules. The agents receive the debugging messages, can obtain debugging instructions, and start debugging of the code blocks of the corresponding sub-application modules according to the debugging instructions. Correspondingly, the agents of the sub-application modules can generate debugging responses. The interaction module 102 can also obtain the debugging responses of the agents of each sub-application module to be debugged, generate a debugging result according to the debugging responses, and present the debugging result to the user.

[0141] For ease of understanding, the specific debugging instructions are described in detail below.

[0142] When the debugging instruction is a breakpoint setting instruction, the debugging module 104 routes a debugging message encapsulating the instruction and carrying a debug session ID to the agent of the corresponding sub-application module. The agent receives the breakpoint setting instruction and can set a breakpoint. When the agent executes to the breakpoint position, the execution is stopped. The agent can also return a debugging response, which is specifically the actual breakpoint position.

[0143] When the debugging instruction is a variable display instruction, the debugging module 104 routes a debugging message encapsulating the instruction and carrying a debug session ID to the agent of the corresponding sub-application module. The agent receives the variable display instruction and can print the value of the variable. The agent can also return a debugging response, which is specifically the value of the variable.

[0144] When the debugging instruction is a stack information viewing instruction, the debugging module 104 routes a debugging message encapsulating the instruction and carrying a debug session ID to the agent of the corresponding sub-application module. The agent receives the stack information viewing instruction and can obtain stack information, such as the identification of the functions that have been executed in the call stack and / or the identification of the function that is currently being executed. The agent can also return a debugging response to the debugging module 104, which is specifically the stack information.

[0145] Further, after setting the breakpoint and tracking the variable, the user can also trigger a debugging operation through a breakpoint deletion control presented by the user interface and a tracking cancellation control, and generate a debugging instruction. The debugging instruction can include an instruction to delete a breakpoint (delete one or all breakpoints) and / or an instruction to cancel tracking of a variable.

[0146] When the debugging instruction is an instruction of deleting a breakpoint, the debugging module 104 routes a debugging message encapsulating the instruction and carrying a debug session ID to an agent of the corresponding sub-application module. The agent receiving the instruction of deleting a breakpoint can delete the corresponding breakpoint, avoiding the agent stopping execution at the corresponding position. The agent can also return a debugging response, which is used to indicate that the deletion is successful.

[0147] When the debugging instruction is an instruction of canceling tracking of a variable, the debugging module 104 routes a debugging message encapsulating the instruction and carrying a debug session ID to an agent of the corresponding sub-application module. The agent receiving the instruction of canceling tracking of a variable cancels tracking of the variable. The agent can also return a debugging response, which is used to indicate that the canceling is successful.

[0148] In some possible implementation manners, the debugging module 104 can first detect whether a debug session corresponding to each debugging instruction exists, and if so, routes each debugging instruction and a corresponding debug session ID to an agent of the corresponding sub-application module, and if not, establishes a corresponding debug session according to the debugging instruction, and then routes each debugging instruction and the corresponding debug session ID to an agent of the corresponding microservice. The agent receiving the above debugging instruction starts debugging of the corresponding microservice. Then, the interaction module 102 obtains a debugging response of the corresponding agent, which can be used to generate a debugging result, so that debugging of the sub-application module can be implemented.

[0149] It should be noted that the application debugging system 100 can include multiple interaction modules 102, for example, multiple IDEs. Multiple users can simultaneously debug multiple sub-application modules of the application 200 through respective interaction modules 102, such as IDEs. Different users can debug the same sub-application module of the application 200, or can debug different sub-application modules of the application 200.

[0150] When multiple users trigger operations on the same sub-application module through respective interaction modules 102, the application debugging system 100 (specifically, the debugging module 104) can establish a debugging session for each user. The debugging session corresponds to the sub-application module being debugged and the interaction module 102 (or the user) initiating the debugging process one-to-one. For example, when each user of n users triggers an operation on m sub-application modules, the debugging module 104 of the application debugging system 100 creates n*m debugging sessions according to the operations of the n users. n is greater than or equal to 1, and m is greater than or equal to 1.

[0151] S306: The application debugging system 100 presents the debugging result to the user.

[0152] The debugging result includes an intermediate debugging result and / or a final debugging result. During the debugging process, the application debugging system 100 (specifically, the interaction module 102) displays the intermediate debugging result. The intermediate debugging result is used to represent the result generated during the debugging process. The result generated during the debugging process can be represented by a debugging progress chart. After the debugging is completed, the application debugging system 100 (specifically, the interaction module 102) displays the final debugging result. The final debugging result is used to represent the success or failure of the debugging.

[0153] The debugging progress chart includes one or more of the following information: the sub-application module that has been debugged, the sub-application module that is being debugged, the sub-application module that has debugging errors, the reminder information of the debugging error, the type of the debugging error, and the request / response flow of the sub-application module. The debugging error refers to an error in the code block of the sub-application module during the running process. The application debugging system 100 detects the error through debugging and reports the error to the user.

[0154] Further, the interaction module 102 of the application debugging system 100 can also present the stack information and / or the variable of the sub-application module debugging process to the user. Specifically, the interaction module 102 can dynamically present the stack information and / or the variable of the debugging process according to the debugging progress.

[0155] The interaction module 102 of the application debugging system 100 can present the debugging result to the user through a GUI or a CUI. For ease of description, the following example illustrates that the application debugging system 100 debugs the application 200 based on the micro-service architecture and presents the debugging result through the GUI.

[0156] Referring to FIG. 6, Figure 6 As shown in the display interface diagram of the debugging result, the interface 600 presents a debugging result control. When the debugging result control is triggered, for example, when the debugging result control is clicked by the user, the interface 600 displays a debugging progress chart 602. The debugging progress chart 602 includes the micro-service that has been debugged, the micro-service that is being debugged, the micro-service that has debugging errors, the reminder information of the debugging error, the type of the debugging error, and the request / response flow of the micro-service.

[0157] Among them, debugged microservices, microservices undergoing debugging, and microservices reporting debugging errors can be distinguished by text, symbols, colors, or shapes. Specifically, the interaction module 102 can adjust the color of the microservice identifiers in the microservice topology to identify debugged and microservices undergoing debugging from among the microservices of application 200. For example, the interaction module 102 changes the identifiers of microservice 1 and microservice 2 from gray to green to indicate that microservice 1 and microservice 2 are debugged, and changes the color of microservice 3 from gray to yellow to indicate that microservice 3 is undergoing debugging. Furthermore, when the debugging progress graph is a grayscale graph, debugged and microservices undergoing debugging can also be identified based on different shades of gray.

[0158] The interaction module 102 can also identify microservices experiencing debugging errors from the microservices of application 200 through debugging error notification information. For example, microservice 3 can be connected to an error message box 609 via a connection line. Error message box 609 includes debugging error notification information, thereby identifying microservice 3 as a microservice experiencing debugging errors. The debugging error notification information includes the error type, such as missing parameters, incorrect parameter type, or parameter validation exception. In this example, the debugging error type for microservice 3 is 5003, indicating a parameter validation exception.

[0159] Furthermore, the interaction module 102 can also add request / response streams of microservices to the topology diagram to help describe the debugging progress of microservices. For example, if a request stream (data stream formed by debugging instructions) flows in or a response stream (data stream formed by debugging responses) flows out, it indicates that the microservice is either being debugged or is being debugged; if neither a request stream flows in nor a response stream flows out, it indicates that the microservice has not yet been debugged.

[0160] Based on the request / response flow described above, users can identify the next microservice or the next group of microservices that need debugging. Figure 6 In the example, the request and response streams represent that microservices 1, 2, and 3 have started debugging, meaning one branch of application 200 has started debugging. Next, the user can decide to debug another branch of application 200. This other branch could be a branch formed by microservices 1, 4, and 3, or a branch formed by microservices 1, 4, and 5. Since microservice 1 has started debugging, the user can decide to debug microservice 4.

[0161] For the microservice being debugged, the interaction module 102 can also identify the type of debugging for the microservice by modifying the shape of the microservice identifier in the topology graph. For example, a circle is added to the identifier for microservice 3, identifying that breakpoint debugging is being performed on microservice 3. In some implementations, the interaction module 102 can also modify the identifier of the microservice to a square, identifying that single-step debugging is being performed on the microservice.

[0162] In some implementations, the interface 600 can also present stack information 603 and / or values of variables 604. The stack information 603 can include the identification of the functions that have been executed in the call stack (function 1, function 2 in this example). Further, the stack information 603 can also include the identification of the function that is currently being executed (function 3 in this example), and the like. The values of variables 604 can be presented in particular by key value pairs, as shown in Figure 6 As shown, the interface 600 can also present the name of the local variable and the value of the local variable, and the like.

[0163] It should be noted that the stack information 603 and the values of variables 604 presented by the interface 600 can change as the debugging process progresses. For example, when debugging microservice 2, the interface 600 presents the functions that have been executed and the function that is currently being executed in the call stack of microservice 2, and presents the values of the local variables involved in these functions. When debugging microservice 3, the interface 600 presents the functions that have been executed and the function that is currently being executed in the call stack of microservice 3, and presents the values of the local variables involved in these functions.

[0164] Further, the interface 600 can also present code blocks 606. The user can determine the theoretical value of a variable according to the code blocks 606, and determine whether the corresponding code block 606 is abnormal according to the theoretical value and the values of variables 604 displayed in the interface 600. In some implementations, the interface 600 also includes a code file directory 608. The code file directory 608 can be used to quickly jump between different code blocks 606 (or different source code files) of the application 200, thereby enabling quick jumping to the code blocks 606 of other microservices for debugging.

[0165] The interface 600 also displays a debugging console control. When the debugging console control is triggered, the debugging console is switched to, so that the user continues to perform debugging on the application 200 based on the debugging console, such as performing debugging on other microservices of the application 200.

[0166] Based on the above content description, the embodiment of the present application provides an application debugging method. In the method, the application debugging system 100 receives the identification of the plurality of sub-application modules input or selected by the user, debugs the code blocks of the plurality of sub-application modules according to the identification of the plurality of sub-application modules, and then presents the debugging result to the user. The method supports debugging the plurality of sub-application modules of the application 200 at the same time, thereby improving the debugging efficiency. Moreover, the user can directly debug the sub-application modules of the application 200 in the production environment, without the need to reproduce the exception generated by the running of the application 200 in the development environment, or the need to load the code blocks to the IDE for local debugging, and the need to redeploy the application 200 after the debugging is completed to the production environment, thereby further improving the debugging efficiency.

[0167] In some implementations, the debugging instruction routed to the agent by the application debugging system 100 is carried in a debugging message. The debugging message can be a message based on a debugging adapter protocol (DAP), and therefore, the agent can also convert the standard DAP debugging message into a debugging message corresponding to the technology stack (or programming language) of the upper-layer application, specifically, the debugging message corresponding to the technology stack (or programming language) of the upper-layer microservice. For example, when the sub-application module to be debugged is developed based on a Java technology stack (or Java language), the agent can convert the standard DAP debugging message into a debugging message based on a java debug interface (JDI).

[0168] In order to implement the above conversion process, the agent can pre-deploy a language debugging module corresponding to the technology stack (or programming language) of the upper-layer sub-application module, such as a microservice. Specifically, the application debugging system 100 can store a language debugging module corresponding to at least one technology stack, for example, a language debugging module corresponding to a C technology stack, a Python technology stack, and a Java technology stack. The language debugging module can be specifically stored in a cloud container engine (CCE) storage volume or a hadoop distributed file system (HDFS).

[0169] The application debugging system 100 can receive a language debugging module deployment request from the agent, and then in response to the language debugging module deployment request, obtain the program code of the language debugging module requested by the agent, and send the program code of the language debugging module to the agent to deploy the corresponding language debugging module in the agent.

[0170] The application 200 can be a heterogeneous application. That is, multiple sub-application modules of the application 200 can include code blocks written based on programming languages. Correspondingly, the application debugging system 100 can deploy a language debugging module of a corresponding programming language in a corresponding agent, thereby achieving debugging of the heterogeneous application.

[0171] The above is described in combination with Figures 1 to 6 The application debugging method provided by the embodiments of the present application is described in detail, and the application debugging system 100 and related devices provided by the embodiments of the present application will be described in combination with the accompanying drawings.

[0172] Referring to Figure 1 As shown in the structural schematic diagram of the application debugging system 100, an application to be debugged is deployed in a production environment, and sub-application modules included in the application run in the production environment to provide services. The system 100 includes:

[0173] An interaction module 102, configured to receive an identification of multiple sub-application modules input or selected by a user, wherein a code block included in each sub-application module is used to implement a function of the application;

[0174] A debugging module 104, configured to debug the code blocks of the multiple sub-application modules according to the identification of the multiple sub-application modules;

[0175] The interaction module 102 is further configured to present a debugging result to the user.

[0176] In some possible implementation manners, the interaction module 102 is configured to:

[0177] present, to the user, a debugging progress diagram of the application through a GUI, wherein the debugging progress diagram includes one or more of the following information: a sub-application module that has been debugged, a sub-application module that is being debugged, a sub-application module that has a debugging error, alert information of the sub-application module that has the debugging error, a type of the debugging error, and a request / response flow of the sub-application module.

[0178] In some possible implementation manners, the interaction module 102 is configured to:

[0179] present, to the user, stack information and / or variables of the sub-application module being debugged in a debugging process.

[0180] In some possible implementation manners, the interaction module 102 is specifically configured to:

[0181] receive the identification of the multiple sub-application modules selected by the user through a graphical user interface (GUI), or receive the identification of the multiple sub-application modules input by the user through a command user interface (CUI).

[0182] In some possible implementation manners, the interaction module 102 is further configured to:

[0183] Before receiving the identification of the plurality of sub-application modules of the user input or selection, the interaction module 102 is further configured to:

[0184] In some possible implementation manners, the interaction module 102 is further configured to:

[0185] obtain the structural information of the application;

[0186] construct a topology graph of the sub-application modules of the application according to the structural information of the application, the topology graph of the sub-application modules representing the calling relationship between the sub-application modules of the application.

[0187] In some possible implementation manners, the interaction module 102 is further configured to:

[0188] obtain updated structural information of the application;

[0189] adjust the topology graph of the sub-application modules of the application according to the updated structural information;

[0190] present the adjusted topology graph of the sub-application modules to the user.

[0191] In some possible implementation manners, each sub-application module of the application corresponds to an agent, and the agent of each sub-application module is configured to receive a debugging instruction and start debugging a code block in the corresponding sub-application module according to the debugging instruction.

[0192] In some possible implementation manners, the interaction module 102 is further configured to:

[0193] generate a plurality of debugging instructions according to the identification of the plurality of sub-application modules;

[0194] The debugging module 104 is specifically configured to:

[0195] establish a plurality of debugging sessions with a plurality of agents in the plurality of sub-application modules to be debugged according to the plurality of debugging instructions;

[0196] obtain a debugging response of the agent of each sub-application module to be debugged, the debugging response being used to generate the debugging result.

[0197] In some possible implementation manners, the debugging started by each agent is an independent thread in a running process of the corresponding sub-application module.

[0198] In some possible implementation manners, the production environment includes at least one node, and one or more sub-application modules of the application are deployed in each node, and the debugging module 104 is specifically configured to:

[0199] Each debugging instruction is routed to a node agent of a node where each sub-application module to be debugged is located, and then routed to a corresponding agent of each sub-application module to be debuged by the node agent.

[0200] In some possible implementation manners, the corresponding agent of each sub-application module and the node agent of each node are code blocks deployed in the production environment at the same time as the application.

[0201] In some possible implementation manners, each sub-application module of the application runs in an independent container, and the sub-application modules running in the containers interact through interfaces of the containers.

[0202] In some possible implementation manners, the plurality of sub-application modules include code blocks written in different programming languages, each debugging instruction is encapsulated as a debugging message and routed to the corresponding agent of the sub-application module to be debugged, and the corresponding agent of each sub-application module is configured to convert the debugging message into a debugging message corresponding to the programming language of the sub-application module.

[0203] The application debugging system 100 according to the embodiments of the present application can correspond to the method described in the embodiments of the present application, and the above and other operations and / or functions of each module / unit of the application debugging system 100 are respectively implemented to realize Figure 3 The corresponding flow of each method in the illustrated embodiments, for brevity, will not be repeated here.

[0204] The embodiments of the present application also provide a computing device 700. The computing device 700 can be a notebook computer, a desktop computer, or the like, and can also be a cloud computing device (for example, a cloud server) in a cloud environment, or a combination of an end-side device and a cloud computing device. The computing device 700 is specifically configured to implement the functions of the application debugging system 100 as described in the Figure 1 embodiments.

[0205] Figure 7 A structural schematic diagram of a computing device 700 is provided, as Figure 7 shown, the computing device 700 includes a bus 701, a processor 702, a display 703, and a memory 704. The processor 702, the memory 704, and the display 703 communicate through the bus 701.

[0206] The bus 701 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the middle, but it does not mean that there is only one bus or one type of bus.

[0207] The processor 702 can be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), etc.

[0208] The display 703 is an input / output (I / O) device. The device can display electronic files such as images, text to the screen for the user to view. According to the manufacturing material, the display 703 can be divided into a liquid crystal display (LCD), an organic light emitting diode (OLED) display, etc. Specifically, the display 703 can receive the identification of the plurality of sub-application modules input or selected by the user, present the debugging result to the user, etc.

[0209] The memory 704 can include a volatile memory, such as a random access memory (RAM). The memory 704 can also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0210] The executable program code stored in the memory 704 is executed by the processor 702 to implement the functions of the foregoing application debugging system 100, or to implement the application debugging method described in the foregoing embodiments. Specifically, the processor 702 executes the foregoing program code to control the display 703 to receive, through a GUI, the identification of the plurality of sub-application modules selected by the user, or to receive, through a CUI, the identification of the plurality of sub-application modules input by the user, and then the display 703 transmits the identification of the plurality of sub-application modules selected or input by the user to the processor 702 through the bus 701, and the processor 702 debugs the code blocks of the plurality of sub-application modules according to the identification of the plurality of sub-application modules, and controls the display 703 to present the debugging result to the user.

[0211] In some possible implementation manners, the processor 702 can also control other interfaces to receive the identification of the plurality of sub-application modules. The other interfaces can be a microphone and the like. Specifically, the microphone can receive the identification of the sub-application modules in the form of voice.

[0212] In some possible implementation manners, the processor 702 can also execute the method steps corresponding to any one of the implementation manners provided in the foregoing method embodiments, which will not be described herein again.

[0213] The embodiments of the present application also provide a computer readable storage medium. The computer readable storage medium can be any available medium or data storage device that can be accessed by a computing device, such as a data center. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk), and the like. The computer readable storage medium includes instructions that instruct the computing device to execute the application debugging method applied to the application debugging system 100 described above.

[0214] The embodiments of the present application also provide a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the flow or function described in the embodiments of the present application is generated in whole or in part.

[0215] The computer instructions can be stored in a computer readable storage medium, or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer or data center to another website, computer or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner.

[0216] The computer program product can be a software installation package, and in a case where any of the foregoing application debugging methods needs to be used, the computer program product can be downloaded and executed on a computing device.

[0217] The descriptions of the corresponding processes or structures of the various drawings are each focused on, and parts not described in detail in a certain process or structure can be referred to the related descriptions of other processes or structures.

Claims

1. An application debugging method, characterized in that, The application to be debugged is deployed in a production environment, the application runs in the production environment to provide services, the production environment includes at least one node, and the method includes: The system receives the identifiers of multiple sub-application modules input or selected by the user. Each sub-application module includes code blocks used to implement the functions of the application. At least one of the multiple sub-application modules includes multiple replicas. Each replica corresponds to a proxy. The proxy corresponding to the replica is used to receive debugging instructions broadcast by the node proxy of the node where the replica is located, and to start debugging of the code blocks in the corresponding sub-application module according to the debugging instructions. The debugging started by each proxy is an independent thread in the running process of the corresponding sub-application module. Debug the code blocks of the multiple sub-application modules based on their identifiers; Present the debugging results to the user; The method further includes: Based on the updated structural information, the topology of the application's sub-application modules is adjusted. The updated structural information is obtained by periodically sending the application's structural information through the agent. The adjusted topology diagram of the sub-application modules is presented to the user.

2. The method according to claim 1, characterized in that, Presenting the debugging results to the user includes: The user is presented with a debugging progress graph of the application through a graphical user interface (GUI). The debugging progress graph includes one or more of the following information: debugged sub-application modules, sub-application modules that are being debugged, sub-application modules that have encountered debugging errors, debugging error reminders, debugging error types, and request / response flows of sub-application modules.

3. The method according to claim 1 or 2, characterized in that, Presenting the debugging results to the user includes: Present the user with the stack information and / or variables of the sub-application module being debugged during the debugging process.

4. The method according to any one of claims 1 to 2, characterized in that, The receipt of identifiers for multiple sub-application modules input or selected by the user includes: receiving identifiers for the multiple sub-application modules selected by the user through a graphical user interface (GUI), or receiving identifiers for the multiple sub-application modules input by the user through a command user interface (CUI).

5. The method according to any one of claims 1 to 2, characterized in that, Before receiving the identifiers of multiple sub-application modules input or selected by the user, the method further includes: The user interface presents a list of sub-application modules of the application to the user, and / or presents a topology diagram of the sub-application modules of the application to the user.

6. The method according to any one of claims 1 to 2, characterized in that, The method further includes: Construct a topology graph of the application's sub-application modules, whereby the topology graph represents the calling relationships between the various sub-application modules of the application.

7. The method according to claim 1, characterized in that, The debugging of code blocks in the plurality of sub-application modules includes: Based on the identifiers of the multiple sub-application modules, generate multiple debugging instructions; Based on the aforementioned multiple debugging instructions, establish multiple debugging sessions with multiple agents of multiple sub-application modules to be debugged; Obtain the debug response of the proxy for each sub-application module to be debugged, and the debug response is used to generate the debug result.

8. The method according to claim 7, characterized in that, Each node deploys one or more sub-application modules of the application, and the step of establishing multiple debugging sessions with multiple agents in the multiple sub-application modules to be debugged according to the multiple debugging instructions includes: Each debugging instruction is routed to the node agent of the node containing the sub-application module to be debugged, and then the node agent routes each debugging instruction to the agent corresponding to the sub-application module to be debugged.

9. The method according to claim 8, characterized in that, The agent corresponding to each sub-application module and the node agent of each node are code blocks deployed in the production environment at the same time as the application.

10. The method according to any one of claims 1 to 2, characterized in that, Each sub-application module of the application runs in an independent container, and the sub-application modules running in the container interact with each other through the container's interface.

11. The method according to claim 1, characterized in that, The multiple sub-application modules include code blocks written in different programming languages. Each debugging instruction is encapsulated as a debugging message and routed to the agent corresponding to the sub-application module to be debugged. The agent corresponding to each sub-application module is used to convert the debugging message into a debugging message corresponding to the programming language of the sub-application module.

12. An application debugging method, characterized in that, The application to be debugged is deployed in a production environment, and the application's sub-application modules run in the production environment to provide services. The production environment includes at least one node. The method includes: The application presents a list of sub-application modules and / or a topology diagram of the sub-application modules to the user through a graphical user interface (GUI), wherein the list of sub-application modules and / or the topology diagram of the sub-application modules are used for the user to select multiple sub-application modules to be debugged. Based on the user's debugging selection operation on the GUI, the debugging results of multiple sub-application modules selected by the user are presented to the user; wherein, each sub-application module includes code blocks used to implement the function of the application, at least one of the multiple sub-application modules includes multiple replicas, each replica corresponds to a proxy, the proxy corresponding to the replica is used to receive debugging instructions broadcast by the node proxy of the node where the replica is located, and start debugging of the code blocks in the corresponding sub-application module according to the debugging instructions, and the debugging started by each proxy is an independent thread in the running process of the corresponding sub-application module; The adjusted topology of the sub-application modules is presented to the user through the GUI. The adjusted topology of the sub-application modules is obtained by adjusting the topology of the application's sub-application modules according to the updated structural information. The updated structural information is obtained by the application's structural information periodically sent by the agent.

13. A method for presenting application debugging results, characterized in that, The application to be debugged is deployed in a production environment, and the application's sub-application modules run in the production environment to provide services. The production environment includes at least one node. The method includes: The user's debugging selections are received through the graphical user interface (GUI). The application's debugging progress graph is presented to the user on the GUI. The debugging progress graph represents the debugging progress of the application debugging system on one or more sub-application modules selected by the user. The debugging progress graph includes one or more of the following information: debugged sub-application modules, sub-application modules currently being debugged, sub-application modules that have encountered debugging errors, debugging error reminder information, debugging error type, and request / response flow of the sub-application modules. Each sub-application module includes code blocks used to implement the functions of the application. At least one of the multiple sub-application modules includes multiple replicas. Each replica corresponds to a proxy. The proxy corresponding to the replica is used to receive debugging instructions broadcast by the node proxy of the node where the replica is located, and to start debugging of the code blocks in the corresponding sub-application module according to the debugging instructions. The debugging started by each proxy is an independent thread in the running process of the corresponding sub-application module. The adjusted topology of the sub-application modules is presented to the user through the GUI. The adjusted topology of the sub-application modules is obtained by adjusting the topology of the application's sub-application modules according to the updated structural information. The updated structural information is obtained by the application's structural information periodically sent by the agent.

14. An application debugging system, characterized in that, The application to be debugged is deployed in a production environment, and the application runs in the production environment to provide services. The production environment includes at least one node, and the application debugging system includes: An interaction module is used to receive the identifiers of multiple sub-application modules input or selected by the user. Each sub-application module includes code blocks used to implement the functions of the application. At least one of the multiple sub-application modules includes multiple replicas. Each replica corresponds to a proxy. The proxy corresponding to the replica is used to receive debugging instructions broadcast by the node proxy of the node where the replica is located, and start debugging of the code blocks in the corresponding sub-application module according to the debugging instructions. The debugging started by each proxy is an independent thread in the running process of the corresponding sub-application module. The debugging module is used to debug the code blocks of the multiple sub-application modules based on their identifiers. The interaction module is also used to present the debugging results to the user; The interaction module is also used to adjust the topology of the application's sub-application modules according to the updated structural information, wherein the updated structural information is obtained by periodically sending the application's structural information through the agent; and to present the adjusted topology of the sub-application modules to the user.

15. The system according to claim 14, characterized in that, The interaction module is used for: The user is presented with a debugging progress graph of the application through a graphical user interface (GUI). The debugging progress graph includes one or more of the following information: debugged sub-application modules, sub-application modules that are being debugged, sub-application modules that have encountered debugging errors, debugging error reminders, debugging error types, and request / response flows of sub-application modules.

16. The system according to claim 14 or 15, characterized in that, The interaction module is used for: Present the user with the stack information and / or variables of the sub-application module being debugged during the debugging process.

17. The system according to any one of claims 14 to 15, characterized in that, The interaction module is specifically used for: Receive the identifiers of the multiple sub-application modules selected by the user through the graphical user interface (GUI), or receive the identifiers of the multiple sub-application modules input by the user through the command user interface (CUI).

18. The system according to any one of claims 14 to 15, characterized in that, The interaction module is also used for: Before receiving the identifiers of multiple sub-application modules input or selected by the user, a list of the application's sub-application modules is presented to the user through the user interface, and / or a topology map of the application's sub-application modules is presented to the user through the user interface.

19. The system according to any one of claims 14 to 15, characterized in that, The interaction module is also used for: Construct a topology graph of the application's sub-application modules, whereby the topology graph represents the calling relationships between the various sub-application modules of the application.

20. The system according to claim 14, characterized in that, The interaction module is also used to: generate multiple debugging instructions based on the identifiers of the multiple sub-application modules; The debugging module is specifically used to: establish multiple debugging sessions with multiple agents in multiple sub-application modules to be debugged according to the multiple debugging instructions; Obtain the debug response of the proxy for each sub-application module to be debugged, and the debug response is used to generate the debug result.

21. The system according to claim 20, characterized in that, Each node deploys one or more sub-application modules of the application, and the debugging module is specifically used for: Each debugging instruction is routed to the node agent of the node containing the sub-application module to be debugged, and then the node agent routes each debugging instruction to the agent corresponding to the sub-application module to be debugged.

22. The system according to claim 21, characterized in that, The agent corresponding to each sub-application module and the node agent of each node are code blocks deployed in the production environment at the same time as the application.

23. The system according to any one of claims 14 to 15, characterized in that, Each sub-application module of the application runs in an independent container, and the sub-application modules running in the container interact with each other through the container's interface.

24. The system according to claim 14, characterized in that, The multiple sub-application modules include code blocks written in different programming languages. Each debugging instruction is encapsulated as a debugging message and routed to the agent corresponding to the sub-application module to be debugged. The agent corresponding to each sub-application module is used to convert the debugging message into a debugging message corresponding to the programming language of the sub-application module.

25. A computing device, characterized in that, The computing device includes a processor, memory, and a display; The processor is configured to execute instructions stored in the memory to cause the computing device to perform the method as described in any one of claims 1 to 13.

26. A computer-readable storage medium, characterized in that, It includes computer program instructions, which, when executed by a computing device, cause the computing device to perform the method as described in any one of claims 1 to 13.

Citation Information

Patent Citations

  • Method and device used for debugging microservice

    CN109150978A

  • Debugging applications at resource constrained virtual machines using dynamically installable lightweight agents

    US20070113218A1

  • White-box testing systems and / or methods in web applications

    US20150169434A1