Content generation method and device, equipment and storage medium
By constructing an execution framework that supports process orchestration and dependency control, the problems of high latency and low resource utilization in agent task execution are solved, achieving efficient concurrent scheduling and fine-grained dependency management of agent tasks, thereby improving task execution efficiency and result consistency.
Patent Information
- Application Number
- CN202511039956.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-11-21
AI Technical Summary
Existing technical solutions suffer from high overall response latency, low resource utilization, and difficulty in achieving high-concurrency scheduling and fine-grained dependency management in intelligent agent task execution and scheduling, especially performing poorly in complex multi-step task scenarios.
A general execution framework supporting process orchestration and dependency control is constructed. By clarifying the dependencies between task nodes, the automatic parallel execution of dependency-free tasks is achieved. Furthermore, a blocking and waiting mechanism and state-aware control logic are introduced to optimize the execution order of dependent tasks in the task flow.
It improves the task execution efficiency and output consistency of intelligent agents, reduces repetitive execution and waiting time, lowers the cost of manual intervention, and is suitable for various types of intelligent agent task scenarios.
Smart Images

Figure CN120994367A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to the technical field of deep learning, large model, intelligent agent, etc. BACKGROUND
[0002] In recent years, with the rapid development of artificial intelligence, large models have shown strong language understanding and knowledge reserve capabilities. Intelligent agents driven by large models have emerged as the times require, which can simulate human thinking for complex processing by virtue of deep learning and intelligent algorithms, and are widely used in content generation scenarios, bringing new strategies to the field of content generation. SUMMARY
[0003] The present disclosure provides a content generation method, device, equipment and storage medium.
[0004] According to an aspect of the present disclosure, a content generation method is provided, comprising:
[0005] receiving a content generation request, and determining a task input object based on the content generation request;
[0006] determining a task flow based on the task input object, the task flow containing a plurality of subtasks, the plurality of subtasks including at least two independent tasks and at least one dependent task; the execution of the independent task does not depend on the completion of other tasks; the execution of the dependent task depends on the completion of other tasks, and the other tasks are preceding tasks of the dependent task; there is a dependency relationship between the preceding task and the dependent task;
[0007] based on the dependency relationship, concurrently scheduling and executing the plurality of subtasks in the task flow to generate an intermediate result;
[0008] generating a content file based on the intermediate result.
[0009] According to another aspect of the present disclosure, a content generation device is provided, comprising:
[0010] a user request access module configured to receive a content generation request and determine a task input object based on the content generation request;
[0011] a task analysis and flow construction module configured to determine a task flow based on the task input object, the task flow containing a plurality of subtasks, the plurality of subtasks including at least two independent tasks and at least one dependent task; the execution of the independent task does not depend on the completion of other tasks; the execution of the dependent task depends on the completion of other tasks, and the other tasks are preceding tasks of the dependent task; there is a dependency relationship between the preceding task and the dependent task;
[0012] The scheduling control module is configured to perform concurrent scheduling and execution on the plurality of sub-tasks in the task flow based on the dependency relationship to generate an intermediate result.
[0013] The content fusion module is configured to generate a content file based on the intermediate result.
[0014] According to another aspect of the present disclosure, an electronic device is provided, comprising:
[0015] at least one processor; and
[0016] a memory in communication with the at least one processor; wherein
[0017] 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 perform the method of any of the embodiments of the present disclosure.
[0018] According to another aspect of the present disclosure, a non-transitory computer readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to perform the method according to any of the embodiments of the present disclosure.
[0019] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method according to any of the embodiments of the present disclosure.
[0020] The present disclosure determines a plurality of sub-tasks based on a content generation request of a user, and explicitly includes a task flow of the plurality of sub-tasks and a dependency relationship, and by analyzing the dependency relationship between the sub-tasks, the execution order of each sub-task can be reasonably arranged, and the situation of repeated execution or too long waiting time caused by improper sub-task order is reduced. Moreover, based on the dependency relationship between the sub-tasks, the task execution resources can be fully utilized, and at the same time, the plurality of sub-tasks are concurrently scheduled and executed, thereby improving the efficiency of content generation tasks. In addition, the present disclosure can realize automatic execution of content generation tasks, reduce manual intervention, and reduce task execution cost.
[0021] 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
[0022] The accompanying drawings are used to better understand the present scheme and do not limit the present disclosure. Among them:
[0023] Figure 1 is an application scenario diagram according to the embodiments of the present disclosure;
[0024] Figure 2 is an implementation flowchart of a content generation method according to an embodiment of the present disclosure;
[0025] Figure 3 is a flowchart of a content generation method according to an embodiment of the present disclosure;
[0026] Figure 4 is a structural diagram of a directed acyclic graph according to an embodiment of the present disclosure;
[0027] Figure 5 is a structural diagram of a content generation apparatus 500 according to an embodiment of the present disclosure;
[0028] Figure 6 is a structural diagram of a content generation apparatus 600 according to an embodiment of the present disclosure;
[0029] Figure 7 shows a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure. DETAILED DESCRIPTION
[0030] Exemplary embodiments of the present disclosure are described herein with reference to the accompanying drawings, which are included to provide a thorough understanding of embodiments of the present disclosure by individuals of ordinary skill in the art, and they should be considered in conjunction with the Disclosure, and they are intended to assist the understanding of the present disclosure, and should be considered only as illustrative. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present disclosure. Also, in order to be clear and concise, descriptions of well-known functions and structures are omitted in the following description.
[0031] The "and / or" of the embodiments of the present disclosure means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C. The terms "first", "second", herein mean to refer to a plurality of similar technical terms and to distinguish them, and are not meant to limit the order or to limit to only two, for example, the first feature and the second feature mean to refer to two categories / two features, the first feature can be one or more, and the second feature can also be one or more.
[0032] In the current era of rapid development in artificial intelligence, intelligent agent systems driven by large models are widely used in scenarios such as content generation, task planning, and knowledge question answering due to their powerful capabilities. As applications become more sophisticated, intelligent agent systems face higher demands on their execution speed, multi-task processing capabilities, and result consistency. However, existing technical solutions often employ linear toolchain calls, lacking fine-grained orchestration of task dependencies, making it difficult for independent subtasks to execute in parallel, thus slowing down the overall processing flow.
[0033] Currently, in the field of task execution and scheduling for intelligent agents, existing solutions mainly focus on two modes: serial toolchain invocation and staged batch execution. These solutions enhance the organization and reusability of task processes to some extent, but they still have significant limitations in terms of concurrent execution, dependency control, and flexible expansion, making it difficult to meet the needs of complex multi-step tasks for high-concurrency scheduling and fine-grained dependency management.
[0034] Option 1: Toolchain execution method based on serial process.
[0035] This approach typically arranges the various tools needed by the agent to perform a task in a linear order, and then calls them sequentially. The result of each tool's execution serves as the input for the next module, until the task is completed.
[0036] The advantage of this approach lies in its clear execution path and simple, easy-to-understand implementation logic, making it suitable for scenarios with relatively stable task structures. However, since all tools are executed sequentially, even if there are no dependencies between them, concurrent processing is not possible. This results in high overall response latency, low resource utilization, and poor ability to dynamically adjust the process, lacking flexibility.
[0037] Option 2: Concurrent execution method based on phase grouping.
[0038] This solution breaks down the task process into several execution stages, and multiple modules can be called in parallel within each stage, but the stages still maintain a sequential order.
[0039] Compared to a simple serial approach, this method offers some improvement in execution efficiency, mitigating the slow response time to a certain extent. However, since dependencies are only reflected between stages, tasks within a stage still need to be manually pre-defined. This results in coarse-grained dependencies, hindering fine-grained dependency modeling and dynamic scheduling, and making it difficult to adapt to complex task structures or scenarios with varying attack call paths.
[0040] To address the aforementioned issues, this disclosure proposes a content generation method to resolve the problems of high overall response latency and low task execution efficiency caused by serial tool calls when current intelligent agents process complex task chains.
[0041] This disclosure constructs a general execution framework that supports process orchestration and dependency control, explicitly modeling the originally sequential task execution process into a concurrently executable task flow. This disclosure enables structured modeling and parsing of the agent's task flow, clearly defining the dependencies between task nodes, thereby achieving automatic parallel execution of tasks without dependencies. Furthermore, for tasks with sequential dependencies, this disclosure introduces a blocking and waiting mechanism and state-aware control logic, allowing each component in the task flow to execute in an orderly manner according to its dependencies, thus improving both the agent's throughput and the consistency of its output.
[0042] From a technical implementation perspective, this disclosure establishes a visualized or configurable process definition module, a task scheduling core, and a context state management process. By combining the instruction generation capabilities of large models, this disclosure can automatically decompose requirements extracted from natural language into task flows and generate corresponding scheduling methods. This not only enhances the flexibility of agent execution and improves the agent's response speed, but also provides a unified operational infrastructure for complex tasks such as multi-step reasoning and multi-tool collaboration.
[0043] Furthermore, the framework proposed in this disclosure possesses versatility and reusability, making it applicable to various types of intelligent agents, including but not limited to complex task scenarios such as long text generation and rewriting, multimodal content fusion, and structured output management. Utilizing this framework can not only improve the efficiency of intelligent agents in performing tasks but also reduce the cost of logical refactoring between different tasks, facilitating rapid product iteration and scenario migration.
[0044] Figure 1 This is a schematic diagram illustrating an application scenario according to an embodiment of this disclosure, such as... Figure 1As shown in the illustration, the application scenario diagram of this disclosure may include, but is not limited to, a request acquisition device 110 and a content generation device 120. The request acquisition device 110 and the content generation device 120 can communicate via any type of wired or wireless network. Specifically, the request acquisition device 110 can be used to acquire a content generation request and send it to the content generation device 120; the content generation device 120 can be used to receive the content generation request and determine the content file based on the request. The request acquisition device 110 proposed in this disclosure includes, but is not limited to, electronic devices such as mobile phones, computers, smart voice interaction devices, smart home appliances, in-vehicle terminals, game consoles, e-book readers, multimedia playback devices, and wearable devices; the content generation device 120 may include electronic devices or servers. Furthermore, this disclosure does not impose a specific limitation on the number of request acquisition devices 110. For example, the application scenario diagram of this disclosure may include one or more request acquisition devices 110.
[0045] Figure 2 This is a flowchart illustrating the implementation of a content generation method according to an embodiment of the present disclosure, including:
[0046] S210. Receive a content generation request and determine the task input object based on the content generation request;
[0047] S220. Determine the task flow based on the task input object. The task flow contains multiple subtasks, including at least two independent tasks and at least one dependent task. The execution of independent tasks does not depend on the completion of other tasks. The execution of dependent tasks depends on the completion of other tasks, which are the predecessor tasks of the dependent tasks. There is a dependency relationship between the predecessor tasks and the dependent tasks.
[0048] S230. Based on this dependency, multiple subtasks in the task flow are concurrently scheduled and executed to produce intermediate results;
[0049] S240. Generate a content file based on the intermediate result.
[0050] In this embodiment of the disclosure, the content generation request can be initiated by the user to express their need to generate specific content. Here, the content may include short text, long text, images, videos, or multimodal content, etc.
[0051] In one example, a content generation request may include at least one of a natural language description, a structured task intent, and information about decomposed subtasks.
[0052] Here, natural language descriptions can include everyday spoken or written natural language. Such descriptions are quite flexible and may include key information such as the topic, content direction, style preferences, and length requirements of the generated content. For example, a natural language description could include, "Help me write a popular science article about environmental protection that is easy to understand, suitable for primary and secondary school students, and around 2,000 words."
[0053] Structured task intents can include pre-defined structures and formats, expressing content generation requests by dividing information into different categories, such as topics, key points, and target audiences. Each category can include corresponding specific content. For example, a structured task intent could include "Topic: Environmental Science Popularization; Key Points: Definition and Importance of Environmental Protection, Development and Application of Environmental Protection Technology; Target Audience: Primary and Secondary School Students; Word Count Requirement: Approximately 2000 words."
[0054] The information on the decomposed subtasks can include detailed descriptions of each subtask obtained after breaking down the overall content generation task. This information is presented in a more detailed and targeted manner, and can include information such as the specific goals of the subtasks, execution steps, required resources, and the order and dependencies between the subtasks.
[0055] Furthermore, in this embodiment of the disclosure, a request is generated based on the received content, and the information in the request is parsed and processed to determine the task input object. Here, the task input object is the basic data for subsequent task processing and may include multimodal data such as text, images, and audio.
[0056] Once the task input object is defined, a complete task flow can be determined based on preset rules, algorithms, or models, combined with the task input object. Here, the task flow can be stored in a specific data structure, which stores a series of subtasks that need to be executed to complete the content generation task. These subtasks can be relatively independent or interrelated. In one example, different subtasks have dependencies, meaning that the execution of some subtasks depends on the results of other subtasks.
[0057] In this embodiment of the disclosure, the multiple subtasks (i.e., the task flow) include at least two independent tasks and at least one dependent task; the execution of the independent tasks does not depend on the completion of other tasks; the execution of the dependent tasks depends on the completion of other tasks, which are the predecessor tasks of the dependent tasks; there is a dependency relationship between the predecessor tasks and the dependent tasks.
[0058] In this embodiment of the disclosure, a dependency-free task refers to a task whose execution does not depend on the completion of other tasks within the task flow. In other words, such tasks can be executed independently without waiting for other tasks to complete.
[0059] The execution of a dependent task depends on the completion of other tasks. This means that a dependent task can only begin execution after all other tasks it depends on have been completed. These other dependent tasks are called the predecessor tasks of the dependent task.
[0060] A predecessor task is another task that a dependent task depends on; it is a prerequisite for the dependent task to begin execution. In one example, a dependent task may have one or more predecessor tasks.
[0061] The dependencies between preceding and dependent tasks define the order in which each subtask in the task flow is executed (i.e., the execution order). This execution order ensures the logical and reasonable nature of the task flow, reducing the likelihood of confusion and errors during task execution.
[0062] By employing the above approach, since the execution of dependency-free tasks does not depend on other tasks, multiple dependency-free tasks can be processed simultaneously, thereby shortening the execution time of subtask processes and improving the processing efficiency of content generation tasks. Furthermore, the preceding tasks of dependent tasks provide the necessary preconditions for their execution. By adhering to these dependencies, errors in content generation due to insufficient preconditions can be reduced, thus improving the quality of content generation.
[0063] Furthermore, based on the dependencies between subtasks, multiple subtasks in the task flow are concurrently scheduled and executed. Here, concurrent scheduling can include starting the execution of multiple subtasks simultaneously. However, not all subtasks can be executed simultaneously. In one example, based on dependencies, it can be determined which subtasks can be concurrently scheduled and executed, and which subtasks need to wait for other subtasks to complete before they can be executed.
[0064] In this embodiment of the disclosure, corresponding intermediate results can be generated after each subtask is executed. In one example, the intermediate results may include generated partial content, task analysis results, and data processing results. Furthermore, the intermediate results generated from executing each subtask can be integrated to generate a content file. Here, the integration process may include filtering, merging, and adjusting the intermediate results. The format of the content file may include monomodal files such as text files, image files, and audio files, or it may include multimodal files, depending on the requirements of the content generation request.
[0065] By employing the above method, based on a defined task input object, a task flow containing multiple subtasks with dependencies is clearly defined. By analyzing the dependencies between subtasks, the execution order of each subtask can be rationally arranged, reducing duplicate executions or excessively long waiting times caused by improper subtask order. Furthermore, based on the dependencies between subtasks, task execution resources can be fully utilized, and multiple subtasks can be concurrently scheduled and executed, thereby improving the efficiency of content generation tasks. In addition, this disclosure enables the automatic execution of content generation tasks, reducing manual intervention and lowering task execution costs.
[0066] Figure 3 This is a flowchart illustrating a content generation method according to an embodiment of the present disclosure. In one example, the content generation task can be a long text generation task, and the core modules for implementing the content generation method may include: a user request access module, a task parsing and process construction module, a scheduling control module (including a task dependency control submodule and a node scheduling execution submodule), and a content fusion module.
[0067] like Figure 3 As shown, the implementation process of the content generation method includes the following steps:
[0068] S301. Receive a task generation request and determine the task input object based on the content generation request.
[0069] In one example, step S301 can be implemented using the task request access module.
[0070] In some implementations, determining the task input object based on the content generation request includes:
[0071] Based on the content generation request, determine at least one of the task generation objective, generation style, and tool preference;
[0072] The task input objects are determined based on a standardized generation template and at least one of the task generation objectives, generation style, and tool preferences.
[0073] In this embodiment, the task request access module performs format validation on the received content generation request to check whether the format of the content generation request conforms to a predetermined specification. For example, whether the content generation request contains the required fields and identifiers, or whether it is submitted in a specific file format, etc. For content generation requests that do not meet the requirements, corresponding standardization processing is performed. For example, non-standard format content generation requests are converted into a unified format, or missing field information is supplemented, etc.
[0074] In one example, content generation requests can be scanned and matched according to predefined field rules to identify the location and content of each field. In another example, a model can be pre-trained to identify field information in content generation requests, and then the location and content of each field can be identified based on this model.
[0075] Furthermore, based on different field types and requirements, the task request access module can adopt standardized processing methods to unify and standardize the identified field content, thereby improving the quality of content generation requests and reducing errors and uncertainties in subsequent processing.
[0076] In this embodiment, the task request access module can perform in-depth analysis and mining of content generation requests based on predefined metadata extraction rules. For example, by analyzing keywords, phrases, and sentence structures in the content generation request, the task generation goal can be determined; by identifying specific style descriptive words (such as "formal," "humorous," etc.), the generation style can be determined; and by searching for tool-related prompts, tool preferences can be clarified. Here, the task generation goal, generation style, and tool preferences can be considered as the key metadata of the content generation request.
[0077] In this embodiment, the standardized generation template provides a general framework and specifications, containing the basic structure and elements required to determine the task input object. Thus, the task input object (which may be referred to as TaskInput) is determined by integrating at least one of the task generation objectives, generation style, and tool preferences from the content generation request with the standardized generation template. Here, the task input object may include parameters such as a description of the task generation objectives and requirements for tool preferences.
[0078] By adopting the above method, the standardized generation template provides a unified structure and framework for determining the task input object, ensuring that the content of each part of the task input object is consistent in format and logic, and providing a data foundation for determining the subsequent task process.
[0079] S302. Based on the task input object, obtain multiple subtasks and the dependencies between different subtasks.
[0080] S303. Construct a task flow based on multiple subtasks and the dependencies between different subtasks.
[0081] In one example, steps S302-S303 can be implemented using the task parsing and process building module.
[0082] In some implementations, the task flow is determined based on the task input object, including:
[0083] Based on the first major model, the task input object is subjected to task intent understanding and task process decomposition to obtain multiple sub-tasks and the dependencies between different sub-tasks.
[0084] Build the task flow based on multiple subtasks and the dependencies between different subtasks;
[0085] Each subtask corresponds to a callable tool module.
[0086] In this embodiment, the task parsing and process construction module receives the task input object and invokes the first major model to perform in-depth analysis of the task input object. Here, the task input object can contain comprehensive information about the content generation task. For example, for generating a travel guide, the task input object may include the destination, target audience, style requirements, etc. The first major model can use its own natural language processing capabilities to parse the information in the task input object and understand the core intent of the content generation task.
[0087] Furthermore, based on the results of understanding the task intent, the first major model breaks down the content of the task input object into multiple specific sub-tasks. For example, for a task input object that generates a travel guide, it might be broken down into the following sub-tasks:
[0088] (1) Confirm the destination;
[0089] (2) Collect information on destination attractions: including attraction names, addresses, features, opening hours, etc.;
[0090] (3) Compile information on local specialty foods: including food names, recommended restaurants, price ranges, and flavor characteristics;
[0091] (4) Transportation planning strategy: This includes transportation methods from the origin to the destination, public transportation routes within the destination city, etc.
[0092] (5) Write the travel guide: In a relaxed style, integrate the information collected and organized earlier into a complete travel guide.
[0093] At the same time, the first major model will also analyze the sequence and dependencies between the various subtasks.
[0094] Furthermore, based on the dependencies between subtasks, the task parsing and process construction module can determine the execution order of each subtask and combine them in the determined execution order to form a complete task process.
[0095] In some implementations, the task flow is represented using a directed acyclic graph (DAG), where the nodes include at least one of source nodes and non-source nodes, and each node corresponds to a subtask; wherein,
[0096] The source node in the directed acyclic graph corresponds to a task with no dependencies.
[0097] In this directed acyclic graph, the non-source node corresponds to a dependent task, and the parent node of the node corresponding to the dependent task corresponds to the predecessor task of the dependent task.
[0098] In this embodiment of the disclosure, a directed acyclic graph is a graph model consisting of nodes and directed edges. "Directed" means that the edges have a direction, i.e., pointing from one node to another, representing a unidirectional relationship; "acyclic" means that there is no loop in the graph that starts from a node and returns to that node along a directed edge.
[0099] In a directed acyclic graph (DAG), the source node is a node without a parent node, meaning no other node points to it via a directed edge. Since a dependency-free task is independent of the completion of other tasks, it can be executed independently in the task flow, essentially acting as the source node in the DAG. Correspondingly, the source node in a DAG can correspond to a dependency-free task.
[0100] A non-source node is a node that has at least one parent node, meaning that other nodes point to it via directed edges. Since the execution of a dependent task depends on the completion of other tasks, in a directed acyclic graph (DAG), these dependent tasks (i.e., predecessor tasks) can be represented by parent nodes, while the dependent task itself is a child node. Accordingly, a non-source node (i.e., a node with a parent node) in a DAG can correspond to a dependent task.
[0101] In one example, configuration items such as input dependencies, output representations, and execution parameters (or tool parameters) can be pre-recorded for each node (including source and non-source nodes) in the directed acyclic graph to define the task flow.
[0102] Using the above method, the directed acyclic graph (DAG) visually and intuitively displays the sequence and dependencies between subtasks, clarifies the starting point and subsequent direction of the task flow, helps reduce logical errors in the task flow, and improves the rationality and completeness of the task flow.
[0103] For example, in the task of generating a travel guide, the subtask "Confirm Destination" is the foundation for the execution of other subtasks, and it has no corresponding preceding task, so it is a dependency-free task and must be executed first. The three subtasks "Collect Destination Attraction Information," "Organize Destination Specialty Food Information," and "Plan Transportation Guide" do not have a strict dependency relationship, but their preceding task is the "Confirm Destination" subtask. Therefore, these three subtasks can be executed simultaneously after the "Confirm Destination" subtask is completed. The subtask "Write the Travel Guide Text" depends on the previously collected attraction information, specialty food information, and transportation guide to write the content, so this subtask can only be executed after all the preceding subtasks are completed.
[0104] Furthermore, in one example, for the multiple subtasks of generating a travel guide, the task flow can be represented as follows:
[0105] (1) Execute the "Determine Destination" subtask;
[0106] (2) Wait for "(1)" to complete;
[0107] (3) Perform the sub-task of “collecting destination attraction information”;
[0108] (4) Perform the sub-task of “organizing information on local specialty foods”;
[0109] (5) Execute the sub-task of "Planning Transportation Strategies";
[0110] (6) Wait for “(3)-(5)” to complete;
[0111] (7) Perform the sub-task of “writing strategy copy”.
[0112] In this embodiment of the disclosure, to improve the efficiency of executing each subtask, a callable tool module is provided for each subtask. These tool modules may be specifically designed for a particular type of subtask and can provide corresponding functionalities and resource support.
[0113] Using the above method, the task input object is analyzed and the task flow is decomposed based on the first major model, resulting in multiple subtasks and the dependencies between them. The task flow is then constructed accordingly, eliminating the need for manual planning and organization, thus improving the efficiency and accuracy of task flow construction. Furthermore, by equipping each subtask with appropriate tool modules, the execution efficiency and quality of the subtasks can be improved.
[0114] After the above steps S302-S303, a set of subtasks (which can be called SubTasks) and a task flow (which can be called TaskFlowGraph (such as a directed acyclic graph)) can be output.
[0115] S304, schedule independent tasks to execute in parallel.
[0116] S305. Check whether the preceding tasks corresponding to the dependent tasks have been completed.
[0117] S306. Execute the dependent task if the preceding task has been completed.
[0118] S307. Write the task execution result to the global context and trigger the scheduling condition check.
[0119] In one example, steps S304-S307 can be implemented using the scheduling control module. Specifically, step S305 can be implemented using the task dependency control submodule, and steps S304 and S306-S307 can be implemented using the node scheduling execution submodule.
[0120] In some implementations, multiple subtasks in the task flow are concurrently scheduled and executed based on dependencies, including:
[0121] Based on the dependencies contained in the directed acyclic graph, determine the source node in the directed acyclic graph and the non-source node in the directed acyclic graph and the dependent tasks.
[0122] Multiple independent tasks are executed in parallel. If any independent task is completed, a scheduling condition check is triggered to determine whether the preceding tasks of any dependent task have been completed. If the preceding tasks of any dependent task are completed, the dependent task is executed and a scheduling condition check is triggered to determine whether the preceding tasks of other dependent tasks have been completed.
[0123] In this embodiment, since the independent tasks are mutually independent and there are no restrictions on their execution order, multiple independent tasks can be executed in parallel using the node scheduling execution submodule. Parallel execution can make full use of task execution resources and reduce waste of execution resources.
[0124] Once any independent task completes, the task dependency control submodule is triggered to perform a scheduling condition check. The purpose of this check is to determine whether any preceding task of a dependent task has completed. If the preceding task of a dependent task is found to be complete, preparation is made for the subsequent execution of that dependent task.
[0125] Furthermore, once the preceding tasks of any dependent task have been completed, the node scheduling execution submodule can execute that dependent task. When any dependent task is completed, the task dependency control submodule will also be triggered to check scheduling conditions to determine whether the preceding tasks of other dependent tasks have been completed.
[0126] It should be noted that if a task with dependencies has not completed its preceding task, the task with dependencies needs to be executed automatically after the preceding task has been completed. This is to achieve accurate scheduling of tasks with dependencies and maximize parallel execution capabilities.
[0127] In some implementations, triggering a scheduling condition check includes:
[0128] Write the task execution result to the global context;
[0129] Based on this global context, a scheduling condition check is performed on any dependent task to determine whether all preceding tasks of any dependent task have been completed.
[0130] In this embodiment of the disclosure, the task execution result may include at least one of the execution results of independent tasks and the execution results of dependent tasks. In one example, the task execution result may include information such as the execution status of subtasks and data generated during the execution process.
[0131] In this embodiment, the node scheduling and execution submodule can write the task execution results into the global context. Here, the global context can be a shared data storage area, providing a unified platform for information exchange between different subtasks. By writing the task execution results into the global context, centralized storage and sharing of information are achieved.
[0132] Furthermore, after writing the task execution result to the global context, a scheduling condition check for a dependent task can be triggered. At this point, the task dependency control submodule can retrieve the task execution results of all preceding tasks of the dependent task from the global context.
[0133] Based on the task execution results obtained from the global context, the task dependency control submodule can determine whether all preceding tasks of a dependent task have been completed. In one example, the criterion for completion can be at least one of the following: the execution status of preceding tasks, the accuracy of preceding task execution, or the task execution result meeting expectations.
[0134] Furthermore, if all preceding tasks have been completed, then the dependent task meets the scheduling conditions and can be executed; if any preceding task has not been completed, then the dependent task needs to wait until all preceding tasks have been completed before it can be executed.
[0135] Understandably, the information in the global context can be updated in real time. In other words, once any subtask is completed, the task execution result can be written into the global context, and the latest task execution result can be obtained from the global context when the scheduling conditions are checked later.
[0136] By employing the above method, and writing the task execution results into the global context, and then using this context to check scheduling conditions, the possibility of dependent tasks executing incorrectly due to a lack of understanding of the status of preceding tasks is reduced. Furthermore, checking the scheduling conditions of dependent tasks based on the global context can reduce the occurrence of multiple dependent tasks simultaneously competing for limited execution resources.
[0137] In some implementations, the subtasks are executed in the following ways:
[0138] The subtask is executed using the callable tool module corresponding to the subtask.
[0139] In this embodiment of the disclosure, each subtask has corresponding functional requirements and execution characteristics, and the tool module can be a collection of code or programs designed to complete a specific function. Different tool modules can have different functions and methods to meet the needs of various subtasks.
[0140] In one example, based on the functional requirements of a subtask, one or more corresponding tool modules can be matched from a large pool of tool modules. This matching method can be based on the tool module's functional description, interface specifications, and its suitability for the subtask's operation type.
[0141] Furthermore, after identifying the callable tool modules corresponding to the subtasks, the node scheduling execution submodule can execute the subtasks based on these tool modules. During subtask execution, the parameters required by the subtask need to be passed to the tool module. These parameters can include input data, operation parameters, etc., and then the tool module can be used to execute the subtask, ultimately returning the task execution result.
[0142] In this embodiment of the disclosure, subtasks may include dependency-free tasks and dependency-dependent tasks. In one example, for a dependency-free task, execution can be triggered immediately. Specifically, the node scheduling execution submodule can use a callable tool module corresponding to the dependency-free task and pass in the required parameters to execute the dependency-free task.
[0143] In this way, by using callable tool modules corresponding to the subtasks to execute them, the preparation time for subtask execution can be shortened and the efficiency of subtask execution can be improved.
[0144] By employing the above method, since there are no restrictions on the execution order between independent tasks, multiple independent tasks can be executed simultaneously, improving the utilization efficiency of execution resources. Furthermore, by rationally allocating resources to execute dependent tasks based on the completion status of their predecessors, the execution stability of dependent tasks can be improved, reducing instances of task execution chaos or errors.
[0145] After the above steps S304-S307, the intermediate results of each subtask (which can be called NodeOutputs) can be obtained.
[0146] S308. Summarize and combine the intermediate results to obtain the combined content.
[0147] S309. Adjust the spliced content to obtain the adjusted content.
[0148] S310. According to the output format requirements, perform structuring processing on the adjusted content to obtain the content file.
[0149] In one example, steps S308-S310 can be implemented using a content fusion module.
[0150] In some implementations, content files are generated based on intermediate results, including:
[0151] The intermediate results of each subtask are summarized and concatenated in logical order to obtain the concatenated content;
[0152] The spliced content is optimized and / or its consistency is adjusted to obtain the adjusted content;
[0153] Based on the output format requirements in the content generation request, the adjusted content is structured to obtain a content file.
[0154] In this embodiment, the content fusion module can summarize and splice the intermediate results of each subtask in a logical order to obtain the spliced content. In one example, the logical order of the intermediate results of each subtask can be determined based on the overall logic between the subtasks and business requirements. This logical order can be determined based on the dependencies between different subtasks or on the general logical order of the generated content. For example, in a news article generation task, subtasks may include collecting news event information, writing news headlines, and writing news articles. Following the normal logical order of news, the news headline should be spliced first, then the news article, and finally, relevant background information on the news event may be added.
[0155] Based on a defined logical order, the intermediate results of each subtask are concatenated to obtain the final content. This concatenation method can include string concatenation, data list concatenation, or data structure concatenation. For example, if the intermediate result is a text fragment, string concatenation operators can be used to concatenate the text fragments; if the intermediate result is a data table, it can be concatenated according to specific columns and rows.
[0156] In the embodiments disclosed herein, the spliced content may have shortcomings, such as inconsistent language expression, inconsistent formatting, repetitive or contradictory information, etc. In some implementations, the content fusion module can call a second major model to optimize and / or adjust the consistency of the spliced content.
[0157] In this embodiment of the disclosure, the second major model can optimize the language expression of the spliced content, and it can also optimize the logic of the spliced content.
[0158] In one example, the second-largest model can identify and automatically correct grammatical errors that may exist in the concatenated content. For sentences with complex structures or unclear expressions, the second-largest model can reorganize the sentence structure.
[0159] In another example, the second model can examine the logical relationships between the various parts of the assembled content, determining whether the content is well-organized and logically coherent. If logical jumps or contradictions are found, the second model can make appropriate additions or adjustments. The second model can also identify important information that may be missing from the assembled content and supplement it reasonably based on the context.
[0160] In this embodiment of the disclosure, the second model can adjust the style consistency of the spliced content, and it can also adjust the format consistency of the spliced content.
[0161] In one example, if the second model detects that the spliced content contains a mix of different styles, it can adjust it to a unified style. In domain-specific spliced content, the second model can also maintain accurate and consistent terminology.
[0162] In another example, if the concatenated content involves different formatting styles, such as font, font size, line spacing, and paragraph indentation, the second model can adjust them to a uniform format according to preset rules or user requirements. For concatenated content containing data, the second model can also maintain consistent data formats, such as date formats and number formats.
[0163] Here, the second and first large models can be the same large model, meaning that the large model can simultaneously realize the functions of the first and second large models; or they can be large models with different functions.
[0164] Furthermore, based on the output format requirements in the content generation request, the content fusion module can perform structuring processing on the adjusted content. Taking a long text generation task as an example, the content fusion module can perform operations such as layering, segmenting, adding titles, and formatting according to templates on the adjusted content, giving the adjusted content a clear structure. Then, the adjusted content can be exported according to the output format requirements to obtain a content file.
[0165] For long text generation tasks, the output format can include plain text, Hyper Text Markup Language (HTML), Portable Document Format (PDF), and Document Format Open eXtensible Markup Language (DOCX).
[0166] If the output format is plain text, there is no need for format conversion and structured design; the adjusted content can be returned directly as a string.
[0167] If the output format is HTML, a predefined content template is needed to generate a web page document. In one example, a predefined template typically contains the basic HTML structure, such as tags like `<html>`, `<body>`, and `< / body>`, as well as some common style and layout settings. Further, the adjusted content is filled into the appropriate locations according to the requirements of the predefined content template to obtain the HTML file.
[0168] If the output format is PDF or DOCX, a format conversion engine is needed to render and convert the adjusted content. In one example, for PDF, tools like headless Chrome can be used to render HTML files into PDFs in a headless environment. For DOCX, tools like docx-template can be used to populate the adjusted content into a DOCX template to generate a compliant DOCX file.
[0169] By using the above method to summarize and concatenate the intermediate results of each subtask in logical order, relevant information originally scattered across different subtasks can be integrated, maintaining the coherence and organization of the concatenated content. Furthermore, optimizing the concatenated content can improve the fluency and accuracy of language expression, and consistent adjustments can unify the content in style and format, improving the overall quality of the generated content. Based on the output format requirements in the content generation request, the adjusted content can be structured to generate content files in various formats, improving the efficiency and reach of content dissemination.
[0170] It should be noted that, in this embodiment, all output file formats support download and online preview functions, and can also be uploaded to a designated content management platform. Furthermore, this disclosure records metadata related to subtasks for subsequent auditing and backtracking.
[0171] After the above steps S308-S310, a content file with a complete structure and clear content (such as a long text content file) can be obtained, which supports exporting in multiple output formats.
[0172] Figure 4 This is a schematic diagram of a directed acyclic graph according to an embodiment of the present disclosure. Taking the above-mentioned multiple sub-tasks of generating a travel guide as an example, the directed acyclic graph may include 5 nodes, each node corresponding to a sub-task. The sub-tasks in nodes 1-5 correspond to the sub-tasks (1)-(5) of the travel guide, respectively. Among them, node 1 can be the source node of the directed acyclic graph, so the sub-task of node 1 can be considered as an independent task. Nodes 2-4 are child nodes of node 1, so the sub-tasks in nodes 2-4 can be considered as dependent tasks, and the independent task of node 1 is the predecessor task of the dependent task of nodes 2-4.
[0173] like Figure 4 As shown, there are no dependencies between nodes 2, 3, and 4, so the subtasks of these three nodes can be executed in parallel. After the subtasks of nodes 2 through 4 are completed, the subtask of node 5 can be executed to complete the content generation task.
[0174] Based on the above, the content generation method proposed in this disclosure aims to solve the problems of serial task execution, low response efficiency, and difficulty in flexibly expanding processes in existing intelligent agent systems. This disclosure constructs an intelligent agent runtime framework by introducing a visual task orchestration mechanism and a tool invocation process based on a dependency graph model. This framework possesses automatic dependency management, concurrent task execution, and module decoupling capabilities, which can improve the generation efficiency of content generation tasks and enhance the maintainability of the intelligent agent system. Furthermore, the method proposed in this disclosure has high versatility and flexible configuration capabilities, and can adapt to various content generation tasks and multi-task collaborative scenarios, such as content creation, document compilation, automatic report writing, and defense material generation.
[0175] This disclosure implements a systematic upgrade at the process level based on the traditional intelligent agent task chain. By introducing a task flow orchestration mechanism and a dependency-aware concurrent execution architecture, it enhances capabilities in task response efficiency, execution concurrency, and flexible process configuration. Specifically, leveraging the intelligent agent system's ability to automatically parse task structures and construct task flows, it can decompose user-inputted natural language content into schedulable subtasks and trigger parallel execution based on task dependencies. This process effectively reduces response latency caused by serial execution, thereby improving overall execution throughput.
[0176] On the other hand, this disclosure maintains the independence and composability of each stage of the subtask by leveraging structured modeling and state-driven control of the subtask execution process. Whether it's a long text generation task with a fixed workflow or a content generation task with a dynamic path (such as conditional generation or optional workflows), flexible adaptation can be achieved within a unified execution framework. This not only enhances the support for complex and diverse content generation needs but also lays the foundation for the reuse of various intelligent agent task execution processes and the accumulation of process templates, thereby improving development reusability and business response speed.
[0177] Furthermore, this disclosure possesses the ability to decouple content generation requests from different sources. Regardless of whether the content generation request is triggered by user interaction in the foreground, generated in batches in the background, or called through an external interface, it can leverage a unified standardized task process and task parsing and process construction module. This feature reduces the workload of repeatedly adapting and developing for various calling methods, thereby enhancing the compatibility and scalability of content generation.
[0178] Overall, this disclosure enhances the parallel control capabilities and process automation level of intelligent agents in content generation scenarios. This improvement significantly increases task processing efficiency and enhances system stability. Under the requirements of multi-parallel, multi-process, and multi-scenario operation, this disclosure provides technical support, reduces R&D costs, and accelerates the application and popularization of intelligent generation technologies in multiple industry scenarios.
[0179] This disclosure also proposes a content generation apparatus. Figure 5 This is a schematic diagram of the structure of a content generation apparatus 500 according to an embodiment of the present disclosure, including:
[0180] User request access module 510 is used to receive content generation requests and determine task input objects based on the content generation requests.
[0181] The task parsing and process construction module 520 is used to determine the task process based on the task input object. The task process contains multiple subtasks, and the multiple subtasks include at least two independent tasks and at least one dependent task. The execution of independent tasks does not depend on the completion of other tasks. The execution of dependent tasks depends on the completion of other tasks, and the other tasks are the predecessor tasks of the dependent tasks. There is a dependency relationship between the predecessor tasks and the dependent tasks.
[0182] The scheduling control module 530 is used to concurrently schedule and execute multiple subtasks in the task flow based on the dependency relationship in order to produce intermediate results;
[0183] Content fusion module 540 is used to generate content files based on the intermediate result.
[0184] In some implementations, the task flow is represented using a directed acyclic graph (DAG), where the nodes include at least one of source nodes and non-source nodes, and each node corresponds to a subtask; wherein,
[0185] In a directed acyclic graph, the source node corresponds to a task with no dependencies.
[0186] In a directed acyclic graph, a non-source node corresponds to a dependent task, and the parent node of the node corresponding to the dependent task corresponds to the predecessor task of the dependent task.
[0187] Figure 6 This is a schematic diagram of the structure of a content generation apparatus 600 according to an embodiment of the present disclosure. In some embodiments, the scheduling control module 530 includes a task dependency control submodule 531 and a node scheduling execution submodule 532.
[0188] The task dependency control submodule 531 is used to determine the dependent tasks corresponding to the source node in the directed acyclic graph and the dependent tasks corresponding to the non-source nodes in the directed acyclic graph based on the dependency relationships contained in the directed acyclic graph; it is also used to perform scheduling condition checks to determine whether the preceding tasks of any dependent task have been completed.
[0189] The node scheduling execution submodule 532 is used to execute multiple independent tasks in parallel. When any independent task is completed, it triggers the task dependency control submodule 531 to check the scheduling conditions. It is also used to execute any dependent task when the preceding task of any dependent task is completed, and to trigger the task dependency control submodule 531 to check the scheduling conditions.
[0190] In some implementations, the node scheduling execution submodule 532 is used to write the task execution result into the global context to trigger the task dependency control submodule 531 to perform scheduling condition checks.
[0191] The task dependency control submodule 531 is used to perform scheduling condition checks on any dependent task based on the global context to determine whether all the preceding tasks of any dependent task have been completed.
[0192] In some implementations, the user request access module 510 is used for:
[0193] Based on the content generation request, determine at least one of the task generation objectives, generation style, and tool preferences;
[0194] The task input objects are determined based on a standardized generation template and at least one of the task generation objectives, generation style, and tool preferences.
[0195] In some implementations, the task parsing and process construction module 520 is used for:
[0196] The first major module is invoked. Based on this first major model, the task input object is analyzed to understand the task intent and decompose the task flow, so as to obtain multiple sub-tasks and the dependencies between different sub-tasks.
[0197] Build the task flow based on multiple subtasks and the dependencies between different subtasks;
[0198] Each subtask corresponds to a callable tool module.
[0199] In some implementations, the node scheduling execution submodule 532 is used to execute the subtask using the callable tool module corresponding to the subtask.
[0200] In some implementations, the content fusion module 540 is used for:
[0201] The intermediate results of each subtask are summarized and concatenated in logical order to obtain the concatenated content;
[0202] The spliced content is optimized and / or its consistency is adjusted to obtain the adjusted content;
[0203] Based on the output format requirements in the content generation request, the adjusted content is structured to obtain a content file.
[0204] The specific functions and examples of each module and submodule of the apparatus in this disclosure can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.
[0205] The acquisition, storage, and application of personal information by users involved in this technical solution comply with relevant laws and regulations and do not violate public order and good morals.
[0206] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0207] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0208] like Figure 7 As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 702 or a computer program loaded from storage unit 708 into random access memory (RAM) 703. RAM 703 may also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.
[0209] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0210] The computing unit 701 can be a variety of general-purpose 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 suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as content generation methods. For example, in some embodiments, the content generation method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the content generation method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the content generation method by any other suitable means (e.g., by means of firmware).
[0211] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0212] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0213] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0214] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; 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 sound input, voice input, or tactile input).
[0215] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0216] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0217] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0218] The specific embodiments described above do not constitute a limitation on the scope of protection of this 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 substitutions, and improvements made within the principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A content generation method, comprising: Receive a content generation request and determine the task input object based on the content generation request; A task flow is determined based on the task input object. The task flow includes multiple subtasks, including at least two independent tasks and at least one dependent task. The execution of the independent tasks does not depend on the completion of other tasks. The execution of the dependent task depends on the completion of other tasks, which are the predecessor tasks of the dependent task. There is a dependency relationship between the predecessor task and the dependent task. Based on the aforementioned dependencies, the multiple subtasks in the task flow are concurrently scheduled and executed to generate intermediate results; A content file is generated based on the intermediate results.
2. The method according to claim 1, wherein, The task flow is represented using a directed acyclic graph (DAG), where nodes include at least one type: source node and non-source node. Each node corresponds to one of the subtasks. The source node in the directed acyclic graph corresponds to the dependent task; The non-source node in the directed acyclic graph corresponds to the dependent task, and the parent node of the node corresponding to the dependent task corresponds to the predecessor task of the dependent task.
3. The method according to claim 2, wherein, The method of concurrently scheduling and executing the multiple subtasks in the task flow based on the dependency relationship includes: Based on the dependencies contained in the directed acyclic graph, determine the source node in the directed acyclic graph and the non-source node in the directed acyclic graph and the dependent tasks. Multiple dependent tasks are executed in parallel. If any dependent task is completed, a scheduling condition check is triggered to determine whether the preceding task of any dependent task has been completed. If the preceding task of any dependent task is completed, the dependent task is executed, and a scheduling condition check is triggered to determine whether the preceding tasks of other dependent tasks have been completed.
4. The method according to claim 3, wherein, The trigger scheduling condition check includes: Write the task execution result to the global context; Based on the global context, a scheduling condition check is performed on any of the dependent tasks to determine whether all the preceding tasks of any of the dependent tasks have been completed.
5. The method according to any one of claims 1-4, wherein, The step of generating a request based on the content to determine the task input object includes: Based on the content generation request, determine at least one of the task generation objective, generation style, and tool preference; The task input object is determined based on a standardized generation template and at least one of the task generation objectives, generation styles, and tool preferences.
6. The method according to any one of claims 1-4, wherein, The process of determining the task flow based on the task input object includes: Based on the first major model, the task input object is subjected to task intent understanding and task flow decomposition to obtain multiple sub-tasks and the dependencies between different sub-tasks; The task flow is constructed based on the multiple sub-tasks and the dependencies between different sub-tasks; Each of the subtasks corresponds to a callable tool module.
7. The method according to claim 6, wherein, The subtasks can be executed in the following ways: The subtask is executed using the callable tool module corresponding to the subtask.
8. The method according to any one of claims 1-4, wherein, The generation of content files based on the intermediate results includes: The intermediate results of each subtask are summarized and concatenated in logical order to obtain the concatenated content; The spliced content is optimized and / or its consistency is adjusted to obtain the adjusted content; Based on the output format requirements in the content generation request, the adjusted content is structured to obtain the content file.
9. A content generation apparatus, comprising: The user request access module is used to receive content generation requests and determine the task input object based on the content generation requests. The task parsing and process construction module is used to determine the task process based on the task input object. The task process includes multiple subtasks, and the multiple subtasks include at least two independent tasks and at least one dependent task. The execution of the independent tasks does not depend on the completion of other tasks. The execution of the dependent task depends on the completion of other tasks, and the other tasks are the predecessor tasks of the dependent tasks. There is a dependency relationship between the predecessor tasks and the dependent tasks. The scheduling control module is used to concurrently schedule and execute the multiple subtasks in the task flow based on the dependencies, so as to generate intermediate results; The content fusion module is used to generate content files based on the intermediate results.
10. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
11. 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-8.
12. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-8.
Citation Information
Cited By
Government affair intelligent writing method and system based on multi-Agent collaboration and long memory technology
CN121327156A
A method and system for intelligent government writing based on multi-agent collaboration and long memory technology
CN121327156B