An AI workflow generation method and system driven by SOP
Patent Information
- Application Number
- CN202611479176.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-22
- Publication Date
- 2026-10-27
AI Technical Summary
[0006]因此,本发明解决的技术问题是:现有的基于流程描述文本生成工作流的方法存在显式流程步骤与实际执行所需节点之间衔接不完整、节点间数据流连续性低、工作流结构对不同执行环境的适配效率低,以及如何在执行环境能力约束下实现节点拓扑重构和异常处理分支补全的问题
[0018]本发明的有益效果:本发明提供的SOP驱动的AI工作流生成方法通过对流程描述形成的节点序列进行数据流连续性检测并补全影响执行衔接的隐含节点,使流程描述中的显式业务步骤能够形成数据连续、逻辑完整的节点结构;通过结合目标执行环境的能力约束对节点结构进行拓扑调整,并依据节点运行状态补充异常处理路径,使生成的节点图能够适配实际执行环境并保持异常状态下的流程完整性;通过将完成结构适配的节点图转换为目标执行环境可识别的工作流配置,使流程描述、节点结构与实际执行配置之间形成连续转换关系;本发明在工作流节点的数据衔接完整性、节点结构与执行环境的适配性以及工作流配置的可执行性方面均取得更加良好的效果。
Smart Images

Figure CN122985126A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and computer software technology, specifically to a method and system for generating AI workflows driven by Standard Operating Procedures (SOPs). Background Technology
[0002] With the development of business process digitization and artificial intelligence technologies, standard operating procedures are gradually transforming from static text into process knowledge that can be parsed and executed by software systems. Existing workflow generation technologies typically use natural language processing, semantic recognition, and node extraction to identify execution actions, conditional relationships, and data objects from process description text, and then convert the recognition results into node sequences or flowchart structures. To improve the parsing capabilities of complex process descriptions, related technologies also introduce multimodal content parsing, unified intermediate representation, and joint classification using rule models and neural networks, enabling process information in text, tables, and flowcharts to enter a unified processing procedure.
[0003] As intelligent execution components become increasingly abundant, after nodes are generated, it is necessary to combine semantic matching, input / output types, and business scenarios to select appropriate execution capabilities for the nodes, and complete workflow orchestration according to the data transmission and control relationships between nodes. Different execution environments typically have limitations such as the number of nodes, nesting depth, interface types, and configuration formats. The workflow generation results also need to undergo structural adjustments, parameter binding, and configuration conversion before entering the target execution environment.
[0004] While existing technologies can parse process text and arrange basic nodes, a significant structural conversion gap remains between process descriptions and executable workflows. Process descriptions often only record business actions and target results, while execution content such as data validation, format conversion, and intermediate processing may not be explicitly stated. When directly constructing node sequences based on explicit steps, mismatched input / output types or gaps in business logic can easily occur between adjacent nodes. When a single step contains multiple complex actions, directly mapping it to a single node may also result in unclear data relationships within the node. Furthermore, once the node graph enters a specific execution environment, it may be limited by node capacity and execution structure. When the existing process structure cannot directly meet the target execution environment, the node organization needs to be readjusted. When input anomalies, execution timeouts, or external service unavailability occur during node operation, the original process description usually lacks execution paths corresponding to the abnormal states. It can be seen that existing workflow generation technologies, when converting process description text into node structures, often struggle to form a data-continuous, logically complete workflow structure that adapts to the target execution environment's requirements, given the coexistence of implicit execution content, differences in node data connections, and constraints on execution environment capabilities. Summary of the Invention
[0005] In view of the above-mentioned problems, the present invention is proposed.
[0006] Therefore, the technical problem solved by this invention is that existing methods for generating workflows based on process description text have problems such as incomplete connection between explicit process steps and nodes required for actual execution, low continuity of data flow between nodes, low adaptability of workflow structure to different execution environments, and how to achieve node topology reconstruction and exception handling branch completion under the constraints of execution environment capabilities.
[0007] To address the aforementioned technical problems, this invention provides the following technical solution: a SOP-driven AI workflow generation method, comprising: acquiring process description text and extracting an initial node sequence based on the process description text; inferring and completing hidden nodes based on data flow continuity detection between adjacent nodes in the initial node sequence to construct an initial node graph with closed data flow; acquiring a capability constraint matrix of the target execution environment, performing topology reconstruction and anomaly handling branch completion on the initial node graph based on the capability constraint matrix to form a target node graph; and serializing and generating a target workflow configuration adapted to the capability constraint matrix based on the target node graph.
[0008] As a preferred embodiment of the SOP-driven AI workflow generation method of the present invention, the step of extracting the initial node sequence based on the process description text includes: identifying the content block type of the process description text, wherein the content block type includes paragraph text blocks, table structure blocks, and list enumeration blocks; executing corresponding parsing strategies for different types of content blocks to extract node information; and merging the parsing results of each content block into the initial node sequence.
[0009] As a preferred embodiment of the SOP-driven AI workflow generation method described in this invention, the step of extracting the initial node sequence based on the process description text further includes: converting the multimodal process description text into a unified intermediate representation structure, and classifying node types based on a rule engine and a neural network model to form the initial node sequence; matching corresponding functional components for each node in the initial node sequence based on multi-dimensional fusion of semantic similarity, functional similarity, and scene similarity; extracting action units as candidate nodes from the process description text based on dependency parsing; applying heuristic rules to filter invalid candidate nodes and merging consecutive candidate nodes with semantic similarity greater than a preset similarity threshold; calculating the confidence score of each candidate node based on semantic matching degree, historical accuracy, and contextual coherence, and determining the initial node sequence based on the confidence score.
[0010] As a preferred embodiment of the SOP-driven AI workflow generation method described in this invention, the step of matching corresponding functional components for each node in the initial node sequence includes: obtaining a first candidate set by keyword matching using a bag-of-words model and a sorting algorithm; obtaining a second candidate set by template matching by calculating the structural similarity between the unified intermediate representation structure and a predefined scene template; obtaining a third candidate set by semantic embedding matching by retrieving historical successful cases from a vector database; and determining the functional components based on the first candidate set, the second candidate set, and the third candidate set.
[0011] As a preferred embodiment of the SOP-driven AI workflow generation method described in this invention, the inference and completion of hidden nodes includes: detecting the data type matching degree of the input data and output data between adjacent nodes; when the data type matching degree is detected to be inconsistent with the preset matching conditions, or when a logical gap is detected between adjacent nodes, inserting a data conversion node or a data verification node between the adjacent nodes as the hidden node.
[0012] As a preferred embodiment of the SOP-driven AI workflow generation method of the present invention, the step of inserting a data conversion node or data verification node as the hidden node between adjacent nodes includes: parsing the pre-condition or result clauses of the step description in the process description text, and extracting the pre-condition node or post-action node as the hidden node; when the data type matching degree is detected to be inconsistent with the preset matching condition, automatically generating a data conversion node based on the data types of the input and output data of the adjacent nodes and inserting it between the adjacent nodes; when a single step in the process description text contains different compound actions, splitting the single step into different sub-nodes and verifying the data flow continuity between the different sub-nodes, and if the verification fails, inserting the data conversion node between the different sub-nodes.
[0013] As a preferred embodiment of the SOP-driven AI workflow generation method described in this invention, the step of performing topology reconstruction and anomaly handling branch completion on the initial node graph based on the capability constraint matrix includes: when a conflict is detected between the topological features of the initial node graph and the capability constraint matrix, performing a node aggregation operation or a nested flattening operation on the initial node graph; triggering anomaly handling branch completion based on the node execution status or external service status, and connecting the generated anomaly handling node to the initial node graph; when the input data of a node is detected to be empty or formatted incorrectly, generating a data cleaning node or a default value filling node; when the execution time of a node is detected to exceed a preset time threshold, generating a retry node or a degraded execution node; when the confidence level of the output result is detected to be lower than a preset confidence threshold, generating a manual review node; and when an external interface call fails, generating a cache read node or a backup service switching node.
[0014] As a preferred embodiment of the SOP-driven AI workflow generation method described in this invention, the step of performing node aggregation or nesting flattening operation on the initial node graph includes: when the number of nodes in the initial node graph exceeds the upper limit of the number of nodes in the capability constraint matrix, merging multiple nodes with similar functions into a composite node, or merging linearly connected nodes into a batch processing node; when the nesting depth of the initial node graph exceeds the upper limit of the depth in the capability constraint matrix, extracting deeply nested conditional branches into sub-workflows, and implementing logical nesting through workflow calling nodes.
[0015] As a preferred embodiment of the SOP-driven AI workflow generation method described in this invention, after the serialization generation of the target workflow configuration adapted to the capability constraint matrix, the method further includes performing format verification and sandbox pre-execution verification on the target workflow configuration; when the verification fails, the method backtracks to the topology reconstruction or the completion step of the hidden node based on the error type for iterative correction until the verification passes or the preset iteration limit is reached.
[0016] Another objective of this invention is to provide an SOP-driven AI workflow generation system that can perform data flow continuity detection and implicit node completion on the initial node sequence formed by the process description text, and perform topology reconstruction and anomaly handling branch completion on the node structure in combination with the capability constraints of the target execution environment. This solves the problems of incomplete process node data connection and mismatch between the generated node structure and the capability constraints of the target execution environment in existing workflow generation technologies.
[0017] As a preferred embodiment of the SOP-driven AI workflow generation system of the present invention, it includes: a process parsing and node extraction module, a data flow closure and graph construction module, a topology reconstruction and anomaly completion module, and a workflow configuration generation module; the process parsing and node extraction module is used to obtain process description text and extract an initial node sequence based on the process description text; the data flow closure and graph construction module is used to infer and complete hidden nodes based on the data flow continuity detection between adjacent nodes in the initial node sequence to construct an initial node graph with data flow closure; the topology reconstruction and anomaly completion module is used to obtain the capability constraint matrix of the target execution environment, and perform topology reconstruction and anomaly handling branch completion on the initial node graph based on the capability constraint matrix to obtain the target node graph; the workflow configuration generation module is used to serialize and generate a target workflow configuration adapted to the capability constraint matrix based on the target node graph.
[0018] The beneficial effects of this invention are as follows: The SOP-driven AI workflow generation method provided by this invention performs data flow continuity detection on the node sequence formed by the process description and completes the implicit nodes that affect execution connection, enabling the explicit business steps in the process description to form a data-continuous and logically complete node structure; by combining the capability constraints of the target execution environment to adjust the node structure topology and supplementing the abnormal handling path according to the node running status, the generated node graph can adapt to the actual execution environment and maintain the integrity of the process under abnormal conditions; by converting the node graph with the completed structure adaptation into a workflow configuration that can be recognized by the target execution environment, a continuous conversion relationship is formed between the process description, node structure and actual execution configuration; this invention achieves better results in terms of the data connection integrity of workflow nodes, the adaptability of node structure to the execution environment, and the executability of workflow configuration. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the overall process of an SOP-driven AI workflow generation method provided by the present invention.
[0021] Figure 2 The flowchart for implicit node completion driven by data flow continuity is provided for an SOP-driven AI workflow generation method according to the present invention.
[0022] Figure 3The overall timing diagram of an SOP-driven AI workflow generation method provided by the present invention. Detailed Implementation
[0023] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0024] Example 1, referring to Figures 1-3 As an embodiment of the present invention, a method for generating an AI workflow driven by an SOP is provided, comprising: During execution, the process description text 100 corresponding to the SOP (Standard Operating Procedure) is first read, and the execution actions are extracted one by one according to the order of the business steps in the process description.
[0025] SOP stands for Standard Operating Procedure, which is a process document used to describe the business execution process, operation steps, and logical relationships between steps.
[0026] For example, if the process description states "obtain industry data, analyze the data after confirming its completeness, and generate a report based on the analysis results", then the three explicit execution actions of "obtain industry data", "analyze industry data" and "generate report" are obtained from the process description, forming the data acquisition node, data analysis node and report generation node respectively, and arranged according to the original business sequence of the SOP to form the initial node sequence 101.
[0027] When forming each node, the data that the node needs to receive and the data generated after the node's execution are recorded simultaneously. The input record for the data acquisition node is the data source information, and the output record is the acquired raw data; the input record for the data analysis node is the data to be analyzed, and the output record is the analysis result; the input record for the report generation node is the analysis result, and the output record is the report file. The initial node sequence 101 not only saves the node execution order, but also saves the data input and output relationship between the preceding and following nodes.
[0028] Then, the continuity of data flow between adjacent nodes is checked according to the node arrangement order.
[0029] Specifically, the system reads the output data type of the data acquisition node and the input data type of the data analysis node. When the data acquisition node outputs document data, while the data analysis node requires structured data as input, the two cannot directly establish a valid data transfer relationship. Therefore, the two nodes are marked as having a data connection gap.
[0030] To address the aforementioned data gap, a data transformation node is generated between the data acquisition node and the data analysis node. The data transformation node receives the raw document output from the data acquisition node, parses the text or field content within the document, and forms structured data according to the input structure required by the data analysis node. Subsequently, the output of the data transformation node is connected to the input of the data analysis node.
[0031] The data acquisition node to data analysis node should be changed to data acquisition node to data transformation node to data analysis node.
[0032] At the same time, the execution condition "after confirming that the data is complete" in the process description is analyzed.
[0033] In this embodiment, the data transmission relationship between adjacent nodes in the initial node sequence 101 is detected to determine whether there are any hidden nodes that need to be filled in. When the input and output data between adjacent nodes in the initial node sequence 101 cannot be directly correlated, the data type matching degree between the output data of the previous node and the input data of the next node is detected. When the output data type is consistent with the input data type, or the data type conversion can be achieved through a data conversion node, it is determined that the data transmission conditions between adjacent nodes are met; when there is no correspondence between the output data type and the input data type, and data adaptation cannot be completed through a data conversion node, it is determined that there is a data connection gap between adjacent nodes, and a data conversion node is inserted between adjacent nodes as a hidden node.
[0034] Furthermore, a continuity analysis is performed on the process semantics corresponding to adjacent nodes. Based on the execution conditions, action relationships, and contextual relationships in the process description text 100, it is determined whether there is a logical gap between adjacent nodes. When it is detected that the pre-execution conditions in the process description text 100 do not form independent nodes, or that subsequent actions lack necessary processing steps, the corresponding missing execution content is identified as a hidden node.
[0035] Hidden nodes include data transformation nodes, data verification nodes, prerequisite condition nodes, and post-action nodes.
[0036] For example, if the initial node sequence 101 contains a data acquisition node and a data analysis node, but there is no corresponding data integrity check action, it indicates that the data output by the data acquisition node cannot directly meet the execution conditions of the data analysis node. Therefore, a data verification node is added between the data acquisition node and the data analysis node. The data output by the data acquisition node first enters the data verification node, where the data verification node checks the data integrity. When the data meets the integrity requirements, the verified data is sent to the data analysis node to form a continuous data processing relationship.
[0037] In another implementation, when the step description in the process description text 100 contains pre-condition or result clauses, but the corresponding content does not form an independent execution step, the pre-condition or result clauses are parsed, and the missing execution content is formed into pre-condition nodes or post-action nodes as implicit nodes. For example, the process description text 100 describes "generating analysis results after completing data review," but the initial node sequence 101 only contains data review nodes and result generation nodes. Therefore, corresponding pre-condition nodes are added based on the execution condition "after completing data review" to complete the logical relationship between nodes.
[0038] When a single step in the process description text 100 contains multiple compound actions, the action relationship corresponding to that step is split into multiple sub-nodes, and the continuity of data flow between different sub-nodes is verified. When there is a data type mismatch or missing data transmission between adjacent sub-nodes, a data conversion node is inserted between the corresponding sub-nodes to achieve data connection between the sub-nodes.
[0039] Traverse all adjacent nodes in the same way.
[0040] For nodes that can directly transmit data, maintain the original connection; for data that cannot be directly transmitted, add corresponding data conversion nodes; for preconditions that are not independently expressed, add corresponding data verification nodes or precondition nodes. After completing all checks, ensure that, except for the starting node, each node that needs to input business data has a definite data source, and that the upstream data can directly meet the input requirements, or meet the input requirements after data conversion. Based on this, construct the initial node diagram 200 for data flow closure.
[0041] After the initial node graph 200 is formed, the capability constraint matrix 300 is read from the pre-saved target execution environment information.
[0042] The capability constraint matrix 300 records at least the node types, the maximum number of nodes, and the maximum workflow depth supported by the target execution environment.
[0043] First, count the total number of nodes in the current initial node graph 200 and compare it with the upper limit of the number of nodes. Then, calculate the workflow nesting depth layer by layer along the conditional branches and compare it with the upper limit of the depth.
[0044] When the number of nodes and the nesting depth are both within the allowed range, maintain the current node organization structure; when the number of nodes or the nesting depth exceeds the limit, identify the corresponding conflicting node area and perform node aggregation or nesting flattening operations.
[0045] While determining the node structure, configure exception handling paths for nodes that have input anomalies, execution timeouts, low-confidence outputs, or external interface call requirements. For data acquisition nodes that call external data services, add a cache reading node or a backup service switching node in case of external interface call failure, in addition to the normal data output path.
[0046] Under normal circumstances, data is transmitted along the original business path; when an external service fails, the system switches to the exception handling branch based on the exception status.
[0047] After completing the above structural processing, the target node diagram 301 is formed.
[0048] Subsequently, the node types, node execution parameters, inter-node connection relationships, and data mapping relationships in the target node diagram 301 are read, and a corresponding structured configuration is formed according to the configuration format of the target execution environment. Each node configuration records the node identifier, node type, input, output, and execution parameters, and each connection relationship records the upstream node, downstream node, and data transmission relationship, thereby serializing and generating the target workflow configuration.
[0049] Example 2, based on Example 1, further specifies the content block identification, unified intermediate representation, initial node extraction, and functional component matching process of the process description text 100, in order to solve the problems that SOPs with different content structures cannot be directly parsed according to the same node structure, and that the generated nodes lack corresponding execution capabilities.
[0050] In practice, when identifying the content block types of the process description text 100, the text is first divided into different regions based on its document structure, text organization, and layout characteristics. Regions with continuous natural language expressions but no fixed row or column structure are identified as paragraph text blocks; regions with row and column boundaries and field relationships are identified as table structure blocks; and regions with numbering, bullet points, or hierarchical indentation are identified as list enumeration blocks. When the same process description text 100 contains multiple content blocks, content associations are established according to the positional relationships of each content block in the original document. After executing the corresponding parsing strategies, these associations are merged to form the initial node sequence 101.
[0051] Taking a Standard Operating Procedure (SOP) that includes both a main text description and an operation procedure table as an example, the main text states "After the data is complete, perform data analysis," and the corresponding row in the operation procedure table states "Steps: Data Analysis; Input: Industry Data; Output: Analysis Results." When parsing the main text, the "Data Completeness" condition and the "Analysis" action are obtained from the paragraphs; when parsing the table, the input object, the action to be performed, and the output object are obtained based on the table header position.
[0052] After parsing, the two parsing results are matched with the steps and business objects in the SOP. Since "Analysis" in the text and "Data Analysis" in the table point to the same business step, two separate analysis nodes are not generated. Instead, the "Data Completeness" condition obtained from the text and the information such as "Input is Industry Data, Output is Analysis Results" obtained from the table are written into the same analysis node record. The parsing results of each content block are merged in this way to form the initial node sequence 101.
[0053] For the multimodal format process description text 100, the above parsing results are uniformly converted into an intermediate representation structure. Each intermediate representation record at least stores the step identifier, action type, operation object, execution condition, input data source, output target, and branch type. The aforementioned analysis steps are recorded as follows: action type is analysis, operation object is industry data, execution condition is data completeness, input data source is industry data, and output target is analysis result.
[0054] Candidate nodes are further extracted from the unified intermediate representation structure. Dependency parsing is performed on each step to identify the action predicate and action object. The process of collecting and classifying industry data involves two actions: "collecting" and "classifying," thus generating two candidate action units for each.
[0055] For auxiliary expressions such as "start processing" and "perform operation" that do not have independent processing objects, heuristic rules are used for filtering. When adjacent candidate nodes correspond to the same business operation and the semantic similarity between the candidate nodes reaches a preset similarity threshold, the adjacent candidate nodes are merged into one execution node.
[0056] The preset similarity threshold is set to 0.85 to avoid excessive merging while ensuring semantic consistency of candidate nodes. Since merging candidate nodes requires confirmation that different steps express the same business operation, a low similarity threshold can easily lead to the incorrect merging of nodes with different execution purposes, disrupting the original process logic; a high similarity threshold may prevent the same business operation from being merged due to differences in expression. By setting 0.85 as the judgment threshold, node merging is only performed when the textual semantics of candidate nodes are highly similar and their business meanings are consistent.
[0057] The retained candidate nodes are classified by node type. First, rules are applied based on action words and the object of the operation. For example, nodes corresponding to actions such as "retrieve," "query," and "get" are classified as information retrieval nodes; candidate nodes containing conditional expressions such as "if," "if," and "when..." are classified as logical judgment nodes. Then, the current step and the steps before and after are input into the neural network model to obtain the probabilities corresponding to different node types. The node type is determined based on the rule judgment results and the probability results.
[0058] For candidate nodes, further calculate the confidence score: , in, Indicates the semantic matching degree weight. Indicates the historical accuracy weight, The context coherence weights are determined through a grid search optimization on the validation set. =0.5, =0.3, =0.2.
[0059] Semantic matching degree is determined by the semantic similarity between the candidate node text and the corresponding node type; historical accuracy is determined by the proportion of correct extraction of the same type of node in the historical SOP; contextual coherence is determined by the data and logical continuity between the current candidate node and the nodes before and after it.
[0060] Candidate nodes that meet the node confirmation criteria are written into the initial node sequence 101, and candidate nodes that cannot be confirmed are saved as pending confirmation.
[0061] Once a node is determined, a corresponding functional component is matched to that node. First, the bag-of-words model is used to represent the node's step text and the functional component description. Then, a sorting algorithm is used to obtain functional components with high text relevance, forming the first candidate set 102. For nodes that acquire industry data, candidate components with information retrieval or information acquisition functions are prioritized.
[0062] The unified intermediate representation structure formed by the current SOP is then read and compared with the pre-saved scenario template. The scenario template records the node or capability combination relationship under typical business scenarios. For example, a market research scenario may include continuous capabilities such as data acquisition, text processing, analysis, and report output. The structural similarity between the current process structure and the scenario template is determined by graph edit distance, and a second candidate set 103 is formed based on the matching results.
[0063] Simultaneously, the current business step is converted into a semantic vector, and historical success cases are retrieved from the vector database. A third candidate set 104 is formed based on the semantic embedding matching relationship between the historical cases and the current step. The historical success cases store the configurations of functional components that have been successfully executed, thus further limiting the range of functional components that can be used in the current node.
[0064] For candidate functional components, further calculate semantic similarity, functional similarity, and scene similarity, and follow the following: , in, The overall matching score represents the candidate AI's capabilities. This indicates the semantic similarity between business steps and AI capabilities. This indicates the functional similarity between the expected inputs and outputs of the business steps and the inputs and outputs supported by AI capabilities. This indicates the similarity between business scenarios and applicable AI capabilities. Represents semantic similarity weights. Indicates the functional similarity weight. The scene similarity weights are obtained by optimizing them on a labeled dataset using gradient descent. =0.4, =0.35, =0.25.
[0065] Determine the comprehensive matching result. Functional similarity focuses on comparing the input / output types required by the node with the actual input / output types supported by the functional component. Scene similarity compares the current scene label with the applicable scene label of the functional component. Finally, select the functional component that meets the comprehensive matching score requirement from the first candidate set 102, the second candidate set 103, and the third candidate set 104, and write the corresponding input and output data types of the functional component into the node record.
[0066] Example 3, based on Example 2, further limits the hidden node inference and completion process, which is used to correct the data connections in the initial node sequence 101 that cannot be directly executed into node connections that can actually transmit data.
[0067] In practice, adjacent nodes are read one by one according to their order of arrangement. Taking nodes A and B as an example, the output parameter set of node A and the input parameter set of node B are read, and their data types are compared. If their data types are the same or there is an allowed type compatibility relationship, the data objects are checked for correspondence. If their data types are different and cannot be directly transmitted, node A and node B are recorded as having a data type mismatch.
[0068] For example, if node A outputs a PDF document and node B inputs structured table data, a data transformation node is generated based on the data type differences between the PDF document and the structured table. The input of the data transformation node is connected to the PDF output of node A. After performing document content extraction and field structuring processing, the structured table is then connected to the input of node B as the output.
[0069] If the data types of node A and node B are consistent, then the execution conditions in the corresponding process description of node B are further read. If there is no integrity judgment node between the data source node and the risk analysis node in the current node sequence, then a logical gap exists between the nodes, and a data verification node is generated.
[0070] The data verification node receives data output from the upstream node and checks whether the data is empty, whether necessary fields exist, or whether the format meets the conditions for subsequent processing. If the conditions are met, the data is then sent to the risk analysis node. At this point, the original connection from the data acquisition node to the risk analysis node is changed to the data acquisition node to the data verification node to the risk analysis node.
[0071] The preconditions and result conditions in the process description are processed separately. For example, after confirming data integrity, they are parsed as preconditions, thus forming a precondition node. The result description of data preparation for subsequent analysis is combined with the input requirements of subsequent analysis nodes. When the prepared result cannot directly meet the input of the analysis node, a corresponding post-action node is formed, such as a data format conversion node or an intermediate result storage node.
[0072] For steps involving multiple compound actions, the process is broken down according to the action predicate. For example, acquiring and categorizing relevant data is broken down into a data acquisition sub-node and a data categorization sub-node. After splitting, data flow continuity checks are performed again, instead of directly connecting the two sub-nodes.
[0073] When the data acquisition sub-node outputs the original document, while the data classification sub-node requires structured text as input, a data transformation node corresponding to document content extraction is added between the two sub-nodes. This forms a process from the data acquisition sub-node to the data transformation node to the data classification sub-node.
[0074] After all nodes have been processed, the initial node graph 200 is traversed again. For each non-starting node, the input source is checked; if there is no upstream input, the missing node is located; if the upstream output type is inconsistent with the current node's input type, the corresponding data conversion node is checked; if the current node has a pre-execution condition, the data validation node or pre-condition node is checked.
[0075] The current node connection is marked as a continuous data flow only when each necessary input has a clear source and each input / output type can be directly connected or connected after transformation. After all business nodes have completed the above checks, the initial node diagram 200 for forming a closed data flow is determined.
[0076] Example 4: Based on the initial node graph 200 formed in Example 3, this example further adjusts the node structure according to the capability constraint matrix 300 of the target execution environment and adds an exception handling branch to the node graph.
[0077] In practice, the capability constraint matrix 300 corresponding to the target execution environment is first read, and the upper limit of the number of nodes, the upper limit of the workflow depth, and the node types supported by the target execution environment are obtained. Then, the total number of current nodes in the initial node graph 200 is counted, and the maximum nesting depth is calculated layer by layer along the conditional branches.
[0078] Assuming the initial node graph 200 has 32 nodes, while the target execution environment allows a maximum of 30 nodes, a conflict exists. In this case, the nodes with linear connections are traversed to find combinations of nodes whose intermediate outputs are not referenced by other branches and can be executed consecutively.
[0079] The data cleaning node, field standardization node, and formatting node are sequentially connected. Since there are no other branches connecting these three nodes, and intermediate results do not need to be read separately by external nodes, the three nodes are merged into a single batch processing node. The input of the original data cleaning node is now connected to the batch processing node, and the output of the original formatting node is now output by the batch processing node. Internally, the batch processing node still executes the data cleaning, field standardization, and formatting steps in the same order.
[0080] When the nesting depth of the initial node graph 200 exceeds the depth limit in the capability constraint matrix 300, the conditional branch causing the depth exceedance is located. For example, if there are two more conditional branches under the third-level conditional node in the main process, the nodes and connecting edges corresponding to the deep conditional branches are extracted from the main node graph to form a sub-workflow.
[0081] Configure a workflow invocation node at the entry point of the original conditional branch, connecting the data that would otherwise enter the deep branch to the workflow invocation node. The workflow invocation node passes the input data to the sub-workflow, which then returns the result to the workflow invocation node after completing the processing of the original deep branch. The workflow invocation node then sends the result to the node after the original branch exit. This reduces the physical nesting depth of the main workflow.
[0082] After completing the topology adjustment, configure exception branches for nodes requiring exception handling. For each business node, at least the input state, execution time state, and output state should be saved; for nodes involving external service calls, the external interface return state should also be saved.
[0083] When the node input is empty or has an incorrect format, an input exception state is triggered, and the exception input of the original business node is connected to the data cleaning node or the default value filling node; after the data is corrected, the processing result is resent to the original business node.
[0084] When a node's execution time exceeds a preset time threshold, an execution timeout state is triggered, and the execution path is switched to a retry node or a degraded execution node. The retry node calls the original functional component again according to the set retry parameters; the degraded execution node calls an alternative functional component that can perform similar processing functions.
[0085] The preset time threshold is determined based on the historical execution time of the node. In one implementation, when the current execution time of the node exceeds 1.5 to 2 times the average historical execution time, it is determined that the preset time threshold has been exceeded.
[0086] When the confidence level of the node's output result is lower than the preset confidence threshold, the low-confidence result is written to the manual review node, and transmission to the original downstream node is stopped. After manual review is completed, the confirmed or modified result is output as the manual review node, and the node reconnects to the original downstream node.
[0087] The preset confidence threshold is determined based on the matching status between the output result and the target execution requirements. In one implementation, the preset confidence threshold is set to the range of 0.8 to 0.9. When the confidence of the output result is lower than 0.85, the manual review node is triggered.
[0088] When an external interface call fails, the exception edge of the current node is connected to the cache read node or the backup service switching node. For example, if a data retrieval node fails to call an external service, it first reads the most recently saved available data from the cache read node; if the cached data meets the requirements, it is sent directly to the downstream node. If a new request is needed, the backup service switching node switches to a backup interface and retrieves the data again.
[0089] After the exception handling node is connected, the number of nodes and nesting depth of the target node graph 301 are recounted, and it is checked whether the newly added node belongs to the node type allowed by the capability constraint matrix 300. At the same time, the data flow continuity between the newly added node and the preceding and following nodes is checked again according to the method of Example 3. After the target execution environment constraints are met and the data flow check is passed, the current node structure is determined as the target node graph 301.
[0090] Example 5, based on Example 4, further adds format verification of the target workflow configuration, sandbox pre-execution verification, and iterative correction after verification failure. This is to solve the problem that although the target node diagram 301 has completed topology reconstruction, the serialized target workflow configuration may still have configuration format errors or the actual execution data path may be inconsistent with the target node diagram 301.
[0091] The target workflow configuration is generated based on the serialization of the target node graph 301, forming an adaptation capability constraint matrix 300. The target workflow configuration records at least the node identifier, node type, node configuration parameters, node input / output relationships, and node connection relationships. Data transfer between nodes is established through binding via output positions and input references; downstream nodes obtain the actual input data based on the output fields of upstream nodes.
[0092] Once the target workflow configuration is generated, a format validation is performed on the configuration. Format validation specifically includes checking whether required configuration fields exist, whether field data types meet the requirements of the target execution environment, whether node identifier references are valid, whether node types are supported by the target execution environment, and whether node configuration parameters conform to the corresponding configuration specifications.
[0093] After format validation passes, a sandbox pre-execution verification is performed on the target workflow configuration. Specifically, the sandbox pre-execution verification loads the target workflow configuration in an environment isolated from the actual business operation, simulates workflow execution using test data, and records the actual input, actual output, startup sequence, and actual data transmission path for each node. The actual data transmission path is compared with the data connection relationships defined in the target node diagram 301 to determine whether the data relationships after the target workflow configuration runs are consistent with those in the target node diagram 301.
[0094] A dynamic verification method that simulates workflow execution in an isolated environment, tracks actual data transmission paths, and compares actual dependencies with statically predicted dependencies is represented as: , in, Weights that represent data dependencies This indicates the number of data fields shared between the corresponding AI execution nodes. This indicates the total number of output data fields from the previous AI execution node.
[0095] When verification fails, the process iteratively corrects the error by backtracking to the topology reconstruction or implicit node completion step based on the error type. If the error is due to the number of nodes, node type, or nested structure being unsuitable for the target execution environment, the error is located in the topology reconstruction step, and the node aggregation or nested flattening operation is re-executed. If the error is due to a mismatch between the actual node input data type and the upstream node output data type, or a lack of intermediate processing required to maintain continuous node execution, the error is located in the implicit node completion step, and data transformation nodes, data verification nodes, precondition nodes, or postaction nodes are regenerated or adjusted.
[0096] For example, if during the sandbox pre-execution process, it is detected that the data analysis node requires structured data input, but the actual received data is still text data, then the error is identified as a data connection error. The process is then traced back to the implicit node completion step, and the data conversion node from text data to structured data is added between the corresponding adjacent nodes. After the correction is completed, the target node diagram 301 is re-formed and the target workflow configuration is re-serialized and generated. Then, format verification and sandbox pre-execution verification are performed.
[0097] For example, if the nesting depth of the target workflow is detected to exceed the depth limit in the capability constraint matrix 300 during format validation or sandbox loading, the error is identified as a topology adaptation error. The process is then backtracked to the topology reconstruction step, where the conditional branch that caused the depth to exceed the limit is re-extracted as a sub-workflow and connected to the main workflow using the workflow call node.
[0098] The preset iteration limit refers to the maximum number of autocorrect rounds set before the target workflow configuration verification begins. Each time a backtracking correction based on the error type is completed, the iteration count increases by one. When both format validation and sandbox pre-execution validation pass, iteration stops and the current target workflow configuration is output. If validation still fails and the preset iteration limit has not been reached, iterative correction continues based on the new error type. When the preset iteration limit is reached, autocorrection stops, and the error type, error node location, and current target workflow configuration are retained for subsequent processing.
[0099] In one implementation, a preset iteration limit is set to 5 times. If the target workflow configuration fails 5 times of format validation and sandbox pre-execution validation, it is considered that the current workflow structure cannot meet the requirements of the target execution environment through automatic correction, the iteration is stopped, and a validation failure result is output.
[0100] Example 6, an embodiment of the present invention, provides an SOP-driven AI workflow generation system, including a process parsing and node extraction module, a data flow closure and graph construction module, a topology reconstruction and exception completion module, and a workflow configuration generation module.
[0101] The process parsing and node extraction module is used to obtain the process description text 100 and extract the initial node sequence 101 based on the process description text 100.
[0102] The data flow closure and graph construction module is used to infer and complete hidden nodes based on the data flow continuity detection between adjacent nodes in the initial node sequence 101, so as to construct the initial node graph 200 with data flow closure.
[0103] The topology reconstruction and anomaly completion module is used to obtain the capability constraint matrix 300 of the target execution environment, and to perform topology reconstruction and anomaly handling branch completion on the initial node graph 200 based on the capability constraint matrix 300 to obtain the target node graph 301.
[0104] The workflow configuration generation module is used to serialize and generate a target workflow configuration that adapts to the capability constraint matrix 300 based on the target node graph 301.
[0105] This embodiment also provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements an SOP-driven AI workflow generation method as proposed in the above embodiment.
[0106] This embodiment also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements an SOP-driven AI workflow generation method as proposed in the above embodiment.
[0107] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0108] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0109] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0110] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0111] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for generating AI workflows driven by Standard Operating Procedures (SOPs), characterized in that, include: Obtain the process description text (100), and extract the initial node sequence (101) based on the process description text (100). Based on the data flow continuity detection between adjacent nodes in the initial node sequence (101), hidden nodes are inferred and completed to construct an initial node graph (200) with closed data flow. Obtain the capability constraint matrix (300) of the target execution environment, and perform topology reconstruction and anomaly handling branch completion on the initial node graph (200) based on the capability constraint matrix (300) to form the target node graph (301). Based on the target node graph (301), a target workflow configuration adapted to the capability constraint matrix (300) is serialized and generated.
2. The SOP-driven AI workflow generation method as described in claim 1, characterized in that: The step of extracting the initial node sequence (101) based on the process description text (100) includes, The process description text (100) is subjected to content block type identification, and the content block type includes paragraph text block, table structure block and list enumeration block; For different types of content blocks, corresponding parsing strategies are executed to extract node information; The parsing results of each content block are merged into the initial node sequence (101).
3. The SOP-driven AI workflow generation method as described in claim 1 or 2, characterized in that: The step of extracting the initial node sequence (101) based on the process description text (100) further includes, The process description text (100) in multimodal format is converted into a unified intermediate representation structure, and the node type is classified based on the rule engine and neural network model to form the initial node sequence (101). Based on the multi-dimensional fusion of semantic similarity, functional similarity and scene similarity, a corresponding functional component is matched for each node in the initial node sequence (101); Based on dependency parsing, action units are extracted as candidate nodes from the process description text (100); Apply heuristic rules to filter invalid candidate nodes and merge consecutive candidate nodes with semantic similarity greater than a preset similarity threshold; The confidence score of each candidate node is calculated based on semantic matching degree, historical accuracy and contextual coherence, and the initial node sequence (101) is determined based on the confidence score.
4. The SOP-driven AI workflow generation method as described in claim 3, characterized in that: The process of matching each node in the initial node sequence (101) with a corresponding functional component includes, The first candidate set (102) is obtained by keyword matching using the bag-of-words model and the sorting algorithm. The second candidate set (103) is obtained by template matching through calculating the structural similarity between the unified intermediate representation structure and the predefined scene template. The third candidate set (104) was obtained by semantic embedding matching of historical successful cases retrieved from the vector database. The functional components are determined based on the first candidate set (102), the second candidate set (103), and the third candidate set (104).
5. The SOP-driven AI workflow generation method as described in claim 1, characterized in that: The inference and completion of hidden nodes includes, Detect the data type matching degree of the input and output data between the adjacent nodes; When it is detected that the data type matching degree does not meet the preset matching conditions, or when it is detected that there is a logical gap between the adjacent nodes, a data conversion node or a data verification node is inserted between the adjacent nodes as the hidden node.
6. The SOP-driven AI workflow generation method as described in claim 5, characterized in that: The insertion of data conversion nodes or data verification nodes as hidden nodes between adjacent nodes includes... Parse the pre-condition or result adverbial phrases of the step description in the process description text (100), and extract the pre-condition node or post-action node as the hidden node; When it is detected that the data type matching degree does not meet the preset matching conditions, a data conversion node is automatically generated and inserted between the adjacent nodes based on the data types of the input and output data of the adjacent nodes; When a single step in the process description text (100) contains different compound actions, the single step is split into different sub-nodes, and the data flow continuity between the different sub-nodes is verified. If the verification fails, the data conversion node is inserted between the different sub-nodes.
7. The SOP-driven AI workflow generation method as described in claim 1, characterized in that: The topology reconstruction and anomaly handling branch completion of the initial node graph (200) based on the capability constraint matrix (300) includes, When a conflict is detected between the topological features of the initial node graph (200) and the capability constraint matrix (300), a node aggregation operation or a nested flattening operation is performed on the initial node graph (200). Based on the node execution status or external service status, trigger exception handling branch completion and connect the generated exception handling node to the initial node graph (200). When the input data of a node is detected to be empty or incorrectly formatted, a data cleaning node or a default value filling node is generated. When a node execution time exceeds a preset time threshold, a retry node or a downgraded execution node is generated. When the confidence level of the output result is detected to be lower than the preset confidence threshold, a manual review node is generated; When an external interface call fails, a cache read node or a backup service switch node is generated.
8. The SOP-driven AI workflow generation method as described in claim 7, characterized in that: The node aggregation operation or nested flattening operation performed on the initial node graph (200) includes, When the number of nodes in the initial node graph (200) exceeds the upper limit of the number of nodes in the capability constraint matrix (300), multiple nodes with similar functions are merged into a composite node, or linearly connected nodes are merged into a batch processing node. When the nesting depth of the initial node graph (200) exceeds the upper limit of the depth in the capability constraint matrix (300), the deeply nested conditional branches are extracted as sub-workflows, and logical nesting is achieved through workflow calling nodes.
9. The SOP-driven AI workflow generation method as described in any one of claims 1, 2, 5, or 7, characterized in that: The process of serializing and generating a target workflow configuration adapted to the capability constraint matrix (300) also includes... The target workflow configuration is configured to perform format validation and sandbox pre-execution validation. When the verification fails, the process backtracks to the topology reconstruction or the completion step of the hidden node based on the error type for iterative correction until the verification passes or the preset iteration limit is reached.
10. A SOP-driven AI workflow generation system, employing the SOP-driven AI workflow generation method as described in any one of claims 1 to 9, characterized in that: It includes a process parsing and node extraction module, a data flow closure and graph construction module, a topology reconstruction and exception completion module, and a workflow configuration generation module; The process parsing and node extraction module is used to obtain process description text (100) and extract initial node sequence (101) based on the process description text (100). The data flow closure and graph construction module is used to infer and complete hidden nodes based on the data flow continuity detection between adjacent nodes in the initial node sequence (101) to construct an initial node graph (200) with data flow closure. The topology reconstruction and anomaly completion module is used to obtain the capability constraint matrix (300) of the target execution environment, and to perform topology reconstruction and anomaly handling branch completion on the initial node graph (200) based on the capability constraint matrix (300) to obtain the target node graph (301). The workflow configuration generation module is used to serialize and generate a target workflow configuration that adapts to the capability constraint matrix (300) based on the target node graph (301).
