AST-based front-end service code differential generation and update method and system

By using abstract syntax trees and zero-width character markers in front-end development to distinguish between system-generated code and developer-modified code, the problem of automatic code generation coverage by interface document management tools is solved, and independent updates and precise differentiated generation of single interfaces are achieved.

CN120508281BActive Publication Date: 2025-09-19JIANGSU LINGHAO NETWORK TECH CO LTD
2 Cites 0 Cited by

Patent Information

Application Number
CN202510984869.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-17
Publication Date
2025-09-19
Estimated Expiration
2045-07-17

AI Technical Summary

Technical Problem

In the existing technology of front-end development, when the interface document management tool automatically generates code, it is unable to distinguish between the code automatically generated by the system and the code modified by the developer, resulting in the modified content being overwritten. It is impossible to achieve independent update of a single interface, and batch full operation must be performed.

Method used

By converting service code into an abstract syntax tree, identifying and distinguishing nodes generated by the system and modified by developers, and using zero-width character tags and interface document metadata, on-demand replacement and precise updates are achieved.

Benefits of technology

It enables independent updates of a single interface, avoids the performance loss caused by global comparison, retains the developer's customized business logic, and reduces the scope of code modification and the risk of errors.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The present invention discloses a front-end service code differential generation and update method and system based on AST, which belongs to the field of computer technology. The key points of its technical solution include: converting the service code into an abstract syntax tree, and traversing each node in the abstract syntax tree to determine the method name; and determining the first node and the second node according to the zero-width character mark in the method name, and the zero-width character mark is generated according to the interface document metadata; performing semantic matching detection on the first node, and updating the first node according to the detection result. The present invention accurately identifies the node type by embedding specially encoded zero-width characters, and realizes differential comparison of code logic through subsequent semantic matching detection, and then accurately replaces the leaf nodes with differences. The present invention avoids the performance loss caused by global comparison, and can realize code generation and replacement at the single interface level, avoiding redundant changes caused by batch operations.
Need to check novelty before this filing date? Find Prior Art