Workflow generation method and device, electronic equipment and storage medium
By identifying task requirements and parameters in user instructions, using predefined function nodes to generate initial workflows, and adjusting according to the target reference workflow, the problem of high workflow generation costs in the existing technology is solved, and efficient and accurate workflows are achieved. Workflows are generated and labor costs are reduced.
Patent Information
- Application Number
- CN202411403870.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-21
AI Technical Summary
The cost of generating workflows in the prior art is high, especially due to the complexity and diversity of AI functional nodes, making it difficult for people without the basic knowledge of AI usage to build efficient workflows.
By obtaining user instructions, identifying task requirements and parameters, using a predefined set of functional nodes to generate an initial workflow, and matching it with the reference workflow in the preset knowledge base, the initial workflow is generated based on the target reference workflow whose matching degree exceeds the threshold. The workflow is adjusted to generate the target workflow.
It achieves the generation of accurate target workflows corresponding to user instructions, improves the execution efficiency and quality of workflow generation, reduces labor costs, and avoids the need for advanced AI knowledge.
Smart Images

Figure CN119338402A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a workflow generation method, device, electronic device and storage medium. Background Art
[0002] With the development of large models and agent technology, more and more AI Bot development platforms have begun to be put into use. On platforms such as COZE, dify, and fast-gpt, whether you have a programming foundation or not, you can use the workflow function provided by the platform to combine atomic AI capability nodes in a drag-and-drop manner to build your own AI bot application.
[0003] However, as the AI capabilities integrated into the platform become increasingly rich, the nodes that need to be added to build a unique workflow and the corresponding parameter information transmission between nodes are becoming more and more complicated, which makes it extremely difficult for people who do not have basic knowledge of AI to use, resulting in a high cost for generating workflows with existing technologies. Summary of the invention
[0004] In view of this, the present application provides a workflow generation method, device, electronic device and storage medium to solve the problem of high cost of generating workflow in the prior art.
[0005] In a first aspect of the present application, a method for generating a workflow is provided, comprising: obtaining a user instruction, and identifying a task requirement corresponding to the user instruction and a task parameter corresponding to the user instruction; processing the task requirement and the task parameter using a predefined set of function nodes to generate an initial workflow; matching the initial workflow with a reference workflow in a preset knowledge base to obtain a workflow matching degree, determining a reference workflow whose workflow matching degree exceeds a threshold as a target reference workflow, wherein the preset knowledge base stores multiple reference workflows; and adjusting the initial workflow according to the reference workflow to obtain a target workflow.
[0006] In a second aspect of the present application, a workflow generation device is provided, comprising: an acquisition module, configured to acquire user instructions, and identify task requirements corresponding to the user instructions and task parameters corresponding to the user instructions; a generation module, configured to process the task requirements and the task parameters using a predefined set of function nodes to generate an initial workflow; a matching module, configured to match the initial workflow with a reference workflow in a preset knowledge base to obtain a workflow matching degree, and determine that a reference workflow whose workflow matching degree exceeds a threshold is a target reference workflow, wherein the preset knowledge base stores multiple reference workflows; an adjustment module, configured to adjust the initial workflow according to the reference workflow to obtain a target workflow.
[0007] According to a third aspect of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0008] According to a fourth aspect of the present application, a storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0009] At least one of the above technical solutions adopted in this application can achieve the following beneficial effects:
[0010] By obtaining user instructions, identifying the task requirements and task parameters corresponding to the user instructions, and using a predefined set of functional nodes to process the task requirements and task parameters, an initial workflow is generated, and the initial workflow is further matched with a reference workflow in a preset knowledge base, so that a target reference workflow with a workflow matching degree exceeding a threshold with the initial workflow can be obtained, and the initial workflow can be optimized and adjusted based on the structure and parameters of the target reference workflow to obtain a target workflow, so that the initial workflow can be generated based on the user instructions through a predefined set of functional nodes, and the initial workflow can be optimized based on the target reference workflow, so that an accurate target workflow corresponding to the user instructions can be generated, and based on the intelligent processing steps of the workflow generation platform, not only the execution efficiency and generation quality of the workflow generation are improved, but also the problem that the user needs a high artificial intelligence knowledge reserve is avoided, and the labor cost of workflow generation is greatly reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0012] Figure 1 It is a flowchart of a method for generating a workflow provided in an embodiment of the present application;
[0013] Figure 2 It is a flowchart of another method for generating a workflow provided in an embodiment of the present application;
[0014] Figure 3 It is a structural schematic diagram of a workflow generation device provided in an embodiment of the present application;
[0015] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0016] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0017] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0018] In addition, it should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "includes..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0019] With the development of large models and AI Agent technology, the AI capabilities integrated into the platform have become increasingly rich. Users can build their own AI workflows on these platforms by dragging and dropping, which lowers some development thresholds. However, with the complexity and diversification of functions, especially the increasing number of AI function nodes on the platform, the parameter dependencies between nodes are becoming more and more complex. For users who do not have basic AI knowledge or programming experience, it becomes very difficult to build an efficient and complex workflow. Therefore, this application designs a task generation assistant system based on multi-agent interaction. By using multiple pre-built agents in the AI platform to understand user instructions, and generating and optimizing corresponding workflows based on user instructions, this not only can efficiently implement workflow construction, but also does not require high labor costs.
[0020] A method and device for generating a workflow according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0021] Figure 1 FIG. 1 is a flow chart of a method for generating a workflow provided in an embodiment of the present application. Figure 1 As shown, the workflow generation method includes:
[0022] S101, obtaining a user instruction, and identifying a task requirement corresponding to the user instruction and a task parameter corresponding to the user instruction.
[0023] Specifically, the user instruction may represent an instruction received by the system from the user, which may be a natural language description or a specific task requirement. As an example: a workflow for generating a science fiction-style city image with a resolution of 1024×1024.
[0024] Furthermore, the task requirements identified from user instructions can be understood as specific execution tasks of the workflow, such as image generation tasks, image style conversion tasks, etc., and the task parameters can be understood as specific parameters related to the task, such as the resolution and style of the generated image, etc., which are not limited here.
[0025] S102: Process the task requirements and task parameters using a predefined set of function nodes to generate an initial workflow.
[0026] Specifically, the predefined function node set can represent the various function node sets pre-stored in the workflow generation platform, and each function node can represent a processing step or module in the workflow, which can be used to process different tasks, such as the corresponding image generation node, parameter setting node, model selection node, etc. in the image generation process.
[0027] Furthermore, the system can select corresponding functional nodes according to task requirements and task parameters, and establish dependencies between the selected functional nodes, that is, the functional nodes selected according to the combination of task requirements and task parameters can obtain an initial workflow.
[0028] S103, matching the initial workflow with the reference workflow in the preset knowledge base to obtain the workflow matching degree, and determining the reference workflow whose workflow matching degree exceeds a threshold as the target reference workflow, wherein the preset knowledge base stores multiple reference workflows.
[0029] Specifically, the system can compare the generated initial workflow with the reference workflow in the preset knowledge base, and select the reference workflow with a matching degree exceeding a threshold (e.g., 0.8) as the target reference workflow, where the reference workflow can represent an excellent workflow stored previously, or a workflow that has been processed by the system and has been verified to be effective. The preset knowledge base can represent the knowledge base used to store these workflows. All workflows can be directly stored in the preset knowledge base, or it can be divided into multiple sub-knowledge bases to store different types of workflows. For example, the image knowledge base is used to store workflows for image generation or image style conversion tasks, and the text rewriting knowledge base is used to store workflows for text rewriting or text style conversion tasks. There is no limitation here.
[0030] Furthermore, when calculating the workflow matching degree, it can be calculated based on indicators such as task type, workflow structure, task parameters, etc., and there is no limitation here.
[0031] S104: Adjust the initial workflow according to the target reference workflow to obtain the target workflow.
[0032] Specifically, after obtaining the target reference workflow, the initial workflow can be adjusted based on the target reference workflow, that is, the initial workflow can be optimized parameters (such as adjustment of model accuracy and resolution) and nodes can be added or deleted (for example, adding processing nodes necessary for corresponding tasks) based on the target reference workflow, so as to further optimize the performance and quality of the target workflow.
[0033] In the above embodiment, the task of each step can be implemented by multiple agents, that is, the task planning agent can understand the user instructions to obtain task requirements and task parameters, and the workflow agent can process the task requirements and task parameters to generate an initial workflow. The workflow adjustment agent can select the target reference workflow and optimize the initial workflow. The above-mentioned agents can be set in advance by the staff based on the requirements of the workflow generation platform, and there is no limitation here.
[0034] According to the technical solution provided in the above embodiment, by obtaining and parsing user instructions, identifying task parameters and task requirements, generating an initial workflow, and selecting a target reference workflow to optimize the initial workflow, a target workflow can be obtained. In this way, a workflow that meets user needs and is optimized can be generated. Through pre-set intelligent execution steps, manual operation of complex AI tasks and processes can be avoided. This not only generates accurate target workflows, but also reduces manual operation costs.
[0035] In some embodiments, a predefined set of functional nodes is used to process task requirements and task parameters to generate an initial workflow, including: determining, based on the task requirements, task sub-steps corresponding to executing the task requirements; determining, based on the task sub-steps, workflow nodes, the workflow nodes representing the functional nodes in the predefined set of functional nodes corresponding to the task sub-steps; and assigning the task parameters to the corresponding workflow nodes to obtain the initial workflow.
[0036] Specifically, you can first determine the task sub-steps corresponding to the task requirements based on the task requirements. The task sub-steps can be expressed as a series of more specific and operational sub-steps. As an example, the task requirement is "generate a realistic-style picture of a future city", then the corresponding task sub-steps may include: parsing the text description entered by the user, selecting a realistic-style image generation model, setting the image resolution, performing image generation, etc., without limitation here.
[0037] Furthermore, workflow nodes can be determined based on task sub-steps. Workflow nodes can represent specific operations or functional units used by the system to implement task sub-steps. Each workflow node corresponds to a specific function, corresponding to a functional node in a predefined functional node set, such as image processing, model selection, text parsing, etc. For example, if the task sub-step is to parse the text description input by the user, the functional node in the corresponding set is a "text parsing node", and the workflow node is a "text parsing node".
[0038] Furthermore, after determining the workflow node, the task parameters can be assigned to the corresponding workflow node. The task parameters can represent the specific requirements or constraints provided by the user regarding the task requirements, such as the resolution, style, output format, etc. of the image. Since the task execution has a specific process, the task parameters can be associated with a specific workflow node. When generating the initial workflow, the system can assign the task parameters to the corresponding workflow nodes to ensure that each workflow node follows these task parameters during execution. As an example, in the image generation task, the user inputs a resolution of 1024×1024 in the task parameters, and a workflow node is determined to be a resolution setting node. During the task execution process, the resolution of 1024×1024 will be assigned to the resolution setting node. When the task is executed to the resolution generation, the system will execute the image generation task based on the configured resolution.
[0039] According to the technical solution provided in the above embodiment, by analyzing the task requirements input by the user, the system can decompose them into multiple specific task sub-steps. For each task sub-step, the system selects the expected matching function node from the predefined function node set as the corresponding workflow node, and then allocates the corresponding task parameters to the corresponding workflow nodes, which can ensure that each workflow node is processed according to these parameters, thereby obtaining a complete initial workflow.
[0040] In some embodiments, the initial workflow is matched with a reference workflow in a preset knowledge base to obtain a workflow matching degree, including: obtaining a reference task requirement corresponding to the reference workflow, and a reference task parameter corresponding to the reference workflow; determining a first similarity based on the task requirement and the reference task requirement; determining a second similarity based on the task parameter and the reference task parameter; and determining the workflow matching degree based on the first similarity and the second similarity.
[0041] Specifically, the preset knowledge base aggregates and stores multiple reference workflows, which can represent excellent workflows of corresponding task types, which can be pre-set by professional developers, or can be excellent workflows with user feedback stored during use, which are not limited here. In this way, the reference workflows in the preset knowledge base have certain reference value. Therefore, in this solution, after the initial workflow is generated, a similar reference workflow can be selected from the preset knowledge base as the target reference workflow, and the initial workflow can be adjusted and optimized. When selecting the target reference workflow, the selection can be based on the matching degree of the two, that is, the reference workflow whose workflow matching degree with the initial workflow is greater than a threshold is selected as the target reference workflow. Among them, the workflow matching degree can be calculated based on the task requirements and task parameters of the initial workflow and the reference task requirements and reference task parameters of the reference workflow.
[0042] Furthermore, the task requirements and the reference task requirements can be calculated to obtain a first similarity. The semantic similarity between the two can be analyzed by natural language understanding capabilities or the similarity between the two can be determined by task type classification to obtain the first similarity. The higher the first similarity, the closer the task requirements are.
[0043] When calculating the second similarity between the task parameters and the reference task parameters, the task parameters provided by the user can be directly compared with the reference task parameters, such as the resolution, style model, output format and other parameters. If the settings are close, it means that the second similarity is high. The first similarity and the second similarity can be calculated by a quantitative model, which will not be expanded here.
[0044] After obtaining the first similarity and the second similarity, the system can combine the two to obtain an overall workflow matching degree. The first similarity and the second similarity can be combined by weighted average or other methods. There is no limitation here. When the workflow matching degree is high (for example, exceeding 0.8), it can indicate that the corresponding reference workflow is very close to the initial workflow and is suitable for subsequent optimization processes. The corresponding reference workflow is then determined as the target reference workflow.
[0045] As an example, the first similarity is 0.8, the second similarity is 0.9, and based on the preset weighted average rule, the workflow matching degree may be 0.85. Then the workflow matching degree exceeds the threshold of 0.8, and this reference workflow will be used as the target reference workflow for subsequent adjustment and optimization of the initial workflow.
[0046] It should be noted that the workflow matching degree can also be calculated based on other factors, such as the structure of the workflow, the output of the initial workflow execution task and the output of the reference workflow execution instruction, etc., as long as it is reasonable, there is no restriction here.
[0047] According to the technical solution provided in the above embodiment, by calculating the first similarity between the task requirements and the reference task requirements, and the second similarity between the task parameters and the reference task parameters, the workflow matching degree can be calculated based on the first similarity and the second similarity. This can help the system to find the reference workflow closest to the user requirements from the preset knowledge base summary, which is used for subsequent optimization and adjustment of the initial workflow to improve the quality and efficiency of the generated workflow, and there is no need for manual selection for comparison and effect judgment of the initial workflow, which greatly reduces labor costs.
[0048] In some embodiments, the initial workflow is adjusted according to the target reference workflow to obtain the target workflow, including: based on the target reference workflow, identifying error parameters of the initial workflow, the error parameters are obtained based on the workflow adjustment agent identification, the workflow adjustment agent represents the agent used to adjust the initial workflow according to the reference workflow; if there are error parameters in the initial workflow, the error parameters are returned to the workflow generation agent, the workflow generation agent represents the agent used to generate the initial workflow according to task requirements and task parameters; a new initial workflow is generated based on the error parameters, task requirements and task parameters, until the new initial workflow has no error parameters, then the new initial workflow is determined to be the target workflow.
[0049] Specifically, after obtaining the target workflow, the initial workflow can be adjusted based on the target reference workflow until the target workflow is obtained. The initial workflow can be adjusted by determining whether there are error parameters in the initial workflow, wherein the error parameters can represent parameter settings in the initial workflow that are significantly different from those in the target reference workflow or do not meet the task requirements.
[0050] By comparing the various parameters of the target reference workflow, the system can automatically identify which parameters are unreasonable or inappropriate. This process can be performed by the workflow adjustment agent, that is, a workflow adjustment agent is pre-set to detect and correct problems or mismatched parameters in the initial workflow. For example, the image generation model in the initial workflow is set to "cartoon style", and the target reference workflow uses "realistic style". The workflow adjustment agent can determine that the "cartoon style" parameter in the initial workflow is wrong. At this time, the parameter in the initial workflow can be directly replaced, or the wrong parameter can be returned to the workflow generation agent. Based on the initially decomposed task parameters and task requirements, the initial workflow is regenerated in combination with the wrong parameter until an accurate workflow is obtained.
[0051] When optimizing and adjusting the initial workflow, it can be understood as an iterative process. That is, each time a new initial workflow is generated, the system will check again to ensure that all parameters meet the task requirements and the standards of the target reference workflow. If there are still incorrect parameters, the system can continue to provide feedback to the workflow generation agent until all incorrect parameters are resolved and the target workflow is obtained.
[0052] According to the technical solution provided in the above embodiment, by identifying the error parameters, the error parameters are fed back to the workflow generation agent, and a new initial workflow is regenerated. After each correction of the error parameters, the system will generate a new workflow again, and repeat this process until there are no error parameters, and it is determined to be the target workflow. In this way, the target workflow that meets user needs can be obtained through iterative optimization between agents.
[0053] In some embodiments, executing the target workflow generation task through the workflow generation platform, after obtaining user instructions and identifying the task requirements corresponding to the user instructions and the task parameters corresponding to the user instructions, also includes: obtaining platform task information corresponding to the workflow generation platform, the platform task information includes the platform task type and the platform task parameter range corresponding to the platform task type, the platform task information represents the task information supported by the workflow generation platform for execution; if the task requirement is within the platform task type and the task parameter is within the platform task parameter range, then executing the target workflow generation task.
[0054] Specifically, before executing the workflow generation task, it is also possible to confirm whether the user's task requirements and parameters meet the support scope of the specific workflow generation platform.
[0055] Specifically, the platform task information corresponding to the workflow generation platform can be obtained. The workflow generation platform can represent the software platform that actually performs the generation task, and can generate specific types of content (such as images, texts, etc.) according to user needs. The platform task information can include the platform task type and the platform task parameter range, where the platform task type can represent the type of task that the platform can perform. For example, a platform may support tasks such as image generation, text generation, and data analysis. The platform task parameter range can represent the parameter range or restrictions corresponding to the task type, such as resolution, style, format, etc.
[0056] Furthermore, it can be determined whether the task requirements and task parameters corresponding to the user instructions conform to the task information of the platform. As an example, if the task requirement input by the user is "generate a realistic-style city image", the system will check whether this requirement is in the platform task type supported by the workflow generation platform, and check whether the task parameters specified by the user (such as image resolution of 1024×1024 and output format of JPG) are within the platform task parameter range supported by the platform. If both are satisfied, the workflow generation task will continue to be executed. If at least one of them is not satisfied, the workflow generation task will be terminated.
[0057] According to the technical solution provided in the above embodiment, by obtaining platform task information and judging whether the task parameters and task requirements corresponding to the user instructions meet the platform requirements based on the platform task information, if both meet the platform requirements, the workflow generation task continues to be executed; if there is at least one item that does not meet the platform requirements, the workflow generation task is terminated. This ensures the feasibility and effectiveness of the generated tasks, reduces the probability of errors, and improves the user experience. Through this inspection mechanism, the system can better manage user requests and platform capabilities, thereby smoothly generating accurate target workflows.
[0058] In some embodiments, after adjusting the initial workflow according to the target reference workflow to obtain the target workflow, it also includes: identifying the data format of the target workflow and the data format supported by the execution platform corresponding to the target workflow; if the data format of the target workflow is inconsistent with the data format supported by the execution platform, converting the data format of the target workflow to the data format supported by the execution platform.
[0059] Specifically, after generating the target workflow, the target workflow can be applied to the corresponding execution platform for execution. Of course, in order to ensure that the target workflow can run correctly on the execution platform, it is also necessary to ensure that the data format of the target workflow is within the data format supported by the execution platform. That is, if the data format of the target workflow does not meet the data format supported by the execution platform, the data format of the target workflow can also be converted.
[0060] The data format of the target workflow may include: JSON format, image format, text format, etc. When the execution platform does not support the data format of the target workflow, the data format of the target workflow can be adjusted to ensure that the target workflow can be recognized and run correctly by the execution platform. In this process, the system can automatically convert the data format that does not match the target workflow into a format supported by the platform according to the requirements of the execution platform. For example, if the data format of the target workflow is JPEG, but the execution platform does not support JPEG but supports PNG format, the data format of the target workflow can be converted from JPEG to PNG to ensure smooth execution of the workflow.
[0061] According to the technical solution provided in the above embodiment, it is possible to determine whether the data format of the target workflow satisfies the data format supported by the execution platform. If not, the format is converted to the data format supported by the execution platform. This ensures that the task is executed smoothly and that the target workflow is format compatible with the execution platform, thereby avoiding execution errors caused by format mismatch.
[0062] In some embodiments, after adjusting the initial workflow according to the target reference workflow to obtain the target workflow, it also includes providing the target workflow to the terminal corresponding to the execution platform and receiving user feedback from the terminal; if the user feedback meets the preset conditions, the target workflow is saved to the preset knowledge base.
[0063] Specifically, after the target workflow is generated, it can be delivered to the user for use. After the user uses it through the terminal, the system can collect user feedback on the corresponding target workflow. The feedback content may include the user's satisfaction with the target workflow execution task generation result, the completion effect and speed of the generated task, etc. The feedback can be in the form of rating, evaluation, text description, etc., which is not limited here. The system can set different analysis strategies based on different feedback forms, that is, when the corresponding feedback meets certain conditions, it is considered that the user believes that the corresponding target workflow is excellent. When the feedback analysis results of a preset number of users (for example, 100) are excellent, the target workflow can be stored in the preset knowledge base as a reference workflow for reference object for subsequent workflow generation optimization.
[0064] According to the technical solution provided in the above embodiment, by receiving and analyzing user feedback, more high-quality reference workflows can be continuously optimized and accumulated, thereby improving the effect of subsequent task generation.
[0065] Figure 2 This is an embodiment of the present application, and the following is combined with Figure 2 The embodiments of the present application are further described.
[0066] First, user instructions input by users can be received, for example: building an image generation workflow with the following requirements: 1. The generated image is realistic in style; 2. The generated image resolution is 1024×1024; 3. Allowing users to upload images as reference images.
[0067] Furthermore, the task planning agent can analyze the task requirements and task parameters corresponding to the user instructions, and use the workflow generation agent to process the task requirements and task parameters to obtain the initial workflow. The workflow adjustment agent extracts the target reference workflow from the preset knowledge base to optimize and adjust the initial workflow and identify incorrect parameters. If incorrect parameters exist, iterative training is performed based on the workflow generation agent and the workflow adjustment agent to obtain an accurate target workflow.
[0068] When delivering the target workflow to users, the data format of the target workflow can be converted based on the data format supported by the execution platform. The target workflow can then be delivered to users and receive user feedback. The user feedback content can be improved to a certain extent. For example, an excellent target workflow can be saved as an excellent case in the knowledge base for optimization reference in the subsequent workflow generation process summary.
[0069] In this way, through the collaboration of multiple intelligent agents, a complete workflow generation and optimization system can be built from the analysis of user input, workflow generation, optimization, to the final delivery of applications. Ultimately, user evaluation and feedback will reversely influence the system's knowledge base, helping the system to more efficiently meet user needs in future workflow generation. It does not require operators to have a lot of AI reserve knowledge, greatly reducing the labor cost of workflow generation.
[0070] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0071] The following are device embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0072] Figure 3 Schematic diagram of a workflow generation device provided in an embodiment of the present application. Figure 3 As shown, the workflow generation device includes:
[0073] The acquisition module 301 is configured to acquire a user instruction and identify a task requirement corresponding to the user instruction and a task parameter corresponding to the user instruction;
[0074] A generation module 302 is configured to process the task requirements and the task parameters using a predefined set of function nodes to generate an initial workflow;
[0075] A matching module 303 is configured to match the initial workflow with a reference workflow in a preset knowledge base, obtain a workflow matching degree, and determine a reference workflow whose workflow matching degree exceeds a threshold as a target reference workflow, wherein the preset knowledge base stores a plurality of reference workflows;
[0076] The adjustment module 304 is configured to adjust the initial workflow according to the reference workflow to obtain a target workflow.
[0077] In some embodiments, the generation module 302 is specifically used to determine the task sub-steps corresponding to the execution task requirements according to the task requirements; determine the workflow nodes according to the task sub-steps, and the workflow nodes represent the functional nodes corresponding to the task sub-steps in the predefined functional node set; assign the task parameters to the corresponding workflow nodes to obtain the initial workflow.
[0078] In some embodiments, the matching module 303 is specifically used to obtain the reference task requirements corresponding to the reference workflow, and the reference task parameters corresponding to the reference workflow; determine the first similarity based on the task requirements and the reference task requirements; determine the second similarity based on the task parameters and the reference task parameters; and determine the workflow matching degree based on the first similarity and the second similarity.
[0079] In some embodiments, the adjustment module 304 is specifically used to identify error parameters of the initial workflow based on the target reference workflow, the error parameters are identified based on the workflow adjustment agent, the workflow adjustment agent represents the agent used to adjust the initial workflow according to the reference workflow; if there are error parameters in the initial workflow, the error parameters are returned to the workflow generation agent, the workflow generation agent represents the agent used to generate the initial workflow according to task requirements and task parameters; a new initial workflow is generated based on the error parameters, task requirements and task parameters, until the new initial workflow has no error parameters, then the new initial workflow is determined to be the target workflow.
[0080] In some embodiments, the acquisition module 301 is specifically used to obtain platform task information corresponding to the workflow generation platform, the platform task information includes the platform task type and the platform task parameter range corresponding to the platform task type, and the platform task information represents the task information supported by the workflow generation platform for execution; if the task requirement is within the platform task type and the task parameter is within the platform task parameter range, the generation task of the target workflow is executed.
[0081] In some embodiments, the adjustment module 304 is specifically used to identify the data format of the target workflow and the data format supported by the execution platform corresponding to the target workflow; if the data format of the target workflow is inconsistent with the data format supported by the execution platform, the data format of the target workflow is converted into the data format supported by the execution platform.
[0082] In some embodiments, the adjustment module 304 is specifically used to provide the target workflow to the terminal corresponding to the execution platform and receive user feedback from the terminal; if the user feedback meets the preset conditions, the target workflow is saved to the preset knowledge base.
[0083] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0084] Figure 4 Schematic diagram of an electronic device 4 provided in an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 401 executes the computer program 403, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0085] The electronic device 4 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 4 may include, but is not limited to, a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 The electronic device 4 is merely an example and does not limit the electronic device 4 , and may include more or less components than those shown in the figure, or different components.
[0086] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0087] The memory 402 may be an internal storage unit of the electronic device 4, for example, a hard disk or memory of the electronic device 4. The memory 402 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. The memory 402 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device.
[0088] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0089] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0090] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for generating a workflow, characterized in that: include: Obtaining a user instruction, and identifying a task requirement corresponding to the user instruction and a task parameter corresponding to the user instruction; Processing the task requirements and the task parameters using a predefined set of function nodes to generate an initial workflow; Matching the initial workflow with a reference workflow in a preset knowledge base to obtain a workflow matching degree, and determining a reference workflow whose workflow matching degree exceeds a threshold as a target reference workflow, wherein the preset knowledge base stores a plurality of the reference workflows; The initial workflow is adjusted according to the target reference workflow to obtain a target workflow.
2. The method according to claim 1, characterized in that The process of processing the task requirements and the task parameters by using a predefined set of functional nodes to generate an initial workflow includes: According to the task requirements, determining the task sub-steps corresponding to the execution of the task requirements; Determine a workflow node according to the task sub-step, wherein the workflow node represents a function node in the predefined function node set corresponding to the task sub-step; The task parameters are assigned to corresponding workflow nodes to obtain the initial workflow.
3. The method according to claim 1, characterized in that The matching of the initial workflow with the reference workflow in the preset knowledge base to obtain the workflow matching degree includes: Acquire a reference task requirement corresponding to the reference workflow, and a reference task parameter corresponding to the reference workflow; Determining a first similarity according to the task requirement and the reference task requirement; Determining a second similarity based on the task parameters and the reference task parameters; The workflow matching degree is determined based on the first similarity and the second similarity.
4. The method according to claim 1, characterized in that: The step of adjusting the initial workflow according to the target reference workflow to obtain a target workflow includes: Based on the target reference workflow, identifying error parameters of the initial workflow, the error parameters are obtained based on the workflow adjustment agent identification, the workflow adjustment agent represents an agent used to adjust the initial workflow according to the reference workflow; If the initial workflow has the error parameter, the error parameter is returned to the workflow generation agent, where the workflow generation agent represents an agent used to generate the initial workflow according to the task requirements and the task parameters; A new initial workflow is generated based on the error parameter, the task requirement, and the task parameter, until the new initial workflow does not have the error parameter, and then the new initial workflow is determined to be the target workflow.
5. The method according to claim 1, characterized in that Executing the target workflow generation task through the workflow generation platform, after obtaining the user instruction and identifying the task requirement corresponding to the user instruction and the task parameter corresponding to the user instruction, further includes: Acquire platform task information corresponding to the workflow generation platform, wherein the platform task information includes a platform task type and a platform task parameter range corresponding to the platform task type, and the platform task information represents task information supported by the workflow generation platform for execution; If the task requirement is within the platform task type and the task parameter is within the platform task parameter range, the generation task of the target workflow is executed.
6. The method according to claim 1, characterized in that After the initial workflow is adjusted according to the target reference workflow to obtain the target workflow, the method further includes: Identify the data format of the target workflow and the data format supported by the execution platform corresponding to the target workflow; If the data format of the target workflow is inconsistent with the data format supported by the execution platform, the data format of the target workflow is converted into a data format supported by the execution platform.
7. The method according to claim 6, characterized in that After the initial workflow is adjusted according to the target reference workflow to obtain the target workflow, the method further includes: Providing the target workflow to a terminal corresponding to the execution platform, and receiving user feedback from the terminal; If the user feedback meets the preset condition, the target workflow is saved to the preset knowledge base.
8. A workflow generation device, characterized in that: include: An acquisition module is configured to acquire a user instruction and identify a task requirement corresponding to the user instruction and a task parameter corresponding to the user instruction; A generation module is configured to process the task requirements and the task parameters using a predefined set of function nodes to generate an initial workflow; a matching module configured to match the initial workflow with a reference workflow in a preset knowledge base to obtain a workflow matching degree, and determine a reference workflow whose workflow matching degree exceeds a threshold as a target reference workflow, wherein the preset knowledge base stores a plurality of the reference workflows; The adjustment module is configured to adjust the initial workflow according to the reference workflow to obtain a target workflow.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Task adaptive processing-oriented oil and gas intelligent application platform construction method and device
CN120146532A
Intelligent management and control method and system for whole process of contradiction regulation
CN120182051A
Intelligent workflow generation method and device, equipment and storage medium
CN121436624A
Multi-agent-based metal material data intelligent analysis method and medium
CN122086562A
Mineral prediction workflow generation method and device, equipment and medium
CN122431654A