Document automatic generation method based on hierarchical cue word and rule engine

By combining layered prompts with a rule engine, the efficiency bottleneck and standard compliance issues in software documentation have been resolved, enabling efficient and standardized document generation, ensuring content integrity and verifiability, and reducing manual coordination costs.

CN121764520APending Publication Date: 2026-03-31CHENGDU AIRCRAFT DESIGN INST OF AVIATION IND CORP OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing technologies suffer from bottlenecks in software documentation due to reliance on manual processes, lack of standard compliance and content completeness, and confusion between requirements and design boundaries. Traditional automated tools are also unable to fully verify the in-depth requirements of the GJB438B/C standard.

Method used

By adopting a hierarchical prompt word and rule engine approach, and through a multi-level guidance design of framework layer, chapter layer and item layer, combined with the semantic understanding capabilities of a large model, the document achieves structured generation, logical completeness and compliance verification, and generates documents that conform to the GJB438B/C standard.

Benefits of technology

It improved document preparation efficiency, reduced manual coordination costs, ensured document standard compliance and content integrity, reduced human error and disputes over requirement changes, and increased test pass rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121764520A_ABST
    Figure CN121764520A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic document generation method based on hierarchical cue words and a rule engine. The method comprises the following steps: step 1, layered cue word design: completing fine control from document types to specific entries based on multi-level guide design of a framework layer, a chapter layer and an entry layer; 2, designing an intelligent rule engine: designing a rule engine based on a GJB438B / C standard and a domain knowledge base, and realizing logic completeness and compliance verification of document contents to ensure that the contents meet deep requirements of the GJB standard; 3, dynamic generation and optimization driven by a large model: completing natural language demand input processing, multi-objective optimization and negotiation suggestion and change influence analysis based on the semantic understanding capability of the large model LLM; and step 4, output and collaborative management: completing the output of the standardized document, and generating a document conforming to the GJB438B / C standard. The method can be adapted to various military technology documents, uniform standard conformity verification is realized, the change influence report is automatically generated, and the manual coordination cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of document requirements management technology, and in particular to a method for automated document generation based on hierarchical prompt words and a rule engine. Background Technology

[0002] In the software development process, software documentation serves as the core basis for design, testing, and acceptance. Its compilation must strictly adhere to the specifications in the GJB438B / C standard and balance the multi-dimensional demands of users, developers, and testers. However, the current SRS compilation process suffers from the following key problems: 1. Dependence on manual labor and efficiency bottlenecks Traditional software documentation relies entirely on manual, line-by-line writing. Software developers must simultaneously handle hundreds of technical elements and ensure the document structure fully conforms to standards. For example, software requirements documents must manage functional requirements, non-functional requirements, and verification methods, making it prone to omissions of crucial sections due to misunderstandings of standards. Test plans define test case coverage, environment configuration, and acceptance criteria, but manual writing often leads to difficulties in test execution due to inconsistent formatting. User manuals include operating procedures and troubleshooting guidelines, but vague descriptions can cause user misunderstandings. This process is time-consuming and error-prone, especially when dealing with complex military systems where the sheer volume of documents makes manual efficiency a core bottleneck.

[0003] 2. Lack of standard compliance and content completeness Military software has strict requirements for the standardization of different document types. However, in traditional methods, software developers often overlook standard details, resulting in incomplete document structures (such as test plans lacking a "risk analysis" section), missing key elements (such as user manuals not defining recovery steps for abnormal operations), and vague descriptions (such as "the system should have high reliability" lacking quantitative indicators).

[0004] 3. Blurring of the boundary between requirements and design In manual drafting, technical implementation details (such as algorithm selection and interface design) are often mixed into the requirements document, blurring the line between "what to do" and "how to do it". This confusion causes the requirements document to lose its objectivity as a design basis and may lead to disputes when requirements change.

[0005] While some automation tools have attempted to alleviate these problems, such as DOORS and Reqtify, which generate document structures through pre-set templates, they only map chapter titles to static templates and lack dynamic support for content logic (such as requirement-design boundary verification) and the generation of quantitative indicators. This superficial mapping automation essentially only shifts manual labor from "formatting" to "template debugging," failing to truly address the core pain points of document creation and making it difficult to comprehensively verify whether the content meets the deeper requirements of the GJB438B / C standard.

[0006] The era of large-scale models offers new possibilities for solving this challenge. Intelligent inspection systems based on large-scale language models (LLM) can perform multi-dimensional analysis of technical documents through deep semantic understanding and logical reasoning capabilities. However, their practical application still needs to address key issues such as model interpretability, anonymization of engineering data, and integration with existing toolchains. Summary of the Invention

[0007] The purpose of this invention is to provide an automated document generation method based on hierarchical prompt words and a rule engine. This invention is adaptable to various types of military technical documents, enabling unified standard compliance verification and automatic generation of change impact reports, thereby reducing manual coordination costs.

[0008] Technical solution: A method for automated document generation based on hierarchical prompt words and a rule engine, comprising the following steps: Step 1: Layered prompt design: Based on a multi-level guidance design of framework layer, chapter layer, and item layer, fine-grained control is achieved from document type to specific item; Step 2: Intelligent Rule Engine Design: Based on the GJB438B / C standard and domain knowledge base, a rule engine is designed to realize the logical completeness and compliance verification of document content, so as to ensure that the content meets the deep requirements of the GJB standard. Step 3: Dynamic generation and optimization driven by large model: Based on the semantic understanding capabilities of the large model LLM, complete natural language input processing, multi-objective optimization and negotiation suggestions, and change impact analysis; Step 4: Output and Collaborative Management: Complete the standardized document output and generate documents that conform to the GJB438B / C standard.

[0009] In the aforementioned document automation generation method based on hierarchical prompt words and rule engines, the framework layer is used to call preset templates according to document type.

[0010] In the aforementioned document automation generation method based on hierarchical prompt words and rule engines, the chapter layer is used to trigger the associated rule base and prompt for required content when entering a specific chapter of the document.

[0011] In the aforementioned document automation generation method based on hierarchical prompt words and rule engines, the chapter layer is also used to pop up a warning and recommend examples in real time when the user input content lacks quantitative indicators.

[0012] In the aforementioned document automation generation method based on hierarchical prompt words and rule engines, the item layer is used to force the input of "triggering conditions", "input and output" and "expected results" fields when targeting functional requirement items, and guides users to select standardized terms through drop-down menus.

[0013] In the aforementioned document automation generation method based on hierarchical prompt words and rule engines, the item layer is used to force the binding of a verification method for non-functional requirement items, otherwise submission is not possible.

[0014] In the aforementioned document automation generation method based on hierarchical prompt words and a rule engine, in step two, the intelligent rule engine is used for standard compliance verification, requirement integrity completion, and requirement-design boundary filtering. Standard compliance verification includes structural verification and content verification. Structural verification checks chapter integrity, numbering continuity, and terminology consistency. During content verification, non-functional requirements must include quantitative indicators and verification methods, and requirement descriptions must avoid technical implementation details. Requirement integrity completion includes non-functional requirement derivation and related requirement generation. Non-functional requirement derivation involves automatically deriving implicit non-functional requirements based on functional requirement scenarios. Related requirement generation involves automatically generating dependencies through semantic analysis. The requirement-design boundary filtering involves automatically filtering descriptions through rule and semantic analysis, and can provide quantitative indicator derivations.

[0015] In the aforementioned document automation generation method based on hierarchical prompt words and rule engines, in step three, natural language requirement input processing is used to convert the requirements described in natural language into structured requirement items that conform to the GJB standard and associate them with non-functional requirements; multi-objective optimization and negotiation suggestions are used to generate compromise solutions through weight analysis in requirement conflict scenarios and provide verifiable compromise indicators; change impact analysis is used to automatically analyze the scope of impact when requirements are modified, generate change impact reports, and update the document synchronously.

[0016] In the aforementioned document automation generation method based on hierarchical prompt words and rule engines, step four, output and collaboration management, is also used for multi-party collaboration and version control: it supports users, developers, and testers to make synchronous modifications through a collaboration interface, detect conflicts in real time, and generate version difference reports.

[0017] Beneficial effects: This invention provides an automated document generation method based on hierarchical prompt words and rule engines, which can be adapted to various types of military technical documents, including but not limited to Software Requirements Specifications (SRS), test plans, user manuals, etc. Its core advantages include multi-document type adaptation, unified standard compliance verification, automatic generation of change impact reports, etc., reducing manual coordination costs.

[0018] (a) Through automated generation and rule validation, document preparation time is reduced from hundreds of man-hours to dozens of man-hours, improving efficiency by over 80% (based on average man-hour statistics for three projects of a certain system of model XX). Structured prompts and rule validation can reduce human errors by over 60% (such as missing chapters and disordered numbering).

[0019] (b) The rule engine enforces the requirements for chapter structure, terminology specifications and verification methods, 100% covering the requirements of GJB438B / C standard.

[0020] (c) Through semantic filtering mechanism, ensure that the requirements document only contains "what to do", and separate the technical implementation details into the design document, reducing more than 70% of requirement change disputes.

[0021] (d) Systematically generate quantitative indicators and verification methods to improve the test pass rate by more than 40% (based on comparative experimental data from a software project).

[0022] (e) It can quickly adapt to different military software scenarios (such as UAV control and radar data processing) by expanding the rule base and prompt words, and its adaptability is better than traditional template tools. Attached Figure Description

[0023] Figure 1 This is the architecture of the present invention. Detailed Implementation

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

[0025] Example 1. A method for automated document generation based on hierarchical prompt words and a rule engine, see [link to example]. Figure 1 As shown, it includes: Step 1: Design of Layered Prompt Keywords Through multi-level guidance at the framework, chapter, and item levels, fine-grained control is achieved from document type to specific item, solving the problem of structured document generation and ensuring compliance with preset templates and formats.

[0026] Framework Layer: When the user selects a document type (such as "Requirements Specification" or "Design Specification"), the system automatically loads the corresponding framework rules (such as the chapter structure and numbering rules defined in the GJB438B / C standard). When the user selects the "SRS" type, the system presets chapters including "Scope," "Referenced Documents," "CSCI Capability Requirements," and "Security Requirements," and defines the mandatory elements for each chapter. Chapter Level: Chapter-level prompts are triggered by title recognition. Each chapter node is associated with mandatory content elements (such as "3.1 Requirements for Status and Method", which requires defining at least 3 statuses), and references standard libraries (such as "3.8 Safety Requirements" which is associated with GJB / Z 142-2004). Structured writing suggestions are generated based on the recognition results, and compliance checks are performed on the chapter content.

[0027] Item Level: Imposes input specifications on specific items to ensure content completeness and verifiability. Functional Requirement Items: Mandates the inclusion of "Trigger Condition," "Input / Output," and "Expected Result" fields to ensure format compliance. Non-Functional Requirement Items: Requires quantifiable metrics and verification methods. For example: "When the system is subjected to a certain attack (scenario), it must maintain a response time of ≤500ms in 99% of requests (metric), verified through simulated attack testing (method)." Step 2: Integration of the Intelligent Rule Engine The rules engine, based on the GJB438B / C standard and domain knowledge base, verifies the logical completeness and compliance of document content, solves dynamic compliance and integrity issues, and ensures that content meets the deeper requirements of the GJB standard. It implements the following functions: 1. Standard compliance verification, including structural verification and content verification.

[0028] Structure verification: Check the completeness of chapters, the continuity of numbering, and the consistency of terminology.

[0029] Content validation: Non-functional requirements must include quantifiable metrics and validation methods. Requirement descriptions should avoid detailing technical implementation.

[0030] 2. Complete the requirements, including the derivation of non-functional requirements and the generation of related requirements.

[0031] Non-functional requirement derivation: Based on functional requirement scenarios, automatically derive the implicit non-functional requirements.

[0032] Dependency generation: Automatically generate dependencies through semantic analysis.

[0033] 3. Requirements-Design Boundary Filtering Through rule and semantic analysis, automatic filtering technology is used to describe requirements and provide quantitative indicator derivations, ensuring the objectivity and verifiability of requirements documents.

[0034] Step 3: Dynamic Generation and Optimization Driven by Large Models By combining the semantic understanding capabilities of Large LLM models, the following functions are achieved: Natural language requirement input processing: Users can describe their requirements in natural language, and the model converts them into structured requirement items that conform to the GJB standard and associates them with non-functional requirements.

[0035] Multi-objective optimization and negotiation suggestions: In scenarios with conflicting requirements (such as users demanding "high security" and developers advocating "low resource consumption"), the model generates compromise solutions through weight analysis and provides verifiable compromise metrics.

[0036] Change impact analysis: When requirements are modified, the model automatically analyzes the scope of impact and generates a change impact report, updating the document accordingly.

[0037] Step 4: Output and Collaboration Management Standardized document output: Generate documents that conform to the GJB438B / C standard. Multi-party collaboration and version control: Supports users, developers, and testers to make synchronous modifications through a collaborative interface. The system detects conflicts in real time and generates version difference reports.

[0038] Example 2. A method for automated document generation based on hierarchical prompt words and a rule engine, see [link to example]. Figure 1 As shown, 1. System Initialization and Document Type Selection Users select the target document type (such as Software Requirements Specification or Test Plan) through the interactive interface, and the system loads the corresponding hierarchical prompt word framework according to the GJB438B / C standard. For example, when "Software Requirements Specification (SRS)" is selected, the system automatically generates a framework containing chapters such as "Scope," "Referenced Documents," and "CSCI Capability Requirements," and pre-sets the required fields and format specifications for each chapter.

[0039] 2. Hierarchical prompt-driven structured input Framework layer: The system calls preset templates based on document type. For example, the chapter structure of SRS documents must strictly follow the automatic numbering rules of GJB438B-2009 (such as "3.1.1 Functional Requirements").

[0040] Chapter-level: When a user enters a specific chapter (e.g., "Security Requirements"), the system triggers the associated rule base (e.g., referencing the GJB / Z 142-2004 standard) and prompts for required fields (e.g., "At least 3 system security states must be defined"). If the user's input lacks quantifiable indicators, the system will display a warning in real time and recommend examples (e.g., "Response time ≤ 500ms, availability ≥ 99.9%").

[0041] Item Level: For functional requirement items, the system mandates the input of "Trigger Condition," "Input / Output," and "Expected Result" fields, and guides users to select standardized terms (such as "Should Support" or "Should Not Appear") via drop-down menus. Non-functional requirement items must be bound to a verification method (such as "Verify through stress testing"), otherwise they cannot be submitted.

[0042] 3. Real-time validation and completion of the intelligent rule engine Standards compliance verification: The rules engine scans the document, comparing the document content against the requirements of each clause based on preset standards (such as ISO, GDPR, etc.) and a custom rule base. Finally, it performs intelligent correlation verification, using semantic analysis technology to identify logical contradictions or missing references across chapters. The system automatically generates a verification report, marking the location and severity of violations and providing remediation suggestions. It also supports dynamic updates to the rule base to adapt to the latest regulatory changes. For example, if the structural verification detects that the "Test Plan" is missing a "Risk Analysis" chapter, it automatically inserts the chapter and prompts the user to supplement the content; if the content verification finds that the requirement description contains technical details, it marks it as a violation and provides modification suggestions.

[0043] Requirement completion and association: When a user inputs an incomplete requirement description, the system uses semantic analysis to identify core keywords and potential intents, automatically completing missing boundary conditions, constraints, or related scenarios. For example, when a user inputs "the system needs to support multi-target tracking," the rule engine automatically derives non-functional requirements (such as "tracking accuracy ≤ 0.1 meters, data update frequency ≥ 10Hz") and generates related test cases (such as "verify tracking accuracy in a scenario with 100 concurrent targets").

[0044] 4. Dynamic optimization and conflict resolution driven by large models Natural Language Transformation: When the user inputs "The system should be able to process radar signals quickly", the large model parses the data and generates a structured entry: "Functional requirement: Radar signal processing delay ≤ 50ms (quantitative indicator), verification method: through simulated signal injection test (method)".

[0045] Multi-objective negotiation: If the user requests "real-time response" while the developer sets "resource utilization rate ≤ 20%", the model generates a compromise solution based on weight analysis (such as "response time ≤ 100ms, resource utilization rate ≤ 30%), and provides verification indicators (such as "testing under 80% load").

[0046] Change impact analysis: When a functional requirement is modified, the model automatically identifies the associated test cases and design document sections, and generates a change report (such as "Affects section 4.2 of the test plan, and the acceptance criteria need to be updated synchronously").

[0047] 5. Collaborative Management and Output Multi-party collaboration: Users, developers, and testers can edit synchronously through a web interface. The system marks conflicting content in real time (such as when users modify requirements but testers do not update test cases) and generates a difference comparison view.

[0048] Version control: Each commit generates a timestamped version, supports reverting to any historical state, and exports change logs (e.g., "V1.2: Updated security requirements, added section 3.5.2").

[0049] Standardized output: The final document is generated in Word format according to GJB438B / C requirements, and a conformity declaration is automatically attached (such as "This SRS document has passed the verification of GJB438B-2009 Sections 5.1-5.8").

[0050] This invention achieves the following advantages: 1. Deep coupling of hierarchical prompts and rule engine: The first three-level guidance mechanism of "framework-chapter-entry" is created, which embeds the structured requirements of GJB standard into the dynamic generation process, solving the problem that traditional template tools only support surface format mapping.

[0051] 2. Semantic-based requirement-design boundary filtering technology: Through the collaboration of a rule engine and a large model, it automatically identifies and removes technical implementation details (such as algorithms and interface designs) to ensure the objectivity of requirement documents and reduce change disputes.

[0052] 3. Multi-objective optimization and quantitative indicator derivation: Combining semantic reasoning and domain knowledge base of LLM, fuzzy requirements (such as "high reliability") are transformed into verifiable quantitative indicators (such as "MTBF≥10000 hours"), and conflicting objectives are dynamically balanced.

[0053] 4. Change Impact Chain Analysis Mechanism: Based on the semantic relationship graph between requirement items, it enables cross-document (requirement-test-design) change impact tracking, significantly reducing manual coordination costs.

Claims

1. A method for automatic generation of documents based on hierarchical prompts and rules engine, characterized in that, The method comprises the following steps: Step one: hierarchical prompt word design: based on the multi-level guidance design of framework layer, chapter layer and item layer, the fine control from document type to specific item is completed; Step two: intelligent rule engine design: based on the rule engine designed according to GJB438B / C standard and domain knowledge base, the logical completeness and compliance check of document content are realized to ensure that the content meets the deep requirements of GJB standard; Step three: dynamic generation and optimization driven by large model: based on the semantic understanding ability of large model LLM, the natural language demand input processing, multi-objective optimization and negotiation suggestion and change impact analysis are completed; Step four: output and collaborative management: the standardized document output is completed to generate the document meeting the GJB438B / C standard.

2. The hierarchical prompt and rules engine based document automation generation method of claim 1, wherein, The framework layer is used to call a preset template according to a document type.

3. The hierarchical prompt and rules engine based document automation generation method of claim 1, wherein, The chapter layer is used to trigger an associated rule base when entering a specific chapter of the document, and prompt the mandatory content.

4. The hierarchical prompt and rules engine based document automation generation method of claim 3, wherein, The chapter layer is also used to pop up a warning and recommend an example in real time when the user inputs a content missing quantitative index.

5. The hierarchical prompt and rules engine based document automation generation method of claim 1, wherein, The item layer is used to force the input of "trigger condition", "input and output" and "expected result" fields when aiming at a functional requirement item, and guide the user to select standardized terms through a drop-down menu.

6. The hierarchical prompt and rules engine based document automation generation method of claim 5, wherein, The item layer is used to force the binding of a verification method when aiming at a non-functional requirement item, otherwise it cannot be submitted.

7. The hierarchical prompt and rules engine based document automation generation method of claim 1, wherein, In step two, the intelligent rule engine is used for standard compliance check, requirement completeness, and requirement-design boundary filtering; wherein the standard compliance check includes structure check and content check; the structure check is used to check chapter integrity, numbering continuity and term consistency; in the content check, the non-functional requirement must contain quantitative indicators and verification methods, and the requirement description should avoid technical implementation details; the requirement completeness includes non-functional requirement derivation and associated requirement generation; the non-functional requirement derivation is to automatically derive the implied non-functional requirement based on the functional requirement scene; the associated requirement generation is to automatically generate the dependency relationship through semantic analysis; the requirement-design boundary filtering is to automatically filter the technical implementation description through rules and semantic analysis, and can give quantitative index derivation.

8. The hierarchical prompt and rules engine based document automation generation method of claim 1, wherein, In step three, the natural language requirement input processing is used to convert the natural language description requirement into a structured requirement item meeting the GJB standard, and associate the non-functional requirement; the multi-objective optimization and negotiation suggestion is used to generate a compromise scheme through weight analysis in the requirement conflict scene, and provide verifiable compromise indicators; the change impact analysis is used to automatically analyze the impact range when the requirement is modified, and generate a change impact report, and synchronously update the document.

9. The hierarchical prompt and rules engine based document automation generation method of claim 1, wherein, In step four, the output and collaborative management is also used for multi-party collaboration and version control: the user, the developer and the tester can modify synchronously through the collaboration interface, detect conflicts in real time and generate a version difference report.