Document generation method and device, electronic equipment and storage medium

By using a document generation task chain planned based on document generation intent, and leveraging CoT technology and the Transformer model, the problems of insufficient planning capabilities and large model limitations in existing long document generation schemes are solved, achieving efficient and accurate document generation.

CN120995993APending Publication Date: 2025-11-21BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511129373.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-12
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing long text generation solutions suffer from planning deficiencies, failing to flexibly plan multiple document generation subtasks. This results in a low match between the target long text and the document generation intent. Furthermore, large models are severely limited by context windows and suffer from illusion problems in long text generation, leading to insufficient generation efficiency and accuracy.

Method used

The first major model is used for step-by-step logical reasoning. Based on the document generation intent, the document generation task chain is planned. Using CoT technology and the autoregressive generation model of the Transformer architecture, combined with intent parsing and execution subject identification, a highly matched document generation task chain is generated, reducing manual intervention and improving generation efficiency.

Benefits of technology

It achieves a high degree of matching between the target document and the document generation intent, reduces manual intervention, improves generation efficiency, avoids information loss and logical breaks, reduces illusion problems, and ensures the accuracy and consistency of document generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120995993A_ABST
    Figure CN120995993A_ABST
Patent Text Reader

Abstract

The invention provides a document generation method and device, electronic equipment and a storage medium, and relates to the technical field of computers, in particular to the technical fields of artificial intelligence, deep learning, large models, natural language processing and the like. The specific implementation scheme comprises the steps of obtaining a document generation intention of a target user; using the first large model to plan a document generation task based on the document generation intention to obtain a document generation task chain; and executing the document generation task chain to obtain a target document. By adopting the method, the matching degree of the target document and the document generation intention can be improved, and meanwhile, the generation efficiency of the target document is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, in particular to the technical field of artificial intelligence, deep learning, large model, natural language processing and the like, and specifically relates to a document generation method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the deep application of artificial intelligence in the fields of news, education, business and the like, the demand for document generation based on artificial intelligence is also rising exponentially. From real-time news compilation to online course design, from business report speed-up to academic literature creation, artificial intelligence is reshaping the document output process in various fields with its relatively efficient content generation capability. SUMMARY

[0003] The present disclosure provides a document generation method, device, electronic equipment and storage medium.

[0004] According to a first aspect of the present disclosure, a document generation method is provided, comprising:

[0005] obtaining a document generation intention of a target user;

[0006] planning a document generation task based on the document generation intention by using a first large model to obtain a document generation task chain;

[0007] executing the document generation task chain to obtain a target document.

[0008] According to a second aspect of the present disclosure, a document generation device is provided, comprising:

[0009] an intention obtaining unit configured to obtain a document generation intention of a target user;

[0010] a task planning unit configured to plan a document generation task based on the document generation intention by using a first large model to obtain a document generation task chain;

[0011] a document generation unit configured to execute the document generation task chain to obtain a target document.

[0012] According to a third aspect of the present disclosure, an electronic equipment is provided, comprising:

[0013] at least one processor;

[0014] a memory in communication connection with the at least one processor;

[0015] wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method provided in the first aspect of the present disclosure.

[0016] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided; wherein the computer instructions are used to make a computer execute the method provided in the first aspect of the present disclosure.

[0017] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program; wherein the computer program, when executed by a processor, can implement the method provided in the first aspect of the present disclosure.

[0018] The present disclosure can improve the matching degree of the target document and the document generation intention, and improve the generation efficiency of the target document.

[0019] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings are used to better understand the present scheme, and do not constitute a limitation on the present disclosure. Among them:

[0021] Figure 1 A flowchart of a document generation method provided by an embodiment of the present disclosure is shown in the figure;

[0022] Figure 2 An architecture diagram of a document generation system provided by an embodiment of the present disclosure is shown in the figure;

[0023] Figure 3 An example explanatory diagram of a document generation method provided by an embodiment of the present disclosure is shown in the figure;

[0024] Figure 4 An example explanatory diagram of a document generation method provided by an embodiment of the present disclosure is shown in the figure;

[0025] Figure 5 An application scenario diagram of a document generation method provided by an embodiment of the present disclosure is shown in the figure;

[0026] Figure 6 A schematic structural block diagram of a document generation apparatus provided by an embodiment of the present disclosure is shown in the figure;

[0027] Figure 7 A schematic structural block diagram of an electronic device provided by an embodiment of the present disclosure is shown in the figure. DETAILED DESCRIPTION

[0028] Exemplary embodiments of the present disclosure are described herein below with reference to the accompanying drawings, in which various details are set forth to facilitate an understanding of the present disclosure. It should be appreciated that various embodiments of the present disclosure can be practiced with variations of these details as would be obvious to one of ordinary skill in the art, and the scope of the present disclosure is not limited to the details as described. For clarity and conciseness, descriptions of well-known functions and constructions are omitted from the following description.

[0029] As described in the background, with the deep application of artificial intelligence in the fields of news, education, business, etc., the demand for document generation based on artificial intelligence is also rising exponentially. From real-time news compilation to online course design, from business report speed-up to academic literature creation, artificial intelligence is reshaping the document output process in various fields with its relatively efficient content generation capability. Among them, the document generation demand can include long text generation demand, and for long text generation demand, the following long text generation schemes are mainly provided in the prior art:

[0030] A fixed document generation workflow is obtained. The document generation workflow can include multiple document generation sub-tasks, such as outline generation tasks, outline decomposition tasks, chapter content filling tasks, content assembly tasks, etc.

[0031] When performing the outline generation task, the long text generation system guides the user to plan the long text outline in an intuitive and friendly interface. For example, the user plans to write a long text about "the application of artificial intelligence in the medical field", and the long text generation system prompts the user to think about several key aspects that may be involved under this topic, which can include "the application of artificial intelligence in disease diagnosis, treatment plan formulation, medical image analysis, etc.", and guides the user to plan these aspects as long text chapters to obtain a long text outline.

[0032] After the user confirms and submits the planned long text outline, the long text generation system starts the outline decomposition task. The background of the long text generation system has a set of preset outline decomposition rules for decomposing each chapter in the long text outline. For example, for the chapter "Application of Artificial Intelligence in Disease Diagnosis", the background of the long text generation system can decompose it into sub-chapters such as "Principle of Artificial Intelligence Diagnosis Technology", "Clinical Application Case Analysis", "Advantages and Limitations", etc., and perform corresponding chapter content filling tasks for each chapter. Specifically, the long text generation system can call the same large model to perform each chapter content filling task to obtain the corresponding content generation result.

[0033] Finally, the content assembly task is performed using the large model, that is, the content generation results are assembled to generate the target long text.

[0034] However, the inventors have found that the existing long text generation scheme, although having a certain level of automation and being able to provide relatively efficient content generation capability, still has the following problems:

[0035] (1) There is a planning capability defect.

[0036] Although the existing long text generation scheme can provide outline generation, outline decomposition, chapter content filling and other functions, it still essentially belongs to a fixed document generation workflow driven by a linear process. Specifically, the existing long text generation scheme does not have flexible task planning capability, that is, it cannot flexibly plan multiple document generation sub-tasks based on the user's document generation intent, and cannot ensure high matching degree of the target long text and the document generation intent. Moreover, due to the planning capability defect, more human intervention costs need to be invested in the implementation process of the existing long text generation scheme. Specifically, an average of 4.2 times of human intervention is needed to complete the generation of a target long text of 10,000 words. This "pseudo-automation" operation mode will lead to a decrease in the generation efficiency of the target long text.

[0037] (2) The direct output of the target long text by the large model will face fundamental technical constraints. Specifically, the traditional large model architecture will be limited by the context window.

[0038] For large models, the maximum input length is about 4096 tokens, and the excess part needs to be truncated or segmented, which will cause information loss and logical breakage. Moreover, experimental data shows that when the input length of the large model exceeds 8000 tokens, the retention rate of key input information is less than 40%. More seriously, the large model has "lazy generation", that is, it tends to generate repetitive and templated content in long text scenarios. According to academic evaluation sets, more than 70% of large models will have similar chapter structure problems when generating a target long text of 10,000 words.

[0039] (3) Large model illusion problem.

[0040] The large model is essentially a probabilistic prediction system, and the "seemingly reasonable" content generated by it may have factual errors. This technical characteristic is particularly prominent in the long text generation scenario. According to relevant technical review tests, the mainstream large model generates 2.3 factual errors per thousand words when generating long texts of more than 3000 words. More dangerously, in the absence of data sources, the large model may also cover up errors by fabricating references and data sources, forming "systematic illusion".

[0041] To solve at least part of the above problems, the embodiments of the present disclosure provide a document generation method, which can be applied to an electronic device. The electronic device can be a terminal device capable of communicating with a server. Here, the terminal device can be a workbench, a large computer, a general computer (e.g., a desktop computer), or other similar computing devices. In the following, the document generation method provided by the embodiments of the present disclosure will be described in conjunction with the flowchart shown in FIG. 1. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described in the flowchart can also be performed in other orders. Figure 1

[0042] In step S101, a document generation intention of a target user is obtained.

[0043] The document generation intention can be used to represent the core requirements and constraint conditions of the target user for the target document to be generated.

[0044] In the embodiments of the present disclosure, the target document can be a long document with a large number of characters, and the document type can be a technical document, an academic paper, a general research report, an industry report, an analysis report, a financial report, an official document, etc. It can also be a long document such as a contract or an agreement. The core requirements can be used to indicate the document theme, the document type, the document reference content, etc. The constraint conditions can include style preferences, related parameter values (e.g., total number of document words, text style, image resolution, etc.), etc.

[0045] For example, the document generation intention can be: please help generate an analysis report based on the document reference content of “certain document” with “certain theme” as the document theme. This document generation intention can also include some constraint conditions.

[0046] In step S102, a first large model is used to plan a document generation task based on the document generation intention, and a document generation task chain is obtained.

[0047] The first large model can be a first large language model (LLM) capable of applying Chain of Thought (CoT) technology for step-by-step logical reasoning, and the first LLM can be a pre-trained neural network model (e.g., a Transformer architecture autoregressive generation model) with general language knowledge, world knowledge, and professional knowledge in various fields (e.g., professional knowledge in the field of computer technology).

[0048] ​In addition, in the embodiment of the present disclosure, the document generation task chain can include a document generation subtask, specifically can include at least one document generation subtask, and the at least one document generation subtask can include at least one of a network search task, an outline generation task, an outline disassembly task, a concurrent content generation task, an abstract generation task, an outline simplification task, a content insertion position determination task, a chart generation task, a figure generation task, a content assembly task, etc., which can be specifically determined by the first large model based on the document generation intent, and the embodiment of the present disclosure does not limit this.

[0049] In step S103, the document generation task chain is executed to obtain the target document.

[0050] The document generation method provided by the embodiment of the present disclosure can intelligently and flexibly plan the document generation task chain based on the document generation intent by using the first large model after obtaining the document generation intent of the target user, that is, the document generation task chain is highly matched with the document generation intent, rather than directly using a fixed document generation workflow regardless of the document generation intent as in the prior art. In this way, after the document generation task chain is executed to obtain the target document, the matching degree of the target document and the document generation intent can be improved. Moreover, during the execution of the document generation method, basically no human participation cost is required, and the "true automation" operation of document generation can be realized, thereby improving the generation efficiency of the target document.

[0051] In some optional embodiments, after step S101 is executed, that is, the document generation intent of the target user is obtained, the document generation method can further include:

[0052] The document generation intent is parsed to obtain an intent analysis result.

[0053] In an example, when the document generation intent is parsed to obtain the intent analysis result, at least one candidate reference content can be obtained based on the document reference content when the document generation intent includes the document reference content, and at least one candidate constraint condition can be obtained based on the constraint meaning representation when the document generation intent includes the constraint meaning representation. That is, in the embodiment of the present disclosure, when the document generation intent includes the document reference content and the constraint meaning representation, the intent analysis result including the at least one candidate reference content and the at least one candidate constraint condition can be generated.

[0054] The document reference content can include at least one of pure document content, chart content (for example, line chart, column chart, pie chart, scatter plot, etc.), and image content. Here, the format of the pure document content can be a word processing software (Word) format, a portable document format (PDF), a mark language (Markdown) format, etc.; the format of the chart content can be a word processing software format, a worksheet (Excel) format, a joint photographic experts group (JPEG) format, a portable network graphics (PNG) format, a graphics interchange format (GIF), a scalable vector graphics (SVG) format, etc.; and the format of the image content can be a JPEG format, a PNG format, a GIF, an SVG format, etc.

[0055] In an example, in a case where the document generation intent includes the document reference content, the document reference content can be disassembled and / or summarized by using a reference content processing tool to obtain at least one candidate reference content. The reference content processing tool can be a second LLM capable of processing a quick reasoning task, and specifically can be a second LLM trained to have the ability to disassemble and summarize the document reference content; the candidate reference content can be a document content summary result obtained by disassembling and / or summarizing the pure document content included in the document reference content, or can be the chart content and / or image content included in the document reference content.

[0056] Further, in the embodiments of the present disclosure, the constraint intention can be used to represent the constraint condition of the target user on the target document to be generated. Based on this, in a case where the document generation intent includes the constraint intention by using the intent recognition tool, the keyword extraction and semantic analysis technology can be applied to disassemble and clarify the constraint intention to obtain at least one candidate constraint condition. The intent recognition tool can be a second LLM, and specifically can be a second LLM trained to have the ability to disassemble and clarify the constraint intention; and the candidate constraint condition can include a style preference, a related parameter value, etc.

[0057] In addition, it should be noted that in the embodiments of the present disclosure, the intention recognition tool can also generate an intention based on the document, and determine a document theme and a document type of the target document to be generated. Based on this, in the embodiments of the present disclosure, when generating the intention analysis result including at least one candidate reference content and at least one candidate constraint condition, the intention analysis result including the document theme, the document type, the at least one candidate reference content and the at least one candidate constraint condition can be generated.

[0058] In the above manner, in the embodiments of the present disclosure, at least one candidate reference content can be obtained based on the document reference content when the document generation intention includes the document reference content, and at least one candidate constraint condition can be obtained based on the constraint intention representation when the document generation intention includes the constraint intention representation, that is, the intention analysis result including at least one candidate reference content and at least one candidate constraint condition can be generated when the document generation intention includes the document reference content and the constraint intention representation. In this process, the document reference content is disassembled into at least one candidate reference content so as to be able to more accurately capture the key information in the document reference content, thereby improving the accuracy of the intention analysis result and further improving the matching degree between the target document and the document generation intention; at the same time, the constraint intention representation is converted into at least one candidate constraint condition, which can further clarify the specific requirements of the target user for the target document to be generated, so as to further improve the matching degree between the target document and the document generation intention after the target document is generated.

[0059] Based on the above, it can be understood that in the embodiments of the present disclosure, when step S102, that is, "planning a document generation task based on the document generation intention by using the first large model to obtain a document generation task chain", is performed, the first large model can be used to plan the document generation task based on the intention analysis result to obtain the document generation task chain.

[0060] In addition, as described above, in the embodiments of the present disclosure, the document generation task chain can include a document generation subtask. Based on this, in some optional embodiments, after step S102, that is, "planning a document generation task based on the document generation intention by using the first large model to obtain a document generation task chain", is performed, the document generation method can further include:

[0061] determining an execution subject identifier corresponding to the document generation subtask by using the first large model, and generating an execution strategy for the document generation subtask based on the execution subject identifier.

[0062] In the embodiments of the present disclosure, when the first large model is used to determine the execution subject identifier corresponding to the document generation subtask, the first large model can be used to determine the candidate execution subject identifier corresponding to the document generation subtask from the plurality of candidate execution subject identifiers as the execution subject identifier corresponding to the document generation subtask, which can be a subject name, a subject number, etc.

[0063] The plurality of candidate execution subject identifiers can correspond to the plurality of candidate execution subjects one by one, and the plurality of candidate execution subjects can include a network search tool (for example, a search engine, a network encyclopedia, etc.), an outline generation tool, an outline disassembly tool, a concurrent content generation tool, an abstract generation tool, an outline simplification tool, a content insertion position determination tool, a chart generation tool, a figure generation tool, a content assembly tool (for example, a layout engine), etc.

[0064] Among these candidate execution subjects, a part of the candidate execution subjects can be a mature network tool in the computer technology field, for example, a network search tool; another part of the candidate execution subjects can be an artificial intelligence tool obtained by training a target large model with corresponding vertical ability, for example, an outline generation tool, a concurrent content generation tool, an abstract generation tool, etc. The target large model can be the first large model, the second large model, or a lightweight large model other than the first large model and the second large model, and can also be an intelligent agent composed of a plurality of neural network models, and the embodiments of the present disclosure do not limit this. For example, for the outline generation tool, it can be an artificial intelligence tool with an outline generation capability obtained by training the first large model with an outline generation capability; for example, for the outline disassembly tool, it can be an artificial intelligence tool with an outline disassembly capability obtained by training the second large model with an outline disassembly capability; for example, for the outline simplification tool, it can be an artificial intelligence tool with an outline simplification capability obtained by training a lightweight large model with an outline simplification capability.

[0065] In the embodiments of the present disclosure, after the first large model is used to determine the execution subject identifier corresponding to the document generation subtask, the first large model can be used to generate an execution strategy for the document generation subtask based on the execution subject identifier, to guide the execution of the document generation subtask.

[0066] By the above manner, in the embodiments of the present disclosure, after the document generation task chain is obtained by utilizing the first large model to generate the intent based on the document and to plan the document generation task, the first large model is utilized to determine the execution subject identifier corresponding to the document generation subtask, and the execution strategy for the document generation subtask is generated based on the execution subject identifier. The execution strategy for the document generation subtask is generated based on the execution subject identifier corresponding to the document generation subtask, and the execution subject identifier corresponding to the document generation subtask can accurately locate the candidate execution subject corresponding to the document generation subtask, so that the candidate execution subject corresponding to the document generation subtask can be utilized to more focusedly and reliably execute the document generation subtask subsequently. Compared with the scheme in the prior art in which all document generation subtasks call the same large model for execution, the accuracy of the execution result of the document generation subtask can be improved.

[0067] Further, in the embodiments of the present disclosure, when the execution strategy for the document generation subtask is generated based on the execution subject identifier, if the subtask constraint condition related to the document generation subtask is included in the intent analysis result, the execution reference data is generated based on the subtask constraint condition (for example, the execution reference data including the subtask constraint condition is generated), and the execution strategy for the document generation subtask is generated based on the execution subject identifier and the execution reference data.

[0068] The subtask constraint condition is contained in at least one candidate constraint condition, that is, the subtask constraint condition can be obtained by analyzing the constraint meaning representation in the document generation intent, which can further clarify the specific demand of the target user for the target document to be generated, so that the matching degree between the target document and the document generation intent can be further improved after the target document is generated.

[0069] In the embodiments of the present disclosure, when the execution strategy for the document generation subtask is generated based on the execution subject identifier, if the subtask constraint condition related to the document generation subtask is not included in the intent analysis result, the document type of the target document to be generated is determined based on the intent analysis result, the supplementary constraint condition is obtained based on the document type of the target document, and the execution reference data is generated based on the supplementary constraint condition (for example, the execution reference data including the supplementary constraint condition is generated), so as to generate the execution strategy for the document generation subtask based on the execution subject identifier and the execution reference data.

[0070] The supplementary constraint condition can include style preference, related parameter value, etc.

[0071] In an example, after the document type of the target document to be generated is determined, the reasonable constraint condition corresponding to the document type of the target document can be determined as the supplementary constraint condition based on a preset corresponding relationship.

[0072] By the above manner, in the embodiment of the present disclosure, preferably, in the case that the intention analysis result includes the subtask constraint condition related to the document generation subtask, the execution reference data can be generated based on the subtask constraint condition; secondly, in the case that the intention analysis result does not include the subtask constraint condition related to the document generation subtask, the document type of the target document to be generated can be determined based on the intention analysis result, the supplementary constraint condition can be obtained based on the document type of the target document, and the execution reference data can be generated based on the supplementary constraint condition. In this way, not only the subtask constraint condition can be added in the execution reference data in the case that the intention analysis result includes the subtask constraint condition related to the document generation subtask, so as to further improve the matching degree between the execution result of the document generation subtask and the document generation intention; but also the reasonable constraint condition corresponding to the document type of the target document can be obtained as the supplementary constraint condition in the case that the intention analysis result does not include the subtask constraint condition related to the document generation subtask, so as to add the supplementary constraint condition in the execution reference data, to rationalize the execution reference data and ensure the smooth execution of the document generation subtask.

[0073] Further, in the embodiment of the present disclosure, when the execution strategy for the document generation subtask is generated based on the execution subject identifier and the execution reference data, in the case that the intention analysis result includes the subtask reference content related to the document generation subtask, the execution reference data can be updated based on the subtask reference content to obtain updated execution reference data, and the execution strategy for the document generation subtask can be generated based on the execution subject identifier and the updated execution reference data.

[0074] The subtask reference content is contained in the at least one candidate reference content, that is, the subtask reference content can be obtained by analyzing the document reference content in the document generation intention. In this way, on the one hand, the key information in the document reference content can be more accurately captured, so as to improve the accuracy of the intention analysis result and further improve the matching degree between the target document and the document generation intention; on the other hand, the input data amount of the target execution subject corresponding to the document generation subtask can be simplified, so as to avoid the loss of important data and improve the reliability of the execution result of the document generation subtask.

[0075] By the above manner, in the embodiment of the disclosure, in the case that the intention analysis result includes the subtask reference content related to the document generation subtask, the execution reference data can be updated based on the subtask reference content to obtain the updated execution reference data. In this way, in the case that the intention analysis result includes the subtask reference content related to the document generation subtask, the subtask reference content can be added in the execution reference data to further improve the matching degree between the execution result of the document generation subtask and the document generation intention.

[0076] In some optional embodiments, after determining the execution subject identifier corresponding to the document generation subtask by using the first large model and generating the execution strategy for the document generation subtask based on the execution subject identifier, in the execution step S103, that is, "executing the document generation task chain to obtain the target document", the following can be performed:

[0077] executing the document generation subtask according to the execution strategy for the document generation subtask to obtain the execution result of the document generation subtask;

[0078] obtaining the target document based on the execution result of the document generation subtask.

[0079] In an example, "executing the document generation subtask according to the execution strategy for the document generation subtask to obtain the execution result of the document generation subtask" can include:

[0080] determining, by using a model context protocol (MCP), a target execution subject corresponding to the document generation subtask from a plurality of candidate execution subjects based on the execution subject identifier included in the execution strategy;

[0081] executing the document generation subtask by using the target execution subject to obtain the execution result of the document generation subtask.

[0082] That is, in the embodiment of the disclosure, the MCP can be used to determine the target execution subject corresponding to the document generation subtask from the plurality of candidate execution subjects based on the execution subject identifier included in the execution strategy, and the target execution subject can be called to execute the document generation subtask by using the target execution subject to obtain the execution result of the document generation subtask.

[0083] Further, it should be noted that, in the embodiments of the present disclosure, only when the target execution subject belongs to the client subject (i.e., the execution subject stored in the electronic device) can the document generation subtask be executed by using the target execution subject on the client side to obtain the execution result of the document generation subtask; when the target execution subject belongs to the server subject (i.e., the execution subject stored in the server), a task execution request carrying the document generation subtask needs to be sent to the target execution subject, so that the document generation subtask is executed by using the target execution subject on the server side to obtain the execution result of the document generation subtask, and the execution result of the document generation subtask sent by the server is received.

[0084] In the embodiments of the present disclosure, the MCP can be used to determine the target execution subject corresponding to the document generation subtask from the plurality of candidate execution subjects based on the execution subject identifier included in the execution strategy, and the document generation subtask is executed by using the target execution subject to obtain the execution result of the document generation subtask. In this process, on the one hand, the target execution subject most suitable for completing the document generation subtask can be accurately located, and the document generation subtask is executed by using the target execution subject to obtain the execution result of the document generation subtask, thereby improving the accuracy of the execution result of the document generation subtask; on the other hand, in the process of obtaining the execution result of the document generation subtask, the necessary communication interaction can be implemented based on the MCP, which can reduce the waiting and adaptation time in the communication interaction process, thereby improving the execution efficiency of the document generation subtask.

[0085] Further, in the embodiments of the present disclosure, when the document generation subtask is executed by using the target execution subject to obtain the execution result of the document generation subtask, the target execution subject can be used to execute the document generation subtask based on the execution reference data included in the execution strategy to obtain the execution result of the document generation subtask.

[0086] The execution reference data can include a sub-constraint condition or a supplementary constraint condition to provide style preferences, related parameter values, etc., and the execution reference data can also include subtask reference content.

[0087] In the embodiments of the present disclosure, the execution result of the document generation subtask can be ensured to be highly related to the execution reference data, that is, the matching degree of the execution result of the document generation subtask and the document generation intent can be improved, so as to further improve the matching degree of the target document and the document generation intent.

[0088] In the embodiments of the present disclosure, when the target execution subject is used to execute the document generation subtask to obtain the execution result of the document generation subtask, the MCP can be used to call a network search tool from a plurality of candidate execution subjects in the case that the document generation subtask has a network requirement, and the network search tool is used to obtain a network search result. Then, the target execution subject is used to execute the document generation subtask based on the network search result to obtain the execution result of the document generation subtask.

[0089] In an example, the document generation subtask can be determined to have a network requirement in the case that the execution of the document generation subtask needs to rely on extensive and scattered data sources or data sources in a specific field.

[0090] In the embodiments of the present disclosure, the network search result obtained by real-time retrieval can be used as a more reliable reference data source for the target execution subject to obtain the execution result of the document generation subtask, so as to alleviate the large model illusion problem of the target execution subject, thereby improving the accuracy of the execution result of the document generation subtask.

[0091] In addition, as described above, the document generation task chain can include at least one document generation subtask in the embodiments of the present disclosure. Based on this, in the embodiments of the present disclosure, when the document generation task chain includes a plurality of document generation subtasks with an execution order, the "obtaining the target document based on the execution result of the document generation subtask" can be that the execution result of the document generation subtask at the end of the execution order in the document generation task chain is taken as the target document. In this way, the acquisition process of the target document can be simplified, and problems such as content repetition and logical contradiction in the target document can be avoided, so as to improve the overall consistency and overall coherence of the target document.

[0092] More specifically, in the embodiments of the present disclosure, when the document generation task chain includes a plurality of document generation sub-tasks with an execution order, for each document generation sub-task, when the document generation sub-task is not the document generation sub-task at the end of the execution order in the document generation task chain, after obtaining the execution result of the document generation sub-task, the other document generation sub-tasks after the document generation sub-task in the execution order can be continued to be executed based on the execution result of the document generation sub-task until all the document generation sub-tasks in the document generation task chain are completed, and the execution result of the document generation sub-task at the end of the execution order in the document generation task chain is taken as the target document. In this process, the assembly of the execution result can also be involved, for example, for a certain document generation sub-task, in the document generation task chain, there are a plurality of other document generation sub-tasks with an execution order adjacent to and before the document generation sub-task, then the document generation sub-task can be taken as a content assembly task, and when the content assembly task is executed, the execution results of the plurality of other document generation sub-tasks need to be relied on, for example, the execution results of the plurality of other document generation sub-tasks need to be assembled to obtain the execution result of the document generation sub-task.

[0093] In some optional embodiments, the document generation method can further include:

[0094] reflecting on the target document by using the first large model to obtain a reflection result;

[0095] In the case that the reflection result represents that the target document has non-compliant document content, determining a target sub-task corresponding to the non-compliant document content from the plurality of document generation sub-tasks;

[0096] updating the non-compliant document content by executing the target sub-task to obtain replacement document content;

[0097] assembling the compliant document content and the replacement document content by using the second large model to obtain a new target document.

[0098] In an example, the first large model can be used to reflect on the target document from a plurality of reflection dimensions to obtain a reflection result.

[0099] The plurality of reflection dimensions can include outline reasonableness, consistency and coherence of internal text content (including a plurality of chapter contents) in the target document, matching degree of internal chart content in the target document and context document content, matching degree of internal image content in the target document and context document content, and the like. Moreover, in the reflection process, for each reflection dimension, a document generation subtask related to the reflection dimension can be determined from a plurality of document generation subtasks as an associated subtask of the reflection dimension, and a reference reflection order corresponding to the reflection dimension is determined according to the execution order of the associated subtask in the plurality of document generation subtasks, to ensure effective execution of the reflection work. For example, for the reflection dimension of outline reasonableness, the corresponding document generation task is the outline generation task, which is a relatively early document generation subtask. For the reflection dimension of consistency and coherence of internal text content in the target document, the corresponding document generation task is the concurrent content generation task, which is a relatively late document generation subtask compared to the outline generation task. Therefore, reflection can be performed from the reflection dimension of outline reasonableness first, and then from the reflection dimension of consistency and coherence of internal text content in the target document.

[0100] After obtaining the reflection result, if the reflection result indicates that the target document has substandard document content, a target subtask corresponding to the substandard document content can be determined from the plurality of document generation subtasks. For example, if the reflection result indicates that the outline reasonableness does not meet the standard requirement, the entire target document can be regarded as substandard document content, and all document generation subtasks after the outline generation task in the execution order can be determined as target subtasks from the plurality of document generation subtasks. For another example, if the reflection result indicates that the matching degree of internal chart content in the target document and context document content does not meet the standard requirement, the internal chart content in the target document can be regarded as substandard document content, and all document generation subtasks after the chart generation task in the execution order can be determined as target subtasks from the plurality of document generation subtasks. The standard requirement can be set according to application requirements, and the embodiments of the present disclosure do not limit this.

[0101] After determining the target subtask, the target subtask can be re-executed with reference to the reflection result, the substandard document content is updated, the replacement document content is obtained, and the second large model is used to assemble the standard document content and the replacement document content to obtain a new target document. The standard document content can be the remaining document content in the target document except the substandard document content. For example, if the substandard document content includes internal chart content in the target document, the standard document content can include internal text content and internal image content in the target document.

[0102] By the above manner, in the embodiment of the disclosure, the first large model can be used to reflect on the target document to obtain a reflection result, to accurately locate the substandard document content in the target document based on the reflection result, and to determine a target subtask corresponding to the substandard document content from a plurality of document generation subtasks, and then re-execute the target subtask to update the substandard document content to obtain replacement document content, and use the second large model to assemble the standard document content and the replacement document content to obtain a new target document, thereby improving the document quality of the new target document, and specifically ensuring the outline rationality of the new target document, ensuring the consistency and coherence of the internal text content in the new target document, ensuring the matching degree of the internal chart content in the new target document and the context document content, and ensuring the matching degree of the internal image content in the new target document and the context document content.

[0103] In addition, it should be noted that in the embodiment of the disclosure, the reflection result can also be logged for reinforcement learning of at least part of the candidate execution subjects in the first large model, the second large model and the plurality of candidate execution subjects.

[0104] Next, the document generation method provided by the embodiment of the disclosure will be further described in three parts.

[0105] (1) Overall architecture of the document generation system

[0106] Please refer to Figure 2 In the embodiment of the disclosure, an agent architecture can be designed based on MCP to serve as a document generation system. Specifically, the document generation system can realize decoupling and efficient collaboration of functions through clear hierarchical division.

[0107] In the embodiment of the disclosure, the core part of the document generation system can include a server tool cluster (including a plurality of candidate execution subjects, which specifically belong to server subjects) and a client tool cluster (including a plurality of candidate execution subjects, which specifically belong to client subjects), both of which can establish a secure and reliable communication connection with the control center of the document generation system through MCP, and support bidirectional data exchange and instruction transmission. The control center can be implemented based on the first large model and the second large model. Here, the first large model can be a first LLM capable of applying CoT technology for step-by-step logical reasoning, such as DeepSeek-R1, Erine-X1, Gpt-O1, etc.; the second large model can be a second LLM capable of handling fast reasoning tasks, such as Deepseek-V3, Erine-4.5-turbo, Gpt-4, etc.

[0108] In addition, in the embodiment of the present disclosure, the server tool cluster can adopt a micro-service architecture design, which includes a plurality of candidate execution subjects, which can be: a reference content processing tool (supporting document reference content disassembly and summary in multiple formats), an intent recognition tool, a chart generation tool (integrating chart code functions of multiple visualization templates), a figure generation tool (such as an artificial intelligence drawing tool based on a multi-modal large model), a network search tool (a search engine capable of obtaining real-time network information, a network encyclopedia, etc.), a Uniform Resource Locator (URL) analysis tool (supporting deep web content crawling and structured processing), and the like. These tools can provide standardized interface services to the outside through an Application Programming Interface (API) gateway.

[0109] The client tool cluster can be an artificial intelligence tool that is deeply optimized for specific application scenarios, and the plurality of candidate execution subjects it includes can be: an outline generation tool, an outline disassembly tool, a concurrent content generation tool, an outline simplification tool, an abstract generation tool, and the like. These tools can be quickly called and combined and arranged through a unified Software Development Kit (SDK).

[0110] (2) Application examples of the document generation method

[0111] (2.1) Document parsing and intent extraction

[0112] After the target user provides a document generation intent including document reference content, the document generation system can call a reference content processing tool provided by the server to disassemble and summarize the document reference content to obtain at least one candidate reference content; at the same time, call an intent recognition tool provided by the server to disassemble and clarify the constraint meaning representation included in the document generation intent to obtain at least one candidate constraint condition. Please refer to Figure 3 In the embodiment of the present disclosure, the document reference content can be directly uploaded or a content link can be provided, and the present disclosure does not limit this.

[0113] Exemplarily, the at least one candidate reference content can include “certain summary content”; and the at least one candidate constraint condition can include “in the image generation link, a resolution of 4096x2160 is used to generate an image”.

[0114] In the above process, the intent recognition tool can also determine the document theme (for example, “analysis of the aesthetic situation of college students”) and the document type (for example, a general research report) of the target document to be generated based on the document generation intent.

[0115] Based on this, in the embodiments of the present disclosure, an intention analysis result including a document topic, a document type, at least one candidate reference content, and at least one candidate constraint condition can be generated.

[0116] (2.2) Planning of a document generation subtask and selection of an execution subject

[0117] Using the first large model, based on the intention analysis result, hierarchical planning of the document generation task is performed to obtain a document generation task chain, and the document generation task chain can include at least one document generation subtask. For example, a plurality of document generation subtasks with an execution order as shown in FIG. 2 can be obtained. Figure 4

[0118] Among them, the plurality of document generation subtasks can include a first network search task, an outline generation task, an outline disassembly task, a second network search task, a concurrent content generation task, an outline simplification task, a content insertion position determination task, a chart generation task, a picture generation task, and a content assembly task. Here, the first network search task, the outline generation task, the outline disassembly task, and the concurrent content generation task have a front-to-back execution order; the first network search task, the outline generation task, the outline simplification task, the content insertion position determination task, and the chart generation task have a front-to-back execution order; and the first network search task, the outline generation task, the outline simplification task, the content insertion position determination task, and the image generation task also have a front-to-back execution order.

[0119] Thereafter, for each document generation subtask, an execution subject identifier corresponding to the document generation subtask can be determined using the first large model, and an execution strategy for the document generation subtask can be generated based on the execution subject identifier.

[0120] In an example, when determining the execution subject identifier corresponding to the document generation subtask using the first large model, the first large model can be used to determine, from a plurality of candidate execution subject identifiers, a candidate execution subject identifier corresponding to the document generation subtask as the execution subject identifier corresponding to the document generation subtask.

[0121] ​Thereafter, the execution reference data can be generated based on the subtask constraint condition in a case where the intention analysis result includes the subtask constraint condition related to the document generation subtask, and the execution strategy for the document generation subtask can be generated based on the execution subject identifier and the execution reference data; or in a case where the intention analysis result does not include the subtask constraint condition related to the document generation subtask, the document type of the target document to be generated can be determined based on the intention analysis result, the supplementary constraint condition can be obtained based on the document type of the target document, and the execution reference data can be generated based on the supplementary constraint condition, so as to generate the execution strategy for the document generation subtask based on the execution subject identifier and the execution reference data. That is, in the embodiment of the present disclosure, in a case where the intention analysis result does not include the subtask constraint condition related to the document generation subtask, the document type of the target document to be generated can be determined based on the intention analysis result, and the current vertical category scene can be determined from the plurality of candidate vertical category scenes based on the document type, and some supplementary constraint conditions can be determined based on the specific scene requirement in the current vertical category scene as a supplement to the insufficient candidate constraint conditions, specifically, as a supplement to the insufficient subtask constraint conditions related to the document generation subtask.

[0122] Further, in the embodiment of the present disclosure, when the execution strategy for the document generation subtask is generated based on the execution subject identifier and the execution reference data, in a case where the intention analysis result includes the subtask reference content related to the document generation subtask, the execution reference data can be updated based on the subtask reference content to obtain updated execution reference data, and the execution strategy for the document generation subtask can be generated based on the execution subject identifier and the updated execution reference data.

[0123] In the above, the subtask constraint condition is contained in at least one candidate constraint condition, that is, the subtask constraint condition can be obtained by analyzing the constraint meaning representation in the document generation intention; and the subtask reference content is contained in at least one candidate reference content, that is, the subtask reference content can be obtained by analyzing the document reference content in the document generation intention.

[0124] For example, for a concurrent content generation task, the execution subject identifier corresponding thereto can be the number of the concurrent content generation tool, and the execution reference data related thereto can include the subtask reference content of “certain summary content”; for example, for a graph generation tool, the execution subject identifier corresponding thereto can be the number of the graph generation tool, and the execution reference data related thereto can include the subtask constraint condition or the supplementary constraint condition of “generating an image with a resolution of 4096x2160 in the image generation link”.

[0125] (2.3) Execution of the document generation subtask

[0126] The plurality of document generation sub-tasks are executed in an execution order.

[0127] A networking search tool is invoked to perform a first networking search task based on the intention resolution result, and obtain first search content.

[0128] An outline generation tool is invoked to perform an outline generation task based on the first search content, and generate an outline A with description information.

[0129] The outline A can include a plurality of chapter content topics with a hierarchy, for example, can include a first-level title "Analysis of the Aesthetic Situation of College Students" (i.e., the document topic of the target document to be generated), a second-level title under the first-level title "Analysis of the Aesthetic Situation of College Students", for example, "Overview of the Aesthetic Situation of College Students" and "Analysis of the Aesthetic Influence Factors of College Students", and a third-level title under the second-level title "Overview of the Aesthetic Situation of College Students", for example, "Characteristics of Aesthetic Concepts", and a third-level title under the second-level title "Analysis of the Aesthetic Influence Factors of College Students", for example, "Influence of Social Culture on the Aesthetic of College Students".

[0130] The description information can be used to describe the specific description content of the chapter content topic.

[0131] The outline A can be as shown in Table 1:

[0132] Table 1

[0133]

[0134]

[0135] An outline disassembly tool is invoked to perform an outline disassembly task, i.e., disassemble the outline A according to the second-level title, and obtain a plurality of content parts to be generated.

[0136] For each content part to be generated, a networking search tool can be invoked to perform a second networking search task to obtain second search content, and a content generation tool can be invoked to perform a concurrent content generation task based on the second search content and / or the sub-task reference content "Summary of Content", and generate corresponding chapter text content. After obtaining a plurality of chapter text contents corresponding to the plurality of content parts to be generated, the concurrent content generation tool can also assemble the plurality of chapter contents to obtain the internal text content of the target document to be generated as the execution result of the concurrent content generation task.

[0137] An outline simplification tool is invoked to perform an outline simplification task, i.e., simplify the outline A. Specifically, the description information in the outline A can be deleted to obtain an outline B. The outline B can be as shown in Table 2:

[0138] Table 2

[0139]

[0140] The content insertion position determination tool is invoked to perform a content insertion position determination task, i.e., inserting the chart placeholder and the image placeholder in the outline B to form an outline C. The outline C can be as shown in Table 3:

[0141] Table 3

[0142]

[0143]

[0144] The chart generation tool is invoked to perform a chart generation task, i.e., parsing the chart placeholder, and generating visual chart content as internal chart content of the target document to be generated based on the parsing result of the chart placeholder and the execution result of the concurrent content generation task.

[0145] The image generation tool is invoked to perform an image generation task, i.e., parsing the image placeholder, and generating visual image content as internal image content of the target document to be generated based on the parsing result of the image placeholder and the execution result of the concurrent content generation task.

[0146] The content assembly tool is invoked to perform a content assembly task, i.e., assembling the execution result of the concurrent content generation task, the execution result of the chart generation task, and the execution result of the image generation task to obtain the target document.

[0147] In an example, the execution result of the chart generation tool can be converted into any possible image format and stored in a specified first URL location, and inserted into the execution result of the concurrent content generation task; similarly, the execution result of the image generation tool can be stored in a specified second URL location, and inserted into the execution result of the concurrent content generation task. The first URL location and the second URL location can be the same or different, and the embodiments of the present disclosure do not limit this.

[0148] In the above process, the invocation of the candidate execution subject needs to comply with the standards of MCP, for example, there needs to be a unified RESTful API interface, a JSON Schema data format, cross-tool context management, and OAuth 2.0 authentication.

[0149] (2.4) Reflection iteration and quality optimization of the target document

[0150] The document generation system detects the target document through the reflection model (for example, the first large model), obtains a reflection result for determining content coherence, chart matching degree and image matching degree, and in the case that the target document meets the standard requirement, pushes the target document to the display iterator streaming output, and in the case that the target document does not meet the standard requirement, triggers a regeneration process (for example, regeneration of internal text content, adjustment of internal chart content, regeneration of internal image content, etc.) based on the non-standard document content.

[0151] In the embodiments of the present disclosure, the reflection result can also be logged for reinforcement learning of the first large model, the second large model and at least part of the candidate execution subjects.

[0152] (2.5) Real-time intervention of the target user

[0153] The thinking process and execution result of each candidate execution subject above are visible to the target user, that is, perceptible to the target user, and therefore, the document generation system also supports manual correction or marking of the execution result in the generation and thinking iteration of the target document and the quality optimization process of the target document, for example, correction or marking of the execution result of the outline generation tool, and for example, correction or marking of the execution result of the concurrent content generation task, so that the document generation system dynamically adjusts the execution strategy (for example, replaces the chart type) based on the feedback result of the target user to ensure that the final output result meets the expectation of the target user.

[0154] (3) Beneficial effects of the document generation method

[0155] The document generation method provided by the embodiments of the present disclosure can not only realize efficient generation of the target document, but also improve the matching degree of the target document and the document generation intention, and at the same time, avoid the problem of similar chapter structure and relieve the large model illusion problem, thereby improving the document quality of the target document.

[0156] Please refer to Figure 6 , an application scenario diagram of the document generation method provided by the embodiments of the present disclosure.

[0157] The document generation method provided by the embodiments of the present disclosure is applied to an electronic device. The electronic device can be a terminal device capable of communicating with a server. Here, the terminal device can be a workstation, a large computer, a general-purpose computer or other similar computing devices.

[0158] Here, the electronic device is used to:

[0159] obtain the document generation intention of the target user;

[0160] The first large model is used to generate an intention based on a document, plan a document generation task, and obtain a document generation task chain;

[0161] The document generation task chain is executed to obtain a target document.

[0162] It should be noted that in the embodiments of the present disclosure, Figure 6 The application scenario diagram shown is only illustrative and not limiting, and those skilled in the art can make various obvious changes and / or replacements based on the Figure 6 Examples, and the technical solutions obtained still belong to the disclosure range of the embodiments of the present disclosure.

[0163] In order to better implement the foregoing document generation method, the embodiments of the present disclosure also provide a document generation apparatus, which can be integrated in an electronic device. The electronic device can be a server or a terminal device. Here, the terminal device can be a workstation, a large computer, a general-purpose computer, or other similar computing devices. In the following, the document generation apparatus 600 provided by the embodiments of the present disclosure will be described in conjunction with the Figure 6 The schematic structure diagram shown is only illustrative and not limiting, and those skilled in the art can make various obvious changes and / or replacements based on the

[0164] The intention obtaining unit 601 is configured to obtain a document generation intention of a target user.

[0165] The task planning unit 602 is configured to use a first large model to plan a document generation task based on the document generation intention, and obtain a document generation task chain.

[0166] The document generation unit 603 is configured to execute the document generation task chain to obtain a target document.

[0167] In some optional embodiments, the document generation apparatus 600 further includes:

[0168] The policy generation unit is configured to use the first large model to determine an execution subject identifier corresponding to a document generation subtask; and generate an execution policy for the document generation subtask based on the execution subject identifier.

[0169] The document generation unit 603 is configured to:

[0170] Execute the document generation subtask according to the execution policy for the document generation subtask to obtain an execution result of the document generation subtask.

[0171] Obtain the target document based on the execution result of the document generation subtask.

[0172] In some optional embodiments, the document generation apparatus 600 further includes:

[0173] The intention analysis unit is configured to analyze the document generation intention to obtain an intention analysis result.

[0174] The policy generation unit is configured to:

[0175] In a case where the intention analysis result includes the subtask constraint condition related to the document generation subtask, generate, based on the subtask constraint condition, the execution reference data;

[0176] Generate, based on the execution subject identifier and the execution reference data, the execution policy for the document generation subtask.

[0177] In some optional embodiments, the policy generation unit is configured to:

[0178] In a case where the intention analysis result does not include the subtask constraint condition related to the document generation subtask, determine, based on the intention analysis result, a document type of a target document to be generated;

[0179] Obtain a supplementary constraint condition based on the document type of the target document;

[0180] Generate, based on the supplementary constraint condition, the execution reference data;

[0181] Generate, based on the execution subject identifier and the execution reference data, the execution policy for the document generation subtask.

[0182] In some optional embodiments, the policy generation unit is configured to:

[0183] In a case where the intention analysis result includes a subtask reference content related to the document generation subtask, update the execution reference data based on the subtask reference content to obtain updated execution reference data;

[0184] Generate, based on the execution subject identifier and the updated execution reference data, the execution policy for the document generation subtask.

[0185] In some optional embodiments, the subtask constraint condition is obtained by analyzing a constraint meaning representation in the document generation intention;

[0186] The subtask reference content is obtained by analyzing a document reference content in the document generation intention.

[0187] In some optional embodiments, the document generation unit 603 is configured to:

[0188] Determine, based on the execution subject identifier included in the execution policy, an execution subject corresponding to the document generation subtask from a plurality of candidate execution subjects by using the MCP;

[0189] Execute the document generation subtask by using the execution subject to obtain an execution result of the document generation subtask.

[0190] In some optional embodiments, the document generation unit 603 is configured to:

[0191] The execution subject is utilized to execute the document generation subtask based on the execution reference data included in the execution strategy, to obtain an execution result of the document generation subtask.

[0192] In some optional embodiments, the document generation unit 603 is configured to:

[0193] In the case where the document generation subtask has a networking requirement, the MCP is utilized to invoke a networking search tool from a plurality of candidate execution subjects;

[0194] The networking search tool is utilized to obtain a networking search result;

[0195] The execution subject is utilized to execute the document generation subtask based on the networking search result, to obtain an execution result of the document generation subtask.

[0196] In some optional embodiments, the document generation task chain includes a plurality of document generation subtasks having an execution sequence; the document generation unit 603 is configured to:

[0197] The execution result of the document generation subtask at the last of the execution sequence in the document generation task chain is taken as the target document.

[0198] In some optional embodiments, the document generation apparatus 600 further includes a reflection unit configured to:

[0199] The first large model is utilized to reflect on the target document, to obtain a reflection result;

[0200] In the case where the reflection result represents that the target document has non-compliant document content, a target subtask corresponding to the non-compliant document content is determined from the plurality of document generation subtasks;

[0201] The non-compliant document content is updated by executing the target subtask, to obtain replacement document content;

[0202] The second large model is utilized to assemble the compliant document content and the replacement document content, to obtain a new target document; wherein the compliant document content is the remaining document content of the target document except the non-compliant document content.

[0203] In the embodiments of the present disclosure, the specific functions and examples of each unit in the document generation apparatus 600 can be referred to the related descriptions of the corresponding steps in the foregoing document generation method embodiments, which will not be repeated here.

[0204] In the technical solutions of the present disclosure, the acquisition, storage and application of user personal information involved comply with relevant laws and regulations, and do not violate public order and good customs.

[0205] According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0206] Figure 7 A schematic structural block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device 700 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device 700 can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present disclosure described and / or claimed in this document.

[0207] As shown in Figure 7 The electronic device 700 includes a computing unit 701 that can perform various appropriate actions and processes according to a computer program stored in a Read-Only Memory (ROM) 702 or a computer program loaded into a Random Access Memory (RAM) 703 from a storage unit 708. In the RAM 703, various programs and data required for the operation of the electronic device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An Input / Output (I / O) interface 705 is also connected to the bus 704.

[0208] Various components in the electronic device 700 are connected to the I / O interface 705, including an input unit 706, such as a keyboard, a mouse, etc., an output unit 707, such as various types of renderers, a speaker, etc., a storage unit 708, such as a magnetic disk, an optical disk, etc., and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the electronic device 700 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0209] The computing unit 701 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, and the like. The computing unit 701 performs the methods and processes described above, e.g., the document generation method. For example, in some embodiments, the document generation method can be implemented as a computer software program tangibly embodied in a machine-readable medium, e.g., the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded onto the RAM 703 and executed by the computing unit 701, one or more steps of the document generation method described above can be performed. Alternatively, in other embodiments, the computing unit 701 can be configured as the document generation method by any other appropriate means, e.g., by means of firmware.

[0210] Various implementations of the systems and techniques described above herein can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a complex programmable logic device (CPLD), a system on chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0211] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces a means for implementing the functions / acts specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0212] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include one or more lines of electrical connections, portable computer disks, hard disk drives, RAM, ROM, erasable programmable read-only memory (EPROM) or flash memory, fiber optics, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0213] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a rendering device (e.g., a Cathode Ray Tube (CRT) or Liquid Crystal Display (LCD) monitor for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0214] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0215] The computer system can include a user terminal and a server. The user terminal and the server are generally remote from each other and typically interact through a communication network. The relationship of user terminal and server is merely that of two electronic devices that exchange data with each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0216] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the document generation method.

[0217] The embodiments of the present disclosure further provide a computer program product, comprising a computer program which, when executed by a processor, implements the document generation method.

[0218] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be executed in parallel, in series, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure are achieved, and the present disclosure is not limited herein. In addition, in the present disclosure, relationship terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. In addition, in the present disclosure, "a plurality of" can be understood as at least two.

[0219] The specific embodiments described above do not constitute an limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the principles of the present disclosure should be included in the protection scope of the present disclosure.

Claims

1. A document generation method, comprising: Obtain the document generation intent of the target user; Using the first major model, based on the document generation intent, document generation tasks are planned to obtain a document generation task chain; The document generation task chain is executed to obtain the target document.

2. The method according to claim 1, wherein, The document generation task chain includes document generation subtasks; the method further includes: Using the first large model, determine the execution entity identifier corresponding to the document generation subtask; based on the execution entity identifier, generate an execution strategy for the document generation subtask; The execution of the document generation task chain to obtain the target document includes: The document generation subtask is executed according to the execution strategy for the document generation subtask to obtain the execution result of the document generation subtask; The target document is obtained by executing the subtask based on the document.

3. The method according to claim 2, further comprising parsing the document generation intent to obtain an intent parsing result; in, The step of generating an execution strategy for the document generation subtask based on the execution entity identifier includes: If the intent parsing result includes subtask constraints related to the document generation subtask, execution reference data is generated based on the subtask constraints. Based on the execution entity identifier and the execution reference data, an execution strategy is generated for the document generation subtask.

4. The method according to claim 3, wherein, The step of generating an execution strategy for the document generation subtask based on the execution entity identifier includes: If the intent parsing result does not include subtask constraints related to the document generation subtask, the document type of the target document to be generated is determined based on the intent parsing result. Based on the document type of the target document, supplementary constraints are obtained; Based on the supplementary constraints, the execution reference data is generated; Based on the execution entity identifier and the execution reference data, an execution strategy is generated for the document generation subtask.

5. The method according to claim 3 or 4, wherein, The step of generating an execution strategy for the document generation subtask based on the execution entity identifier and the execution reference data includes: If the intent parsing result includes subtask reference content related to the document generation subtask, the execution reference data is updated based on the subtask reference content to obtain the updated execution reference data; Based on the execution entity identifier and the updated execution reference data, an execution strategy is generated for the document generation subtask.

6. The method according to claim 5, wherein, The subtask constraints are obtained by parsing the restrictive intent representation in the document generation intention; The subtask reference content is obtained by parsing the document reference content in the document generation intent.

7. The method according to claim 3, wherein, The step of executing the document generation subtask according to the execution strategy for the document generation subtask to obtain the execution result of the document generation subtask includes: Using the model context protocol, and based on the execution entity identifier included in the execution strategy, the target execution entity corresponding to the document generation subtask is determined from multiple candidate execution entities; Using the target execution entity, the document generation subtask is executed to obtain the execution result of the document generation subtask.

8. The method according to claim 7, wherein, The step of using the target execution entity to execute the document generation subtask to obtain the execution result of the document generation subtask includes: Using the target execution entity and based on the execution reference data included in the execution strategy, the document generation subtask is executed to obtain the execution result of the document generation subtask.

9. The method according to claim 7, wherein, The step of using the target execution entity to execute the document generation subtask to obtain the execution result of the document generation subtask includes: When the document generation subtask requires network connectivity, the network search tool is invoked from among the multiple candidate execution entities using the model context protocol; Using the aforementioned online search tool, online search results are obtained; Using the target execution entity, based on the online search results, the document generation subtask is executed to obtain the execution result of the document generation subtask.

10. The method according to claim 2, wherein, The document generation task chain includes multiple document generation sub-tasks with an execution order; The execution result of the document generation subtask yields the target document, including: The execution result of the document generation subtask that is last in the document generation task chain is taken as the target document.

11. The method according to claim 10, further comprising: Using the first major model, the target document is reflected upon to obtain the reflection results; If the reflection result indicates that the target document contains non-compliant document content, a target sub-task corresponding to the non-compliant document content is determined from the plurality of document generation sub-tasks; By executing the target subtask, the content of the non-compliant document is updated to obtain the replacement document content; Using the second major model, the content of the compliant document and the content of the replacement document are assembled to obtain a new target document; wherein, the content of the compliant document is the remaining document content in the target document excluding the content of the non-compliant document.

12. A document generation apparatus, comprising: The intent acquisition unit is used to acquire the document generation intent of the target user. The task planning unit is used to plan document generation tasks based on the document generation intent using the first major model, and to obtain a document generation task chain. The document generation unit is used to execute the document generation task chain to obtain the target document.

13. An electronic device, comprising: At least one processor; A memory that is communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method according to any one of claims 1 to 11.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 11.

15. A computer program product comprising a computer program; wherein, When the computer program is executed by a processor, it can implement the method of any one of claims 1 to 11.