SPEC-based artificial intelligence document generation method and related equipment

By using an AI-powered document generation method based on SPEC to manage the document creation process in stages, the problem of lack of document planning in existing technologies is solved, enabling efficient and logically sound professional document generation and improving user experience and content quality.

CN121328496APending Publication Date: 2026-01-13GUANGDONG ELECTRIC POWER PLANNING SURVEY & DESIGN INST
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511289058.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-10
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing AI-powered writing tools lack systematic support for overall document planning, structured creation, and project management when generating professional documents. They fail to provide structured creative process guidance, resulting in weak content logic, insufficient consistency, poor user experience, and the need for extensive manual revisions.

Method used

The document generation method based on SPEC is adopted. It achieves intelligent management of the document creation process through four stages: requirements analysis, detailed document outline generation, task planning and content creation. Combined with prompt word constraint mechanism, progress tag parsing and format tag parsing, it realizes intelligent management of the document creation process.

Benefits of technology

It significantly improves the efficiency and quality of professional document creation, ensures the logicality and consistency of content, reduces the need for manual revisions, and achieves automated document generation and direct usability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121328496A_ABST
    Figure CN121328496A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an SPEC-based artificial intelligence document generation method and related equipment. The SPEC-based artificial intelligence document generation method comprises four SPEC stages including a demand analysis stage, an outline generation stage, a task planning stage, a content creation stage and the like. According to the SPEC-based artificial intelligence document generation method, through a standardized SPEC four-stage process and in combination with key technologies such as a cue word constraint mechanism, progress label analysis and format label analysis, the intellectualization of the creation process of documents, especially professional documents, is realized, and the creation efficiency and the document quality are remarkably improved; specifically, a document creation process is divided into four ordered stages including a demand analysis stage, an outline generation stage, a task planning stage and a content creation stage, so that staged management can be realized, parameters are finely controlled in each stage, and a document which is easier to meet user requirements is generated. The method is widely applied to the technical field of artificial intelligence.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the field of artificial intelligence technology, and in particular to a SPEC-based artificial intelligence document generation method and related equipment. BACKGROUND

[0002] Traditionally, the demand analysis, structure design, content writing, etc. of professional documents such as patent files, technical reports, academic papers, etc. need to be processed manually, which often faces the problems of time-consuming and laborious, low efficiency, etc.

[0003] With the development of artificial intelligence (AI) technology, professional documents can be processed using AI technology. However, current AI writing tools are mostly limited to generating fragment texts, while professional documents often have a large volume and strong logical structure. Therefore, the current AI writing technology lacks systematic support for overall planning, structured creation and project management of documents, generally lacks effective management and progress tracking capabilities for multiple project parallelism and multi-stage collaboration, cannot provide structured creation process guidance, and the user experience is poor. Moreover, AI-generated content often lacks strong logic and consistency, and the content quality is difficult to control, which can easily lead to content deviation from expectations and require a lot of manual revision, and has no efficiency and cost advantages compared to manual processing. SUMMARY

[0004] In view of the deficiencies of the current AI writing technology in generating professional documents, the purpose of embodiments of the present application is to provide a SPEC-based artificial intelligence document generation method and related equipment.

[0005] In one aspect, the embodiments of the present application include a SPEC-based artificial intelligence document generation method, which comprises:

[0006] a requirement analysis stage; in the requirement analysis stage, a requirement specification document is generated;

[0007] an outline generation stage; in the outline generation stage, a detailed document outline is generated according to the requirement specification document;

[0008] a task planning stage; in the task planning stage, the detailed document outline is decomposed into at least one independent creation task item;

[0009] a content creation stage; in the content creation stage, document text content is generated according to each creation task item in sequence.

[0010] Further, the requirement specification document is generated, comprising:

[0011] Obtaining a requirement analysis prompt word template;

[0012] Performing at least one round of first interactive dialogue between a user and an artificial intelligence model;

[0013] When each first text content block of each round of the first interactive dialogue that has been performed meets a preset condition, generating the requirement specification document according to each first text content block, otherwise, performing the next round of the first interactive dialogue;

[0014] Wherein, any round of the first interactive dialogue includes the following steps:

[0015] Obtaining a requirement analysis prompt word sub-template; wherein, when the first interactive dialogue is the first round, the requirement analysis prompt word sub-template includes the requirement analysis prompt word template and the interactive input information of the user in the current round of the first interactive dialogue, otherwise, the requirement analysis prompt word sub-template includes the requirement analysis prompt word template, the interactive input information of the user in the current round of the first interactive dialogue and the first text content block output by the artificial intelligence model in each round of the first interactive dialogue that has been performed;

[0016] Inputting the requirement analysis prompt word sub-template into the artificial intelligence model to obtain the first text content block corresponding to the current round of the first interactive dialogue output by the artificial intelligence model.

[0017] Further, the generating a detailed document outline according to the requirement specification document includes:

[0018] According to the requirement specification document, obtaining an outline generation prompt word template;

[0019] Performing at least one round of second interactive dialogue between a user and an artificial intelligence model;

[0020] When each second text content block of each round of the second interactive dialogue that has been performed meets a preset condition, generating the detailed document outline according to each second text content block, otherwise, performing the next round of the second interactive dialogue;

[0021] Wherein, any round of the second interactive dialogue includes the following steps:

[0022] Obtaining an outline generation prompt word sub-template; wherein, when the second interactive dialogue is the first round, the outline generation prompt word sub-template includes the outline generation prompt word template and the interactive input information of the user in the current round of the second interactive dialogue, otherwise, the outline generation prompt word sub-template includes the outline generation prompt word template, the interactive input information of the user in the current round of the second interactive dialogue and the second text content block output by the artificial intelligence model in each round of the second interactive dialogue that has been performed;

[0023] The outline-generated prompt word template is input into the artificial intelligence model to obtain the second text content block corresponding to the second interactive dialogue in this round, which is output by the artificial intelligence model.

[0024] Furthermore, the step of decomposing the detailed document outline into at least one independent creation task item includes:

[0025] Based on the detailed document outline, obtain the task planning prompt template;

[0026] Perform at least one round of third interactive dialogue between the user and the AI ​​model;

[0027] When each third text content block of the executed round of the third interactive dialogue meets the preset conditions, each third text content block is used as a corresponding creation task item; otherwise, the next round of the third interactive dialogue is executed.

[0028] The third interactive dialogue in any round includes the following steps:

[0029] Obtain a task planning prompt word template; wherein, when the third interactive dialogue is the first round, the task planning prompt word template includes the task planning prompt word template and the user's interactive input information in this round of the third interactive dialogue; otherwise, the task planning prompt word template includes the task planning prompt word template, the user's interactive input information in this round of the third interactive dialogue, and the third text content block output by the artificial intelligence model in each round of the executed third interactive dialogue;

[0030] The task planning prompt word template is input into the artificial intelligence model to obtain the third text content block corresponding to the third interactive dialogue in this round, which is output by the artificial intelligence model.

[0031] Furthermore, the step of generating the document body content sequentially according to each of the creation task items includes:

[0032] Based on each of the creation tasks, obtain the content creation prompt template;

[0033] Perform at least one round of the fourth interactive dialogue between the user and the AI ​​model;

[0034] When each fourth text content block of the executed round of the fourth interactive dialogue meets the preset conditions, the document body content is generated according to each fourth text content block; otherwise, the next round of the fourth interactive dialogue is executed.

[0035] In any round of the fourth interactive dialogue, the following steps are included:

[0036] Obtain a content creation prompt word template; wherein, when the fourth interactive dialogue is the first round, the content creation prompt word template includes the content creation prompt word template and the user's interactive input information in this round of the fourth interactive dialogue; otherwise, the content creation prompt word template includes the content creation prompt word template, the user's interactive input information in this round of the fourth interactive dialogue, and the fourth text content block output by the artificial intelligence model in each round of the fourth interactive dialogue that has been executed;

[0037] The content creation prompt word template is input into the artificial intelligence model to obtain the fourth text content block corresponding to the fourth interactive dialogue in this round, which is output by the artificial intelligence model.

[0038] Furthermore, the SPEC-based AI document generation method also includes:

[0039] Before inputting each prompt word sub-template into the artificial intelligence model, tags are added to the prompt word sub-templates to generate prompt information; each prompt word sub-template includes the requirements analysis prompt word sub-template in the requirements analysis phase, the outline generation prompt word template in the outline generation phase, the task planning prompt word template in the task planning phase, and the content creation prompt word template in the content creation phase;

[0040] The AI ​​model generates AI tags for each text content block in response to the tag generation prompt information; each text content block includes a first text content block generated in the requirements analysis stage, a second text content block generated in the outline generation stage, a third text content block generated in the task planning stage, and a fourth text content block generated in the content creation stage.

[0041] The text content blocks are structured and managed according to the AI ​​tags.

[0042] Furthermore, the step of obtaining the AI ​​tags generated by the artificial intelligence model in response to the tag generation prompt information for each text content block includes:

[0043] In response to the tag generating prompt information, the artificial intelligence model sets stage tags and status tags for each of the first text content blocks, each of the second text content blocks and each of the third text content blocks, respectively;

[0044] In response to the tag generation prompt information, the artificial intelligence model sets stage tags, status tags, content boundary tags, and task tags for each of the fourth text content blocks.

[0045] Furthermore, the SPEC-based AI document generation method also includes:

[0046] Get the user-editable main prompts;

[0047] Input the total prompt words into the artificial intelligence model;

[0048] Obtain the following prompt templates output by the artificial intelligence model: a requirements analysis prompt template for the requirements analysis phase, an outline generation prompt template for the outline generation phase, a task planning prompt template for the task planning phase, and a content creation prompt template for the content creation phase.

[0049] On the other hand, embodiments of the present invention also include a computer device, including a memory and a processor, the memory for storing at least one program, and the processor for loading at least one program to execute the SPEC-based artificial intelligence document generation method in the embodiments.

[0050] On the other hand, embodiments of the present invention also include a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the SPEC-based artificial intelligence document generation method in the embodiments.

[0051] The beneficial effects of the embodiments of the present invention are as follows: The SPEC-based AI document generation method in the embodiments, through a standardized SPEC four-stage process (requirements analysis stage, outline generation stage, task planning stage, and content creation stage), combined with key technologies such as prompt word constraint mechanism, progress tag parsing, and format tag parsing, achieves intelligent document creation, especially for professional documents, significantly improving creation efficiency and document quality; specifically, by dividing the document creation process into four orderly stages—requirements analysis stage, outline generation stage, task planning stage, and content creation stage—stage-based management can be achieved, and parameters can be finely controlled in each stage, thereby generating documents that are more likely to meet user requirements; Based on this, a prompt word constraint mechanism was implemented: a dedicated prompt word template was customized for each stage to precisely control the AI's output format, content range, and quality requirements; a tag parsing technology was implemented: the progress tags (such as [PHASE_OUTLINE]) and format tags (such as [CONTENT_START]) contained in the AI ​​response were automatically parsed to achieve automated content recognition, extraction, and status management; an interactive advancement mechanism was implemented: intelligent multi-turn dialogues guided user operations, naturally promoting orderly transitions between stages; and a format control technology was implemented: output format specifications were clearly defined in the prompt words to effectively avoid the appearance of interfering symbols such as Markdown, ensuring that the generated content could be used directly. Attached Figure Description

[0052] Figure 1This is a schematic diagram of the structure of the SPEC-based artificial intelligence document generation system in the embodiment;

[0053] Figure 2 This is a schematic diagram illustrating the steps of the SPEC-based AI document generation method in the embodiment;

[0054] Figure 3 This is a schematic diagram illustrating the specific process of the requirements analysis phase in the embodiment;

[0055] Figure 4 This is a schematic diagram illustrating the specific process of the outline generation stage in the embodiment;

[0056] Figure 5 This is a schematic diagram illustrating the specific process of the task planning phase in the embodiment;

[0057] Figure 6 This is a schematic diagram illustrating the specific process of the content creation stage in the embodiment. Detailed Implementation

[0058] I. An AI-powered document generation system based on SPEC

[0059] In this embodiment, the following can be used Figure 1 The SPEC-based AI document generation system shown executes the SPEC-based AI document generation method.

[0060] Reference Figure 1 The SPEC-based AI document generation system adopts a modular design and mainly includes the following core functional modules:

[0061] Phase Management Module: Controls the switching logic and status maintenance of the four SPEC phases in the SPEC-based AI document generation method;

[0062] User interaction module: responsible for processing user input information and managing the multi-turn dialogue process at each stage;

[0063] Prompt word constraint module: responsible for the configuration, management and application of dedicated prompt word templates for each stage;

[0064] Progress tag parsing module: Parses progress information tags in the response of artificial intelligence model for status tracking;

[0065] Formatting Tag Parsing Module: Parses formatting tags in the output of artificial intelligence models and extracts structured document content;

[0066] Document management module: Responsible for creating, saving, loading, and version control of project files;

[0067] AI Interface Module: Enables communication and interaction between users and artificial intelligence models (specifically, large language models such as DeepSeek);

[0068] User interface module: Provides users with a graphical user interface (GUI);

[0069] Configuration Management Module: Manages global configuration parameters and user-customized settings for the system.

[0070] Figure 1 The module includes phase management, user interaction, prompt word constraint, progress label parsing, format label parsing, document management, AI interface, user interface, and configuration management modules. These modules can be hardware modules, software modules, or a combination of both, such as a hardware module running the software program. When using hardware modules, one or more computer devices can be used as these modules. II. SPEC-based AI Document Generation Method

[0071] In this embodiment, refer to Figure 1 and Figure 2 The SPEC-based AI document generation method includes the following steps:

[0072] S1. Requirements Analysis Phase: Generate requirements specification documents;

[0073] S2. Outline Generation Stage: Generate a detailed document outline based on the requirements specification document;

[0074] S3. Task Planning Stage: Break down the detailed document outline into at least one independent creative task item;

[0075] S4. Content Creation Stage: Generate the main text content of the document in sequence according to each creation task.

[0076] The SPEC-based AI document generation method in this embodiment divides the document generation process into four SPEC stages: Specification, Outline, Planning, and Content, ultimately obtaining the document content desired by the user.

[0077] Specifically, refer to Figure 1 The phase management module controls the switching logic and state maintenance of the four SPEC phases, namely the execution and jump of steps S1-S4. Within each phase, when it is necessary to run or invoke an artificial intelligence model, the AI ​​interface module enables communication and interaction between the user and the AI ​​model. The AI ​​model used can be DeepSeek, GPT, or other models.

[0078] (I) S1 Requirements Analysis Phase (Specification Phase)

[0079] In this embodiment, when performing step S1, which is the step of generating the requirements specification document, the following steps can be performed:

[0080] S101. Obtain the requirement analysis prompt template;

[0081] S102. Perform at least one round of the first interactive dialogue between the user and the artificial intelligence model;

[0082] The first round of interactive dialogue in any given time includes the following steps:

[0083] S10201. Obtain the requirement analysis prompt word template; wherein, when the first interactive dialogue in this round is the first round, the requirement analysis prompt word template includes the requirement analysis prompt word template and the user's interactive input information in the first interactive dialogue in this round; otherwise, the requirement analysis prompt word template includes the requirement analysis prompt word template, the user's interactive input information in the first interactive dialogue in this round, and the first text content block output by the artificial intelligence model in each of the executed first interactive dialogues;

[0084] S10202. Input the demand analysis prompt word template into the artificial intelligence model and obtain the first text content block corresponding to the first interactive dialogue in this round output by the artificial intelligence model;

[0085] S103. When each first text content block of the executed first interactive dialogue meets the preset conditions, generate a requirement specification document based on each first text content block; otherwise, execute the next round of the first interactive dialogue.

[0086] In this embodiment, the process of step S1, i.e., the requirements analysis phase, is as follows: Figure 3 As shown.

[0087] Reference Figure 3 The requirements analysis phase executes steps S101-S103, where step S102 includes multiple rounds of first interactive dialogue.

[0088] In step S101, a matching, fixed requirement analysis prompt template can be retrieved from the database based on the user's requirement information. In this embodiment, the content of the requirement analysis prompt template is shown in Table 1.

[0089] Table 1 Contents of the Requirements Analysis Prompt Template

[0090]

[0091]

[0092] Step S102 includes multiple rounds of first interactive dialogue, each round of which includes steps S10201-S10202. Since the principle of each round of first interactive dialogue is the same, we will take one round of first interactive dialogue, namely steps S10201-S10202, as an example for explanation.

[0093] In step S10201, refer to Figure 3 If this round of first interactive dialogue is the first round of first interactive dialogue, meaning there has been no previous first interactive dialogue, then the user can be asked to input interactive input information for this round of first interactive dialogue. This interactive input information can be information expressing the user's requirements for the document to be generated. The requirements analysis prompt word template and the interactive input information are combined to form the requirements analysis prompt word sub-template for this round of first interactive dialogue. If this round of first interactive dialogue is a subsequent round of first interactive dialogue, meaning there are previously obtained first text content blocks from previous rounds of first interactive dialogue, then the previously obtained first text content blocks can also be added to form the requirements analysis prompt word sub-template. In other words, the requirements analysis prompt word template, the interactive input information entered by the user in this round of first interactive dialogue, and the first text content blocks obtained from previous rounds of first interactive dialogue are combined to form the requirements analysis prompt word template for this round of first interactive dialogue.

[0094] In other words, apart from the first round of the first interactive dialogue, the requirement analysis prompt word template for each round of the first interactive dialogue is composed of the results of the previous rounds of the first interactive dialogue, i.e., the first text content blocks, combined with the requirement analysis prompt word template and the interactive input information newly entered by the user. In this way, information is iteratively accumulated between the rounds of the first interactive dialogue. When multiple rounds of the first interactive dialogue are executed, the user can be guided to gradually provide more requirement information.

[0095] In step S10202, the requirement analysis prompt word template is input into the artificial intelligence model to obtain the first text content block corresponding to the first interactive dialogue of this round, output by the artificial intelligence model. The first text content block can specifically represent the text obtained after semantically organizing the requirement analysis prompt word template.

[0096] In this embodiment, after completing one round of the first interactive dialogue (steps S10201-S10202), it is checked whether each first text content block of the executed rounds of the first interactive dialogue meets a preset condition. Specifically, the preset condition can be set as "the total data volume of each first text content block of the executed rounds of the first interactive dialogue is greater than a data volume threshold". If this preset condition is not met, it indicates that the requirement information is not sufficient, and the next round of the first interactive dialogue is executed, i.e., steps S10201-S10202 are re-executed. Otherwise, if this preset condition is met, it indicates that the requirement information is sufficient, the first interactive dialogue ends, and step S103 is executed to combine the first text content blocks obtained from each round of the first interactive dialogue to generate a requirement specification document. Alternatively, the preset condition can be set by an artificial intelligence model. For example, if the last first text content block output by the artificial intelligence model has an end marker, then it is determined that this preset condition is met, and the first interactive dialogue ends.

[0097] Reference Figure 3 After obtaining the first text content block by executing step S10202 in each round of the first interactive dialogue, the user interface module can push the first text content block to the user, thereby guiding the user to edit new interactive input information in the next round of the first interactive dialogue.

[0098] When performing step S103, the user can modify or confirm the first text content block obtained from each round of the first interaction, and use the modified or confirmed first text content block to generate the requirement specification document.

[0099] In this embodiment, by executing multiple rounds of first interactive dialogue using the requirement analysis prompt template in step S1, the following technical effects can be achieved:

[0100] o To gain a more comprehensive understanding of user needs and generate structured requirement specification documents;

[0101] o The application uses customized demand analysis prompt templates to guide users to clearly describe their needs and to constrain the prompts input into the artificial intelligence model, thereby improving the logic and consistency of the AI ​​model's output, reducing the possibility of content deviating from expectations, and improving content quality;

[0102] o By gradually collecting user needs information through multiple rounds of interactive dialogue, it is beneficial to avoid users providing a large amount of information in a short period of time, reduce user pressure, and facilitate the collection of richer details of needs;

[0103] o Automatically generate compliant requirement specification documents through multiple rounds of first-round interactive dialogue with artificial intelligence models;

[0104] o Supports users in reviewing and modifying the generated requirements specification documents.

[0105] (II) S2 Outline Generation Phase

[0106] In this embodiment, when step S2 is executed, which is the step of generating a detailed document outline based on the requirements specification document, the following steps can be performed:

[0107] S201. Based on the requirements specification document, obtain the outline to generate prompt word template;

[0108] S202. Perform at least one round of a second interactive dialogue between the user and the artificial intelligence model;

[0109] Each round of the second interactive dialogue includes the following steps:

[0110] S20201. Obtain the outline generation prompt word sub-template; wherein, when the second interactive dialogue is the first round, the outline generation prompt word sub-template includes the outline generation prompt word template and the user's interactive input information in this round of the second interactive dialogue; otherwise, the outline generation prompt word sub-template includes the outline generation prompt word template, the user's interactive input information in this round of the second interactive dialogue, and the second text content block output by the artificial intelligence model in each round of the executed second interactive dialogue;

[0111] S20202. Input the outline-generated prompt word template into the artificial intelligence model and obtain the second text content block corresponding to the second interactive dialogue in this round output by the artificial intelligence model;

[0112] S203. If each second text content block of each round of the second interactive dialogue meets the preset conditions, generate a detailed document outline based on each second text content block; otherwise, execute the next round of the second interactive dialogue.

[0113] In this embodiment, the process of step S2, i.e., the outline generation stage, is as follows: Figure 4 As shown.

[0114] Reference Figure 4 The outline generation stage executes steps S201-S203, where step S202 includes multiple rounds of second interactive dialogue.

[0115] In step S201, a fixed outline prompt template can be read from the database. In this embodiment, the content of the outline prompt template is shown in Table 2.

[0116] Table 2 Contents of Outline Generation Prompt Template

[0117]

[0118] Step S202 includes multiple rounds of second interactive dialogue, each round of which includes steps S20201-S20202. Since the principle of each round of second interactive dialogue is the same, we will take one round of second interactive dialogue, namely steps S20201-S20202, as an example for explanation.

[0119] In step S20201, refer to Figure 4 If this round of the second interactive dialogue is the first round of the second interactive dialogue, meaning no second interactive dialogue has been executed before, then the user can be asked to input interactive input information for this round of the second interactive dialogue. This interactive input information can be information expressing the user's requirements for the outline to be generated. The outline generation prompt word template and the interactive input information are combined to form the outline generation prompt word sub-template for this round of the second interactive dialogue. If this round of the second interactive dialogue is a subsequent round of the second interactive dialogue, meaning there are second text content blocks obtained from previous rounds of the second interactive dialogue, then the previously obtained second text content blocks can also be added to form the outline generation prompt word sub-template. In other words, the outline generation prompt word template, the interactive input information entered by the user in this round of the second interactive dialogue, and the second text content blocks obtained from previous rounds of the second interactive dialogue are combined to form the outline generation prompt word template for this round of the second interactive dialogue.

[0120] In other words, apart from the first round of the second interactive dialogue, the outline generation prompt word template for each round of the second interactive dialogue is composed of the results of the previous rounds of the second interactive dialogue, i.e., each second text content block, combined with the outline generation prompt word template and the interactive input information newly entered by the user. In this way, information is iteratively accumulated between the rounds of the second interactive dialogue. When multiple rounds of the second interactive dialogue are executed, the user can be guided to gradually provide more outline points.

[0121] In step S20202, the outline-generated prompt word sub-template is input into the artificial intelligence model to obtain the second text content block corresponding to the second interactive dialogue in this round, output by the artificial intelligence model. Specifically, the second text content block can represent the text obtained after semantically organizing the outline-generated prompt word template.

[0122] In this embodiment, after completing one round of the second interactive dialogue, i.e., steps S20201-S20202, it is checked whether each second text content block of the executed rounds of the second interactive dialogue meets a preset condition. Specifically, the preset condition can be set as "the total data volume of each second text content block of the executed rounds of the second interactive dialogue is greater than a data volume threshold". If this preset condition is not met, it indicates that the outline is not sufficient, and the next round of the second interactive dialogue is executed, i.e., steps S20201-S20202 are re-executed. Otherwise, if this preset condition is met, it indicates that the outline is sufficient, the second interactive dialogue ends, and step S203 is executed to combine the second text content blocks obtained from each round of the second interactive dialogue to generate a detailed document outline. Alternatively, the preset condition can be set by an artificial intelligence model. For example, if the last second text content block output by the artificial intelligence model has an end marker, then it is determined that this preset condition is met, and the second interactive dialogue ends.

[0123] Reference Figure 4 After obtaining the second text content block by executing step S20202 in each round of the second interactive dialogue, the user interface module can push the second text content block to the user, thereby guiding the user to edit new interactive input information in the next round of the second interactive dialogue.

[0124] When performing step S203, the user can modify or confirm the second text content blocks obtained from each round of the second interactive process, and use the modified or confirmed second text content blocks to generate a detailed document outline.

[0125] In this embodiment, by generating prompt word templates through the outline in step S2 during the outline generation stage and executing multiple rounds of second interactive dialogue, the following technical effects can be achieved:

[0126] o Calls a specialized outline to generate prompt word templates, thereby constraining the prompt words input into the artificial intelligence model, improving the logic and consistency of the AI ​​model's output, reducing the possibility of content deviating from expectations, and improving content quality;

[0127] Automatically design the chapter structure and logical relationships of a document;

[0128] Generates standardized Markdown-formatted outline documents;

[0129] o Supports users in reviewing and adjusting the generated outline;

[0130] Based on the confirmed requirements specification, automatically generate a well-structured and logically clear professional document outline.

[0131] (III) S3 Task Planning Phase

[0132] In this embodiment, when performing step S3, which is to decompose the detailed document outline into at least one independent creation task item, the following steps can be performed:

[0133] S301. Obtain the task planning prompt template based on the detailed document outline;

[0134] S302. Perform at least one round of third interactive dialogue between the user and the artificial intelligence model;

[0135] Each round of the third interactive dialogue includes the following steps:

[0136] S30201. Obtain the task planning prompt word template; wherein, when the third interactive dialogue is the first round, the task planning prompt word template includes the task planning prompt word template and the user's interactive input information in this round of the third interactive dialogue; otherwise, the task planning prompt word template includes the task planning prompt word template, the user's interactive input information in this round of the third interactive dialogue, and the third text content block output by the artificial intelligence model in each round of the executed third interactive dialogue;

[0137] S30202. Input the task planning prompt word template into the artificial intelligence model and obtain the third text content block corresponding to the third interactive dialogue in this round output by the artificial intelligence model;

[0138] S303. When each third text content block of the executed third interactive dialogue meets the preset conditions, each third text content block is used as a corresponding creation task item; otherwise, the next round of third interactive dialogue is executed.

[0139] In this embodiment, the process of step S3, i.e., the task planning stage, is as follows: Figure 5 As shown.

[0140] Reference Figure 5 The task planning phase executes steps S301-S303, where step S302 includes multiple rounds of third interactive dialogue.

[0141] In step S301, a fixed task planning prompt template can be read from the database. In this embodiment, the content of the task planning prompt template is shown in Table 3.

[0142] Table 3: Contents of Task Planning Prompt Templates

[0143]

[0144] Step S302 includes multiple rounds of third interactive dialogue, each round of which includes steps S30201-S30202. Since the principle of each round of third interactive dialogue is the same, we will take one round of third interactive dialogue, namely steps S30201-S30202, as an example for explanation.

[0145] In step S30201, refer to Figure 5 If this round of third interactive dialogue is the first round of third interactive dialogue, meaning no third interactive dialogue has been executed before, then the user can be asked to input interactive input information for this round of third interactive dialogue. This interactive input information can be information expressing the user's requirements for the division of the creative task. The task planning prompt word template and the interactive input information are combined to form the task planning prompt word template for this round of third interactive dialogue. If this round of third interactive dialogue is a subsequent round of third interactive dialogue, meaning there are third text content blocks obtained from previous rounds of third interactive dialogue, then the previously obtained third text content blocks can also be added to form the task planning prompt word template. In other words, the task planning prompt word template, the interactive input information entered by the user in this round of third interactive dialogue, and the third text content blocks obtained from previous rounds of third interactive dialogue are combined to form the task planning prompt word template for this round of third interactive dialogue.

[0146] In other words, apart from the first round of the third interactive dialogue, the task planning prompt word template for each round of the third interactive dialogue is composed of the results of the previous rounds of the third interactive dialogue, i.e., the third text content blocks, combined with the task planning prompt word template and the interactive input information newly entered by the user. In this way, information is iteratively accumulated between the rounds of the third interactive dialogue. When multiple rounds of the third interactive dialogue are executed, the user can be guided to gradually provide more task requirement information.

[0147] In step S30202, the task planning prompt word template is input into the artificial intelligence model to obtain the third text content block corresponding to the third interactive dialogue in this round, output by the artificial intelligence model. The third text content block can specifically represent the text obtained after semantically organizing the task planning prompt word template.

[0148] In this embodiment, after completing one round of the third interactive dialogue, i.e., steps S30201-S30202, it is checked whether each third text content block of each round of the executed third interactive dialogue meets a preset condition. Specifically, the preset condition can be set as "the number of each third text content block (the number of text blocks, or the total amount of data) of each round of the executed third interactive dialogue is greater than a quantity threshold". If this preset condition is not met, it indicates that the task definition information is still unclear, and the next round of the third interactive dialogue is executed, i.e., steps S30201-S30202 are re-executed. Otherwise, if this preset condition is met, it indicates that the task definition information is clear, the third interactive dialogue ends, and step S303 is executed, whereby the third text content blocks obtained from each round of the third interactive dialogue are treated as creation task items.

[0149] Reference Figure 5 After obtaining the third text content block by executing step S30202 in each round of the third interactive dialogue, the user interface module can push the third text content block to the user, thereby guiding the user to edit new interactive input information in the next round of the third interactive dialogue.

[0150] During step S303, the user can modify or confirm the third text content block obtained from each round of the third interaction, and the modified or confirmed third text content block is used as the creation task item. During step S303, the artificial intelligence model can set preset conditions. For example, if the last third text content block output by the artificial intelligence model has an end marker, then it is determined that this preset condition is met, and the third interactive dialogue ends.

[0151] In this embodiment, by executing multiple rounds of third-round interactive dialogue using task planning prompt templates in step S3, the following technical effects can be achieved:

[0152] o Use task planning-specific prompt word templates to constrain the prompt words input into the artificial intelligence model, improve the logic and consistency of the AI ​​model's output, reduce the possibility of content deviating from expectations, and improve content quality;

[0153] Automatically breaks down the outline into independent task items by chapter;

[0154] o Clearly define for each task: work content, expected outputs (including word count requirements), and completion criteria;

[0155] o Generate a standardized task plan;

[0156] The finalized document outline is broken down into specific, actionable creative tasks.

[0157] (iv) S4 Content Creation Phase

[0158] In this embodiment, when step S4 is executed, which is the step of generating the document body content in sequence according to each creation task item, the following steps can be performed:

[0159] S401. Obtain content creation prompt templates based on each creation task item;

[0160] S402. Perform at least one round of the fourth interactive dialogue between the user and the artificial intelligence model;

[0161] In any round of the fourth interactive dialogue, the following steps are included:

[0162] S40201. Obtain the content creation prompt word template; wherein, when the fourth interactive dialogue is the first round, the content creation prompt word template includes the content creation prompt word template and the user's interactive input information in this round of the fourth interactive dialogue; otherwise, the content creation prompt word template includes the content creation prompt word template, the user's interactive input information in this round of the fourth interactive dialogue, and the fourth text content block output by the artificial intelligence model in each of the executed rounds of the fourth interactive dialogue;

[0163] S40202. Input the content creation prompt word template into the artificial intelligence model and obtain the fourth text content block corresponding to the fourth interactive dialogue in this round output by the artificial intelligence model;

[0164] S403. If each fourth text content block of the executed rounds of fourth interactive dialogue meets the preset conditions, generate the document body content based on each fourth text content block; otherwise, execute the next round of fourth interactive dialogue.

[0165] In this embodiment, the process of step S4, i.e., the content creation stage, is as follows: Figure 6 As shown.

[0166] Reference Figure 6 The content creation stage executes steps S401-S403, where step S402 includes multiple rounds of fourth interactive dialogue.

[0167] In step S401, a fixed content creation prompt template can be read from the database. In this embodiment, the content of the content creation prompt template is shown in Table 4.

[0168] Table 4 Content Creation Tip Templates

[0169]

[0170] Step S402 includes multiple rounds of fourth interactive dialogue, each round of which includes steps S40201-S40202. Since the principle of each round of fourth interactive dialogue is the same, we will take one round of fourth interactive dialogue, namely steps S40201-S40202, as an example for explanation.

[0171] In step S40201, refer to Figure 6 If the current fourth interactive dialogue is the first fourth interactive dialogue, meaning no fourth interactive dialogue has been executed before, then the user can be asked to input interactive input information for this fourth interactive dialogue. This interactive input information can be information expressing the user's requirements for the professional document. The content creation prompt template and the interactive input information are then combined to form the content creation prompt sub-template for this fourth interactive dialogue. If the current fourth interactive dialogue is a subsequent fourth interactive dialogue, meaning there are fourth text content blocks obtained from previous fourth interactive dialogues, then the previously obtained fourth text content blocks can also be added to form the content creation prompt sub-template. In other words, the content creation prompt template, the interactive input information entered by the user in this fourth interactive dialogue, and the fourth text content blocks obtained from previous fourth interactive dialogues are combined to form the content creation prompt template for this fourth interactive dialogue.

[0172] In other words, apart from the first round of the fourth interactive dialogue, the content creation prompt word template for each round of the fourth interactive dialogue is composed of the results of the previous rounds of the fourth interactive dialogue, i.e., the fourth text content blocks, combined with the content creation prompt word template and the interactive input information newly entered by the user. In this way, information is iteratively accumulated between the rounds of the fourth interactive dialogue. When multiple rounds of the fourth interactive dialogue are executed, the user can be guided to gradually provide more content creation requirements information.

[0173] In step S40202, the content creation prompt template (representing the requirements for the creation task) is input into the artificial intelligence model, and the fourth text content block corresponding to the fourth interactive dialogue in this round is obtained from the output of the artificial intelligence model. The fourth text content block can specifically represent a part of the professional document created according to the requirements of the content creation prompt template.

[0174] In this embodiment, after completing one round of the fourth interactive dialogue (steps S40201-S40202), it is checked whether each fourth text content block of the executed rounds of the fourth interactive dialogue meets a preset condition. Specifically, the preset condition can be set as "the total data volume of each fourth text content block of the executed rounds of the fourth interactive dialogue is greater than a data volume threshold". If this preset condition is not met, it indicates that the generated text is not large enough, and the next round of the fourth interactive dialogue is executed, i.e., steps S40201-S40202 are executed again. Otherwise, if this preset condition is met, it indicates that the generated text is large enough, the fourth interactive dialogue ends, and step S403 is executed to combine all the fourth text content blocks in sequence to generate the document body content. Alternatively, the preset condition can be set by an artificial intelligence model. For example, if the last fourth text content block output by the artificial intelligence model has an end mark, then it is determined that this preset condition is met, and the fourth interactive dialogue ends.

[0175] Reference Figure 6 After obtaining the fourth text content block by executing step S40202 in each round of the fourth interactive dialogue, the user interface module can push the fourth text content block to the user, thereby guiding the user to edit new interactive input information in the next round of the fourth interactive dialogue.

[0176] When performing step S403, the user can modify or confirm the fourth text content block obtained from each round of fourth interaction, and use the modified or confirmed fourth text content block to generate the document body content.

[0177] In this embodiment, by executing multiple rounds of fourth interactive dialogue using the content creation prompt template in step S4, the following technical effects can be achieved:

[0178] o Utilizes specialized content creation prompt templates to constrain the prompts input into the AI ​​model, thereby improving the logic and consistency of the AI ​​model's output, reducing the likelihood of content deviating from expectations, and ultimately enhancing content quality.

[0179] o Generate document body content that meets the format requirements in sequence according to the task plan;

[0180] Each round of the fourth interactive dialogue generates a portion of the document's main text content based on a creation task, allowing for more refined structural control over the document's content. For example, when outputting the fourth text content block, strict formatting constraints can be imposed, prohibiting the use of specific symbols such as Markdown, and requiring the AI ​​model to use specified formatting tags when outputting the fourth text content block.

[0181] (e.g., [CONTENT_START][TASK_X]...[CONTENT_END]) explicitly marks the boundaries of the fourth text content block;

[0182] o Supports users in providing feedback, editing, or confirming the generated content.

[0183] (V) Prompt Word Constraint Mechanism

[0184] Each of the four phases of the SPEC process uses a corresponding dedicated template. For example, the requirements analysis phase uses a requirements analysis prompt template, the outline generation phase uses an outline generation prompt template, the task planning phase uses a task planning prompt template, and the content creation phase uses a content creation prompt template.

[0185] By configuring a dedicated prompt word template for each SPEC phase, it can be ensured that the output of the artificial intelligence model in each of the four SPEC phases meets the objectives of that phase.

[0186] Requirements analysis phase: Emphasizing requirements-guiding elements, problem clarification mechanisms, specification confirmation processes, and progressive information collection strategies;

[0187] Outline generation phase: focuses on structural design guidance, chapter planning specifications, logical relationship definition, and output format standardization;

[0188] Task planning phase: Focus on task decomposition strategies, prioritization methods, definition of completion standards, and workload estimation mechanisms;

[0189] Content creation stage: Emphasizing strict format constraints, precise word count control, quality assurance measures, and user feedback processing procedures.

[0190] In this embodiment, when performing steps S101 to obtain the requirement analysis prompt template, S201 to obtain the outline generation prompt template, S301 to obtain the task planning prompt template, and S401 to obtain the content creation prompt template, in addition to reading templates with fixed content from the database, templates can also be obtained by performing the following steps:

[0191] P1. Obtain the user-edited master prompt words;

[0192] P2. Input the main prompt words into the artificial intelligence model;

[0193] P3. Obtain the following prompt templates from the AI ​​model: requirements analysis prompt template for the requirements analysis phase, outline generation prompt template for the outline generation phase, task planning prompt template for the task planning phase, and content creation prompt template for the content creation phase.

[0194] In step P1, users can be prompted to freely edit the master prompt. The master prompt is content written by the user entirely based on their own ideas and requirements for the professional document, without template guidance.

[0195] In step P2, the master prompts are input into the AI ​​model, which performs semantic understanding, key point extraction, and formatting. For example, the AI ​​model can format the master prompts into templates for requirements analysis, outline generation, task planning, and content creation. Thus, when step P3 is executed, it can obtain the following templates: a requirements analysis template for the requirements analysis phase, an outline generation template for the outline generation phase, a task planning template for the task planning phase, and a content creation template for the content creation phase.

[0196] By executing steps P1-P3, users can be guided to edit their own ideas to obtain the master prompts, which are then organized by the artificial intelligence model into formatted prompt templates for requirements analysis, outline generation, task planning, and content creation. This facilitates obtaining more flexible prompt templates and reduces the negative impact of rigid professional document content caused by obtaining fixed prompt templates.

[0197] By using corresponding dedicated templates in each of the four SPEC phases, an interactive advancement mechanism and a format control mechanism can be implemented. Specifically, the interactive advancement mechanism has the following effects:

[0198] Guided question design: Design targeted questions based on the current stage goals; ensure questions have clear direction; control the complexity and number of questions; support the gradual accumulation of information;

[0199] User feedback processing: Automatically identify user feedback types (confirmation / modification / question); dynamically adjust subsequent dialogue strategies; trigger stage advancement when conditions are met; maintain the coherence of the dialogue context;

[0200] The format control mechanism has the following effects:

[0201] Formatting constraint strategies: explicitly disable specific symbols in prompts; require predefined tag structures in output; specify paragraph indentation and other formatting details; ensure high consistency in content formatting;

[0202] Quality assurance mechanisms include: verifying the compliance of output format; checking the completeness of content; ensuring logical coherence; and providing error diagnosis and correction suggestions.

[0203] (vi) Tag parsing technology

[0204] In this embodiment, the SPEC-based AI document generation method further includes the following steps:

[0205] S5. Before inputting each prompt word sub-template into the artificial intelligence model, add tags to the prompt word templates to generate prompt information;

[0206] S6. Obtain the AI ​​tags generated by the AI ​​model in response to the tag generation prompts for each text content block;

[0207] S7. Perform structured management of each text content block based on each AI tag.

[0208] In step S5, the prompt word templates include the requirements analysis prompt word template in the requirements analysis phase, the outline generation prompt word template in the outline generation phase, the task planning prompt word template in the task planning phase, and the content creation prompt word template in the content creation phase.

[0209] For example, when performing step S10202 in the requirements analysis phase, tag generation prompts are added to the requirements analysis prompt word template, so that the tag generation prompts, along with the requirements analysis prompt word template, are input into the artificial intelligence model; the artificial intelligence model processes the requirements analysis prompt word template and outputs a first text content block, and also generates AI tags corresponding to the first text content block in response to the tag generation prompts, so that when performing step S6, the AI ​​tags corresponding to the first text content block output by the artificial intelligence model can be obtained.

[0210] For example, in step S20202 of the outline generation stage, tag generation prompts are added to the outline generation prompt sub-template, so that the tag generation prompts and the outline generation prompt sub-template are input into the artificial intelligence model. The artificial intelligence model processes the outline generation prompt sub-template and outputs a second text content block. In response to the tag generation prompts, it also generates AI tags corresponding to the second text content block, so that when step S6 is executed, the AI ​​tags corresponding to the second text content block output by the artificial intelligence model can be obtained.

[0211] For example, in step S30202 of the task planning phase, tag generation prompts are added to the task planning prompt word template, so that the tag generation prompts, together with the task planning prompt word template, are input into the artificial intelligence model; the artificial intelligence model processes the task planning prompt word template and outputs a third text content block, and also generates AI tags corresponding to the third text content block in response to the tag generation prompts, so that when step S6 is executed, the AI ​​tags corresponding to the third text content block output by the artificial intelligence model can be obtained.

[0212] For example, in step S40202 of the content creation stage, tag generation prompts are added to the content creation prompt word template, so that the tag generation prompts and the content creation prompt word template are input into the artificial intelligence model; the artificial intelligence model processes the content creation prompt word template and outputs the fourth text content block, and also generates AI tags corresponding to the fourth text content block in response to the tag generation prompts, so that when step S6 is executed, the AI ​​tags corresponding to the fourth text content block output by the artificial intelligence model can be obtained.

[0213] Specifically, the AI ​​tags generated by the AI ​​model for the first, second, and third text content blocks generated during the demand analysis, outline generation, and task planning phases include phase tags and status tags; for the fourth text content block generated during the content creation phase, the generated AI tags include not only phase tags and status tags, but also content boundary tags and task tags.

[0214] For example, for the first text content block A generated during the requirements analysis phase, the AI ​​tag set for it is:

[0215] Phase tag:

PHASE_SPEC

[0216] Status label: [COMPLETED]

[0217] For the second text content block B generated during the outline generation stage, the AI ​​label set for it is:

[0218] Phase tag:

PHASE_OUTLINE

[0219] Status label: [COMPLETED]

[0220] For the third text content block generated during the task planning phase, since each third text content block corresponds to a creation task item, the AI ​​label set for the third text content block C corresponding to creation task item X is:

[0221] Phase tag:

PHASE_PLAN

[0222] Status label: [COMPLETED]

[0223] For the fourth text content block generated during the content creation stage, since each fourth text content block corresponds to a creation task item, the AI ​​label set for the fourth text content block D corresponding to creation task item X is as follows:

[0224] Phase label:

PHASE_CONTENT

[0225] Status label: [COMPLETED]

[0226] Content boundary tags and task tags:

[0227] [CONTENT_START][TASKX], [CONTENT_END], [OUTLINE_START], [OUTLINE_END]; and so on.

[0228] In this embodiment, the text content blocks output by the artificial intelligence model in the four stages all have stage labels and status labels. The stage label indicates which stage the text content block belongs to, that is, the first text content block, the second text content block, the third text content block, or the fourth text content block; the status label indicates the completion status of the stage when the artificial intelligence model outputs the text content block.

[0229] Taking the status labels that are present in all four stages of the text content block as an example, the content and meaning of the status labels of the text content block in the four stages are as follows:

[0230] 1. Requirements Analysis Phase:

[0231] Initial: pending

[0232] After the user inputs their requirements: in_progress

[0233] AI completed the requirements analysis.

[0234] 2. Outline generation stage:

[0235] Once the requirement is met: in_progress

[0236] AI-generated outline: completed

[0237] 3. Task Planning Phase:

[0238] After the outline is completed: in_progress

[0239] AI-generated task plan: completed

[0240] 4. Content creation stage:

[0241] After the task is scheduled to complete: in_progress

[0242] All chapters completed: completed

[0243] Status labels can be visualized through the user interface (UI) module. Specifically, when the AI ​​model outputs a block of text content and its status labels, the status labels can be sent to the UI module, which then displays them through a project panel. For example, different status label values ​​will display different icons in the project panel.

[0244] pending: Displays the ○ icon

[0245] in_progress: Displays... icon

[0246] Completed: Displays a checkmark icon.

[0247] When there are multiple status labels, each status label can be displayed in the form of a status tree.

[0248] By setting status labels and visualizing them, users can intuitively understand the progress of each stage.

[0249] In step S7, each text content block can be structurally managed based on its AI tags. For example, the following process can be executed when performing step S7:

[0250] 1. Content Location: Locate the task content block based on the [CONTENT_START], [TASK_X], and [CONTENT_END] tags;

[0251] 2. Task Association: Associate the extracted content with the task number TASK_X specified in the tag;

[0252] 3. Formatting cleanup: Removes all prohibited formatting symbols and redundant information from the content block;

[0253] 4. Structure maintenance: Maintain the original document structure and hierarchical relationship of the content blocks.

[0254] In [CONTENT_START][TASK_X] and [CONTENT_END], [CONTENT_START] and [CONTENT_END] are content boundary labels, while [TASK_X] is a task label, generated by the AI ​​model only during the content creation stage for the fourth text content block it generates. Based on the task label [TASK_X] of the fourth text content block, it can be determined which creation task it corresponds to. Based on the content boundary labels of the fourth text content block, it can be determined which part of the document's main content it belongs to; for example, based on the status labels of each fourth text content block, it can be determined the completion status of each fourth text content block in the content creation stage, thus allowing the fourth text content blocks to be sorted. For two consecutive fourth text content blocks with content boundary labels of [CONTENT_START] and [CONTENT_END] respectively, they, along with all the fourth text content blocks between them, can be identified as belonging to the same part of the document's main content.

[0255] By executing steps S5-S7, each text content block output by the artificial intelligence model can be assigned a corresponding AI tag. Based on the AI ​​tag, the specific stage of the four-stage process corresponding to the text content block, its completion status within that stage, and other information can be determined, thereby achieving structured management of the text content blocks. For example, refer to... Figure 1 Each text content block generated by the SPEC-based AI document generation method, along with its corresponding AI tag, can be stored in the document management module. The document management module can determine the stage and completion status of the text content block based on its AI tag. It can also visualize the creation progress based on the AI ​​tag of the latest output text content block, displaying the stage status, task progress, creation task items, and parts of the document text in real time, thereby providing information support for the management of the AI ​​model.

[0256] III. Application of the SPEC-based AI document generation method

[0257] By implementing the SPEC-based AI document generation method, the following effects can be achieved:

[0258] (I) Significantly improved efficiency

[0259] Document creation cycle shortened by about 70%: AI assistance significantly reduces the time spent on manual writing.

[0260] Demand analysis efficiency improved by over 80%: Structured guidance accelerates the collection and confirmation of demand information.

[0261] Outline generation efficiency improved by about 90%: AI automatically generates professional outlines, saving a lot of planning time.

[0262] Content creation efficiency is improved by about 60%: AI generates high-quality first drafts, and human staff only need to make optimizations and adjustments.

[0263] (II) Document Quality Improvement

[0264] Achieving controllable content generation: Through phased SPEC guidance and process document confirmation, AI-generated content is effectively constrained to avoid deviating from the topic;

[0265] Enhanced content consistency: The prompt word constraint mechanism ensures that the output format is standardized and consistent;

[0266] A clearer logical structure: The four-stage model ensures that the document's overall logic is rigorous and its hierarchy is distinct;

[0267] Enhanced professionalism: The AI ​​model is trained on massive amounts of professional corpora, resulting in more professional content.

[0268] Reduced error rate: Automated processes reduce errors introduced by manual operation.

[0269] (III) User Experience Optimization

[0270] More natural and fluid interaction: The multi-turn dialogue mode conforms to user operating habits;

[0271] Visualize creation progress: Display the stage status and task progress in real time;

[0272] Improved ease of use: Features such as one-click export and automatic saving simplify user operations;

[0273] Supports multiple projects in parallel: This allows users to manage multiple document projects simultaneously, improving work efficiency.

[0274] In this embodiment, the SPEC-based AI document generation method can be applied to the creation of patent documents such as technical disclosure documents, claims, specifications, and patent search reports; technical documents such as technical solution design documents, product manuals, technical specification documents, and technical reports; academic documents such as academic papers, research reports, dissertations, and academic conference papers; and professional documents such as business plans, project proposals, market analysis reports, and feasibility study reports.

[0275] A computer program that executes the SPEC-based AI document generation method in this embodiment can be written into a computer device or storage medium. When the computer program is read out and run, the SPEC-based AI document generation method in this embodiment is executed, thereby achieving the same technical effect as the SPEC-based AI document generation method in the embodiment.

[0276] It should be noted that, unless otherwise specified, when a feature is referred to as "fixed" or "connected" to another feature, it can be directly fixed or connected to the other feature, or indirectly fixed or connected to the other feature. Furthermore, the descriptions of "upper," "lower," "left," and "right" used in this disclosure are only relative to the relative positional relationships of the components of this disclosure in the accompanying drawings. The singular forms "a," "an," and "the" used in this disclosure are also intended to include the plural forms, unless the context clearly indicates otherwise. Moreover, unless otherwise defined, all technical and scientific terms used in this embodiment have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this embodiment specification is only for describing specific embodiments and is not intended to limit the embodiments of the invention. The term "and / or" as used in this embodiment includes any combination of one or more of the associated listed items.

[0277] It should be understood that although the terms first, second, third, etc., may be used to describe various elements in this disclosure, these elements should not be limited to these terms. These terms are only used to distinguish elements of the same type from each other. For example, a first element may also be referred to as a second element without departing from the scope of this disclosure, and similarly, a second element may also be referred to as a first element. The use of any and all instances or exemplary language (“e.g.,” “such as,” etc.) provided in this embodiment is intended only to better illustrate embodiments of the invention and, unless otherwise required, does not impose a limitation on the scope of embodiments of the invention.

[0278] It should be recognized that embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium. The method can be implemented using standard programming techniques—including a non-transitory computer-readable storage medium configured with a computer program, wherein such a storage medium causes the computer to operate in a specific and predefined manner—according to the methods and drawings described in the specific embodiments. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if desired, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit (ASIC).

[0279] Furthermore, the procedures described in this embodiment can be performed in any suitable order, unless otherwise indicated by this embodiment or otherwise obviously contradictory to the context. The procedures (or variations and / or combinations thereof) described in this embodiment can be executed under the control of one or more computer systems configured with executable instructions, and can be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. A computer program includes multiple instructions executable by one or more processors.

[0280] Furthermore, the method can be implemented in any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices, etc. Aspects of embodiments of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention of this embodiment includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps above in conjunction with a microprocessor or other data processor. Embodiments of the invention also include the computer itself when programmed according to the methods and techniques of embodiments of the invention.

[0281] A computer program can be applied to input data to perform the functions of this embodiment, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including a specific visual depiction of physical and tangible objects generated on the display.

[0282] The above are merely preferred embodiments of the present invention. The embodiments of the present invention are not limited to the above-described implementations. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the embodiments of the present invention, as long as they achieve the same technical effects, should be included within the scope of protection of the embodiments of the present invention. Within the scope of protection of the embodiments of the present invention, the technical solutions and / or implementation methods can have various modifications and variations.

Claims

1. A method for generating AI-powered documents based on SPEC, characterized in that, The SPEC-based AI document generation method includes: Requirements analysis phase; during the requirements analysis phase, requirements specification documents are generated; Outline generation stage; in the outline generation stage, a detailed document outline is generated based on the requirements specification document; Task planning phase; in the task planning phase, the detailed document outline is broken down into at least one independent creative task item; Content creation stage; in the content creation stage, the main text content of the document is generated in sequence according to each creation task item.

2. The SPEC-based AI document generation method according to claim 1, characterized in that, The generation of the requirements specification document includes: Get the requirements analysis prompt template; Perform at least one round of the first interactive dialogue between the user and the artificial intelligence model; When each first text content block of the first interactive dialogue in each round of execution meets the preset conditions, the requirement specification document is generated according to each first text content block; otherwise, the next round of the first interactive dialogue is executed. In any round of the first interactive dialogue, the following steps are included: Obtain a requirement analysis prompt word template; wherein, when the first interactive dialogue is the first round, the requirement analysis prompt word template includes the requirement analysis prompt word template and the user's interactive input information in this round of the first interactive dialogue; otherwise, the requirement analysis prompt word template includes the requirement analysis prompt word template, the user's interactive input information in this round of the first interactive dialogue, and the first text content block output by the artificial intelligence model in each round of the first interactive dialogue that has been executed; The demand analysis prompt word template is input into the artificial intelligence model to obtain the first text content block corresponding to the first interactive dialogue in this round, which is output by the artificial intelligence model.

3. The SPEC-based AI document generation method according to claim 1, characterized in that, The process of generating a detailed document outline based on the requirements specification document includes: Based on the aforementioned requirements specification document, obtain the outline to generate prompt word template; Perform at least one round of a second interactive dialogue between the user and the AI ​​model; When each second text content block of the executed round of the second interactive dialogue meets the preset conditions, the detailed document outline is generated based on each second text content block; otherwise, the next round of the second interactive dialogue is executed. In any round of the second interactive dialogue, the following steps are included: Obtain an outline generation prompt word template; wherein, when the second interactive dialogue is the first round, the outline generation prompt word template includes the outline generation prompt word template and the user's interactive input information in this round of the second interactive dialogue; otherwise, the outline generation prompt word template includes the outline generation prompt word template, the user's interactive input information in this round of the second interactive dialogue, and the second text content block output by the artificial intelligence model in each round of the second interactive dialogue that has been executed; The outline-generated prompt word template is input into the artificial intelligence model to obtain the second text content block corresponding to the second interactive dialogue in this round, which is output by the artificial intelligence model.

4. The SPEC-based AI document generation method according to claim 1, characterized in that, The step of breaking down the detailed document outline into at least one independent creation task item includes: Based on the detailed document outline, obtain the task planning prompt template; Perform at least one round of third interactive dialogue between the user and the AI ​​model; When each third text content block of the executed round of the third interactive dialogue meets the preset conditions, each third text content block is used as a corresponding creation task item; otherwise, the next round of the third interactive dialogue is executed. The third interactive dialogue in any round includes the following steps: Obtain a task planning prompt word template; wherein, when the third interactive dialogue is the first round, the task planning prompt word template includes the task planning prompt word template and the user's interactive input information in this round of the third interactive dialogue; otherwise, the task planning prompt word template includes the task planning prompt word template, the user's interactive input information in this round of the third interactive dialogue, and the third text content block output by the artificial intelligence model in each round of the executed third interactive dialogue; The task planning prompt word template is input into the artificial intelligence model to obtain the third text content block corresponding to the third interactive dialogue in this round, which is output by the artificial intelligence model.

5. The SPEC-based AI document generation method according to claim 1, characterized in that, The step of generating document content in sequence according to each of the creation task items includes: Based on each of the creation tasks, obtain the content creation prompt template; Perform at least one round of the fourth interactive dialogue between the user and the AI ​​model; When each fourth text content block of the executed round of the fourth interactive dialogue meets the preset conditions, the document body content is generated according to each fourth text content block; otherwise, the next round of the fourth interactive dialogue is executed. In any round of the fourth interactive dialogue, the following steps are included: Obtain a content creation prompt word template; wherein, when the fourth interactive dialogue is the first round, the content creation prompt word template includes the content creation prompt word template and the user's interactive input information in this round of the fourth interactive dialogue; otherwise, the content creation prompt word template includes the content creation prompt word template, the user's interactive input information in this round of the fourth interactive dialogue, and the fourth text content block output by the artificial intelligence model in each round of the fourth interactive dialogue that has been executed; The content creation prompt word template is input into the artificial intelligence model to obtain the fourth text content block corresponding to the fourth interactive dialogue in this round, which is output by the artificial intelligence model.

6. The SPEC-based AI document generation method according to any one of claims 1-5, characterized in that, The SPEC-based AI document generation method also includes: Before inputting each prompt word sub-template into the artificial intelligence model, tags are added to the prompt word sub-templates to generate prompt information; each prompt word sub-template includes the requirements analysis prompt word sub-template in the requirements analysis phase, the outline generation prompt word template in the outline generation phase, the task planning prompt word template in the task planning phase, and the content creation prompt word template in the content creation phase; The AI ​​model generates AI tags for each text content block in response to the tag generation prompt information; each text content block includes a first text content block generated in the requirements analysis stage, a second text content block generated in the outline generation stage, a third text content block generated in the task planning stage, and a fourth text content block generated in the content creation stage. The text content blocks are structured and managed according to the AI ​​tags.

7. The SPEC-based AI document generation method according to claim 6, characterized in that, The step of obtaining the AI ​​tags generated by the AI ​​model in response to the tag generation prompt information for each text content block includes: In response to the tag generating prompt information, the artificial intelligence model sets stage tags and status tags for each of the first text content blocks, each of the second text content blocks and each of the third text content blocks, respectively; In response to the tag generation prompt information, the artificial intelligence model sets stage tags, status tags, content boundary tags, and task tags for each of the fourth text content blocks.

8. The SPEC-based AI document generation method according to any one of claims 1-5, characterized in that, The SPEC-based AI document generation method also includes: Get the user-editable main prompts; Input the total prompt words into the artificial intelligence model; Obtain the following prompt templates output by the artificial intelligence model: a requirements analysis prompt template for the requirements analysis phase, an outline generation prompt template for the outline generation phase, a task planning prompt template for the task planning phase, and a content creation prompt template for the content creation phase.

9. A computer device, characterized in that, It includes a memory and a processor, the memory being used to store at least one program, and the processor being used to load at least one program to execute the SPEC-based artificial intelligence document generation method according to any one of claims 1-8.

10. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to perform the SPEC-based artificial intelligence document generation method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Dialogue data generation method and system, model training method and conversation processing method

    CN117933387A

  • Method and system for generating long text

    CN118940728A

  • Document writing method, system and equipment based on large language model

    CN119026576A

  • Voice generation method and device, storage medium and program product

    CN119694293A