A Methodology for Building Large Model Applications Based on Configurable Workflows and Domain Knowledge Bases
By constructing a structured domain knowledge base and configurable workflows, combined with semantic process configuration and multi-model service scheduling, the problems of insufficient knowledge enhancement and process configurability in large language model intelligent applications are solved, achieving efficient and intelligent task execution and model response.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGSU YIQICE NETWORK TECH CO LTD
- Filing Date
- 2025-07-09
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies lack the ability to dynamically adapt to task semantics when building intelligent applications based on large language models. They are unable to meet the high complexity requirements of multiple business scenarios, have weak knowledge enhancement capabilities, insufficient process configurability, severe model response decoupling, and cannot achieve automatic adaptation and optimal model selection.
We construct a structured domain knowledge base and achieve dynamic prompt input generation, semantically consistent knowledge retrieval, and scheduling of large language model services through semantic flow configuration, knowledge graph enhancement, and multi-model service scheduling. We also select the optimal model and jump between processes based on task type and response metrics.
It enhances the task understanding and knowledge retrieval capabilities of large language models, improves the automation and intelligence level of workflows, and has the advantages of flexible configuration, reliable execution, stable output, and high knowledge matching accuracy, making it suitable for complex large model application scenarios.
Smart Images

Figure CN120631869B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence application construction technology, and in particular to a method for constructing large model applications based on configurable workflows and domain knowledge bases. Background Technology
[0002] In the current construction of artificial intelligence systems, with the continuous development of Large Language Models (LLMs), enterprises and developers are increasingly focusing on integrating the capabilities of large models into specific business scenarios to build intelligent systems for question answering, content generation, knowledge mining, and process collaboration. Existing technologies typically rely on fixed process configurations and static Prompt templates, lacking the ability to dynamically adapt to task semantics and struggling to efficiently support the large model invocation needs in heterogeneous scenarios. Furthermore, knowledge enhancement often employs traditional document search or keyword matching, failing to form a unified, structured knowledge embedding mechanism, thus limiting the completeness of semantic expression and the consistency of reasoning.
[0003] On the other hand, current mainstream workflow systems are mostly geared towards business process automation, relying primarily on rule-driven node transitions. They lack support for the integration of semantic tags and domain knowledge, and do not possess the ability to dynamically schedule and control the flow of responses from large model tasks. Especially in areas such as multi-task concurrency, cross-model service scheduling, and Prompt build strategy optimization, existing platforms suffer from poor flexibility, weak controllability, and rigid scheduling mechanisms, making it difficult to meet the needs of building highly complex intelligent applications. Furthermore, model selection is mostly based on manual specification or static binding, failing to achieve automatic adaptation and optimal model interface selection based on task type, response performance, and other metrics, thus affecting the application's response efficiency and stability.
[0004] In summary, existing technologies generally suffer from problems such as weak knowledge enhancement capabilities, insufficient process configurability, and severe decoupling between task-driven and model-response processes in the construction of intelligent applications for large language models.
[0005] Therefore, how to provide a method for building large model applications based on configurable workflows and domain knowledge bases is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] One objective of this invention is to propose a method for constructing large-scale model applications based on configurable workflows and domain knowledge bases. This invention fully integrates semantic process configuration, knowledge graph enhancement, and multi-model service scheduling technologies. It describes in detail how to automate the entire process of complex tasks by constructing a structured domain knowledge base, dynamically generating prompt input, performing semantically consistent knowledge retrieval, and scheduling the optimal large language model service. It has the advantages of strong intelligent adaptation capabilities, high knowledge retrieval accuracy, good model response stability, and high system configuration flexibility.
[0007] The method for constructing a large model application based on a configurable workflow and a domain knowledge base according to an embodiment of the present invention includes the following steps:
[0008] S1. Construct a domain knowledge base, collect industry documents and terminology, extract entities, relationships and attributes, build a semantic graph, and generate a knowledge embedding dataset;
[0009] S2. Define a configurable workflow, set process jump rules based on a preset semantic process description language, configure task types for each task node and bind semantic tags;
[0010] S3. Configure the Prompt adaptive generation mechanism to generate the Prompt input text for the current node based on the semantic labels of the task nodes and the knowledge embedding dataset.
[0011] S4. Call the knowledge embedding dataset to perform semantic vector retrieval, obtain related knowledge fragments, filter and sort them according to semantic path consistency, and embed them into the Prompt input text to form an enhanced Prompt input text.
[0012] S5. Input the enhanced Prompt text into the large language model interface, obtain the return result of the large language model, record the response index of the large language model, and determine whether the jump condition is met based on the return result of the large language model and the process jump rules, and determine the next execution node.
[0013] S6. Based on the task type and the response indicators of the large language model, and combined with the current process execution load, select the optimal interface from multiple large language model service instances, and support the switching of large language models and dynamic updates of scheduling strategies.
[0014] S7. Organize the results returned by the large language model at the process termination node into output, and record the workflow execution log and the large language model call data.
[0015] Optionally, S1 specifically includes:
[0016] S11. Collect structured and unstructured data of the target industry. The structured data includes terminology standards, classification codes, and basic knowledge tables. The unstructured data includes industry policy documents, research reports, and domain corpora.
[0017] S12. Perform text preprocessing operations on structured and unstructured data, including word segmentation, part-of-speech tagging and named entity recognition, and extract entity set E, relation set R and attribute set S;
[0018] S13. Perform multi-granularity semantic expansion processing on the extracted entity set E to construct a multi-granularity entity set E. ′ ={E 1 E 2 ,…,E H}, where H is the number of semantic granularity layers, E H This represents a subset of entities at the H-th granularity level.
[0019] S14, Based on multi-granularity entity set E ′ Given a set of relations R and a set of attributes S, construct a semantic graph G = (E ′ Let (e, R, S) represent the edge structure in the graph in the form of triples. A triple is defined as (e, R, S). i ,r j ,e ij ), where e i Let r represent the i-th entity node. j Let e represent the j-th semantic relation. ij Indicates with e i Through semantic relation r j Another entity node that is connected;
[0020] S15. Based on the semantic graph G, construct a multi-view structural representation, and build three types of subgraphs from semantically similar views, entity connection views, and attribute dependency views, respectively. Perform graph embedding operations on each subgraph to generate an embedding vector set V. (1) V (2) V (3) The embedded vector sets are fused to obtain the knowledge embedding dataset V = {v1, v2, ..., v...} O}, where v i Indicates the merged entity e i The vector representation of , where O is the number of entity vectors;
[0021] S16. Input the knowledge embedding dataset V into the vector retrieval engine and configure the index structure.
[0022] Optionally, S2 specifically includes:
[0023] S21. Define a workflow graph structure F = (N, L) based on a semantic process description language, where N represents the set of task nodes and L represents the directed connection relationship between nodes;
[0024] S22, for each task node n i Configure task type t i The task types include information extraction, text generation, structure transformation, and data archiving, forming a task type set T = {t1, t2, ..., t}. p}, where p is the total number of task nodes in the workflow;
[0025] S23, for each task node n i Configure semantic tag set Define the semantic category of a node, where q is the number of semantic tags;
[0026] S24. Set the process jump rules and construct the jump scoring function Γ(n) i →n j Let the adjacency matrix A∈{0,1} be defined. p×p , where A ij =1 indicates task node n i Jump to n j For each node n i Construct a state vector to represent the node's current execution load, input size, and task density information;
[0027]
[0028] Among them, A ij For node n in the adjacency matrix i to n j The connection identifier, x i ,x j They are nodes n i n j The state vector, and They are respectively task type t i t j The function vector representation, where ||| is the vector magnitude;
[0029] S25. Supports parallel branch structure, sets parallel execution set in task node set, allows the same upstream node to point to multiple downstream task nodes, and configures jump synchronization mechanism;
[0030] S26. Store the constructed flowchart structure, adjacency matrix, and state vector set into the process definition container for use in Prompt input text generation and process execution control.
[0031] Optionally, S3 specifically includes:
[0032] S31. Initialize the Prompt template construction rules and preset the corresponding Prompt template structure for each task type. The Prompt template structure consists of a static text frame and replaceable variable slots.
[0033] S32. Transfer the semantic tag set L bound to the current task node. i Mapped to a set of semantic tag embedding vectors Each label embedding vector represents the semantic embedding representation of the label, and q is the number of semantic labels;
[0034] S33. Retrieve the set of vectors embedded with labels from the knowledge embedding dataset V. i The set of embedding vectors whose semantic similarity to any vector is greater than a preset threshold η.
[0035]
[0036] Among them, v k Let k be the knowledge embedding vector, and max be the maximum value operation. Let be the embedding vector of the j-th semantic tag;
[0037] S34. Embed the vector set Each knowledge vector is mapped to a Prompt semantic block, and a ranking priority weight π(b) is calculated for each Prompt semantic block. k ):
[0038]
[0039] Among them, e k For Prompt semantic block b k The embedding vector, w j For the semantic weight of the label, ρ k α is the semantic block structure priority factor, β is the fusion adjustment coefficient, and softmax represents the normalized sorting function.
[0040] S35. According to the sorting priority weight π(b) k Arrange the Prompt semantic blocks in descending order, insert them into the Prompt template slots in sequence, construct the final Prompt input text, and record the Prompt construction log information, including the semantic tags used, the index of the matched semantic blocks, the content replaced, and the order.
[0041] Optionally, S4 specifically includes:
[0042] S41. Receive the semantic tags configured in the current task node, load all generated semantic embedding vector sets and corresponding original knowledge fragment texts in the knowledge embedding dataset, and use them as the basis for knowledge retrieval required by the current task node.
[0043] S42. Based on the semantic labels configured in the current task node and the semantic embedding vectors of each knowledge fragment in the knowledge embedding dataset, perform semantic vector retrieval operations to construct a preliminary set of candidate knowledge fragments based on vector similarity.
[0044] S43. For each knowledge fragment in the initial screening set of candidate knowledge fragments, and in conjunction with the semantic tags bound to the task nodes, perform path consistency comparison in the domain semantic graph structure to obtain the semantic path structure matching status.
[0045] S44. Based on semantic path consistency, candidate knowledge fragments are screened and sorted, and knowledge fragments with similar semantic path structure consistency to the current task node are selected first to construct a target injection fragment set.
[0046] S45. Convert the knowledge fragments in the target injection fragment set into a structured text format to maintain compatibility with the Prompt input text structure of the current task node, and construct the injection preparation area.
[0047] S46. Insert the structured target injection fragment into the Prompt input text of the current task node to form an enhanced Prompt input text, and write the enhanced Prompt input text into the output buffer of the task node.
[0048] Optionally, S5 specifically includes:
[0049] S51. Receive the enhanced Prompt input text as input data for the current task node, and read the large language model interface information bound in the current task node.
[0050] S52. Based on the configured task type, allocate large language model inference resources to the current task node and initialize the large language model inference task queue.
[0051] S53. Input the enhanced Prompt text into the large language model interface, activate the large language model inference task, and listen to the returned content and record the call status in an asynchronous manner.
[0052] S54. Obtain the results returned by the large language model, perform content normalization processing, extract key fields and semantic expression structures from the returned text, and generate structured response information;
[0053] S55. Perform response quality assessment on the structured response information, collect the response time of the large language model, the success rate of the call, and the semantic coverage score between the large language model and the task semantic tags, and generate the response index of the large language model.
[0054] S56. Based on the terminology constraints and entity consistency standards in the domain knowledge base, perform content credibility verification and generate a response content credibility score. If the response content credibility score is greater than the preset credibility threshold, write the result returned by the large language model into the output buffer of the current task node.
[0055] S57. Based on the set flow jump rules, extract the structured key parameters from the results returned by the large language model and input them into the jump rule expression J(x). If the result is true, update the current flow execution pointer and determine the next execution node:
[0056]
[0057] Where μ, τ and θ is the jump weight coefficient. s To score semantic coverage, λ c To assess the credibility of the response content, S m (x,L i Let x be the structured parameter and L be the semantic tag set. i The semantic matching score function between them, where δ is the jump judgment threshold;
[0058] S58. Record the response metrics of the large language model for the current task node, the credibility score of the response content, and the jump judgment status, and write them to the workflow execution log and the large language model call data table.
[0059] Optionally, S6 specifically includes:
[0060] S61. Receive the task type, large language model response index and semantic tag set configured by each task node, and call the constructed knowledge embedding dataset. Perform vector embedding operation on each semantic tag in the semantic tag set to generate a semantic tag vector sequence. After weighted averaging, the semantic tag vector of the task node is formed, and the running semantic state vector of the current task node is constructed.
[0061] S62. Construct a multi-dimensional service candidate matrix M, where each large language model service instance is represented as a service state vector Ω. i =[R i ,δ i ,L i ,ε i ], including available computing resources R i Historical stability score δ i Current load status L iService flexibility ε i , where ε i This indicates the ability of large language model service instances to maintain stable responses under different semantic tasks;
[0062] S63. Construct an evolutionary scheduling scoring function based on the runtime semantic state vector. Used to score the fit of large language model service instances in the t-th scheduling round:
[0063]
[0064] Where η1 is the similarity score weight coefficient, η2 is the load weight coefficient, η3 is the elasticity weight coefficient, η4 is the trend score weight coefficient, and λ k For semantic label vectors, μ i Sim(λ) is the historical semantic response vector of the service instance for a large language model. k ,μ i ) represents the current semantic label vector λ k With the historical semantic response vector μ of the large language model service instance i cosine similarity, L i ε serves the current model load. i For service elasticity, Trend(i,t) represents the stability of the scheduling trend of the large language model service instance in the first t-1 rounds;
[0065] S64. Calculate the scheduling score of each large language model service instance, construct an instance scheduling priority ranking list, and select the large language model service instance with the highest score as the recommended service interface for the current task node.
[0066] S65. Introduce service switching determination function C switch :
[0067]
[0068] in, To recommend large language model service instance scores, Score the currently bound large language model service instance, where ∈ is the switching score threshold, ζ is the minimum trend stability threshold, and M * The optimal large language model service instance selected for the current task node; ∧ is a logical operator.
[0069] S66, If C switch =True, then update the inference call interface of the current task node to M. * Simultaneously, the reason for the switch, the score change, and the trend status are recorded in the service scheduling log;
[0070] S67. If Cswitch =False, then keep the current large language model service instance unchanged, update the current node task status, and mark it as "not switched";
[0071] S68. Write the scores, judgment process, final large language model interface and trend evolution data of all scheduling rounds into the task node context information structure and workflow execution log, supporting scheduling optimization and multi-task reasoning historical analysis.
[0072] The beneficial effects of this invention are:
[0073] This invention achieves intelligent execution of complex tasks in a large language model environment by constructing a structured domain knowledge base and a configurable semantic workflow. In the background, large model applications suffer from insufficient knowledge injection capabilities, weak process control capabilities, and a lack of dynamic scheduling for model selection, making it difficult to meet the high reliability and adaptability requirements of multi-business scenarios. To address these issues, this invention proposes a systematic technical solution encompassing knowledge organization, process configuration, dynamic prompt generation, and large model response processing.
[0074] Specifically, the system generates a knowledge embedding dataset by constructing a semantic graph containing entities, relationships, and attributes, providing semantic support for subsequent Prompt input; it improves the system's task adaptability by setting a semantic flow description language to enable flexible configuration of task types and jump logic for flow nodes; it introduces a semantic consistency retrieval mechanism and vector sorting strategy to make the knowledge injection process more relevant and accurate; at the same time, through a multi-model instance scheduling mechanism, combined with response performance and task load, it supports adaptive selection and switching of model interfaces, improving response efficiency and system elasticity.
[0075] By combining the above technical approaches, this invention not only effectively enhances the task understanding and knowledge retrieval capabilities of large language models, but also significantly improves the automation and intelligence level of workflows. It has the advantages of flexible configuration, reliable execution, stable output, and high knowledge matching accuracy, and is suitable for various complex large model application construction scenarios that require intelligent decision-making and knowledge support. It has good practical application value and promotion prospects. Attached Figure Description
[0076] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0077] Figure 1 The flowchart shows the method for constructing large model applications based on configurable workflows and domain knowledge bases proposed in this invention.
[0078] Figure 2This is a schematic diagram illustrating the domain knowledge base construction and semantic graph generation process of the large model application construction method based on configurable workflow and domain knowledge base proposed in this invention. Detailed Implementation
[0079] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0080] refer to Figure 1 and Figure 2 The method for building large-scale model applications based on configurable workflows and domain knowledge bases includes the following steps:
[0081] S1. Construct a domain knowledge base, collect industry documents and terminology, extract entities, relationships and attributes, build a semantic graph, and generate a knowledge embedding dataset;
[0082] S2. Define a configurable workflow, set process jump rules based on a preset semantic process description language, configure task types for each task node and bind semantic tags;
[0083] S3. Configure the Prompt adaptive generation mechanism to generate the Prompt input text for the current node based on the semantic labels of the task nodes and the knowledge embedding dataset.
[0084] S4. Call the knowledge embedding dataset to perform semantic vector retrieval, obtain related knowledge fragments, filter and sort them according to semantic path consistency, and embed them into the Prompt input text to form an enhanced Prompt input text.
[0085] S5. Input the enhanced Prompt text into the large language model interface, obtain the return result of the large language model, record the response index of the large language model, and determine whether the jump condition is met based on the return result of the large language model and the process jump rules, and determine the next execution node.
[0086] S6. Based on the task type and the response indicators of the large language model, and combined with the current process execution load, select the optimal interface from multiple large language model service instances, and support the switching of large language models and dynamic updates of scheduling strategies.
[0087] S7. Organize the results returned by the large language model at the process termination node into output, and record the workflow execution log and the large language model call data.
[0088] This invention provides a method for constructing large-scale model applications based on configurable workflows and domain knowledge bases, exhibiting excellent modularity, intelligence, and scalability. By constructing a structured domain knowledge base and generating a knowledge embedding dataset, industry semantic information can be fully extracted, providing semantic support for model inference. A configurable workflow mechanism defined by a pre-defined semantic flow description language enables configuration of task node types, semantic tag binding, and control of flow jump logic, improving the flexibility and intelligence of flow orchestration. Deep integration of the Prompt adaptive generation mechanism and knowledge embedding effectively enhances the large language model's understanding of task context. The introduction of a judgment mechanism combining large language model response indicators and flow jump rules significantly improves the accuracy of flow execution paths. Simultaneously, a dynamic scheduling multi-model service instance optimization strategy enables intelligent allocation and switching of different model service capabilities while ensuring response performance. In summary, this method can significantly improve the configuration efficiency, execution stability, and output quality of large-scale model applications in complex scenarios, possessing good engineering feasibility and promotional value.
[0089] In this embodiment, S1 specifically includes:
[0090] S11. Collect structured and unstructured data of the target industry. The structured data includes terminology standards, classification codes, and basic knowledge tables. The unstructured data includes industry policy documents, research reports, and domain corpora.
[0091] S12. Perform text preprocessing operations on structured and unstructured data, including word segmentation, part-of-speech tagging and named entity recognition, and extract entity set E, relation set R and attribute set S;
[0092] S13. Perform multi-granularity semantic expansion processing on the extracted entity set E to construct a multi-granularity entity set E. ′ ={E 1 E 2 ,…,E H}, where H is the number of semantic granularity layers, E H This represents a subset of entities at the H-th granularity level.
[0093] S14, Based on multi-granularity entity set E ′ Given a set of relations R and a set of attributes S, construct a semantic graph G = (E ′ Let (e, R, S) represent the edge structure in the graph in the form of triples. A triple is defined as (e, R, S). i ,r j ,e ij ), where e i Let r represent the i-th entity node. j Let e represent the j-th semantic relation. ij Indicates with ei Through semantic relation r j Another entity node that is connected;
[0094] S15. Based on the semantic graph G, construct a multi-view structural representation, and build three types of subgraphs from semantically similar views, entity connection views, and attribute dependency views, respectively. Perform graph embedding operations on each subgraph to generate an embedding vector set V. (1) V (2) V (3) The embedded vector sets are fused to obtain the knowledge embedding dataset V = {v1, v2, ..., v...} O}, where v i Indicates the merged entity e i The vector representation of , where O is the number of entity vectors;
[0095] S16. Input the knowledge embedding dataset V into the vector retrieval engine and configure the index structure.
[0096] This invention proposes a structured semantic enhancement method for large-scale model applications, addressing the domain knowledge acquisition and modeling stages. Through multi-source data fusion, multi-granularity semantic expansion, and multi-view graph embedding, it effectively improves the expressiveness and retrievalability of knowledge representation. By collecting structured and unstructured data, covering terminology standards, policy documents, and domain corpora, a comprehensive original semantic resource covering key industry knowledge is constructed. Text preprocessing and entity, relation, and attribute extraction techniques are used to accurately obtain semantic triples, ensuring the accuracy of the knowledge base. Furthermore, a multi-granularity semantic expansion strategy is introduced, enabling entity representations to have context-level understanding capabilities and enhancing the breadth of knowledge coverage. Graph embedding operations are performed by constructing three types of views: semantic similarity, entity connectivity, and attribute dependency, followed by embedding fusion to form a more expressive knowledge embedding dataset. Finally, an efficient vector retrieval structure is configured to support subsequent high-performance semantic retrieval and Prompt enhancement calls. This solution significantly improves the depth and quality of knowledge injection, providing crucial support for contextual understanding, semantic awareness, and task adaptation in large language models, and possesses good engineering practicality and scalability.
[0097] In this embodiment, S2 specifically includes:
[0098] S21. Define a workflow graph structure F = (N, L) based on a semantic process description language, where N represents the set of task nodes and L represents the directed connection relationship between nodes;
[0099] S22, for each task node n i Configure task type t i The task types include information extraction, text generation, structure transformation, and data archiving, forming a task type set T = {t1, t2, ..., t}.p}, where p is the total number of task nodes in the workflow;
[0100] S23, for each task node n i Configure semantic tag set Define the semantic category of a node, where q is the number of semantic tags;
[0101] S24. Set the process jump rules and construct the jump scoring function Γ(n) i →n j Let the adjacency matrix A∈{0,1} be defined. p×p , where A ij =1 indicates task node n i Jump to n j For each node n i Construct a state vector to represent the node's current execution load, input size, and task density information;
[0102]
[0103] Among them, A ij For node n in the adjacency matrix i to n j The connection identifier, x i ,x j They are nodes n i n j The state vector, and They are respectively task type t i t j The function vector representation, where ||| is the vector magnitude;
[0104] Jump to the scoring function Γ(n) i →n jThe practical significance of the formula lies in dynamically modeling and quantitatively evaluating the connection relationships between task nodes in a workflow. The jump scoring function combines multiple factors such as node state, task type function vectors, and semantic compatibility to implement a configurable mechanism for calculating the rationality of jump paths in a workflow. In practical applications, each task node not only has static semantic labels and task type definitions but also exhibits a dynamic running state during execution; this information is encoded as a node state vector. Simultaneously, different task types possess their own function vector expressions, representing their processing capabilities and semantic attributes. The jump scoring function comprehensively evaluates whether the current node can efficiently and logically jump to the next node through vector modulus normalization and similarity calculation. In this way, the scoring mechanism avoids the drawbacks of traditional fixed jumps based on static flowcharts, introducing more flexible and intelligent jump control logic, effectively supporting complex process scenarios such as parallelism, branching, and conditional judgments, and enhancing the flexibility and execution optimization capabilities of the workflow system.
[0105] S25. Supports parallel branch structure, sets parallel execution set in task node set, allows the same upstream node to point to multiple downstream task nodes, and configures jump synchronization mechanism;
[0106] S26. Store the constructed flowchart structure, adjacency matrix, and state vector set into the process definition container for use in Prompt input text generation and process execution control.
[0107] This invention addresses the insufficient process management capabilities in large model-driven applications by proposing a configurable workflow definition method that integrates semantic description, task labeling, and state-aware scheduling. This significantly improves the flexibility of process configuration, the semantic nature of expression, and the adaptability of execution. By introducing a semantic process description language to construct a workflow graph structure, the method precisely defines the set of task nodes and directed connections, building a resolvable process topology. Each task node is configured with a task type and semantic label, enabling type identification and semantic layering of process tasks. Furthermore, process jump rules are defined, introducing an innovative jump scoring function that integrates node state vectors and task function vectors to calculate the jump priority of process connection paths, achieving fine-grained control and dynamic optimization of process jump behavior. Simultaneously, it supports parallel branch structures and synchronization mechanisms, allowing the process to be deployed in parallel on multiple task paths, improving task execution efficiency. Finally, the flowchart structure, adjacency matrix, and state vectors are uniformly encapsulated in a process definition container, providing complete structural support for subsequent Prompt generation and execution scheduling. This solution balances structural definability and scheduling intelligence, possesses excellent system adaptability, task configuration efficiency, and operational controllability, and is suitable for large-scale intelligent workflow scenarios involving the collaborative execution of multiple model tasks.
[0108] In this embodiment, S3 specifically includes:
[0109] S31. Initialize the Prompt template construction rules and preset the corresponding Prompt template structure for each task type. The Prompt template structure consists of a static text frame and replaceable variable slots.
[0110] S32. Transfer the semantic tag set L bound to the current task node. i Mapped to a set of semantic tag embedding vectors Each label embedding vector represents the semantic embedding representation of the label, and q is the number of semantic labels;
[0111] S33. Retrieve the set of vectors embedded with labels from the knowledge embedding dataset V. i The set of embedding vectors whose semantic similarity to any vector is greater than a preset threshold η.
[0112]
[0113] Among them, v k Let k be the knowledge embedding vector, and max be the maximum value operation. Let be the embedding vector of the j-th semantic tag;
[0114] Embedded vector set The practical significance of this formula lies in the fact that before constructing the enhanced Prompt input text, the system extracts knowledge fragments highly relevant to the current task node from the domain knowledge base. This process is performed through "semantic similarity," comparing the semantic tags bound to the task node with each knowledge fragment in the knowledge base at the semantic level to determine whether they have sufficient semantic relevance. Only when the semantic relevance between a knowledge fragment and the task tag exceeds a set similarity threshold will the system include that knowledge fragment in the candidate set for injection into the Prompt. The significance of this mechanism is that it can effectively filter knowledge content that is irrelevant to the task or has weak relevance, ensuring that the information injected into the Prompt is highly relevant and accurate, thereby improving the professionalism and relevance of the final large language model response content. At the same time, this semantic similarity-based screening method avoids the bias or misleading caused by relying solely on keyword matching, helping to enhance the robustness and intelligence of the system when facing complex semantic tasks, and possesses good practical feasibility and application promotion value.
[0115] S34. Embed the vector set Each knowledge vector is mapped to a Prompt semantic block, and a ranking priority weight π(b) is calculated for each Prompt semantic block. k ):
[0116]
[0117] Among them, e k For Prompt semantic block b k The embedding vector, w j For the semantic weight of the label, ρ k α is the semantic block structure priority factor, β is the fusion adjustment coefficient, and softmax represents the normalized sorting function.
[0118] Calculate the sorting priority weight π(b) k The core significance of this method lies in its ability to accurately measure the value of each knowledge fragment in the current task by integrating semantic relevance, label weights, and structural adaptability, thereby guiding the semantic organization order of the Prompt. Specifically, it first calculates the semantic similarity between each semantic block and all semantic labels in the current task node, using a normalized vector inner product to measure semantic similarity. To reflect the different impacts of different semantic labels on the task, a weighting factor is introduced for each label to enhance the dominance of key semantic labels in the ranking results. Secondly, the formula also introduces a structural priority factor for semantic blocks to assess whether they are more suitable for insertion into specific slots in the Prompt template structure. Finally, the system uses a fusion adjustment coefficient to uniformly weight and fuse semantic similarity scores and structural adaptability, and normalizes the weights of all semantic blocks into ranking probabilities using a softmax function. By comprehensively considering multiple factors, it assigns reasonable ranking priorities to candidate semantic blocks, achieving dynamic matching between task semantics, structural expectations, and knowledge fragments, thereby improving the contextual relevance and generation effect of the Prompt input. This method has a clear logical path and strong feasibility.
[0119] S35. According to the sorting priority weight π(b) k Arrange the Prompt semantic blocks in descending order, insert them into the Prompt template slots in sequence, construct the final Prompt input text, and record the Prompt construction log information, including the semantic tags used, the index of the matched semantic blocks, the content replaced, and the order.
[0120] This invention addresses the lack of semantic awareness and knowledge enhancement in the Prompt construction process of large-scale model applications. It proposes an adaptive Prompt generation method that combines semantic tag embedding and knowledge embedding ranking strategies, significantly improving the context matching and expression quality of Prompt construction. The method initializes the Prompt template structure corresponding to the task type, defining a static text framework and replaceable slots to lay the foundation for subsequent automatic filling. Semantic tags bound to task nodes are mapped to a set of semantic tag embedding vectors, achieving a vectorized expression of node semantic features. Furthermore, semantic vector retrieval is performed from the knowledge embedding dataset, filtering knowledge fragments highly similar to the semantic tag embedding vectors to ensure the introduced content is highly relevant to the task context. A priority scoring function based on semantic tag weights, structural priority factors, and fusion adjustment coefficients is used to weight and rank candidate Prompt semantic blocks, and normalization is applied to form the final filling order. Finally, Prompt semantic blocks are embedded into template slots in descending weight order, dynamically generating Prompt input text adapted to the semantics of the current task. This scheme possesses high knowledge adaptability and semantic fit, significantly improving the response accuracy, context understanding ability, and Prompt generation efficiency of large language models in different tasks.
[0121] In this embodiment, S4 specifically includes:
[0122] S41. Receive the semantic tags configured in the current task node, load all generated semantic embedding vector sets and corresponding original knowledge fragment texts in the knowledge embedding dataset, and use them as the basis for knowledge retrieval required by the current task node.
[0123] S42. Based on the semantic labels configured in the current task node and the semantic embedding vectors of each knowledge fragment in the knowledge embedding dataset, perform semantic vector retrieval operations to construct a preliminary set of candidate knowledge fragments based on vector similarity.
[0124] S43. For each knowledge fragment in the initial screening set of candidate knowledge fragments, and in conjunction with the semantic tags bound to the task nodes, perform path consistency comparison in the domain semantic graph structure to obtain the semantic path structure matching status.
[0125] S44. Based on semantic path consistency, candidate knowledge fragments are screened and sorted, and knowledge fragments with similar semantic path structure consistency to the current task node are selected first to construct a target injection fragment set.
[0126] S45. Convert the knowledge fragments in the target injection fragment set into a structured text format to maintain compatibility with the Prompt input text structure of the current task node, and construct the injection preparation area.
[0127] S46. Insert the structured target injection fragment into the Prompt input text of the current task node to form an enhanced Prompt input text, and write the enhanced Prompt input text into the output buffer of the task node.
[0128] This invention addresses the issue of inaccurate knowledge injection and semantic matching in large-scale model calls by proposing a knowledge fragment selection and injection method based on semantic vector retrieval and semantic path structure comparison, significantly improving the knowledge relevance and structural consistency of the Prompt input text. First, by loading semantic embedding vectors and corresponding original knowledge fragments from the knowledge embedding dataset, a full foundation for task node knowledge retrieval is constructed. Second, using the semantic tag vectors bound to the task nodes as the retrieval basis, an initial set of candidate knowledge fragments is constructed to ensure semantic relevance. Further, semantic path consistency comparison is performed in the domain semantic graph, and structured matching analysis is conducted on the semantic relationships of the candidate fragments to select a set of target injection fragments with highly consistent semantic path structures, fundamentally ensuring the reasonable embedding of knowledge content within the context. Subsequently, the target fragments undergo format standardization processing to ensure their grammatical structure is consistent with the Prompt input framework, and an injection preparation area is constructed. Finally, the structured knowledge fragments are sequentially inserted into the Prompt text to form an enhanced Prompt input text, which is then cached in the task node output area. This method enhances the accuracy of knowledge utilization and semantic reasoning ability in large-scale model task execution, effectively improving the accuracy of model response and the depth of contextual understanding.
[0129] In this embodiment, S5 specifically includes:
[0130] S51. Receive the enhanced Prompt input text as input data for the current task node, and read the large language model interface information bound in the current task node.
[0131] S52. Based on the configured task type, allocate large language model inference resources to the current task node and initialize the large language model inference task queue.
[0132] S53. Input the enhanced Prompt text into the large language model interface, activate the large language model inference task, and listen to the returned content and record the call status in an asynchronous manner.
[0133] S54. Obtain the results returned by the large language model, perform content normalization processing, extract key fields and semantic expression structures from the returned text, and generate structured response information;
[0134] S55. Perform response quality assessment on the structured response information, collect the response time of the large language model, the success rate of the call, and the semantic coverage score between the large language model and the task semantic tags, and generate the response index of the large language model.
[0135] S56. Based on the terminology constraints and entity consistency standards in the domain knowledge base, perform content credibility verification and generate a response content credibility score. If the response content credibility score is greater than the preset credibility threshold, write the result returned by the large language model into the output buffer of the current task node.
[0136] S57. Based on the set flow jump rules, extract the structured key parameters from the results returned by the large language model and input them into the jump rule expression J(x). If the result is true, update the current flow execution pointer and determine the next execution node:
[0137]
[0138] Where μ, τ and θ is the jump weight coefficient. s To score semantic coverage, λ c To assess the credibility of the response content, S m (x,L i Let x be the structured parameter and L be the semantic tag set. i The semantic matching score function between them, where δ is the jump judgment threshold;
[0139] The jump rule expression J(x) is used to make decisions on task node jumps in intelligent workflows. Its core lies in integrating multiple semantically relevant indicators to comprehensively evaluate whether the current task node meets the jump conditions. First, the formula considers the semantic matching degree between structured parameters and task semantic tags. This part measures the consistency between the large language model's returned results and the current task objective, reflecting the fit of the execution context. Second, the formula introduces a model response credibility score to determine whether the model's output has sufficient accuracy and reliability, thereby avoiding incorrect process jumps due to response errors. Third, a semantic coverage score is introduced to measure the overall coverage of the task's semantic tags by the large language model's returned results, ensuring that the output information fully supports the semantics required by the task. These three factors are assigned weights and linearly weighted to form the final score. The system compares this score with a set jump judgment threshold to decide whether to jump to the next process node. This formula achieves dynamic process control driven by multiple factors, helping to improve the intelligent judgment capability of the workflow, enhance the accuracy and stability of the process response, and ensure the continuity and semantic consistency of task execution.
[0140] S58. Record the response metrics of the large language model for the current task node, the credibility score of the response content, and the jump judgment status, and write them to the workflow execution log and the large language model call data table.
[0141] This invention improves the inference accuracy and response reliability of large language models in configurable workflows by constructing a full-process large language model invocation and response control mechanism for enhanced prompt input text. First, it receives and loads the enhanced prompt input text of the current task node, while simultaneously reading the bound large language model interface information. Based on the configured task type, it initializes model inference resources and task queues, fundamentally ensuring resource scheduling and load balancing for inference execution. Then, it activates large language model inference asynchronously, and after obtaining the returned content, performs normalization processing and structured parsing to further ensure clear and controllable response results. By introducing a response quality evaluation mechanism, it quantitatively analyzes response time, success rate, and semantic coverage with semantic tags, constructing a model response index system. Simultaneously, it uses terminology constraint rules from the domain knowledge base to perform credibility verification of the response content, ensuring output reliability from a content consistency perspective. Furthermore, by combining the set process jump rules and structured parameter parsing results, it determines whether the process should jump, forming a data-driven dynamic control process mechanism. Finally, it comprehensively records model response indicators, credibility scores, and jump statuses to support subsequent log auditing and system optimization. This solution effectively ensures the quality, security, and process controllability of the inference output of large language models, and improves the robustness and reliability of large model application systems.
[0142] In this embodiment, S6 specifically includes:
[0143] S61. Receive the task type, large language model response index and semantic tag set configured by each task node, and call the constructed knowledge embedding dataset. Perform vector embedding operation on each semantic tag in the semantic tag set to generate a semantic tag vector sequence. After weighted averaging, the semantic tag vector of the task node is formed, and the running semantic state vector of the current task node is constructed.
[0144] S62. Construct a multi-dimensional service candidate matrix M, where each large language model service instance is represented as a service state vector Ω. i =[R i ,δ i ,L i ,ε i ], including available computing resources R i Historical stability score δ i Current load status L i Service flexibility ε i , where ε iThis indicates the ability of large language model service instances to maintain stable responses under different semantic tasks;
[0145] S63. Construct an evolutionary scheduling scoring function based on the runtime semantic state vector. Used to score the fit of large language model service instances in the t-th scheduling round:
[0146]
[0147] Where η1 is the similarity score weight coefficient, η2 is the load weight coefficient, η3 is the elasticity weight coefficient, η4 is the trend score weight coefficient, and λ k For semantic label vectors, μ i Sim(λ) is the historical semantic response vector of the service instance for a large language model. k ,μ i ) represents the current semantic label vector λ k With the historical semantic response vector μ of the large language model service instance i cosine similarity, L i ε serves the current model load. i For service elasticity, Trend(i,t) represents the stability of the scheduling trend of the large language model service instance in the first t-1 rounds;
[0148] Evolutionary scheduling scoring function The practical significance of this method is to comprehensively evaluate the scheduling and adaptation capabilities of large language model service instances at a specific point in time, thereby providing a quantitative basis for model selection in multi-task dynamic inference environments. It comprehensively scores service instances from four aspects: semantic matching degree, current service load, service resilience, and historical response trend. Semantic matching degree reflects the semantic relevance between the semantic labels of the current task and the historical tasks processed by the service instance; a higher matching degree indicates that the model is better at handling the current task content. The inverted service load represents the availability of current computing resources; the closer to 1, the more idle the resource and the higher its scheduling priority. Service resilience reflects the service's stable handling capability under high concurrency scenarios. The trend score considers the service's historical performance and stability in continuous task scheduling, used to capture the behavioral evolution of service instances. By weightedly integrating these four indicators, the formula can dynamically and accurately characterize the scheduling advantages and disadvantages of each service instance, achieving optimal adaptation between tasks and model services, and improving the intelligence and stability of the entire system. This mechanism is particularly suitable for collaborative scheduling scenarios of large models and multiple instances, demonstrating good feasibility and practical value.
[0149] S64. Calculate the scheduling score of each large language model service instance, construct an instance scheduling priority ranking list, and select the large language model service instance with the highest score as the recommended service interface for the current task node.
[0150] S65. Introduce service switching determination function C switch :
[0151]
[0152] in, To recommend large language model service instance scores, Score the currently bound large language model service instance, where ∈ is the switching score threshold, ζ is the minimum trend stability threshold, and M * The optimal large language model service instance selected for the current task node; ∧ is a logical operator.
[0153] Service switching determination function C switch The practical significance of the formula lies in determining whether the current task node needs to switch the bound large language model service instance, thereby achieving intelligent large model service scheduling and dynamic optimization. Specifically, this mechanism comprehensively evaluates the performance score difference between the recommendation model service and the currently bound model service, and combines this with the stable performance of the recommendation service in recent task scheduling as the basis for triggering the switch. When the performance score of the recommendation service is significantly better than the current service, and it consistently demonstrates high stability and adaptability in multiple rounds of task execution, the system will determine that the switching conditions are met, and thus execute the replacement operation of the model service interface. The advantage of this method is that it avoids frequent service switching due to short-term performance fluctuations, ensuring the stability and efficiency of service scheduling. At the same time, it can also adjust the service binding relationship in a timely manner when the performance of the model service degrades or the performance of the new service instance significantly improves, thereby improving the overall response quality and resource utilization of the inference task. By integrating the joint constraints of performance difference and trend judgment, this mechanism achieves accurate selection and intelligent switching of large language model service interfaces in a dynamic operating environment, possessing significant practical value and feasibility.
[0154] S66, If C switch =True, then update the inference call interface of the current task node to M. * Simultaneously, the reason for the switch, the score change, and the trend status are recorded in the service scheduling log;
[0155] S67. If C switch =False, then keep the current large language model service instance unchanged, update the current node task status, and mark it as "not switched";
[0156] S68. Write the scores, judgment process, final large language model interface and trend evolution data of all scheduling rounds into the task node context information structure and workflow execution log, supporting scheduling optimization and multi-task reasoning historical analysis.
[0157] This invention addresses the dynamic selection and scheduling problem of large language model service instances in configurable workflows. It proposes an adaptive service scheduling method based on runtime semantic state vectors and an evolutionary scheduling scoring function, significantly improving the adaptation accuracy and execution efficiency between tasks and model services. By vectorizing the semantic tag set of task nodes, a runtime semantic state vector for the current task node is constructed, comprehensively reflecting the task type and semantic features. Based on this, a multi-dimensional service candidate matrix is constructed to comprehensively quantify the computational resources, historical stability, current load, and response elasticity of each large language model service instance, thus providing multi-faceted support for scheduling scoring. By introducing an evolutionary scheduling scoring function that integrates similarity, load, elasticity, and trend dimensions, a multi-dimensional dynamic evaluation of service instance adaptability is achieved, and the optimal recommended model service interface is selected based on the score ranking. Simultaneously, a service switching judgment function is introduced to control service switching while ensuring response stability, avoiding system oscillations caused by frequent switching. Finally, all scheduling information is written to the context structure and execution log, achieving transparency and historical traceability of the service call process. This solution boasts advantages such as accurate semantic matching, strong adaptability, and intelligent service scheduling, significantly improving the stability and controllability of multi-task large language model inference systems.
[0158] Example 1:
[0159] To verify the feasibility of this invention in practice, it was applied to a large administrative service center. The business process system originally used by the center, based on traditional rule configuration and static model services, often experienced problems such as response delays and low processing accuracy when facing peak business periods. This was particularly evident in tasks such as contract clause extraction, policy Q&A generation, and regulatory archiving, and it could no longer meet the dynamic reasoning and adaptive scheduling requirements in high-concurrency and complex semantic understanding scenarios.
[0160] To address the aforementioned issues, the center adopted the "Method for Constructing Large Language Model Applications Based on Configurable Workflows and Domain Knowledge Bases" proposed in this invention for system upgrades. After deploying the method of this invention, the system first performed semantic structuring processing on the original industry data, constructed a knowledge embedding dataset, and built a workflow diagram based on this, defining jump rules and semantic label annotations, thus achieving intelligent optimization of the entire process from Prompt generation, enhancement, inference to scheduling.
[0161] In real-world business scenarios, such as the "intelligent question-answering generation" task, the system of this invention dynamically identifies semantic tags, retrieves related knowledge, generates a structured Prompt, and selects the optimal large language model instance for inference, reducing the average response time from 1130 milliseconds to 665 milliseconds and increasing the accuracy from 80.1% to 93.1%. In the "contract information extraction" scenario, the system quickly determines task redirection and response credibility through process jump rules, improving accuracy by 16.4% and reducing response time by 45.3%. In the "automatic form archiving" scenario, the system can intelligently determine field classification and semantic intent matching, improving accuracy to 89.4%, significantly better than the original system's 74.5%.
[0162] During the entire testing period, more than 5,000 task call requests were processed. After deploying the method of this invention, the task execution log showed that the average accuracy improved by more than 14%, the average response latency decreased by more than 43%, the number of process failure retries decreased by 65%, and the stability of system calls was significantly enhanced.
[0163] Table 1 Performance Comparison Data Between the Invention System and the Original System
[0164]
[0165] In the proposed method for constructing large language models based on configurable workflows and domain knowledge bases, the integrated application of mechanisms such as process semantic modeling, Prompt semantic enhancement, and model scheduling optimization significantly improves the response efficiency and accuracy of large language models in typical task scenarios. To verify the effectiveness of the system, three typical tasks—"intelligent question answering generation," "contract information extraction," and "automatic form archiving"—were selected for comparative testing to evaluate the system's performance before and after optimization in terms of average response time and result accuracy—two key indicators.
[0166] In the intelligent question-answering generation task, the original system had an average response time of 1130 milliseconds and an accuracy of 80.1%. However, after Prompt enhancement and model load scheduling optimization, the average response time of the system in this invention was reduced to 665 milliseconds, and the accuracy was improved to 93.1%. This demonstrates that in generative tasks with clear semantic objectives and high-quality knowledge injection, the process semantic label mapping and knowledge vector filtering mechanism of this invention effectively compresses the model's computational path and improves the inference hit rate.
[0167] In the contract information extraction task, the original system had a response time of 980 milliseconds and an accuracy of 74.2%; while the optimized system had a response time reduced to 536 milliseconds and an accuracy improved to 90.6%. This invention demonstrates a more significant advantage in such structured extraction tasks, mainly due to the domain terminology graph and its embedding vectors introduced in this method, which provide more targeted semantic constraints in the Prompt construction, thereby reducing redundant content and improving the ability to identify key information.
[0168] In the task of automatic form archiving, the original system had an average response time of 860 milliseconds and an accuracy of 74.5%; while after adopting the method of this invention, the response time was reduced to 478 milliseconds and the accuracy increased to 89.4%. This result reflects that the present invention improves the intelligence level of archived information extraction and classification in data archiving tasks through structured Prompt generation and jump judgment optimization, especially in high-frequency repetitive task scenarios, it can more effectively shorten the response time and control the accuracy.
[0169] In summary, all three types of tasks achieved significant performance improvements in the system of this invention, with average response time reduced by more than 40% and average accuracy improved by more than 15%. These results demonstrate that the method of this invention not only possesses good task adaptability and scalability, but also exhibits excellent feasibility and practical value in various complex task environments, fully verifying its general support capabilities and business deployment advantages in large language model applications.
[0170] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for constructing large-scale model applications based on configurable workflows and domain knowledge bases, characterized in that: Includes the following steps: S1. Construct a domain knowledge base, collect industry documents and terminology, extract entities, relationships and attributes, build a semantic graph, and generate a knowledge embedding dataset; S2. Define a configurable workflow, set process jump rules based on a preset semantic process description language, configure task types for each task node and bind semantic tags; S3. Configure the Prompt adaptive generation mechanism to generate the Prompt input text for the current node based on the semantic labels of the task nodes and the knowledge embedding dataset. S4. Call the knowledge embedding dataset to perform semantic vector retrieval, obtain related knowledge fragments, filter and sort them according to semantic path consistency, and embed them into the Prompt input text to form an enhanced Prompt input text. S5. Input the enhanced Prompt text into the large language model interface, obtain the return result of the large language model, record the response index of the large language model, and determine whether the jump condition is met based on the return result of the large language model and the process jump rules, and determine the next execution node. S6. Based on the task type and the response indicators of the large language model, and combined with the current process execution load, select the optimal interface from multiple large language model service instances, and support the switching of large language models and dynamic updates of scheduling strategies. S7. Organize the results returned by the large language model at the process termination node into output, and record the workflow execution log and the large language model call data at the same time. S6 specifically includes: Constructing an evolutionary scheduling scoring function based on runtime semantic state vectors. Used for large language model service instances in the first... The fit is scored in each scheduling round: ; in, This is the weighting coefficient for the similarity score. This is the load weighting coefficient. This is the elasticity weighting coefficient. The trend score weighting coefficient, The current semantic label vector Historical semantic response vectors of large language model service instances cosine similarity, To serve the current model load, To improve service flexibility, Instances of serving large language models first Stability of scheduling trends during rounds; Calculate the scheduling score for each large language model service instance, construct a priority ranking list of instance scheduling, and select the large language model service instance with the highest score as the recommended service interface for the current task node; Introducing a service switching determination function : ; in, To recommend large language model service instance scores, Score the currently bound large language model service instances. To switch the rating threshold, The minimum trend stability threshold, The optimal large language model service instance selected for the current task node. For logical operators; like Then the inference call interface of the current task node will be updated to... Simultaneously, the reason for the switch, the score change, and the trend status are recorded in the service scheduling log; like If the current large language model service instance remains unchanged, the current node task status is updated and marked as "not switched".
2. The method for constructing large model applications based on configurable workflows and domain knowledge bases according to claim 1, characterized in that, S1 specifically includes: S11. Collect structured and unstructured data of the target industry. The structured data includes terminology standards, classification codes, and basic knowledge tables. The unstructured data includes industry policy documents, research reports, and domain corpora. S12. Perform text preprocessing operations on structured and unstructured data, including word segmentation, part-of-speech tagging, and named entity recognition, and extract entity sets. Relation sets With attribute collection ; S13, For the extracted entity set Perform multi-granularity semantic extension processing to construct a multi-granularity entity set. ,in, The number of semantic granularity layers. Indicates the first Subsets of entities at the layer granularity; S14, Based on multi-granularity entity sets Relation sets With attribute collection Constructing a semantic graph The edge structure in a graph is represented by triples, and a triple is defined as follows: ,in, This represents the i-th entity node. Represents the j-th semantic relation. Indicates and Through semantic relationships Another entity node that is connected; S15, Based on semantic graph A multi-view structural representation is constructed, and three types of subgraphs are built from semantically similar views, entity connection views, and attribute dependency views. Graph embedding operations are then performed on each subgraph to generate a set of embedding vectors. The knowledge embedding dataset is obtained by fusing the set of embedded vectors. ,in, Represents the merged entity The vector representation of , The number of entity vectors; S16. Embedding knowledge into datasets Input the data into the vector retrieval engine and configure the index structure.
3. The method for constructing large model applications based on configurable workflows and domain knowledge bases according to claim 1, characterized in that, S2 specifically includes: S21. Define workflow diagram structure based on semantic process description language. ,in, Represents a set of task nodes. This indicates the directed connection relationship between nodes; S22, for each task node Configure task type The task types include information extraction, text generation, structure transformation, and data archiving, forming a task type set. ,in, This represents the total number of task nodes in the workflow. S23, for each task node Configure semantic tag set Define the semantic category of the node, where q is the number of semantic tags; S24. Set the process jump rules and construct the jump scoring function. Define the adjacency matrix ,in, Represents task node You can jump to For each node Construct a state vector to represent the node's current execution load, input size, and task density information; S25. Supports parallel branch structure, sets parallel execution set in task node set, allows the same upstream node to point to multiple downstream task nodes, and configures jump synchronization mechanism; S26. Store the constructed flowchart structure, adjacency matrix, and state vector set into the process definition container for use in Prompt input text generation and process execution control.
4. The method for constructing large model applications based on configurable workflows and domain knowledge bases according to claim 1, characterized in that, S3 specifically includes: S31. Initialize the Prompt template construction rules and preset the corresponding Prompt template structure for each task type. The Prompt template structure consists of a static text frame and replaceable variable slots. S32. Retrieve the set of semantic tags bound to the current task node. Mapped to a set of semantic tag embedding vectors , where each label embedding vector represents the semantic embedding representation of the label, and q is the number of semantic labels; S33, From Knowledge Embedded Datasets Search and tag embedding vector set The semantic similarity of any vector in the set is greater than a preset threshold. Embedded vector set ; S34. Embed the vector set Each knowledge vector is mapped to a Prompt semantic block, and a ranking priority weight is calculated for each Prompt semantic block. ; S35. According to sorting priority weight Arrange the Prompt semantic blocks in descending order, insert them into the Prompt template slots in sequence, construct the final Prompt input text, and record the Prompt construction log information, including the semantic tags used, the index of the matched semantic blocks, the content replaced, and the order.
5. The method for constructing large model applications based on configurable workflows and domain knowledge bases according to claim 1, characterized in that, S4 specifically includes: S41. Receive the semantic tags configured in the current task node, load all generated semantic embedding vector sets and corresponding original knowledge fragment texts in the knowledge embedding dataset, and use them as the basis for knowledge retrieval required by the current task node. S42. Based on the semantic labels configured in the current task node and the semantic embedding vectors of each knowledge fragment in the knowledge embedding dataset, perform semantic vector retrieval operations to construct a preliminary set of candidate knowledge fragments based on vector similarity. S43. For each knowledge fragment in the initial screening set of candidate knowledge fragments, and in conjunction with the semantic tags bound to the task nodes, perform path consistency comparison in the domain semantic graph structure to obtain the semantic path structure matching status. S44. Based on semantic path consistency, candidate knowledge fragments are screened and sorted, and knowledge fragments with similar semantic path structure consistency to the current task node are selected first to construct a target injection fragment set. S45. Convert the knowledge fragments in the target injection fragment set into a structured text format to maintain compatibility with the Prompt input text structure of the current task node, and construct the injection preparation area. S46. Insert the structured target injection fragment into the Prompt input text of the current task node to form an enhanced Prompt input text, and write the enhanced Prompt input text into the output buffer of the task node.
6. The method for constructing large model applications based on configurable workflows and domain knowledge bases according to claim 1, characterized in that, S5 specifically includes: S51. Receive the enhanced Prompt input text as input data for the current task node, and read the large language model interface information bound in the current task node. S52. Based on the configured task type, allocate large language model inference resources to the current task node and initialize the large language model inference task queue. S53. Input the enhanced Prompt text into the large language model interface, activate the large language model inference task, and listen to the returned content and record the call status in an asynchronous manner. S54. Obtain the results returned by the large language model, perform content normalization processing, extract key fields and semantic expression structures from the returned text, and generate structured response information; S55. Perform response quality assessment on the structured response information, collect the response time of the large language model, the success rate of the call, and the semantic coverage score between the large language model and the task semantic tags, and generate the response index of the large language model. S56. Based on the terminology constraints and entity consistency standards in the domain knowledge base, perform content credibility verification and generate a response content credibility score. If the response content credibility score is greater than the preset credibility threshold, write the result returned by the large language model into the output buffer of the current task node. S57. Based on the set flow jump rules, extract the structured key parameters from the results returned by the large language model, and input the jump rule expression. If the determination result is true, then update the current process execution pointer and determine the next execution node; S58. Record the response metrics of the large language model for the current task node, the credibility score of the response content, and the jump judgment status, and write them to the workflow execution log and the large language model call data table.
Citation Information
Patent Citations
Vertical domain document question and answer method and system based on knowledge graph enhanced large model
CN119646026A
Dynamic ontology construction method based on large model
CN119691194A