Code collaborative management system and method based on AST semantic capitalization and knowledge graph
By using AST semantic assetization and multidimensional knowledge graphs, we have solved the problems of insufficient code parsing granularity, single-dimensional relationship modeling, disconnected document synchronization, lack of real-time collaboration, and lack of intelligent verification for data import. This has enabled semantic-level asset management of code, multi-dimensional relationship modeling, real-time document synchronization, and fine-grained collaboration, thereby improving team collaboration efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN WISDOM & TONG TECHNOLOGY CO LTD
- Filing Date
- 2026-02-09
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies suffer from insufficient granularity in code parsing, lack of semantic-level assetization capabilities, single-dimensional code relationship modeling, disconnected document synchronization, lack of real-time and structured management in multi-person collaboration, and lack of intelligent verification and conflict handling in batch data import.
It employs an AST semantic assetization module for high-fidelity parsing, constructs a multi-dimensional knowledge graph, enables real-time multi-user collaboration, automates document synchronization, provides intelligent batch data management, achieves millisecond-level real-time data push via the WebSocket protocol, and supports custom validation rules and conflict handling.
It achieves semantic-level asset management of code, multi-dimensional code relationship modeling, real-time document synchronization, fine-grained multi-person collaboration, intelligent batch data import, reduces notification noise, and improves team collaboration efficiency.
Smart Images

Figure CN122064367A_ABST
Abstract
Description
I. Technical Field
[0002] This invention relates to the fields of software engineering and artificial intelligence technology, specifically to a code collaboration management system and method based on Abstract Syntax Tree (AST) semantic assetization, knowledge graph reasoning, and Large Language Model (LLM) collaboration. II. Background Technology
[0004] With the widespread adoption of AI-assisted programming tools (such as GitHub Copilot and Cursor), global software development code output has exploded. Statistics show that code output has increased by 76% since the widespread adoption of AI-assisted programming. However, this rapid code generation has not translated into improved code management capabilities, leaving the software engineering field facing the severe challenge of a "code deluge."
[0005] Existing code analysis tools mainly suffer from the following shortcomings:
[0006] (1) Insufficient code parsing granularity and lack of semantic-level assetization capabilities. Existing code analysis methods (such as the abstract syntax tree-based program understanding method disclosed in CN112835585A) can perform AST parsing and path extraction on source code, but they only stay at the level of syntax structure analysis and fail to transform the parsing results into reusable, searchable, and traceable "digital assets". Developers cannot identify logically equivalent code blocks across projects, resulting in a large amount of redundant development.
[0007] (2) The code relationship modeling is too simplistic and lacks multidimensional knowledge graph reasoning. Existing code dependency analysis tools typically focus only on single-dimensional relationships such as function calls or module imports, and cannot simultaneously model multidimensional relationships such as function calls, class inheritance, module dependencies, and Git commit modifications. When bug impact analysis is required across multiple call chains, existing tools struggle to provide effective support.
[0008] (3) Code changes are out of sync with documentation. Most existing documentation generation tools are based on code comment extraction (such as JSDoc and Sphinx), which cannot detect semantic-level changes in the code. When the code is refactored or the logic is modified, the relevant documentation often fails to update automatically, resulting in a long-term inconsistency between the documentation and the code.
[0009] (4) Lack of real-time and structured management in multi-person collaboration. Existing code review tools (such as GitHub PullRequest) are based on file differences and lack the ability to perform real-time collaborative annotation, permission management, and version tracking at the node level of the code knowledge graph. Team members cannot see each other's operation positions and annotation content in real time in the graph view.
[0010] (5) Lack of intelligent verification and conflict handling in batch data import. Existing data import tools usually only support simple format verification, lack user-defined verification rule system, and also lack intelligent conflict detection and multi-strategy processing mechanism for existing data.
[0011] Therefore, there is an urgent need for a system and method that can organically integrate code parsing, knowledge graph construction, document synchronization, multi-person collaboration, and intelligent data management to solve the above-mentioned technical problems. III. Summary of the Invention
[0013] 3.1 Technical problem to be solved by the present invention
[0014] The technical problem to be solved by this invention is: how to build a code collaboration management system that integrates AST semantic assetization, multi-dimensional knowledge graph reasoning, LLM-driven automatic document synchronization, real-time multi-person collaborative annotation, and intelligent batch data management, so as to overcome the problems of insufficient code parsing granularity, single dimension of relationship modeling, disconnection of document synchronization, lack of real-time collaboration, and lack of intelligent verification of data import in the existing technology.
[0015] 3.2 Technical Solution
[0016] To address the aforementioned technical problems, this invention provides a code collaboration management system based on AST semantic assetization and knowledge graph, comprising the following modules:
[0017] The AST semantic assetization module is used to perform high-fidelity abstract syntax tree parsing on source code, supporting incremental parsing and fault tolerance for more than 40 programming languages; it uses the Merkle tree structured hash algorithm to perform fingerprint calculation on AST nodes to generate code fingerprint identifiers; and it transforms the parsing results into structured digital assets, supporting cross-project code block reuse retrieval.
[0018] The multidimensional knowledge graph engine module is used to map code repositories into multidimensional knowledge graphs, where nodes cover functions, classes, variables, files, and Git commit records, and edge relationships cover various types such as function calls (CALLS), class inheritance (INHERITS), commit modifications (MODIFIED_BY), and module imports (IMPORTS). Based on GraphRAG technology, it realizes hybrid queries of deterministic graph reasoning and probabilistic vector retrieval, and supports multi-hop impact analysis.
[0019] The knowledge graph visualization and interaction module provides visualization of the graph in five layout modes: force-directed graph, tree graph, radial graph, grid graph, and concentric circle graph. It supports drag-and-drop selection of nodes, batch operations, right-click context menus, custom styles (color, size, icon), bookmarking, and global search. It also supports drag-and-drop management of node groups through the statistics panel and integrates with the undo / redo system.
[0020] The graph version management and timeline playback module is used to create graph snapshots and compare versions. It supports the visual overlay display of snapshot differences (using color coding to identify newly added, deleted, and modified nodes and relationships); it supports graph evolution animation playback based on Git commit timelines, including play, pause, fast forward, and rewind controls; it supports scheduled automatic snapshots and manual backups, as well as version rollback.
[0021] The automated document synchronization module is used to intelligently filter trivial changes and accurately identify semantic-level changes through an AST-level change awareness mechanism; combined with the document rewriting capability of Large Language Model (LLM), it automatically generates document update patches corresponding to code changes; it supports integration with CI / CD pipelines and automatically triggers document synchronization when code is committed.
[0022] The real-time multi-user collaboration module is used to achieve millisecond-level real-time data push via the WebSocket protocol, replacing the traditional polling mechanism; it supports multiple users to perform node-level annotations on the knowledge graph, including types such as comments, tags, and warnings; it supports nested replies to annotations to form discussion threads, and supports the @mention function to achieve targeted notifications; it supports real-time display of the collaboration cursor, so that team members can see each other's operation positions in the graph; it supports administrators to lock nodes, approve annotations, and log operation audits.
[0023] The intelligent notification aggregation module provides three notification frequency options: real-time push, daily summary, and weekly summary. It automatically collapses multiple consecutive notifications from the same node into a single summary, and supports user-defined collapse trigger thresholds. It also supports pushing key changes to external collaboration platforms (such as Slack and Lark) via Webhook, and supports the linkage between desktop notifications and in-app notifications.
[0024] The intelligent batch import module supports batch data import in CSV and JSON formats and provides standard template downloads. During the import preview stage, it supports user-defined validation rules (including five rule types: required fields, type constraints, regular expression matching, enumerated values, and numerical ranges) to intercept non-compliant data before import. It supports saving and loading validation rule templates for rule reuse. It supports import conflict detection, providing three conflict handling strategies: skip, overwrite, and merge, and supports preset default strategies based on node type. It also supports import history and import rollback.
[0025] This invention also provides a code collaboration management method based on AST semantic assetization and knowledge graph, comprising the following steps:
[0026] Step S1: Receive the source code submitted by the user, perform incremental parsing of the source code through the AST parsing engine to generate a high-fidelity abstract syntax tree, and calculate the code fingerprint of each node through the Merkle tree hash algorithm.
[0027] Step S2: Based on the AST parsing results, extract entities such as functions, classes, variables, and files from the code, as well as the relationships between them such as calls, inheritance, imports, and modifications, and construct a multidimensional knowledge graph.
[0028] Step S3 presents the knowledge graph to the user in a visual layout such as a force-directed graph, allowing the user to explore the graph through interactive methods such as dragging, searching, and filtering, and supports operations such as labeling, grouping, and customizing the style of nodes.
[0029] Step S4: When code changes are detected, semantic-level changes are identified through AST difference comparison, and a large language model is called to automatically generate document update patches to achieve automatic synchronization between code and documents.
[0030] Step S5: Real-time synchronization of multiple users' operations, including annotation creation, node editing, and cursor position, is achieved through the WebSocket protocol, enabling real-time collaboration among multiple users.
[0031] Step S6: Automatically create map snapshots, supporting difference comparison and visualization overlay between any two snapshots, as well as timeline-based map evolution playback.
[0032] Step S7: Receive batch import data, apply user-defined verification rules to verify the data during the preview stage, perform conflict detection and strategy processing on the data that passes the verification, complete the import, and automatically create a timeline snapshot.
[0033] Step S8: Based on the user's notification preference settings, node change events are processed in a hierarchical manner. Real-time notifications are pushed immediately, delayed notifications are aggregated into daily or weekly summaries, and consecutive notifications from the same node are automatically collapsed.
[0034] 3.3 Beneficial Effects
[0035] Compared with the prior art, the technical solution of this invention has the following advantages:
[0036] (1) Achieve semantic-level asset management of code. Through high-fidelity AST parsing and Merkle tree fingerprinting algorithm, the source code is transformed into structured digital assets, which supports accurate identification and reuse of code blocks across projects, and solves the problem that the code parsing in the existing technology only stays at the syntax level and cannot be managed as an asset.
[0037] (2) Construct a multi-dimensional code knowledge graph. Simultaneously model various relationship types such as function calls, class inheritance, module dependencies, and Git modifications. Combined with GraphRAG hybrid reasoning technology, it supports multi-hop impact analysis, which can accurately locate the source of bugs and their impact range outside the multi-level call chain, thus solving the problem of single-dimensional relationship modeling in existing technologies.
[0038] (3) Achieve automatic document synchronization driven by AST. By accurately identifying semantic changes through an AST-level change awareness mechanism and combining it with LLM to automatically rewrite documents, a closed loop of "code as document" is achieved, solving the problem of code changes and document synchronization being disconnected in the existing technology.
[0039] (4) Provides graph-level real-time multi-person collaboration. Based on WebSocket, it provides millisecond-level real-time push, supports node-level annotation, collaboration cursor, @mention, permission management and audit logs, and achieves a finer collaboration granularity than traditional code review tools.
[0040] (5) Provides intelligent batch data management. It supports five types of custom validation rules and rule template reuse, three conflict handling strategies and type presets, and import rollback, which greatly improves the accuracy and controllability of batch data import.
[0041] (6) Provides a multi-level notification aggregation mechanism. Three-level notification frequency, automatic folding, configurable thresholds and Webhook integration effectively reduce notification noise in high-frequency change scenarios and improve team collaboration efficiency. IV. Description of the attached drawings
[0043] Figure 1 This is a schematic diagram of the overall architecture of the system of the present invention.
[0044] Figure 2 This is a flowchart of the AST semantic assetization module.
[0045] Figure 3 This is a flowchart illustrating the construction and query process of a multidimensional knowledge graph.
[0046] Figure 4 This is a flowchart for map version management and snapshot comparison.
[0047] Figure 5 A flowchart for automated document synchronization.
[0048] Figure 6 This is a communication architecture diagram for real-time multi-user collaboration.
[0049] Figure 7 A flowchart for intelligent batch data import.
[0050] Figure 8 This is a flowchart for notification aggregation and tiered push notifications. V. Detailed Implementation Methods
[0052] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0053] Example 1: System Overall Architecture
[0054] like Figure 1 As shown, the code collaboration management system of the present invention adopts a front-end and back-end separation B / S architecture, including three layers: client layer, server layer and data layer.
[0055] The client-side layer is built on the React 19 framework and the Tailwind CSS 4 style system, and uses tRPC 11 to implement end-to-end type-safe remote procedure calls. The client-side layer includes the following main pages and components:
[0056] The AST parser page (ASTExplorer) integrates the Monaco code editor, supporting real-time code input and AST visualization.
[0057] The KnowledgeGraph page uses the D3.js force-directed graph engine to provide interactive visualization of the graph.
[0058] The DocSync page displays the correspondence between code changes and document updates;
[0059] The GraphStatsPanel displays the distribution of node groups and supports drag-and-drop group management.
[0060] The BulkImportPanel provides data preview, validation rule configuration, and conflict handling.
[0061] The ServerNotificationCenter displays an aggregated list of notifications and supports setting a collapse threshold.
[0062] The TeamAnnotations component supports nested replies and @mentions;
[0063] TimelinePlayer supports animated playback of graph evolution.
[0064] The server-side layer is built on the Express 4 framework and tRPC 11, and provides API services through the following routing modules:
[0065] syncRouter handles cloud synchronization of differential snapshots and user settings synchronization;
[0066] CollaborationRouter handles CRUD operations, access control, audit logs, and Webhook configuration.
[0067] The timelineRouter handles the creation, comparison, and backup management of timeline snapshots.
[0068] WatchNotifyRouter handles node monitoring, notification push, and summary generation.
[0069] Bulk ImportRouter handles file parsing, conflict detection, and import execution.
[0070] The data layer uses a MySQL / TiDB relational database and accesses data via Drizzle ORM. The data model includes 19 tables: users, diff snapshots, user settings, node annotations, graph snapshots, node bookmarks, node locks, annotation reviews, adminAuditLogs, saved views, node custom styles, webhook configurations, graph templates, graph backups, timeline snapshots, node watches, notifications, import jobs, and digest events.
[0071] File storage uses S3 object storage service, and file uploading and access are achieved through pre-configured storage helper functions (storagePut / storageGet).
[0072] Example 2: AST Semantic Asset Processing Flow
[0073] like Figure 2 As shown, the processing flow of the AST semantic assetization module includes the following steps:
[0074] Step S2.1: Receive the source code entered by the user in the Monaco editor and identify the programming language type of the code. The system supports more than 40 programming languages, including but not limited to Python, JavaScript, TypeScript, Java, C / C++, Rust, Go, etc.
[0075] Step S2.2 involves invoking a high-performance parsing engine based on Tree-sitter to perform incremental parsing of the source code. The characteristic of incremental parsing is that when local modifications occur in the code, only the affected subtree is re-parsed, rather than the entire syntax tree, thus achieving millisecond-level response speeds. The parsing engine also possesses fault tolerance capabilities, enabling the generation of a partially correct syntax tree even if the code contains syntax errors.
[0076] Step S2.3: Perform high-fidelity restoration on the generated AST, retain source code location information (line number, column number, offset), and form a concrete syntax tree (CST) to ensure that subsequent patching operations can accurately locate the corresponding position in the source code.
[0077] Step S2.4 involves calculating the code fingerprint for each meaningful subtree in the AST (such as function definitions, class definitions, code blocks, etc.) using the Merkle tree structured hash algorithm. Specifically, starting from the leaf nodes, the hash value is calculated layer by layer upwards: the hash value of a leaf node is determined by its node type and text content; the hash value of a non-leaf node is determined by the ordered combination of its node type and the hash values of all its child nodes. This algorithm can identify logically equivalent code blocks with different textual expressions (such as variable renaming, whitespace differences, etc.), achieving accurate matching of code assets across projects.
[0078] Step S2.5: Store the parsing results (AST structure, code fingerprint, source code location mapping) as digital assets in a structured JSON format, supporting global retrieval by fingerprint value and enabling cross-project reuse of code assets.
[0079] Example 3: Construction and Query of Multidimensional Knowledge Graph
[0080] like Figure 3 As shown, the processing flow of the multidimensional knowledge graph engine module includes the following steps:
[0081] Step S3.1: Based on the AST parsing results, extract entities from the code. Entity types include: Function, Class, Variable, File, Module, Git Commit, etc. Each entity serves as a node in the knowledge graph, carrying attributes such as name, type, file, and line number range.
[0082] Step S3.2: Analyze the relationships between entities and construct multi-dimensional edges. Relationship types include:
[0083] CALLS: Function A calls function B;
[0084] INHERITS: Class A inherits from class B;
[0085] IMPORTS: Module A imports Module B;
[0086] MODIFIED_BY: Entity A was modified by Git commit C;
[0087] CONTAINS: File A contains function B;
[0088] DEPENDS_ON: Module A depends on module B.
[0089] Step S3.3: Assemble entities and relations into a knowledge graph data structure, where the node array records the attribute information of all entities, and the edge array records the source node, target node, and relation type of all relations.
[0090] Step S3.4: Implement hybrid queries based on GraphRAG technology. For structured queries (such as "find all callers of function A"), a deterministic graph traversal algorithm is used to perform precise reasoning along the defined relational paths; for semantic queries (such as "find all codes related to authentication"), a probabilistic vector retrieval is used, and fuzzy matching is performed in the graph after semantic understanding of the query intent through LLM. The results of the two query methods are then fused, sorted, and returned.
[0091] Step S3.5 supports multi-hop impact analysis. When the user specifies a starting node, the system performs a breadth-first traversal along the relationship edges such as CALLS, IMPORTS, and DEPENDS_ON, expanding the scope of influence layer by layer. It supports tracing up to five levels of call chains and highlights all affected nodes in a visual manner.
[0092] Example 4: Visualization and Interactive Operation of the Atlas
[0093] The knowledge graph visualization and interaction module is implemented based on the D3.js force-directed graph engine and provides the following interactive functions:
[0094] Five layout modes are available: Force layout, which uses physical simulation to achieve a natural distribution of nodes; Tree layout, which displays inheritance and containment relationships in a hierarchical structure; Radial layout, which radiates outwards from the central node; Grid layout, which arranges nodes by type in a regular grid; and Concentric layout, which arranges nodes from the inside out according to their importance. D3 transition animations are used to achieve smooth node displacement effects when switching layouts.
[0095] Node interaction operations: Supports single-click selection, multi-selection by box selection, and Ctrl+click to add selection; supports right-click context menu to provide batch highlighting, batch annotation, batch grouping and other operations; supports custom style settings for nodes, including color, size, icon and custom label.
[0096] Drag-and-drop group management: In the graph statistics panel, nodes under each group support drag-and-drop across groups using the HTML5 native drag-and-drop API. At the start of a drag, the source node and source group information are recorded. Visual highlighting is displayed when the drag passes over the target group. Upon release, group changes are executed, and the operation record is registered through the undo / redo system (useUndoRedo), supporting Ctrl+Z for undo and Ctrl+Y for redo.
[0097] Global Search: Use the Ctrl+K shortcut to bring up the search panel. It supports searching by node name, type, and group. Search results are displayed in groups by type. It also supports search history and one-click location of the target node.
[0098] Example 5: Atlas Version Management and Timeline Playback
[0099] like Figure 4 As shown, the processing flow of the map version management module includes:
[0100] Snapshot Creation: Users can manually create graph snapshots or configure automatic snapshot timers (custom intervals are supported). Each snapshot records complete data of the current graph (all nodes and relationships), the number of nodes, the number of relationships, creation time, and descriptive information. Snapshot data is stored in the timelineSnapshots table.
[0101] Snapshot Difference Comparison: After the user selects any two snapshots, the system compares the node sets and relationship sets in the two snapshots, calculating the number of newly added nodes, deleted nodes, modified nodes (nodes whose attributes have changed), and newly added and deleted relationships. The difference results are displayed on the current graph canvas in a color-coded overlay: green indicates additions, red indicates deletions, and yellow indicates modifications.
[0102] Timeline playback: The system arranges all snapshots in chronological order, and users can use the playback controller (play / pause / fast forward / rewind / jump) to watch the evolution of the graph from the first snapshot to the last. During playback, the appearance, disappearance, and movement of nodes are presented in animated form.
[0103] Backup and Rollback: The system supports manual backup and scheduled automatic backup (created daily). Backup data includes map data, annotation data, and node style data. When it is necessary to restore to a historical state, users can select the target version from the backup list to roll back.
[0104] Example 6: Automated Document Synchronization
[0105] like Figure 5 As shown, the processing flow of the automated document synchronization module includes:
[0106] Step S6.1: Listen for change events in the code repository (such as Git commits, PR merges, etc.) and obtain the list of changed files and the differences.
[0107] Step S6.2 involves parsing the Abstract Syntax Tree (AST) for each modified file, comparing the ASTs before and after the change in a structured manner, and identifying semantic-level changes. The system intelligently filters out the following trivial changes: adjustments to pure whitespace characters, modification of comments, renaming of variables (which do not affect the logic), code formatting, etc. Only semantic changes that affect the code logic are retained, such as: modification of function signatures, changes to return types, addition / deletion of routes, changes to data model fields, etc.
[0108] Step S6.3: Assemble the identified semantic change information (change module, AST change description, scope of impact) into a structured context, and call the Large Language Model (LLM) to generate the corresponding document update content. The LLM automatically selects the document update strategy according to the change type: new features generate new document paragraphs, modified features update the corresponding paragraphs, and deleted features are marked as removed.
[0109] Step S6.4: Generate a document update patch and display a change tracking table (including changed modules, AST change descriptions, and synchronization status) for developers to review and confirm before merging.
[0110] Step S6.5: Integrate document synchronization checks into the CI / CD pipeline. When a PR is submitted, the document synchronization process is automatically triggered, generating a document patch as part of the PR, enabling one-click merging.
[0111] Example 7: Real-time Multi-user Collaboration
[0112] like Figure 6 As shown, the communication architecture of the real-time multi-user collaboration module includes:
[0113] WebSocket Connection Management: A WebSocket connection is automatically established when the client enters the knowledge graph page. The connection status is displayed in real time (connected / connecting / disconnected) through the WsStatusIndicator component. When the connection is lost, it automatically attempts to reconnect and synchronizes any data missed during the reconnection process.
[0114] Collaborative cursor synchronization: Each user's mouse position on the graph canvas is broadcast in real time to other online users via WebSocket. The CollaborativeCursors component renders the cursor positions and username labels of other users on the canvas, enabling team members to perceive each other's focus.
[0115] Collaborative annotation: User-created annotations (comments, tags, warnings, etc.) on graph nodes are pushed to all online users in real time via WebSocket. Annotations support nested replies to form discussion threads and support the @mention feature (implemented through the MentionInput component), with users being @mentioned receiving targeted notifications.
[0116] Access Control: Administrators can lock specific nodes (nodeLocks table), preventing ordinary users from creating annotations on those nodes. Annotation content can be set to require approval (annotationReviews table), and administrators approve or reject them through an approval queue. All administrator operations are recorded in the audit log (adminAuditLogs table), which supports filtering and exporting by time range.
[0117] Example 8: Intelligent Batch Import and Verification
[0118] like Figure 7 As shown, the data processing flow of the intelligent batch import module includes:
[0119] In step S8.1, the user uploads a data file in CSV or JSON format, and the system provides a standard template for download and reference.
[0120] In step S8.2, the system parses the uploaded file, extracts node data and relationship data, and displays the parsing results in the preview interface.
[0121] Step S8.3: During the preview phase, the user configures custom validation rules. The system supports five validation rule types:
[0122] Required rule: Specifies that a field cannot be empty;
[0123] Type constraint (type): Specifies that a field must be a specific data type (string, number, boolean).
[0124] Regular expression matching (regex): Specifies that the value of a field must match the given regular expression;
[0125] Enumeration value (enum): Specifies that the value of a field must be in a predefined list of options;
[0126] Numeric range: Specifies the minimum and maximum values for a numeric field.
[0127] Users can save the currently configured set of validation rules as a named template (stored in localStorage), and automatically populate all rules with a single click when importing the next time.
[0128] In step S8.4, the system applies validation rules to each data entry, highlighting non-compliant rows in red and displaying specific error messages. Users can choose to correct the data or exclude non-compliant rows before continuing.
[0129] Step S8.5 involves conflict detection on the validated data. The system compares the ID of the node to be imported with the IDs of existing nodes in the graph. When a conflict is found, three processing strategies are provided: skip (preserve existing data), overwrite (replace with new data), and merge (merge the attributes of both). Users can preset default conflict strategies for different node types (e.g., default overwrite for Function type, default skip for File type).
[0130] Step S8.6: Perform the import operation to write nodes and relationships into the graph data. After import, a timeline snapshot is automatically created to record the graph state before and after import, facilitating subsequent comparison. Detailed information about the import task (number of imports, conflict resolution results, list of imported node IDs) is recorded in the importJobs table, supporting subsequent import rollback operations.
[0131] Example 9: Notification Aggregation and Tiered Push
[0132] like Figure 8 As shown, the processing flow of the notification aggregation and tiered push module includes:
[0133] Step S9.1: When a node in the graph undergoes a change event (addition of annotation, style modification, relationship change, node locking / unlocking, import completion, etc.), the system queries all listeners (nodeWatches table) of that node.
[0134] Step S9.2: Perform tiered processing based on the notification frequency settings of each listener.
[0135] Real-time: Immediately create a notification record (notifications table), push it to online users via WebSocket, and trigger desktop notifications simultaneously;
[0136] Daily: Records events in the digestEvents table and marks them as daily.
[0137] Weekly: Record events in the summary event table and mark them as weekly.
[0138] Step S9.3: The scheduled task (Cron Job) runs at fixed times every day and week, extracts unprocessed events from the digestEvents table, groups and aggregates them by user and node, generates summary notifications, and pushes them through the built-in notification system.
[0139] Step S9.4: At the notification center display level, multiple consecutive notifications from the same node are automatically collapsed. The collapse logic is as follows: notifications are grouped according to nodeId. When the number of consecutive notifications from the same node reaches the user-defined collapse threshold (default is 3, adjustable between 2-20, stored in localStorage), these notifications are collapsed into a summary card, displaying the number of notifications, a summary of event types, unread counts, and time range. Users can click on the summary card to expand and view the details of each notification.
[0140] In step S9.5, for users who have configured Webhook, critical change events are simultaneously pushed to the external collaboration platform via an HTTP POST request. Webhook configuration supports Slack, Lark, Discord, and custom platforms, and supports event type filtering and key signature verification.
Claims
1. A code collaboration management system based on AST semantic assetization and knowledge graph, characterized in that, include: The AST semantic assetization module is used to perform abstract syntax tree parsing on source code, supporting incremental parsing and fault tolerance for multiple programming languages; The Merkle tree structured hash algorithm is used to calculate the fingerprint of AST nodes and generate code fingerprint identifiers. The parsing results are transformed into structured digital assets, supporting code block reuse retrieval across projects. The multi-dimensional knowledge graph engine module is used to map the code repository into a multi-dimensional knowledge graph, where the nodes cover functions, classes, variables, files and Git commit records, and the edge relationships cover various types such as function calls, class inheritance, commit modifications, and module imports. This module enables hybrid queries combining deterministic graph reasoning and probabilistic vector retrieval based on GraphRAG technology; a knowledge graph visualization and interaction module provides graph visualization with multiple layout modes, supports drag-and-drop node selection, batch operations, custom styles, and global search; supports drag-and-drop management of node groups via a statistics panel and integrates with the undo / redo system; and a graph version management and timeline playback module creates graph snapshots and performs version comparisons, supporting the visual overlay display of snapshot differences. Supports timeline-based animation playback of graph evolution; The automated document synchronization module is used to identify semantic-level changes through an AST-level change awareness mechanism and automatically generate document update patches in conjunction with a large language model. The real-time multi-user collaboration module is used to push data in real time via the WebSocket protocol, supporting multiple users to perform node-level annotation, collaborative cursor synchronization, and permission management on the knowledge graph; the intelligent notification aggregation module provides multi-level notification frequency options, automatically folds multiple consecutive notifications of the same node into a summary, and supports user-defined folding trigger thresholds. The intelligent batch import module supports batch data import in CSV and JSON formats. It allows users to define custom validation rules during the import preview stage and supports import conflict detection and multi-strategy processing.
2. The system according to claim 1, characterized in that, In the AST semantic assetization module, the Merkle tree structured hash algorithm is implemented as follows: starting from the leaf nodes of the AST, the hash value is calculated layer by layer upwards. The hash value of the leaf node is determined by its node type and text content, and the hash value of the non-leaf node is determined by the ordered combination of its node type and the hash values of all its child nodes, thereby enabling the identification of logically equivalent but textually different code blocks.
3. The system according to claim 1, characterized in that, In the multidimensional knowledge graph engine module, the hybrid query is implemented as follows: for structured queries, a deterministic graph traversal algorithm is used to perform precise reasoning along the defined relational paths; for semantic queries, a probabilistic vector retrieval is used, and after semantic understanding of the query intent through a large language model, fuzzy matching is performed in the graph; the results of the two query methods are fused, sorted, and returned.
4. The system according to claim 1, characterized in that, The knowledge graph visualization and interaction module supports layout modes including force-oriented layout, tree layout, radial layout, grid layout and concentric circle layout. When switching layouts, transition animations are used to achieve smooth node displacement effects.
5. The system according to claim 1, characterized in that, The drag-and-drop group management is implemented as follows: nodes under each group in the statistics panel support drag-and-drop operations for cross-group dragging. When dragging starts, the source node and source group information are recorded. When dragging over the target group, a visual highlight is displayed. After releasing the button, the group is changed and the operation record is registered through the undo / redo system. It supports undoing and restoring the original group and redoing the operation.
6. The system according to claim 1, characterized in that, In the graph version management and timeline playback module, the snapshot difference comparison is implemented by comparing the node set and relationship set in two snapshots, calculating the newly added, deleted and modified nodes and relationships, and displaying them on the graph canvas in a color-coded manner, where green represents addition, red represents deletion and yellow represents modification.
7. The system according to claim 1, characterized in that, In the automated document synchronization module, the AST-level change awareness mechanism is implemented by performing AST parsing and structured comparison on the code before and after the change, intelligently filtering out trivial changes such as pure whitespace adjustment, comment modification, variable renaming and code formatting, and retaining only semantic changes that affect the code logic.
8. The system according to claim 1, characterized in that, The real-time multi-user collaboration module also includes: a collaborative cursor synchronization function, which broadcasts each user's mouse position on the graph canvas to other online users in real time via WebSocket; a nested annotation reply function, which supports multi-level replies to annotations to form discussion threads; an @mention function, which parses the @username in the annotation content and sends a targeted notification to the mentioned user; and a permission management function, which supports administrators to lock nodes and approve annotations, with all administrator operations recorded in the audit log.
9. The system according to claim 1, characterized in that, In the intelligent notification aggregation module, notification folding is implemented as follows: notifications are grouped according to node identifiers. When the number of consecutive notifications from the same node reaches the user-defined folding threshold, these notifications are folded into a summary card, displaying the number of notifications, a summary of event types, unread counts, and time range. The default value of the folding threshold is 3, which can be adjusted between 2 and 20 and stored in local persistent storage.
10. The system according to claim 1, characterized in that, The intelligent batch import module supports the following validation rule types: required rules, type constraints, regular expression matching, enumerated values, and numerical ranges; it supports saving the validation rule set as a named template and persistently storing it, so that it can be loaded with one click the next time it is imported; the conflict handling strategies include three types: skip, overwrite, and merge, and it supports preset default strategies according to node type.
11. A code collaboration management method based on AST semantic assetization and knowledge graph, characterized in that, Includes the following steps: Step S1: Receive the source code submitted by the user, perform incremental parsing of the source code through the AST parsing engine, generate an abstract syntax tree, and calculate the code fingerprint of each node through the Merkle tree hash algorithm; Step S2: Based on the AST parsing results, extract entities and multidimensional relationships between entities from the code to construct a multidimensional knowledge graph. Step S3: Present the knowledge graph to the user in a visual layout, allowing users to explore the graph through drag-and-drop, search, and filtering interactions, and supporting node annotation, grouping, and style customization. Step S4: When code changes are detected, identify semantic-level changes through AST difference comparison and automatically generate document update patches using a large language model. Step S5: Real-time synchronization of multiple users' operations via the WebSocket protocol enables real-time collaboration among multiple users. Step S6: Automatically create graph snapshots, supporting snapshot difference comparison and timeline-based graph evolution playback. Step S7: Receive batch imported data, apply custom validation rules for data verification during the preview stage, and perform conflict detection and strategy processing on the verified data to complete the import. Step S8: Based on the user's notification preferences, node change events are processed in a hierarchical manner, and consecutive notifications from the same node are automatically collapsed.
12. The method according to claim 11, characterized in that, In step S1, the incremental parsing method is as follows: when the code is partially modified, only the affected subtree is re-parsed instead of the entire syntax tree; the parsing engine has fault tolerance capability, and can generate a partially correct syntax tree even if the code has syntax errors.
13. The method according to claim 11, characterized in that, In step S2, the multidimensional relationships include function call relationships, class inheritance relationships, module import relationships, Git commit modification relationships, file inclusion relationships, and module dependency relationships.
14. The method according to claim 11, characterized in that, In step S4, the specific method for identifying semantic-level changes through AST difference comparison is as follows: perform AST parsing on the code before and after the change, conduct structured comparison, intelligently filter out trivial changes, and retain only semantic changes that affect the code logic.
15. The method according to claim 11, characterized in that, In step S7, the custom verification rules include five types: mandatory rules, type constraints, regular expression matching, enumeration values, and numerical ranges. The specific method of conflict detection is to compare the identifier of the node to be imported with the node identifier in the existing graph, and provide three processing strategies when a conflict is found: skip, overwrite, and merge.
16. The method according to claim 11, characterized in that, In step S8, the specific method of hierarchical processing is as follows: real-time notifications are pushed immediately, and daily and weekly notifications are aggregated into summaries and pushed at regular intervals; the specific method of notification folding is as follows: notifications are grouped according to node identifiers, and when the number of consecutive notifications from the same node reaches the folding threshold, they are automatically folded into summary cards.