Workflow generation method and apparatus, electronic device, medium, and product
Patent Information
- Application Number
- CN202610724961.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-25
- Publication Date
- 2026-08-18
AI Technical Summary
[0003]鉴于上述问题,本申请提供一种工作流生成方法、装置、电子设备、可读存储介质及计算机程序产品,能够解决难以准确解析用户意图,导致生成的工作流结构错误或逻辑缺失,准确率显著下降的问题
[0019] Fourthly, this application provides a readable storage medium storing a computer program, which, when executed by a processor, performs the workflow generation method described in any one of the first aspects.
Smart Images

Figure CN122593766A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a workflow generation method, apparatus, electronic device, readable storage medium, and computer program product. Background Technology
[0002] As enterprises deepen their digital transformation, the demand for automated workflow generation in complex business scenarios such as financial approvals, supply chain management, and IT operations orchestration is becoming increasingly urgent. Systems need to understand user natural language commands and automatically convert them into executable, structured processes. Existing technologies typically employ rule-based or template-based natural language processing methods, mapping user input to actions and data objects within the workflow using a predefined lexicon, and then populating these into fixed process templates to generate the workflow. However, this method heavily relies on static classification systems and process templates. When user commands contain complex business logic such as conditional branches and iterative loops, the system struggles to accurately interpret user intent, leading to errors in the generated workflow structure or logical gaps, resulting in a significant decrease in accuracy. Summary of the Invention
[0003] In view of the above problems, this application provides a workflow generation method, apparatus, electronic device, readable storage medium, and computer program product, which can solve the problem that it is difficult to accurately interpret user intent, resulting in errors in the generated workflow structure or logical omissions, and a significant decrease in accuracy.
[0004] Firstly, this application provides a workflow generation method, including: Based on a pre-defined process knowledge base, the natural language description data is identified to obtain the workflow type; The semantic parsing model is invoked to perform semantic parsing on the natural language description data based on the workflow type, thereby obtaining process node information; Based on the process node information, generate workflow configuration data; The workflow is generated based on the workflow configuration data.
[0005] In the above technical solution, the method can determine the workflow type through a preset process knowledge base, thereby providing a clear basis for semantic parsing, avoiding the blindness of semantic parsing, and thus improving the accuracy of parsing natural language description data. At the same time, it can also generate workflow configuration data and final workflow based on accurate process node information, thereby effectively reducing workflow structure errors and logical omissions caused by parsing deviations, improving the accuracy of workflow generation, and ensuring that the generated workflow can accurately correspond to the business requirements described in natural language.
[0006] In some implementations, the process of identifying natural language description data based on a preset process knowledge base to obtain workflow types includes: The natural language description data is subjected to semantic segmentation to obtain a set of semantic fragments; The set of semantic fragments is vectorized to obtain a set of semantic vectors; Based on a pre-defined process knowledge base, the semantic vector set is matched and identified to obtain the workflow type.
[0007] In the above technical solution, the method can improve the matching accuracy between natural language description and process knowledge base through semantic segmentation and vectorization processing, and achieve accurate identification of workflow type, thereby providing a reliable type basis for subsequent semantic parsing.
[0008] In some implementations, the invocation of the semantic parsing model, based on the workflow type, performs semantic parsing on the natural language description data to obtain process node information, including: The workflow type is associated with the current session history to obtain context information; The semantic parsing model is invoked, and based on the context information and the preset domain knowledge graph, the natural language description data is semantically parsed using a dynamic semantic mapping algorithm based on an attention mechanism to obtain the process node entities; The process node information of the process node entity is obtained through a structured interface; The process node information includes the node type and constraint metadata of the process node entity.
[0009] In the above technical solution, the method can combine the session context and the domain knowledge graph to improve the understanding depth of complex business semantics, thereby accurately extracting process node entities; at the same time, by obtaining node type and constraint metadata through structured interface specifications, it can also ensure that the process node information is complete, accurate and uniform in format, effectively avoiding semantic ambiguity and information loss.
[0010] In some implementations, generating workflow configuration data based on the process node information includes: Based on the node type and the constraint metadata, identify the node attributes of the process node entities and the logical relationships between the process node entities; Workflow configuration data is generated based on the node type, the constraint metadata, the node attributes, and the logical relationships; wherein the workflow configuration data includes at least role objectives, component descriptions, and constraints.
[0011] In the above technical solution, the method can accurately restore the business attributes and internal logical relationships of each process node, and generate standardized workflow configuration data containing complete business elements, thereby ensuring that the configuration information fits the business requirements and providing data support for the subsequent correct generation of executable workflows.
[0012] In some implementations, generating a workflow based on the workflow configuration data includes: The workflow configuration data is processed by a pre-configured encoder to obtain workflow semantic features; Based on the workflow semantic features, determine whether the business logic type described by the workflow configuration data is a complex logic type; wherein, the complex logic type includes at least one of condition judgment type, loop iteration type, and parallel execution type; If not, generate the workflow based on the workflow configuration data and the preset business template; If so, generate nested node combinations using the large language model and the workflow configuration data, and generate a workflow based on the nested node combinations.
[0013] In the above technical solution, the method can distinguish between simple and complex business logic and generate workflows in a differentiated manner, thereby taking into account both the generation efficiency of conventional processes and the structural integrity of complex logical processes. This effectively solves the problems of error-prone workflow generation and logical omissions under complex logic such as conditional branches, loops, and parallelism, and improves the adaptability and execution reliability of workflows.
[0014] In some implementations, after generating the workflow based on the workflow configuration data, the method further includes: Generate a visual flowchart and an executable file based on the described workflow; The executable file is executed by calling an external service to obtain execution status information; wherein, the execution status information includes branch triggering results and error logs; The execution status information is pushed to the user interface; Based on the execution status information and the user's feedback information regarding the execution status information, the parameters of the semantic parsing model are optimized.
[0015] In the above technical solution, the method can realize the visualization and executable implementation of workflow, as well as the effect of real-time monitoring and feedback of process execution status; at the same time, it can also continuously optimize the semantic parsing model by combining execution data and user feedback, thereby continuously improving the accuracy of workflow generation and business adaptability.
[0016] Secondly, this application provides a workflow generation apparatus, comprising: The identification unit is used to identify natural language description data based on a preset process knowledge base to obtain the workflow type; The parsing unit is used to call the semantic parsing model to perform semantic parsing on the natural language description data based on the workflow type, and obtain process node information; The first generation unit is used to generate workflow configuration data based on the process node information; The second generation unit is used to generate a workflow based on the workflow configuration data.
[0017] In the above technical solution, the device can determine the workflow type through a preset process knowledge base, thereby providing a clear basis for semantic parsing, avoiding the blindness of semantic parsing, and thus improving the accuracy of parsing natural language description data; at the same time, it can also generate workflow configuration data and final workflow based on accurate process node information, thereby effectively reducing workflow structure errors and logical omissions caused by parsing deviations, improving the accuracy of workflow generation, and ensuring that the generated workflow can accurately correspond to the business requirements described in natural language.
[0018] Thirdly, this application provides an electronic device including a memory and a processor, the memory storing a computer program, and the processor running the computer program to cause the electronic device to perform the workflow generation method described in any one of the first aspects.
[0019] Fourthly, this application provides a readable storage medium storing a computer program, which, when executed by a processor, performs the workflow generation method described in any one of the first aspects.
[0020] Fifthly, this application provides a computer program product comprising a computer program that, when executed by a processor, performs the workflow generation method described in any one of the first aspects.
[0021] The beneficial effects of this application are as follows: it can significantly improve the accuracy and semantic consistency of workflow generation through dynamic semantic parsing and multimodal modeling; it can also support complex workflows such as conditional, loop, and parallel workflows through complex logic modeling capabilities, thereby expanding the scope of process expression; it can also improve the cross-domain adaptability of models and reduce customization costs through self-feedback optimization and collaboration with domain knowledge bases; and it can also improve the efficiency and stability of process execution, reduce manual intervention, and lower the threshold for user use through continuous self-optimization and natural language interaction. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart illustrating the workflow generation method in some embodiments of this application; Figure 2 This is a schematic diagram of the workflow generation device in some embodiments of this application; Figure 3 This is a schematic diagram of the structure of an electronic device in some embodiments of this application. Detailed Implementation
[0024] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0026] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more (including two), similarly, "multiple sets" refers to two or more sets (including two sets), and "multiple pieces" refers to two or more pieces (including two pieces) unless otherwise explicitly defined.
[0027] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0028] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0029] Existing rule- and template-based workflow generation methods often rely on pre-defined static classification systems and fixed templates, making it difficult to parse complex business logic. This results in generated workflows with incorrect structures or missing logic, leading to significantly low accuracy. Therefore, this application proposes an automated workflow generation method.
[0030] This method proposes first identifying the workflow type corresponding to the user's intent based on a process knowledge base, and then performing in-depth analysis of the user input based on that workflow type. This significantly improves the accuracy of extracting process node information, thereby ensuring the accuracy of workflow configuration data acquisition and workflow generation. Based on this, the method can effectively automate the conversion from unstructured natural language requirements to structured executable workflows, and enhance the intelligence and convenience of workflow construction.
[0031] like Figure 1 As shown, some embodiments of this application provide a workflow generation method, which includes: S100: Based on a preset process knowledge base, the system identifies natural language description data to obtain the workflow type.
[0032] In this embodiment, the natural language description data is the text command input by the user or the text content converted from speech, which is used to represent the business requirements and operation process that the user needs to perform.
[0033] In this embodiment, the process knowledge base is a pre-built and stored collection of standard workflow templates, process nodes, business rules, and entity relationships. The process knowledge base is pre-configured based on business scenario specifications, historical process data, and system-defined process classification rules.
[0034] In this embodiment, the workflow type is a business process category that matches user needs, such as approval process, data processing process, task scheduling process, and service call process.
[0035] In this embodiment, the method first performs semantic segmentation on the natural language description data to obtain semantic fragments, then performs vectorization processing on the semantic fragments to obtain semantic vectors, and then performs similarity matching with a preset process knowledge base. Based on the matching results, the method accurately identifies and outputs the corresponding workflow type. For details of the identification process, please refer to steps S110 to S130.
[0036] S200: Invoke the semantic parsing model, based on the workflow type, to perform semantic parsing on the natural language description data and obtain the process node information.
[0037] In this embodiment, the method first associates the identified workflow type with the current session history to form context information; then, it uses the business domain and category corresponding to the workflow type as limiting conditions and inputs them into the semantic parsing model; finally, it combines domain knowledge graph and attention mechanism algorithms to perform targeted semantic parsing within the business scope of the current workflow type, thereby achieving the effect of extracting only the corresponding process node entities under this type. Step S210 also provides relevant explanations regarding this content.
[0038] In this embodiment, the semantic parsing model can be implemented using a pre-trained language model architecture. Examples include general-purpose semantic pre-trained models such as BERT, RoBERTa, and ERNIE. Preferably, this method employs the BERT model, which integrates a domain knowledge graph, as the specific implementation.
[0039] For example, this method can use a BERT model (bidirectional semantic encoding pre-trained language model) that integrates knowledge graphs, relying on BERT's built-in attention mechanism to improve the accuracy of entity and relation extraction, while introducing dynamic contextual prompts for association verification to accurately identify process attributes and logical relationships.
[0040] Specifically, this method first performs semantic encoding and feature extraction on the user input text using the BERT model, and then performs semantic alignment and feature fusion with the extracted semantic features and predefined entities, relationships and structured constraint information in the knowledge graph. The prior business knowledge of the knowledge graph is used to correct and supplement the semantic understanding results of the BERT model, thereby achieving a two-way combination of text semantics and structured knowledge.
[0041] In this embodiment, the process node information is output after semantic parsing, and includes structured process data containing node name, node type, functional attributes, logical associations, flow constraints and business rules.
[0042] S300: Generate workflow configuration data based on process node information.
[0043] In this embodiment, the workflow configuration data is a structured configuration information that integrates one or more pieces of information from node attributes, logical relationships, and constraint metadata based on process node information, and can be used for process instantiation, visualization, and automated execution. Among them, a single-node workflow can be generated solely based on node attributes and constraint metadata, without the need to configure logical relationships between nodes.
[0044] In this embodiment, node attributes, logical relationships, and constraint metadata are not data structure components of workflow configuration data, but rather input criteria and parsing elements used to calculate, process, and generate workflow configuration data.
[0045] In this embodiment, the workflow configuration data includes at least one of the following: role objectives, component descriptions, and constraints.
[0046] For example, when dealing with a simple single-node workflow, only the component description is required; when dealing with a general workflow, only the role, objective, and constraints are required, and the component description can be simplified or omitted; however, when dealing with a complex workflow, all three elements—role, objective, component description, and constraints—must be included.
[0047] In this embodiment, the role objective is the execution role identity and the business task objective to be completed corresponding to the process node entity; the component description is the functional description and configuration parameters of the functional components called by each process node entity; the constraints are the node execution rules, branch judgment logic, permission constraints and process flow restriction rules.
[0048] S400: Generate workflows based on workflow configuration data.
[0049] In this embodiment, the workflow is an automated business execution process arranged according to business logic rules, node relationships and constraints. It includes multiple process nodes, logical relationships between nodes, role and permission configurations and execution rules, which are used to realize the automated scheduling and orderly execution of business processes.
[0050] In summary, this method can construct a workflow generation process consisting of user input, semantic parsing, and process generation based on steps S100~S400, thereby achieving automated conversion from natural language to an executable workflow.
[0051] In the above embodiments, the method can determine the workflow type through a preset process knowledge base, thereby providing a clear basis for semantic parsing, avoiding the blindness of semantic parsing, and thus improving the accuracy of parsing natural language description data; at the same time, it can also generate workflow configuration data and final workflow based on accurate process node information, thereby effectively reducing workflow structure errors and logical omissions caused by parsing deviations, improving the accuracy of workflow generation, and ensuring that the generated workflow can accurately correspond to the business requirements described in natural language.
[0052] In some embodiments, step S100 may include: S110. Perform semantic segmentation on the natural language description data to obtain a set of semantic segments.
[0053] In this embodiment, the method supports bimodal input of text and voice. Specifically, the method can receive text commands or voice commands input by the user through a natural language interface.
[0054] In this embodiment, the method can perform semantic segmentation on the input natural language description data to obtain a set of semantic fragments.
[0055] In this embodiment, the method can segment, divide, and identify intents in the natural language description data input by the user based on preset business semantic rules and process logic boundaries. The entire continuous text instruction is decomposed according to independent operation actions, business conditions, execution objects, and process links to obtain multiple semantic units with complete business meanings, thus completing semantic segmentation processing.
[0056] S120. Perform vectorization on the set of semantic fragments to obtain a set of semantic vectors.
[0057] In this embodiment, the method can vectorize the split semantic fragments, transforming natural language content into numerical abstract feature expressions.
[0058] S130. Based on the preset process knowledge base, the semantic vector set is matched and identified to obtain the workflow type.
[0059] In this embodiment, the method can match vectorized semantic information with a process knowledge base to quickly identify the target workflow type, while combining historical interaction data to enhance contextual understanding.
[0060] In this embodiment, the method can calculate the similarity between the semantic vector and the standard vector of each workflow type in the process knowledge base, and select the workflow type with the highest matching degree based on the similarity value to complete the matching recognition.
[0061] In the above embodiments, the method can improve the matching accuracy between natural language description and process knowledge base through semantic segmentation and vectorization processing, and achieve accurate identification of workflow type, thereby providing a reliable type basis for subsequent semantic parsing.
[0062] In some embodiments, step S200 may include: S210. Associate the workflow type with the current session history to obtain context information.
[0063] In this embodiment, the current session history may include the instructions entered by the user in the current session, contextual interaction information, and historical parsing results.
[0064] In this embodiment, the method can integrate the identified workflow type with the current session history to construct complete contextual semantic information, providing accurate contextual support for the subsequent semantic parsing process.
[0065] In this embodiment, the method can weightedly fuse the business attributes and process constraint information corresponding to the workflow type with the user needs, operation preferences and contextual semantic features in the session history to form a unified global contextual semantic feature.
[0066] S220. Invoke the semantic parsing model, based on contextual information and a preset domain knowledge graph, and use an attention-based dynamic semantic mapping algorithm to perform semantic parsing on natural language description data to obtain process node entities.
[0067] In this embodiment, the domain knowledge graph is a pre-built structured knowledge set containing business-related entities, relationships, and rules, used to provide entity association basis and business support for semantic parsing, ensuring the accuracy of the parsing results.
[0068] Among them, the domain knowledge graph is built based on entity association rules, business operation specifications and semantic matching standards. It is used to standardize the semantic parsing process and ensure that the parsing results meet business requirements.
[0069] In this embodiment, the dynamic semantic mapping algorithm based on the attention mechanism refers to an algorithm that focuses on key semantic information in the input text through the attention mechanism, dynamically adjusts the semantic mapping weights, achieves accurate parsing of natural language, and extracts semantic units that conform to business logic.
[0070] In this embodiment, a process node entity refers to an operational unit or business node with independent business meaning, parsed from natural language requirements. There are typically multiple nodes, each corresponding to a specific business operation or requirement, serving as the foundation for subsequent workflow construction.
[0071] In this embodiment, the method can extract business entities and generate corresponding entity feature vectors based on contextual information and a preset domain knowledge graph through a dynamic semantic mapping algorithm based on an attention mechanism.
[0072] In this embodiment, the method can align contextual semantic features with entity relationships in the domain knowledge graph, and dynamically focus on key semantic fragments through an attention mechanism, thereby identifying and extracting business objects, operational actions, and constraints in natural language descriptions. Then, the extracted business entities are vectorized and encoded to generate entity feature vectors of corresponding dimensions.
[0073] S230. Obtain the process node information of the process node entity through the structured interface; wherein, the process node information includes the node type and constraint metadata of the process node entity.
[0074] In this embodiment, node type refers to the business attributes and functional classifications of process nodes in the workflow, including but not limited to approval nodes, execution nodes, judgment nodes, data processing nodes, notification nodes, etc.
[0075] In this embodiment, constraint metadata refers to structured constraint information used to limit the execution rules, triggering conditions, permission scope, data format and flow logic of process nodes, including node execution conditions, approval permissions, data verification rules, timeout rules, flow branch conditions, etc.
[0076] In this embodiment, the method can semantically match and align user input with corresponding entities in the domain knowledge graph, and then obtain the node type and constraint metadata corresponding to the matched process node entities through a preset structured interface.
[0077] In the above embodiments, the method can combine session context and domain knowledge graph to improve the understanding depth of complex business semantics, thereby accurately extracting process node entities; at the same time, by obtaining node type and constraint metadata through structured interface specifications, it can also ensure that process node information is complete, accurate and uniform in format, effectively avoiding semantic ambiguity and information loss.
[0078] In some embodiments, step S300 may include: S310. Based on the node type and constraint metadata, identify the node attributes of the process node entities and the logical relationships between the process node entities.
[0079] In this embodiment, node attributes are a set of parameters used to describe the characteristics and configuration information of a process node, including node name, node type, execution permissions, triggering conditions, processing objects, timeout rules, and data format requirements.
[0080] In this embodiment, the logical relationship between process node entities refers to the execution order, dependency constraints, branch judgment and flow rules of each process node in the workflow, including sequential execution, conditional branching, parallel execution, cyclic execution, dependency triggering and other relationships.
[0081] For example, when a process node entity is identified as an approval node type, the method can extract node attributes such as approval authority, approval level, and triggering conditions based on the corresponding constraint metadata; at the same time, based on the flow rules and dependency conditions in the constraint metadata, the method can determine the logical relationships such as sequential execution and conditional branches between the approval node and the preceding submission node and the subsequent execution node.
[0082] S320. Generate workflow configuration data based on node type, constraint metadata, node attributes, and logical relationships; wherein, the workflow configuration data includes at least role objectives, component descriptions, and constraints.
[0083] In this embodiment, the method can integrate role objectives, component descriptions and constraints through a template engine based on node type, constraint metadata, node attributes and logical relationships between nodes to obtain standardized workflow configuration data.
[0084] For example, this method can determine the execution role and business objective corresponding to each node based on the node type of the process node, forming role objectives; extract the functional components, execution methods and configuration information corresponding to each node based on node attributes and constraint metadata, forming component descriptions; determine the execution order, branch conditions and permission constraints of the workflow based on the logical relationship and flow rules between nodes, forming restriction conditions; and then integrate the above content through a template engine to generate standardized workflow configuration data.
[0085] In the above embodiments, the method can accurately restore the business attributes and internal logical relationships of each process node, and generate standardized workflow configuration data containing complete business elements, thereby ensuring that the configuration information fits the business requirements and providing data support for the subsequent correct generation of executable workflows.
[0086] In some embodiments, step S400 may include: S410. The workflow configuration data is processed by a pre-configured encoder to obtain workflow semantic features.
[0087] In this embodiment, the encoder is a deep coding model pre-trained based on business workflow samples. It is used to extract features and vectorize the structured workflow configuration data, transforming the textual and structured workflow configuration information into low-dimensional, dense workflow semantic features with semantic representation capabilities.
[0088] In this embodiment, the workflow semantic feature is a dense feature vector obtained by encoding and abstracting the workflow configuration data. It is used to characterize the overall business meaning, node logic, role permissions, and constraint rules of the workflow.
[0089] In this embodiment, the method can use a pre-trained and configured encoder to perform feature encoding and abstract representation on standardized workflow configuration data to obtain the corresponding workflow semantic features.
[0090] S420. Based on the semantic features of the workflow, determine whether the business logic type described by the workflow configuration data is a complex logic type. If yes, proceed to step S440; otherwise, proceed to step S430.
[0091] In this embodiment, the complex logic type includes at least one of condition judgment type, loop iteration type, and parallel execution type.
[0092] In this embodiment, the condition judgment type refers to the business logic type in the workflow that includes branch judgment, condition jump, and selection of different execution paths based on different constraint rules.
[0093] In this embodiment, the loop iteration type refers to a business logic type in the workflow that involves repeated execution, loop processing, or termination only after a specified number of times or when a termination condition is met.
[0094] In this embodiment, parallel execution type refers to a business logic type in which multiple process nodes in the workflow are triggered simultaneously, executed synchronously, are independent of each other, and must all be completed before entering the next node.
[0095] In this embodiment, the method can automatically distinguish and determine whether business logic is a regular business logic or a complex business logic type based on workflow semantic features.
[0096] S430. Generate workflow based on workflow configuration data and preset business templates.
[0097] In this embodiment, for conventional business logic scenarios, the method can quickly generate standardized workflows based on preset business templates and workflow configuration data.
[0098] S440 generates nested node combinations through large language models and workflow configuration data, and generates workflows based on the nested node combinations.
[0099] In this embodiment, for complex business logic scenarios, the method can call a large language model that is finely tuned and optimized based on a specific business dataset, combine it with workflow configuration data, generate a nested node combination that conforms to the business logic, and complete the construction of the workflow based on the nested node combination.
[0100] In the above embodiments, the method can distinguish between simple and complex business logic and generate workflows in a differentiated manner, thereby taking into account both the generation efficiency of conventional processes and the structural integrity of complex logic processes. This effectively solves the problems of error-prone workflow generation and logical omissions under complex logics such as conditional branches, loops, and parallelism, and improves the adaptability and execution reliability of workflows.
[0101] In some embodiments, after step S400, the method may further include: S500 generates visual flowcharts and executable files based on workflows.
[0102] In this embodiment, the visual flowchart is a schematic diagram of the process formed by graphically arranging and displaying each process node, node attribute and mutual logical relationship of the workflow. It is used to intuitively present the business flow sequence, branch logic, nested structure and node configuration information.
[0103] In this embodiment, the executable file is a deployable program file formed by standardizing and encapsulating the node rules, constraints, flow logic and business configuration of the complete workflow. It can be directly loaded, parsed and automatically drive the workflow scheduling and execution.
[0104] In this embodiment, the method can visualize and render the generated workflow, generate a corresponding visual flowchart, and encapsulate the workflow into an executable file to support the subsequent deployment and operation of the workflow.
[0105] S600: By calling an external service to execute the executable file, execution status information is obtained; the execution status information includes branch triggering results and error logs.
[0106] In this embodiment, the branch trigger result refers to the corresponding execution branch, flow path and node jump result triggered by the workflow during execution based on preset conditions, which is used to reflect the actual execution direction of the workflow.
[0107] In this embodiment, the error log refers to the abnormal information, execution failure records, node error content and fault reasons generated during workflow execution, which is used for workflow anomaly location, problem investigation and operation debugging.
[0108] In this embodiment, the method can run an executable file by calling an external service to execute the corresponding workflow and provide real-time feedback on the execution status information, including branch triggering results and error logs.
[0109] S700: Push execution status information to the user interface.
[0110] In this embodiment, the method can push workflow execution status information to the user interface in real time, realizing visual monitoring and status display of the workflow execution process.
[0111] S800: Optimize the parameters of the semantic parsing model based on the execution status information and the user's feedback on the execution status information.
[0112] In this embodiment, the method can dynamically adjust the semantic parsing model based on workflow execution status information and user feedback information through a self-feedback optimization module, analyze execution error cases using a backtracking mechanism, generate corresponding model optimization parameters according to different error types, and continuously update the association strength between entities in the knowledge graph, thereby achieving a continuous improvement in the accuracy of the semantic parsing model.
[0113] In the above embodiments, the method can realize the visualization and executable implementation of workflows, as well as the effect of real-time monitoring and feedback of process execution status; at the same time, it can also continuously optimize the semantic parsing model by combining execution data and user feedback, thereby continuously improving the accuracy of workflow generation and business adaptability.
[0114] like Figure 2 As shown, some embodiments of this application provide a schematic diagram of a workflow generation apparatus. It should be understood that this apparatus is related to... Figure 1 The method executed in the middle corresponds to the steps involved in the aforementioned method. The specific functions and effects of the device can be found in the description above. To avoid repetition, detailed descriptions are omitted here.
[0115] The workflow generation device includes: The recognition unit 910 is used to recognize natural language description data based on a preset process knowledge base to obtain the workflow type; The parsing unit 920 is used to call the semantic parsing model to perform semantic parsing on the natural language description data based on the workflow type, and obtain the process node information. The first generation unit 930 is used to generate workflow configuration data based on process node information; The second generation unit 940 is used to generate a workflow based on workflow configuration data.
[0116] In some embodiments, the identification unit 910 includes: Segmentation subunit 911 is used to perform semantic segmentation processing on natural language description data to obtain a set of semantic fragments; Vectorization subunit 912 is used to vectorize the set of semantic segments to obtain a set of semantic vectors; The first identification subunit 913 is used to match and identify the semantic vector set based on a preset process knowledge base to obtain the workflow type.
[0117] In some embodiments, the parsing unit 920 includes: The association subunit 921 is used to associate the workflow type with the current session history to obtain context information; The parsing subunit 922 is used to call the semantic parsing model, which uses contextual information and a preset domain knowledge graph as a basis to perform semantic parsing on natural language description data through a dynamic semantic mapping algorithm based on an attention mechanism to obtain process node entities; Get subunit 923, used to obtain process node information of process node entities through structured interfaces; The process node information includes the node type and constraint metadata of the process node entity.
[0118] In some embodiments, the first generation unit 930 includes: The second identification subunit 931 is used to identify the node attributes of process node entities and the logical relationships between process node entities based on node type and constraint metadata. The first generation subunit 932 is used to generate workflow configuration data based on node type, constraint metadata, node attributes and logical relationships; wherein the workflow configuration data includes at least role objectives, component descriptions and constraints.
[0119] In some embodiments, the second generation unit 940 includes: Encoding subunit 941 is used to process workflow configuration data through a pre-configured encoder to obtain workflow semantic features; The judgment subunit 942 is used to determine whether the business logic type described by the workflow configuration data is a complex logic type based on the workflow semantic features; wherein, the complex logic type includes at least one of condition judgment type, loop iteration type, and parallel execution type; The second generation subunit 943 is used to generate a workflow based on workflow configuration data and preset business template when the judgment result of the judgment subunit 942 is negative. The second generation subunit 943 is also used to generate nested node combinations through the large language model and workflow configuration data when the judgment result of the judgment subunit 942 is yes, and to generate a workflow based on the nested node combinations.
[0120] In some embodiments, the workflow generation apparatus further includes: The third generation unit 950 is used to generate a visual flowchart and an executable file based on the workflow after the second generation unit 940 generates the workflow based on the workflow configuration data. Execution unit 960 is used to execute an executable file by calling an external service and obtain execution status information, including branch triggering results and error logs. Push unit 970 is used to push execution status information to the user interface; The optimization unit 980 is used to optimize the parameters of the semantic parsing model based on the execution status information and the user's feedback information on the execution status information.
[0121] like Figure 3As shown, this application provides an electronic device 1000, which includes a processor 1001 and a memory 1002. The processor 1001 and the memory 1002 are interconnected and communicate with each other through a communication bus 1003 and / or other forms of connection mechanism (not shown). The memory 1002 stores a computer program that can be executed by the processor 1001. When the computing device is running, the processor 1001 executes the computer program to perform the method in any of the aforementioned optional implementations.
[0122] This application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the method in any of the aforementioned optional implementations.
[0123] The computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0124] This application provides a computer program product, which includes a computer program that, when run by a processor, executes the method in any of the aforementioned optional implementations.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application. In particular, as long as there is no conflict, the various technical features mentioned in the embodiments can be combined in any way. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
Claims
1. A workflow generation method, characterized in that, include: Based on a pre-defined process knowledge base, the natural language description data is identified to obtain the workflow type; The semantic parsing model is invoked to perform semantic parsing on the natural language description data based on the workflow type, thereby obtaining process node information; Based on the process node information, generate workflow configuration data; The workflow is generated based on the workflow configuration data.
2. The workflow generation method according to claim 1, characterized in that, The process knowledge base, based on a pre-set process description, identifies natural language description data to obtain workflow types, including: The natural language description data is subjected to semantic segmentation to obtain a set of semantic fragments; The set of semantic fragments is vectorized to obtain a set of semantic vectors; Based on a pre-defined process knowledge base, the semantic vector set is matched and identified to obtain the workflow type.
3. The workflow generation method according to claim 1, characterized in that, The invoke semantic parsing model, based on the workflow type, performs semantic parsing on the natural language description data to obtain process node information, including: The workflow type is associated with the current session history to obtain context information; The semantic parsing model is invoked, and based on the context information and the preset domain knowledge graph, the natural language description data is semantically parsed using a dynamic semantic mapping algorithm based on an attention mechanism to obtain the process node entities; The process node information of the process node entity is obtained through a structured interface; The process node information includes the node type and constraint metadata of the process node entity.
4. The workflow generation method according to claim 3, characterized in that, The step of generating workflow configuration data based on the process node information includes: Based on the node type and the constraint metadata, identify the node attributes of the process node entities and the logical relationships between the process node entities; Workflow configuration data is generated based on the node type, the constraint metadata, the node attributes, and the logical relationships; wherein the workflow configuration data includes at least role objectives, component descriptions, and constraints.
5. The workflow generation method according to claim 1, characterized in that, The step of generating a workflow based on the workflow configuration data includes: The workflow configuration data is processed by a pre-configured encoder to obtain workflow semantic features; Based on the workflow semantic features, determine whether the business logic type described by the workflow configuration data is a complex logic type; wherein, the complex logic type includes at least one of condition judgment type, loop iteration type, and parallel execution type; If not, generate the workflow based on the workflow configuration data and the preset business template; If so, generate nested node combinations using the large language model and the workflow configuration data, and generate a workflow based on the nested node combinations.
6. The workflow generation method according to claim 1, characterized in that, After generating the workflow based on the workflow configuration data, the method further includes: Generate a visual flowchart and an executable file based on the described workflow; The executable file is executed by calling an external service to obtain execution status information; wherein, the execution status information includes branch triggering results and error logs; The execution status information is pushed to the user interface; Based on the execution status information and the user's feedback information regarding the execution status information, the parameters of the semantic parsing model are optimized.
7. A workflow generation device, characterized in that, The workflow generation device includes: The identification unit is used to identify natural language description data based on a preset process knowledge base to obtain the workflow type; The parsing unit is used to call the semantic parsing model to perform semantic parsing on the natural language description data based on the workflow type, and obtain process node information; The first generation unit is used to generate workflow configuration data based on the process node information; The second generation unit is used to generate a workflow based on the workflow configuration data.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to cause the electronic device to perform the workflow generation method according to any one of claims 1 to 6.
9. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, performs the workflow generation method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, performs the workflow generation method according to any one of claims 1 to 6.