Code generation agent visualization system and method based on causal chain construction

By constructing a causal chain visualization system, the internal task flow and decision-making logic of the embedded code generation agent can be captured and visualized in real time, solving the problem of opaque internal processes of the agent and improving the efficiency of human-machine collaborative development and the quality of code generation.

CN122044548APending Publication Date: 2026-05-15NANJING RES INST OF ELECTRONICS TECH
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING RES INST OF ELECTRONICS TECH
Filing Date
2026-04-20
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

The existing embedded code generation agents have opaque internal processes, unclear causal logic in decision-making, limited information presentation methods, weak user interaction guidance capabilities, and are unable to effectively respond to dynamic domain constraints, resulting in low efficiency in human-machine collaborative development.

Method used

A visualization system based on causal chains is constructed. Through multi-source data acquisition, causal chain construction and data structuring, multi-view collaborative rendering and interactive feedback layer, the system can capture and visualize the internal task flow and decision-making logic of the intelligent agent in real time, and provide multi-dimensional evaluation and interactive guidance.

Benefits of technology

It significantly improves the interpretability and transparency of intelligent agents, enhances users' understanding and trust in the behavior of intelligent agents, improves the efficiency and quality of code generation, and reduces development costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122044548A_ABST
    Figure CN122044548A_ABST
Patent Text Reader

Abstract

The invention discloses a code generation agent visualization system and method based on causal chain construction, and relates to the technical field of embedded software research and development. Multi-source heterogeneous data generated in the intelligent body is integrated into a clear causal chain model, and the iteration process of the abstraction and black box of the intelligent body is displayed as visual and traceable graphical information; furthermore, interactive guide mechanisms such as weight adjustment, task backtracking and branching, constraint injection and the like are designed and provided, so that a user can carry out real-time intervention and dynamic guide on the operation logic of the intelligent agent based on visualization, and closed-loop control of data perception, causal visualization, user interaction and intelligent feedback is formed; the code generation process is finely monitored, deeply understood and efficiently optimized, and the controllability, interpretability and final output quality of code generation are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of embedded software development technology, and more specifically, to a code generation intelligent agent visualization system and method based on causal chain construction. Background Technology

[0002] With the increasing application of artificial intelligence in software engineering, code generation agents have become an important tool for improving development efficiency. These agents typically integrate complex models that can receive user requirements and generate high-quality code through multiple iterations (including tasks such as code generation, compilation, testing, and evaluation).

[0003] However, existing technologies have the following significant drawbacks:

[0004] The black-box problem and lack of interpretability: The internal decision-making process of an intelligent agent is opaque to the user. Users can only see the final code output and have no idea why the agent makes a specific decision, the causal logic between different tasks, or the basis for the trade-offs of intermediate results. When the results do not meet expectations, users find it difficult to pinpoint the root cause of the problem and cannot effectively guide the agent to optimize, which seriously restricts the development of human-machine collaboration.

[0005] Information presentation is flat: Most current tool interfaces are based on simple chat windows or code editors, and the information presentation is monotonous. They cannot effectively display the complex task flow states such as parallel, serial, and conditional branching within the agent, nor can they associate code evaluation metrics with specific code versions.

[0006] Weak interaction and guidance capabilities: Due to the lack of visualization of the internal state causal chain, the interaction between users and intelligent agents remains at the primary dialogue-response mode, and it is impossible to make refined intervention based on visualized process insights.

[0007] Therefore, how to break the black box of intelligent agents, construct the causal chain of their internal decision-making and execution processes, and visualize it in an intuitive and understandable way, thereby providing more powerful interaction and guidance capabilities to adapt to intelligent agents, is a problem that current technology urgently needs to solve. Summary of the Invention

[0008] The purpose of this invention is to solve the technical problems of existing embedded code generation agents, such as opaque internal processes, unclear causal logic in decision-making, limited information presentation methods, weak user interaction guidance capabilities, and inability to effectively respond to dynamic domain constraints. The invention provides a multi-dimensional, dynamic visualization method that can construct and visualize the internal task flow and causal chain of decision-making logic of an agent, as well as the evaluation results of functions, performance, and reliability associated with this causal chain. This enhances users' understanding and trust in the agent's behavior and improves the efficiency of human-machine collaborative development.

[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows: a code generation intelligent agent visualization system based on causal chain construction, including a data source layer, a data processing and output layer, and an interactive feedback layer;

[0010] The data source layer includes an embedded code generation agent and a multi-source data acquisition module; the data processing and output layer includes a causal chain construction and data structuring processing module and a visualization rendering engine; the interactive feedback layer includes a multi-view collaborative visualization module and an interactive analysis and guidance module.

[0011] The multi-source data acquisition module is used to capture multi-source heterogeneous data from the agent in real time; the causal chain construction module parses, aligns and associates the multi-source heterogeneous data, integrating discrete events and data into a causal chain data model with clear causal logic that runs through the entire lifecycle of the code generation task; the multi-view collaboration module, based on the causal chain data model, performs collaborative rendering through task flow time sequence, multi-dimensional evaluation radar and version evolution comparison view, to present the internal decision-making logic and execution process of the agent in an interpretable and visual way.

[0012] As a preferred structure of the present invention, the embedded code generation agent is the data source and the observed object of the entire visualization system. It is responsible for receiving the user's control instructions and executing specific embedded code generation tasks. During operation, the agent continuously generates and outputs multi-source heterogeneous data reflecting its internal state based on internal strategies and external inputs.

[0013] As a preferred structure of the present invention, the specific embedded code generation task includes a management and control module, a large model, an embedded heterogeneous compilation module, a dynamic and static testing module, a performance analysis module, and an embedded real-time status acquisition module.

[0014] The multi-source heterogeneous data includes task flow topology, decision path, evaluation metrics, code version snapshots, compilation logs, and embedded device status.

[0015] As a preferred structure of the present invention, the multi-source data acquisition module is used to capture various types of state data in multiple dimensions and in real time from the embedded code-generated intelligent agent. The multi-source data acquisition module connects to different data interfaces of the intelligent agent system through various module adapters, subscribes to events of heterogeneous data in the embedded code generation and execution process, classifies and aggregates the raw data, and then transmits it to the data processing and output layer in a unified manner.

[0016] As a preferred structure of the present invention, the causal chain construction and data structuring processing module is used to serialize and structure the collected raw data to construct a data causal chain that runs through the entire life cycle of the task; the causal chain construction and data structuring processing module cleans, aligns and parses the multi-source data transmitted from the data source layer, transforms unstructured logs and snapshots into a unified internal data model, and establishes cross-data source event associations based on task flow topology and decision logic to form a data structure with causal logic to support visualization rendering.

[0017] As a preferred structure of the present invention, the intelligent agent data structuring processing elements include:

[0018] Task flow data: describes the type, status, dependencies, and execution order of tasks;

[0019] Decision data: Records the decision inputs and outputs of the iterative evaluation module;

[0020] Evaluation data includes quantitative scores for static tests, functionalities, and performance metrics for each code version;

[0021] Code snapshot data: Stores the code version and metadata generated in each iteration cycle;

[0022] Embedded real-time status: The running status of embedded software on the hardware platform;

[0023] The above multi-source data is processed in batches and structured to form a complete task-centric logical dataset according to a unified time series.

[0024] As a preferred structure of the present invention, the visualization rendering engine is the core execution unit for graphics generation, responsible for mapping structured data into specific visualization graphics; the visualization rendering engine receives standardized data from the data structuring processing module, and calls the underlying graphics library interface to draw basic visual components according to the preset visual encoding scheme.

[0025] As a preferred structure of the present invention, the multi-view collaborative visualization module includes basic views generated by the visualization rendering engine. Through layout management and view linkage mechanisms, it constructs a dynamic, multi-dimensional intelligent agent behavior observation window, rendering three interconnected and collaboratively interactive visualization views, including:

[0026] Task flow timeline view: The timeline is used as the horizontal axis, different swimlanes represent parallel task execution units, nodes of different shapes and colors represent tasks of different types and states, and arrowed lines represent logical dependencies and data flow between tasks.

[0027] Multi-dimensional evaluation radar chart: Dynamically generate a radar chart for the user's currently selected code version. Each axis represents a dimension of embedded software evaluation indicators. By comparing the fit of the current version with the preset embedded software target outline in the chart, the gap between the current version and the target is displayed.

[0028] Version Evolution and Comparison View: Displays generated code versions in list or thumbnail format, with key metrics marked, including overall performance and compilation status. Users can select two or more versions for comparison, and plot the evolution curve of the embedded software's overall score with the number of iterations, showing the trend and inflection points of the optimization process.

[0029] As a preferred structure of the present invention, the interactive analysis and guidance module is used to transform the user's analysis and control into intervention in the operation process of the intelligent agent, capture the user's human-computer interaction behavior, parse it into specific instructions or parameters, and transmit it to the embedded code generation intelligent agent for the next iteration.

[0030] This invention also provides an interpretable visualization method for embedded code generation agents based on causal chain construction. This method constructs a multi-view collaborative visualization framework that is linked in real-time with the agent's iterative process. It integrates multi-source heterogeneous data generated within the agent into a clear causal chain model, presenting the abstract, black-box iterative process of the agent as intuitive and traceable graphical information. Furthermore, it designs and provides interactive guidance mechanisms such as weight adjustment, task backtracking and branching, and constraint injection, enabling users to intervene and dynamically guide the agent's operational logic in real-time based on visualization. This forms a closed-loop control system of data perception, causal visualization, user interaction, and intelligent feedback, achieving refined monitoring, deep understanding, and efficient optimization of the code generation process, significantly improving the controllability, interpretability, and final output quality of code generation.

[0031] Specifically, the following steps are included:

[0032] Step 1: Real-time data capture. Deploy a multi-source data acquisition module to capture multi-source heterogeneous data generated by the embedded code generation agent during task execution in real time, and timestamp all multi-source heterogeneous data and store it in a structured database.

[0033] Step 2: Causal chain construction and data structuring. The data structuring module processes the captured multi-source heterogeneous data to construct a multimodal data causal chain that spans the entire lifecycle of the task.

[0034] Step 3: Visualization and rendering. The visualization and rendering engine reads the structured data and generates and renders at least three collaborative visualization views. When a user interacts with an object in any view, the other views can simultaneously highlight or display relevant information that has a causal relationship with the data entity.

[0035] Step 4: Interface display and interactive feedback. Users interact with strategies and parameters through a visual interface.

[0036] As described above, the technical solution adopted in this invention has the following beneficial effects:

[0037] 1. This invention significantly improves the interpretability and transparency of intelligent agents: by constructing and visualizing the causal chain of task flow and decision-making logic within the intelligent agent, the abstract decision-making process is transformed into intuitive and traceable graphical information, effectively overcoming the black box problem and enabling users to deeply understand the working principle and decision basis of the system.

[0038] 2. This invention enhances the efficiency of intelligent agent problem localization and interaction: Through visualized causal chain feedback and interactive guidance, users can quickly locate the root cause of the problem, adjust the strategy, and guide the intelligent agent to evolve in a more expected direction, significantly improving the efficiency and quality of code development.

[0039] 3. This invention improves the efficiency and quality of embedded software development: Through a collaborative development environment, users can discover embedded software performance bottlenecks, design defects, and optimization directions earlier, effectively reducing later testing and maintenance costs and improving the overall project success rate. Attached Figure Description

[0040] Figure 1 This is a block diagram of the code generation intelligent agent visualization system based on causal chains according to the present invention.

[0041] Figure 2 This is a flowchart of the code generation intelligent agent visualization method based on causal chain construction of the present invention. Detailed Implementation

[0042] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0043] like Figure 1 As shown, the present invention discloses an interpretable visualization system for an embedded code-generating intelligent agent based on causal chain construction, which mainly includes three layers: a data source layer, a data processing and output layer, and an interactive feedback layer. The data source layer includes an embedded code-generating intelligent agent and a multi-source data acquisition module; the data processing and output layer includes a causal chain construction and data structuring processing module and a visualization rendering engine; and the interactive feedback layer includes a multi-view collaborative visualization module and an interactive analysis and guidance module.

[0044] like Figure 2 As shown in this embodiment, an interpretable visualization method for code generation agents based on causal chain construction is disclosed. First, a data acquisition module captures multi-source heterogeneous data from the agent in real time. Then, a causal chain construction module parses, aligns, and correlates the data, integrating discrete events and data into a unified data model with clear causal logic that runs through the entire lifecycle of the code generation task. Finally, a multi-view collaboration module, based on this causal chain data model, performs collaborative rendering through task flow time sequence, multi-dimensional evaluation radar, and version evolution comparison view to present the internal decision-making logic and execution process of the agent in an interpretable and visualized manner. It also supports user intervention through interactive analysis and guidance modules, forming a closed-loop logic of "perception-decision-execution-feedback".

[0045] To further illustrate the specific implementation of the present invention, an example of an interpretable and visualized method for embedded code generation intelligent agents based on causal chains is provided:

[0046] In this example, the first step is to build three functional modules: the data source layer, the data processing and output layer, and the interactive feedback layer. The data source layer includes an embedded code generation agent based on GLM4.5 (using pulse compression processing as the algorithm; the hardware platform is FT2000+, the Kylin OS, and the Linux-GCC compiler; it also includes Cobot static testing and custom dynamic testing and monitoring modules), and a multi-source heterogeneous data acquisition module based on technologies such as Cigar. The data processing and output layer uses the Spring Boot architecture and JavaScript language to design and implement data structuring processing modules and a visualization rendering engine. The interactive feedback layer uses Vue language to design and implement multi-view collaborative visualization graphics and user interaction guidance modules. The specific processing flow is as follows: Figure 2 As shown:

[0047] Step 1: Real-time data capture

[0048] First, a multi-source heterogeneous data acquisition agent is deployed, connected to the core modules of the embedded code generation agent (iterative scheduler, evaluation module, heterogeneous compilation module, resource abstraction module, and dynamic / static testing module) via a message queue. When the embedded code generation agent begins pulse compression processing for code generation, the data acquisition agent starts recording relevant multi-source data for the task, covering creation time, task type, execution status, code snapshot, code version, compilation results, dynamic / static test results, etc. All data is timestamped and stored in a structured database.

[0049] Step 2: Data structuring and causal chain construction

[0050] After completing the real-time capture of multi-source heterogeneous data, the data structuring module is immediately started to perform in-depth analysis and integration of the raw data stored in the structured database, and to construct a multimodal data causal chain that runs through the entire life cycle of the task through task association and time sequence.

[0051] The module performs semantic parsing and entity extraction on heterogeneous data from different sources. It parses compilation logs to extract specific error codes and warning messages; parses code snapshots to identify key code entities such as functions and variables and their changes; parses the output of the dynamic and static evaluation module to quantify various performance metrics; and parses the resource status output curves of the resource abstraction module. Simultaneously, the module aligns all data streams using the timestamps from the data acquisition agent as the main axis to ensure the accuracy of the timing of events.

[0052] Based on the task flow topology and decision path of the embedded code-generated intelligent agent, the module establishes causal relationships across data sources. When processing the task of "pulse compression processing code generation", the module not only records basic information such as its creation time and execution status, but also deeply binds it with the following data, including upstream decisions (decision context such as iterative scheduler decision events, user requirement input, hardware resource status and evaluation index weights), intermediate products (code version snapshots, heterogeneous compilation results (success / failure, optimization level)), and downstream effects (related to the test results of the dynamic and static testing modules for this code version, including functional pass rate, performance test score, resource usage curve, etc.).

[0053] Ultimately, a relational data model is formed, providing a data foundation for the subsequent visualization rendering engine.

[0054] Step 3: Visual Rendering

[0055] The visualization rendering engine reads the structured data and updates the interface.

[0056] In the task flow sequence view, the timeline expands from left to right. At time T0, a green rectangular node, Code Generation V1, appears in the code generator swimlane. Shifting the view to the right, a blue rectangular node, Compile V1, appears in the heterogeneous compiler swimlane, and an arrow is generated pointing from Code Generation V1 to it, indicating the dependency. If compilation fails, the node turns red and triggers an iterative generation and compilation task, pointing to the next generation V2 and compilation V2 task.

[0057] In the radar view, when the user clicks on code version V1, the multi-dimensional evaluation radar chart updates accordingly. Assuming V1 compiles successfully and passes the multi-dimensional tests, the radar chart displays a large pentagon covering dimensions such as real-time performance, pass rate, and static detection score. Simultaneously, theoretical data from the intelligent agent domain knowledge base is used to create a blurred pentagon for comparison.

[0058] In the version evolution and comparison view, the list displays the user-selected generated V1 and V2 versions for comparison. Users can compare the two versions of code, scores in various dimensions, and view the generated code evaluation curve.

[0059] Step 4: Interface Display and Interaction Feedback

[0060] Finally, users interact with the strategy and parameters through a visual interface. If a user finds some evaluation values ​​in V2 to be poor, such as insufficient real-time performance, they can drag the weight slider of the real-time axis in the adjustment graph. This operation is sent to the agent via API, and the iterative evaluation module will increase the real-time evaluation weight in the next iteration, prioritizing optimization of interruption response time. Alternatively, users can enter branches such as branch backtracking, constraint information injection, and code generation completion according to their needs, ultimately achieving interactive control over embedded code generation.

[0061] Through the above specific implementation methods, the present invention successfully transforms the complex internal workflow of the code generation agent into intuitive and interactive visual information, greatly improving the efficiency and experience of human-machine collaboration.

[0062] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A code generation intelligent agent visualization system based on causal chain construction, characterized in that: It includes a data source layer, a data processing and output layer, and an interactive feedback layer; The data source layer includes an embedded code generation agent and a multi-source data acquisition module; the data processing and output layer includes a causal chain construction and data structuring processing module and a visualization rendering engine; the interactive feedback layer includes a multi-view collaborative visualization module and an interactive analysis and guidance module. The multi-source data acquisition module is used to capture multi-source heterogeneous data from the agent in real time; the causal chain construction module parses, aligns and associates the multi-source heterogeneous data, integrating discrete events and data into a causal chain data model with clear causal logic that runs through the entire lifecycle of the code generation task; the multi-view collaboration module, based on the causal chain data model, performs collaborative rendering through task flow time sequence, multi-dimensional evaluation radar and version evolution comparison view, to present the internal decision-making logic and execution process of the agent in an interpretable and visual way.

2. The code generation intelligent agent visualization system based on causal chain construction according to claim 1, characterized in that: The embedded code generation agent is the data source and observed object of the entire visualization system. It is responsible for receiving user control commands and executing specific embedded code generation tasks. During operation, the agent continuously generates and outputs multi-source heterogeneous data reflecting its internal state based on internal strategies and external inputs.

3. The code generation intelligent agent visualization system based on causal chain construction according to claim 2, characterized in that: The specific embedded code generation task includes a management and control module, a large model, an embedded heterogeneous compilation module, a dynamic and static testing module, a performance analysis module, and an embedded real-time status acquisition module. The multi-source heterogeneous data includes task flow topology, decision path, evaluation metrics, code version snapshots, compilation logs, and embedded device status.

4. The code generation intelligent agent visualization system based on causal chain construction according to claim 1, characterized in that: The multi-source data acquisition module is used to capture various types of state data in multiple dimensions and in real time from the intelligent agent generated by the embedded code. The multi-source data acquisition module connects to different data interfaces of the intelligent agent system through various module adapters, subscribes to events of heterogeneous data during the embedded code generation and execution process, classifies and aggregates the raw data, and then transmits it to the data processing and output layer in a unified manner.

5. The code generation intelligent agent visualization system based on causal chain construction according to claim 1, characterized in that: The causal chain construction and data structuring module is used to serialize and structure the collected raw data to construct a data causal chain that runs through the entire life cycle of the task. The causal chain construction and data structuring module cleans, aligns and parses the multi-source data transmitted from the data source layer, transforms unstructured logs and snapshots into a unified internal data model, and establishes cross-data source event associations based on task flow topology and decision logic to form a data structure with causal logic to support visualization rendering.

6. The code generation intelligent agent visualization system based on causal chain construction according to claim 1, characterized in that: The elements of intelligent agent data structuring processing include: Task flow data: describes the type, status, dependencies, and execution order of tasks; Decision data: Records the decision inputs and outputs of the iterative evaluation module; Evaluation data includes quantitative scores for static tests, functionalities, and performance metrics for each code version; Code snapshot data: Stores the code version and metadata generated in each iteration cycle; Embedded real-time status: The running status of embedded software on the hardware platform; The above multi-source data is processed in batches and structured to form a complete task-centric logical dataset according to a unified time series.

7. The code generation intelligent agent visualization system based on causal chain construction according to claim 1, characterized in that: The visualization rendering engine is the core execution unit for graphics generation, responsible for mapping structured data into specific visual graphics. The visualization rendering engine receives standardized data from the data structure processing module, and calls the underlying graphics library interface to draw basic visual components according to the preset visual encoding scheme.

8. The code generation intelligent agent visualization system based on causal chain construction according to claim 1, characterized in that: The multi-view collaborative visualization module includes basic views generated by the visualization rendering engine. Through layout management and view linkage mechanisms, it constructs a dynamic, multi-dimensional intelligent agent behavior observation window, rendering three interconnected and collaboratively interactive visualization views, including: Task flow timeline view: The timeline is used as the horizontal axis, different swimlanes represent parallel task execution units, nodes of different shapes and colors represent tasks of different types and states, and arrowed lines represent logical dependencies and data flow between tasks. Multi-dimensional evaluation radar chart: Dynamically generate a radar chart for the user's currently selected code version. Each axis represents a dimension of embedded software evaluation indicators. By comparing the fit of the current version with the preset embedded software target outline in the chart, the gap between the current version and the target is displayed. Version Evolution and Comparison View: Displays generated code versions in list or thumbnail format, with key metrics marked, including overall performance and compilation status. Users can select two or more versions for comparison, and plot the evolution curve of the embedded software's overall score with the number of iterations, showing the trend and inflection points of the optimization process.

9. The code generation intelligent agent visualization system based on causal chain construction according to claim 1, characterized in that: The interactive analysis and guidance module is used to transform the user's analysis and control into intervention in the operation process of the intelligent agent, capture the user's human-computer interaction behavior, parse it into specific instructions or parameters, and transmit it to the embedded code to generate the intelligent agent for the next iteration.

10. A method for a code-generating intelligent agent visualization system based on causal chain construction according to any one of claims 1-9, characterized in that, Includes the following steps: Step 1: Real-time data capture. Deploy a multi-source data acquisition module to capture multi-source heterogeneous data generated by the embedded code generation agent during task execution in real time, and timestamp all multi-source heterogeneous data and store it in a structured database. Step 2: Causal chain construction and data structuring. The data structuring module processes the captured multi-source heterogeneous data to construct a multimodal data causal chain that spans the entire lifecycle of the task. Step 3: Visualization and rendering. The visualization and rendering engine reads the structured data and generates and renders at least three collaborative visualization views. When a user interacts with an object in any view, the other views can simultaneously highlight or display relevant information that has a causal relationship with the data entity. Step 4: Interface display and interactive feedback. Users interact with strategies and parameters through a visual interface.