AI software generation method and system
By using AI software generation methods and systems, the problems of requirement ambiguity and architectural omissions in generative AI software development have been solved. A verifiable, auditable, and reproducible generation loop from requirements to code/text/images has been achieved, improving the consistency and compliance of the generated products and shortening the delivery cycle.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing generative AI suffers from problems such as ambiguous requirements, architectural omissions, inconsistent specifications, and uncontrollable security risks in software development. It lacks formal constraints on the semantics of requirements, verifiable control over the generation process, and accurate retrieval of cross-domain knowledge, making it difficult for the generated products to meet engineering deliverable standards.
By employing methods such as requirement analysis and standardization, architecture diagram governance and topology, retrieval enhancement and context governance, product type routing and generation, dual-channel verification and trusted release gates, and closed-loop learning, an end-to-end generation closed loop is formed from requirements to code/text/images that is verifiable, auditable, and reproducible.
Significantly improves the consistency, reliability, and compliance of the generated products, reduces rework and quality assurance investment, shortens delivery cycles, and enhances the effectiveness of human-in-the-loop review.
Smart Images

Figure CN121858079A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software development, and more specifically, to an AI software generation method and system. Background Technology
[0002] As enterprises become increasingly digitalized and software complexity continues to rise, traditional software engineering has long faced structural challenges such as incomplete requirements, frequent changes, insufficient talent supply, and high quality assurance costs.
[0003] Generative AI, which has emerged in recent years, can significantly improve efficiency at the programming level. However, coarse-grained generation directly from requirements to code often encounters bottlenecks such as requirement ambiguity, architectural omissions, inconsistent specifications, and uncontrollable security risks. The lack of formal constraints on requirement semantics, verifiable control over the generation process, and accurate retrieval of cross-domain knowledge makes it difficult for the generated products to meet engineering deliverable standards. Summary of the Invention
[0004] This invention provides an AI software generation method and system, solving the technical problems in related technologies.
[0005] This invention provides an AI software generation method, comprising the following steps: S100, Requirements Analysis and Standardization: Summarize business objectives, compliance requirements and existing assets, unify fields and style tags, form specifications and acceptance items, and output a list of issues for subsequent tracking; S200, Architecture Graph Governance and Topology: Based on the initial task graph, cycle detection and elimination are performed to produce a cycle-free task graph and topology order; on this basis, edge weights are re-marked to form a planning order and cost reference for scheduling; S300, Retrieval Enhancement and Context Governance: Construct a list of candidate knowledge sources, comprehensively evaluate them based on similarity, constraint matching, source credibility, timeliness, and conflict level, and generate ranking results; S400, Product Type Routing and Generation / Reconstruction: Based on specifications, task graph and context, determine product routing and generation strategies, and set evaluation metrics and rollback schemes for each modality; Product routing includes code, text, and images; S500, Dual-channel verification and trusted release gate: Simultaneously evaluates the quality gate and the source gate to avoid false releases with high coverage but low trust. Quality gates include evaluation objects such as code, text, and images; S600, closed-loop learning and weight / score update: incremental updates of graph weights and retrieval scores based on defect and compliance feedback, maintenance of black / white lists and evidence chains, and calibration of parameters to reduce oscillations and overfitting; S700, Deliverables and Audit Release: Output testing and coverage, text quality and fact-checking, image quality and compliance, static analysis and complexity, SBOM reports; archive specifications, task diagrams, context, artifacts and decision logs, and finally release after reviewing key discrepancies and risks in the loop.
[0006] Furthermore, the steps for requirements analysis and standardization are as follows: S110, Input Collection and Standardization: Establish collection lists and templates, archive requirements, compliance strategies and assets, perform deduplication and field standardization, naming conventions and tagging style / image restrictions, and form a standardized input set for subsequent parsing; S120, Specification Consistency and Executability Check: Detects conflicts between objectives and constraints, identifies interface contract gaps, and verifies non-executable acceptance items. Translates text style and image constraints into executable assertions, and generates and writes back correction sets and issue forms.
[0007] Furthermore, the steps for architecture graph governance and topologyability are as follows: S210, Cycle Detection and Minimum Feedback Edge Set Removal (MFES): Perform cycle detection on the task graph, solve for the minimum feedback edge set based on the cost, generate an acyclic graph and topological order, and record the risks and audit descriptions of the removed edges. formula: ; ; in, The cost of removing edges (considering risk, coupling, SLA, and benefits). This is a minimum set of feedback edges used to eliminate cycles. This is the graph of the cycle-free tasks after removing the cycles. This is the set of edges that remain after removal. Topological order, used to plan the execution sequence. A set of task nodes; For task edge set, This is a topological sorting operator that outputs a topological order for acyclic graphs. Let e be the edge; S220, Weight Recalibration and Planning Cost Calculation: The edge weights are recalibrated by considering comprehensive risks, coupling, SLA penalties, and business benefits, producing calibration weights and calculating the total planning cost, which is used for scheduling, ranking, and identifying high-cost paths.
[0008] Furthermore, the steps for retrieval enhancement and context governance are as follows: S310, Candidate Set Scoring and Conflict Penalty: Calculate the embedding similarity and constraint matching degree of candidate documents, evaluate source risk, credibility and timeliness, measure the degree of conflict with the specification, generate a comprehensive scoring list with conflict penalty and sort it. S320, Context Selection: Under the constraint of upper limit of context, greedily select documents based on the benefit per unit length, iterate until the threshold is reached and output the set of documents selected into the context and the reason for removal. If necessary, perform a summary to improve the benefit / length ratio. S330, Source Verification Gate and License Inspection: For selected... Perform source signature / hash verification and license compliance checks, verify credibility and risk thresholds, remove non-compliant sources and record gating logs to ensure contextual credibility and compliance.
[0009] Furthermore, in the candidate set scoring and conflict penalty, the scoring function is as follows: in, For embedding; They are similar to cosines; To constrain the matching degree; For document Source risk; For document The credibility of the source; For document The timeliness score; For document With specifications The degree of conflict; This is the scoring coefficient. For document For specifications The comprehensive scoring function includes similarity, matching degree, source risk / credibility / timeliness, and conflict penalty.
[0010] Furthermore, in context selection, the selection set is as follows: ; in, For document For specifications The comprehensive scoring function, For the collection of documents selected into the context, This is the upper limit of the context length. For document The length or number of tokens, For the complete set of candidate documents, For the d-th document; The greedy rule is as follows: ; in, Documents selected based on the greedy algorithm criteria.
[0011] Furthermore, the steps for product type routing and generation / reconstruction are as follows: S410, Modal Routing and Utility Evaluation: Evaluate the matching degree, risk and compliance of each modality based on the specifications, acyclic task graph and context, select the optimal modality and formulate the generation strategy, and clarify the evaluation indicators and fallback plan; The generation strategy includes model, prompt structure, temperature, and post-processing; S420, code generation and structured refactoring: Based on the layering and dependencies of the acyclic task graph, code synthesis and refactoring are performed, interface contracts, comments and test stubs are completed, static scanning and unit testing are performed, and iterative optimization and context conflict resolution are achieved based on the loss term. S430, Text Generation and Style / Fact Verification: Generate technical documents / white papers / disclosure texts, standardize terminology and style, perform readability and factual consistency verification, fix inconsistencies and ensure consistency with specifications and context; S440, Image Generation and Content Compliance: Generate image assets for architecture diagrams / flowcharts / UI prototypes, conduct quality and composition assessments and content compliance checks, resample or replace problematic images and retain audit records; The tests include NSFW, watermark, and material license.
[0012] Furthermore, the steps for dual-channel verification and trusted release gate are as follows: S510, Multimodal Attitude Measurement and Gating: Assembles three types of metrics and performs their respective gating threshold detection, outputs the reasons for failures and improvement suggestions, and avoids false releases of high coverage under low confidence conditions; Code metrics: ; Text metrics: ; Image metrics: ; CodeGate: ; Text gate: ; Image gate: ; in, This indicates that compilation has succeeded; For test coverage; Defect density; Score the complexity. To count or score safety risks; For license compliance instructions; For text readability; For text consistency; For consistency of facts; Rate the image quality; For image compliance indication; Risk rating for inappropriate content; For each gate threshold, This is the metric vector for the corresponding mode; It is a gated Boolean function; S520, Source Verification Gate and Integrated Release: Evaluate the source gate and merge it with each modal quality gate into an integrated release decision. If it fails, generate a backtrack route to step 300 / step 400, reduce the weight of the source of the problem, and record the release decision and evidence chain.
[0013] Furthermore, the source verification gate and the integrated gate in the integrated release process are as follows: Source: in, To determine the source, This is the final collection of documents selected based on context. For document Source credibility score; This is the threshold for source credibility. For document The license compliance indicator is 1 for compliance and 0 for non-compliance. For document Source risk score; As the upper limit threshold for source risk, This is an indicator function that outputs 1 if the condition is true, and 0 otherwise. Comprehensive door: ; in, For comprehensive release criteria, both the multimodal quality gate and the source gate must be satisfied. For code modal mass gate Boolean functions; For text modal quality gate Boolean function; This is a Boolean function for image modal quality gates; For the logical AND operator, when all gates pass... =1, otherwise 0.
[0014] The present invention also proposes an AI software generation system for performing the steps of the aforementioned AI software generation method, including: Standardization module: Unifies and standardizes requirements, compliance strategies and knowledge assets, completes deduplication and field specification; performs semantic parsing and ambiguity resolution on requirements to generate specifications, maps strategies to executable acceptance criteria; conducts consistency and executability checks, and outputs a correction set, an acceptance criterion correction set and a problem list. Graph Governance and Topology Module: Performs cycle detection on the initial task graph and removes the minimum feedback edge set to produce an acyclic task graph and topology order; recalibrates edge weights by considering risks, coupling, service levels, and business benefits; calculates planning costs for scheduling and prioritization; and forms an executable plan sequence. The retrieval and context governance module comprehensively scores candidate documents based on similarity, constraint matching, source risk / credibility / timeliness, and conflict level; it greedily selects the context set based on unit length benefit under the context length constraint, and summarizes excessively long documents; it implements source and license gating to eliminate non-compliant or high-risk sources. Product routing and generation module: Select the optimal product modality based on specifications, acyclic task graph and context, and formulate generation strategies and rollback plans; On the code side, strengthen the consistency of interface contracts and comments and supplement test stubs; On the text side, unify terminology and style and perform readability and fact verification; On the image side, generate architecture / process / UI assets and perform quality and content compliance checks. Quality and Source Release Module: Assembles multimodal quality metrics for code, text, and images and evaluates their respective gating; performs source trust and license gating on the context set; merges the quality gate and source gate into a comprehensive release gate, allowing delivery if the quality meets the criteria, and reverting to the generation or retrieval stage for repair if the quality does not meet the criteria, and downgrading the source of the problem. Closed-loop learning and parameter calibration module: Updates graph edge weights incrementally based on quality signals and defect location to suppress high-risk paths; performs scoring up / down weighting on retrieval sources and maintains black / white lists and evidence chains; calibrates retrieval scoring coefficients and modal routing parameters based on logs and metrics to reduce oscillations and overfitting, and continuously improves the robustness of planning and retrieval. Deliverables and Auditable Module: Build delivery packages / images, technical documentation and image assets; generate test, coverage, text quality and fact-checking, image compliance, static analysis and complexity, and SBOM reports; archive code / text / images and metrics and decision logs to form a chain of evidence; perform final release after reviewing key discrepancies and risks in the loop, and optimize the delivery cycle under the premise of compliance and quality.
[0015] The beneficial effects of this invention are as follows: This invention organically integrates requirement semantic normalization, graph governance and topology, retrieval and context gating, multimodal product routing and quality, source dual gating, and closed-loop learning to form an end-to-end generation closed loop that is verifiable, auditable, and reproducible from requirements to code / text / images. On the one hand, normalization and consistency checks resolve requirement ambiguities and translate strategies into executable acceptance criteria, avoiding specification inconsistencies. On the other hand, acyclic topology and weight recalibration of the task graph eliminate architectural omissions and implicit couplings, clarifying executable plan sequences. At the same time, trusted sources and license gating enhance the relevance and compliance of retrieval context, and multimodal quality gating ensures consistency in compilation / testing / security / style / facts. Ultimately, evidence chain archiving and adaptive parameter calibration continuously reduce generation oscillations and overfitting, significantly improving the consistency, reliability, and compliance of generated products, reducing rework and quality assurance investment, shortening delivery cycles, and enhancing the effectiveness of human-in-the-loop review. Attached Figure Description
[0016] Figure 1 This is a flowchart of an AI software generation method according to the present invention; Figure 2 This is a structural block diagram of an AI software generation system according to the present invention; Figure 3 This is a task topology diagram in an example of the present invention; Figure 4 This is a schematic diagram of the context selection structure in an example of the present invention; Figure 5 This is a schematic diagram of modal routing in an example of the present invention; Figure 6 This is a schematic diagram of the passage gate in an example of the present invention. Detailed Implementation
[0017] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, features described in some examples may be combined in other examples.
[0018] like Figure 1 As shown, an AI software generation method includes the following steps: S100, Requirements Analysis and Standardization (Constraint Straightening): Summarize business objectives, compliance requirements and existing assets, unify fields and style tags, form specifications and acceptance items, and output a list of issues for subsequent tracking; In one embodiment of the present invention, the following steps are specifically included: S110, Input Collection and Standardization: Establish collection lists and templates, and archive requirements. Compliance strategy With assets The process involves deduplication and field standardization, naming conventions and tagging style / image constraints to form a standardized input set for subsequent parsing. formula: ; in, For natural language / structured language requirements; For organizational standards and compliance strategies (including style / content policies); Specifications (goals, constraints, interface contracts, style / content limitations); Acceptance criteria (can execute assertion / property tests); For semantic parsing and ambiguity resolution; Mapping for acceptance clauses, This is a set of acceptance criteria.
[0019] S120, Specification Consistency and Executability Check: Performs conflict detection on objectives and constraints, identifies interface contract gaps, and verifies non-executable acceptance items. Translates text style and image constraints into executable assertions, generates and writes back the correction set. With the question form; in, This is a specification revision set, recording the specification items that need to be adjusted; This is a set of revised acceptance criteria, recording the acceptance assertions that need to be adjusted; the issue sheet includes a description of the conflict, the location of the gap, the reason for non-compliance, and recommended measures.
[0020] Output: Consistent and executable With a list of issues.
[0021] S200, Graph Governance and Topology (Overcoming Graph Barriers): Based on the initial task graph, cycle detection and removal are performed to produce a cycle-free task graph and topology order; on this basis, edge weights are re-marked to form a planning order and cost reference for scheduling. In one embodiment of the present invention, the following steps are specifically included: S210, Cycle Detection and Minimum Feedback Edge Set Removal (MFES): Perform cycle detection on the task graph based on cost. Solve and remove the minimum feedback edge set Generate an acyclic graph With topological order And record the risks and audit explanations for removing edges; formula: ; formula: ; in, The cost of removing edges (considering risk, coupling, SLA, and benefits). This is a minimum set of feedback edges used to eliminate cycles. This is the graph of the cycle-free tasks after removing the cycles. This is the set of edges that remain after removal. Topological order, used to plan the execution sequence. A set of task nodes; For task edge set, This is a topological sorting operator (outputs a topological order for acyclic graphs). Let e be the e-th edge.
[0022] S220, Weight Recalibration and Planning Cost Calculation: Recalibrating edge weights by considering comprehensive risks, coupling, SLA penalties, and business benefits, producing calibrated weights. And calculate the total planning cost. It is used for scheduling, sorting, and identifying high-cost paths; Weight calibration: Planning costs: ; in, These are the weighting coefficients; For the edge Risk score for the corresponding task; Coupling degree; For the edge Service level penalties; For business revenue, The initial edge weights; For the recalibrated edge weights, This represents the total planning cost accumulated in topological order.
[0023] S300, Search Enhancement and Context Governance (Overcoming Search Barriers): Construct a list of candidate knowledge sources, comprehensively evaluate them based on similarity, constraint matching, source credibility, timeliness, and conflict level, and generate ranking results; In one embodiment of the present invention, the following steps are specifically included: S310, Candidate Set Scoring and Conflict Penalty: Calculate the embedding similarity and constraint matching degree of candidate documents, evaluate source risk, credibility and timeliness, measure the degree of conflict with the specification, generate a comprehensive scoring list with conflict penalty and sort it. Scoring function: in, For embedding; They are similar to cosines; To constrain the matching degree; For document Source risk; For document The credibility of the source; For document The timeliness score; For document With specifications The degree of conflict; This is the scoring coefficient. For document For specifications The comprehensive scoring function includes similarity, matching degree, source risk / credibility / timeliness and conflict penalty.
[0024] S320, Context Selection (Length-Constrained Approximate Knapsack): Within the context upper limit... Under constraints, a greedy algorithm selects documents based on the unit length reward, iterates until a threshold is reached, and then outputs the result. Based on the reasons for removal, a summary should be provided if necessary to improve the benefit / length ratio; Select set: ; in, For document For specifications The comprehensive scoring function, For the collection of documents selected into the context, This is the upper limit of the context length. For document The length or number of tokens, For the complete set of candidate documents, For the d-th document; Greed Principle: ; in, Documents selected based on the greedy algorithm criteria.
[0025] S330, Source Verification Gate and License Inspection: For selected... Perform source signature / hash verification and license compliance checks, verify credibility and risk thresholds, remove non-compliant sources and record gating logs to ensure contextual credibility and compliance; Source verification gate: in, This is the credibility threshold; This represents the upper limit of risk. For license compliance instructions (1 for compliance), at the same time, The source is determined by the Menbull decision (1 indicates pass).
[0026] S400, Product Type Routing and Generation / Refactoring (Multimodal): Based on specifications, task graphs and context, determine product routing (code, text and images) and generation strategies, and set evaluation metrics and rollback plans for each modality; In one embodiment of the present invention, the following steps are specifically included: S410, Modal Routing and Utility Evaluation: According to Specifications Acyclic Quest Map With context Assess the fit, risk, and compliance of each modality, and select the optimal modality. And formulate generation strategies (model, prompt structure, temperature and post-processing), and clarify evaluation indicators and rollback plans; Modal routing: ; Routing utility: ; in, Modal matching degree; Modal risk; Modal compliance adaptation; For the corresponding routing coefficients, in addition, For routing utility functions; To determine the optimal mode selection result, take the following... The largest mode, For candidate modes, the set of values is: That is, {code, text, image}.
[0027] S420, Code Generation and Structured Refactoring: Based on The layering and dependencies are used for code synthesis and refactoring, interface contracts, comments and test stubs are completed, static scanning and unit testing are performed, and iterative optimization and context conflict resolution are achieved based on loss terms. Objective function: ; in, To generate mass loss; For static specification / complexity loss; Losses due to test failures and insufficient coverage; For security alerts / risk losses; This results in a loss of architectural consistency. Loss due to conflict with the context; To lose weight, It is a code product; This is a graph for acyclic tasks; For the governed context set. To generate quality loss, measure code against specifications. and context Semantic consistency and integrity; The penalty is calculated based on the static specification / complexity loss, combined with the number of coding specification violations and the penalty for exceeding the cyclomatic complexity limit; The loss due to test failures and insufficient coverage is calculated by weighting the number of failed test cases and the coverage gap. For security alerts / risk losses, the number of high-risk vulnerabilities reported by the SAST tool is weighted by risk level; To measure the architectural consistency loss, we measure code dependencies and acyclic task graphs. The deviation of the topology and hierarchical constraints of ′; To avoid context-sensitive loss, the detection code implementation and Direct contradictions in the Chinese documentation or API descriptions; S430, Text Generation and Style / Fact Verification: Generate technical documents / white papers / disclosure texts, standardize terminology and style, perform readability and factual consistency verification, fix inconsistencies, and ensure compliance with specifications. and context Consistent; Objective function: ; in, Generate loss for the text; For readability loss; Loss due to inconsistency of facts; This results in a loss of style consistency. As weight, at the same time, It is a textual product. The optimal text output that minimizes the total loss.
[0028] S440, Image Generation and Content Compliance: Generate image assets such as architecture diagrams / flowcharts / UI prototypes, conduct quality and composition assessments and content compliance checks (NSFW, watermarks, material licenses), resample or replace problematic images and retain audit records; Objective function: ; in, Generate loss for the image; For image quality loss; For composition / layout loss; For the corresponding target weights, at the same time, As an image product, The optimal image product that minimizes the total loss.
[0029] S500, Dual-channel verification and trusted release gate (quality + source): Simultaneously evaluates the quality gate (code, text, image) and the source gate to avoid false releases with high coverage but low trust. In one embodiment of the present invention, the following steps are specifically included: S510, Multimodal Attitude Measurement and Gating: Assembles three types of metrics and performs their respective gating threshold detection, outputs the reasons for failures and improvement suggestions, and avoids false releases of high coverage under low confidence conditions; Code metrics: ; Text metrics: ; Image metrics: ; CodeGate: Text gate: ; Image gate: in, This indicates that compilation has succeeded; For test coverage; Defect density; Score the complexity. To count or score safety risks; For license compliance instructions; For text readability; For text consistency; For consistency of facts; Rate the image quality; For image compliance indication; Risk rating for inappropriate content; These are the threshold values for each gate. This is the metric vector for the corresponding mode; This is a gated Boolean function (outputs 1 if the threshold is met). This is an indicator function that outputs 1 if the condition is true, and 0 otherwise.
[0030] S520, Source Verification Gate and Integrated Release: Source Assessment Gate And merged with each modal mass gate into If it fails, a rollback route is generated to S300 / S400 and the source of the problem is downgraded, and the release decision and evidence chain are recorded; Source: in, This is the final collection of documents selected based on context. For document Source credibility score; The source credibility threshold is set by the organization's policy. For document The license compliance indicator is 1 for compliance and 0 for non-compliance. For document Source risk score; The upper limit threshold for source risk is set by organizational strategy; For code modal mass gate Boolean functions; For text modal quality gate Boolean function; This is a Boolean function for image modal quality gates; For the logical AND operator, when all gates pass... =1, otherwise 0; Comprehensive door: ; Output: If it passes, it proceeds to delivery; if it fails, it returns to S400 or S300 for repair and demotion.
[0031] in, The source is determined by the Menbull decision (1 indicates pass). For comprehensive release criteria (both multimodal quality gate and source gate are satisfied).
[0032] S600, closed-loop learning and weight / score update (vibration prevention and calibration): incremental updates of graph weights and retrieval scores based on defect and compliance feedback, maintenance of black / white lists and evidence chains, and calibration of parameters to reduce oscillations and overfitting; In one embodiment of the present invention, the following steps are specifically included: S610, Graph Weight Update: Based on defect location and quality signals, incrementally update the graph edge weights, increase the weight of risky paths or add labels, update scheduling priorities and confirm that the acyclic attribute is maintained. formula: ; in, The learning rate; The weighting adjustment rules are derived from the metrics and the question sheet.
[0033] S620, Search scoring update and black / white list: Downgrade problematic sources to the blacklist, upgrade high-quality sources to the whitelist, revise scoring function parameters and save source evidence and audit records to support subsequent decisions; formula: ; in, The learning rate; This is to correct the scores generated from defect and compliance feedback. Meanwhile, This is a single set of defects and compliance issues; The score for the current round's source, This is the updated source score.
[0034] S630, Parameter Adaptive Calibration: Performs parameter calibration based on logs and metrics (robust optimization / Bayes update / grid search), selects parameter sets to reduce oscillations and overfitting, and feeds them back into the retrieval and routing strategies; formula: ; in, Parameter calibration operators (based on robust optimization based on logs and metrics / Bayesian update / grid search and other strategies); A structured record of historical metrics, gating results, defects, and compliance feedback; For retrieval scoring coefficients; These are the modal routing coefficients.
[0035] S700, Deliverables and Audit Release (Reproducibility and Chain of Evidence): Output test and coverage, text quality and fact-checking, image quality and compliance, static analysis and complexity, SBOM report; archive specifications, task diagrams, context, artifacts and decision logs, and finally release after reviewing key differences and risks in the loop; In one embodiment of the present invention, the following steps are specifically included: S710, Build and Deliverables Generation: Generate packages / images, text documents, image assets, test and coverage reports, text quality and fact-checking reports, image quality and security compliance reports, static analysis and complexity metrics, SBOM; S720, Evidence Chain Archiving and Release of Persons in the Loop: Archiving With decision logs; people review key discrepancies and risks, and execute final release; S730, Delivery Target Formula: in, Delivery cycle; For multimodal compliance determination.
[0036] like Figure 2 As shown, based on the above generation method, an AI software generation system is proposed, including the following modules: Standardization module: Unifies and standardizes requirements, compliance strategies and knowledge assets, completes deduplication and field specification; performs semantic parsing and ambiguity resolution on requirements to generate specifications, maps strategies to executable acceptance criteria; conducts consistency and executability checks, and outputs a correction set, an acceptance criterion correction set and an issue list.
[0037] Graph Governance and Topology Module: Performs cycle detection on the initial task graph and removes the minimum feedback edge set to produce an acyclic task graph and topology order; recalibrates edge weights based on risk, coupling, service level, and business benefits, calculates planning costs for scheduling and prioritization, and forms an executable plan sequence.
[0038] The retrieval and context governance module comprehensively scores candidate documents based on similarity, constraint matching, source risk / credibility / timeliness, and conflict level; it greedily selects the context set based on unit length benefit under the context length constraint, and summarizes excessively long documents; it implements source and license gating to eliminate non-compliant or high-risk sources.
[0039] Product routing and generation module: Select the optimal product modality (code / text / image) based on specifications, acyclic task graph and context, and formulate generation strategies and rollback plans; on the code side, strengthen the consistency of interface contracts and comments and supplement test stubs; on the text side, unify terminology and style and perform readability and factual verification; on the image side, generate architecture / process / UI assets and perform quality and content compliance checks.
[0040] Quality and Source Release Module: Assembles multimodal quality metrics for code, text, and images and evaluates their respective gating; performs source trust and license gating on the context set; merges the quality gate and source gate into a comprehensive release gate, allowing delivery if the quality meets the criteria, and reverting to the generation or retrieval stage for repair if the quality does not meet the criteria, and downgrading the source of the problem.
[0041] Closed-loop learning and parameter calibration module: Updates graph edge weights incrementally based on quality signals and defect location to suppress high-risk paths; performs scoring up / down weighting on retrieval sources and maintains black / white lists and evidence chains; calibrates retrieval scoring coefficients and modal routing parameters based on logs and metrics to reduce oscillations and overfitting, and continuously improves the robustness of planning and retrieval.
[0042] Deliverability and Auditability Module: Build delivery packages / images, technical documentation, and image assets; generate reports on testing, coverage, text quality and fact-checking, image compliance, static analysis and complexity, SBOM, etc.; archive code / text / images and metrics and decision logs to form a chain of evidence; perform final release after reviewing key differences and risks in the loop, and optimize the delivery cycle under the premise of compliance and quality.
[0043] Upgrading enterprise intelligent customer service through AI software generation methods and systems, the following process implementation case is provided: Requirements Analysis and Standardization: Summarize the business objectives, compliance requirements, and existing FAQ / API lists for customer service scenarios, unify fields and style tags, form specifications and acceptance items, and output a list of issues for subsequent tracking.
[0044] Specifically, input collection and standardization: Establish collection lists and templates, archive customer service requirements, organizational strategies, and knowledge assets; perform deduplication, field standardization, and style / image constraint tagging to form a standardized input set. Specification consistency and executability checks: Check the consistency of objectives, constraints, and interface contracts, identify unexecutable acceptance items; translate text style and image constraints into executable assertions, generate and write back correction sets and issue tickets.
[0045] like Figure 3 As shown, the architecture graph governance and topology are as follows: Based on the initial task graph, cycle detection and elimination are performed to produce a cycle-free task graph and topology order; on this basis, the edge weights are re-marked to form a planning order and cost reference for scheduling.
[0046] Specifically, loop detection and minimum feedback edge removal: Locate loops in the task flow (such as "FAQ extraction - index construction - FAQ extraction"), remove or reconstruct high-cost feedback edges to obtain a stable acyclic task graph and execution order, and record audit notes. Weight recalibration and planning cost calculation: Perform weight calibration by comprehensively considering risks, coupling, SLA penalties, and business benefits to form scheduling priorities; prioritize the governance of high-risk / high-coupling paths to ensure the overall planning is robust.
[0047] like Figure 4 As shown, retrieval enhancement and context governance involve constructing a list of candidate knowledge sources (internal wiki, old FAQ documents, vendor interface descriptions, compliance policies, etc.), and comprehensively evaluating them based on similarity, constraint matching, source credibility, timeliness, and conflict level to generate ranking results.
[0048] Specifically, the candidate set scoring and conflict penalty process involves: evaluating semantic and constraint matching for each source, identifying conflicts and inconsistencies with specifications, and generating a candidate ranking list with conflict penalties. Context selection (length-constrained approximate knapsack): Greedy selection based on unit length gain within a context window constraint, summarizing long documents when necessary, ultimately forming a context set and recording the reasons for removal. Source verification gate and license check: Trusted signature / hash verification and license compliance checks are performed on the sources selected for the context, removing high-risk or non-compliant sources while retaining gate logs and evidence chains.
[0049] Product type routing and generation / refactoring: Based on specifications, task graphs and context, determine product routing (code / text / image) and generation strategies, and set evaluation metrics and rollback plans for each modality.
[0050] Specifically, such as Figure 5 As shown, modal routing and utility evaluation: evaluate the matching, risk and compliance adaptation of the three modalities of code / text / image, select the optimal route and clarify the required model, prompt structure, post-processing and fallback path.
[0051] Code generation and structured refactoring: Generate components such as "Knowledge Retrieval API," "FAQ Synchronizer," and "Retrieval Indexer" according to layers and dependencies; complete interface contracts, comments, and test stubs; perform static scanning and unit testing, and iteratively eliminate context conflicts. Text generation and style / fact verification: Generate technical design specifications, interface specifications, and disclosure texts, unifying terminology and style; perform readability and factual consistency verification, fix inconsistencies, and ensure consistency with specifications and context.
[0052] like Figure 6 As shown, dual-channel verification and trusted release gate: simultaneously evaluate the quality gate (code, text, image) and the source gate to avoid false releases due to "high coverage and low trust".
[0053] Specifically, multi-modal attitude measurement and gating: code-side checks compilation and test coverage, text-side checks readability and consistency, and image-side checks quality and compliance; outputs non-compliant items and improvement suggestions. Source verification gate and comprehensive release: comprehensive release is achieved when the source gate passes and all modal quality gates are satisfied; if it fails, it reverts to the retrieval or generation stage to fix and downgrades the problematic source.
[0054] Closed-loop learning and weight / score update: Incremental updates to graph weights and retrieval scores based on defect and compliance feedback, maintenance of black / white lists and evidence chains, and parameter calibration to reduce oscillations and overfitting.
[0055] Specifically, graph weight updates: Graph weights and scheduling priorities are optimized based on quality signals and identified risk nodes to ensure more robust subsequent execution paths. Search scoring updates and black / white lists: Problematic sources are downgraded and added to the blacklist, while high-quality sources are upgraded and added to the whitelist, with scoring strategies revised and evidence recorded. Parameter adaptive calibration: Key coefficients for retrieval and routing are adjusted based on historical logs and metrics to ensure continuous process convergence and robustness.
[0056] Delivery and Audit: Generate container images and documentation packages, and output reports such as test and coverage, text quality and fact-checking, image quality and compliance, static analysis and complexity, and SBOM; archive specifications, task graphs, contexts, artifacts and decision logs, and finally release the container after reviewing key differences and risks in the loop.
[0057] After applying this generation method in this example, the upgraded intelligent customer service knowledge base achieved stable convergence across the entire chain from requirements to code / text / images: the task graph was governed into an acyclic, topologically sustainable structure, with clear scheduling priorities and explicit suppression of risky paths; the retrieval context was guaranteed by trusted sources and license gating, and candidate knowledge was selected in an orderly manner under a multi-dimensional trade-off of similarity, constraint matching, and conflict, significantly reducing inconsistencies and "illusions"; multimodal products were generated through a unified routing strategy, with complete interface contracts and test stubs on the code side, and compilation, coverage, and security gates satisfied; and text-side technical... The language and style are consistent with the facts; the image composition meets compliance standards; and the overall quality gate and source gate reach a consistent conclusion in the comprehensive release process. The delivery end has reproducible construction and complete evidence chain archiving. Human review focuses more on key differences and risks, and the rollback and repair paths are clear. Closed-loop learning further calibrates weights and scores and reduces oscillations and overfitting, thereby bringing higher retrieval accuracy and generation consistency, lower compliance and security risks, shorter delivery cycle and stronger auditability and maintainability. Ultimately, the responsiveness and iteration efficiency of the customer service knowledge base are improved simultaneously.
[0058] The embodiments of the present invention have been described above, but 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, all of which are within the protection scope of the present invention.
Claims
1. A method for generating AI software, characterized in that, Includes the following steps: S100, Requirements Analysis and Standardization: Summarize business objectives, compliance requirements and existing assets, unify fields and style tags, form specifications and acceptance items, and output a list of issues for subsequent tracking; S200, Architecture Graph Governance and Topology: Based on the initial task graph, cycle detection and elimination are performed to produce a cycle-free task graph and topology order; on this basis, edge weights are re-marked to form a planning order and cost reference for scheduling; S300, Retrieval Enhancement and Context Governance: Construct a list of candidate knowledge sources, comprehensively evaluate them based on similarity, constraint matching, source credibility, timeliness, and conflict level, and generate ranking results; S400, Product Type Routing and Generation / Reconstruction: Based on specifications, task graph and context, determine product routing and generation strategies, and set evaluation metrics and rollback schemes for each modality; Product routing includes code, text, and images; S500, Dual-channel verification and trusted release gate: Simultaneously evaluates the quality gate and the source gate to avoid false releases with high coverage but low trust. Quality gates include evaluation objects such as code, text, and images; S600, closed-loop learning and weight / score update: incremental updates of graph weights and retrieval scores based on defect and compliance feedback, maintenance of black / white lists and evidence chains, and calibration of parameters to reduce oscillations and overfitting; S700, Deliverables and Audit Release: Output testing and coverage, text quality and fact-checking, image quality and compliance, static analysis and complexity, SBOM reports; archive specifications, task diagrams, context, artifacts and decision logs, and finally release after reviewing key discrepancies and risks in the loop.
2. The AI software generation method according to claim 1, characterized in that, The steps for requirements analysis and standardization are as follows: S110, Input Collection and Standardization: Establish collection lists and templates, archive requirements, compliance strategies and assets, perform deduplication and field standardization, naming conventions and tagging style / image restrictions, and form a standardized input set for subsequent parsing; S120, Specification Consistency and Executability Check: Detects conflicts between objectives and constraints, identifies interface contract gaps, and verifies non-executable acceptance items. Translates text style and image constraints into executable assertions, and generates and writes back correction sets and issue forms.
3. The AI software generation method according to claim 1, characterized in that, The steps for architecture graph governance and topologyability are as follows: S210, Cycle Detection and Minimum Feedback Edge Set Removal: Perform cycle detection on the task graph, solve for the minimum feedback edge set based on the cost, generate an acyclic graph and topological order, and record the risks and audit explanations of the removed edges; formula: ; ; in, The cost of removing edges, This is a minimum set of feedback edges used to eliminate cycles. This is the graph of the cycle-free tasks after removing the cycles. This is the set of edges that remain after removal. Topological order, used to plan the execution sequence. A set of task nodes; For task edge set, This is a topological sorting operator that outputs a topological order for acyclic graphs. Let e be the edge; S220, Weight Recalibration and Planning Cost Calculation: The edge weights are recalibrated by considering comprehensive risks, coupling, SLA penalties, and business benefits, producing calibration weights and calculating the total planning cost, which is used for scheduling, ranking, and identifying high-cost paths.
4. The AI software generation method according to claim 1, characterized in that, The steps of search enhancement and context governance are as follows: S310, Candidate Set Scoring and Conflict Penalty: Calculate the embedding similarity and constraint matching degree of candidate documents, evaluate source risk, credibility and timeliness, measure the degree of conflict with the specification, generate a comprehensive scoring list with conflict penalty and sort it. S320, Context Selection: Under the constraint of upper limit of context, greedily select documents based on the benefit per unit length, iterate until the threshold is reached and output the set of documents selected into the context and the reason for removal. If necessary, perform a summary to improve the benefit / length ratio. S330, Source Verification Gate and License Inspection: For selected... Perform source signature / hash verification and license compliance checks, verify credibility and risk thresholds, remove non-compliant sources and record gating logs to ensure contextual credibility and compliance.
5. The AI software generation method according to claim 4, characterized in that, In the candidate set scoring and conflict penalty, the scoring function is as follows: in, For embedding; They are similar to cosines; To constrain the matching degree; For document Source risk; For document The credibility of the source; For document The timeliness score; For document With specifications The degree of conflict; This is the scoring coefficient. For document For specifications The comprehensive scoring function includes similarity, matching degree, source risk / credibility / timeliness, and conflict penalty.
6. The AI software generation method according to claim 5, characterized in that, In context selection, the selection set is as follows: ; in, For document For specifications The comprehensive scoring function, For the collection of documents selected into the context, This is the upper limit of the context length. For document The length or number of tokens, For the complete set of candidate documents, For the d-th document; The greedy rule is as follows: ; in, Documents selected based on the greedy algorithm criteria.
7. The AI software generation method according to claim 1, characterized in that, The steps for product type routing and generation / reconstruction are as follows: S410, Modal Routing and Utility Evaluation: Evaluate the matching degree, risk and compliance of each modality based on the specifications, acyclic task graph and context, select the optimal modality and formulate the generation strategy, and clarify the evaluation indicators and fallback plan; The generation strategy includes model, prompt structure, temperature, and post-processing; S420, code generation and structured refactoring: Based on the layering and dependencies of the acyclic task graph, code synthesis and refactoring are performed, interface contracts, comments and test stubs are completed, static scanning and unit testing are performed, and iterative optimization and context conflict resolution are achieved based on the loss term. S430, Text Generation and Style / Fact Verification: Generate technical documents / white papers / disclosure texts, standardize terminology and style, perform readability and factual consistency verification, fix inconsistencies and ensure consistency with specifications and context; S440, Image Generation and Content Compliance: Generate image assets for architecture diagrams / flowcharts / UI prototypes, conduct quality and composition assessments and content compliance checks, resample or replace problematic images and retain audit records; The tests include NSFW, watermark, and material license.
8. The AI software generation method according to claim 1, characterized in that, The steps for dual-channel verification and trusted release gate are as follows: S510, Multimodal Attitude Measurement and Gating: Assembles three types of metrics and performs their respective gating threshold detection, outputs the reasons for failures and improvement suggestions, and avoids false releases of high coverage under low confidence conditions; Code metrics: ; Text metrics: ; Image metrics: ; CodeGate: ; Text gate: ; Image gate: in, This indicates that compilation has succeeded; For test coverage; Defect density; Score the complexity. To count or score safety risks; For license compliance instructions; For text readability; For text consistency; For consistency of facts; Rate the image quality; For image compliance indication; Risk rating for inappropriate content; For each gate threshold, This is the metric vector for the corresponding mode; It is a gated Boolean function; S520, Source Verification Gate and Integrated Release: Evaluate the source gate and merge it with each modal quality gate into an integrated release decision. If it fails, a backtrack route is generated to S300 / S400, and the source of the problem is downgraded. The release decision and evidence chain are recorded.
9. The AI software generation method according to claim 8, characterized in that, The source verification gate and the integrated gate in the integrated release are as follows: Source: in, To determine the source, This is the final collection of documents selected based on context. For document Source credibility score; This is the threshold for source credibility. For document The license compliance indicator is 1 for compliance and 0 for non-compliance. For document Source risk score; As the upper limit threshold for source risk, This is an indicator function that outputs 1 if the condition is true, and 0 otherwise. Comprehensive door: ; in, For comprehensive release criteria, both the multimodal quality gate and the source gate must be satisfied. For code modal mass gate Boolean functions; For text modal quality gate Boolean function; This is a Boolean function for image modal quality gates; For the logical AND operator, when all gates pass... =1, otherwise 0.
10. An AI software generation system, characterized in that, The steps for performing an AI software generation method as described in any one of claims 1-9 include: Standardization module: Unifies and standardizes requirements, compliance strategies and knowledge assets, completes deduplication and field specification; performs semantic parsing and ambiguity resolution on requirements to generate specifications, maps strategies to executable acceptance criteria; conducts consistency and executability checks, and outputs a correction set, an acceptance criterion correction set and a problem list. Graph Governance and Topology Module: Performs cycle detection on the initial task graph and removes the minimum feedback edge set to produce an acyclic task graph and topology order; recalibrates edge weights by considering risks, coupling, service levels, and business benefits; calculates planning costs for scheduling and prioritization; and forms an executable plan sequence. The retrieval and context governance module comprehensively scores candidate documents based on similarity, constraint matching, source risk / credibility / timeliness, and conflict level; it greedily selects the context set based on unit length benefit under the context length constraint, and summarizes excessively long documents; it implements source and license gating to eliminate non-compliant or high-risk sources. Product routing and generation module: Select the optimal product modality based on specifications, acyclic task graph and context, and formulate generation strategies and rollback plans; On the code side, strengthen the consistency of interface contracts and comments and supplement test stubs; On the text side, unify terminology and style and perform readability and fact verification; On the image side, generate architecture / process / UI assets and perform quality and content compliance checks. Quality and Source Release Module: Assembles multimodal quality metrics for code, text, and images and evaluates their respective gating; performs source trust and license gating on the context set; merges the quality gate and source gate into a comprehensive release gate, allowing delivery if the quality meets the criteria, and reverting to the generation or retrieval stage for repair if the quality does not meet the criteria, and downgrading the source of the problem. Closed-loop learning and parameter calibration module: Updates graph edge weights incrementally based on quality signals and defect location to suppress high-risk paths; performs scoring up / down weighting on retrieval sources and maintains black / white lists and evidence chains; calibrates retrieval scoring coefficients and modal routing parameters based on logs and metrics to reduce oscillations and overfitting, and continuously improves the robustness of planning and retrieval. Deliverables and Auditable Module: Build delivery packages / images, technical documentation and image assets; generate test, coverage, text quality and fact-checking, image compliance, static analysis and complexity, and SBOM reports; archive code / text / images and metrics and decision logs to form a chain of evidence; perform final release after reviewing key discrepancies and risks in the loop, and optimize the delivery cycle under the premise of compliance and quality.