Xenogeneic tissue engineered corneal stroma and limbal epithelial cell transplantation for limbal stem cell deficiency

By using asynchronous execution of the self-iterative model and virtual space verification, the problems of logical illusion and semantic error in the code rewriting of the domestic IT innovation platform are solved, realizing fully automated self-iteration and security compliance of the domestic IT innovation platform code, and improving rewriting efficiency and controllability.

CN122132070APending Publication Date: 2026-06-02NINGBO JINWANG INFORMATION IND CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NINGBO JINWANG INFORMATION IND CO LTD
Filing Date
2026-03-24
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

The existing code rewriting model cannot achieve a fully closed-loop self-iteration on the domestic IT innovation platform, resulting in code rewriting results that cannot meet the adaptation requirements of the domestic IT innovation scenario. It has logical illusions, semantic errors, runtime exceptions and security and compliance risks, and cannot meet the efficiency and stability requirements of the domestic IT innovation project.

Method used

A code rewriting method based on a self-iterative model is adopted. The code is split and rewritten in an asynchronous manner. The rewritten results are cross-validated with the expected results in a virtual space until they are consistent. A closed-loop process of logical chain parsing, error factor analysis and virtual space operation is constructed, and a neural symbol self-iterative model is used for self-diagnosis and correction.

Benefits of technology

It has achieved fully automated self-iteration in rewriting the code of the domestic IT innovation platform, which has improved the consistency of the code's business logic, adaptability to the domestic environment, and operational reliability. It has ensured the security and compliance of the code rewriting results with the domestic IT innovation platform, met the independent and controllable requirements of the domestic IT innovation industry, and improved the rewriting efficiency and controllability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122132070A_ABST
    Figure CN122132070A_ABST
Patent Text Reader

Abstract

This invention relates to the field of intelligent code rewriting and discloses a code rewriting method for a domestic IT innovation platform based on a self-iterative model. The method operates in a code rewriting system comprising a basic database and a multi-link space. The multi-link space includes a rewriting space, a splitting space, and a virtual space. The method includes acquiring the target code, parsing the logical chain of the target code based on a neural symbolic self-iterative model, splitting the target code into sub-code segments, performing error factor analysis on the sub-code segments, executing the rewriting in the rewriting space, running the rewritten code in the virtual space, cross-validating the code execution results with the expected rewriting results, and controlling the asynchronous execution of code splitting, code rewriting, and virtual execution through an asynchronous clock and state signal mechanism to ensure that the execution results in the virtual space are consistent with the expected results, and outputting the rewritten code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a code rewriting method for a domestic IT innovation platform based on a self-iterative model, belonging to the technical field of intelligent code rewriting methods. Background Technology

[0002] The domestic IT innovation platform is the core carrier for achieving full-stack independent control in the field of information technology. Migrating and adapting existing business systems to a full-stack domestic software and hardware ecosystem, including domestic CPUs, operating systems, databases, and middleware, is a core task for the large-scale promotion of the domestic IT innovation industry. Cross-platform rewriting of existing code, adaptation to domestic interfaces, logical compliance modifications, defect fixing, and functional reconstruction directly determine the implementation efficiency, business continuity, and security controllability of the domestic IT innovation platform replacement project. These are core technical aspects that cannot be bypassed in the implementation of domestic IT innovation. With the rapid development of artificial intelligence technology, code rewriting models based on large language models have acquired basic code generation, reconstruction, and migration capabilities. They can complete basic operations such as syntax conversion and cross-platform adaptation based on natural language instructions, reducing the manual cost of domestic IT innovation code adaptation to some extent. However, existing rewriting models have a fundamental and insurmountable defect in the specific scenario of the domestic IT innovation platform: they lack a fully closed-loop self-iterative capability based on the first-principle verification principle. Their code rewriting behavior is mostly single-prediction or limited-number attempts, failing to adapt to the core needs of the domestic IT innovation scenario. Specifically, when an agent receives a domestically adapted code rewriting instruction from a domestic IT innovation platform, it can only tentatively generate code variants based on the statistical patterns of the training data. If the rewriting result does not meet the adaptation requirements of the domestic IT innovation platform and business expectations, it must rely on manual error annotation and repeated input of prompts to guide the model to correct it. Not only is the adaptation cycle completely uncontrollable, but human error can also easily lead to business interruptions in the domestic IT innovation production environment, failing to meet the efficiency and stability requirements for the large-scale deployment of domestic IT innovation projects. At the same time, although the code output by existing models is often highly syntactically compliant, its semantic correctness, runtime logic consistency, adaptability to the domestic environment, and security compliance are all seriously lacking in the domestic IT innovation scenario, and there are even cases where the code cannot be compiled and executed normally on the domestic IT innovation platform. These anomalies are amplified in the context of domestic IT innovation, with two main causes: First, logical illusion and functional degradation, which are common problems in generative code models. During the localization rewriting process, the model is prone to introducing invalid code that does not conform to the specifications of the domestic IT innovation platform and contradicts the original business logic. It may even deviate from the core business intent in multiple iterations of rewriting. Domestic IT innovation platforms have extremely high requirements for business logic consistency and security compliance. Logical illusion can not only lead to business anomalies but may also introduce unauthorized code logic, bringing serious security and compliance risks and violating the core principle of independent control of the domestic IT innovation industry. Second, there is a serious disconnect between context and runtime environment. Existing models can only perform static analysis on code text and cannot perceive the runtime environment characteristics, resource constraints, interface call specifications, and differentiated ecosystem requirements of domestically produced software and hardware on the domestic IT innovation platform. As a result, the rewritten code can only meet the surface-level syntax compliance. In the actual operation of the domestic IT innovation platform, problems such as interface incompatibility, excessive resource consumption, and runtime anomalies occur, forming the core pain point of "can be modified, but cannot run, and cannot be used" in the domestic IT innovation code adaptation.To address the aforementioned issues, existing industry solutions typically involve integrating external static analysis tools and specialized testing tools for domestic environments, or generating multiple code variants through repeated sampling and then selecting the optimal adaptation solution. However, these methods are essentially passive, relying on external auxiliary tools to verify results and then using those results to constrain the model generation process. They fail to endow the code rewriting agent with the core capabilities at the architectural level to dynamically analyze adaptation errors in the domestic environment, accurately verify the operational results of the domestic innovation platform, and autonomously generate compliant correction solutions throughout the entire domestic innovation adaptation process. Consequently, they cannot fundamentally solve the core problems of low code rewriting adaptation efficiency, uncontrollable business logic, insufficient operational reliability, and high security and compliance risks in domestic innovation scenarios. Summary of the Invention

[0003] The purpose of this invention is to provide a code rewriting method for a domestic IT innovation platform based on a self-iterative model. The method splits and rewrites the code asynchronously, runs the rewritten code in a virtual space, and cross-verifies the code execution results with the expected results until the execution results in the virtual space are consistent with the expected results.

[0004] To achieve the above objectives / to solve the above technical problems, the present invention is implemented using the following technical solution.

[0005] On one hand, this invention provides a code rewriting method for a domestic IT innovation platform based on a self-iterative model, running in a code rewriting system including a basic database and a multi-link space, wherein the multi-link space includes a rewriting space, a splitting space, and a virtual space, and the method includes: The target code is obtained, and the target code is parsed using a neural symbolic self-iterative model to obtain a logical chain. The target code is then split into sub-code segments. Error factor analysis is performed on the sub-code segments. For sub-code segments with error factors, the correction strategy in the basic database is retrieved to complete the correction and then rewritten. For sub-code segments without error factors, rewriting is performed in the rewriting space. Run the rewritten code in the virtual space and cross-validate the code execution results with the expected rewritten results. The asynchronous execution of code splitting, code rewriting, and virtual running is controlled through asynchronous clock and status signal mechanisms. If the running result does not match the expected result, the process is backtracked to the code splitting stage, error factor analysis stage, or logic chain parsing stage corresponding to the error for iterative correction until the running result of the virtual space matches the expected result. The logical chain parsing includes: Construct an abstract syntax tree for the target code, generate a program dependency graph based on the abstract syntax tree, and extract high-dimensional semantic vectors of the target code using a pre-trained code understanding model; The high-dimensional semantic vector is aligned and fused with the program dependency graph to generate a unified neural symbol embedding vector. The semantic entropy of each logical unit in the target code is calculated using the unified neural symbol embedding vector, and a semantic entropy heatmap is generated.

[0006] Preferably / further, the program dependency graph and the semantic entropy heatmap are read, the local subgraph complexity of nodes with high semantic entropy values ​​is calculated, and a dynamically prioritized split task queue is generated; Based on at least one of the dimensions of control flow constraints, data dependency constraints, and semantic clustering constraints, a splitting strategy is generated for the target subgraph in the splitting task queue. The logical equivalence of the splitting strategy is verified by a lightweight symbolic execution engine, and the verified splitting scheme is output.

[0007] Preferably / furthermore, error factor analysis is performed on the sub-code segment; If no error factor is found, the sub-code segment is rewritten; If an error factor is found, the error factor is parsed, and a matching correction strategy is retrieved from the correction strategy library to correct the sub-code segment. The corrected sub-code segment is then rewritten.

[0008] Preferably / further, a lightweight symbolic execution engine is used to verify whether the code module violates the predefined data interaction and calling conventions. The neural symbolic self-iterative model is invoked to calculate the semantic deviation between the unified neural symbolic feature vector of the current code module and the original vector when the module was generated. The memory usage and execution time of the virtual runtime are monitored, and the captured abnormal signals are combined with the code logic graph context to encapsulate them into structured error factors.

[0009] Preferably / further, starting from the node of the current error factor in the logic graph, reverse tracing and forward prediction are performed to form a logic pollution chain. The root cause error factor is located in the logic pollution chain and prioritized according to its impact range. Correction strategies are matched to the root cause error factor to generate an executable correction scheme. The results of the correction scheme are verified in virtual space and fed back to the error factor analysis to prune and update the logic pollution chain.

[0010] Preferably / furthermore, asynchronous execution of code splitting, code rewriting, and virtual running is based on asynchronous clock control; Based on an asynchronous clock, when the first sub-code segment is obtained through code splitting, the rewriting of that sub-code segment is triggered asynchronously; When a single logical link of the rewritten sub-code segment is parsed out, the virtual execution of that sub-code segment is triggered asynchronously; The feedback from the virtual operation results drives the verification and iterative optimization of the code splitting and rewriting process.

[0011] Preferably / furthermore, the asynchronous execution control is performed through a hierarchical asynchronous state signal mechanism, specifically including: Predefine and publish status signals to indicate the completion of task phases; Configure each functional unit to listen for specific status signals to trigger its execution; When a process anomaly is detected, an anomaly alarm signal is issued to trigger the backtracking mechanism and adjust the system task processing priority.

[0012] Preferably / furthermore, it also includes a syntax standardization preprocessing step, specifically including: For the programming language type of the target code, the corresponding syntax rule library is loaded. Through the syntax rule library, the target code is subjected to syntax ambiguity resolution and structural standardization to generate structured fused text. Lexical analysis is performed on the structured fused text to break it down into atomic lexical units. Based on grammatical rules, the atomic lexical units are combined into grammatical units, and the hierarchy and position information of the grammatical units are recorded.

[0013] Preferably / further, the neural symbol self-iterative model includes: The encoding layer employs a dual-branch attention mechanism, combining syntactic and semantic attention, to encode the input code. The symbolic logic reasoning layer infers the encoded results based on a built-in logic rule base and generates logical feature vectors. The multi-task output layer, based on fused encoding and logical features, performs at least one of the following tasks: logical contradiction identification, functional intent classification, cross-language understanding, and error localization.

[0014] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: 1. This invention constructs a full-link self-iterative closed loop of "logic chain parsing - adaptive splitting - error factor analysis - code rewriting - virtual space operation - cross-validation - backtracking iteration". During the process of domestic rewriting and adaptation of the information technology innovation platform, when the code execution result does not meet the business expectations of the information technology innovation platform, the system can automatically backtrack to the corresponding link to complete the root cause location and iterative correction until the output code with the running result on the information technology innovation platform is completely consistent with the expectations. From the architectural level, it gives the information technology innovation code rewriting intelligent agent the endogenous ability of autonomous verification, self-diagnosis and self-evolution, completely get rid of the passive dependence of existing information technology innovation code adaptation on manual prompts and intervention and external testing tools, and truly realize the fully automated self-iterative of code domestic rewriting and adaptation in the information technology innovation scenario. It greatly reduces the implementation cycle of information technology innovation projects and meets the efficiency requirements of large-scale implementation of the information technology innovation industry. 2. This invention introduces an independent virtual space that can directly simulate the full-stack domestic software and hardware operating environment of the domestic IT innovation platform. It performs dynamic runtime verification on the rewritten code and cross-verifies it with the expected business results. This upgrades the verification standard for code correctness in the domestic IT innovation scenario from the traditional static syntax compliance and model output probability to the consistency verification of dynamic runtime results under the domestic IT innovation platform environment. It can effectively capture and correct hidden problems that are difficult to find through static text analysis, such as semantic logic errors specific to the domestic IT innovation platform, domestic interface adaptation anomalies, runtime resource consumption exceeding limits, and business logic deviations. Combined with an automated backtracking and correction mechanism, it can continuously approach the code rewriting result that is fully adapted to the domestic IT innovation platform and has completely correct functions. This greatly improves the business logic consistency, domestic environment adaptability, and operational reliability of the rewritten code in the domestic IT innovation scenario, and fully ensures the business continuity after the domestic IT innovation platform goes live. 3. This invention overcomes the core defects of existing generative code models in the adaptation process of information technology innovation platforms, such as logical illusion and lack of first-principles verification, by establishing a deep collaborative mechanism for virtual operation verification and feedback correction of information technology innovation platforms. It uses observable and quantifiable code operation results under the localization environment of information technology innovation platforms as the basis for real-time verification, driving the iterative optimization of the rewriting process. This ensures that the entire code rewriting process is always consistent with the original business intent and the security and compliance specifications of information technology innovation platforms. It effectively suppresses the risk of code deviating from the original business intent, introducing unauthorized logic, and violating information technology innovation compliance requirements in multiple localization adaptation iterations. It fully conforms to the core principles of independent controllability, security and compliance of the information technology innovation industry, and significantly improves the controllability and compliance of the output results of information technology innovation code rewriting. 4. This invention employs an asynchronous clock and hierarchical status signal mechanism to achieve asynchronous pipelined parallel execution of the three core stages: code splitting, code rewriting, and virtual operation. This breaks through the performance bottleneck of the traditional serial processing mode of "full splitting - full rewriting - full testing" for domestic innovation code adaptation. Targeting the characteristics of large core business systems with large code volume and high coupling in domestic innovation scenarios, domestic rewriting can be triggered as soon as the first sub-code segment is split, and virtual operation in the domestic innovation environment can be triggered as soon as a single logic link is rewritten. While ensuring the accuracy of rewriting adaptation, it significantly improves the processing efficiency of domestic rewriting adaptation of large-scale business systems, perfectly meeting the needs of rapid and stable deployment of large core systems in domestic innovation projects. 5. The neural symbolic self-iterative model adopted in this invention combines the deep understanding of business semantics by neural networks with the interpretability and verifiability of symbolic logic. It can seamlessly adapt to the code rewriting needs of multiple programming languages, multiple domestic vendor interface specifications, and multiple technology stacks in the domestic IT innovation scenario. At the same time, through the construction and analysis of structured error factors and logical pollution chains, it realizes the accurate location of the root cause of domestic IT innovation adaptation errors and the control of the entire chain propagation. Error-correction examples throughout the process can be structured and accumulated in the basic database to form a domestically adapted error-correction knowledge graph and correction strategy library. This enables the system's domestic IT innovation code adaptation and self-repair capabilities to continuously evolve with the accumulation of running data, forming a positive synergy with the improvement of the domestic software and hardware ecosystem, and providing the domestic IT innovation platform with continuously iterative code adaptation capabilities. Attached Figure Description

[0015] Figure 1 The diagram shown is a flowchart of the overall system of this invention. Figure 2 The diagram shows the system overview and preprocessing module flowchart. Figure 3 The flowchart shown is for the logical chain parsing and semantic entropy calculation module; Figure 4 The diagram shown is a flowchart of the adaptive code splitting module. Figure 5 The flowchart shown is for the error factor analysis and encapsulation module. Figure 6 The diagram shown is a flowchart of the strategy matching and code rewriting module. Figure 7 The diagram shown is a flowchart of the virtual operation and cross-validation module. Figure 8 The flowchart shown is for the asynchronous clock and status signal control module. Detailed Implementation

[0016] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.

[0017] The term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0018] This embodiment introduces a code rewriting method for a domestic IT innovation platform based on a self-iterative model. It runs on a code rewriting system that includes a basic database, interaction units, and a multi-link space, and includes: The target code is obtained, split, and rewritten. The multi-link space includes the rewriting space and the splitting space. The splitting of the target code includes logical chain parsing and code splitting. The execution result of the target code is parsed to obtain the logical relationship and generate code tags. The target code with code tags is traversed and split to obtain sub-code segments. The sub-code segments are obtained and rewritten in the rewriting space.

[0019] Based on the neural symbol self-iterative model, code logic chain parsing and adaptive code splitting are performed. Through pre-trained code understanding of the large model, the source code text and comments are transformed into a high-dimensional semantic vector sequence. In this process, the functional intent of the code is captured and the independent semantic vectors of key code elements are extracted.

[0020] An abstract syntax tree is constructed to generate a control flow graph to show the program execution path and a data dependency graph to reveal the definition and usage relationships between variables, forming a program dependency graph that accurately describes the internal logical structure of the code. A cross-attention mechanism is used to dynamically align and deeply fuse the high-dimensional semantic vector sequence with the program dependency graph. Based on the fused unified vector, a lightweight prediction model is used to estimate the probability that each logical unit in the code needs to be corrected during the iteration process, which is defined as semantic entropy. The level of entropy quantifies the uncertainty or complexity of the code logic, and an entropy heatmap covering the entire code is generated to intuitively mark code regions with different entropy values.

[0021] Because different programming languages ​​have significantly different syntax features, directly parsing the original code will generate a lot of syntactic ambiguity, leading to deviations in subsequent semantic extraction and graph construction. Therefore, it is necessary to perform syntax standardization preprocessing. For the programming language type of the target code, the corresponding language-specific syntax rule library is automatically loaded. This rule library contains core content such as the keyword set, operator precedence matrix, statement structure specifications, and syntax ambiguity resolution rules of the language. For example, for the problem of ambiguous syntax block boundaries caused by inconsistent indentation in Python code, the system will perform indentation statistics and adjacent statement correlation analysis to transform indentation differences into clear syntax block separators. At the same time, redundant spaces, duplicate variable declarations, invalid comments and other meaningless characters in the code are removed to form a structured code and comment fused text, providing a unified input basis for subsequent word segmentation and parsing.

[0022] Since lexical segmentation can only obtain scattered atomic elements, including identifiers, keywords, and constants, which cannot form logical units with syntactic meaning, a two-level segmentation strategy of lexical and syntactic units is implemented to form logical syntactic units. The lexical analyzer traverses the standardized fused text and, based on the lexical rules in the syntactic rule base, splits the text into atomic lexical units, labeling each unit with a type tag. For example, the code statement "inttotal=sum(numList);" is split into atomic units such as "int (keyword)", "total (variable name)", "= (operator)", "sum (function name)", and "numList (variable name)". Based on the syntactic rules in the syntactic rule base, the atomic lexical units are combined into syntactic units with complete syntactic meaning. At the same time, the position information such as the start line number, end line number, and parent syntactic unit of each syntactic unit is recorded, providing data support for the hierarchical structure construction of the abstract syntax tree nodes.

[0023] Because traditional abstract syntax trees (ASTs) only contain syntactic structure information and lack semantic connections and constraints, they cannot support core processes such as logical chain parsing and error factor analysis. Therefore, semantic enhancement annotations are implemented. By establishing semantic connections between code and comments, semantic understanding biases caused by invalid comment information are avoided. The semantic features of the code itself are extracted to ensure accurate capture of functional intent even in scenarios without comments. Furthermore, a cross-attention mechanism is used to connect AST nodes with pre-trained code to understand the high-dimensional semantic vectors output by the large model. The core semantic features in the vectors are transformed into extended attributes of the nodes. For example, for the variable declaration node "String userId;", semantic information such as the inferred data type, scope, and potential associated functions are annotated; for the function call node "sendRequest(url,params);", semantic attributes such as the function description, input parameter constraints, and return value type are annotated. At the same time, a bidirectional mapping algorithm between comments and code is used to establish connections between block comments, inline comments, and corresponding syntactic units. Comment binding identifiers are added to each AST node to establish strong connections, ensuring that comment information can effectively assist semantic understanding.

[0024] Since cross-level associations between nodes in the abstract syntax tree (AST) are crucial for the generation of subsequent control flow graphs and data dependency graphs, a lack of clear association links can lead to logical breaks in subsequent graph construction. After semantic annotation, cross-level association links between AST nodes are constructed. All AST nodes are traversed to locate nodes requiring cross-level associations, such as variable reference nodes, function call nodes, and class instantiation nodes. Then, based on grammatical rules and semantic features, association pointers are established between the current node and its corresponding declaration node. These pointers are bound together, and the association type is recorded. A grammatical integrity verification engine is then activated to verify the structural legality of the AST based on the grammatical rule base. Incomplete grammatical structures detected are labeled with grammatical risk levels and preliminary repair suggestions. For example, for non-void functions lacking return values, the label "High Risk: Function declaration returns an int value, but does not contain a return statement" is provided, along with suggestions to "Add a return statement to return an int value or change the function's return type to void," providing preliminary risk information for subsequent error factor analysis.

[0025] The bidirectional mapping algorithm includes: Set the comments to be processed to be combined as Where n is the total number of comments, and each comment Corresponding attribute vector, The meanings of each component are as follows: Characterizes the unique identifier of the annotation. Characterizes inline, block, and document comments in comment types. The annotation text is represented by V, which is the natural language vocabulary space. The line number that indicates the starting line of the comment in the code. This indicates the end line number of the comment in the code. The annotations represent the global, class-level, and function-level code regions, defining the combination of code syntax units as... Where m is the total number of syntax units, and each unit Corresponding attribute vector, The meanings of each component are as follows: Characterizes a unique identifier for a syntactic unit. Characterizes functions, classes, loops, conditionals, and assignment statements within a unit type. The set of keywords representing the unit function, where k is the number of keywords. The starting line number of the representation unit in the code. The end line number of the representation unit in the code. The code region described in the characterization unit.

[0026] Bidirectional mappings are used to find a set of mappings. Make any ,in Characterization and The degree of correlation, and satisfying: in, Characterizes the maximum number of mappings for a single annotation. It represents the maximum number of mappings for a single code unit, thereby constraining the rationality of the mapping relationship.

[0027] The system performs forward matching of comments to code and reverse matching of code to comments to achieve bidirectional mapping. The forward matching process includes: Initial screening of candidate sets: Perform candidate weight calculation: Perform location similarity optimization: Since the positional correlation between comments and code units is inversely proportional to the distance—the closer the distance, the higher the positional similarity—a reciprocal form is used to map the distance to... The similarity value constraints are satisfied. The position threshold is determined based on the annotation type. The difference is used to adjust the strictness of position constraints in the initial screening of the candidate set.

[0028] Perform semantic similarity Calculation of comprehensive score : The reverse matching process includes: Initial screening of candidate sets: Perform candidate weight calculation: Perform location similarity optimization: Perform semantic similarity Overall score calculate: Preliminary mapping candidate set obtained: in, This characterizes a position threshold adjustment system used to narrow down the position filtering range under an "OR" constraint. This represents the weight of hierarchical associations within regions, and is used in scenarios where regions are inconsistent but hierarchical relationships exist. This characterizes the weights of unrelated regions, used in scenarios where regions lack hierarchical association and exhibit inconsistencies. Characterizes the initial matching threshold under the "OR" constraint, and is obtained by matching below the threshold. To avoid omitting valid candidates, the following constraints apply: , The mapping relationship between comments and code is obtained sequentially through a bidirectional mapping algorithm. and The preset weighting coefficients satisfy... + =1, used for both peace and positional similarity. and semantic similarity Contribution to the overall score, The position threshold is determined based on the annotation type. The differences are used to adjust the strictness of position constraints in the initial screening of the candidate set for reverse matching. For from grammar units A mapping function for extracting key semantic features is used to map them to the vector representation of the annotated text. Perform semantic similarity calculation. Comment text Mapped to the natural language vocabulary space V, representing word vectors.

[0029] Using unified neural symbol embedding vectors as node features and program dependency graphs as initial edge structures, an initial code logic graph is constructed. Graph neural networks are used to infer potential logical dependencies, and the calculated semantic entropy values ​​are used as key attributes to annotate the entropy of corresponding graph nodes, outputting an initial probabilistic logic graph with entropy value annotations.

[0030] The construction methods for the code logic graph include graph node initialization, initial edge structure construction, and graph dimensional enhancement: Using logical units of code as basic nodes, the division of logical units is based on the preliminary calculation results of semantic entropy and the functional boundaries of the code. Each node contains three core attributes: first, syntactic structure attributes, which are the node type and statement structure features extracted based on the abstract syntax tree; second, semantic feature attributes, which are the high-dimensional semantic vector of the logical unit and the set of independent semantic vectors of key elements generated by the pre-trained model; and third, semantic entropy attributes, which are the semantic entropy value of the logical unit calculated by the lightweight prediction model, quantifying its logical uncertainty. Based on the program dependency graph as the basic framework, an initial edge structure between nodes is constructed, containing two types of core edges: first, control flow edges, which extract the execution order relationship between logical units based on the control flow graph, with edge attributes indicating the execution triggering conditions and order priority; and second, data dependency edges, which extract the variable transit relationship between logical units based on the data dependency graph, with edge attributes indicating the name, data type, and transit frequency of the transited variables. A graph neural network inference model is introduced. Taking initialized node attributes and edge structure as input, the model captures local neighbor features of nodes through graph convolutional layers and strengthens the weights of key dependencies through graph attention layers to infer potential logical dependencies. For example, although logical unit I and logical unit J have no direct data or control flow connection, they both serve the same functional goal, exhibiting functional synergistic dependency; the execution result of logical unit K indirectly affects the conditional judgment of logical unit L, exhibiting implicit control flow dependency. The logical rationality of the inferred potential dependencies is verified by a symbolic logic verification module. After successful verification, they are added as potential dependency edges, with edge attributes labeled with dependency type and inference confidence. Based on the initial node and edge structure, two key dimensions of graph information are added: First, the logical dependency strength dimension, which calculates the dependency strength value of each edge. This value is calculated based on the semantic similarity of related nodes, the co-occurrence frequency during code execution, and the criticality of data transmission. For example, the transitive dependency strength of core variables is higher than that of ordinary variables, and the control flow dependency strength of mandatory execution paths is higher than that of optional paths. Second, the functional module association dimension, which uses cluster analysis on the functional intent tags of nodes to divide nodes belonging to the same functional module into the same functional cluster. Functional association edges are added between nodes within the cluster, and the edge attributes are labeled with the functional cluster name and the functional role of the node within the cluster.

[0031] Semantic entropy values ​​are used as the basis for dynamic adjustment of nodes. For nodes with semantic entropy values ​​higher than a threshold, their internal logical units are refined, new child nodes are split, and the associated edges are reconstructed. For adjacent nodes with semantic entropy values ​​lower than the threshold and highly related functions, they are merged and optimized to reduce graph redundancy. At the same time, all operations in the graph construction process are recorded to form a graph construction log, which serves as a reference for subsequent code splitting and error tracing.

[0032] Read the initial probabilistic logic graph and entropy heatmap, calculate the comprehensive complexity of the local subgraph of high-entropy nodes, and generate a dynamically prioritized splitting task queue. For the target subgraph in the splitting task queue, generate executable splitting strategies from the dimensions of control flow boundary, key data nodes, and semantic clustering, clarify the code boundaries and interface specifications after splitting, verify them based on a lightweight symbolic execution engine, prove the logical equivalence of the code before and after splitting through mathematical reasoning, and verify whether the interface specifications are maintained. Output the splitting scheme that passes the verification.

[0033] An executable splitting strategy is generated based on three dimensions: control flow constraints, data dependency constraints, and semantic clustering constraints. The splitting logic for the control flow constraint dimension includes: A nested loop depth threshold is set. When the nested loop depth of a logic unit exceeds the threshold, it is split with the innermost loop as the boundary. The inner loop is separated into an independent sub-module, while the outer loop retains its original module. The split boundary is the input / output interface of the loop variable. The number of decision paths for conditional branches is calculated, and a threshold number of paths is set, such as the number of decision paths for if-else statements and the number of branches for switch-case statements. When the number of paths exceeds the threshold, the branches are clustered and split according to their functional relevance. Branches with similar functions are merged into a sub-module. The input interface of each sub-module is the branch decision condition, and the output interface is the branch execution result. The code execution path is simulated through a symbolic execution engine to identify control flow segments with parallel execution characteristics, i.e., segments with no execution order dependency and only need to meet the input data readiness condition. These segments are independently split into parallel sub-modules, with the split boundary set as the data input readiness trigger interface and the execution result summary interface.

[0034] The logic for splitting data dependency constraints includes: Calculate the variable sharing ratio between logical units and set a first threshold and a second threshold for the sharing ratio. When the sharing ratio is lower than the first threshold, it is determined to be a weak data dependency and can be independently split. When the sharing ratio is between the first and second thresholds, splitting is performed using data interface encapsulation. Shared variables are encapsulated into standardized data interfaces, and sub-modules interact with data through these interfaces. When the sharing ratio is higher than the second threshold, no splitting is performed to avoid performance loss caused by frequent data interactions after splitting. Analyze the length of the variable transmission path between logical units. When the path length exceeds the threshold for the number of logical units, splitting is performed at the intermediate nodes of the path. Set up a data caching interface to split long paths into multiple short-path sub-modules to reduce data transmission latency. Identify the core data in the code and independently split the read and write logic of the core data into dedicated sub-modules. Other logical units access the core data through standardized read and write interfaces. The split boundary is set as the access control interface for the core data to ensure the security and consistency of the core data.

[0035] The logic for splitting the semantic clustering constraint dimensions includes: The functional intent vector of each logical unit is calculated, and the similarity value is calculated using the cosine similarity algorithm. Logical units with similarity values ​​higher than the similarity threshold are clustered into a sub-module to ensure the uniformity of sub-module functions. The semantic entropy difference between adjacent logical units is calculated. When the difference exceeds the entropy threshold, it indicates that the logical complexity of the two is significantly different, and they are split and isolated to avoid the logical uncertainty of the high-entropy module affecting the stability of the low-entropy module. The functional independence of logical units is identified through a pre-trained model. Logical units with functional independence values ​​higher than the independence threshold are directly split into independent sub-modules, whose interfaces are the input parameters and output results of that function.

[0036] For the verified splitting scheme, the global logical graph is updated in real time, the atomic graph is replaced with new nodes, and connections are established according to the interface specifications. After splitting, the semantic entropy of the affected area is immediately recalculated. Successful or unsuccessful splitting verification cases are fed back as training data to the neural symbol self-iterative model to achieve online learning and optimization.

[0037] If the entropy value of a new module generated after each split is still high, it can be added back to the task queue. When the semantic entropy of all code modules drops below the threshold, or the task queue is cleared, the final logical chain graph is output, along with a verified set of sub-codes.

[0038] The neural symbolic self-iterative model consists of a bottom-level encoding layer, an intermediate symbolic logic reasoning layer, and a top-level multi-task output layer, wherein: The encoding layer includes a Transformer encoder, which optimizes the standard Transformer's multi-head attention mechanism into a dual-branch attention mechanism of syntactic and semantic attention. The syntactic attention branch focuses on capturing the syntactic structural relationships of the code, such as the sequential dependencies between statements and the association between functions and calling statements. It enhances structural feature extraction by assigning attention weights to the abstract syntax tree nodes of the code. The semantic attention branch focuses on capturing the semantic relationships of the code, such as cross-statement references of variables and the semantic correspondence between comments and code. It assigns attention weights by calculating the semantic similarity of text fragments. The outputs of the dual-branch attention are integrated through an adaptive weight fusion module to generate a basic encoding vector that combines structural and semantic features.

[0039] The symbolic logic reasoning layer includes a symbolic logic reasoning unit, which contains a logic rule base and a dynamic reasoning engine. The logic rule base contains domain-specific logic rules, such as: function definitions must precede calls, variables can only be used after assignment, and loop conditions must be semantically consistent with the loop body. The dynamic reasoning engine, based on the underlying encoding vector, identifies logical relationships in the code through pattern matching and rule-based reasoning, such as causal relationships, dependency relationships, and constraint relationships. It then transforms the reasoning results into logical feature vectors, which are fused with the underlying encoding vectors to form a two-dimensional fused vector.

[0040] The multi-task output layer includes: inputting a fusion vector of a code snippet to predict whether the snippet contains logical contradictions, such as conflicts between conditional judgments and execution results, or mismatched variable types; mapping the fusion vector of the code snippet to a preset set of functional intent labels, such as data sorting, file reading and writing, network requests, and algorithm calculations, to achieve accurate functional classification; inputting code snippets of different programming languages ​​that implement the same function to train the model to generate semantically consistent fusion vectors, improving the model's cross-language code understanding ability; and inputting code snippets containing syntax errors and logical errors to train the model to identify error types and locate semantic features associated with errors, laying the foundation for subsequent error factor analysis.

[0041] When rewriting a sub-code segment, error factor analysis is also performed on the sub-code. Sub-code segments without error factors are rewritten, while sub-code segments with error factors are analyzed for factors. Correction strategies configured in the base database are retrieved, error factors are analyzed and the sub-code segments are corrected, and the corrected sub-code segments are rewritten.

[0042] The lightweight symbolic execution engine verifies whether the code module violates the predefined data interaction and calling conventions. It also calls the neural symbolic self-iterative model to compare the current unified neural symbolic feature vector of the code module with the original vector when the module was generated, and calculates its semantic deviation. A high deviation indicates that the code may have deviated from the original functional intent in multiple iterations. The system monitors the memory usage and execution time of the virtual runtime and compares them with historical baselines or expected thresholds to capture abnormal resource usage patterns.

[0043] Specifically, verifying whether the code module violates predefined data interaction and calling conventions includes: Since data interaction and calling conventions are usually in the form of natural language or semi-structured documents, they cannot be directly parsed and verified by the symbolic execution engine. These conventions need to be transformed into formal symbolic rules that can be recognized by machines. Based on the domain adaptation model of the neural symbolic self-iterative model, the core constraints in the conventions are extracted and transformed into first-order logical symbolic expressions. At the same time, each rule is associated with the corresponding node type in the global logic graph to ensure that the rules and the logical structure of the code are accurately aligned. The lightweight symbolic execution engine loads the formalized set of symbolic rules and extracts the associated subgraph of the code module to be verified from the global logic graph, including the input and output nodes, direct data dependency nodes, and control flow predecessor and successor nodes of the module. Combined with the contextual information of the logic graph, the problem of symbolic execution being limited to the module and ignoring cross-module constraints is avoided.

[0044] The execution engine starts with symbolic input data and traverses the key executable paths of the module using a path pruning strategy. During path execution, it matches code behavior with symbolic rules in real time to detect rule violations. If a rule violation is found, it is immediately marked as an anomaly signal indicating a potential violation of data format conventions. However, the symbolic execution engine can only detect the surface-level rule execution results and cannot determine whether the violation is caused by a syntax error or a semantic intent shift. To address this, a neural symbolic self-iterative model is invoked for deep verification. The original unified neural symbolic feature vector of the code module when it was first generated is extracted from the model's historical training cache. The standardized text of the code module to be verified is input into the model, and the model re-encodes and generates the current unified neural symbolic feature vector through a dual-branch attention mechanism. Information such as the potential anomaly location, association rule identifier, and logical graph subgraph structure captured during symbolic execution are passed into the model as context parameters to assist the model in focusing on feature extraction and comparison of key areas. Furthermore, by combining the path verification results of symbolic execution and the logical graph context through the neural symbolic self-iterative model, a secondary semantic judgment is made on potential anomalies to determine whether they are accidental syntax errors or parameter adjustments caused by changes in core semantic intent. This achieves synergy between surface-level rule verification and deep semantic judgment. This collaborative approach preserves the accuracy of symbolic execution engines in path coverage and rule matching, enabling rapid identification of explicit violations of conventions. By leveraging the semantic understanding capabilities of neural symbolic models, it avoids misjudging reasonable code optimizations as violations. Meanwhile, the lightweight design, through path pruning and context focusing, avoids the problems of excessive resource consumption and low execution efficiency of traditional symbolic execution engines, thus meeting the real-time requirements of the self-iterative process.

[0045] The semantic deviation is calculated by integrating three dimensions: feature vector similarity, logical graph structure consistency, and semantic entropy change. Specifically, it includes: The feature vectors are split and their cosine similarity is calculated to obtain the feature vector similarity. Calculate the graph editing deer and matching degree of the subgraph of the logic graph to obtain structural consistency. ; The semantic entropy change rate is calculated and combined with the keyness coefficient to obtain the semantic entropy change index. The initial semantic deviation is obtained by fusing the three-dimensional indicators according to their weights. The final semantic deviation is obtained by combining the rule violation correction coefficient and the time decay factor. .

[0046] When calculating feature vector similarity, the syntax structure, semantic intent, and logical dependencies are decomposed, and their similarities are calculated separately before being weighted and fused together to obtain the unified neural symbol feature vectors of the original code modules. The unified neural symbolic feature vector of the current code module Decomposed into character vectors according to feature dimensions, where, , For vector dimensions: in, , Representation syntax subvectors, , Characterizing the intended sub-vector, , Representational logical subvectors, .

[0047] Feature vector similarity for: Wherein, the weights satisfy Since simple graph edit distance cannot reflect the semantic matching degree of nodes and edges, structural consistency is obtained by correcting the graph edit distance, node matching degree, and edge association degree. The graph edit distance is calculated using a dynamic programming algorithm to determine the minimum modification cost, which includes: in, The subgraph representing the logic graph corresponding to the original code module. For a set of nodes, For edge set, The subgraph representing the logic graph corresponding to the current code module. For a set of nodes, For edge set, Represents the insertion of nodes or edges. Represents the deletion of a node or edge. The replacement cost for a node or edge is set to 1.

[0048] The node matching degree calculation specifically includes: in, , For node semantic entropy, For function labels.

[0049] Edge correlation calculation specifically includes: in, , For edge type, The direction of the edge.

[0050] The corrected structural consistency is as follows: in, and Characterizing the balance coefficient, This is used to ensure that the matching accuracy metric effectively offsets the excessive influence of edit distance.

[0051] The semantic entropy change rate needs to be considered in conjunction with module importance to avoid misjudgments caused by entropy fluctuations in secondary modules. Therefore, entropy change rate and weighted entropy change index are calculated. The entropy change rate is: The weighted entropy change index is: in, The semantic entropy value that represents the original code module. , The semantic entropy value that represents the current code module. Q is the module criticality coefficient, and its value ranges between the upper limit of the core module value and the lower limit of the auxiliary module value.

[0052] Weights were assigned based on the importance of the three-dimensional indicators, and the results were combined to form the initial deviation. Wherein, the weights satisfy , Transformation of representation similarity, The conversion of the degree of deviation.

[0053] The initial deviation is dynamically corrected to obtain the final deviation: in, To correct the coefficient, only when the rules within the module are violated. ,when The time signature indicates a violation of cross-module rules, which is considered a serious deviation. The time signature indicates no rule violation, but the entropy value changes abruptly. The time decay factor represents the percentage of deviation caused by reasonable optimization as the number of iterations increases, and it decays slightly with the number of iterations.

[0054] The captured raw anomaly signals are combined with the current code logic relationship graph context and encapsulated into structured error factors. Each error factor is a data object containing a factor ID, associated module, anomaly type, triggering context, and pollution index. The factor ID is a unique identifier, the associated module represents the node ID of the code module that caused the anomaly in the logic graph, the anomaly type includes logic violation, semantic deviation, resource overrun, etc., the triggering context represents the input data, variable state snapshot, and related adjacent nodes in the logic graph at that moment when the anomaly occurred, and the pollution index represents the initial severity score.

[0055] Starting from the node in the logical graph where the current error factor is located, data dependency edges and control flow edges are used for reverse tracing and forward prediction. Reverse tracing is used to find upstream nodes that may lead to the current anomaly, while forward prediction is used to analyze downstream nodes that may be contaminated by the current anomaly. Error factors with causal relationships are connected to form logical pollution chains. These chains characterize how fundamental errors propagate from their source and derive various manifestations of anomalies. A pollution chain is a dynamic graph structure where nodes are error factors and edges represent verified or high-probability causal relationships. Whenever a new error factor is captured, it is attempted to be associated with existing pollution chains, expanding or merging them. Within each logical pollution chain, the root cause error factor is located based on the topological order of the nodes, the cumulative contribution of the pollution index, and the feasibility of remediation. All root cause factors are globally prioritized according to the total impact range of their pollution chains, generating a root cause remediation queue.

[0056] For each factor in the root cause remediation queue, a strategy is matched from the remediation strategy library and chain-aware matching is performed. If a root cause factor is at the source of a long contamination chain, a comprehensive remediation strategy that can block the propagation path of the entire contamination chain will be matched first, rather than just remediating the factor itself. When generating a remediation plan, an expected impact range assessment is attached to predict that it can eliminate downstream error factors on the current contamination chain after implementation.

[0057] The corrective measures are applied to the code, and the test is rerun in virtual space to verify whether the root cause error has been eliminated. The downstream errors predicted to be eliminated on the logical pollution chain where the root cause error is located are also tracked and verified to disappear synchronously. If the verification passes, all eliminated factors and their associated edges are pruned from the current set of error factors and pollution chain graph. If some downstream errors still exist, it indicates that the pollution chain model is incomplete or the corrective measures are insufficient. The verification results will be used as feedback to enhance the pollution chain model and optimize the corrective measures library.

[0058] Once a pollution chain is successfully pruned, the associated modules whose semantic entropy has changed significantly due to this correction are analyzed. Through an asynchronous clock mechanism, these modules are automatically added to a high-priority queue to be rewritten, triggering an adaptive rewrite that is coordinated with this correction to ensure the overall logical consistency of the system and prevent local corrections from introducing new incompatibilities.

[0059] All error factors, logical contamination chains, correction schemes, and their verification results are structurally stored in the system's basic database, forming a continuously growing error-correction knowledge graph. This knowledge graph is used to train an error propagation prediction model, enabling it to predict potential contamination chains earlier and more accurately in the future, even alerting to risks before errors actually occur. The correction strategy library is also continuously enhanced through feedback from actual effects, allowing the system's self-healing capabilities to evolve with each iteration.

[0060] The multi-link space also includes a virtual space, in which the rewritten code segment is run. The expected result of the code rewriting is cross-validated with the result of the virtual run to determine whether the rewritten code matches the expected result. If they do not match, the code rewriting stage is traced back, and the error factor analysis stage, code splitting stage, and logic chain parsing stage are traced back in sequence to identify the stage where the anomaly occurred and iterative correction is performed. The corrected code is then run virtually until the result of the virtual run matches the expected result, at which point the program exits and responds with a function prompt on the interactive unit.

[0061] An asynchronous clock is configured within the multi-link space. Based on the asynchronous clock, the asynchronous execution of code splitting, code rewriting, and virtual execution is controlled. The asynchronous clock is a dynamic clock used to trigger the rewriting process when the first sub-code segment is obtained through splitting. The rewriting process rewrites the obtained sub-code segment, parses the logical relationship of the rewritten sub-code segment, and triggers the virtual execution of the code when a single logical link is obtained. This achieves asynchronous execution of code splitting, code rewriting, and virtual execution. Each step is interconnected. When the execution condition of the next step is triggered during the execution of the previous step, the next step is executed. The results of the virtual execution are used to verify the code splitting and code rewriting, achieving self-iteration in the code rewriting process and improving the accuracy of the output code rewriting. Compared to the existing step-by-step execution method, there is a significant efficiency improvement. The step-by-step execution method traverses and rewrites the code after it is split. When the rewriting is completed, the rewritten code is output. The rewritten code needs to be manually copied to the engine with the language environment configured for result verification. If the verification result is not satisfactory, the system needs to input the error through the interactive unit. The system analyzes the error and rewrites it. The rewriting process is complicated and is prone to logical illusions during multiple interactions, which affects the rewriting result and efficiency.

[0062] A hierarchical asynchronous state signal mechanism is established as the central nervous system connecting the splitting space, rewriting space, and virtual space. The system does not rely on a fixed time rhythm but instead issues and transmits signals based on task completion status and results. Predefined standardized state signals are used; each signal represents the completion of a specific stage of work by a functional unit and carries a complete result data package. State signals include: The sub-segment ready signal is issued immediately when the splitting space successfully separates a semantically complete and clearly defined independent sub-code segment from the source code based on the logical relationship graph. The signal data packet includes: a unique identifier for the sub-code segment, the corresponding source code text, the input / output conventions for interacting with other sub-segments, and the source node identifier of the sub-segment in the global logical relationship graph.

[0063] The code rewriting scheme takes effect when the rewriting space generates a code rewriting scheme for a sub-code segment, and the scheme passes the formal logical equivalence verification of the lightweight symbolic execution engine. The rewriting space immediately issues a signal indicating that the rewriting scheme has passed verification. The signal data packet includes: the identifier of the rewritten sub-segment, the newly generated code text, and the formal verification report.

[0064] The virtual runtime completion signal is issued immediately after the virtual space completes the runtime test of a set of related code. The signal data packet includes: a test task identifier, a detailed test result report, runtime performance profile data, and a list of all exceptions captured during the test.

[0065] Process anomaly alarm signals are issued by the detection module at any stage of neural symbol parsing, code splitting, code rewriting, or virtual execution, once the system detects logical conflicts, significant semantic deviations from expectations, or resource consumption exceeding safety thresholds. The signal data packet includes: anomaly type classification, a snapshot of the specific context triggering the anomaly, the identifier of the involved code segment or logic graph node, and the system's preliminary assessment of the anomaly severity level.

[0066] The signal response responsibilities of the functional units are defined. The rewrite space continuously listens for the ready signal of the sub-segment. Once this signal is captured, the sub-code segment is intelligently rewritten. The virtual space continuously listens for the signal that the rewrite plan takes effect. Once this signal is captured, the rewritten code is virtually executed.

[0067] When the neural symbol parsing module has just completed a deep analysis of a certain part of the source code and generated a batch of reliable initial logical graph nodes, it immediately instructs the splitting space to prioritize the analysis and disassembly of these ready nodes. For each sub-code segment successfully extracted from the splitting space, a sub-segment ready signal is issued through the coordination mechanism, so that the code parsing and code splitting stages can work asynchronously and overlap, reducing the system response waiting time.

[0068] Upon receiving a segment ready signal, the corresponding rewrite task is added to the queue and assigned to an idle rewrite engine for execution. Simultaneously, real-time monitoring is performed. When an abnormal status alarm signal is received, the source tracing and backtracking mechanism is activated to quickly locate the original rewrite task that caused the abnormal or failed result, forcibly interrupt the current execution flow of the task, and put it back into the highest priority position in the task queue, suspending subsequent tasks that have a strong dependency on the task.

[0069] A dynamic indicator of logical health is constructed, which is calculated comprehensively based on the number, severity, and spread of errors reported in recent virtual operation completion signals. When the health index is high, it indicates that the system output results are stable and reliable. When the health index is low, it indicates that the system output results are unstable and there are problems in the code rewriting process. The system proactively reduces the intake of new tasks and the speed of rewriting, performs real-time testing on the effective signal of each rewriting scheme, and frequently uses the backtracking mechanism to improve the rewriting logic and the system's self-iteration, thereby improving the quality and efficiency of code rewriting.

[0070] In summary, this invention constructs an iterative logic exercise of parsing, splitting, rewriting, virtual running verification, and backtracking correction. When the rewriting result does not meet expectations, the system can automatically backtrack to the front-end stage for positioning and iterative correction until a running result consistent with the expected result is generated. This enables the intelligent agent to have the inherent ability of self-verification, self-diagnosis, and self-evolution, solving the passive mode that requires external manual prompts and verification for rewritten code, and realizing the sub-iteration of the code rewriting process. By introducing virtual space operation and cross-validating with expected results, the verification method of code correctness is changed from static syntax compliance or model probability to dynamic operation result verification. This effectively captures and corrects semantic and logical errors, runtime anomalies and result deviations that are difficult to find through text analysis alone. Combined with an automated backtracking and correction mechanism, it can continuously approach the correct code rewriting, thereby greatly improving the semantic correctness, logical consistency and functional reliability of the final output code. By establishing a coordinated mechanism for virtual operation verification and feedback correction, the core problems of logical illusion and lack of first-principles verification are overcome. Observable operation results are used for real-time verification and to drive iteration, ensuring that the rewriting process always stays consistent with the correct functional goals. This effectively suppresses the risk of code deviating from the original intent or introducing contradictory logic in multiple processing steps, and improves the controllability of the output results.

[0071] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0072] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0073] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0074] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0075] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A code rewriting method for a domestic IT innovation platform based on a self-iterative model, running in a code rewriting system including a basic database and a multi-link space, wherein the multi-link space includes a rewriting space, a splitting space, and a virtual space, characterized in that, The method includes: The target code is obtained, and the target code is parsed using a neural symbolic self-iterative model to obtain a logical chain. The target code is then split into sub-code segments. Error factor analysis is performed on the sub-code segments. For sub-code segments with error factors, the correction strategy in the basic database is retrieved to complete the correction and then rewritten. For sub-code segments without error factors, rewriting is performed in the rewriting space. Run the rewritten code in the virtual space and cross-validate the code execution results with the expected rewritten results. The asynchronous execution of code splitting, code rewriting, and virtual running is controlled through asynchronous clock and status signal mechanisms. If the running result does not match the expected result, the process is backtracked to the code splitting stage, error factor analysis stage, or logic chain parsing stage corresponding to the error for iterative correction until the running result of the virtual space matches the expected result. The logical chain parsing includes: Construct an abstract syntax tree for the target code, generate a program dependency graph based on the abstract syntax tree, and extract high-dimensional semantic vectors of the target code using a pre-trained code understanding model; The high-dimensional semantic vector is aligned and fused with the program dependency graph to generate a unified neural symbol embedding vector. The semantic entropy of each logical unit in the target code is calculated using the unified neural symbol embedding vector, and a semantic entropy heatmap is generated.

2. The method for rewriting code of a domestic IT innovation platform based on a self-iterative model according to claim 1, characterized in that, Read the program dependency graph and the semantic entropy heatmap, calculate the local subgraph complexity of nodes with high semantic entropy values, and generate a dynamically prioritized split task queue. Based on at least one of the dimensions of control flow constraints, data dependency constraints, and semantic clustering constraints, a splitting strategy is generated for the target subgraph in the splitting task queue. The logical equivalence of the splitting strategy is verified by a lightweight symbolic execution engine, and the target code of the splitting scheme that has passed the verification is output.

3. The method for rewriting code of a domestic information technology innovation platform based on a self-iterative model according to claim 2, characterized in that, Perform error factor analysis on the sub-code segment; If no error factor is found, the sub-code segment is rewritten; If an error factor is found, the error factor is parsed, and a matching correction strategy is retrieved from the correction strategy library to correct the sub-code segment. The corrected sub-code segment is then rewritten.

4. The method for rewriting code of a domestic IT innovation platform based on a self-iterative model according to claim 3, characterized in that, The lightweight symbolic execution engine verifies whether the code module violates the predefined data interaction and calling conventions. It calls the neural symbolic self-iterative model to calculate the semantic deviation between the unified neural symbolic feature vector of the current code module and the original vector when the module was generated. It monitors the memory usage and execution time of the virtual runtime and encapsulates the captured abnormal signals into structured error factors in combination with the code logic graph context.

5. The method for rewriting code of a domestic IT innovation platform based on a self-iterative model according to claim 1, characterized in that, Starting from the nodes of the error factors in the logic graph, reverse tracing and forward prediction are performed to form a logic pollution chain. The root cause error factors are located in the logic pollution chain and prioritized according to their impact range. Correction strategies are matched to the root cause error factors to generate executable correction schemes. The results of the correction schemes are verified in virtual space and fed back to the error factor analysis to prune and update the logic pollution chain.

6. The method for rewriting code of a domestic IT innovation platform based on a self-iterative model according to any one of claims 1 to 5, characterized in that, Asynchronous execution based on asynchronous clock control of code splitting, code rewriting, and virtual execution; Based on an asynchronous clock, when the first sub-code segment is obtained through code splitting, the rewriting of that sub-code segment is triggered asynchronously; When a single logical link of the rewritten sub-code segment is parsed out, the virtual execution of that sub-code segment is triggered asynchronously; The feedback from the virtual operation results drives the verification and iterative optimization of the code splitting and rewriting process.

7. The method for rewriting code of a domestic IT innovation platform based on a self-iterative model according to claim 6, characterized in that, The asynchronous execution control is performed through a layered asynchronous state signal mechanism, specifically including: Predefine and publish status signals to indicate the completion of task phases; Configure each functional unit to listen for specific status signals to trigger its execution; When a process anomaly is detected, an anomaly alarm signal is issued to trigger the backtracking mechanism and adjust the system task processing priority.

8. The method for rewriting code of a domestic IT innovation platform based on a self-iterative model according to claim 7, characterized in that, It also includes a syntax standardization preprocessing step, specifically including: For the programming language type of the target code, the corresponding syntax rule library is loaded. Through the syntax rule library, the target code is subjected to syntax ambiguity resolution and structural standardization to generate structured fused text. Lexical analysis is performed on the structured fused text to break it down into atomic lexical units. Based on grammatical rules, the atomic lexical units are combined into grammatical units, and the hierarchy and position information of the grammatical units are recorded.

9. The method for rewriting code of a domestic IT innovation platform based on a self-iterative model according to claim 8, characterized in that, The neural symbol self-iterative model includes: The encoding layer employs a dual-branch attention mechanism, combining syntactic and semantic attention, to encode the input code. The symbolic logic reasoning layer infers the encoded results based on a built-in logic rule base and generates logical feature vectors. The multi-task output layer, based on fused encoding and logical features, performs at least one of the following tasks: logical contradiction identification, functional intent classification, cross-language understanding, and error localization.