A method and system for interactive editing and dynamic reconstruction of a bid document based on a large language model
By employing an interactive editing and dynamic reconstruction method based on a large language model, the problems of inflexibility and inefficiency in the process of generating tender documents are solved. This method enables dynamic synchronization of the table of contents and the main text, as well as user-controllable and efficient reconstruction, thereby improving the efficiency and quality of tender document preparation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGXI FASHION TECH
- Filing Date
- 2026-03-13
- Publication Date
- 2026-06-19
AI Technical Summary
Existing technologies struggle to achieve flexible and efficient personalization during the tender document generation process, particularly in areas such as interactive editing after generation, dynamic structural adjustments, and controllable chapter-level regeneration.
An interactive editing and dynamic reconstruction method based on a large language model is adopted. The initial table of contents structure is generated by parsing the tender documents through OCR. It supports interactive editing of the table of contents by users. Combined with chapter-level prompt word binding and context-aware local regeneration, the table of contents and the main text content are dynamically synchronized in both directions.
It significantly improves the efficiency and quality of bid document preparation, enhances users' control over the generation process, ensures consistency between the table of contents and the main text content, reduces compliance risks, and enables efficient and flexible bid document reconstruction.
Smart Images

Figure CN122242470A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of bid document editing technology, specifically to a method and system for interactive editing and dynamic reconstruction of bid documents based on a large language model. Background Technology
[0002] Currently, the industry mainly adopts the following technical approaches for assisting in the generation of tender documents: (1) Document filling system based on static templates: Traditional methods often rely on preset Word or PDF templates. Users fill in structured fields such as project name, company information, and qualification number through a form interface, and the system automatically fills in the corresponding positions. Although this type of solution can improve the standardization of the format, the content is highly fixed and cannot be dynamically adjusted according to the specific requirements of the tender documents. It is especially difficult to deal with unstructured and open clauses (such as "the technical solution must reflect innovation"), resulting in generalized and untargeted generated content.
[0003] (2) Full-text one-time AI generation tool: With the development of Large Language Model (LLM), some manufacturers have tried to input the full text of the tender document into the LLM and have the model directly output the complete tender document. Although this method has a certain degree of intelligence, it has obvious defects: First, the generation process is "black box", and users cannot interfere with the intermediate logic; second, the modification cost is extremely high - if only a certain chapter needs to be adjusted (such as updating performance cases), all materials still need to be re-uploaded and the full text generated, which is inefficient and easily destroys the confirmed content; third, it lacks structured management, the table of contents is disconnected from the main text, and it is difficult to support version control and collaborative review of complex tender documents.
[0004] (3) Integration of General AI Writing Assistants: Some companies embed general AI writing tools (such as Notion AI and WPS AI) into the bidding process, allowing users to manually write in segments and then call upon AI for polishing or expansion. While this type of solution provides a certain degree of interactivity, it is not deeply customized for the bidding scenario: it lacks both the ability to semantically analyze bidding documents and a chapter-level prompt word management mechanism, and it does not support the linkage update of the directory structure and content. Users still need to take the lead in content organization throughout the process, with AI serving only as an auxiliary polishing tool, failing to achieve an efficient closed loop of "human-machine collaboration".
[0005] In summary, existing technologies generally focus on how to generate more accurate drafts, but there are significant gaps in key aspects such as interactive editing after generation, dynamic structural adjustments, and controllable regeneration at the chapter level. Users are either limited by rigid templates or trapped in an inefficient cycle of "re-running the entire document," making it difficult to achieve flexible and efficient personalized customization while ensuring document quality. This is precisely the core problem that this invention aims to solve. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for interactive editing and dynamic reconstruction of tender documents based on a large language model, comprising the following steps: Step 1: Initialize the tender document structure: The user uploads the tender document, and the system extracts the tender requirements through OCR + text parsing, calls the large language model to generate the initial directory structure. The initial directory is stored in a tree structure and each node is assigned a unique ID. The node status is set to "to be generated". Step 2: User interactive editing of the table of contents: Users can perform operations such as adding, deleting, sorting, and renaming nodes in the front-end directory tree area. All operations are synchronized to the document structure management module in real time. Step 3: Chapter content generation and prompt word binding: Users can trigger the content generation operation of a specified chapter or the entire chapter through the front-end interface, or they can open the prompt word writing pop-up to edit the prompt words for the corresponding chapter and then re-trigger the generation operation; Step 4: Content Update and Status Synchronization: After the large language model returns the generated results, the system writes the new content into the corresponding chapter container, marks the node status as "generated", and refreshes the content area in real time on the front end and highlights the "written" status of the directory node; Step 5: Exporting Bidding Documents: The system reads the structured bidding document data, generates and exports a Word document that retains the original format and hierarchical structure, and automatically adds a table of contents to the document.
[0007] Preferably, step 2 also includes optional features that support users to import catalog templates in batches, and the system automatically identifies the chapter titles in the tender documents and maps them to the catalog nodes.
[0008] Preferably, in step 2, the bidirectional dynamic synchronization between the directory structure and the main text content is achieved as follows: the system maintains a structured document model, and each node in the directory tree is mapped one-to-one with the main text content container through a unique identifier; when the user performs operations such as adding, deleting, dragging, and renaming on the directory, the system automatically creates / deletes / migrates the corresponding chapter content container and maintains the consistency of the hierarchical relationship; when adding or deleting main text content, the system updates the status of the directory node in reverse and marks it as "to be generated".
[0009] Preferably, in step 3, when the chapter content is regenerated, the system performs a context-aware local regeneration operation, specifically: automatically extracting multi-dimensional contextual information such as the parent chapter summary of the target chapter, keywords of sibling chapters at the same level, and the original text of relevant clauses in the tender document, and concatenating the contextual information with the prompt words edited by the user as additional input to the large language model.
[0010] Preferably, in step 3, each directory node is associated with an independent, explicit, user-editable prompt word. This prompt word is used to drive the large language model to generate or regenerate the corresponding chapter content, and only triggers the local regeneration of the target chapter without affecting the confirmed content of other chapters.
[0011] Preferably, the method is implemented based on a visual interactive web editing interface, adopting a two-column UI layout with a collapsible / editable directory tree on the left and a chapter content editing area on the right, to achieve a WYSIWYG structured document collaborative editing experience. Moreover, this interface is deeply coupled with the backend document model, prompt word engine, and large language model generation API.
[0012] Preferably, the file exported in step 5 can be used for text polishing. When the user selects a piece of text in the content area, a text polishing panel pops up. After entering the polishing requirements, the system calls the large language model API. The model rewrites the content based on the selected content and the user's requirements. After the user confirms, the system completes the replacement of the corresponding text.
[0013] This invention also provides an interactive editing and dynamic reconstruction system for tender documents based on a large language model, including a front-end interactive interface module, a document structure management module, a local content generation module, and a back-end service interface layer. Each module is an essential component and works collaboratively with the others. The front-end interactive interface module runs in a web browser and provides a visual directory tree, chapter content editing area, and prompt word configuration panel, supporting users to perform visual operations such as directory editing, prompt word modification, content polishing, generation triggering, and document export. The document structure management module is used to maintain the hierarchical structure model of the tender document, storing the directory tree in JSON format. Each node contains a unique ID, title, parent node ID, content status, and metadata of bound prompt words, realizing bidirectional dynamic synchronization and data storage between the directory structure and the main text content. The local content generation module is used to call the large language model API to generate or regenerate the target chapter text based on the specified chapter ID, the prompt words edited by the user, and the context information extracted by the system, supporting chapter-level local generation and fragment-level text polishing. The back-end service interface layer provides a RESTful API to realize front-end and back-end data synchronization and request response between the front-end interactive interface module, document structure management module, and local content generation module.
[0014] Preferably, the document structure is stored using a PostgreSQL database, with the directory tree node fields including {id, name, parentId, order, chapter_requirements, chapter_words, status, content}. The large language model is invoked using a workflow agent built with FastGPT, adapted to GPT-4 and domestic large models, concatenating prompts and contextual information within the context length limit. RAG retrieval functionality is integrated, vectorizing the bidding document standards and historical bid documents into blocks for use by the large language model. The system also includes optional extension modules, including a multi-version snapshot and diff comparison module, a drag-and-drop sorting UI module, and a manual rich text editing module. The multi-version snapshot and diff comparison module records the editing process of the bidding documents and supports comparison of content differences between different versions. The drag-and-drop sorting UI module optimizes the editing experience of the directory tree, allowing users to adjust the order and hierarchy of directory nodes by dragging. The manual rich text editing module allows users to perform manual rich text editing operations on font, font size, paragraph, and format in the chapter content editing area. Preferably, the front-end is a web application built on React + Ant Design, supporting modification of the directory tree order, rich text display, prompt word panel pop-ups, and text selection and polishing interaction; the back-end service adopts the Node.js + Koa framework, providing RESTful API interfaces to handle directory management, prompt word saving, and content generation requests; the intelligent agent orchestration and LLM call are integrated with the open-source platform FastGPT, constructing two types of workflows: chapter generation and fragment polishing, realizing prompt word routing, context splicing, model calling, and result parsing; the document structure storage uses a PostgreSQL database to store the complete tender document structure, prompt words for each chapter, content text, and metadata; the auxiliary integration of vector retrieval function stores the tender document in PGVector vector database after text segmentation, allowing the FastGPT workflow to retrieve relevant clauses during generation to enhance the context.
[0015] Compared with existing technologies, the beneficial effects of this invention are: by introducing core technologies such as a chapter-level editable prompt mechanism, bidirectional dynamic synchronization of table of contents and content, and context-aware local regeneration, it significantly improves the efficiency, quality, flexibility, and user experience in the tender document preparation process, specifically in the following aspects: (1) Significantly improve document preparation efficiency and reduce repetitive work. In traditional AI generation solutions, if a chapter needs to be modified (such as updating "performance of similar projects in the past three years"), the user must re-upload all materials and trigger the regeneration of the entire document, which is time-consuming and can easily overwrite confirmed content. However, this application supports independent regeneration by chapter, only calling LLM to process the target node, while the rest of the content remains unchanged, avoiding unnecessary calculations and manual review costs.
[0016] (2) Enhance users’ control and customization capabilities over the generation process. Traditional systems hide prompts in the background, making it impossible for users to understand or adjust the generation logic. This application makes the prompts explicit, visual, and editable, allowing users to modify instructions in real time according to the bidding focus (such as “emphasizing localized services” or “highlighting BIM application experience”) and obtain targeted optimization results instantly, transforming AI from a “substitute” into a “guided collaborator”.
[0017] (3) To achieve dynamic consistency between the directory structure and the main text content, thereby reducing compliance risks, the existing tools mostly display the directory statically. After users manually add or delete chapters, the content needs to be maintained synchronously, which is very easy to miss. This application ensures that the adjustment of the directory structure automatically triggers the change of the content container, and vice versa, through a unique ID mapping + two-way synchronization mechanism.
[0018] In summary, this invention does not simply apply LLM to document generation, but rather constructs an efficient, reliable, and flexible interactive reconstructing system for tender documents through systematic innovations in structure awareness, granular control, context fusion, and human-computer collaboration. Compared to the closest existing technology, this solution achieves substantial progress in five dimensions: efficiency improvement, quality assurance, user controllability, structural consistency, and collaborative security, demonstrating outstanding practical value and significant technical advantages. Attached Figure Description
[0019] Figure 1 This is a flowchart of the workflow of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0021] Example 1
[0022] System Technical Architecture Frontend: A web application built with React + Ant Design, supporting modification of directory tree order, rich text display, prompt panel pop-up, and text selection and polishing interaction; Backend services: Utilizing the Node.js + Koa framework, providing RESTful API interfaces to handle directory management, suggestion word saving, content generation requests, etc. Intelligent agent orchestration and LLM invocation: Integrating the open-source platform FastGPT to build two types of workflows: chapter generation and paragraph polishing, realizing prompt word routing, context splicing, model invocation and result parsing; Document structure storage: A PostgreSQL database is used to store the complete tender document structure, including the table of contents, chapter prompts, content text, and metadata; Vector retrieval (auxiliary): The tender documents are stored in the PGVector vector database after being segmented into text, so that the FastGPT workflow can retrieve relevant clauses during generation (only as context enhancement, not the core of this invention).
[0023] Specific steps: Step 1: Upload the tender document and initialize the document structure. The user uploads the "XX Province Wind Farm EPC Project Tender Document.docx" and fills in metadata such as the title. The front-end calls the back-end POST / tender interface, and the Node.js service stores the document address and creates basic information.
[0024] The FastGPT then invokes the pre-defined "directory generation workflow," which calls the DeepSeek-R1 model and returns a structured directory. The Node.js service then stores this directory in the PostgreSQL table tender_directory.
[0025] Step 2: User interactively adjusts the table of contents. The user right-clicks on "Chapter 1 Technical Solution" in the front-end table of contents tree, selects "Add Sub-Chapter", and enters the title "1.2 Construction Safety Assurance Measures".
[0026] The frontend sends a POST request to / tenders / :tenderId / directory, passing in information such as title and location. The Node.js service inserts a new row into the PostgreSQL tender_directory table, with the ID automatically generated by the system.
[0027] Step 3: Enter the prompt and trigger chapter generation. The user clicks on the table of contents item "1.2 Construction Safety Measures," and the page scrolls to the corresponding area. Because the prompt is empty, the prompt panel displays a blank input box. The user enters: "Based on the safety management experience of wind power projects in high-altitude areas over the past three years, write construction safety measures, including personnel training, emergency plans, and safety inspection systems, with no less than 600 words." After clicking the "Generate" button, the frontend calls ` / tenders / :tenderId / directory / contentGenerate`, carrying the following parameters: { "directoryId": "2406"} The Node.js service performs the following operations: Read the complete structure of the document containing this chapter from PostgreSQL; Call FastGPT's "Chapter Generation Workflow", pass in the complete prompt, and call LLM; Receive the generated results and update the `content` field of that section in PostgreSQL; Return the new content to the front end for real-time rendering.
[0028] Step 4: Select the text and perform paragraph-level polishing (enhanced function). The user reads the generated content and selects the sentence: "We will conduct safety training." The "AI Polishing" input box pops up. Enter the instruction: "Change to 'Regularly organize safety training for all employees and keep records', to make the tone more formal." The front-end calls ` / contentEmbellish` with the following parameters: selectedText: “We will conduct security training.” Instruction: "Change to 'Organize regular safety training for all employees and keep records,' in a more formal tone." sectionId: “2406” The Node.js service calls FastGPT's "text polishing workflow". After the LLM returns the polishing results, the system only replaces the selected part, leaving the rest of the content unchanged, and updates the content of that section in PostgreSQL.
[0029] Step 5: Export the final document After completing all editing, the user clicks "Export Word".
[0030] The Node.js service reads the complete structure from PostgreSQL, generates .docx files by chapter level (using the pandoc library), preserves heading styles and paragraph structure, and downloads them to the local machine.
[0031] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method and system for interactive editing and dynamic reconstruction of tender documents based on a large language model, characterized in that: Includes the following steps: Step 1: Initialize the tender document structure: The user uploads the tender document, the system extracts the tender requirements through OCR + text parsing, calls the large language model to generate the initial directory structure, the initial directory is stored in a tree structure and each node is assigned a unique ID, and the node status is set to "to be generated"; Step 2: User interactive editing of the table of contents: Users can perform operations such as adding, deleting, sorting, and renaming nodes in the front-end directory tree area. All operations are synchronized to the document structure management module in real time. Step 3: Chapter content generation and prompt word binding: Users can trigger the content generation operation of a specified chapter or the entire chapter through the front-end interface, or they can open the prompt word writing pop-up to edit the prompt words for the corresponding chapter and then re-trigger the generation operation; Step 4: Content Update and Status Synchronization: After the large language model returns the generated results, the system writes the new content into the corresponding chapter container, marks the node status as "generated", and refreshes the content area in real time on the front end and highlights the "written" status of the directory node; Step 5: Exporting Bidding Documents: The system reads the structured bidding document data, generates and exports a Word document that retains the original format and hierarchical structure, and automatically adds a table of contents to the document.
2. The interactive editing and dynamic reconstruction method for tender documents based on a large language model according to claim 1, characterized in that: Step 2 also includes optional features that allow users to import catalog templates in batches, and the system automatically identifies chapter titles in the tender documents and maps them to catalog nodes.
3. The interactive editing and dynamic reconstruction method for tender documents based on a large language model according to claim 1, characterized in that: In step 2, bidirectional dynamic synchronization between the directory structure and the main text content is achieved. Specifically, the system maintains a structured document model, and each node in the directory tree is mapped one-to-one with the main text content container through a unique identifier. When the user performs operations such as adding, deleting, dragging, or renaming the directory, the system automatically creates / deletes / migrates the corresponding chapter content container and maintains the consistency of the hierarchical relationship. When adding or deleting main text content, the system updates the status of the directory node in reverse and marks it as "to be generated".
4. The interactive editing and dynamic reconstruction method for tender documents based on a large language model according to claim 1, characterized in that: In step 3, when the chapter content is regenerated, the system performs a context-aware local regeneration operation, which specifically involves: automatically extracting multi-dimensional contextual information such as the parent chapter summary of the target chapter, keywords of sibling chapters at the same level, and the original text of relevant clauses in the tender document, and concatenating the contextual information with the prompt words edited by the user as additional input to the large language model.
5. The interactive editing and dynamic reconstruction method for tender documents based on a large language model according to claim 1, characterized in that: In step 3, each directory node is associated with an independent, explicit, and user-editable prompt word. This prompt word is used to drive the large language model to generate or regenerate the corresponding chapter content, and only triggers the local regeneration of the target chapter without affecting the confirmed content of other chapters.
6. The interactive editing and dynamic reconstruction method for tender documents based on a large language model according to claim 1, characterized in that: The method is implemented based on a visual interactive web editing interface, which adopts a two-column UI layout with a collapsible / editable directory tree on the left and a chapter content editing area on the right. This enables a WYSIWYG structured document collaborative editing experience, and the interface is deeply coupled with the backend document model, prompt word engine, and large language model generation API.
7. The interactive editing and dynamic reconstruction method for tender documents based on a large language model according to claim 1, characterized in that: The exported file in step 5 can be edited. When the user selects a section of text in the content area, a text editing panel will pop up. After entering the editing requirements, the system will call the large language model API. The model will rewrite the content based on the selected content and the user's requirements. After the user confirms, the system will complete the replacement of the corresponding text.
8. A system for interactive editing and dynamic reconstruction of tender documents based on a large language model according to any one of claims 1-7, characterized in that: The system comprises a front-end interactive interface module, a document structure management module, a partial content generation module, and a back-end service interface layer. Each module is an essential component and works collaboratively with the others. The front-end interactive interface module runs in a web browser and provides a visual directory tree, chapter content editing area, and prompt word configuration panel, supporting users to perform visual operations such as directory editing, prompt word modification, content polishing, generation triggering, and document export. The document structure management module maintains the hierarchical structure model of the bidding document, storing the directory tree in JSON format. Each node contains a unique ID, title, parent node ID, content status, and metadata of bound prompt words, achieving bidirectional dynamic synchronization and data storage between the directory structure and the main text content. The partial content generation module calls the large language model API to generate or regenerate the target chapter text based on the specified chapter ID, user-edited prompt words, and system-extracted context information, supporting chapter-level partial generation and fragment-level text polishing. The back-end service interface layer provides a RESTful API for front-end and back-end data synchronization and request / response between the front-end interactive interface module, document structure management module, and partial content generation module.
9. The interactive editing and dynamic reconstruction system for tender documents based on a large language model according to claim 8, characterized in that: The document structure is stored using a PostgreSQL database, with directory tree node fields including {id, name, parentId, order, chapter_requirements, chapter_words, status, content}. The large language model is invoked using a workflow agent built with FastGPT, adapted to GPT-4 and domestic large models, concatenating prompts and contextual information within context length limits. RAG retrieval functionality is integrated, vectorizing bidding document standards and historical bid documents into blocks for use by the large language model. The system also includes optional extension modules, including a multi-version snapshot and diff comparison module, a drag-and-drop sorting UI module, and a manual rich text editing module. The multi-version snapshot and diff comparison module records version changes in the bidding document editing process and supports comparison of content differences between different versions. The drag-and-drop sorting UI module optimizes the directory tree editing experience, allowing users to adjust the order and hierarchy of directory nodes via dragging. The manual rich text editing module allows users to perform manual rich text editing operations on font, font size, paragraphs, and formatting in the chapter content editing area.
10. The interactive editing and dynamic reconstruction system for tender documents based on a large language model according to claim 1, characterized in that: The front-end is a web application built on React + Ant Design, supporting directory tree order modification, rich text display, prompt word panel pop-up, and text selection and polishing interaction; the back-end service uses the Node.js + Koa framework, providing RESTful API interfaces to handle directory management, prompt word saving, and content generation requests. The intelligent agent orchestration and LLM call are integrated with the open-source platform FastGPT, constructing two types of workflows: chapter generation and paragraph polishing, realizing prompt word routing, context splicing, model calling, and result parsing; the document structure storage uses a PostgreSQL database to store the complete tender document structure, prompt words for each chapter, content text, and metadata; the auxiliary integration of vector retrieval function stores the tender document in PGVector vector database after text segmentation, allowing the FastGPT workflow to retrieve relevant clauses during generation to enhance the context.