System and method for playback and visualization of program execution process

Through dynamic instrumentation and multi-dimensional visualization technology, the shortcomings of program execution analysis in the existing technology are solved, and the detailed recording and interactive debugging of program execution details are realized, and programming and debugging efficiency is improved. It is suitable for a variety of programming languages ​​and Complex system.

CN119149431AInactive Publication Date: 2024-12-17刘宇
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411364167.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-28
Publication Date
2024-12-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing program execution analysis technology has shortcomings in capturing program dynamic details, supporting interactive debugging and providing multi-dimensional visualization views, which is difficult to meet the growing needs of program learning and problem-solving, especially in serverless architectures. and delimiting means of problems.

Method used

Provides a program execution analysis system, including a program execution information acquisition module, an execution process playback engine and a multi-dimensional visual presentation module. It uses dynamic instrumentation technology to capture execution information in real time, supports interactive debugging, and presents program status through multi-dimensional visualization. Combining cross-language support frameworks and advanced analytics tools, multilingual compatibility and fine-grained analysis are achieved.

Benefits of technology

It fully records program execution details, provides multi-dimensional visual views, supports interactive debugging, broadens the application scope of program analysis technology, significantly improves the efficiency of programming, debugging and understanding, and improves the productivity of software development and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149431A_ABST
    Figure CN119149431A_ABST
Patent Text Reader

Abstract

The invention provides a system and a method for playback and visualization of a program execution process, and aims to improve program teaching and learning efficiency and support troubleshooting of a production environment, especially a server-free architecture. The system comprises a program execution information acquisition module, an execution process playback engine, a multi-dimensional visualization presentation module and a cross-language support framework. Wherein the acquisition module captures detailed information of program execution in real time through dynamic instrumentation; the playback engine gradually reproduces an execution process based on the collected information, and supports interactive debugging; the visual presentation module presents a program state from multiple angles in a graphical mode; the cross-language support framework ensures the compatibility with mainstream programming languages. Compared with the prior art, the method has the advantages that program execution details can be completely recorded and presented in a high-fidelity mode, the complex execution process is visual and visible, the interpretability and the debuggeability of program behaviors are greatly improved, and the method has wide application prospects in the fields of program teaching, troubleshooting and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer software, and in particular to a system and method for program behavior analysis and visualization, aiming to improve the interpretability and debuggability of execution processes during program design, debugging and teaching. Background Art

[0002] The playback and visualization technology of program execution process has important applications in the fields of program design learning, debugging and troubleshooting. Accurately recording and intuitively presenting the state changes and execution process of the program during runtime is the key to improving the efficiency of programming learning for beginners and deepening developers' understanding of complex programs. However, most of the commonly used program teaching and learning tools are limited to static analysis, lacking fine-grained description and vivid presentation of the dynamic execution process, making it difficult for learners to establish a dynamic mental model of program behavior and understand the essence of program execution.

[0003] As the complexity of software systems continues to increase, the difficulty of troubleshooting and debugging during development and maintenance is also increasing. In particular, in some innovative system architectures and programming models, such as serverless computing, new challenges are brought to problem location and tracking due to its dynamic scheduling, short lifecycle instances, and distributed execution. Traditional debugging methods are difficult to cope with the complex interactions and processes in serverless applications, and innovative program analysis technologies are urgently needed to provide more sophisticated, comprehensive, and coherent insights into the execution process.

[0004] At present, the industry mainly uses two solutions for program execution analysis: instrumentation debugging and post-analysis. Instrumentation debugging inserts probe code at specific locations of the target program to capture program runtime information in real time and interactively control program execution. Post-analysis is to perform offline analysis of execution records such as logs and traces after the program is executed to restore the program running process. These two solutions have achieved transparency of program behavior to a certain extent, but there are still many limitations.

[0005] However, existing technologies still have shortcomings in analyzing dynamic execution behaviors, supporting program learning and understanding, and coping with complex system troubleshooting. First, most solutions lack the ability to capture and replay the execution process in detail, and cannot fully reproduce the program running details. Second, the visual analysis dimensions provided by existing tools are single, and it is difficult to intuitively and comprehensively present the program status and execution logic. Third, the execution analysis support for new architectures such as serverless is limited, and there is a lack of targeted data collection and problem demarcation methods. These problems restrict the application of program dynamic analysis technology in programming learning and complex system debugging.

[0006] To solve the above problems, some studies have tried to optimize program instrumentation strategies to improve the precision of data collection; introduce multi-level visualization views to enhance the expressiveness of program behavior; and develop a serverless execution tracking framework to improve the efficiency of troubleshooting. Although these improvements have alleviated the limitations of existing technologies to a certain extent, they are still not ideal in terms of capturing program state changes, depicting the dynamic execution panorama, and adapting to new programming models, making it difficult to fundamentally meet the growing needs of program learning, understanding, and troubleshooting.

[0007] Therefore, there is an urgent need for a new program execution analysis system that can record execution details in detail, vividly present program behavior, flexibly support different programming paradigms, and fully enable programming learning and complex system troubleshooting. This is of great significance for improving the learning efficiency of beginners, deepening developers' system understanding, and ensuring the stable operation of innovative architectures. It has become a research hotspot and development trend in the field of software engineering. Summary of the invention

[0008] The purpose of this invention is to solve the shortcomings of existing program execution analysis technology in capturing program dynamic details, supporting interactive debugging, and providing multi-dimensional visualization views, so as to improve the efficiency and experience of program understanding and debugging.

[0009] In addition, the present invention also aims to provide a general and extensible program analysis framework that supports multiple mainstream programming languages ​​and expands the application scope of program execution analysis technology.

[0010] To achieve the above objectives, the present invention provides a system for program execution process playback and visualization, which is characterized by comprising a program execution information collection module, an execution process playback engine, a multi-dimensional visualization presentation module and a cross-language support framework.

[0011] In some embodiments, the system also includes a refined interactive analysis tool to further enhance program behavior analysis capabilities.

[0012] Specifically, the program execution information collection module dynamically inserts the target program to capture detailed information during program execution in real time, including statement execution order, variable value changes, stack information, memory allocation, etc., to form a complete execution information record.

[0013] Furthermore, the execution process playback engine gradually reproduces the execution process of the program based on the execution information record, and supports interactive operations such as pause, forward, backward, breakpoint debugging, etc.

[0014] Preferably, the multi-dimensional visualization presentation module presents the program execution status in a graphical and visual manner, including multiple perspectives such as source code highlighting, variable view, call stack visualization, memory object view, etc. Optionally, the cross-language support framework achieves compatibility and extended support for mainstream programming languages ​​through language-independent abstract interfaces and plug-in adapters.

[0015] In one embodiment, the refined interactive analysis tool also provides advanced analysis capabilities such as logic assertion analysis, difference comparison, and visual statistical views.

[0016] In some embodiments, the dynamic instrumentation uses binary code injection technology to modify the executable file of the target program and insert information collection code at a specified location to achieve low-intrusive execution information extraction.

[0017] In addition, the present invention can also utilize the breakpoint debugging interface provided by the operating system or virtual machine to achieve real-time control and status checking of the program execution process.

[0018] In other embodiments, the visualization presentation module uses a multi-level tree structure to display the program execution process, and supports interactive operations such as focusing, expanding, and folding, so as to facilitate users to explore the execution details of interest.

[0019] In a preferred embodiment, the program execution process playback and visualization system of the present invention is seamlessly integrated with an integrated development environment, so that users can observe program behavior in real time while writing code and use visualization clues to quickly locate anomalies.

[0020] In another preferred embodiment, the system, as an independent analysis tool, can be flexibly connected to various program execution environments, supports playback analysis of offline execution logs, and is suitable for troubleshooting in production environments.

[0021] By adopting the above technical solution, the present invention has the following beneficial effects: (1) Completely record program execution details and achieve fine-grained playback and analysis of the execution process; (2) Provide multi-dimensional visualization views to intuitively present the dynamic behavior and state changes of the program; (3) Support interactive debugging, which facilitates users to actively explore and locate anomalies; (4) Achieve multi-language compatibility and greatly expand the application scope of program analysis technology; (5) Integrate advanced analysis tools to provide solid support for program understanding and optimization.

[0022] In summary, this invention has created a new paradigm for program execution analysis, significantly improved the efficiency of program design, debugging and understanding, promoted the innovation of software development and maintenance technology, and has important significance for improving the quality and productivity of software engineering. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 It is the overall architecture diagram of the system of the present invention.

[0025] Figure 2 The internal structure of the program execution information collection module is shown.

[0026] Figure 3 is an interactive debugging diagram of the execution process playback engine.

[0027] Figure 4 Several view samples of the multi-dimensional visualization presentation module are shown.

[0028] Figure 5 The plug-in mechanism of the cross-language support framework is explained.

[0029] Figure 6 Demonstrates the working principle of one of the refined interactive analysis tools - logical assertion analysis.

[0030] Figure 7 Describes the application process of integrating this system with the integrated development environment.

[0031] Figure 8 The application deployment process of this system on a serverless computing platform is explained. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0033] In the description of the present invention, it should be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.

[0034] Embodiment 1: This embodiment provides a system for replaying and visualizing the program execution process. Compared with the prior art, the system has made innovative improvements in the following key aspects: First, in terms of program execution information collection, this system uses a novel dynamic binary instrumentation technology, which uses a dynamic binary translation framework (such as DynamoRIO, Pin, etc.) to parse and modify the machine instructions of the program in real time during program execution.

[0035] Specifically, the instrumentation module first identifies key instructions in the target code, such as function calls, return instructions, memory access instructions, etc., and then injects the acquisition code before and after these instructions. The acquisition code is responsible for recording execution information such as instruction addresses, operands, register values, memory addresses, etc., and packages the records and sends them to the back-end execution information library.

[0036] In order to reduce the overhead of instrumentation, the system also designs an incremental lazy instrumentation mechanism. This mechanism maintains a cache of instrumented code blocks. For each new code block encountered, it first checks whether there is an instrumented version in the cache. If so, it is executed directly. Otherwise, it is instrumented in real time and cached. This strategy of trading space for time can significantly reduce the overhead of repeated instrumentation.

[0037] In addition, for multi-threaded programs, the mechanism also introduces read-write locks and atomic operation instructions to ensure cache consistency and thread safety.

[0038] Secondly, in order to further optimize the instrumentation performance, the system also designs an instrumentation point selection algorithm based on path coverage. The algorithm is based on the following greedy strategy: each time, a instrumentation point that can cover the most uncovered paths is selected until all paths are covered. Formally, the problem can be defined as: Given a program control flow graph , find a minimal subset of vertices , so that: in, Representation diagram The set of all simple paths in . This problem can be approximately solved by the following greedy algorithm: initialization For each vertex , calculate the number of covered paths : choose ,renew: Repeat steps 2 and 3 until ,at this time This is the desired approximate optimal set of insertion points In the implementation, classic algorithms such as depth-first search can be used to enumerate all simple paths in the program flow graph, and data structures such as bit vectors can be used to maintain path coverage relationships to improve computational efficiency.

[0039] Again, in terms of execution state reproduction, this system innovatively proposes a fine-grained panoramic reproduction mechanism that combines virtual machine environment simulation and instrumentation log driver. Specifically, the playback engine maintains a virtual machine environment, including virtual register groups, virtual memory space, virtual stack frames, etc. During the playback process, the virtual machine first loads the initial image of the target program. Then, the engine begins to parse the instrumentation log and drives the virtual machine execution according to the instruction sequence in the log. For each instruction, the virtual machine performs the following operations: According to the instruction address, set the virtual register group state to the register value recorded in the instrumentation log If it is a memory write instruction, the target address in the virtual memory is written to the value recorded in the instrumentation log If it is a function call instruction, a new virtual stack frame is created and the return address and other meta-information of the current frame are pushed onto the stack. If it is a function return instruction, the current virtual stack frame is popped and the execution environment of the previous frame is restored Set the program counter in the virtual register bank to the address of the next instruction Through the above steps, the virtual machine can accurately reproduce the state changes of memory, registers, call stack, etc. during program execution, making the entire execution process like a movie replay, which can be paused, moved forward, and rewound at will. In addition, in order to support efficient state random access, the engine also establishes a multi-level index on the instrumentation log. Specifically, the log is divided into blocks of fixed size, a timestamp index is established on each block, and a first-level block index is established at fixed time intervals. When querying the status at any point in time, first match the target block through the timestamp, and then scan the block sequentially to locate the specific instruction position.

[0040] Finally, in terms of multi-dimensional visualization, this system makes comprehensive use of graphics rendering, data visualization, human-computer interaction and other technologies to provide developers with an immersive program behavior observation experience. The following describes in detail the design and implementation of several representative views: Source code view: This view displays the current and historically executed code lines in real time in a highlighted form. To this end, the view component maintains the mapping relationship between source code and instruction addresses. Every time the virtual machine executes a new instruction, the component reverses the source code location based on the instruction address and highlights the corresponding line. At the same time, the component also updates the badge next to the line number with information such as the number of times the instruction has been executed. In addition, a floating prompt box is embedded in the code line to show the value changes of the variables before and after the execution of the line.

[0041] Variable tracking view: This view draws a line chart based on time series data to show the value change trajectory of the variable during the entire execution process. The horizontal axis represents time, the vertical axis represents the variable value, and different variables are represented by lines of different colors. In order to process large-scale time series data, the view adopts optimization mechanisms such as streaming rendering and block loading. When the user pans or zooms the timeline, the view dynamically adjusts the data sampling granularity and visualization area to ensure rendering efficiency and continuity of information presentation.

[0042] Call chain view: This view uses Sunburst diagram layouts to show the dynamic evolution of the call stack. The Sunburst diagram consists of a series of concentric rings, each ring represents a nested level of the call stack, and the fan on the ring represents the function at that level. As the program executes, new function calls will generate new rings in the diagram, and function returns will shrink the rings, thereby intuitively reflecting the call hierarchy and execution flow between functions. In order to cope with large-scale call chains, the view uses D3.js's dynamic zoom and clustering layout algorithm, and supports users to adjust the viewing angle and detail level through interactive means such as clicking and dragging.

[0043] Memory layout view: This view borrows the idea of ​​treemap and uses a nested matrix to display the spatial distribution and occupancy of memory objects. The view divides the virtual address space of the process into multiple fixed-size blocks. Each block corresponds to a cell in the matrix. The color indicates the allocation status of the block (such as allocated, free, reserved, etc.), and the brightness indicates the access frequency of the block. For the allocated blocks, they are further subdivided into object matrices of smaller granularity. In this way, the memory layout of the entire process is intuitively presented as a fractal-like nested matrix. When the user hovers the mouse over a block, the floating prompt box will display detailed information about the block, such as the starting address, size, type, call stack, etc. Through multi-level zooming and panning, users can freely switch between macro layout and micro objects.

[0044] In order to ensure the smoothness and scalability of the view, the system adopts a front-end and back-end separation architecture. The view component runs in the browser and communicates with the back-end service through WebSocket. When the execution state changes, the back-end service pushes the change information to the view component in an incremental manner, and the view component updates the UI state after parsing the data. Considering the increasingly complex interaction logic carried by the view component, the system also introduces state management libraries (such as Redux, Mobx, etc.) to maintain the state consistency of the view, and improves rendering efficiency through performance optimization methods such as virtual scrolling and lazy loading.

[0045] In summary, the program execution visualization system proposed in this embodiment has been deeply optimized and innovatively designed in terms of dynamic information collection, program state reproduction, and multi-dimensional behavior presentation. The overall performance and analysis effect are orders of magnitude better than those of existing systems. The following is a typical scenario to illustrate the workflow of this system: Assume that a developer discovers an intermittent crash while debugging a C++ program. After preliminary analysis, he identifies a suspicious code area. In order to further find out the cause of the crash, he decides to use this system to replay and trace the execution of the area: Developers load the target program in the IDE and set markers at the entry and exit of suspicious code areas.

[0046] The developer starts the program and runs it repeatedly. During this process, the instrumentation module automatically instruments the code in the marked area and uploads the instrumentation data to the server in real time.

[0047] The developer enters the system's web interface and selects an execution record that triggered the crash. The system backend parses the record and replays the instrumentation log to reproduce the complete execution process at the time of the crash.

[0048] The developer checked the code at the crash point in the source code view and found that the crash occurred when accessing a dynamically allocated pointer.

[0049] The developer further checked the memory status of the crash point in the memory layout view and found that the memory block where the target pointer was located had been released in advance, suspecting that there was a problem with the memory management logic.

[0050] To verify the speculation, the developer checked the life cycle of the target pointer in the variable tracking view. He found that the pointer was accidentally released in another function call shortly after it was created, and the crash occurred at a later code location.

[0051] The developer locates the function call that releases the pointer based on the information in the call chain view, sets a breakpoint there, and replays the execution process again.

[0052] After the breakpoint was triggered, the developer debugged the function that released the pointer statement by statement, and eventually found that there was a logical error in the management of pointer ownership, which caused the pointer to be released prematurely. When the pointer was accessed again elsewhere, a crash occurred.

[0053] The developer fixed the problematic memory management logic and the problem was resolved.

[0054] During the entire debugging process, the developer successfully located a hidden memory error in just tens of minutes with the help of the execution playback, status inspection, and multi-dimensional visualization capabilities provided by the system, which is orders of magnitude more efficient than traditional debugging methods. This fully demonstrates the great value of the system in improving development productivity and software quality.

[0055] Example 2: Based on Example 1, this example further improves the interactive analysis capabilities of the system and introduces a set of innovative program behavior insight tools. These tools are based on the multi-dimensional visualization view in Example 1, combined with data analysis, program understanding, machine learning and other technologies, to provide developers with more intelligent, efficient and in-depth execution feature analysis and problem diagnosis methods.

[0056] The logic assertion checker is one of the typical tools. This tool allows users to insert assertion statements in the form of "assert(expr)" into the code to declare logical constraints that must be met at specific program points. When the program is replayed, the tool automatically detects and records the actual evaluation results of the assertion. If an assertion failure is found, an alert is generated and the execution is located at the assertion failure point, helping users quickly find logical errors in the code. Compared with traditional assertion checking methods, the innovation of this tool lies in the introduction of symbolic execution technology, which can automatically generate inputs that cause assertion failures, greatly improving the discovery rate of hidden errors.

[0057] Specifically, the tool designs a dedicated symbolic execution engine. It can replace variables in assertions with symbolic values, convert assertion expressions into path constraints, and collect the specific values ​​of variables at execution time as boundary conditions for constraint solving. By converting the assertion checking problem into a constraint solving problem, the engine can use the existing SMT solver to automatically infer the range of variable values ​​that violate the assertion, and then generate the minimum counterexample that causes the assertion to fail. Compared with ordinary symbolic execution, the engine is optimized in the following aspects: First, it introduces an incremental symbolic execution mechanism based on taint analysis. Specifically, it dynamically tracks the dependencies of cada sub-expressions in the assertion during the symbolic execution process, and only symbolizes the variables directly related to the assertion results, while retaining the specific values ​​of irrelevant variables. This incremental strategy can greatly reduce the path space of symbolic execution and improve the efficiency and accuracy of assertion checking. Secondly, for external function calls involved in assertions, the engine proposes a function summary mechanism. It statically builds a logical summary of the input-output relationship for common library functions or system APIs, and directly uses these summaries to describe the function behavior during symbolic execution without analyzing the function statement by statement. This method of logical abstraction of complex functions can significantly reduce the constraint scale and solution difficulty while ensuring the correctness of the analysis. Thirdly, to address the path explosion problem in pointer alias analysis, the engine innovatively introduces a staged memory model. It divides the symbolic execution process into multiple stages, each of which defines an independent pointer value range. For pointer comparisons in the same phase, the engine generates disjoint constraints; for pointer comparisons across phases, the engine uses offsets to describe different values ​​of the same pointer, thereby avoiding exponential alias combinations, ensuring comparison completeness while significantly reducing the complexity of memory modeling. Finally, for the search strategy for assertion-related paths, the engine adopts a heuristic priority depth exploration algorithm. It uses the variables that appear in the assertion as a benchmark to evaluate the possibility of assertion violation for each path, and always prioritizes the exploration of the branch with the greatest possibility. In addition, it also sets a path length threshold, and stops expanding once the exploration length exceeds the predetermined range, in order to balance execution coverage and analysis efficiency. By comprehensively applying the above optimization strategies, the logic assertion checker can cover more assertion failure scenarios with less overhead, breaking through the application bottleneck of traditional symbolic execution technology in large-scale programs to a certain extent. More importantly, the tool establishes a connection between static logic specifications and dynamic execution information, so that the program properties expected by developers are automatically verified at runtime, greatly improving the efficiency of discovering and locating hidden logic errors in complex systems, and making important contributions to improving software reliability.

[0058] The differential execution analyzer is another important innovation of this embodiment. This tool is designed to analyze the differences between different execution paths or states of the same code segment and locate the key factors that cause program behavior changes. Its core idea is to use symbolic execution and semantic differential technology to automatically generate the minimum input that causes differences in control flow and data flow, and locate the key statements that introduce differences and their scope of influence.

[0059] Specifically, the analyzer first extracts two forked program slices from the execution log, performs statement-level differential comparison on them, and quickly locates the first differential statement that causes the fork. Then, starting from this statement, the analyzer collects the variables that introduce the difference in the statement, traces back the data flow of these variables, and constructs a dependency graph for the difference propagation. On this basis, the analyzer applies dynamic taint analysis to identify all statements directly or indirectly affected by the difference variables, and generates the path conditions of the statement subset. By solving the path conditions, the variable value conditions on which the statement that introduces the difference depends can be obtained. In order to improve the readability of the conditions, the analyzer also applies a series of simplification rules, such as constant propagation, variable substitution, expression simplification, etc., to express the conditions in the simplest form as much as possible. It should be pointed out that even after simplification, the difference conditions may still be very complex, which is inconvenient for manual analysis. To this end, the analyzer further proposes a structured difference pattern matching method. It predefines a set of common difference types and their typical characteristics, such as boundary condition differences, initial value differences, slip of the tongue differences, etc., and matches the simplified difference conditions with these patterns. Once it is found that the conditions are highly consistent with a certain pattern, the differences can be directly attributed to the corresponding causes, greatly improving the degree of automation in the classification and interpretation of differences.

[0060] On the basis of difference location and attribution, the analyzer also evaluates the impact scope of each difference. To this end, the analyzer takes the difference statement as the root and generates a dynamic slice of the statement in the subsequent execution process. By comparing the specific behaviors of the two executions on the difference slice, the impact trajectory of the difference can be intuitively portrayed. In addition, the slice also contains a large amount of program state information, such as variable values, function call parameters, etc. By analyzing the dynamic change trend of this information, the analyzer can further infer the impact of the difference at the data flow and control flow levels. In order to intuitively present the impact of the difference, the analyzer specially designed a difference propagation graph. The graph takes the difference statement as the root, the statements affected by the difference as the nodes, and the edges between the nodes represent the control dependency or data dependency relationship between the statements. The color of the edge indicates the propagation direction of the difference in the dependency relationship, and the thickness of the edge indicates the correlation strength of the propagation path. Through the difference propagation graph, developers can see the impact scope and propagation path of the difference at a glance, which helps to sort out the causal context between error introduction and exposure.

[0061] It can be seen that the differential execution analyzer applies multiple innovative technologies such as fine-grained statement differentiation, symbolic condition extraction, semantic pattern matching, and dynamic impact analysis to execution comparison, establishes a cross-execution difference tracking and impact analysis mechanism, and forms a complete set of difference visualization and explainability analysis solutions. This innovative idea of ​​combining differential analysis with semantic understanding not only greatly improves the efficiency and accuracy of differential analysis, but also provides important technical support for revealing the evolution of program behavior and predicting potential abnormal risks, and has important theoretical and practical significance.

[0062] The performance bottleneck analyzer is another important contribution of this embodiment. Existing function-level sampling analysis can only discover performance hotspots, but lacks in-depth analysis of the causes of hotspots. To address this shortcoming, this tool proposes a fine-grained, semantic, full-process bottleneck tracking method. This method uses instrumentation logs as the object, implements flexible customization of bottleneck modes through domain-specific languages, and introduces symbolic execution-based path analysis and flow dependency-based impact analysis. It not only accurately locates performance bottlenecks in the code, but also establishes a full-process tracking chain from bottleneck phenomena to bottleneck roots, forming a complete bottleneck attribution and optimization decision-making system.

[0063] Specifically, the performance analysis DSL allows developers to define the bottleneck patterns of interest using a concise descriptive language. Compared to directly writing complex code instrumentation logic, DSL greatly reduces the threshold for using performance analysis. Thanks to the high degree of domain abstraction in the language, developers can directly use performance-related semantic concepts such as loops, recursion, and cache to describe bottleneck features, and the system automatically translates these features into instrumentation point selection strategies and runtime statistical metrics. The entire process is completely transparent to users.

[0064] Based on the bottleneck location, the analyzer will automatically trigger the semantic tracing of the bottleneck. The core innovation here is the deep integration of traditional performance analysis and symbolic execution technology. Taking a bottleneck point as the starting point, the analyzer symbolically evaluates the path conditions of the point and collects the path constraints from the program entry to the bottleneck point. Then, the analyzer converts the path constraints into constrained optimization problems to solve the variable combinations that cause the most serious bottleneck on the path. These variable combinations essentially characterize the semantic scenarios where the bottleneck occurs, that is, the triggering conditions of the bottleneck. Compared with traditional heuristic search, semantic analysis based on path constraints gives the necessary conditions that lead to performance problems, avoids false positive reasoning, and greatly improves the accuracy of bottleneck root cause identification.

[0065] In order to further improve the comprehensiveness of bottleneck analysis, the analyzer introduces full-process impact analysis based on local path analysis. Specifically, the analyzer takes the bottleneck point as the root and recursively generates dynamic slices of statements and variables at this point in the subsequent execution process. The slice reflects the impact of the bottleneck statement on subsequent statements through control flow and data flow. By comparing the differences in the slices in the two executions, the analyzer can evaluate the changes in program behavior before and after the bottleneck is eliminated, and then estimate the effect of performance optimization. More importantly, the slices also retain rich data flow information. By analyzing the changing trends of this information over time, the analyzer can predict the impact of bottlenecks on key performance indicators, such as memory usage growth trends, IO wait time distribution, etc., providing an important quantitative basis for performance evaluation.

[0066] Based on the above analysis results, the analyzer can systematically characterize the full-cycle characteristics of bottlenecks, such as symptoms, root causes, impacts, and optimization potential, from multiple perspectives, and provide developers with practical optimization decision suggestions, such as algorithm replacement, data structure adjustment, and concurrency optimization. Compared with traditional performance analysis tools, this tool has the following significant advantages: First, DSL makes the performance analysis process highly automated, avoiding tedious manual plug-in and greatly improving the analysis efficiency; second, the introduction of symbolic execution technology breaks through the bottleneck of traditional sampling analysis, making performance analysis move from phenomenon to essence, not only locating the bottleneck, but also revealing the semantic root cause of the bottleneck in depth; third, the use of slice analysis and flow dependency analysis makes bottleneck analysis move from local to global, characterizing the impact trajectory of bottlenecks in time and space, and providing a direct basis for evaluating optimization benefits; finally, this tool establishes a complete performance analysis paradigm, covering the entire performance analysis process such as bottleneck location, root cause analysis, impact assessment, and optimization decision, so that traditional empirical performance tuning is elevated to a scientific and engineering practice based on measurement and reasoning.

[0067] Undoubtedly, the innovative dynamic analysis mechanisms such as logic checking, difference analysis, and bottleneck diagnosis proposed in this embodiment have significantly expanded the observability, explainability, and optimizability of program behavior, and achieved a comprehensive perspective from macro to micro, from phenomenon to essence, and from behavior to mechanism. It will definitely provide strong technical support for improving software development efficiency, optimizing software running performance, and ensuring software system reliability, and will have a far-reaching impact on software engineering theory innovation and practical application. Next, based on the existing achievements, the present invention will continue to explore new methods of large-scale and intelligent program behavior analysis with domain knowledge as the guide and execution data as the basis, and finally form a set of end-to-end program behavior insight technology system and tool platform to fully enable intelligent software development, analysis, and operation and maintenance.

[0068] Embodiment 3: This embodiment provides a method for replaying and visualizing the program execution process. This method is based on the system described in Embodiment 1, further refines the specific implementation mechanism of each step, and forms a complete program behavior analysis process.

[0069] Specifically, the first step of the method is to dynamically instrument the target program, capture detailed information when the program is executed in real time, and form a complete execution information record. In order to achieve efficient and accurate information collection, this embodiment adopts an adaptive multi-granularity instrumentation strategy. The strategy performs static analysis on the program during the compilation phase, estimates the execution frequency and information density of each code area according to the complexity of the control flow and data flow, and then automatically determines the optimal instrumentation method and instrumentation point location for each area in combination with the user-configured collection granularity requirements. For example, for areas with frequent execution but relatively stable information, the strategy tends to choose sparse instrumentation based on sampling, sacrificing trace accuracy in exchange for a larger performance improvement; while for areas with moderate execution frequency and rich information, the strategy tends to choose fine-grained full instrumentation, with minimal performance loss to obtain the maximum analysis accuracy. In addition, in order to further reduce the instrumentation overhead, the strategy will also dynamically adjust the instrumentation parameters, such as sampling frequency, filtering conditions, etc., at runtime, striving to achieve the best balance between information completeness and execution efficiency.

[0070] The generated execution information record will be sent to the execution information record library described in Example 1, and will be permanently stored after regularization and indexing for subsequent playback, analysis and visualization. It is worth mentioning that the record library adopts a hybrid storage architecture, which comprehensively uses multiple data organization forms such as row storage, column storage, and memory cache to optimize for different data characteristics and access modes. For example, for data that tends to be read sequentially, such as statement execution sequences, the record library selects a row-oriented storage format and B+ tree index to ensure the efficiency of continuous IO; while for state variable snapshots, which tend to be read randomly, the record library selects a column-oriented storage format and hash index to improve random access performance. At the same time, the record library will also dynamically adjust the distribution of data between disk, memory, and cache according to the timeliness characteristics of the data, follow the principle of most recent use, and ensure that frequently queried hot data is always retained in the fastest storage medium. Through these optimizations, the record library can support the long-term retention of massive execution information while meeting the stringent requirements of the playback and analysis process for data real-time performance.

[0071] The second step of the method is to use the playback engine to reproduce the historical execution process of the program based on the execution information record obtained in the first step, and respond to the user's interactive analysis request. This embodiment comprehensively optimizes the design of the playback engine, introduces a series of synchronization and incremental mechanisms, and strives to achieve real-time and dynamic playback of execution information under limited hardware resources. First, the engine uses a lightweight virtual machine as the playback operation environment, which can directly interpret the bytecode instruction sequence recorded in the execution plug-in log without prior decompilation into machine code, saving preparation time before operation. Secondly, for state playback, the engine proposes a continuous checkpoint mechanism. Traditional state playback requires frequent serialization of the entire system state to disk, and then restores from the checkpoint when the user queries the historical state. This strategy not only consumes a lot of IO, but also makes it difficult to support fine-grained random access. The continuous checkpoint mechanism adopts an incremental approach, that is, the state change amount is captured each time instead of the full amount, and the change amount is continuously stored at an extremely fine time granularity (such as milliseconds). When a user queries any historical state, the engine only needs to execute the changes sequentially from the most recent checkpoint to quickly reach the target moment, and this process can make full use of the restored state, avoiding the huge overhead of replaying from the beginning. Finally, for repeated playback during the analysis process, the engine has also designed a differentiated reuse mechanism. This mechanism automatically tracks the time interval involved in each playback request, and caches and reuses the playback results of different intervals. When faced with playback requests with two overlapping intervals, the engine will compare their timestamps and intelligently determine whether the existing playback results can be reused, rather than simply replaying them, thereby minimizing the cumulative overhead of repeated playback.

[0072] Thanks to the collaboration of these innovative mechanisms, the playback engine of this embodiment has reached the industry-leading level in terms of both space utilization and response time, laying a high-performance data foundation for subsequent interactive analysis.

[0073] The third step of the method is to project the intermediate results produced by the playback engine to various visualization views, and respond to the user's interactive operations on the view to form an active and continuous analysis closed loop. This embodiment further optimizes and expands the multi-dimensional visualization module described in Example 1 to improve the fluency and coherence of visual analysis. On the one hand, various views adopt a multi-level progressive rendering strategy when drawing, that is, first presenting an overview of the visual elements, and then gradually adding detailed information, allowing users to start exploring and analyzing during the data loading process, breaking the serial workflow of "data preparation-overall drawing-interactive exploration" in traditional visualization, and realizing the process of visual analysis. Streamlined and continuous. On the other hand, the module also introduces a rule-based adaptive view recommendation mechanism. According to different analysis intentions and data characteristics, the mechanism automatically matches the most relevant view types and configuration parameters, and dynamically adjusts the view with the user's interactive behavior, so that it always focuses on the data perspective with the richest information and the highest value. For example, when a user browses the execution process of a function through the code view, if the function happens to contain a complex nested loop, the analysis intention is likely to understand the iteration mode of the loop. At this time, the mechanism will automatically recommend configuring the iteration count statistics chart and the call stack comparison chart to highlight the dynamic characteristics of the loop; if the function happens to frequently read and write certain shared variables, the analysis intention is likely to focus on data competition. At this time, the mechanism will automatically switch to focus on the read and write operation timing alignment chart of these variables. It is precisely relying on this adaptive view linkage mechanism that this embodiment combines the views of each analysis stage into a seamless and complementary whole, allowing users to switch freely between overviewing the overall situation and focusing on the local situation, greatly expanding the breadth and depth of visual analysis.

[0074] Furthermore, this embodiment also designs a variety of composite interaction paradigms for program understanding, further releasing the imagination space of visual analysis. Here are two typical interaction paradigms as examples: The first is the "see the anomaly - trace the root cause" paradigm. When users observe abnormal execution features in a certain view, they can directly mark the relevant visual elements on the view, and then use the feature matching algorithm based on similarity to automatically retrieve the context information and code snippets most relevant to the abnormal features, and intuitively reveal the causes and consequences of the anomaly. Subsequently, users can also explore the propagation and influence chain of these related information in the execution flow through the interactive root cause analysis tool. Based on dynamic taint analysis technology, this tool traces back the statements and variables involved in the abnormal features, identifies their data dependencies and control dependencies, and finally locates the semantic "root cause" of the anomaly. It is worth mentioning that, given the conditionality and uncertainty of the program execution path, it is inevitable that there will be analysis uncertainty or incomplete dependencies in the process. In response to this, the tool adopts a fault-tolerant mechanism, that is, using confidence scores to characterize the credibility of each step of the analysis conclusion, and dynamically adjusts the breadth and depth of the analysis accordingly, and adaptively balances the analysis quality and analysis efficiency. Through this paradigm, users can establish a direct connection between the anomalies observed in the view and potential defects in the code, and locate defects in a targeted manner based on execution characteristics. Its efficiency and accuracy are improved compared to traditional simple code analysis.

[0075] The second is the "Compare Differences - Active Optimization" paradigm. When users want to understand the differences in performance or behavior between two different executions, they can first use the difference execution analyzer to automatically detect the main differences between the two executions in the time and space dimensions, and generate an intuitive visual summary of the differences, so that the differences are clear at a glance. On this basis, users can use interactive profiles and correlation analysis tools to deeply explore the differences in the execution resource usage and internal laws. For example, for the significant difference in the running time of two benchmarks, users can use the hierarchical sampling mechanism of adaptive tuning parameters to analyze the distribution and aggregation characteristics of the differences at the granularity of functions, basic blocks, statements, etc. layer by layer, and quickly lock the key change points of time consumption; for another example, for the repeated fluctuations in throughput, latency and other indicators of two stress tests, users can use the correlation model based on trend fitting to reveal the nonlinear correlation between performance indicators and factors such as resource utilization and scheduling delay, and then actively optimize potential performance bottlenecks. It is worth mentioning that these analysis tools adopt an innovative incremental computing architecture. With the dynamic addition of comparative executions, processes such as difference detection and correlation analysis can be continuously updated based on the original results, avoiding the huge overhead of calculation from scratch. Through this paradigm, users can continuously evaluate the performance of the program in multiple quality dimensions based on real workloads, guide the entire process of performance optimization based on objective facts and scientific basis, and truly achieve active optimization oriented to usage.

[0076] In summary, this embodiment uses multi-granularity dynamic instrumentation as the data basis, high-performance execution playback as the technical support, declarative visual mapping as the analysis handle, and composite interactive paradigm as the application outlet, systematically optimizing the data preparation, view drawing, interactive exploration and other links of program behavior visual analysis, and finally forming a set of automated, integrated, and intelligent full-process analysis solutions with unprecedented high degrees of freedom and strong insight. Looking back at the forefront of the times, program visualization technology has gone through multiple development stages such as code navigation, execution profiles, and runtime tracking. However, due to the limitations of underlying data and analysis models, it has never been able to move from data presentation to active data discovery, and cannot transform perceptual visual clues into rational optimization decisions, so it faces the crisis of insufficient application value and innovation motivation. The breakthrough of this embodiment lies in the construction of a visual analysis framework that organically integrates data acquisition, semantic reconstruction, interactive exploration, causal reasoning, and optimization decisions.

[0077] Example 4: This example demonstrates how to integrate the program execution process playback and visualization system of the present invention into a mainstream integrated development environment (IDE) to form an end-to-end visualization debugging solution, truly making analysis ubiquitous and optimization readily available.

[0078] At present, mainstream IDEs generally have the problem of disconnection between debugging and development functions. Although traditional debuggers provide necessary means such as breakpoints and single-stepping, the debugging process is separated from code editing, running tests and other links, making it difficult for developers to establish a continuous understanding of code and running behavior. However, this embodiment seamlessly embeds the visual analysis function into the IDE, making program execution completely transparent to developers, allowing them to have a full insight into the real running posture of the program while coding, and to conduct interactive debugging at any time based on the observed features, truly achieving "what you see is what you think, what you think is what you get".

[0079] In the specific implementation, this embodiment first transforms the project management module of the IDE and introduces the concept of a visual execution plan. The so-called visual execution plan is a set of configurations used to guide the instrumentation, collection, analysis, and presentation of specific code snippets. Its content may include target code range, instrumentation granularity, filter expressions, focus data, view templates, etc. Developers can define different plans for different code snippets to form an execution plan set. The execution plan set is persisted together with the code project, and its life cycle is completely synchronized with the code. When the IDE is started, the project management module will automatically load the execution plan set bound to the project, so that the execution plan is explicitly associated with the corresponding source code file.

[0080] Furthermore, this embodiment also introduces an explicit expression of visual execution plans in the source code editor. For each code snippet covered by the plan, the editor will add a special texture to the background of the corresponding area to intuitively identify that the snippet is in the context of visual execution. When the developer hovers the cursor over the snippet, the integrated execution plan editing panel will automatically pop up, displaying the detailed configuration of the plan, and providing a graphical editing interface so that developers can easily adjust the plan. It is worth mentioning that, thanks to the execution feature DSL proposed in Example 2, developers can directly define the execution features of interest in a declarative manner without having to write cumbersome collection and analysis code, which greatly reduces the threshold for use.

[0081] When the code is executed, the IDE will automatically instrument the target code according to the execution plan set, and transmit the collected information to the integrated execution analysis engine in real time. The engine will stream the execution information and extract the features that the plan focuses on. Once an abnormal feature or a special event predefined by the user is found, the engine will immediately interrupt the execution and notify the IDE of the execution site and the triggering event.

[0082] After receiving the notification, the IDE will automatically position the cursor to the line of code that triggered the event, and pop up the execution scene panel next to the editor. This panel comprehensively uses the multi-dimensional visualization view in Example 1 to present the execution fragments before and after the event in the form of a timeline. Developers can freely drag on the timeline to replay the program state at any historical moment. For abnormal features observed in the panel, developers can also start advanced analysis such as difference analysis and root cause tracing proposed in Example 2 to quickly locate defects with the help of precise visual clues.

[0083] Furthermore, this embodiment also provides an innovative feedback-driven optimization mechanism. Through this mechanism, developers can directly mark the execution features that need to be focused on and optimized in the execution site panel, and attach text descriptions of the improvement intention. The IDE will automatically synchronize these focus points and descriptions to the execution plan, and continue to track the performance of the focus points in subsequent executions. At the same time, the IDE will also call the machine learning component to cluster the features similar to the focus points in the massive execution samples, refine the optimization experience, and form improvement suggestions. During the code editing process, once the IDE finds that the code snippet that the developer is modifying has had marked features, it will actively push optimization suggestions and prompt potential improvement directions. If the developer adopts the suggestion, the IDE will also automatically compare the differences in execution features between the two versions before and after, and instantly evaluate the optimization effect. Through this mechanism, developers can easily feed back the optimization clues found at runtime to the coding stage, guide more accurate optimization decisions, and objectively evaluate the effect of each code change, so as to achieve closed-loop management of the entire optimization process.

[0084] In summary, this embodiment organically integrates the aforementioned key technologies with IDE, and establishes a two-way bridge between coding, execution, analysis, optimization and other links, ultimately forming a visual debugging closed loop that "starts with problem discovery and ends with problem solving", truly transforming execution analysis from a static backtracking after the fact to a dynamic prevention in advance, making performance problems invisible and achieving immediate optimization results. It can be expected that this intensive, full-game debugging paradigm will become the standard configuration of future IDEs.

[0085] Example 5: This example further expands the application of the aforementioned systems and methods in the field of serverless computing. Serverless computing is an innovative computing model that has emerged in recent years. Its core concept is to "encapsulate services with functions, drive execution with events, and schedule and run with the cloud", simplifying the development, deployment, and operation and maintenance of distributed applications. Although this model greatly improves the agility of application delivery, it also brings unprecedented challenges to program behavior analysis. On the one hand, due to the dynamic scheduling and short life cycle of the serverless platform, it is difficult for a single function instance to obtain complete and continuous execution information. On the other hand, due to the loose coupling and asynchronous communication between functions, the traditional thread-centric execution model is no longer applicable. How to collaboratively analyze the naturally isolated execution flows between function instances has become a difficult problem that needs to be solved urgently in the industry.

[0086] In response to the above challenges, this embodiment innovatively proposes a set of full-stack program behavior tracing and analysis technologies for serverless computing. This technology uses service meshing and instrumentation probe clustering as infrastructure support, request context awareness and distributed execution flow stitching as data preparation methods, and topology dependency graphs and directed acyclic call graphs as visualization analysis models, forming a new execution perspective paradigm with all-round perception, global association, and full-stack analysis, providing a powerful tool for in-depth understanding of the operating mechanism of serverless applications.

[0087] In the specific implementation, this embodiment first transforms the deployment architecture of the serverless platform and introduces a service grid as the infrastructure for distributed tracing. The so-called service grid is a lightweight network proxy layer located above the application service, which is responsible for the connection, management, and observation between service instances. For each application carried on the platform, this embodiment declares a dedicated grid in its deployment configuration. When a function instance in an application is dynamically created, the platform automatically connects it to the application-specific grid. Here, the access point of the grid is a functionally enhanced Sidecar agent. The agent has built-in logic for execution information collection and transmission, and can be regarded as a lightweight "insertion probe". During the operation of the function instance, the agent will capture the requests and responses in and out of the instance in real time, extract the header information (such as tracking ID, parent ID, etc.), and associate it with the execution event of the instance (such as call start, call end), forming discrete "execution tracking records", and sending the records asynchronously to the central execution information library through the message queue. Compared with the code plug-in in Example 1, this black box grid agent plug-in has lower invasiveness and stronger versatility, and is more suitable for the dynamic characteristics of the serverless platform.

[0088] Furthermore, since the various plug-in probes distributed in the grid work independently, the discrete execution trace records they generate naturally lack a global perspective. In order to establish the association between different function instances in the execution flow, this embodiment proposes a distributed execution flow stitching technology based on request context propagation. The core idea is to weave all the execution fragments involved in an end-to-end call into a complete, directed acyclic "call topology graph" by setting a unified tracing ID and parent-child ID in the request header. Among them, the tracing ID uses a globally unique identifier for an end-to-end call, and the parent-child ID characterizes the two consecutive execution fragments in the same call. In terms of specific implementation, this embodiment follows the HTTP header format defined in the OpenTracing specification, where the tracing ID uses Uber's Trace ID format to ensure global uniqueness; the parent-child ID is represented by SpanID, and the child SpanID is incremented based on the parent SpanID to reflect the call hierarchy. Thanks to this unified context representation, the execution trace records scattered in the grid agent can be easily stitched into a complete end-to-end call topology.

[0089] After the execution trace records are transmitted to the central execution information repository, this embodiment will further organize them into two types of views: topology dependency graph and directed acyclic call graph. The former takes the application as the unit, macroscopically depicts the service topology and its internal call dependencies; the latter takes the end-to-end request as the unit, and fine-grainedly displays the function execution chain of a call in time sequence. These two views present the operation panorama of serverless applications from global to local, multi-level and multi-perspective, and are the basis for subsequent visual analysis.

[0090] Based on the macro view, i.e., the topology dependency graph, this embodiment designs a series of visual analysis mechanisms for application architecture and service quality. Here we take two typical analysis scenarios as examples: The first is the correlation analysis of functional and non-functional requirements. In the topology view, developers can directly annotate functional attributes and non-functional attributes on related functions in a declarative manner, such as "login verification", "image processing" and other functions, as well as non-functional requirements such as "real-time response" and "high availability". In the process of execution tracking, the embodiment will automatically associate the attribute annotations of the function nodes with their runtime indicators (such as throughput, latency, error rate), and find the cluster of functions that contribute most to specific non-functional requirements based on similarity clustering, that is, the key influencing factors of performance and reliability. On this basis, the embodiment will further compare the clustering results of different periods, characterize the dynamic changes of requirements and influencing factors, and intuitively reveal the evolution of the system in terms of quality attributes such as function, performance, and stability. Through this analysis, developers can objectively evaluate the impact of each functional iteration on the macro quality of the system and formulate targeted optimization plans.

[0091] The second is the root cause analysis based on dependency relationships. When an application has an exception, it is usually difficult to locate deep faults by terminal feedback alone due to the influence of asynchronous calls and multi-level nesting between functions. To address this problem, this embodiment makes full use of topological dependency information and designs a reverse recursive root cause reasoning mechanism. When a function node is reported to have an exception, the mechanism will automatically check all direct and indirect upstream nodes of the node, compare their execution indicators with historical normal values, and determine whether it is a "suspect node" that introduces the exception. Then, the upstream of the suspect node is analyzed in the same way, and the source is traced back recursively until no more suspect nodes are found. After the recursion converges, the path from the original abnormal node to the last layer of suspect nodes is the "critical execution chain" that introduces the exception. Furthermore, the embodiment will compare the differences before and after the recent executions of each node in the critical execution chain (such as input parameters, state variables) to identify the "difference points" that are most likely to cause the exception. Finally, the embodiment will comprehensively score the suspicion of each node in the critical execution chain to form a comprehensive ranking, which is output to the developer for auxiliary judgment. Through this analysis, developers no longer need to look for clues in a vast number of call records, but can start from the most suspicious locations, greatly narrowing the scope of investigation and improving the efficiency of fault location.

[0092] The microscopic view, i.e. the directed acyclic call graph, is used to analyze the execution details of an end-to-end call. This embodiment designs a variety of interactive analysis functions around this view, and two of them are highlighted here: The first is the difference call comparison. Developers can open two call graphs at the same time and select the execution fragments of the same function in the two calls to visually compare their differences in time consumption, resource usage and other indicators. Furthermore, developers can also compare the two calls before and after the function to view the changes in the state variable values. Through this function, developers can intuitively locate the key differences in performance and resource usage.

[0093] The second is call flow reorganization. Developers can select any function node on the call graph, extract several function calls before and after its execution fragment, and reorganize them into a custom "focus call chain". The system will automatically filter out call details that are not related to the focus, allowing developers to focus on analyzing the most interesting execution flow. At the same time, based on the call patterns extracted from massive execution samples, the system will also intelligently recommend some common focus call chains to further simplify the configuration burden of developers.

[0094] Combining the analysis functions of the above two views, this embodiment builds a three-dimensional execution analysis model that focuses on different granularities, which not only supports the dynamic control of application architecture and service quality from the overall perspective, but also deeply reveals the internal mechanism of key execution flows, forming a set of effective program behavior insight solutions specifically targeting the characteristics of serverless computing. Undoubtedly, this set of methods has important practical guiding significance for guiding the architecture design, performance optimization, and fault diagnosis of serverless applications.

[0095] A significant advantage of this embodiment is that it fully utilizes the inherent "transparency" of the serverless platform. Due to the platform's lifecycle management of applications, user code is distributed in the form of images, and the platform can modify the images without the user's awareness, such as injecting Agents, mounting Sidecars, etc., thereby achieving full coverage of application-level monitoring and tracking. Different from the traditional "on-demand monitoring" paradigm, this "monitoring as code" paradigm allows the collection of analytical data and the construction of application code to be completely decoupled, achieving "innate immunity" in terms of observability.

[0096] Another key innovation of this embodiment is that a new distributed execution representation paradigm is formed with gridded plug-ins as the data source and request stream weaving as the data form. This paradigm is no longer confined to a single thread or process, but uses end-to-end requests as the basic unit of execution flow, and panoramically depicts the interaction between services from the two dimensions of time and space. It can be said that this is a bottom-up execution representation method that adapts to the inherent complexity of distributed applications, and injects new vitality into the traditional "thread / process-centric" program behavior analysis paradigm.

[0097] In summary, this embodiment has systematically innovated from multiple aspects such as infrastructure, data form, visualization, and interactive analysis around the characteristics of serverless computing, and built a full-stack program behavior tracking and analysis technology. This technology can not only restore the operating truth of serverless applications in an all-round and fine-grained manner, but also provide developers with a powerful weapon to face the complexity of distributed environments, and will play an indispensable role in improving operation and maintenance efficiency and ensuring service quality. Looking to the future, this program behavior insight technology in a "large distributed" environment is expected to become the commanding height of intelligent operation and maintenance, opening up new ideas for application management and optimization in the cloud computing era.

[0098] It should be noted that the above embodiments are only preferred embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art may make various modifications or equivalent substitutions to the above embodiments without violating the spirit and essence of the present invention. For example, the data acquisition capability of the code execution recording module may be expanded to more dimensions, such as CPU occupancy, I / O operations, etc.; the function of generating automated test scripts may be added to the execution process playback module; more machine learning models may be integrated into the intelligent analysis module to support personalized problem detection, etc. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A system for replaying and visualizing program execution, which aims to improve the efficiency of program teaching and learning, and supports troubleshooting in production environments, especially serverless architectures, characterized in that: include: The program execution information collection module is used to dynamically instrument the target program and capture detailed information during program execution in real time, including but not limited to statement execution order, variable value changes, stack information, memory allocation, etc., to form a complete execution information record; An execution process playback engine, based on the execution information record, gradually reproduces the execution process of the program and supports interactive operations, including but not limited to pause, forward, backward, breakpoint debugging, etc.; Multi-dimensional visualization module, which presents the program execution status in a graphical and visual way, including but not limited to source code highlighting, variable view, call stack visualization, memory object view, etc.; The cross-language support framework achieves compatibility and extended support for mainstream programming languages ​​through language-independent abstract interfaces and plug-in adapters.

2. The system according to claim 1, characterized in that The program execution information acquisition module adopts dynamic binary plugging technology to realize fine-grained execution information extraction without affecting the normal operation of the target program.

3. The system according to claim 1, characterized in that The execution process playback engine supports random access to historical execution time points, provides interactive debugging functions such as pause, resume, single step, breakpoints, etc., and can synchronously present the program status at the corresponding moment.

4. The system according to claim 1, characterized in that The multi-dimensional visualization presentation module includes multiple perspectives such as source code view, variable tracking view, call stack view, memory layout view, etc., which intuitively present the execution trajectory and state changes of the program.

5. The system according to claim 1, characterized in that The cross-language support framework defines a set of language-independent execution information collection and presentation interfaces, and provides customized support for mainstream programming languages ​​in a plug-in manner.

6. The system according to claim 1, characterized in that It also includes sophisticated interactive analysis tools, including but not limited to logic assertion analysis, difference comparison, visual statistical views, etc., which support in-depth analysis of key states and execution paths.

7. A method for replaying and visualizing a program execution process, characterized in that: The steps include: Dynamically instrument the target program to capture detailed information during program execution in real time, forming a complete execution information record; Based on the execution information record, the execution process of the program is gradually reproduced using a playback engine to respond to user interaction operations; Present the program execution status in a graphical and visual way, including but not limited to source code highlighting, variable view, call stack visualization, memory object view, etc.; Compatibility and extended support for mainstream programming languages ​​are achieved through language-independent abstract interfaces and plug-in adapters.

Citation Information

Cited By

  • Tree component optimization method based on React framework and fusing virtualization rendering and increment rendering

    CN119668568A

  • Private authority detection method and system in game issuing access

    CN122133175A