An implicit workflow construction method and device, electronic equipment and storage medium

By constructing an implicit workflow, generating a training dataset, and combining reasoning with the prompts from virtual characters, the problem of uncontrollable processes in complex logical problems by large models is solved, thereby improving the controllability and efficiency of large models in handling complex problems.

CN117009443BActive Publication Date: 2026-05-08NANJING TRANSWARP INTELLIGENCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING TRANSWARP INTELLIGENCE CO LTD
Filing Date
2023-08-03
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Large models lack controllability and intuitiveness in solving complex logical problems, and existing methods struggle to make the process measurable and controllable.

Method used

By constructing implicit workflows based on existing workflows, training datasets for multiple flowlets are generated. The functionality of implicit workflows is realized through reasoning based on the prompts from virtual characters, and the construction process is controllable.

Benefits of technology

This makes the large model measurable and controllable in solving complex logical problems, improving the controllability and efficiency of the large model in handling complex problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117009443B_ABST
    Figure CN117009443B_ABST
Patent Text Reader

Abstract

The application discloses a kind of implicit workflow construction method, device, electronic equipment and storage medium.The method includes: implicit workflow construction is carried out based on existing workflow, and the implicit workflow obtained by construction is formed by the series connection of multiple workflow modules flowlet;Generation of the training data set of the multiple flowlets;Implicit workflow learning is carried out based on the training data set, and the prompt information of the virtual role corresponding to the multiple flowlets is constructed in the learning process;The prompt information of multiple virtual roles is combined reasoning according to the arrangement order of the multiple flowlets and the original logical relationship, to realize the function of implicit workflow.The implicit work amount constructed by the method can realize the process of complex problems by large model measurable and controllable, can also be based on the result of each step timely error correction, and performance is stable and controllable, implementation efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of artificial intelligence technology, and in particular to a method, apparatus, electronic device and storage medium for constructing implicit workflows. Background Technology

[0002] With the rapid development of artificial intelligence, machine learning technology is also advancing rapidly. From machine learning to deep learning and then to large-scale learning, large models have shown good performance in solving the generalization and logical reasoning problems that have long been unsolved in the field of machine learning, providing possibilities for the realization of general artificial intelligence. However, there is a lack of effective safeguards for improving the CoT (Cooperation and Logic) capabilities of large models, thus posing a huge challenge to the application of large model technology.

[0003] The following are some current methods to improve the CoT (Cooperation and Testing) capabilities of large models: 1. Improve the CoT capabilities of models through code training; 2. Guide large models to think according to the logic of examples and provide answers by providing hints and few-shot methods; 3. Train large models with corpora containing specific thinking logic, such as the solution process and results of mathematical arithmetic problems; 4. Use large models as control modules to train them to use various tools, thereby enabling large models to solve complex problems, such as AutoGPT.

[0004] The drawback of methods 1 and 2 is that the process of solving complex logic problems is not intuitive and is not controllable. Therefore, how to make the process of large models solving complex logic problems controllable is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] This invention provides a method, apparatus, electronic device, and storage medium for constructing implicit workflows to address the problem that the process of solving complex logical problems using large models is not intuitive or controllable.

[0006] According to one aspect of the present invention, a method for constructing an implicit workflow is provided, comprising:

[0007] Implicit workflows are built based on existing workflows. The resulting implicit workflow is formed by connecting multiple workflow modules (flowlets).

[0008] Generate the training dataset for the multiple flowlets;

[0009] Implicit workflow learning is performed based on the training dataset, and prompt information for virtual roles corresponding to the multiple flowlets is constructed during the learning process;

[0010] The implicit workflow function is achieved by combining and reasoning the prompts from multiple virtual characters according to the arrangement order of the multiple flowlets and the original logical relationship.

[0011] According to another aspect of the present invention, an implicit workflow construction apparatus is provided, comprising:

[0012] The building module is used to build implicit workflows based on existing workflows. The resulting implicit workflow is formed by connecting multiple workflow modules (flowlets).

[0013] A generation module is used to generate the training dataset for the multiple flowlets;

[0014] The learning module is used to learn implicit workflows based on the training dataset, and the learning process includes prompts for virtual roles corresponding to the multiple flowlets.

[0015] The implicit workflow function is achieved by combining and reasoning the prompts from multiple virtual characters according to the arrangement order of the multiple flowlets and the original logical relationship.

[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: at least one processor; and

[0017] A memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the implicit workflow construction method according to any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the implicit workflow construction method according to any embodiment of the present invention.

[0020] The technical solution of this invention constructs an implicit workflow based on an existing workflow. The constructed implicit workflow is formed by connecting multiple workflow modules (flowlets). A training dataset for the multiple flowlets is generated. Implicit workflow learning is performed based on the training dataset. During the learning process, prompt information for virtual characters corresponding to the multiple flowlets is constructed. The prompt information for the multiple virtual characters is combined and reasoned according to the arrangement order of the multiple flowlets and the original logical relationship to realize the function of implicit workflow. This solves the problem that the process of large models solving complex logical problems is not intuitive and uncontrollable, and achieves the beneficial effect of making the process of large models handling complex problems measurable and controllable.

[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0023] Figure 1 This is a flowchart illustrating an implicit workflow construction method provided in Embodiment 1 of the present invention;

[0024] Figure 2 This is a schematic diagram of implicit workflow construction based on existing workflow provided in Embodiment 1 of the present invention;

[0025] Figure 3 A schematic diagram illustrating the process of generating a training dataset of multiple flowlets in an implicit workflow construction method provided for an embodiment of the present invention;

[0026] Figure 4 This is a flowchart illustrating a method for constructing an implicit workflow according to Embodiment 2 of the present invention.

[0027] Figure 5 This is a schematic diagram of an implicit workflow construction method provided in an example embodiment of the present invention;

[0028] Figure 6 This is a flowchart of an NL2SQL large model database adaptive method provided in Embodiment 3 of the present invention;

[0029] Figure 7 A flowchart illustrating an adaptive method for a large NL2SQL database provided in a specific embodiment of the present invention;

[0030] Figure 8 A flowchart of the adaptive workflow of the NL2SQL database provided for a specific embodiment of the present invention;

[0031] Figure 9 A schematic diagram of the segmentation operator provided in a specific embodiment of the present invention;

[0032] Figure 10 This is a schematic diagram of the structure of a hidden workflow construction device provided in Embodiment 4 of the present invention;

[0033] Figure 11This is a schematic diagram of the structure of an electronic device according to an embodiment of the implicit workflow construction method of the present invention. Detailed Implementation

[0034] To enable those skilled in the art to better understand the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. 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 scope of protection of the present invention. It should be understood that the various steps described in the method embodiments of the present invention can be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0035] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0036] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0037] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0038] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0039] Example 1

[0040] Figure 1 This is a flowchart illustrating an implicit workflow construction method provided in Embodiment 1 of the present invention. This method is applicable to situations where large-scale complex logic processing capabilities are achieved. This method can be executed by an implicit workflow construction device, which can be implemented by software and / or hardware and is generally integrated on an electronic device. In this embodiment, the electronic device includes, but is not limited to, a computer device.

[0041] like Figure 1 As shown, the implicit workflow construction method provided in Embodiment 1 of the present invention includes the following steps:

[0042] S110. Construct implicit workflows based on existing workflows. The resulting implicit workflows are formed by connecting multiple workflow modules (flowlets).

[0043] The existing workflows can be for large models, which are generative models. These workflows can be manually defined or automatically generated. To better adapt to various pipeline application scenarios, flowlets can be executed for non-large models, such as a flowlet within a workflow that executes a script.

[0044] In this embodiment, the process of constructing an implicit workflow based on an existing workflow can be as follows: the existing workflow is divided according to the input and output data of the operators in the existing workflow, and an implicit workflow computation graph based on a large model is constructed according to the division results.

[0045] It should be noted that the existing workflow segmentation method is different from the traditional workflow segmentation method (such as deep learning computation graph segmentation method and distributed data processing computation graph segmentation method). It only segments based on the input and output data of the operator, without considering distributed computing partitioning or functional module partitioning.

[0046] Furthermore, existing workflows consist of multiple operators, each with corresponding input and output data, with the input data of the upstream operator serving as the output data of the downstream operator.

[0047] Figure 2 This is a schematic diagram of implicit workflow construction based on existing workflow provided in Embodiment 1 of the present invention, as shown below. Figure 2 As shown, operators op-0 to op-6 connect the entire existing workflow. in-1 is the input data of op-1, and out-1 is the output data of op-1. The output data out-0 of the upstream operator op-0 can be used as the input data in-1 of the downstream operator op-1.

[0048] Optionally, implicit workflow construction based on existing workflow includes: dividing the existing workflow into multiple operators based on the input and output data; mapping the multiple operators according to the mapping rules in the implicit workflow mapping rule base to obtain multiple workflow modules (flowlets); and constructing an implicit workflow based on a large model through the concatenation of flowlets.

[0049] In this process, multiple operators obtained from the segmentation are mapped to corresponding workflow modules (flowlets) according to mapping rules. Flowlets are virtual modules. The functions and input and output requirements of the virtual modules are defined by formally defining [in]->flowlet->[out]. An implicit workflow based on a large model is constructed by concatenating flowlets.

[0050] Furthermore, mapping multiple operators includes: performing a one-to-one mapping on some of the multiple operators, performing a one-to-many decomposition mapping on some of the multiple operators, and performing a many-to-one merging mapping on some of the multiple operators.

[0051] The merging rules for the merge mapping are based on the principles of feasibility of the data generation task and maintaining data diversity, including horizontal operator merging and vertical operator merging. Figure 2 To illustrate with examples, horizontal operator merging: For instance, op-0 and op-1 cannot be merged because they cannot directly generate out-1 data from in-0; however, op-4 and op-5 can be merged because they can directly generate out-5 from in-4. Vertical operator merging: For instance, op-6, although in-6 is the same as in-0 and out-6 is the same as out-1, is not merged with op-0 or op-1 to maintain the diversity of output data; however, op-2 and op-3 have diverse input data but the same output data, so they can be merged.

[0052] For example, such as Figure 2As shown in the diagram, the mapping relationship between operators `op` and `flowlet` is indicated by the dashed arrows. `op-0` maps to `flowlet-1`, and the input data [in-1] and output data [out-1] of `flowlet-1` are the same as the input data `in-0` and output data `out-0` of `op-0`, respectively. `op-1` maps to `flowlet-2`, and the input data [in-2] and output data [out-2] of `flowlet-2` are the same as the input data `in-1` and output data `out-1` of `op-1`, respectively. `op-6` maps to `flowlet-3`, and the input data of `flowlet-3`... [in-3] and output data [out-3] are consistent with the input data in-6 and output data out-6 of op-6, respectively; op-2 and op-3 are merged and mapped to flowlet-4, the input data [in-4] of flowlet-4 = in-2 + in-3, and the output data [out-4] of flowlet-4 = out-2 + out-3; op-4 and op-5 are merged and mapped to flowlet-5, the input data [in-5] of flowlet-5 = in-4, and the output data [out-5] of flowlet-5 = out-5.

[0053] S120. Generate the training dataset for the multiple flowlets.

[0054] Traditional dataset management methods typically use data label pairs, such as treating [in] as data and [out] as labels in [in]->flowlet->[out]. This embodiment, considering the characteristics of large models, divides the flowlet training dataset into two categories: unlabeled background description training dataset and labeled indicator training dataset. The background description training data corresponding to flowlet-n is denoted as bg-n, and the labeled indicator training data is denoted as data-n.

[0055] The background description training data consists of the instructions or logical support data required to complete the flowlet-n task. For example, if the flowlet-n task is to predict gastric tumor suppressor genes, the content of bg-n is the working principle of the p53 gene. It should be noted that the labeled data-n expands the flowlet's input data [in] by adding logical descriptions that generate [out] data from [in]. These logical descriptions can be generated manually or formed using query tools, question-answering systems, generative large models, etc.

[0056] In this embodiment, the background description training dataset can be generated according to a preset module. This can be understood as the background description training dataset being generated based on the background description information through the preset module. The labeled data (data-n) in the labeled instruction training dataset can be generated manually, or it can be generated based on a prompt template, a large model, or an evaluator. After the labeled data is generated, it needs to be validated by a data validator. The validated labeled data is then used to generate the instruction training dataset according to the instructions.

[0057] Furthermore, generating the training dataset for the multiple flowlets includes:

[0058] Based on the descriptive information, a background description training dataset is output according to a preset template; the prompt template is used as input to a large model so that the large model outputs labeled data of the multiple flowlets. The prompt template includes input data and prompt descriptions. The diversity of the input data is achieved through data templates, which are in the form of key-value pairs; the labeled data is validated by a data validator, and qualified labeled data is output; the qualified labeled data is used to generate an instruction training dataset according to the instruction-prompt requirements. The content of the instruction training dataset is a set of [input data]-[output data] pairs in [input data]-flowlet-[output data].

[0059] Figure 3 This invention provides a schematic diagram of the process for generating a training dataset of multiple flowlets in an implicit workflow construction method, as shown in Embodiment 1. Figure 3 As shown, in Step 201, the data generator generates [in] data. The [in]-template defines the data template for the input data, which enables diversity in the [in] data. The gene-prompt template is the input to the LLM (Large Model). The purpose of the prompt template is to guide the large model to generate [out] data through prompts. The gene-prompt mainly contains the [in] data and prompt descriptions.

[0060] Specifically, the generation of diverse [in] data from the input data template [in]-template is implemented as follows: the content to be filled in the [in]-template is described as [key], and the actual content is [value]. In this step, the [value] can be extracted from existing data, or a prompt containing the [key] can be sent to the LLM to generate the [value] content.

[0061] like Figure 3 As shown, Step 202 verifies the [in] data generated in Step 201 using a data validator. The data validator checks and verifies the [in] data based on validation rules, i.e., eval-rules. Its internal implementation is a rule executor, and the final result is either pass or fail. The eval-rules can support specific evaluation specifications and can also support calls to external interfaces and tools. The output qualified labeled data is then used to generate an instruction training dataset, sft-dataset, according to the instruction-prompt requirements. The content of the instruction training dataset is a set of [in]-[out] pairs in [in-n]->flowlet-n->[out-n].

[0062] S130. Implicit workflow learning is performed based on the training dataset, and prompt information for virtual roles corresponding to the multiple flowlets is constructed during the learning process.

[0063] Implicit workflow learning can include flowlet background learning and flowlet function learning. Flowlet background learning can be performed on a large model using various algorithms based on the background description dataset in the training dataset. After the large model completes flowlet background learning, flowlet function learning can continue on the large model based on the instruction training dataset in the training dataset. Flowlet function learning mainly includes instruction learning.

[0064] In this embodiment, the instruction training dataset is a set of [in]-[out] pairs in [in-n]->flowlet-n->[out-n]. During processing, it is necessary to construct multiple virtual roles corresponding to flowlets, obtain functional training data for multiple virtual roles corresponding to flowlets, and merge the functional training data of all virtual roles corresponding to flowlets into a large instruction fine-tuning data set for instruction learning training of the large model.

[0065] Among them, virtual characters refer to virtual characters in large models. For example, when using a large model, the "xxx" in the prompt "Please play as xxx, ..." is a virtual character that can be trained.

[0066] The learning process stops when the loss function of the large model stabilizes at a fixed value and can no longer decrease, and the implicit workflow learning ends after the evaluation is passed.

[0067] It should be noted that merging the functional training data of all flowlets corresponding to virtual characters into a large set of instruction fine-tuning data enables the flowlet learning to be changed from serial to parallel, improving learning efficiency. At the same time, the merged data is more diverse, which can achieve better robustness and stability.

[0068] S140. Combine and reason with the prompts of multiple virtual characters according to the arrangement order of the multiple flowlets and the original logical relationship to realize the function of implicit workflow.

[0069] In this embodiment, all virtual character prompt templates are combined and reasoned with the original logical relationships in the order of flowlet-1 to flowlet-n to achieve the function of the entire implicit workflow. This is existing technology and will not be elaborated further. Here, the virtual character prompt template refers to the prompt information template for the virtual character.

[0070] The flowlet can also support calls to third-party APIs and tools. The workflowdispatcher completes the entire workflow function by interacting with the prompt connection module and the API connection module.

[0071] This invention provides an implicit workflow construction method. First, an implicit workflow is constructed based on an existing workflow, consisting of multiple workflow modules (flowlets) linked together. Then, a training dataset for these flowlets is generated. Next, implicit workflow learning is performed based on this training dataset, during which prompts for virtual roles corresponding to the multiple flowlets are constructed. Finally, the prompts for the multiple virtual roles are combined and reasoned according to the order of the multiple flowlets and their original logical relationships to realize the function of the implicit workflow. This method provides a direct and controllable approach to constructing large-scale model workloads, directly converting workflow logic into large-scale model workflow logic, which is more suitable for practical engineering applications. Through multi-level workflow logic refinement, it can cover the implementation of everything from business logic to basic algorithm logic in the large model. Rule-based logical decomposition not only ensures controllability of intermediate processes but also allows for the combination of different workflows, resulting in a secure, controllable, easy-to-use, and highly practical workflow.

[0072] Based on the above embodiments, modified embodiments of the above embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in the modified embodiments.

[0073] Furthermore, if the labeled data verification fails, the error code returned by the data validator is added to the prompt template, and the labeled data of the output flowlet is continuously optimized through the large language model until the labeled data of the output passes the verification.

[0074] In step S120, the error codes fed back by the data validator are added to the prompt template. The output results are continuously optimized through LLM until the data validator passes the verification. The labeled data can be verified multiple times based on the error codes until qualified labeled data is obtained. The whole process is automated, which can reduce manual intervention and ensure the efficiency and quality of data generation.

[0075] Example 2

[0076] Figure 4 This is a flowchart illustrating a hidden workflow construction method according to Embodiment 2 of the present invention. Embodiment 2 is an optimization based on the above embodiments. For details not covered in this embodiment, please refer to Embodiment 1.

[0077] like Figure 4 As shown in Embodiment 2 of the present invention, a method for constructing an implicit workflow includes the following steps:

[0078] S210. Construct implicit workflows based on existing workflows. The resulting implicit workflows are formed by connecting multiple workflow modules (flowlets).

[0079] S220. Generate the training dataset for the multiple flowlets.

[0080] S230. Use the background description dataset in the training dataset as input to the large model, and perform flowlet background learning on the large model through the MASK learning method.

[0081] Among them, the MASK learning method can be used to learn multi-level models such as MLM and FIM.

[0082] This step introduces mask learning into the large model learning stage. Mask learning in the learning stage can effectively avoid the use of vector databases or excessively long hints, thereby reducing system complexity and computational overhead.

[0083] S240. Based on the instruction training dataset in the training dataset, perform flowlet function learning on the large model.

[0084] Furthermore, the flowlet function learning of the large model based on the instruction training dataset in the training dataset includes: constructing function training data for multiple flowlets corresponding to virtual characters based on the instruction training dataset in the training dataset; merging the function training data for all flowlets corresponding to virtual characters into an instruction fine-tuning dataset; and using the instruction fine-tuning dataset to perform instruction learning on the large model.

[0085] Specifically, the step of constructing functional training data for multiple flowlets corresponding to virtual characters based on the instruction training dataset in the training dataset includes: processing the [input data]-[output data] pairs of multiple flowlets included in the instruction training dataset in the training dataset to obtain functional training data for multiple flowlets corresponding to virtual characters;

[0086] The processing involves performing the following operations for each flowlet: assigning a virtual role to the flowlet, describing the name and functional logic of the virtual role corresponding to the flowlet to obtain the virtual role's prompt information, combining the virtual role's prompt information with the [input data] in the [input data]-[output data] pair to form a virtual role prompt template, and replacing the [input data] in the [input data]-[output data] pair with the virtual role prompt template to obtain functional training data for a flowlet's corresponding virtual role.

[0087] For example, a virtual role is assigned to each flowlet, such as role-n for flowlet-n. Then, the name and functional logic of role-n are described. The description of role-n is combined with [in] to form role-n-prompt, replacing [in] in the original [in]-[out]. The result is the flowlet functional training data [role-n-prompt]-[out-n]. The functional training data [role-n-prompt]-[out-n] for all flowlets corresponding to virtual roles are merged into a large instruction fine-tuning data set [role-prompt]-[out] for instruction-learning training of the large model.

[0088] It should be noted that during the model learning process, the flowlet function is implicitly implemented through training virtual characters; merging multiple flowlet function learning tasks into one task effectively improves learning efficiency. The merged data is diverse, and using diverse data for model training can improve the robustness and stability of large models.

[0089] S250. Combine and reason with the prompts of multiple virtual characters according to the arrangement order of the multiple flowlets and the original logical relationship to realize the function of implicit workflow.

[0090] Furthermore, the workflow construction method based on prompts takes into account the differences in expressiveness of model size. For example, a 10B model may only support reasoning ability by role, but for larger models, such as a 100B model, multiple inferences can be eliminated and replaced with implicit inference of the large model. Only the method of combining descriptions needs to be used to improve the prompt. For example, the prompt description "The output after inputting data A into Role-1, and then inputting it into Role-2, the result is" combines the original two inferences of role-1 and role-2 into one.

[0091] Embodiment 2 of this invention provides an implicit workflow construction method, which clarifies the implicit workflow learning process. This method introduces mask learning into the large model learning stage. Mask learning in the learning stage effectively avoids the use of vector databases or excessively long hints, thus reducing system complexity and computational overhead. Flowlet functionality is implicitly implemented through virtual character training. Multiple flowlet function learning tasks are merged into one task for learning, effectively improving learning efficiency. The merged data is diverse, and using diverse data for model training can improve the robustness and stability of the large model.

[0092] Based on the technical solutions of the above embodiments, this invention provides an exemplary implementation method.

[0093] like Figure 5 As shown, Figure 5 A schematic diagram of an implicit workflow construction method provided in an example embodiment of the present invention includes the following four stages:

[0094] Phase 1: Flowlet construction.

[0095] like Figure 5 As shown in Phase 1, the implicit workflow is constructed by connecting the workflow modules Flowlet-0, Flowlet-1, Flowlet-2, Flowlet-3, and Flowlet-4.

[0096] Phase 2: Flowlet dataset generation.

[0097] like Figure 5As shown in Phase 2, in the data generator, the gene-prompt is the input of the mature LLM. The role of the gene-prompt is to guide the LLM to generate origin-data through prompting. The origin-data input data validator checks and verifies the data based on the eval-rules to generate qualified labeled datasets.

[0098] Phase 3: Learning Flowlet.

[0099] like Figure 5 As shown in Part 3 of the diagram, implicit workflow learning is divided into two steps: flowlet background learning and flowlet function learning. bg represents unlabeled background description training data, and role represents virtual role.

[0100] Phase 4: Workflow Establishment.

[0101] like Figure 5 As shown in Phase 4, the workflow dispatcher completes the entire workflow functionality by interacting with the prompt linker module and the API linker module.

[0102] Example 3

[0103] This invention provides a specific embodiment of an implicit workflow construction method. This embodiment is a database adaptation application scenario in a large NL2SQL (Generate SQL Statements from Natural Language) model. Based on the implicit workflow construction method provided in any embodiment of this invention, an NL2SQL large model database adaptation method is proposed.

[0104] The implementation of natural language to SQL query conversion requires external knowledge support, such as database table information. However, a database often contains many tables, and associating natural language questions with specific tables is a challenging problem in the industry. Current methods for addressing this issue include: Method 1: The user selects a range of tables before asking a question; the system generates SQL statements based on the selected table information and the question. Method 2: Database structure information is stored in a vector database, and tables related to the question are retrieved from the vector database through semantic matching. Method 3: Table information is included as part of the prompt, enhancing the context to improve the accuracy of the SQL statement. Method 4: The traditional NL2SQL modeling approach is used, decomposing the SQL generation task into multiple intermediate tasks for learning. Method 1 places high demands on user knowledge and skills; Methods 2 and 4 have high SQL generation error rates; Method 3 requires sufficient context length, has low performance, and the accuracy of the generated SQL statements remains low.

[0105] In the application scenario of this embodiment, the implicit workflow of the large model is used to accurately associate the relevant tables in the database based on the natural semantic questions, thereby realizing the self-adaptation capability of the NL2SQL model to the database.

[0106] Figure 6 This is a flowchart of an NL2SQL large model database adaptive method provided in Embodiment 3 of the present invention, as shown below. Figure 6 As shown, it includes the following steps:

[0107] S310. Construct an implicit workflow for the adaptive full workflow of the NL2SQL database according to the input and output categories of the data. The constructed implicit workflow is formed by connecting multiple workflow modules (flowlets).

[0108] The adaptive full workflow of the NL2SQL database can be a real pipeline implementation or a virtual workflow. To better adapt to various pipeline application scenarios, the mapped flowlets can be executed for non-large models, such as a flowlet in the workflow executing a script.

[0109] The NL2SQL database adaptive workflow consists of multiple operators, each with corresponding input and output data. The input data of the upstream operator becomes the output data of the downstream operator. Accordingly, the implicit workflow of the NL2SQL database adaptive process is constructed according to the input and output categories of the data, including:

[0110] Based on the input and output data, the entire adaptive workflow of the NL2SQL database is divided into multiple operators;

[0111] The multiple operators are mapped according to the mapping rules in the implicit workflow mapping rule base to obtain multiple workflow modules (flowlets);

[0112] An adaptive processing system for NL2SQL databases based on implicit workflows of a large model is obtained by constructing a series of flowlets.

[0113] The mapping of the plurality of operators includes: performing a one-to-one mapping of some of the plurality of operators, performing a one-to-many decomposition mapping of some of the plurality of operators, and performing a many-to-one merging mapping of some of the plurality of operators.

[0114] S320. Generate the training dataset for the multiple flowlets.

[0115] The training dataset includes an unlabeled background description training dataset and a labeled instruction training dataset.

[0116] Generate the training dataset for the multiple flowlets, including:

[0117] The training dataset is output based on the descriptive information and according to a preset template;

[0118] A prompt template is used as input to a large model so that the large model outputs labeled data from multiple flowlets. The prompt template includes input data and prompt descriptions. The diversity of the input data is achieved through a data template of the input data. The data template is in the form of key-value pairs. The prompt template is formed by combining multiple tables and field information through a flowlet execution script.

[0119] The SQL statements in the labeled data are extracted by an execution script of a flowlet and then sent to the SQL engine for execution.

[0120] Based on the error code returned by the SQL engine, the labeled data is filtered by the data validator;

[0121] The filtered labeled data will be output as qualified labeled data.

[0122] The qualified labeled data is used to generate an instruction training dataset according to the instruction-prompt requirements. The content of the instruction training dataset is a set of [input data]-[output data] pairs in [input data]-flowlet-[output data].

[0123] Furthermore, if the labeled data verification fails, the error code returned by the data validator is added to the prompt template, and the labeled data of the output flowlet is continuously optimized through the large language model until the labeled data of the output passes the verification.

[0124] S330. Implicit workflow learning is performed based on the training dataset, and prompt information for virtual roles corresponding to the multiple flowlets is constructed during the learning process.

[0125] Implicit workflow learning includes flowlet background learning and flowlet function learning.

[0126] In this embodiment, implicit workflow learning based on the training dataset includes:

[0127] Based on the background description data of tables in the NL2SQL database, the MASK learning method is used to perform flowlet background learning on the NL2SQL large model.

[0128] Based on the instruction training dataset in the training dataset, flowlet functionality is learned for a large model that has already undergone flowlet background learning.

[0129] Furthermore, based on the instruction training dataset in the training dataset, flowlet feature learning is performed on the large model that has already undergone flowlet background learning, including:

[0130] Based on the instruction training dataset in the training dataset, construct functional training data for multiple flowlets corresponding to virtual characters;

[0131] Merge the functional training data of all flowlets corresponding to virtual characters into a single instruction fine-tuning dataset;

[0132] The instructions are used to fine-tune the dataset for instruction learning on a large model that has already undergone flowlet background learning.

[0133] Furthermore, based on the instruction training dataset in the training dataset, functional training data for multiple flowlets corresponding to virtual characters is constructed, including:

[0134] The input data-output data pairs of multiple flowlets included in the training dataset are processed to obtain the functional training data of the virtual characters corresponding to multiple flowlets;

[0135] The process involves performing the following operations for each flowlet: assigning a virtual role to the flowlet, describing the name and functional logic of the virtual role corresponding to the flowlet to obtain the virtual role's prompt information, combining the virtual role's prompt information with the [input data] in the [input data]-[output data] pair to form a virtual role prompt template, and replacing the [input data] in the [input data]-[output data] pair with the virtual role prompt template to obtain functional training data for a flowlet's corresponding virtual role.

[0136] S340. Combine and reason with the prompts of multiple virtual characters according to the arrangement order of the multiple flowlets and the original logical relationship to realize the function of implicit workflow.

[0137] The third embodiment of this invention provides an NL2SQL large model database adaptive method, which achieves the ability to accurately associate relevant tables in the database based on natural semantic questions through the implicit workflow of the large model, thereby realizing the self-adaptation capability of the NL2SQL model to the database.

[0138] Based on the technical solutions of the above embodiments, this invention provides a specific implementation method. Figure 7 This is a flowchart illustrating an adaptive method for a large NL2SQL database provided in a specific embodiment of the present invention.

[0139] In this specific embodiment, the database that the NL2SQL large model needs to be automatically adapted to is named ACAD, which contains 15 data tables. For example... Figure 7 As shown, the specific process is as follows:

[0140] Phase 1: Workflow segmentation and flowlet construction.

[0141] Step 101: Divide the workflow according to input-output data.

[0142] This step can simultaneously consider both in-model and out-of-model processing logic, and perform implicit workflow modeling for the entire adaptive workflow of the NL2SQL database. Figure 8 A flowchart of the adaptive workflow of the NL2SQL database provided for a specific embodiment of the present invention is shown below. Figure 8 As shown, denoted as the Ogen-workflow graph, the Ogen-workflow graph is segmented according to the input and output categories of the data. Existing DAG computational graph segmentation methods can be used for this segmentation. After segmentation, the data is input... Figure 9 As shown, Figure 9 This is a schematic diagram of the segmentation operator provided in a specific embodiment of the present invention.

[0143] Step 102: Flowlet construction.

[0144] Based on the implicit workflow mapping rule library flowlet-combo-rule, this rule library can be manually configured or continuously optimized through model output. Figure 9 In the diagram, OP1 is mapped to flowlet-0, OP2 and OP3 are merged and mapped to flowlet-1, OP4 is decomposed into flowlet-2, flowlet-3, and flowlet-4, OP5 and OP6 are merged and mapped to flowlet-6, and OP7 is mapped to flowlet-7, resulting in the following: Figure 7 The flowlet diagram shown in Stage 1 contains Flowlet-0, Flowlet-1, and Flowlet-4, which represent out-of-model processing. By connecting these flowlets, an adaptive processing system for the NL2SQL database based on the implicit workflow of a large model is constructed.

[0145] Phase 2: Flowlet dataset generation.

[0146] Step 201: Generate original data, i.e., labeled data, through gene-prompt.

[0147] This step is completed collaboratively by flowlet-2 and flowlet-3. The input to flowlet-2 is the original schema description. An example of one of the tables is as follows:

[0148] {

[0149] "table_name":"AUTHOR",

[0150] "create_table":"create table author(\naid int(11)primary ke

[0151] y,\nhomepage varchar(255),\nname varchar(255),\noid int(11)\n);",

[0152] "table_meaning":"Author Information Table",

[0153] "column meaning":{

[0154] "aid":"Author ID",

[0155] "homepage":"Homepage",

[0156] "name":"name",

[0157] "oid":"Organization ID"

[0158] }

[0159] flowlet-2 uses scripts to combine information from multiple tables and fields to form a gene-prompt, or prompt template, as shown in the example below:

[0160] The goal of the "Asking Questions" game is to generate Chinese query questions based on known table and field information. For example, given that table A stores employee attendance records with fields UserID, Name, and Time, which represent employee ID, employee name, and attendance time respectively, a question can be asked based on these field names: "Did Xiao Wang clock in on March 6th?".

[0161] The rules for generating questions are as follows: First, generate the event information in the question based on the table description. In this example, the "whether to clock in" event corresponds to the description in data table A. Second, generate the query conditions for the question based on the field descriptions. In this example, the query conditions for the question are: Xiao Wang corresponds to the Name field, and March 6th corresponds to the Time field.

[0162] Now, let's begin the game. Based on the field names in the information "[Data table JOURNAL, storing journal information, with specific fields homepage and jid, meaning homepage and journal ID respectively.]", what is the generated Chinese query question and the query SQL?

[0163] The content in brackets 【】 in the above prompt represents the combination of tables and fields generated by the script, supporting complex combinations such as multiple tables and fields, and tables and graphs. Next, flowlet-3 uses the gene-prompt as input to call a mature large-scale model interface. In this embodiment, the Solar large-scale model independently developed by StarRing Technology is used. Interfaces such as chatGPT and Bloom can also be called without affecting the feasibility and innovation of this invention. The large-scale model outputs the query question and SQL results as follows:

[0164] Question: What is the homepage address for journal ID 123456?

[0165] SQL: SELECT homepage FROM JOURNAL WHERE jid='123456'.

[0166] Step 202: Verify the original data using the data-validator and output qualified label data.

[0167] The eval-rules in this implementation are as follows: the SQLite execution result serves as the evaluation standard for the original corpus; if the execution passes, it is accepted; if there is an error, it is rejected. The execution script in Flowlet-4 extracts the SQL statements from the original data and sends them to SQLite for execution. The corpus is then filtered based on the error codes returned during execution, and the filtered corpus consists of qualified corpus. Next, the qualified corpus is used to generate instruct training corpus according to the instruct-prompt requirements. This step is also based on template rules. Finally, the instruct training dataset is generated, denoted as sft-dataset. Taking one sample as an example, it is as follows:

[0168] {

[0169] "context":"The purpose of the database table matcher is to return the table used in the corresponding SQL statement based on the question. It is usually denoted as: table matcher-[DBName]. For example, table matcher-A indicates that it is the table matcher for database A. The table matcher is used as follows: To query "all singers older than 40 years old" in database A, the above question is entered into table matcher-A."

[0170] The returned result is: "table": singer. Given that the table matcher corresponding to the database "academic" is table matcher-academic, the query in the database "academic" is: "Query papers for the conference name '2022 Beijing International Science and Technology Conference', where the author is 'Wang Er' and their field is mentioned." After inputting the question into the table matcher "academic", the returned result is: "

[0171] "target":""table":['CONFERENCE','PUBLICATION']"

[0172] }

[0173] It is important to note that this step defines the virtual character table matcher and its formal definition through the prompt, which is crucial for large-scale model implementation. Based on the definition and training of virtual characters, more complex functions can be implemented by combining virtual characters in stage 4.

[0174] Phase 3: Learning Flowlet.

[0175] This phase of implementation is divided into two steps: learning the background of Flowlet and learning the functionality of Flowlet, as detailed below:

[0176] Step 301: Based on the schema information, flowlet-0 also uses a script to output semantic table descriptions according to the template, denoted as table-bg dataset, i.e., background description data, as input data for flowlet background learning. Taking one of the table description data as an example, as follows:

[0177] The AUTHOR table in the ACAD database is an author information table, which has fields aid, homepage, name, and oid, representing author ID, homepage, name, and organization ID, respectively.

[0178] flowlet-1 uses table-bg data to implement the MLM mask learning method for learning flowlet background knowledge. It's important to note that only the table name, table description, field names, and field meaning descriptions are masked; the database name is not masked.

[0179] Step 302: Learning the flowlet feature.

[0180] In this step, the NL2SQL large model trained in step 301 continues to undergo instruction fine-tuning. Flowlet-6 uses the sft-dataset as the dataset to continue training the NL2SQL large model; training ends when the loss cannot be reduced and the model passes the evaluation in flowlet-7. The prompt format used for evaluating the large model in flowlet-7 is consistent with that used for inference.

[0181] Phase 4: Workflow Construction.

[0182] After the three stages described above, NL2SQL in this implementation possesses the adaptive functionality of the ACAD database. This step directly utilizes the prompt method to achieve this functionality, without involving the use of third-party APIs or tools. In practical use, you can first try using the database table matcher role to recall relevant tables based on the issue, and then combine the issue and table descriptions into a new prompt for use; alternatively, you can use the database table matcher role implicitly, requiring only one inference to generate the SQL statement. This step adopts the latter approach, and an example of the relevant prompt is as follows:

[0183] Please act as a DBA and generate the SQL statement. The query should be "What is the homepage address of journal with ID 123?", retrieved from the ACAD database. Based on the results returned by the question input table matcher - ACAD, the generated SQL should be:

[0184] The NL2SQL model output is: SELECT homepage FROM JOURNAL WHERE jid='123'.

[0185] In the example above, "the return result after the input table matcher ACAD" needs to be executed in two steps if it is explicitly called: first, obtain the output result of the table matcher, and then use the output result as part of the SQL generation prompt to execute the large model and obtain the SQL generation result.

[0186] This invention provides an adaptive method for NL2SQL large model databases. Through the implicit workflow construction method provided in any embodiment of this invention, the NL2SQL large model, in practical application scenarios, eliminates the need to input table information related to the question; SQL statements are generated simply by inputting the question. This implicitly addresses the issue of "how to accurately match relevant tables based on the question." This method maintains the simplicity of system architecture, processes, and implementation, while being low-cost and highly efficient.

[0187] Example 4

[0188] Figure 10 This is a schematic diagram of an implicit workflow construction device provided in Embodiment 4 of the present invention. The device is applicable to situations where large-scale complex logic processing capabilities can be achieved. The device can be implemented by software and / or hardware and is generally integrated on an electronic device.

[0189] like Figure 10 As shown, the device includes: a construction module 110, a generation module 120, a learning module 130, and an implementation module 140.

[0190] Module 110 is used to build implicit workflows based on existing workflows. The resulting implicit workflow is formed by connecting multiple workflow modules (flowlets).

[0191] The generation module 120 is used to generate the training dataset for the multiple flowlets;

[0192] Learning module 130 is used to perform implicit workflow learning based on the training dataset, wherein prompt information for virtual roles corresponding to the multiple flowlets is constructed during the learning process;

[0193] The implementation module 140 is used to combine and reason with the prompts of multiple virtual characters according to the arrangement order of the multiple flowlets and the original logical relationship to realize the function of implicit workflow.

[0194] In this embodiment, the device first constructs an implicit workflow based on an existing workflow using a construction module 110. The constructed implicit workflow is formed by connecting multiple workflow modules (flowlets). Then, a training dataset of the multiple flowlets is generated using a generation module 120. Subsequently, an implicit workflow learning process is performed using a learning module 130 based on the training dataset. During the learning process, prompt information for virtual characters corresponding to the multiple flowlets is constructed. Finally, an implementation module 140 combines and reasons the prompt information of the multiple virtual characters according to the arrangement order of the multiple flowlets and the original logical relationship to realize the function of the implicit workflow.

[0195] This embodiment provides a hidden workflow construction device that enables the process of handling complex problems with large models to be measurable and controllable, and can also correct errors in a timely manner based on the results of each step. It has stable and controllable performance and high implementation efficiency.

[0196] Furthermore, the existing workflow consists of multiple operators, each with corresponding input and output data. The input data of the upstream operator serves as the output data of the downstream operator. Accordingly, the construction module 110 is specifically used for:

[0197] Based on the input and output data, the existing workflow is divided into multiple operators;

[0198] The multiple operators are mapped according to the mapping rules in the implicit workflow mapping rule base to obtain multiple workflow modules (flowlets);

[0199] An implicit workflow based on a large model is obtained by concatenating flowlets.

[0200] Based on the above optimization, mapping the multiple operators includes: performing a one-to-one mapping on some of the multiple operators, performing a one-to-many decomposition mapping on some of the multiple operators, and performing a many-to-one merging mapping on some of the multiple operators.

[0201] Furthermore, the training dataset includes an unlabeled background description training dataset and a labeled instruction training dataset. Correspondingly, the generation module 120 specifically includes:

[0202] The first output unit is used to output the background description training dataset according to a preset template based on the description information.

[0203] The second output unit is used to take the prompt template as input to a large model so that the large model outputs labeled data of the multiple flowlets. The prompt template includes input data and prompt description. The diversity of the input data is achieved through the data template of the input data, which is in the form of key-value pairs.

[0204] The verification unit is used to verify the tagged data through the data verifier and output qualified tagged data.

[0205] The generation unit is used to generate an instruction training dataset from the qualified labeled data according to the instruction-prompt requirements. The content of the instruction training dataset is a set of [input data]-[output data] pairs in [input data]-flowlet-[output data].

[0206] Based on the above optimizations, if the labeled data verification fails, the error code returned by the data validator is added to the prompt template, and the labeled data of the output flowlet is continuously optimized through the large language model until the output labeled data verification passes.

[0207] Furthermore, the implicit workflow learning includes flowlet background learning and flowlet functionality learning; correspondingly, the learning module 130 includes:

[0208] The first learning submodule is used to take the background description dataset in the training dataset as the input of the large model and perform flowlet background learning on the large model through the MASK learning method.

[0209] The second learning submodule is used to learn the flowlet functionality of the large model based on the instruction training dataset in the training dataset.

[0210] Based on the above scheme, the second learning sub-module includes:

[0211] The construction unit is used to construct functional training data for multiple flowlets corresponding to virtual characters based on the instruction training dataset in the training dataset;

[0212] The merging unit is used to merge the functional training data of all flowlets corresponding to virtual characters into a single instruction fine-tuning dataset.

[0213] A learning unit is used to fine-tune the dataset to perform instruction learning on a large model using the instructions.

[0214] Based on the above scheme, the construction unit is specifically used to: process the [input data]-[output data] pairs of multiple flowlets included in the training dataset to obtain functional training data of virtual characters corresponding to multiple flowlets;

[0215] The process involves performing the following operations for each flowlet: assigning a virtual role to the flowlet, describing the name and functional logic of the virtual role corresponding to the flowlet to obtain the virtual role's prompt information, combining the virtual role's prompt information with the [input data] in the [input data]-[output data] pair to form a virtual role prompt template, and replacing the [input data] in the [input data]-[output data] pair with the virtual role prompt template to obtain functional training data for a flowlet's corresponding virtual role.

[0216] Furthermore, the building module 110 is also used to implicitly build a fully adaptive workflow for the NL2SQL database according to the input and output categories of the data.

[0217] Furthermore, the prompt template is formed by combining multiple tables and field information through a flowlet execution script.

[0218] Furthermore, the verification unit is also used to: extract the SQL statement from the labeled data through an execution script of a flowlet, and send the SQL statement to the SQL engine for execution; filter the labeled data through a data validator according to the error code returned after the SQL engine is executed; and output the filtered labeled data as qualified labeled data.

[0219] Furthermore, the first learning submodule is also used to: perform flowlet background learning on the NL2SQL large model using the MASK learning method based on the background description data of the tables in the NL2SQL database.

[0220] The aforementioned implicit workflow construction device can execute the implicit workflow construction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0221] Example 5

[0222] Figure 11 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0223] like Figure 11 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0224] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0225] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as implicit workflow construction methods.

[0226] In some embodiments, the implicit workflow construction method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the implicit workflow construction method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the implicit workflow construction method by any other suitable means (e.g., by means of firmware).

[0227] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0228] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0229] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0230] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0231] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0232] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0233] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0234] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for constructing implicit workflows, characterized in that, The method includes: Implicit workflow construction is performed based on an existing workflow, wherein the existing workflow consists of multiple operators, each with corresponding input and output data, and the input data of the upstream operator serves as the output data of the downstream operator; the implicit workflow construction process includes: dividing the existing workflow into multiple operators based on the input and output data; mapping the multiple operators according to mapping rules in the implicit workflow mapping rule base to obtain multiple workflow modules (flowlets), wherein the flowlet is a virtual module, and its function and input / output requirements are defined by formally defining [input data]->flowlet->[output data]; and constructing an implicit workflow based on a large model by concatenating multiple flowlets. Generate the training dataset for the multiple flowlets; Implicit workflow learning is performed based on the training dataset, and prompt information for virtual roles corresponding to the multiple flowlets is constructed during the learning process; The prompts from multiple virtual characters are combined and reasoned according to the order of the multiple flowlets and the original logical relationship to realize the function of implicit workflow; The training dataset includes an unlabeled background description training dataset and a labeled indicator training dataset. Correspondingly, the training dataset for generating the multiple flowlets includes: Based on the background description information, a background description training dataset is output according to a preset template; A prompt template is used as input to a large model so that the large model outputs labeled data of the multiple flowlets. The prompt template includes input data and prompt descriptions. The diversity of the input data is achieved through a data template of the input data, which is in the form of key-value pairs. The labeled data is verified by a data validator, and qualified labeled data is output. The qualified labeled data is used to generate an instruction training dataset according to the instruction-prompt requirements. The content of the instruction training dataset is a set of [input data]-[output data] pairs in [input data]-flowlet-[output data].

2. The method according to claim 1, characterized in that, Mapping the plurality of operators includes: A one-to-one mapping is performed on some of the multiple operators, a one-to-many decomposition mapping is performed on some of the multiple operators, and a many-to-one merging mapping is performed on some of the multiple operators.

3. The method according to claim 1, characterized in that, If the labeled data verification fails, the error code returned by the data validator is added to the prompt template, and the labeled data of the output flowlet is continuously optimized through the large model until the labeled data of the output passes the verification.

4. The method according to claim 1, characterized in that, The implicit workflow learning includes flowlet background learning and flowlet functionality learning. Correspondingly, the implicit workflow learning based on the training dataset includes: The background description training dataset in the training dataset is used as the input of the large model, and the large model is subjected to flowlet background learning through the MASK learning method. The flowlet functionality is learned on a large model based on the instruction training dataset in the training dataset.

5. The method according to claim 4, characterized in that, Flowlet functionality learning is performed on a large model based on the instruction training dataset in the aforementioned training dataset, including: Based on the instruction training dataset in the training dataset, construct functional training data for multiple flowlets corresponding to virtual characters; Merge the functional training data of all flowlets corresponding to virtual characters into a single instruction fine-tuning dataset; The instructions are used to fine-tune the dataset for instruction learning on a large model.

6. The method according to claim 5, characterized in that, The construction of functional training data for multiple flowlets corresponding to virtual characters based on the indicator training dataset in the training dataset includes: The input data-output data pairs of multiple flowlets included in the training dataset are processed to obtain the functional training data of the virtual characters corresponding to multiple flowlets; The process involves performing the following operations for each flowlet: assigning a virtual role to the flowlet, describing the name and functional logic of the virtual role corresponding to the flowlet to obtain the virtual role's prompt information, combining the virtual role's prompt information with the [input data] in the [input data]-[output data] pair to form a virtual role prompt template, and replacing the [input data] in the [input data]-[output data] pair with the virtual role prompt template to obtain functional training data for a flowlet's corresponding virtual role.

7. The method according to claim 1, characterized in that, The implicit workflow construction based on existing workflows includes: implicit workflow construction for an adaptive full workflow of the NL2SQL database according to the input and output categories of data.

8. The method according to claim 1, characterized in that, The prompt template is formed by combining multiple tables and field information through a flowlet execution script.

9. The method according to claim 1, characterized in that, The step of verifying the labeled data through a data validator and outputting qualified labeled data includes: The SQL statements in the labeled data are extracted by an execution script of a flowlet and then sent to the SQL engine for execution. Based on the error code returned by the SQL engine, the labeled data is filtered by the data validator; The filtered labeled data will be output as qualified labeled data.

10. The method according to claim 4, characterized in that, The step of using the background description training dataset from the training dataset as input to a large model and performing flowlet background learning on the large model through a MASK learning method includes: The background description data of tables in the NL2SQL database is used to perform flowlet background learning on the NL2SQL large model using the MASK learning method.

11. A hidden workflow construction device, characterized in that, The device includes: A construction module is used to build implicit workflows based on existing workflows. The existing workflow consists of multiple operators, each with corresponding input and output data. The input data of an upstream operator serves as the output data of a downstream operator. The implicit workflow construction process includes: dividing the existing workflow into multiple operators based on the input and output data; mapping the multiple operators according to mapping rules in the implicit workflow mapping rule base to obtain multiple workflow modules (flowlets), where each flowlet is a virtual module whose function and input / output requirements are defined through a formal definition of [input data]->flowlet->[output data]; and constructing an implicit workflow based on a large model by concatenating multiple flowlets. A generation module is used to generate the training dataset for the multiple flowlets; The learning module is used to learn implicit workflows based on the training dataset, and the learning process includes prompt information for virtual roles corresponding to the multiple flowlets. The implementation module is used to combine and reason with the prompts of multiple virtual characters according to the arrangement order of the multiple flowlets and the original logical relationship to realize the function of implicit workflow; The training dataset includes an unlabeled background description training dataset and a labeled indicator training dataset. Correspondingly, the generation module specifically includes: The first output unit is used to output the background description training dataset according to a preset template based on the background description information. The second output unit is used to take the prompt template as input to a large model so that the large model outputs labeled data of the multiple flowlets. The prompt template includes input data and prompt description. The diversity of the input data is achieved through the data template of the input data, which is in the form of key-value pairs. The verification unit is used to verify the tagged data through the data verifier and output qualified tagged data. The generation unit is used to generate an instruction training dataset from the qualified labeled data according to the instruction-prompt requirements. The content of the instruction training dataset is a set of [input data]-[output data] pairs in [input data]-flowlet-[output data].

12. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the implicit workflow construction method according to any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the implicit workflow construction method according to any one of claims 1-10.

Citation Information

Patent Citations

  • Workflow node recommendation method and device

    CN114115878A