A method, apparatus, device and medium for debugging transmission of a message
By constructing debug messages as data streams in the production environment and using piped file transfer, the problem of low debug message transmission efficiency is solved, achieving efficient debugging and improved resource utilization.
Patent Information
- Application Number
- CN202010837046.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-05-26
- Filing Date
- 2020-08-19
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2040-08-19
AI Technical Summary
In existing technologies, the transmission efficiency of debugging messages during the debugging process is low, which affects debugging efficiency and resource utilization.
By constructing debug messages as data streams, using pipe files to transmit the data streams, and employing a batch message transmission protocol, debug messages are processed in batches, improving transmission efficiency and resource utilization.
It enables efficient transmission of debugging messages in the production environment, improving debugging efficiency and throughput, reducing load, and enhancing resource utilization.
Smart Images

Figure CN113722116B_ABST
Abstract
Description
[0001] This application claims priority from the Chinese Patent Application No. 202010456122.7 filed on May 26, 2020, and entitled "Application Debugging Method, Device, Equipment 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 a debugging message transmission method, device, equipment and 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 development, testing, online and other stages from the project approval to delivery to the customer. In each stage of development, testing and online, a corresponding environment is usually configured, such as development environment, testing environment and production environment.
[0004] Developers often need to debug the application, which includes detecting errors in the program code of the application by manual 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 the application in the development environment through the integrated development environment (IDE).
[0005] The efficiency of debugging message transmission is low in the debugging process, which affects the debugging efficiency. How to efficiently transmit the debugging message has become a problem focused by the industry. SUMMARY
[0006] The present application provides a debugging message transmission method, which constructs the debugging message as a data stream and transmits the data stream through a pipe file, thereby improving the transmission efficiency of the debugging message and the debugging efficiency. The present application also provides a device, equipment, computer readable storage medium and computer program product corresponding to the above method.
[0007] In a first aspect, a method for transmitting a debugging message is provided. The method is applied to an application debugging system, which is configured to debug a sub-application module of an application. The sub-application module of the application is a functional module that implements one or more functions through a computer executable code block. The sub-application module can be one or more source code files. For an application developed based on a micro-service architecture, the sub-application module can also be one or more micro-services. The sub-application module can run in a production environment to provide services.
[0008] The production environment includes at least one node, which is a server, a terminal computing device, or other computing nodes with computing capabilities. The sub-application module of the application can be deployed on at least one node of the production environment, for example, can be centrally deployed on one node, or distributedly deployed on different nodes.
[0009] Each sub-application module has a module agent (also referred to as a micro-service agent when the sub-application module is a micro-service), and each node has a node agent (also referred to as a host agent). The module agent is referred to as an agent in the embodiments of the present application.
[0010] The agent is a code block deployed in the production environment at the same time as the application. The code block is used to interact with the external environment and debug the sub-application module when running. The host agent is a code block deployed in the production environment at the same time as the application. 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 when running.
[0011] Specifically, the host agent or the agent obtains a first message batch, each debugging message in the first message batch being a debugging request message for requesting to debug a first sub-application module of the application or a debugging response message after debugging the first sub-application module (the debugging message in the first message batch obtained by the host agent is a debugging request message, and the debugging message in the first message batch obtained by the agent is a debugging response message), and then the host agent or the agent constructs the first message batch into a first debugging data stream by using a batch message transmission protocol, writes the first debugging data stream into a first debugging pipe file, and transmits the first debugging data stream through the first debugging pipe file, for example, transmits the first debugging data stream constructed based on the debugging request message from the host agent to the agent, and transmits the first debugging data stream constructed based on the debugging response message from the agent to the host agent.
[0012] Since the pipe file is a file built on memory and can be accessed by two processes (a write process and a read process) at the same time, a debug data stream constructed by transmitting a batch of debug messages through the pipe file can realize edge writing and edge reading, improving transmission efficiency. Moreover, at most one message header is retained in the debug data stream, which can reduce the load and further improve the transmission efficiency. In addition, transmitting multiple debug messages in a batch manner can improve the throughput and further improve the resource utilization.
[0013] In some possible implementation ways, the application debugging system can support multiple users to simultaneously debug the same sub-application module or different sub-application modules of an application. Based on this, when each debug message is a debug request message for requesting to debug a first sub-application module of the application, the debug instruction is included in each debug request message. Different debug instructions are derived from the debugging selection of the first sub-application module by different users.
[0014] Specifically, different users select to debug the first sub-application module, and the application debugging system generates multiple debug request messages for requesting to debug the first sub-application module, and each debug request message includes a debug instruction. Since the multiple debug request messages are all for requesting to debug the first sub-application module, the host agent can construct the multiple debug request messages into a first debug data stream, and transmit the first debug data stream through a first debugging pipe file between the host agent and the agent of the first sub-application module, thereby improving the transmission efficiency and the resource utilization.
[0015] In some possible implementation ways, a batch message transmission protocol is used to define the format of an initial data stream. The initial data stream is actually a template of a data stream, and the host agent or the agent can construct a debug data stream based on the template. Specifically, the initial data stream includes a content field, and the host agent or the agent can write the content of the multiple debug messages in a first message batch into the content field of the initial data stream, thereby obtaining a first debug data stream.
[0016] The first debug data stream includes the content of the multiple debug messages, and the transmission of the first debug data stream can realize the transmission of the multiple debug messages, thereby improving the concurrency rate and further improving the resource utilization.
[0017] In some possible implementation ways, considering that the sizes of the debug messages can not be uniform, the initial data stream can further include a size field. The host agent or the agent can write the sizes of the multiple debug messages in the first message batch into the size field of the initial data stream, and write the content of the multiple debug messages into the content field, thereby obtaining the first debug data stream.
[0018] In this way, when the agent or the host agent receives the first debugging data stream, the agent or the host agent can recover a plurality of debugging messages from the first debugging data stream according to the message size indicated by the size field, thereby achieving transmission of the plurality of debugging messages, and improving the transmission efficiency of the debugging messages and the resource utilization.
[0019] In some possible implementation manners, the initial data stream further includes a protocol version field and a header size field, the protocol version field is used to indicate a protocol version of the data stream, and the header size field is used to determine a start address of a payload in the data stream based on the protocol version.
[0020] In this way, it can be achieved that different versions of the batch message transmission protocol are allowed to exist in a live network environment, have good compatibility, and meet the needs of actual services.
[0021] In some possible implementation manners, each sub-application module of the application corresponds to an agent, which is specifically a module agent, and when the sub-application module is a microservice, the agent can also be referred to as a microservice agent. For ease of description, the agent is referred to as agent in the embodiments of the application. When each debugging message is a debugging request message that requests a first sub-application module of the application to debug, a transmission destination of the debugging request message is the agent of the first sub-application module.
[0022] In this way, the agent of the sub-application module is equivalent to an independent thread that is hosted in the process at runtime. When the application debugging system debugs the sub-application module of the application, the above process is not blocked, and the interaction is directly performed through the thread that is hosted in the process, so that the debugging of the sub-application module in a production environment can be implemented.
[0023] In some possible implementation manners, the agent of the first sub-application module is deployed with a language debugging module corresponding to a programming language of the first sub-application module. The language debugging module is used to convert the debugging message into a debugging message corresponding to the programming language, and then implement the debugging of the first sub-application module according to the debugging message corresponding to the programming language.
[0024] In this way, the language debugging module corresponding to different programming languages can be deployed in the agents of different sub-application modules, so that the debugging of the heterogeneous application can be implemented, and the business needs can be met.
[0025] In some possible implementation manners, the host agent can also use the batch message transmission protocol to construct a code of an updated language debugging module into a first deployment data stream, and then write the first deployment data stream into a first deployment pipeline file, and transmit the first deployment data stream to the agent of the first sub-application module through the first deployment pipeline file.
[0026] In this way, the language debugging module in the agent of the first sub-application module can be updated, so that the agent can start debugging the first sub-application module with the updated language debugging module, and the debugging performance is improved.
[0027] In some possible implementation manners, the application is deployed in a production environment, and the production environment includes at least one node. When each debugging message is a debugging response message after the first sub-application module is debugged, the debugging response message is transmitted to a node agent of a node where the first sub-application module is located.
[0028] The debugging response message generated by the first sub-application module is first transmitted to the host agent, and then transmitted to at least one interactive module (such as a browser or an integrated development environment) of the application debugging system through the agent. Therefore, the transmission efficiency of the debugging data stream formed by the debugging response message can be improved through the debugging pipeline file between the agent and the host agent.
[0029] In some possible implementation manners, the host agent can receive a plurality of messages, classify the plurality of messages, and obtain the first message batch and the second message batch. Each debugging message in the first message batch is a debugging request message for requesting to debug the first sub-application module, and each debugging message in the second message batch is a debugging request message for requesting to debug the second sub-application module. The host agent can also use the batch message transmission protocol to construct the second message batch into a second debugging data stream, and then write the second debugging data stream into a second debugging pipeline file, and transmit the second debugging data stream to the agent corresponding to the second sub-application module through the second debugging pipeline file.
[0030] The host agent transmits the first debugging data stream and the second debugging data stream through the first debugging pipeline file and the second debugging pipeline file respectively. On the one hand, the debugging data stream constructed by the batch of debugging messages can be transmitted through the pipeline file, so that the read-write operation is realized, and the transmission efficiency is improved. On the other hand, the debugging data stream for the first sub-application module and the debugging data stream for the second sub-application module can be transmitted in parallel through the first debugging pipeline file and the second debugging pipeline file, and the debugging efficiency is further improved.
[0031] In a second aspect, the present application provides a device for transmitting a debugging message. The device is applied to an application debugging system, which is used for debugging a sub-application module of an application. The device can be a host agent or a software module in the host agent. In some embodiments, the device can also be an agent or a software module in the agent. The device specifically comprises:
[0032] an obtaining module, configured to obtain a first message batch, each debugging message in the first message batch being a debugging request message for requesting to debug a first sub-application module of the application or a debugging response message after debugging the first sub-application module;
[0033] a processing module, configured to construct the first message batch into a first debugging data stream by using a batch message transmission protocol;
[0034] The processing module is further configured to write the first debugging data stream into a first debugging pipe file, and transmit the first debugging data stream through the first debugging pipe file.
[0035] In some possible implementation manners, when each debugging message is a debugging request message for requesting to debug the first sub-application module of the application, each debugging request message comprises a debugging instruction, and different debugging instructions are derived from debugging selections of different users on the first sub-application module.
[0036] In some possible implementation manners, the batch message transmission protocol is used to define a format of an initial data stream, and the initial data stream comprises a content field.
[0037] The processing module is specifically configured to:
[0038] write the content of the plurality of debugging messages in the first message batch into the content field of the initial data stream, to obtain the first debugging data stream.
[0039] In some possible implementation manners, the initial data stream further comprises a size field.
[0040] The processing module is specifically configured to:
[0041] write the size of the plurality of debugging messages in the first message batch into the size field of the initial data stream, and write the content of the plurality of debugging messages into the content field, to obtain the first debugging data stream.
[0042] In some possible implementation manners, the initial data stream further comprises a protocol version field and a header size field, the protocol version field is used to indicate a protocol version of the data stream, and the header size field is used to determine a start address of a payload in the data stream based on the protocol version.
[0043] In some possible implementation manners, each sub-application module of the application corresponds to an agent, and when each debugging message is a debugging request message for requesting to debug a first sub-application module of the application, a transmission destination of the debugging request message is an agent of the first sub-application module.
[0044] In some possible implementation manners, the agent of the first sub-application module is deployed with a language debugging module corresponding to a programming language of the first sub-application module, and the language debugging module is configured to convert the debugging message into a debugging message corresponding to the programming language.
[0045] In some possible implementation manners, when the apparatus is a host agent or a software module in the host agent, the processing module is further configured to:
[0046] construct, by using the batch message transmission protocol, code of the updated language debugging module as first deployment data flow;
[0047] write the first deployment data flow into a first deployment pipeline file, and transmit the first deployment data flow to the agent of the first sub-application module through the first deployment pipeline file.
[0048] In some possible implementation manners, the application is deployed in a production environment, and the production environment includes at least one node, and when each debugging message is a debugging response message after the first sub-application module is debugged, the debugging response message is transmitted to a node agent of a node where the first sub-application module is located.
[0049] In some possible implementation manners, when the apparatus is a host agent or a software module in the host agent, the obtaining module is specifically configured to:
[0050] receive a plurality of messages;
[0051] classify the plurality of messages to obtain the first message batch and a second message batch, wherein each debugging message in the second message batch is a debugging request message for requesting to debug the second sub-application module;
[0052] the processing module is further configured to:
[0053] construct, by using the batch message transmission protocol, the second message batch as second debugging data flow;
[0054] write the second debugging data flow into a second debugging pipeline file, and transmit the second debugging data flow to an agent corresponding to the second sub-application module through the second debugging pipeline file.
[0055] In a third aspect, the present application provides a computing device, comprising a processor and a memory. 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 the first aspect or any implementation manner of the first aspect.
[0056] In a fourth 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 the first aspect or any implementation manner of the first aspect.
[0057] In a fifth aspect, the present application provides a computer program product comprising instructions which, when executed on a computing device, cause the computing device to perform the method in the first aspect or any implementation manner of the first aspect.
[0058] 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
[0059] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced as follows.
[0060] Figure 1 A system architecture diagram for debugging an application by an application debugging system provided by the embodiments of the present application;
[0061] Figure 2 A schematic diagram of transmission of a debugging message in an application debugging system provided by the embodiments of the present application;
[0062] Figure 3A A deployment schematic diagram of a proxy and a node proxy provided by the embodiments of the present application;
[0063] Figure 3B A deployment schematic diagram of a proxy and a node proxy provided by the embodiments of the present application;
[0064] Figure 3C A deployment schematic diagram of a proxy and a node proxy provided by the embodiments of the present application;
[0065] Figure 4 A flowchart of a transmission method of a debugging message provided by the embodiments of the present application;
[0066] Figure 5 A schematic diagram of transmission of a data stream through a pipe file provided by the embodiments of the present application;
[0067] Figure 6A structural schematic diagram of a transmission device for debugging messages provided in an embodiment of the present application;
[0068] Figure 7 A structural schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0069] The terms "first", "second" in the embodiments of the present application are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features.
[0070] First, some technical terms involved in the embodiments of the present application are introduced.
[0071] 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 an application software. For example, in the office field, the application can be a single text editing application, or an application composed of text editing application, table editing application and graphics editing application.
[0072] An application usually includes multiple 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 that provides services formally. The production environment includes at least one node, which refers to a server, a terminal computing device or other computing nodes with computing capabilities.
[0073] For a complex application with many functions, a developer can use micro services architecture (MSA) for development to improve development efficiency. The micro services architecture refers to splitting the functional modules of an application into independent micro services. A micro service is a set or a group of relatively small and independent functional units. The 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. The micro services run in the production environment to provide corresponding services.
[0074] For the application deployed in the production environment, if there is a running exception and the like, the application usually needs to be debugged. Among them, debugging refers to debugging the program code of the application through various means such as single-step execution, setting breakpoints, printing variable content and the like.
[0075] The related art debugging method of the application deployed in the production environment is usually to load the program code of the application to the integrated development environment (IDE), to locally debug the program code of the application in the development environment through the IDE, and to re-deploy the application online after solving the determined problem. Since it is necessary to reproduce the exception generated by the application running in the production environment in the development environment, and to load the program code of the application to the IDE for local debugging, and to reproduce and deploy the application after debugging, the debugging efficiency of the application is greatly affected.
[0076] Based on this, the present application provides a method for directly debugging the application in the production environment. The method is executed by an application debugging system. For the application deployed in the production environment to be debugged, the application debugging system 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 the user to select a plurality of sub-application modules to be debugged at a time, and debugs the plurality of sub-application modules of the application, thereby improving the debugging efficiency of the application. Moreover, the user can directly debug in the production environment, without the need to load the program code to the IDE for local debugging, and without the need to re-deploy the application after debugging, thereby further improving the debugging efficiency.
[0077] Among them, the application debugging system also supports multiple users to simultaneously debug the sub-application modules of the application. In the debugging process, the application debugging system often needs to transmit the debugging messages generated by the plurality of users in the debugging of the sub-application modules. The application debugging system transmits the debugging messages in a piece-by-piece transmission mode, which is low in transmission efficiency, thereby affecting the application debugging efficiency. Moreover, the piece-by-piece transmission mode causes a significant decrease in throughput and a significant decrease in resource utilization.
[0078] Therefore, the present application provides a transmission method of a debugging message. Specifically, the application debugging system obtains a first message batch, each debugging message in the first message batch being a debugging request message for requesting to debug a first sub-application module of the application or a debugging response message for debugging the first sub-application module, and then the application debugging system constructs a first debugging data stream from the first message batch by using a batch message transmission protocol, writes the first debugging data stream into a first debugging pipe file, and transmits the first debugging data stream through the first debugging pipe file.
[0079] A pipe is a file used for inter-process communication (IPC). Essentially, a pipe is a pseudo-file, actually a kernel buffer. A pipe is created by a process (specifically the parent process) using the pipe function, stored in memory, and disappears when the process terminates. A pipe can be referenced by two file descriptors: one for the read end and one for the write end. Data typically flows into the pipe from the write end and out from the read end.
[0080] Because pipe files are memory-based files that can be accessed simultaneously by two processes (the writing process and the reading process), transmitting batches of debug messages via pipes allows for simultaneous writing and reading of debug data streams, improving transmission efficiency. Furthermore, the debug data stream retains at most one message header, reducing load and further enhancing transmission efficiency. In addition, transmitting multiple debug messages in batches increases throughput, thereby improving resource utilization.
[0081] To make the technical solution of this application clearer and easier to understand, the system architecture of the application debugging method provided in the embodiments of this application is described below with reference to the accompanying drawings.
[0082] like Figure 1 As shown, the application debugging system 100 establishes a communication path with the data center 300. The application debugging system 100 is used to debug at least one application 200 deployed on 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 multiple sub-application modules, and each sub-application module includes code blocks used to implement the functionality of the application 200.
[0083] Sub-application modules of application 200 can be deployed in a distributed manner on at least one node of data center 300. For example, in Figure 1 In the example, application 200's n sub-application modules are distributed across k nodes (also called hosts) in the data center, where k is less than or equal to n. It should be noted that sub-application modules can be deployed directly on nodes (physical machines), or they can be deployed in virtual machines or containers on the nodes. When each sub-application module of application 200 is deployed in an independent container, the sub-application modules running in the container can interact through the container's interface.
[0084] Each sub-application module has a module agent (also called a microservice agent when the sub-application module is a microservice), and each node has a node agent (host agent), also called a host agent. In this embodiment, the module agent is referred to as an agent.
[0085] The agent is a code block deployed in the production environment at the same time as the application 200. The code block is used to proxy the sub-application module to interact with the outside world 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 is essentially equivalent to an independent thread hosted in the process at runtime. When the application debugging system 100 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 the production environment can be realized.
[0086] In some implementations, the agent can be created by code injection. Code injection is a technology of inserting and running independent code into a target process. Code injection can be generally implemented by configuring 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 (e.g., a microservice) is started, the code in the inserted code file is written into the virtual memory space of the process, and the thread corresponding to the inserted code is also started along with the process. The thread can run all the time before the host process is terminated.
[0087] 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 can generate a process at runtime. The program code corresponding to the process can be deployed to the node along with the code block included in the sub-application module of the application 200. When the process of the sub-application module on the node is started, the host agent is also started.
[0088] The application debugging system 100 includes an interaction module 102 and a debugging module 104. The interaction module 102 is used to receive the identification of a plurality of sub-application modules input or selected by a user, for example, receive the identification of a plurality of sub-application modules selected by a user through a graphical user interface (GUI) or receive the identification of a plurality of sub-application modules input by a user through a command user interface (CUI). The debugging module 104 is used to debug the code block of the plurality of sub-application modules according to the identification of the plurality of sub-application modules.
[0089] The interaction module 102 generates a plurality of debugging messages according to the identification of the plurality of sub-application modules input or selected by the user, specifically, generates a debugging request message for debugging the plurality of sub-application modules. The debugging module 104 sends the debugging request message to the host agent of the node where the plurality of sub-application modules are located, and then sends the debugging request message to the agent of the sub-application module through the host agent. The agent of the sub-application module starts debugging the code of the sub-application module, generates a debugging response message, and sends the debugging response message to the host agent, and then sends the debugging response message to the debugging module 104 through the host agent.
[0090] Next, the process of transmitting the debugging message between the host agent and the agent will be described in detail.
[0091] Referring to Figure 2 The host agent can receive a plurality of debugging request messages, obtain a first message batch according to the plurality of debugging request messages, and each debugging message in the first message batch is a debugging request message for requesting to debug the first sub-application module. Then the host agent can use the batch message transmission protocol to construct the first message batch into a first debugging data stream, write the first debugging data stream into a first debugging pipe file, and transmit the first debugging data stream through the first debugging pipe file, for example, transmit the first debugging data stream to the agent of the first sub-application module.
[0092] The agent of the first sub-application module can obtain the debugging request message according to the first debugging data stream, start debugging the first sub-application module according to the debugging request message, and generate a debugging response message. The agent of the first sub-application module can obtain a first message batch according to the debugging response message, and each debugging message in the first message batch is a debugging response message for debugging the first sub-application module. The agent can use the batch message transmission protocol to construct the first message batch into a first debugging data stream, write the first debugging data stream into a first debugging pipe file, and transmit the first debugging data stream through the first debugging pipe file, for example, transmit the first debugging data stream to the host agent of the node where the first sub-application module is located.
[0093] The above-mentioned first debugging data stream is a set of ordered data sequences with a starting point and an ending point. According to the flow direction of the first debugging data stream, the first debugging data stream can be divided into an incoming flow and an outgoing flow. The incoming flow refers to the data flow flowing into the agent, and the outgoing flow refers to the data flow flowing out of the agent.
[0094] InFigure 2 In the example of the debugging scenario, the pipe file of the debugging data stream formed by the transmission of the debugging request message and the pipe file of the debugging data stream formed by the transmission of the debugging response message can be the same or different. In some embodiments, the pipe file of the debugging data stream formed by the transmission of the debugging request message can be in.fifo.pipe, and the pipe file of the debugging data stream formed by the transmission of the debugging response message can be out.fifo.pipe.
[0095] Figure 2 The message transmission method of the embodiments of the present application is introduced in the debugging scenario. The message transmission method of the embodiments of the present application can also be applied to other scenarios, such as a performance monitoring scenario. The performance monitoring refers to monitoring the running performance of a sub-application module, such as the central process unit (CPU) usage rate, the memory usage rate, etc. Specifically, the host agent obtains a first message batch, each message of the first message batch being a performance monitoring request message for monitoring the performance of a first sub-application module. The host agent can use the batch message transmission protocol to construct multiple performance monitoring request messages in the first message batch into a first monitoring data stream, and then write the first monitoring data stream into a first monitoring pipe file to transmit the first monitoring data stream through the first monitoring pipe file.
[0096] Correspondingly, the agent of the first sub-application module receives the first monitoring data stream and can obtain the performance monitoring request message. The agent of the first sub-application module can perform performance monitoring according to the multiple performance monitoring request messages to generate multiple performance monitoring response messages. The multiple performance monitoring response messages can form a first message batch. The agent of the first sub-application module can use the batch message transmission protocol to construct the multiple performance monitoring response messages in the first message batch into a first monitoring data stream, and then write the first monitoring data stream into the first monitoring pipe file to transmit the first monitoring data stream through the first monitoring pipe file, thereby achieving batch transmission of the multiple performance monitoring response messages.
[0097] In Figure 1 and Figure 2In the embodiment shown, the interaction module 102 of the application debugging system 100 can be an IDE that provides application debugging functions. 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 another interaction module that can provide functions for debugging the online application 200, such as a browser loaded with a user interface for debugging the application 200 or an interaction module dedicated to application debugging. The debugging module 104 of the application debugging system 100 is a debugger. For ease of description, the interaction module 102 is taken as an IDE and the debugging module 104 is taken as a debugger in the following description.
[0098] The host agent and the agent are deployed in the production environment at the same time as the sub-application modules of the application 200, specifically in the data center 300. The data center 300 can be a self-owned data center or a third-party data center. In addition, the data center 300 can be a local data center, which means a data center under the direct control of the user, or a cloud data center. The self-owned cloud data center specifically refers to a data center corresponding to a private cloud, and the third-party cloud data center specifically refers to a data center corresponding to a public cloud.
[0099] The host agent, the agent, and the application debugging system 100 can be deployed in the same data center or in different data centers. The deployment of the host agent and the agent will be described in detail below with reference to the accompanying drawings.
[0100] As shown in Figure 3A , the application debugging system 100 is deployed in one cloud data center (which can specifically be a cloud computing cluster), and the host agent and the agent are deployed in another cloud data center. The cloud data center where the host agent and the agent are deployed can be a data center provided by a cloud service provider, such as a public cloud, or a self-built data center, such as a private cloud.
[0101] As shown in Figure 3B , the application debugging system 100, the host agent, and the agent can also be deployed in the same cloud data center. The cloud data center can be a third-party data center provided by a cloud service provider or a private data center.
[0102] As shown in Figure 3CAs shown, the application debugging system 100 can be deployed in a cloud data center, and the host agent and the agent can be deployed in a local data center. A user can remotely debug the application 200 through the application debugging system 100, specifically, cloud debugging of the application 200.
[0103] Figures 3A to 3C Only the deployment of the application debugging system 100 and the host agent and the agent is exemplarily illustrated. In other possible implementation manners of the embodiments of the present application, different modules of the application debugging system 100 can also be respectively deployed in different environments, for example, respectively deployed in different cloud data centers, or the interaction module 102 is deployed in a terminal computing device and the debugging module 104 is deployed in a cloud data center.
[0104] In order to make the technical solutions of the present application clearer and easier to understand, the method for transmitting a debugging message provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0105] Referring to Figure 4 As shown in the flowchart of the method for transmitting a debugging message, the method comprises the following steps.
[0106] S402: The host agent or the agent obtains a first message batch.
[0107] The first message batch comprises a plurality of messages, for example, a plurality of debugging messages. The plurality of messages in the first message batch have the same receiver. For example, in a cloud debugging scenario, the receivers of the plurality of debugging messages (specifically, debugging request messages) are the agents of the first sub-application module, and therefore each debugging message in the first message batch can be a debugging request message for requesting debugging of the first sub-application module.
[0108] Each debugging request message comprises a debugging instruction, which can be derived from the debugging selection of different users on the first sub-application module. The application debugging system 100 (specifically, the interaction module 102) generates a debugging request message for requesting debugging of the first sub-application module according to the debugging selection of different users on the first sub-application module, and the host agent receives the debugging request message sent by the application interaction system 100 (specifically, the debugging module 104), thereby obtaining the first message batch.
[0109] When the agent of the first sub-application module receives the multiple debugging request messages requesting to debug the first sub-application module, specifically, the multiple debugging request messages requesting multiple users to debug the first sub-application module, the agent can start debugging the code of the first sub-application module and generate multiple debugging response messages. The agent of the first sub-application module can obtain a first message batch, and each debugging message in the first message batch is a debugging response message for debugging the first sub-application module.
[0110] The debugging messages obtained by the host agent or the agent can be stored in a queue. For example, the debugging request messages are stored in a queue with a topic of request. The debugging request messages usually carry the identifier of the sub-application module. For example, when the sub-application module is a microservice, the debugging request message carries the resource identifier of the resource to which the microservice belongs.
[0111] The host agent can also classify the debugging request messages according to the sub-application modules requested to be debugged, to obtain debugging request messages requesting to debug the first sub-application module and debugging request messages requesting to debug the second sub-application module. For example, the host agent classifies the debugging request messages in the queue with the topic of request according to the resource identifier. In this way, the host agent can obtain a first message batch and a second message batch. Each debugging message in the second message batch is a debugging request message requesting to debug the second sub-application module.
[0112] In some possible implementations, the agent can classify the debugging response messages according to the sub-application modules to be debugged, to obtain debugging response messages for debugging the first sub-application module and debugging response messages for debugging the second sub-application module. In this way, the agent can obtain a first message batch and a second message batch. Each debugging message in the second message batch is a debugging response message for debugging the second sub-application module.
[0113] S404: The host agent or the agent constructs the first message batch into a first debugging data stream by using a batch message transmission protocol.
[0114] The batch message transmission protocol is used to define the format of an initial data stream. The initial data stream includes a content field. The host agent or the agent writes the content of the multiple debugging messages in the first message batch into the content field of the initial data stream, to obtain the first debugging data stream. The content of the debugging messages can be in the form of bytes or characters, and the first debugging data stream can be different based on the form of the content. The host agent and the agent can construct the multiple debugging messages in the first message batch into a byte stream or a character stream.
[0115] Optionally, the size of the debug message can not be uniform, and for this purpose, the initial data stream can further include a size field. The size field can be denoted as message size, which is used to represent the size or the magnitude of the message. The message size can be generally represented by an integer (i.e., integer type, integer, int for short), for example, by a 32-bit integer.
[0116] It should be noted that the initial data stream can include at least one size field for indicating the size of at least one message. When the initial data stream is a data stream constructed based on two messages, the initial data stream can include at least one size field for indicating the size of at least one message. By analogy, when the initial data stream is a data stream constructed based on N (N is greater than 2) messages, the initial data stream can include at least N-1 size fields for indicating the size of at least N-1 messages. In some implementations, the initial data stream can include N size fields for indicating the size of N messages. For example, the host agent or the agent can add a size field in front of each content field to indicate the size of the message.
[0117] The content field and the size field are generally fields in the message body. In some implementations, the initial data stream can further include a field in the message header. For example, the initial data stream can further include a type field. In the cloud debugging scenario, the type field can be used to indicate that the data stream is a debugging request stream or a debugging response stream. Among them, the debugging data stream formed by the debugging request message can be referred to as the debugging request stream, and the debugging data stream formed by the debugging response message can be referred to as the debugging response stream.
[0118] Further, according to different debugging instructions encapsulated in the debugging request message, the debugging request stream can be further subdivided into a debugging adapter request stream and a command stream. When the debugging instruction encapsulated in the debugging request message is a command such as starting debugging, the debugging data stream constructed based on the debugging request message is a command flow. When the debugging instruction encapsulated in the debugging request message is an instruction for setting a breakpoint, an instruction for viewing stack information, an instruction for displaying a certain variable, an instruction for tracking a certain variable, or an instruction for single-step execution, the debugging data stream constructed based on the debugging request message is a debugging adapter request stream, also referred to as a debugging adapter protocol (DAP) stream.
[0119] Correspondingly, when the agent receives the command stream, the agent can generate a command response (command ack) message according to a start debugging command or the like in the command stream. The debugging response message for debugging the sub-application module includes the command response message. The agent can generate a command response stream (command ack flow) according to a plurality of command response messages. When the agent receives the debugging adaptation request stream, the agent can debug the sub-application module according to a breakpoint setting instruction, a stack information viewing instruction, a variable display instruction, a variable tracking instruction, or a single-step execution instruction in the debugging adaptation request stream, and generate a debugging adaptation response message for the instructions. The debugging response message for debugging the sub-application module includes the debugging adaptation response message, and a debugging adaptation response stream (DAP return stream) can be generated based on the debugging adaptation response message.
[0120] Based on this, the type field in the initial data stream can also be used to indicate that the data stream is a command stream, a DAP stream, or a command response stream, a DAP return stream.
[0121] Optionally, the host agent or the agent can use different versions of the batch message transmission protocol to transmit messages, and the initial data stream can further include a protocol version (version) field. The version can be generally represented by an integer, for example, a 32-bit int. Further, embodiments of the present application allow different versions of the batch message transmission protocol to exist in a live network environment. For this purpose, the initial data stream can further include a header size (header size) field. The header size refers to the total length of the header part excluding the header size, version fields. The header size can be generally represented by an integer, for example, a 32-bit int.
[0122] Optionally, when the header part includes a start code (start code), the header size specifically refers to the total length of the header part excluding the start code, header size, version. The start code is used to indicate a message batch state. For example, when the start code takes a value of -1, a new message batch (message batch) is about to be written into a pipe file.
[0123] The header size is mainly used to calculate the start address of the payload. Specifically, the host agent uses different versions of the batch message transmission protocol to transmit debugging messages to the agent. The agent can calculate the start address of the payload according to the header size, and then obtain the transmitted message batch.
[0124] Optionally, the initial data stream can further include any one or more of a context field, a context size field, and a timestamp field. The context field is used to indicate the context of the current message batch, and the field value of the context field can be an identifier of the context, which can be represented by a string. The context size field is used to indicate the size of the context, and the field value of the context size field can be an integer, for example, a 32-bit int. The timestamp is used to indicate the timestamp of the message batch, and the field value of the timestamp can be an integer, for example, a 64-bit long.
[0125] For ease of understanding, the present application further provides an example of a first message batch and a first debug data stream constructed according to the first message batch.
[0126] In this example, the first message batch includes 2 debug messages, specifically message1 and message2. The batch message transmission protocol is used to define the format of the initial data stream. Referring to Figure 5 , the initial data stream includes 2 content fields and 2 size fields. The content fields and the size fields can be fields included in the message body of the initial data stream. The initial data stream further includes a type field, a context size field, a context field, a timestamp field, and a start code field, a header size field, and a protocol version field. The type field, the context size field, the context field, the timestamp field, and the start code field, the header size field, and the protocol version field can be fields included in the message header of the initial data stream.
[0127] In the example of Figure 5 , the host agent writes the content of the messages message1 and message2 into the corresponding content fields, respectively, and writes the size of the messages message1 and message2 into the corresponding size fields, respectively. The field values of the content fields and the size fields are as follows:
[0128] message1 content = “messageA”;
[0129] message2 content = “messageB”;
[0130] message1 size = “8”;
[0131] message2 size = “8”;
[0132] In addition, the host agent also writes the type of the message (the type of the data stream) into the corresponding type field, the size of the context into the context size field, the identification of the context into the context field, and the transmission time into the timestamp field. The field values of these fields are as follows:
[0133] message type=“1”;
[0134] context size=“8”;
[0135] context=“contextA”;
[0136] timestamp=“123456789”;
[0137] In the message type=“1”, it is represented that the debug message is a debug request message (the data stream is a debug request stream).
[0138] In addition, the host agent also writes the protocol version into the protocol version field, the value of the start code into the start code field, and the value of the header size into the header size field. The body part, i.e., the payload part, includes the content field and the size field. The header part includes the fields other than the content field and the size field. In addition to the start code field, the protocol version field, and the header size field, the header part also includes the type field, the context size field, the context field, and the timestamp field. The type field and the context size field each occupy 4 bytes, and the context field and the timestamp field each occupy 8 bytes. Therefore, the value of the header size is 4+4+8+8=24.
[0139] It should be noted that when the host agent or the agent also acquires the second message batch, the host agent or the agent can also use the batch message transmission protocol to construct the second message batch into a second debug data stream. The specific implementation of the host agent or the agent in constructing the second debug data stream can be referred to the specific implementation of constructing the first debug data stream, which will not be described here.
[0140] S406: The host agent or the agent writes the first debug data stream into the first debug pipe file and transmits the first debug data stream through the first debug pipe file.
[0141] The host agent can pre-create the pipe file, for example, by creating the pipe file through a pipe function. The host agent then writes the first debug data stream (e.g., a command stream or a DAP stream) into the first debug pipe file. Correspondingly, the agent can read the first debug data stream from the first debug pipe file. In this way, the first debug data stream described above is transmitted through the first debug pipe file.
[0142] In some implementations, the agent writes the first debug data stream (e.g., a command response stream or a DAP return stream) into the first debug pipe file. Correspondingly, the host agent can read the first debug data stream from the first debug pipe file. In this way, the first debug data stream described above is transmitted through the first debug pipe file.
[0143] When the host agent or the agent further obtains a second message batch and constructs a second debug data stream according to the second message batch, the host agent can further write the second debug data stream (e.g., a command stream or a DAP stream) into a second debug pipe file. Correspondingly, the agent can read the second debug data stream from the second debug pipe file. In this way, the second debug data stream described above is transmitted through the second debug pipe file.
[0144] Further, the agent can write the second debug data stream (e.g., a command response stream or a DAP return stream) into the second debug pipe file. Correspondingly, the host agent can read the second debug data stream from the second debug pipe file. In this way, the second debug data stream described above is transmitted through the second debug pipe file.
[0145] Multiple sub-application modules can be deployed on one node, and the host agent can create corresponding debug pipe files for each sub-application module. Considering that the debug data stream includes a command stream / command response stream and a DAP stream / DAP return stream, the host agent can create different debug pipe files for different debug data streams. For example, the host agent can create pipe files such as dap_fifo.pipe and command_fifo.pipe, and the host agent can write a DAP stream into dap_fifo.pipe and a command stream into command_fifo.pipe, so that different types of data streams can be isolated.
[0146] Based on the above description, the embodiment of the present application provides a method for transmitting a debugging message. In the method, a host agent or an agent obtains a first message batch, each debugging message in the first message batch is a debugging request message for requesting a first sub-application module of a debugging application or a debugging response message for debugging the first sub-application module, and then the host agent or the agent constructs a first debugging data stream by using a batch message transmission protocol on the first message batch, writes the first debugging data stream into a first debugging pipe file, and transmits the first debugging data stream through the first debugging pipe file. The method supports transmission of a debugging data stream constructed by a batch of debugging messages through a pipe file, can realize read while write, and improves transmission efficiency. Moreover, at most one message header is retained in the debugging data stream, so that the load can be reduced and the transmission efficiency is further improved. In addition, transmission of a plurality of debugging messages in a batch manner can improve throughput and further improve resource utilization.
[0147] The first debugging data stream transmitted by the host agent to the agent is generated according to a debugging 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 an upper-layer application, specifically a debugging message corresponding to a technology stack (or a programming language) of an upper-layer sub-application module. For example, when the sub-application module to be debugged is developed based on a Java technology stack (or a Java language), the agent can convert the standard DAP debugging message into a debugging message based on a java debug interface (JDI).
[0148] In order to realize the above conversion process, the agent can pre-deploy a language debugging module corresponding to the technology stack (or the programming language) of the upper-layer sub-application module. Specifically, the application debugging system 100 can store code of a language debugging module corresponding to at least one technology stack, for example, code of a language debugging module corresponding to a C technology stack, a Python technology stack, or a Java technology stack. The code of the language debugging module can be specifically stored in a cloud container engine (CCE) storage volume or a hadoop distributed file system (HDFS).
[0149] The application debugging system 100 can receive a language debugging module deployment request from an agent, and in response to the language debugging module deployment request, obtain the code of the language debugging module requested by the agent, send the code of the language debugging module to the agent, and deploy the corresponding language debugging module in the agent.
[0150] The code of the language debugging module can be sent to the host agent, the host agent can use the bulk message transmission protocol to construct the code of the language debugging module into a first deployment data stream, write the first deployment data stream into a first deployment pipeline file, and transmit the first deployment data stream through the first deployment pipeline file. The agent of the first sub-application module reads the first deployment data stream from the first deployment pipeline file, deploys the corresponding language debugging module in the agent according to the first deployment data stream, so as to convert the debugging message based on the language debugging module.
[0151] When a new version of the language debugging module exists, the host agent can also construct a first deployment data stream according to the code of the new version of the language debugging module, write the first deployment data stream into a first deployment pipeline file, and transmit the first deployment data stream through the first deployment pipeline file. The agent of the first sub-application module reads the first deployment data stream from the first deployment pipeline file, and updates the language debugging module according to the code of the new version of the language debugging module in the first deployment data stream.
[0152] In some possible implementations, the application debugging system 100 can also present a list of sub-application modules of the application 200 to the user through a user interface, or present a topology graph of the sub-application modules of the application 200 to the user through the user interface, so that the user selects multiple sub-application modules for debugging according to the list of sub-application modules or the topology graph of the sub-application modules.
[0153] The list of sub-application modules or the topology graph of the sub-application modules presented by the application debugging system 100 is generated according to the structure information of the application 200. The structure information includes at least one of the identifier of the application, the identifier of the sub-application module (for example, a microservice), and the identifier of the resource to which the sub-application module (for example, a microservice) belongs. When at least one sub-application module of the application 200 includes multiple copies, the identifier of the resource to which the sub-application module belongs can be the identifier 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), or the like deployed on the physical machine.
[0154] 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. When the sub-application module is still available, the agent can send a discovery message to the application debugging system 100. The discovery message can carry the identification of the application, the identification of the sub-application module, and the identification of the resource to which the sub-application module belongs. The agent can send the discovery message at a fixed frequency (for example, 500 seconds / time), so that a large number of discovery messages are generated. The agent can use the batch message transmission protocol to construct the discovery messages into a structured data stream, write the structured data stream into a structured pipe file (for example, the first structured pipe file), and transmit the structured data stream through the structured pipe file. The host agent can also send the discovery messages in the structured data stream to a queue, for example, to a queue with a topic of inventory. The debugging module 104 can take the discovery messages from the queue, obtain the structure information therefrom, and store in a cache such as a Redis cache.
[0155] Further, the debugging module 104 can also send a ping message to each resource when obtaining the resource list. When no feedback message is received within a preset time, the corresponding resource is deleted from the resource list. Then the debugging module 104 sends the resource list in which the non-feedback resource is deleted to the interaction module 102.
[0156] In the performance monitoring scenario, the host agent can create a monitoring pipe file, for example, a first monitoring pipe file for the first sub-application module. Multiple users trigger a performance monitoring operation on the first sub-application module, and the application debugging system 100 generates multiple performance monitoring request messages for requesting to monitor the performance of the first sub-application module. The host agent can use the batch message transmission protocol to construct the multiple performance monitoring request messages into a first monitoring data stream. The host agent can write the first monitoring data stream into the first monitoring pipe file and transmit the first monitoring data stream through the first monitoring pipe file.
[0157] The agent of the first sub-application module reads the first monitoring data stream from the first monitoring pipe file and obtains the multiple performance monitoring request messages. The agent of the first sub-application module starts performance monitoring of the first sub-application module according to the multiple performance monitoring request messages and generates multiple performance monitoring response messages. The performance monitoring response messages carry monitoring index values such as CPU usage, memory usage, etc. The agent of the first sub-application module uses the batch message transmission protocol to construct the multiple performance monitoring response messages into a first monitoring data stream, writes the first monitoring data stream into the first monitoring pipe file, and transmits the first monitoring data stream through the first monitoring pipe file, thereby realizing performance monitoring.
[0158] It should be noted that the above debugging pipeline file, deployment pipeline file, structure pipeline file and monitoring pipeline file can be the same pipeline file, or can be different pipeline files. When the debugging pipeline file, deployment pipeline file, structure pipeline file and monitoring pipeline file are different pipeline files, isolation of different types of messages can be achieved.
[0159] The above is described in combination with Figures 1 to 5 The transmission method of the debugging message provided by the embodiments of the present application is described in detail, and the device and equipment provided by the embodiments of the present application will be introduced below in combination with the drawings.
[0160] Referring to the structural schematic diagram of the transmission device of the debugging message shown in FIG. 6, the device 600 is applied to an application debugging system, and the application debugging system is used for code debugging of a sub-application module of an application. The device 600 can be a software module in a host agent or host agent. In some embodiments, the device 600 can also be a software module in an agent or agent. The device 600 specifically includes:
[0161] The acquisition module 602 is configured to acquire a first message batch, each debugging message in the first message batch being a debugging request message for requesting debugging of a first sub-application module of the application or a debugging response message after debugging of the first sub-application module.
[0162] The processing module 604 is configured to construct the first message batch into a first debugging data stream by using a batch message transmission protocol.
[0163] The processing module 604 is further configured to write the first debugging data stream into a first debugging pipeline file, and transmit the first debugging data stream through the first debugging pipeline file.
[0164] In some possible implementation manners, when each debugging message is a debugging request message for requesting debugging of the first sub-application module of the application, each debugging request message includes a debugging instruction, and different debugging instructions are derived from different user debugging selections of the first sub-application module.
[0165] In some possible implementation manners, the batch message transmission protocol is used to define a format of an initial data stream, and the initial data stream includes a content field.
[0166] The processing module 604 is specifically configured to:
[0167] write the content of the plurality of debugging messages in the first message batch into the content field of the initial data stream to obtain the first debugging data stream.
[0168] In some possible implementation manners, the initial data stream further comprises a size field;
[0169] The processing module 604 is specifically configured to:
[0170] write the size of the plurality of debug messages in the first message batch into the size field of the initial data stream, and write the content of the plurality of debug messages into the content field, to obtain the first debug data stream.
[0171] In some possible implementation manners, the initial data stream further comprises a protocol version field and a header size field, the protocol version field is used to indicate the protocol version of the data stream, and the header size field is used to determine the start address of the payload in the data stream based on the protocol version.
[0172] In some possible implementation manners, each sub-application module of the application corresponds to an agent, and when each debug message is a debug request message for requesting to debug a first sub-application module of the application, the transmission destination of the debug request message is the agent of the first sub-application module.
[0173] In some possible implementation manners, the agent of the first sub-application module is deployed with a language debug module corresponding to the programming language of the first sub-application module, and the language debug module is used to convert the debug message into a debug message corresponding to the programming language.
[0174] In some possible implementation manners, the device 600 is a host agent or a software module in the host agent, and the processing module 604 is further configured to:
[0175] construct the code of the updated language debug module into a first deployment data stream by using the batch message transmission protocol;
[0176] write the first deployment data stream into a first deployment pipeline file, and transmit the first deployment data stream to the agent of the first sub-application module through the first deployment pipeline file.
[0177] In some possible implementation manners, the application is deployed in a production environment, the production environment comprises at least one node, and when each debug message is a debug response message after the first sub-application module is debugged, the debug response message is transmitted to a node agent of a node where the first sub-application module is located.
[0178] In some possible implementation manners, the device 600 is a host agent or a software module in the host agent, and the obtaining module 602 is specifically configured to:
[0179] receive a plurality of messages;
[0180] classifying the plurality of messages to obtain the first message batch and a second message batch, wherein each debug message in the second message batch is a debug request message requesting to debug the second sub-application module;
[0181] The processing module 604 is further configured to:
[0182] construct the second message batch as a second debug data stream by using the batch message transmission protocol;
[0183] write the second debug data stream into a second debug pipe file, and transmit the second debug data stream to the proxy corresponding to the second sub-application module through the second debug pipe file.
[0184] The transmission device 600 of the debug message according to the embodiments of the present application can correspond to performing 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 transmission device 600 of the debug message are respectively for realizing Figure 4 the corresponding flow of each method in the embodiments shown, for the sake of brevity, will not be repeated here.
[0185] The embodiments of the present application also provide a computing device 700. The computing device 700 can be a terminal computing device such as a notebook computer, a desktop computer, etc., can be a cloud computing device (for example, a central server) in a cloud environment, or can be an edge computing device (for example, an edge server) in an edge environment, or a combination of the above devices. The computing device 700 is specifically configured to implement the functions of the transmission device 600 of the debug message in the embodiments shown. Figure 6
[0186] Figure 7 A structural schematic diagram of a computing device 700 is provided, as shown in the figure, the computing device 700 includes a bus 701, a processor 702, a communication interface 703 and a memory 704. The processor 702, the memory 704 and the communication interface 703 communicate through the bus 701. Figure 7
[0187] 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 the sake of representation, Figure 7 only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0188] 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.
[0189] The communication interface 703 is configured to communicate with the outside. For example, the first message batch is acquired, the second message batch is acquired, or the code of the updated language debugging module is acquired, etc.
[0190] The memory 704 can include a volatile memory, such as a random access memory (RAM), and 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).
[0191] The executable code is stored in the memory 704, and the processor 702 executes the executable code to perform the aforementioned method for transmitting a debugging message. Specifically, in the case of implementing the method for transmitting a debugging message in the embodiment shown in the figure, and Figure 6 In the case of implementing the method for transmitting a debugging message in the embodiment shown in the figure, and Figure 6 In the case of implementing the method for transmitting a debugging message in the embodiment shown in the figure, and Figure 6 The software or program code required for the functions of each module in the method for transmitting a debugging message is stored in the memory 704. The processor 702 executes the program code stored in the memory 704 to perform the method for transmitting a debugging message in the embodiment shown in the figure. Figure 4 The method for transmitting a debugging message in the embodiment shown in the figure.
[0192] 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 store data which can be accessed by a computing device, such as a data center, etc. The available medium can be a magnetic medium, such as a floppy diskette, a hard disk drive, a magnetic tape, an optical medium, such as a compact disk (CD) or a DVD, or a semiconductor medium, such as a solid state hard drive, etc. The computer readable storage medium includes instructions that instruct the computing device to perform the method for transmitting a debugging message of the above-described apparatus for transmitting a debugging message.
[0193] The embodiments of the present application further provide a computer program product. The computer program product comprises one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the computer instructions produce, in whole or in part, the processes or functions described in the embodiments of the present application.
[0194] 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 wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.).
[0195] The computer program product can be a software installation package, which can be downloaded and executed on a computing device in the case of needing to use any of the foregoing application debugging methods.
[0196] The descriptions of the processes or structures corresponding to the respective figures above each have their own emphasis, and the 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. A method of debugging transmission of messages, characterized in that, The method is applied to an application debugging system for code debugging of sub-application modules of an application, and comprises the following steps: obtaining a first message batch, each debugging message in the first message batch being a debugging request message for requesting debugging of a first sub-application module of the application or a debugging response message after debugging of the first sub-application module, each sub-application module of the application corresponding to an agent, when each debugging message is the debugging request message for requesting debugging of the first sub-application module, a transmission destination of the debugging request message being an agent of the first sub-application module, the agent of the first sub-application module being configured to proxy interaction between the first sub-application module and a node agent and debugging of the first sub-application module, the node agent corresponding to a node on which the first sub-application module is deployed, and the node agent being configured to forward a message from a sub-application module on the node or forward a message to a sub-application module on the node; constructing the first message batch into a first debugging data stream by using a batch message transmission protocol; writing the first debugging data stream into a first debugging pipeline file, and transmitting the first debugging data stream through the first debugging pipeline file, the first debugging pipeline file being a file accessed by a writing process and a reading process simultaneously.
2. The method of claim 1, wherein, When each debugging message is the debugging request message for requesting debugging of the first sub-application module, each debugging request message includes a debugging instruction, and different debugging instructions are derived from debugging selections of different users on the first sub-application module.
3. The method of claim 2, wherein, The batch message transmission protocol is configured to define a format of an initial data stream, the initial data stream including a content field, and the first message batch is constructed into the first debugging data stream by using the batch message transmission protocol, comprising the following steps: writing contents of multiple debugging messages in the first message batch into the content field of the initial data stream to obtain the first debugging data stream.
4. The method of claim 3, wherein, The initial data stream further includes a size field, and the first message batch is constructed into the first debugging data stream by using the batch message transmission protocol, comprising the following steps: writing sizes of multiple debugging messages in the first message batch into the size field of the initial data stream, and writing contents of the multiple debugging messages into the content field to obtain the first debugging data stream.
5. The method of claim 4, wherein, The initial data stream further includes a protocol version field and a header size field, the protocol version field being configured to indicate a protocol version of the data stream, and the header size field being configured to determine a start address of a payload in the data stream based on the protocol version.
6. The method of claim 1, wherein, The agent of the first sub-application module is deployed with a language debugging module corresponding to a programming language of the first sub-application module, and the language debugging module is configured to convert the debugging message into a debugging message corresponding to the programming language.
7. The method of claim 6, wherein, The method further comprises the following steps: constructing code of an updated language debugging module into a first deployment data stream by using the batch message transmission protocol; writing the first deployment data stream into a first deployment pipeline file, and transmitting the first deployment data stream to the agent of the first sub-application module through the first deployment pipeline file.
8. The method according to any one of claims 1 to 7, characterized in that, The application is deployed in a production environment including at least one node, and when each debugging message is a debugging response message after debugging the first sub-application module, the debugging response message is transmitted to a node agent of a node where the first sub-application module is located.
9. The method according to any one of claims 1 to 7, characterized by, The method further includes: receiving a plurality of messages; and classifying the plurality of messages to obtain the first message batch and a second message batch, wherein each debugging message in the second message batch is a debugging request message requesting to debug a second sub-application module; constructing the second message batch into a second debugging data stream using the batch message transmission protocol; writing the second debugging data stream into a second debugging pipe file, and transmitting the second debugging data stream to an agent corresponding to the second sub-application module through the second debugging pipe file.
10. An apparatus for debugging transmission of messages, characterized in that The device is applied to an application debugging system for code debugging of sub-application modules of an application, and the device includes: a obtaining module configured to obtain a first message batch, wherein each debugging message in the first message batch is a debugging request message requesting to debug a first sub-application module of the application or a debugging response message after debugging the first sub-application module, and each sub-application module of the application corresponds to an agent, when each debugging message is a debugging request message requesting to debug the first sub-application module of the application, a transmission destination of the debugging request message is an agent of the first sub-application module, the agent of the first sub-application module is configured to proxy interaction between the first sub-application module and a node agent and debugging of the first sub-application module, the node agent corresponds to a node where the first sub-application module is deployed, and the node agent is configured to forward a message from a sub-application module on the node or forward a message to a sub-application module on the node; a processing module configured to construct the first message batch into a first debugging data stream using a batch message transmission protocol; the processing module is further configured to write the first debugging data stream into a first debugging pipe file, and transmit the first debugging data stream through the first debugging pipe file, the first debugging pipe file being a file accessed by a writing process and a reading process at the same time.
11. The apparatus of claim 10, wherein, When each debugging message is a debugging request message requesting to debug the first sub-application module of the application, each debugging request message includes a debugging instruction, and different debugging instructions are derived from debugging selections of different users on the first sub-application module.
12. The apparatus of claim 11, wherein, The batch message transmission protocol is configured to define a format of an initial data stream, and the initial data stream includes a content field; the processing module is specifically configured to: write contents of a plurality of debugging messages in the first message batch into the content field of the initial data stream to obtain the first debugging data stream.
13. The apparatus of claim 12, wherein, The initial data stream further includes a size field; the processing module is specifically configured to: write sizes of the plurality of debugging messages in the first message batch into the size field of the initial data stream, and write the contents of the plurality of debugging messages into the content field to obtain the first debugging data stream.
14. The apparatus of claim 13, wherein, The initial data stream further comprises a protocol version field and a header size field, the protocol version field is used to indicate a protocol version of the data stream, and the header size field is used to determine a start address of a payload in the data stream based on the protocol version.
15. The apparatus of claim 10, wherein, The proxy of the first sub-application module is deployed with a language debugging module corresponding to a programming language of the first sub-application module, and the language debugging module is used to convert the debugging message into a debugging message corresponding to the programming language.
16. The apparatus of claim 15, wherein, The processing module is further used to: construct a code of the updated language debugging module into a first deployment data stream by using the batch message transmission protocol; write the first deployment data stream into a first deployment pipeline file, and transmit the first deployment data stream to the proxy of the first sub-application module through the first deployment pipeline file.
17. The apparatus of any one of claims 10 to 16, wherein, The application is deployed in a production environment, and the production environment comprises at least one node, and when each debugging message is a debugging response message after the first sub-application module is debugged, the debugging response message is transmitted to a node proxy of a node where the first sub-application module is located.
18. The apparatus of any one of claims 10 to 16, wherein, The obtaining module is specifically used to: receive a plurality of messages; classify the plurality of messages to obtain the first message batch and a second message batch, wherein each debugging message in the second message batch is a debugging request message requesting to debug a second sub-application module; The processing module is further used to: construct the second message batch into a second debugging data stream by using the batch message transmission protocol; write the second debugging data stream into a second debugging pipeline file, and transmit the second debugging data stream to a proxy corresponding to the second sub-application module through the second debugging pipeline file.
19. A computing device, comprising: The computing device comprises a processor and a memory; The processor is used to execute instructions stored in the memory, so that the computing device executes the method in any one of claims 1 to 9.
20. A computer-readable storage medium, characterized in that, Computer program instructions are included, when the computer program instructions are executed by a computing device, the computing device executes the method in any one of claims 1 to 9.
Citation Information
Patent Citations
Method for managing transmission of IEC61850 high layer protocol message
CN101827026A
Debugging applications at resource constrained virtual machines using dynamically installable lightweight agents
US20070113218A1