Workflow generation method and computing device

By adaptively adjusting the similarity threshold based on functional description and utilizing a workflow selection model in workflow generation, the problems of cumbersome configuration and errors in the existing technology are solved, and fast and accurate workflow generation is achieved.

CN120805875APending Publication Date: 2025-10-17XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510728756.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing technologies rely on pre-configured nodes and processes in automatic application construction, which makes configuration cumbersome and error-prone, and makes it difficult to quickly and accurately generate workflows.

Method used

By determining the similarity threshold based on the functional description of the target application, the target workflow template is screened from the workflow knowledge base, and the similarity threshold is adjusted adaptively using semantic understanding. The workflow selection model and anomaly detection are combined to optimize the generated workflow.

Benefits of technology

It achieves the rapid and accurate generation of application workflows, improves the accuracy and efficiency of workflow generation, and ensures that the generated workflows are correct and meet logical requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120805875A_ABST
    Figure CN120805875A_ABST
Patent Text Reader

Abstract

The invention provides a workflow generation method and computing equipment. The workflow generation method and the computing equipment can quickly and accurately generate a workflow of an application. According to the specific scheme, the method is applied to a computing device and comprises the steps that in response to a workflow generation request, a similarity threshold value is determined based on function description of a target application, the workflow generation request comprises the function description, and the function description is used for indicating functions needing to be achieved by the target application; based on the similarity threshold value and the function description, a target workflow template is screened from a workflow knowledge base, and the workflow knowledge base comprises a plurality of workflow templates and the corresponding function description; the similarity between the function description of the target workflow template and the function description is greater than a similarity threshold; and in response to the screened target workflow template, generating a workflow of the target application based on the target workflow template.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a workflow generation method and a computing device. BACKGROUND

[0002] With the development of artificial intelligence technology, the demand for applications in various industries is increasing. Automatic application construction is a technology proposed to reduce the technical threshold of application development and accelerate the landing of applications. It mainly uses platforms, automation tools and preset processes to realize end-to-end automation from data preparation to application workflow generation.

[0003] At present, the automatic construction of applications mainly relies on various nodes and processes configured in advance, which is complicated and prone to errors. SUMMARY

[0004] The embodiments of the present application provide a workflow generation method and a computing device, which can quickly and accurately generate the workflow of an application.

[0005] To achieve the above technical purposes, the technical solutions adopted by the present application are as follows:

[0006] In a first aspect, the embodiments of the present application provide a workflow generation method, which comprises: in response to a workflow generation request, determining a similarity threshold based on a function description of a target application, wherein the workflow generation request comprises the function description, and the function description is used to indicate the function to be implemented by the target application; based on the similarity threshold and the function description, screening a target workflow template from a workflow knowledge base, wherein the workflow knowledge base comprises a plurality of workflow templates and corresponding function descriptions; the similarity between the function description of the target workflow template and the function description is greater than the similarity threshold; in response to screening the target workflow template, generating the workflow of the target application based on the target workflow template.

[0007] It can be understood that the workflow generation method provided by the embodiments of the present application is applied to a computing device, the computing device pre-acquires a workflow knowledge base, the workflow knowledge base saves workflow templates corresponding to various function descriptions, when the workflow of a target application needs to be constructed, the similarity between the function description of the target application and the function description of each workflow template is calculated, the target workflow template is selected from the workflow templates with a similarity greater than a similarity threshold, and the workflow of the target application is determined based on the target workflow template. Since the workflow templates in the workflow knowledge base are pre-included and can accurately run, the quick and accurate generation of the application workflow is ensured.

[0008] In addition, the function description of the target application input by the user is complex and changeable, and the use of a fixed similarity threshold for matching may cause matching errors, such as: the function description is too simple, which may cause too many irrelevant workflow templates to be matched, and the function description is too complex, which may cause no accurate workflow template to be matched. Therefore, the computing device deeply understands the semantics of the function description, and then adaptively adjusts the similarity threshold based on the semantic richness shown by the function description (that is, the higher the semantic richness, the higher the similarity threshold), so as to ensure the optimal matching result.

[0009] In a possible implementation, the similarity threshold is determined based on the function description of the target application, including: determining the total number of keywords and the total number of high-frequency keywords in the function description, wherein the high-frequency keyword is a keyword with a number of occurrences greater than a preset number; determining a similarity threshold increment based on the total number of keywords and the total number of high-frequency keywords; and determining the similarity threshold according to the reference similarity threshold and the similarity threshold increment.

[0010] It can be understood that the keyword refers to a word or phrase in a text, dialogue or data that can highly summarize the core content. The high-frequency word is a key word in the keyword, so the keyword and the high-frequency word are crucial to deeply understand a text, dialogue or data. Therefore, the computing device deeply understands the key semantics of the function description from the two dimensions of the keyword and the high-frequency word, and then adaptively adjusts the similarity threshold according to the semantic richness shown by the key semantics, so as to ensure the accuracy of the adjustment of the similarity threshold.

[0011] In a possible implementation, the similarity threshold is determined based on the total number of keywords and the total number of high-frequency keywords, including:

[0012] The weighted sum of the total number of keywords and the total number of high-frequency keywords is determined as the similarity threshold increment; or the weighted sum of the total number of keywords and the total number of high-frequency keywords is determined as the first similarity threshold increment; the second similarity threshold increment is determined based on the context information in the function description; and the sum of the first similarity threshold increment and the second similarity threshold increment is determined as the similarity threshold increment.

[0013] It can be understood that the weight of the keyword is less than the weight of the high-frequency word, and the adjusted similarity threshold is a value in the interval of 0 to 1. The context refers to the background environment around a word, sentence or data, which directly affects the accurate understanding and deep analysis of information. Therefore, the computing device deeply understands the context semantics of the function description from the dimension of the context information, and then adaptively adjusts the similarity threshold according to the semantic richness shown by the key semantics and the context semantics, so as to further improve the adjustment accuracy of the similarity threshold.

[0014] In a possible implementation, determining the second similarity threshold increment based on the context information in the function description comprises: determining a type of each context information; determining a similarity threshold increment corresponding to each context information based on the type and a preset similarity threshold increment for the context information of each type; and determining the second similarity threshold increment based on the similarity threshold increment corresponding to each context information; wherein the type of the context information at least comprises a conditional statement and an adverb; and the adverb comprises an adjective, an adverb, and a negative word used to modify a noun.

[0015] In a possible implementation, the filtering of the target workflow template from the workflow knowledge base based on the similarity threshold and the function description comprises: determining a similarity of the function description between each workflow template in the workflow knowledge base and the target application; determining a workflow template with a similarity greater than the similarity threshold as a candidate workflow template; and selecting a preset number of workflow templates with the highest similarity from the candidate workflow templates as the target workflow templates.

[0016] It can be understood that the computing device filters several workflow templates with the most similar function descriptions to the target application from the workflow knowledge base as the target workflow templates, thereby improving the screening accuracy of the target workflow templates.

[0017] In a possible implementation, the generation of the workflow of the target application based on the target workflow template comprises:

[0018] obtaining a first prompt word, wherein the first prompt word comprises a workflow template, a function description, and a first prompt sentence, and the first prompt sentence is used to prompt the workflow selection model to select a workflow template with the most similar function from the workflow template; inputting the first prompt word into the workflow selection model to obtain a workflow template output by the workflow selection model; and determining the workflow of the target application based on the workflow template output by the workflow selection model.

[0019] It can be understood that the computing device further analyzes the functions of the plurality of target workflow templates by using the workflow selection model, and screens the target workflow template with the most similar function to the function description of the target application from the plurality of target workflow templates, and generates the workflow of the target application by using the screened target workflow template. The two screening operations of the similarity screening and the workflow selection model screening ensure the generation accuracy of the workflow of the target application.

[0020] In a possible implementation, the method further comprises: in response to no target workflow template being screened, generating an initial workflow based on the function description; performing abnormal node detection and abnormal node link on the initial workflow, and optimizing the initial workflow based on the detection result to obtain the workflow of the target application.

[0021] It can be understood that the computing device also provides a safeguard mechanism to invoke an external tool to automatically build a workflow conforming to the function description of the target application when the target workflow template is not determined in the workflow knowledge base, and then perform anomaly detection and optimization on the workflow to ensure that the generated workflow meets the logical requirements and can be correctly executed.

[0022] In a possible implementation, the above generating an initial workflow based on the function description comprises:

[0023] obtaining a third prompt word, wherein the third prompt word comprises a reference workflow, a workflow structure restriction, the function description, and a third prompt statement, the third prompt statement being used to prompt the first workflow generation model to generate a workflow conforming to the function description based on the reference workflow and the workflow structure restriction; inputting the third prompt word into the first workflow generation model to obtain a first workflow output by the first workflow generation model; and generating the initial workflow based on the first workflow.

[0024] It can be understood that when the computing device determines that the target workflow template is not selected from the workflow knowledge base, the first workflow generation model is invoked, the first workflow generation model has the ability to generate a workflow according to a prompt word. Then the computing device generates a third prompt word, uses the third prompt word and the first workflow generation model to build a first workflow, the first workflow is a preliminary implementation of the initial workflow, and finally generates the initial workflow based on the first workflow. In this way, the model can be used to quickly implement the construction of the initial workflow.

[0025] In a possible implementation, the above generating an initial workflow based on the first workflow comprises:

[0026] obtaining a fourth prompt word, wherein the fourth prompt word comprises the first workflow, node information, and a fourth prompt statement, the node information comprises node configurations and node restrictions corresponding to each node type, and the fourth prompt statement is used to prompt the second workflow generation model to adjust the first workflow based on the node information; inputting the fourth prompt word into the second workflow generation model to obtain a second workflow output by the second workflow generation model; and determining the second workflow as the initial workflow.

[0027] It can be understood that after the computing device generates the first workflow, the second workflow generation model is invoked, the second workflow generation model has the ability to refine a workflow according to a prompt word. On this basis, the computing device generates a fourth prompt word, uses the fourth prompt word and the second workflow generation model to refine the first workflow to obtain a second workflow, and finally determines the second workflow as the initial workflow. In this way, the integrity of the initial workflow can be ensured.

[0028] In a possible implementation, the above detecting the abnormal node and the abnormal node link of the initial workflow and optimizing the initial workflow based on the detection result to obtain the workflow of the target application, comprises:

[0029] In response to the initial workflow having an abnormal node or an abnormal node link, determining an abnormal situation; optimizing the initial workflow based on the abnormal situation; repeating the detecting and optimizing until the initial workflow has no abnormality; and determining the optimized initial workflow as the workflow of the target application.

[0030] It can be understood that the computing device detects potential errors (such as unimplementable nodes or logically conflicting node links) of the preliminary workflow after generating the preliminary workflow, and optimizes the preliminary workflow (such as replacing unimplementable nodes or eliminating logical conflicts of node links) according to the detection result, and then repeatedly executes the above operations until no potential error is detected. In this way, it is ensured that the finally generated workflow is available and error-free.

[0031] In a possible implementation, the above workflow knowledge base further comprises a plurality of workflow nodes and corresponding node descriptions of the workflow nodes; and the above detecting the abnormal node of the initial workflow comprises: determining, based on the node descriptions, each node in the initial workflow that matches a workflow node; and determining, as an abnormal node, a node in the initial workflow that has no matching workflow node.

[0032] It can be understood that the workflow knowledge base comprises a large number of implemented workflow nodes, and the computing device matches the workflow nodes in the initial workflow with the workflow nodes in the workflow knowledge base. If the matching is successful, it means that the workflow node can be used normally, and if the matching is unsuccessful, it means that the workflow node cannot be used, and then the workflow node that fails to match is determined as an abnormal node. When it is determined that the initial workflow has an abnormal node, the initial workflow can be optimized according to the abnormal node, and then the optimized initial workflow is re-detected and optimized. Through continuous optimization, it is determined that all nodes in the finally generated workflow have corresponding implementations in the workflow knowledge base, and the accuracy of the generated workflow is improved.

[0033] In a possible implementation, the above detecting the abnormal node and the abnormal node link of the initial workflow and optimizing the initial workflow based on the detection result to obtain the workflow of the target application, comprises:

[0034] In response to determining that the initial workflow does not have an abnormal node, a test case is obtained, where the test case includes test input and expected output of each node link in the initial workflow; a second prompt word is obtained, where the second prompt word includes the test case, the initial workflow, and a second prompt statement, the second prompt statement is used to prompt the workflow detection model to identify an abnormal node link and a corresponding abnormal type in the initial workflow using the test case, the abnormal node link is a node link with actual output inconsistent with expected output; the second prompt word is input into the workflow detection model, and a detection result output by the workflow detection model is obtained.

[0035] It can be understood that after determining that there is no abnormal node in the initial workflow, the computing node obtains a test case given by a model generating the initial workflow, which contains test input and expected output of each node link in the initial workflow. Then, the workflow detection model is called, which has the ability to analyze the node links of the test workflow and test the ability of the node links according to the prompt word. On this basis, the computing device generates a second prompt word to detect an abnormal node link that is difficult to implement in the initial workflow using the second prompt word and the workflow detection model. In the case of detecting an abnormal node link, the initial workflow is optimized according to the abnormal node link, and then the optimized initial workflow is re-detected and optimized. Through continuous optimization, the data coherence of the finally generated workflow is ensured, and the accuracy of the workflow generation is improved.

[0036] In a possible implementation, the detection result includes an abnormal node link and a corresponding abnormal type, test input, expected output, and actual output; and the optimizing the initial workflow based on the abnormal case includes: inputting the initial workflow, the detection result, and the function description into a workflow repair model to obtain an optimization scheme output by the workflow repair model; and optimizing the initial workflow using the optimization scheme.

[0037] It can be understood that after determining that there is an abnormal node link in the initial workflow, the computing node calls the workflow repair model, which has the ability to optimize the workflow according to the abnormal case, so that the optimization scheme of the workflow can be obtained using the workflow repair model, and the optimization of the workflow can be realized using the optimization scheme. In this way, the generation efficiency of the workflow is improved using the workflow repair model.

[0038] In a second aspect, the present application provides a computing device. The computing device includes various modules applied to the method of the first aspect or any possible design of the first aspect.

[0039] In a third aspect, the present application provides a computing device, comprising a memory and a processor. The memory and the processor are coupled; the memory is configured to store computer program code, the computer program code comprising computer instructions. When the processor executes the computer instructions, the computing device is caused to perform the workflow generation method according to the first aspect and any possible implementation thereof.

[0040] In a fourth aspect, the present application provides a computing device, comprising a processor, wherein the processor performs the workflow generation method according to the first aspect and any possible implementation thereof.

[0041] For example, the computing device can be a server, a tablet, a desktop, a laptop, a notebook, a netbook, etc.

[0042] In a fifth aspect, the present application provides a computer readable storage medium, comprising computer instructions. When the computer instructions are run on a computing device, the computing device is caused to perform the workflow generation method according to the first aspect and any possible implementation thereof.

[0043] In a sixth aspect, the present application provides a computer program product, comprising computer instructions. When the computer instructions are run on a computing device, the computing device is caused to perform the workflow generation method according to the first aspect and any possible implementation thereof.

[0044] The detailed description of the second to sixth aspects and various implementations thereof in the present application can refer to the detailed description of the first aspect and various implementations thereof; and the beneficial effects of the second to sixth aspects and various implementations thereof can refer to the beneficial effect analysis of the first aspect and various implementations thereof, which will not be repeated here.

[0045] These aspects and other aspects of the present application will be more apparent in the following description. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 An implementation environment schematic diagram related to a workflow generation method provided by an embodiment of the present application;

[0047] Figure 2 A hardware structure schematic diagram of a computing device provided by an embodiment of the present application;

[0048] Figure 3 A flowchart schematic diagram of a workflow generation method provided by an embodiment of the present application;

[0049] Figure 4 A flowchart schematic diagram of another workflow generation method provided by an embodiment of the present application;

[0050] Figure 5 Another flowchart of a workflow generation method provided by an embodiment of the present application is shown in FIG. 2.

[0051] Figure 6 A structural diagram of a workflow generation device provided by an embodiment of the present application is shown in FIG. 3. DETAILED DESCRIPTION

[0052] In the embodiments of the present application, the terms "first", "second", and the like are used to distinguish between items or components having substantially the same function or role. Those skilled in the art will understand that the terms "first", "second", and the like do not limit the quantity or execution order, and the terms "first", "second", and the like do not necessarily mean different.

[0053] In the description of the embodiments of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. In this document, "and / or" is only a description of the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can mean that A exists alone, A and B exist together, and B exists alone. In addition, "at least one" means one or more, and "multiple" means two or more.

[0054] It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, illustration, or description. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design solutions. Rather, the use of "exemplary" or "for example" is intended to present the relevant concept in a specific manner.

[0055] For the convenience of understanding, the related terms involved in the embodiments of the present application will be briefly introduced as follows:

[0056] (1) Knowledge Base is a database that stores a large amount of information and knowledge, which can be used by computer programs to search, retrieve, and answer user questions.

[0057] (2) Large language models: In the embodiments of the present application, large language models mainly refer to deep learning models such as generative pre-trained transformers (GPT) and bidirectional encoder representations from transformers (BERT). These models have a large number of parameters and require a large amount of data for training. They can handle complex tasks such as language understanding and text generation.

[0058] (3) AI application: refers to software or systems that use artificial intelligence (AI) technology to solve specific problems or optimize business processes. It can be a standalone application or an intelligent function embedded in an existing system.

[0059] (4) Template matching: a pattern recognition technique used to find similar parts in large datasets such as images, text or audio to predefined templates. In the AI application automatic creation process, template matching can be used to quickly identify and locate data elements that meet specific formats or structures.

[0060] (5) Automatic construction: refers to the use of algorithms and technologies to generate new software components or workflows without direct human involvement.

[0061] (6) Workflow: a series of interconnected tasks or steps that together complete a business process or operation. In AI applications, the workflow defines how data flows between processing nodes and what specific tasks should be performed on each node. It can be linear or contain complex structures such as branches, loops, etc.

[0062] (7) Similarity threshold: a set limit value used to determine whether the similarity between two objects or data points is high enough to consider them identical or related. In the embodiments of the present application, it represents the threshold value that needs to be reached when the functional description of the target application matches the functional description of the workflow template in the workflow database. Exceeding this threshold means that the two are similar.

[0063] (8) Personalized adjustment: refers to adjusting the process according to specific fields, user needs or data characteristics.

[0064] The embodiment of the present application provides a workflow generation method, which can be applied to an AI application workflow automatic creation scenario, and when a target application needs to be built, a similarity threshold is determined based on a function description of the target application, wherein the workflow generation request comprises the function description, and the function description is used to indicate a function to be implemented by the target application; the similarity between the function description of the target application and the function description of each workflow template stored in a workflow knowledge base is calculated, and a target workflow template is selected from the workflow templates with the similarity greater than the similarity threshold; in response to the target workflow template being screened, a workflow of the target application is generated based on the target workflow template. Considering that the function description of the target application input by the user is complex and changeable, and a fixed similarity threshold may cause the function description to be too simple and too many irrelevant workflow templates to be matched, or the function description to be too complex and no accurate workflow template to be matched, therefore, the similarity threshold is dynamically adjusted according to the function description, so that the target workflow template is more accurately screened. Moreover, the workflow templates in the workflow knowledge base are pre-collected and can be accurately run, and therefore, the rapid accuracy of the generated application workflow is ensured.

[0065] The implementation of the embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0066] Figure 1 FIG. 1 is a schematic diagram of an implementation environment related to a workflow generation method provided by the embodiment of the present application, and the implementation environment comprises a first computing device 101.

[0067] The first computing device 101 is configured to, after receiving a workflow generation request, determine a similarity threshold based on a function description of a target application included in the workflow generation request, wherein the function description is used to indicate a function to be implemented by the target application; based on the similarity threshold and the function description, screen a target workflow template from a workflow knowledge base, wherein the workflow knowledge base comprises a plurality of workflow templates and corresponding function descriptions, and the function description of the target workflow template has a similarity greater than the similarity threshold with the function description; in response to the target workflow template being screened, generate a workflow of the target application based on the target workflow template; and return the workflow of the target application.

[0068] In a possible implementation manner, the first computing device 101 can be a terminal device, and the first computing device 101 is configured to, in response to a function description of a target application received by a first external interaction interface, determine that the workflow generation request is received.

[0069] In the implementation manner, the first external interaction interface is an interaction interface for providing a workflow generation service, and a user can submit the function description of the target application on the first external interaction interface through an information input component arranged on the first computing device 101, such as a touch screen, a keyboard, a mouse, and the like.

[0070] In a possible implementation, in response to the workflow generation request sent by the terminal device to the first computing device 101, the implementation environment further includes: the terminal device 102, and at this time, the first computing device 101 can be a server.

[0071] In the implementation, the terminal device 102 is configured to generate the workflow generation request in response to the function description of the target application received by the second external interaction interface, and forward the workflow generation request to the computing device 101, and receive the workflow of the target application returned by the computing device 101, and return the workflow of the target application. The second external interaction interface is an interaction interface that provides a workflow generation service, and a user can submit a function description of a target application on the second external interaction interface through an information input component, such as a touch screen, a keyboard, a mouse, or the like, disposed on the terminal device 102.

[0072] The terminal device can be at least one of a smart phone, a smart watch, a desktop computer, a laptop computer, a virtual reality terminal, an augmented reality terminal, a wireless terminal, and a laptop computer.

[0073] The server can be at least one of a standalone physical server, such as a general-purpose server, a graphics processing unit (GPU) server, a data processing unit (DPU) server, or the like, or a server cluster or a distributed file system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks, and basic cloud computing services such as big data, without limitation in the embodiments of the present application.

[0074] In a possible implementation, the implementation environment can include: a second computing device 103.

[0075] The first computing device 101 is configured to filter a target workflow template from the workflow knowledge base based on the similarity threshold and the function description, including: sending a first request to the second computing device 103, and receiving a workflow template returned by the second computing device 103; wherein the first request is used to instruct the second computing device 103 to filter a workflow template corresponding to a function description with a similarity to the function description of the target application exceeding a similarity threshold from the workflow knowledge base. Then, the target workflow template is selected from the workflow template returned by the second computing device 103.

[0076] The second computing device 103 is a server providing query services and stores a workflow knowledge base containing a large number of workflow templates and their corresponding functional descriptions. In response to receiving the first request, the second computing device 103 is configured to calculate the similarity between the functional description of the target application and the functional description of each workflow template in the workflow knowledge base, filter out workflow templates with similarities exceeding a similarity threshold, and return the filtered workflow templates to the computing device 102.

[0077] In one possible implementation, after filtering out workflow templates whose similarities are greater than a similarity threshold, the second computing device 103 may also sort the filtered workflow templates in descending order of similarity, filter out workflow templates ranked before the first numerical value in the descending sequence, and return the workflow templates ranked before the first numerical value to the computing device 102.

[0078] The workflow generation method provided in the embodiment of the present application can be applied to a first computing device 101, which can be a terminal device and a network device, and the network device can be a server. The terminal device and the network device can be collectively referred to as electronic devices.

[0079] Figure 2 This is a hardware structure diagram of a computing device provided in an embodiment of the present application. Figure 2 , Figure 2 The computing device shown may include: a processor 201 , a memory 202 , a communication interface 203 , and a bus 204 . The processor 201 , the memory 202 , and the communication interface 203 may be connected via the bus 204 .

[0080] The processor 201 is the control center of the computing device, and can be a general-purpose central processing unit such as a CPU, or other general-purpose processors, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0081] As an example, the processor 201 may include one or more CPUs, such as Figure 2 CPU 0 and CPU 1 are shown in Figure 1.

[0082] The memory 202 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.

[0083] In a possible implementation, the memory 202 can exist independently of the processor 201. The memory 202 can be connected to the processor 201 through the bus 204, for storing data, instructions or program codes. When the processor 201 invokes and executes the instructions or program codes stored in the memory 202, the workflow generation method provided by the embodiments of the present application can be implemented.

[0084] In another possible implementation, the memory 202 can also be integrated with the processor 201.

[0085] The communication interface 203 is used for connecting the computing device with other devices through a communication network, which can be an Ethernet, a radio access network (RAN), a wireless local area network (WLAN) or the like. The communication interface 203 can include a receiving unit for receiving data, and a sending unit for sending data.

[0086] The bus 204 can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 2 In the figure, only one thick line is used to represent the bus, but it does not mean that there is only one bus or only one type of bus.

[0087] It should be noted that Figure 2 The structure shown in the figure does not constitute a limitation on the computing device, except Figure 2In addition to the components shown, the computing device can include other components, such as more or less of the components shown, or different arrangements of the components shown, or different components altogether.

[0088] Figure 3 A flowchart of a workflow generation method provided by an embodiment of the present application is shown. Referring to Figure 3 The method is applied to a computing device and includes the following S301-S303:

[0089] S301, in response to a workflow generation request, determining a similarity threshold based on a function description of a target application, wherein the workflow generation request includes the function description, and the function description is used to indicate a function to be implemented by the target application.

[0090] As an example, the function description of the target application is a piece of text representing information such as the function to be executed by the target application and the execution details, for example: "I want to generate an AI application that can analyze the sentiment of Chinese text, and call external tools for secondary verification when the sentiment analysis is inaccurate."

[0091] The similarity threshold is a critical value for measuring whether the function description of the target application is similar to the function description of the workflow template in the workflow knowledge base. When the similarity between the function description of the target application and the function description of the workflow template in the workflow knowledge base is greater than the similarity threshold, it is considered similar; otherwise, it is considered not similar.

[0092] In a possible implementation, the determination of the similarity threshold based on the function description of the target application includes: keyword extraction on the function description of the target application; context information extraction on the function description of the target application; and determination of the similarity threshold based on the keywords and / or the context information.

[0093] It can be understood that the keyword refers to a word or phrase in a piece of text, dialogue or data that can highly summarize the core content. The context information realizes the semantic association between the words in the text, and can help understand the overall theme and context of the text. In this implementation, the keywords and context information are used to deeply understand the function description of the target application in terms of semantics and semantic association; and then the similarity threshold is adaptively adjusted based on the semantic richness of the function description (i.e., the higher the semantic richness, the higher the similarity threshold), so as to ensure the accuracy of the selection of the workflow template similar to the target application.

[0094] The keyword extraction on the function description of the target application can be in various ways.

[0095] As an example, the extraction method can be: tokenizing the function description of the target application; and deleting stop words in the tokenization to obtain the keywords.

[0096] wherein, the stop words refer to common words in natural language processing (NLP) that have no substantial contribution to text analysis or information retrieval, which are usually high-frequency and weak semantic, filtering out which can improve processing efficiency. Common types of stop words include function words, high-frequency function words, and irrelevant words in specific fields. Function words such as prepositions (of, in, at), conjunctions (and, or, but), pronouns (I, you, she), etc. High-frequency function words such as "is", "is", "is", "is", "is", etc. Irrelevant words in specific fields such as mood words (ah, um, uh) and the like.

[0097] As another example, the extraction method can be: based on the functional description of the target application, determining the technical field to which the target application is applied; obtaining the conventional vocabulary table of the technical field; performing word segmentation on the functional description of the target application; determining the segmented words appearing in the conventional vocabulary table as the keywords.

[0098] The above-mentioned ways of extracting context information from the functional description of the target application are also various.

[0099] As an example, the extraction method can be: inputting the functional description of the target application into a pre-constructed context information extraction model to obtain the corresponding context information.

[0100] It should be noted that the context information of the functional description of the target application can be extracted using the currently common context information extraction model (such as LSTM model, CNN model, Transformer model), which will not be described here.

[0101] As another example, the extraction method can be: extracting context information from the functional description of the target application according to a pre-set type of context information.

[0102] It should be noted that the type of context information can be a sentence pattern (such as a conditional statement, a pre-set trigger statement, etc.), or a word type (such as a modifier word, a related word, etc.). Modifier words include adjectives, adverbs, and negative words used to modify nouns. Related words include words with explicit logical relationships (such as cause and effect, transition, parallelism, etc.).

[0103] The above-mentioned determination of the similarity threshold based on the keywords and / or context information includes:

[0104] The keywords and / or context information are collectively input into a pre-trained threshold determination model to obtain the similarity threshold.

[0105] wherein, the threshold determination model is a model trained with first sample data, the first sample data including keywords and / or context information corresponding to the functional description, and the similarity threshold corresponding to the functional description set by the expert.

[0106] S302, filtering a target workflow template from a workflow knowledge base based on the similarity threshold and the function description, wherein the workflow knowledge base comprises a plurality of workflow templates and corresponding function descriptions of the plurality of workflow templates; and the function description of the target workflow template has a similarity greater than the similarity threshold with the function description.

[0107] In a possible implementation, the filtering of the target workflow template from the workflow knowledge base based on the similarity threshold and the function description comprises: calculating a similarity of the function description between each workflow template in the workflow knowledge base and the target application; determining a candidate workflow template for each workflow template having a similarity greater than the similarity threshold; and determining the target workflow template based on the candidate workflow template.

[0108] In a possible implementation, the calculation of the similarity of the function description between each workflow template in the workflow knowledge base and the target application comprises:

[0109] obtaining a first text vector corresponding to the function description of each workflow template in the workflow knowledge base;

[0110] obtaining a second text vector corresponding to the function description of the target application;

[0111] calculating a similarity between each first text vector and the second text vector.

[0112] As an example, the determination of the target workflow template based on the candidate workflow template comprises:

[0113] determining the candidate workflow template as the target workflow template.

[0114] As another example, the determination of the target workflow template based on the candidate workflow template comprises:

[0115] performing descending arrangement on the candidate workflow template; and selecting a preset number of workflow templates at the top of the descending sequence as the target workflow template.

[0116] S303, in response to the filtering of the target workflow template, generating a workflow of the target application based on the target workflow template.

[0117] In a possible implementation, the generation of the workflow of the target application based on the target workflow template comprises: determining a first workflow template based on the target workflow template; and determining the first workflow template as the workflow of the target application.

[0118] As an example, the determination of the first workflow template based on the target workflow template comprises: randomly selecting one workflow template from the target workflow template as the first workflow template.

[0119] As an example, the determining the first workflow template based on the target workflow template includes: constructing a first prompt word, wherein the first prompt word includes the target workflow template, a function description of the target application, and a first prompt sentence for prompting to select a workflow template with a function closest to the function description from the target workflow template; inputting the first prompt word into a workflow selection model to obtain a workflow template output by the workflow selection model; and determining the first workflow template based on the workflow template output by the workflow selection model.

[0120] It can be understood that the workflow selection model is pre-trained by using a large amount of second sample data, and the second sample data includes a plurality of workflow templates, a function description, a prompt sentence "select a workflow template with a function closest to the function description from the plurality of workflow templates", and a true value (a workflow template that should be selected).

[0121] In a possible implementation, the workflow generation request can further include personalized information; and the generating the workflow of the target application based on the target workflow template includes: determining a first workflow template based on the target workflow template; and adjusting the first workflow template by using the personalized information to obtain the workflow of the target application.

[0122] The technical scheme provided by the embodiments of the present application saves the workflow templates corresponding to various function descriptions in the workflow knowledge base, and when a workflow of a target application needs to be constructed, the similarity between the function description of the target application and the function description of each workflow template is calculated, and a target workflow template is selected from the workflow templates with a similarity greater than a similarity threshold; in response to the selection of the target workflow template, the workflow of the target application is determined based on the target workflow template. Since the workflow templates in the workflow knowledge base are pre-included and can accurately run, the rapid accuracy of generating the application workflow is ensured. In addition, the function description of the target application input by the user is complex and variable, and the use of a fixed similarity threshold for matching may lead to matching errors, for example, a too simplified function description may lead to the matching of too many irrelevant workflow templates, and a too complex function description may lead to the matching of an inaccurate workflow template. Therefore, the computing device performs semantic deep understanding of the function description, and then adaptively adjusts the similarity threshold based on the semantic richness of the function description (i.e., the higher the semantic richness, the higher the similarity threshold), so as to ensure the optimal matching result.

[0123] Figure 4 Another flowchart of a workflow generation method provided by the embodiments of the present application is shown. Referring to FIG. 4, Figure 4 the method applied to a computing device includes S401-S407:

[0124] S401, in response to a workflow generation request, keyword extraction is performed on a function description of a target application, wherein the workflow generation request comprises the function description, and the function description is used to indicate a function to be implemented by the target application.

[0125] S402, according to a preset type of context information, context information is extracted from the function description of the target application.

[0126] The steps S401-S402 have been described in detail in the step S301 of the embodiment as shown in the above, and will not be repeated here. Figure 3

[0127] S403, based on the keywords, a first similarity threshold increment is determined.

[0128] In a possible implementation, the above-mentioned determining the first similarity threshold increment based on the keywords comprises: determining a total number of keywords; determining a total number of high-frequency words, wherein the high-frequency words are keywords with a number of occurrences greater than a preset number; and determining the first similarity threshold increment according to the total number of keywords, the total number of high-frequency words, a weight of the keywords and a weight of the high-frequency words, wherein the weight of the keywords is less than the weight of the high-frequency words.

[0129] The preset number of words can be set according to actual needs, for example, set to 3.

[0130] It can be understood that the high-frequency words are words in the keywords with a number of occurrences greater than a preset number, i.e., the high-frequency words are key words in the keywords, which have more important semantic information, and therefore the weight of the high-frequency words is set to be greater than the weight of the keywords.

[0131] As an example, the above-mentioned determining the first similarity threshold increment according to the total number of keywords, the total number of high-frequency words, the weight of the keywords and the weight of the high-frequency words comprises: determining a product of the total number of keywords and the weight of the keywords as a first increment; determining a product of the total number of high-frequency words and the weight of the high-frequency words as a second increment; and determining a sum of the first increment and the second increment as the first similarity threshold increment.

[0132] The following is a calculation formula of the first similarity threshold increment:

[0133] ΔT1=q1N+q1Rq1<q2

[0134] Wherein, q1 is the weight of the keywords, q2 is the weight of the high-frequency words, N is the total number of keywords, and R is the total number of high-frequency words.

[0135] ​As a further example, the above determining the first similarity threshold increment according to the total number of keywords, the total number of high-frequency words, the weight of keywords and the weight of high-frequency words comprises: determining a product of the total number of keywords, the weight of keywords and the coefficient of keywords as a first increment; determining a product of the total number of high-frequency words, the weight of high-frequency words and the coefficient of high-frequency words as a second increment; and determining a sum of the first increment and the second increment as the first similarity threshold increment.

[0136] The following is a calculation formula of the first similarity threshold increment:

[0137] ΔT1=k1q1N+k2q2Rq1<q2

[0138] wherein q1 is the weight of keywords, q2 is the weight of high-frequency words, N is the total number of keywords, R is the total number of high-frequency words, k1 is the coefficient of keywords and k2 is the coefficient of high-frequency words.

[0139] For example, assuming that the function description of the target application includes 8 keywords and 3 high-frequency words, the coefficient of keywords and the coefficient of high-frequency words are both set to 0.05, the weight of keywords is set to 0.3 and the weight of high-frequency words is set to 0.4, the first similarity threshold similarity increment is 0.16 at this time.

[0140] It should be noted that the weight of keywords, the weight of high-frequency words, the coefficient of keywords and the coefficient of high-frequency words are set according to requirements and are adaptively adjusted with the length of the text.

[0141] S404, determining a second similarity threshold increment based on the context information.

[0142] In a possible implementation, the above determining the second similarity threshold increment based on the context information comprises: determining the type of each context information; determining the similarity threshold increment corresponding to each context information based on the type and the preset similarity threshold increment for the context information of each type; and determining the second similarity threshold increment based on the similarity threshold increment corresponding to each context information.

[0143] The above preset similarity threshold increment for the context information of each type is the similarity threshold increment when each type of context information appears once. The above determining the second similarity threshold increment based on the similarity threshold increment corresponding to each context information comprises: determining a sum of the similarity threshold increments corresponding to each context information as the second similarity threshold increment.

[0144] For example, the types of context information include conditional statements and modifiers, and the modifiers include adjectives, adverbs and negative words used to modify nouns. The similarity threshold increment corresponding to the conditional statement is 0.03, the similarity threshold increment corresponding to the adjectives and adverbs modifying the nouns is 0.01, and the similarity threshold increment corresponding to the negative words modifying the nouns is 0.03. Assuming that a text of a function description includes 6 conditional statements, 3 adjectives and adverbs modifying the nouns, and one negative word modifying the nouns, the second similarity threshold increment is 0.24.

[0145] S405, determining the similarity threshold value according to the reference similarity threshold value, the first similarity threshold increment and the second similarity threshold increment.

[0146] The reference similarity threshold value is determined according to the requirements, for example, set to 0.5.

[0147] In a possible implementation, the determination of the similarity threshold value according to the reference similarity threshold value, the first similarity threshold increment and the second similarity threshold increment includes:

[0148] The sum of the reference similarity threshold value, the first similarity threshold increment and the second similarity threshold increment is determined as the similarity threshold value.

[0149] S406, filtering the target workflow template from the workflow knowledge base based on the similarity threshold value and the function description, wherein the workflow knowledge base includes a plurality of workflow templates and their corresponding function descriptions; the function description of the target workflow template has a similarity with the function description greater than the similarity threshold value.

[0150] S407, generating the workflow of the target application based on the target workflow template in response to filtering the target workflow template.

[0151] The steps S406-S407 have been described in detail in the steps S302-S303 of the embodiment shown in Figure 3 , and will not be repeated here.

[0152] The technical scheme provided by the embodiment of the present application can understand the function description of the target application in depth through the keywords and context information, and adaptively adjust the similarity threshold value on this basis, so as to ensure the accuracy of the adjustment of the similarity threshold value, and further ensure the accuracy of the filtering of the target workflow template.

[0153] Figure 5 Another flowchart of a workflow generation method provided by the embodiment of the present application is shown in Figure 5 , which is applied to a computing device, and the method includes steps S501-S511.

[0154] S501, in response to a workflow generation request, determining a similarity threshold based on a function description of a target application, wherein the workflow generation request comprises the function description, and the function description is used to indicate a function to be implemented by the target application.

[0155] S502, based on the similarity threshold and the function description, screening a target workflow template from a workflow knowledge base, wherein the workflow knowledge base comprises a plurality of workflow templates and their corresponding function descriptions; the function description of the target workflow template has a similarity with the function description greater than the similarity threshold.

[0156] S503, in response to screening the target workflow template, generating a workflow of the target application based on the target workflow template.

[0157] The steps S501-S503 described above have been introduced in detail in steps S301-S303 of the embodiment as shown in Figure 3 The steps S501-S503 described above have been introduced in detail in steps S301-S303 of the embodiment as shown in

[0158] S504, in response to not screening the target workflow template, generating an initial workflow based on the function description.

[0159] It can be understood that the workflow templates stored in the workflow knowledge base are reasonable and have usability, therefore, the workflow of the target application is preferentially generated by using the target workflow template, and when the target workflow template does not exist, a mechanism of directly generating the workflow of the target application based on the function description is provided, to ensure the generation of the workflow.

[0160] In a possible implementation, the above generating the initial workflow based on the function description comprises: obtaining a third prompt word, wherein the third prompt word comprises a reference workflow, a workflow structure restriction, the function description and a third prompt sentence, the third prompt sentence is used to prompt a first workflow generation model to generate a workflow meeting the function description based on the reference workflow and the workflow structure restriction; inputting the third prompt word into the first workflow generation model to obtain a first workflow output by the first workflow generation model; and generating the initial workflow based on the first workflow.

[0161] The above reference workflow refers to an example of generating an initial workflow of an application based on the functional description of the application, which can include positive examples and negative examples, and the workflow architecture learned from the reference workflow model can include relevant information such as nodes, edges, and input and output definitions of the workflow. The above workflow structure restriction refers to the constraints on process flexibility, scalability, or performance due to technical, business, organizational, and other factors. For example: to avoid process confusion caused by too many conditional branches, limit the number of conditional branches of the workflow to a predetermined number. The above third prompt statement can be generated based on role design, for example: "You are an application workflow generation model, you need to generate a workflow that meets the functional description based on the reference workflow and the workflow structure restriction", by assigning a role design, the first workflow generation model better understands the task and improves the accuracy of workflow generation.

[0162] It can be understood that the first workflow generation model is pre-trained using a large amount of third sample data, and the third sample data includes reference workflows, workflow structure restrictions, functional descriptions, and third prompt statements, such as the data format of the third sample data: {"third prompt statement": text, "functional description": text, "reference workflow": json, "workflow structure restriction": text}. The embodiment of the application preliminarily constructs the initial workflow through the first workflow generation model.

[0163] As an example, the above generating an initial workflow based on the first workflow includes: determining the first workflow as the initial workflow.

[0164] It can be understood that when the content of the workflow structure restriction is sufficient, the first workflow can be directly used as the initial workflow.

[0165] As another example, the above generating an initial workflow based on the first workflow includes: obtaining a fourth prompt word, wherein the fourth prompt word includes the first workflow, node information, and a fourth prompt statement, the node information includes node configurations corresponding to each node type and node restrictions, and the fourth prompt statement is used to prompt the second workflow generation model to adjust the first workflow based on the node information; inputting the fourth prompt word into the second workflow generation model to obtain a second workflow output by the second workflow generation model; and determining the second workflow as the initial workflow.

[0166] The above node configuration refers to the necessary parameter configuration for the normal operation of the node in the workflow construction environment, and the node restriction refers to various resource or function constraints imposed on a single node in the workflow construction environment.

[0167] For example, the node restriction corresponding to the input node can be that the input node can only accept text input, file input, drop-down box input, and knowledge base input, and the input prompt word is not more than 200 characters.

[0168] The node restriction corresponding to the threshold-related node can be that the threshold value range is 0-1.

[0169] The node restriction corresponding to the output node can be that the output text is not more than 200 characters; and the output complete workflow (including node detailed configuration, parameters, etc.).

[0170] The node restriction corresponding to the condition node restriction can be that the judgment branch is not more than 3, and the judgment condition is not more than 2.

[0171] It can be understood that when the workflow structure restriction is relatively simple, the first workflow needs to be refined to obtain the initial workflow. The embodiment of the application refines the first workflow through the second workflow generation model, and specifically:

[0172] The computing device pre-stores the node configuration and node restriction corresponding to each node type, parses the node type list of the first workflow (for example, a json workflow) from the structure data of the first workflow, and finds the node configuration and node restriction corresponding to each node type in the node type list to constitute node information. Then, a fourth prompt word including the first workflow, the node information, and the third prompt sentence is constructed, the fourth prompt word is input into the second workflow generation model, and the second workflow generation model after refinement is obtained.

[0173] It can be understood that the second generation model is pre-trained by using a large amount of fourth sample data, and the fourth sample data includes the first workflow, the node information, and the fourth prompt sentence. For example, the data format of the fourth sample data is {"fourth prompt sentence": text, "first workflow": json, "node information": json}. The embodiment of the application constructs a specific workflow through the second workflow generation model. That is, the first workflow generation model and the second workflow generation model are constructed to constitute a complete initial workflow.

[0174] S505, performing node anomaly detection on the initial workflow.

[0175] In a possible implementation, the workflow knowledge base further includes a plurality of workflow nodes and node descriptions corresponding to the workflow nodes; and the node anomaly detection on the initial workflow includes: determining, based on the node descriptions, the matched workflow nodes of each node in the initial workflow; and determining, as an abnormal node, a node in the initial workflow that does not have a matched workflow node.

[0176] It can be understood that a large number of implemented workflow nodes are included in the workflow knowledge base, and each workflow node has a corresponding node description. For each node in the initial workflow, the computing device determines whether there is a workflow node matching the node in the workflow knowledge base based on the node description of the node. If the matching is successful, it means that the node has a corresponding implementation in the workflow knowledge base, and the node is a normal node; if the matching is unsuccessful, it means that the node has no corresponding implementation in the workflow knowledge base, and the node is an abnormal node. If there is an abnormal node in the initial workflow, the initial workflow is optimized to ensure that all nodes in the finally generated workflow have corresponding implementations in the workflow knowledge base, thereby improving the accuracy of the generated workflow nodes.

[0177] S506, in response to determining that there is an abnormal node in the initial workflow, performing S507; in response to determining that there is no abnormal node in the initial workflow, performing S508.

[0178] S507, optimizing the initial workflow based on the abnormal node and returning to perform S505.

[0179] The above optimization of the initial workflow based on the abnormal node includes: inputting the abnormal node and the initial workflow into a node repair model to obtain a node repair model optimized initial workflow.

[0180] It can be understood that the optimized initial workflow is re-detected for node abnormalities. If there are still abnormalities, the initial workflow is optimized again, and through continuous circulation, an initial workflow is obtained in which all nodes have corresponding implementations in the workflow knowledge base.

[0181] It should be noted that, assuming that a workflow has repeatedly performed node abnormality detection for a second preset number of times, at this time, the workflow generation work enters a dead loop, and the workflow generation process is exited.

[0182] S508, performing node link abnormality detection on the initial workflow.

[0183] The above node link refers to the connected edge of the node and the node.

[0184] In a possible implementation, the above node link abnormality detection on the initial workflow includes:

[0185] Obtaining a test case, wherein the test case includes test input and expected output of each node link in the initial workflow;

[0186] obtaining a second prompt word, wherein the second prompt word includes a test case, an initial workflow, and a fourth prompt statement, the fourth prompt statement being used to prompt the workflow detection model to identify an abnormal node link and its corresponding abnormal type in the initial workflow using the test case, the abnormal node link being a node link whose actual output does not match the expected output; inputting the second prompt word into the workflow detection model to obtain a detection result output by the workflow detection model. The detection result includes an abnormal node link and its corresponding abnormal type, a test input, an expected output, and an actual output. For example: {“error type”:“interface conflict”,“error node”:“Node3”,“expected output”:“Tensor”,“actual output”:“None”,“complete workflow”:“***”}.

[0187] It can be understood that the workflow detection model is pre-trained using a large amount of fifth sample data, the fifth sample data including a test case, an initial workflow, and a second prompt statement, for example, the data format of the fifth sample data is {“second prompt statement”: text, “initial workflow”: json, “test case”: List}.

[0188] After determining that there is no abnormal node in the initial workflow, the computing node obtains a test case given by a model generating the initial workflow, which contains test inputs and expected outputs of each node link in the initial workflow. Then, the computing device inputs the second prompt word into the workflow detection model to detect the abnormal node link that is difficult to implement in the initial workflow. By detecting the abnormal node link in the initial workflow, the initial workflow is optimized to ensure the data coherence of the finally generated workflow, improving the accuracy of the generated workflow node link.

[0189] S509, in response to determining that there is an abnormal node link in the initial workflow, performing S510; in response to determining that there is no abnormal node link in the initial workflow, performing S511.

[0190] S510, optimizing the initial workflow based on the abnormal node link and returning to perform S505.

[0191] The above optimization of the initial workflow based on the abnormal node link includes: inputting the initial workflow, the detection result, and the function description into a workflow repair model to obtain an optimization scheme output by the workflow repair model; and optimizing the initial workflow using the optimization scheme.

[0192] It can be understood that the workflow repair model is trained in advance by a large amount of sixth sample data including an initial workflow, a detection result and a function description (in the form of a triple). After determining that there is an abnormal node link in the initial workflow, the computing node calls the workflow repair model, and an optimization scheme of the workflow can be obtained by using the workflow repair model, and the optimization of the workflow can be realized by using the optimization scheme. In this way, the optimization efficiency of the workflow is improved by using the workflow repair model. Then, the node anomaly detection is performed on the optimized initial workflow again. If there is still node anomaly or node link anomaly, optimization is performed again, and through continuous circulation, an accurate workflow is generated.

[0193] S511, determining an initial workflow as a workflow of the target application.

[0194] In a possible implementation, the above determining the initial workflow as the workflow of the target application comprises: performing individual adjustment on the initial workflow, and taking the adjusted workflow as the workflow of the target application.

[0195] The technical scheme provided by the embodiment of the application improves the flexibility and reliability of the system when the workflow knowledge base cannot find a suitable workflow template, calls an external tool to generate a workflow, and ensures that the finally generated process meets the logical requirements and can be correctly executed through error detection and correction, optimization strategy and other mechanisms.

[0196] The above mainly introduces the scheme of the embodiment of the application from the perspective of the method. It can be understood that the computing device (such as a server) in the embodiment of the application contains a hardware structure and / or a software module corresponding to the execution of each function in order to realize the above functions. Those skilled in the art should easily realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present text can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driven hardware depends on the specific application and design constraints of the technical scheme. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiment of the application.

[0197] Figure 6 A structural schematic diagram of a workflow generation apparatus provided by the embodiment of the application is shown in FIG. 6. Referring to FIG. 6, Figure 6 The workflow generation apparatus is applied to a computing device and includes a determination module 601, a screening module 602 and a first generation module 603. Wherein,

[0198] The determining module 601 is configured to determine a similarity threshold based on a function description of a target application in response to a workflow generation request, wherein the workflow generation request comprises the function description, and the function description is used to indicate a function to be implemented by the target application.

[0199] The screening module 602 is configured to screen a target workflow template from a workflow knowledge base based on the similarity threshold and the function description, wherein the workflow knowledge base comprises a plurality of workflow templates and corresponding function descriptions of the plurality of workflow templates, and a similarity between the function description of the target workflow template and the function description is greater than the similarity threshold.

[0200] The first generating module 603 is configured to generate a workflow of the target application based on the target workflow template in response to screening of the target workflow template.

[0201] The technical scheme provided by the embodiments of the present application saves the workflow templates corresponding to various function descriptions in the workflow knowledge base, and when a workflow of a target application needs to be constructed, the similarity between the function description of the target application and the function description of each workflow template is calculated, the target workflow template is selected from the workflow templates with a similarity greater than a similarity threshold, and the workflow of the target application is determined based on the target workflow template. Since the workflow templates in the workflow knowledge base are pre-recorded and can accurately run, the rapid accuracy of generating the application workflow is ensured. In addition, the function description of the target application input by the user is complex and variable, and the use of a fixed similarity threshold for matching may result in matching errors, for example, a too simplified function description may result in too many irrelevant workflow templates being matched, and a too complex function description may result in an accurate workflow template not being matched. Therefore, the computing device deeply understands the function description, and adaptively adjusts the similarity threshold based on the deep understanding, thereby ensuring the optimal matching result.

[0202] In some possible implementation manners, the determining module 601 comprises a first determining unit, a second determining unit and a third determining unit, wherein:

[0203] The first determining unit is configured to determine a total number of keywords and a total number of high-frequency keywords based on the keywords in the function description, wherein the high-frequency keywords are keywords with a number of occurrences greater than a preset number of occurrences.

[0204] The second determining unit is configured to determine a similarity threshold increment based on the total number of keywords and the total number of high-frequency keywords.

[0205] The third determining unit is configured to determine the similarity threshold according to a reference similarity threshold and the similarity threshold increment.

[0206] In some possible implementation manners, the second determining unit is specifically configured to determine the weighted sum of the total number of keywords and the total number of high-frequency words as the similarity threshold increment;

[0207] The second determining unit includes:

[0208] The first determining sub-unit is configured to determine the weighted sum of the total number of keywords and the total number of high-frequency words as the first similarity threshold increment;

[0209] The second determining sub-unit is configured to determine the second similarity threshold increment based on the context information in the function description;

[0210] The third determining sub-unit is configured to determine the sum of the first similarity threshold increment and the second similarity threshold increment as the similarity threshold increment.

[0211] In some possible implementation manners, the second determining sub-unit includes a first determining layer, a second determining layer and a third determining layer, and wherein:

[0212] The first determining layer is configured to determine the type of each context information;

[0213] The second determining layer is configured to determine the similarity threshold increment corresponding to each context information based on the type and the preset similarity threshold increment for the context information of each type;

[0214] The third determining layer is configured to determine the second similarity threshold increment based on the similarity threshold increment corresponding to each context information; and the type of the context information at least includes conditional statements and adjectives.

[0215] The adjectives include adjectives for modifying nouns, adverbs and negative words.

[0216] In some possible implementation manners, the screening module 602 includes a calculating unit, a fourth determining unit and a fifth determining unit, and wherein:

[0217] The calculating unit is configured to calculate the similarity of the function description between each workflow template in the workflow knowledge base and the target application;

[0218] The fourth determining unit is configured to determine the workflow template with the similarity greater than the similarity threshold as the candidate workflow template;

[0219] The fifth determining unit is configured to select the preset number of workflow templates with the highest similarity from the candidate workflow templates as the target workflow template.

[0220] In some possible implementation manners, the first generating module includes a constructing unit, a sixth determining unit and a seventh determining unit, and wherein:

[0221] The acquisition unit is configured to acquire a first prompt word, wherein the first prompt word comprises a target workflow template, a function description, and a first prompt sentence, and the first prompt sentence is used to prompt the workflow selection model to select a workflow template that is most similar to the function description from the target workflow template;

[0222] The sixth determination unit is configured to input the first prompt word into the workflow selection model to obtain a workflow template output by the workflow selection model;

[0223] The seventh determination unit is configured to determine a workflow of the target application based on the workflow template output by the workflow selection model.

[0224] In some possible implementation manners, the apparatus further includes a second generation module, and the second generation module includes a first generation unit and an exception detection and optimization unit.

[0225] The first generation unit is configured to, in response to the target workflow template not existing, generate an initial workflow based on the function description.

[0226] The exception detection and optimization unit is configured to perform exception node detection and exception node link on the initial workflow, and optimize the initial workflow based on a detection result to obtain the workflow of the target application.

[0227] In some possible implementation manners, the first generation unit includes a first construction subunit, a fourth determination subunit, and a first generation subunit, and the first construction subunit is configured to:

[0228] The first acquisition subunit is configured to acquire a third prompt word, wherein the third prompt word comprises a reference workflow, a workflow structure restriction, a function description, and a third prompt sentence, and the third prompt sentence is used to prompt the first workflow generation model to generate a workflow that meets the function description based on the reference workflow and the workflow structure restriction.

[0229] The fourth determination subunit is configured to input the third prompt word into the first workflow generation model to obtain a first workflow output by the first workflow generation model.

[0230] The first generation subunit is configured to generate an initial workflow based on the first workflow.

[0231] In some possible implementation manners, the first generation subunit includes a first acquisition layer, a fourth determination layer, and a fifth determination layer, and the first acquisition layer is configured to:

[0232] The first obtaining layer is configured to obtain a fourth prompt word, wherein the fourth prompt word comprises a first workflow, node information, and a fourth prompt statement, the node information comprises node configurations and node restrictions corresponding to each node type, and the fourth prompt statement is used to prompt the second workflow generation model to adjust the first workflow based on the node information;

[0233] The fourth determining layer is configured to input the fourth prompt word into the second workflow generation model to obtain a second workflow output by the second workflow generation model;

[0234] The fifth determining layer is configured to determine the second workflow as an initial workflow.

[0235] In some possible implementation manners, the abnormality detection and optimization unit comprises an abnormality response subunit, an optimization subunit, and a fifth determining subunit, and wherein:

[0236] The abnormality detection subunit is configured to determine an abnormality in response to the initial workflow having an abnormal node or an abnormal node link.

[0237] The optimization subunit is configured to optimize the initial workflow based on the abnormality, and repeatedly perform the detection and optimization until the initial workflow has no abnormality.

[0238] The fifth determining subunit is configured to determine the optimized initial workflow as a workflow of the target application.

[0239] In some possible implementation manners, the workflow knowledge base further comprises a plurality of workflow nodes and node descriptions corresponding to the workflow nodes, and the abnormality detection subunit comprises a sixth determining layer and a seventh determining layer, and wherein:

[0240] The sixth determining layer is configured to determine, based on the node descriptions, each node in the initial workflow that matches a workflow node.

[0241] The seventh determining layer is configured to determine, as an abnormal node, a node in the initial workflow that has no matching workflow node.

[0242] In some possible implementation manners, the abnormality detection subunit further comprises a second obtaining layer, a third obtaining layer, and an eighth determining layer, and wherein:

[0243] The second obtaining layer is configured to obtain a test case in response to the initial workflow having no abnormal node, wherein the test case comprises test inputs and expected outputs of each node link in the initial workflow.

[0244] The third acquisition layer is configured to acquire a second prompt word, wherein the second prompt word comprises a test case, an initial workflow, and a fourth prompt statement, the fourth prompt statement is configured to prompt the workflow detection model to identify an abnormal node link and a corresponding abnormal type in the initial workflow by using the test case, and the abnormal node link is a node link with inconsistent actual output and expected output;

[0245] The eighth determination layer is configured to input the second prompt word into the workflow detection model to obtain a detection result output by the workflow detection model.

[0246] In some possible implementation manners, the detection result comprises the abnormal node link and the corresponding abnormal type, a test input, an expected output, and an actual output.

[0247] The optimization subunit further comprises a second optimization layer and a third optimization layer, wherein:

[0248] The second optimization layer is configured to input the initial workflow, the detection result, and the function description into a workflow repair model to obtain an optimization scheme output by the workflow repair model.

[0249] The third optimization layer is configured to optimize the initial workflow by using the optimization scheme.

[0250] The embodiment of the application further provides a computing device, comprising a processor and a memory, and the processor and the memory are coupled. Wherein the memory is configured to store computer program instructions, and the processor is configured to invoke the computer program instructions in the memory to execute the workflow generation method shown in the above embodiment.

[0251] The embodiment of the application further provides a computer readable storage medium, which stores computer program instructions, and the computer program instructions are configured to enable a computing device to execute the workflow generation method shown in the above embodiment.

[0252] The embodiment of the application further provides a computer program product, comprising computer program instructions, when the computer program instructions run on a computing device, enable the computing device to execute the workflow generation method shown in the above embodiment.

[0253] The computing device, the computer readable storage medium, or the computer program product provided by the embodiment of the application are all configured to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved by the computing device, the computer readable storage medium, or the computer program product are referable to the beneficial effects in the corresponding method provided above, and will not be described here again.

[0254] Those skilled in the art can clearly understand the technical personnel in the art that, for the convenience and brevity of description, only the above functional modules are divided as an example, and in actual application, the above functions can be completed by different functional modules according to the needs, that is, the internal structure of the device (such as a computing device) is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device (such as a computing device) and unit described above can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.

[0255] In several embodiments provided in the present application, it should be understood that the disclosed system, device (such as a computing device) and method can be implemented in other ways. For example, the device (such as a computing device) embodiments described above are only schematic, for example, the division of the module or unit is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.

[0256] The units described above as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0257] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit.

[0258] The integrated unit described above, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the method of the various embodiments of the present application. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk, and various media that can store program codes.

[0259] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A workflow generation method, characterized in that: The method comprises: In response to a workflow generation request, determining a similarity threshold based on a functional description of a target application, wherein the workflow generation request includes the functional description, and the functional description is used to indicate a function to be implemented by the target application; Based on the similarity threshold and the functional description, a target workflow template is selected from a workflow knowledge base, wherein the workflow knowledge base includes a plurality of workflow templates and corresponding functional descriptions; and the functional description of the target workflow template has a similarity with the functional description that is greater than the similarity threshold; In response to selecting the target workflow template, a workflow of the target application is generated based on the target workflow template.

2. The method according to claim 1, characterized in that Determining the similarity threshold based on the functional description of the target application includes: Based on the keywords in the function description, determining the total number of the keywords and the total number of high-frequency words, wherein the high-frequency words are the keywords that appear more than a preset number of times; Determining a similarity threshold increment based on the total number of keywords and the total number of high-frequency words; The similarity threshold is determined according to a base similarity threshold and the similarity threshold increment.

3. The method according to claim 2, characterized in that The determining the similarity threshold increment based on the total number of the keywords and the total number of the high-frequency words includes: Determine the weighted sum of the total number of keywords and the total number of high-frequency words as the similarity threshold increment; or Determine a weighted sum of the total number of keywords and the total number of high-frequency words as a first similarity threshold increment; determining a second similarity threshold increment based on context information in the functional description; The sum of the first similarity threshold increment and the second similarity threshold increment is determined as the similarity threshold increment.

4. The method according to claim 3, characterized in that The determining, based on the context information in the function description, a second similarity threshold increment, includes: determining a type of each piece of context information; Determining a similarity threshold increment corresponding to each piece of context information based on the type and a similarity threshold increment preset for each type of context information; Determining the second similarity threshold increment based on the similarity threshold increment corresponding to each of the context information; wherein the types of the context information include at least: conditional statements and modifiers; The modifiers include adjectives, adverbs and negative words used to modify nouns.

5. The method according to claim 1, wherein The step of screening a target workflow template from a workflow knowledge base based on the similarity threshold and the functional description includes: Determining the similarity of functional descriptions between each workflow template in the workflow knowledge base and the target application; Determine the workflow template whose similarity is greater than the similarity threshold as a candidate workflow template; A preset number of workflow templates with the highest similarity are selected from the candidate workflow templates and determined as the target workflow templates.

6. The method according to claim 1 or 5, characterized in that Generating the workflow of the target application based on the target workflow template includes: Obtaining a first prompt word, wherein the first prompt word includes the target workflow template, the functional description, and a first prompt statement, wherein the first prompt statement is used to prompt the workflow selection model to select a workflow template having a function most similar to the functional description from the target workflow template; Inputting the first prompt word into the workflow selection model to obtain a workflow template output by the workflow selection model; The workflow of the target application is determined based on the workflow template output by the workflow selection model.

7. The method according to claim 1, characterized in that The method further comprises: In response to not finding the target workflow template, generating an initial workflow based on the functional description; The initial workflow is detected for abnormal nodes and abnormal node links, and the initial workflow is optimized based on the detection results to obtain the workflow of the target application.

8. The method according to claim 7, characterized in that The workflow knowledge base also includes multiple workflow nodes and their corresponding node descriptions; The detecting abnormal nodes on the initial workflow includes: Based on the node description, determining a workflow node that matches each node in the initial workflow; A node in the initial workflow that does not have a matching workflow node is determined as an abnormal node.

9. The method according to claim 7, characterized in that The detecting abnormal node links on the initial workflow includes: In response to determining that the initial workflow does not have an abnormal node, obtaining a test case, wherein the test case includes a test input and an expected output of each node link in the initial workflow; Obtaining a second prompt word, wherein the second prompt word includes the test case, the initial workflow, and a second prompt statement, the second prompt statement being used to prompt the workflow detection model to use the test case to identify abnormal node links and their corresponding abnormality types in the initial workflow, wherein the abnormal node link is a node link whose actual output does not match the expected output; The second prompt word is input into the workflow detection model to obtain a detection result output by the workflow detection model.

10. A computing device, characterized in that The method comprises a memory and a processor; the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions; wherein, when the processor calls the program instructions to execute the method according to any one of claims 1 to 9.