Task arrangement method and system based on agent and knowledge graph

Through a large language model combining agents and knowledge graphs, user task needs are analyzed and execution plans are generated, which solves the problems of high labor costs, high thresholds and poor dynamic adaptability in the existing technology, and achieves efficient and reliable task orchestration, reducing the number of tasks in the current technology. The cost of orchestration and difficulty of use are provided.

CN119201383APending Publication Date: 2024-12-27SHANGHAI JIAOTONG UNIV +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411237239.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing task orchestration method requires a lot of manual intervention, high threshold, poor dynamic adaptability, and large language models have poor results in the lack of external knowledge base, affecting the availability and reliability of agents.

Method used

Using a task orchestration method based on agents and knowledge graphs, by obtaining user task requirements and API interface information in the knowledge graph, using a large language model to analyze requirements, generate execution plans, and implement the API interface based on the execution plan, monitor and adjust in real time. To reduce labor costs and usage thresholds.

Benefits of technology

It significantly reduces the cost of manual task orchestration, improves the reliability and ease of use of the system, provides visual and traceable API call information through the knowledge graph, simplifies the tool interface, and lowers the threshold for use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201383A_ABST
    Figure CN119201383A_ABST
Patent Text Reader

Abstract

The invention discloses a task arrangement method and system based on an agent and a knowledge graph, and relates to the technical field of task arrangement, and the task arrangement method based on the agent and the knowledge graph comprises the steps: obtaining a user task demand and the knowledge graph; the knowledge graph comprises interface information of a plurality of application programming interfaces; based on the user task demand, retrieving interface information of all application programming interfaces corresponding to the user task demand from the knowledge graph; analyzing a user task demand by using a large language model to obtain task content; arranging all application programming interfaces corresponding to the user task requirements on the basis of the task contents to obtain execution plans of the application programming interfaces; and based on the execution plan, executing each application programming interface corresponding to the user task demand. According to the invention, the cost and use threshold of manual task arrangement can be reduced, and the reliability and usability of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of task scheduling technology, and in particular to a task scheduling method and system based on intelligent agents and knowledge graphs. Background Art

[0002] In the real world, there are many complex tasks that need to be completed with computer assistance, and these tasks usually rely on calling various application programming interfaces (APIs) to achieve their goals. Existing solutions often require a lot of human resources and time costs. How to reduce labor costs and lower the threshold for use to efficiently complete these complex tasks has become an important research direction.

[0003] Traditional task scheduling usually involves scheduling various task nodes and performing periodic or event scheduling to achieve complex task scheduling. However, this method requires a lot of manual intervention and has high requirements on the user's technical level. If we can study a method of task parsing, scheduling and execution for complex task requirements and reduce the cost of manual task scheduling as much as possible, we will be able to greatly improve work efficiency.

[0004] Existing task scheduling methods mainly include:

[0005] 1. Traditional service orchestration method:

[0006] Service orchestration: This centralized orchestration method defines a series of executable business processes for different services through a control center. Each microservice does not need to know the specific order of service combination, but is managed uniformly by the control center.

[0007] Service orchestration: This decentralized orchestration method does not rely on a central scheduling node. Each microservice exchanges resources and information through defined message queues and other mechanisms.

[0008] 2. Orchestration tools in microservice architecture:

[0009] Many orchestration languages ​​and tools have been used in microservice architecture, such as WSCL, XLANG, WSFL, BPMN, and BPEL. Among them, BPEL and BPMN are the most commonly used orchestration languages.

[0010] Netflix Conductor, Zeebe and other process engines and Activiti, jBPM and other workflow frameworks are also widely used in practical applications. These tools and frameworks provide high flexibility and scalability, but also require developers to have high professional knowledge and skills.

[0011] Although existing service orchestration methods and tools can meet the needs of complex tasks to a certain extent, there are still some obvious shortcomings:

[0012] 1. High labor costs: Existing orchestration tools and languages ​​usually require developers to manually write and maintain orchestration scripts, which consumes a lot of manpower and time.

[0013] 2. High learning threshold: Existing orchestration tools and languages, such as BPEL and BPMN, require developers to have specific programming and modeling knowledge, which makes the usage threshold high for users who do not have relevant background.

[0014] 3. Poor dynamic adaptability: As business needs continue to change, existing orchestration solutions need to be frequently updated and adjusted, and developers need to participate throughout the process, which increases maintenance costs and difficulty.

[0015] 4. Limitations of Large Language Models (LLM): The existing open source large language models are not ideal in terms of tool use, especially in the absence of an external knowledge base, which is prone to hallucinations and affects the usability and reliability of the intelligent agent. Summary of the invention

[0016] The purpose of this application is to provide a task scheduling method and system based on intelligent agents and knowledge graphs, reduce the cost and usage threshold of manual task scheduling, and improve the reliability and ease of use of the system.

[0017] To achieve the above objectives, this application provides the following solutions:

[0018] In the first aspect, the present application provides a task scheduling method based on an agent and a knowledge graph, comprising:

[0019] Obtaining user task requirements and a knowledge graph; the knowledge graph includes interface information of multiple application programming interfaces;

[0020] Based on the user task requirement, retrieve interface information of all application programming interfaces corresponding to the user task requirement from the knowledge graph;

[0021] Utilize the large language model to analyze the user's task requirements and obtain the task content;

[0022] Based on the task content, all application programming interfaces corresponding to the user's task requirements are arranged to obtain an execution plan of the application programming interfaces;

[0023] Based on the execution plan, each application programming interface corresponding to the user task requirement is executed.

[0024] Optionally, the interface information includes: the dependency relationship between the self-information and the application programming interface; the self-information includes: name, category, supplier, input parameters and output parameters.

[0025] Optionally, a node of the knowledge graph corresponds to the application programming interface's own information, and an edge corresponds to the dependency relationship between the application programming interfaces corresponding to two nodes connected by the edge.

[0026] Optionally, based on the user task requirement, interface information of all application programming interfaces corresponding to the user task requirement is retrieved from the knowledge graph, including:

[0027] According to the user task requirement, determining the category of the application programming interface corresponding to the user task requirement;

[0028] According to the category of the application programming interface corresponding to the user's task requirements, the application programming interface of the corresponding category is screened out from the knowledge graph;

[0029] The user task requirements are converted into SPARQL query statements using a large language model, and a query is performed in the knowledge graph to obtain interface information of each application programming interface of the corresponding category.

[0030] Optionally, after executing each application programming interface corresponding to the user task requirement based on the execution plan, the method further includes:

[0031] Real-time monitoring of the execution status of each application programming interface corresponding to user task requirements;

[0032] The execution plan of the application programming interface is adjusted in real time based on the execution status.

[0033] Optionally, the large language model is an Agent.

[0034] In a second aspect, the present application provides a task scheduling system based on an agent and a knowledge graph, which is used to implement any of the above-mentioned task scheduling methods based on an agent and a knowledge graph, and the task scheduling system based on an agent and a knowledge graph includes: a knowledge graph module, an API scheduling module and an API execution engine;

[0035] The knowledge graph module is used to:

[0036] Obtaining user task requirements and a knowledge graph; the knowledge graph includes interface information of multiple application programming interfaces;

[0037] Based on the user task requirement, retrieve interface information of all application programming interfaces corresponding to the user task requirement from the knowledge graph;

[0038] The API orchestration module is used to:

[0039] Utilize the large language model to analyze the user's task requirements and obtain the task content;

[0040] Based on the task content, all application programming interfaces corresponding to the user's task requirements are arranged to obtain an execution plan of the application programming interfaces;

[0041] The API execution engine is used to execute various application programming interfaces corresponding to user task requirements based on the execution plan.

[0042] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-mentioned task scheduling methods based on intelligent agents and knowledge graphs.

[0043] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned task scheduling methods based on intelligent agents and knowledge graphs.

[0044] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned task scheduling methods based on intelligent agents and knowledge graphs.

[0045] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0046] This application discloses a task scheduling method and system based on intelligent agents and knowledge graphs. Through a large language model, the design of effective prompt words, and the introduction of external knowledge, the present invention can significantly reduce the cost of manual task scheduling, and provide visual and traceable API call information through knowledge graphs to improve the reliability and usability of the system. In addition, the design of a simple and easy-to-understand tool interface allows users to easily schedule and execute tasks, further lowering the threshold for use. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1A schematic diagram of a task scheduling method based on an agent and a knowledge graph provided in one embodiment of the present application;

[0049] Figure 2 The flowchart of the task arrangement method based on Agent and knowledge graph;

[0050] Figure 3 Constructing process maps for knowledge pictures;

[0051] Figure 4 Arrange a method flow chart for the travel-related information query task;

[0052] Figure 5 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0054] The purpose of this application is to provide a task scheduling method and system based on intelligent agents and knowledge graphs, aiming to reduce the cost and usage threshold of manual task scheduling and improve the reliability and ease of use of the system.

[0055] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0056] In an exemplary embodiment, Figure 1 and Figure 2 As shown, the task scheduling method based on the agent and the knowledge graph in this embodiment includes:

[0057] Step 1: Obtain user task requirements and knowledge graph; the knowledge graph includes interface information of multiple application programming interfaces.

[0058] As an optional implementation method, the interface information includes: the dependency relationship between the self-information and the application programming interface; the self-information includes: name, category, supplier, input parameters and output parameters.

[0059] As an optional implementation, a node of the knowledge graph corresponds to the application programming interface's own information, and an edge corresponds to the dependency relationship between the application programming interfaces corresponding to the two nodes connected by the edge.

[0060] Specifically, before step 1, it also includes: constructing a knowledge graph, such as Figure 3 As shown in Figure 1, the process of building a knowledge graph includes: (1) Data collection: Collect a large amount of API data on public API websites, sort out the functions, parameters, dependencies and other information of various APIs from the API documents, and store them in JSON format files. (2) Graph construction: Structure the collected API information, use the API as a node in the knowledge graph, the dependencies between APIs as edges in the graph, and add some relevant semantic nodes to assist the model's expression ability. The constructed knowledge graph is stored in the Neo4j database.

[0061] Step 2: Based on the user task requirements, retrieve the interface information of all application programming interfaces corresponding to the user task requirements from the knowledge graph.

[0062] As an optional implementation, step 2 includes:

[0063] Step 21: According to the user task requirement, determine the category of the application programming interface corresponding to the user task requirement.

[0064] Specifically, according to the user's task requirements, the category of the API required by the user is determined, that is, the category of the application programming interface corresponding to the user's task requirements, such as weather query, hotel query and other task requirements.

[0065] Step 22: According to the categories of application programming interfaces corresponding to the user's task requirements, filter out application programming interfaces of corresponding categories from the knowledge graph.

[0066] Step 23: Use the large language model to convert the user task requirements into SPARQL query statements, query them in the knowledge graph, and obtain the interface information of each application programming interface in the corresponding category.

[0067] As an optional implementation, the large language model is an Agent.

[0068] Step 3: Use the large language model to parse the user's task requirements and obtain the task content.

[0069] Specifically, a large language model is used to perform natural language processing on user task requirements to obtain task content.

[0070] The API information and task description retrieved from the knowledge graph are provided to the large language model for API orchestration and parameter configuration.

[0071] Step 4: Based on the task content, arrange all application programming interfaces corresponding to the user's task requirements to obtain an execution plan for the application programming interfaces.

[0072] Specifically, the arrangement result in natural language is output according to the specified prompt word, and then the API call sequence, API parameter input and parameter information to be passed between APIs are matched therefrom by using regular matching expressions, so as to obtain the execution plan.

[0073] Among them, through the prompt word techniques such as Chain of Thought and Few-shot prompting, efficient and concise prompt words are constructed to tap the agent capabilities of the large language model. This embodiment adopts the ReWOO prompt word arrangement method, which stipulates that the large language model is output according to the established format, so that the entire API call sequence can be obtained through one arrangement. If there is a mutual dependency between APIs, a placeholder will be used to represent the previous API call result, and the placeholder will be replaced after the API call.

[0074] The interface information and task content of the application programming interface retrieved from the knowledge graph are provided to the large language model for API orchestration and parameter configuration.

[0075] Step 5: Based on the execution plan, execute each application programming interface corresponding to the user's task requirements.

[0076] As an optional implementation manner, after step 5, the method further includes:

[0077] Monitor the execution status of each application programming interface corresponding to user task requirements in real time.

[0078] Adjust the execution plan of the API in real time based on the execution status.

[0079] Specifically, if an error occurs in the call of the application programming interface, an automatic retry mechanism will be triggered. If the user's task requirements cannot be met after execution according to the execution plan, a rescheduling mechanism will be triggered to ensure that the task is completed as expected.

[0080] like Figure 4As shown, the present application also provides an application scenario, which applies the above-mentioned task scheduling method based on intelligent agents and knowledge graphs to schedule travel-related information query tasks. Specifically: 1) Obtain user task requirements and knowledge graphs; user task requirements include: obtaining airport ID, obtaining airport information, obtaining login information, etc. 2) Based on user task requirements, retrieve interface information of all application programming interfaces corresponding to user task requirements from the knowledge graph, and the interface information includes: API front and back dependency information, etc. 3) Use a large language model to parse user task requirements and obtain task content. 4) Based on the task content, schedule all application programming interfaces corresponding to user task requirements to obtain an execution plan for the application programming interface. 5) Based on the execution plan, execute each application programming interface corresponding to the user task requirement. 6) Perform natural language answer processing on the API call results obtained according to the execution plan.

[0081] In an exemplary embodiment, a task orchestration system based on an agent and a knowledge graph is provided to implement any of the above-mentioned task orchestration methods based on an agent and a knowledge graph. The task orchestration system based on an agent and a knowledge graph includes: a knowledge graph module, an API orchestration module and an API execution engine.

[0082] Knowledge graph module, used for:

[0083] Obtain user task requirements and knowledge graphs. The knowledge graph includes interface information of multiple application programming interfaces.

[0084] Based on user task requirements, interface information of all application programming interfaces corresponding to the user task requirements is retrieved from the knowledge graph.

[0085] API orchestration module, used to:

[0086] Use the large language model to parse user task requirements and obtain task content.

[0087] Based on the task content, all application programming interfaces corresponding to the user's task requirements are arranged to obtain an execution plan for the application programming interfaces.

[0088] The API execution engine is used to execute various application programming interfaces corresponding to user task requirements based on the execution plan.

[0089] In an exemplary embodiment, a computer device is provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a task scheduling method based on an agent and a knowledge graph.

[0090] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, a task scheduling method based on an agent and a knowledge graph is implemented.

[0091] In an exemplary embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements a task scheduling method based on an agent and a knowledge graph.

[0092] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a task scheduling method based on an intelligent agent and a knowledge graph is implemented.

[0093] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0094] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0095] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0096] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0097] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0098] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A task scheduling method based on intelligent agent and knowledge graph, characterized in that: The task scheduling method based on intelligent agent and knowledge graph includes: Obtaining user task requirements and a knowledge graph; the knowledge graph includes interface information of multiple application programming interfaces; Based on the user task requirement, retrieve interface information of all application programming interfaces corresponding to the user task requirement from the knowledge graph; Utilize the large language model to analyze the user's task requirements and obtain the task content; Based on the task content, all application programming interfaces corresponding to the user's task requirements are arranged to obtain an execution plan of the application programming interfaces; Based on the execution plan, each application programming interface corresponding to the user task requirement is executed.

2. The task scheduling method based on agent and knowledge graph according to claim 1 is characterized in that: The interface information includes: the dependency between the self-information and the application programming interface; the self-information includes: name, category, supplier, input parameters and output parameters.

3. The task scheduling method based on agent and knowledge graph according to claim 2 is characterized in that: A node of the knowledge graph corresponds to the application programming interface's own information, and an edge corresponds to the dependency relationship between the application programming interfaces corresponding to the two nodes connected by the edge.

4. The task scheduling method based on agent and knowledge graph according to claim 2 is characterized in that: Based on the user task requirement, interface information of all application programming interfaces corresponding to the user task requirement is retrieved from the knowledge graph, including: According to the user task requirement, determining the category of the application programming interface corresponding to the user task requirement; According to the category of the application programming interface corresponding to the user's task requirements, the application programming interface of the corresponding category is screened out from the knowledge graph; The user task requirements are converted into SPARQL query statements using a large language model, and a query is performed in the knowledge graph to obtain interface information of each application programming interface of the corresponding category.

5. The task scheduling method based on agent and knowledge graph according to claim 1 is characterized in that: After executing each application programming interface corresponding to the user task requirement based on the execution plan, the method further includes: Real-time monitoring of the execution status of each application programming interface corresponding to user task requirements; The execution plan of the application programming interface is adjusted in real time based on the execution status.

6. The task scheduling method based on agent and knowledge graph according to claim 1 is characterized in that: The large language model is an Agent.

7. A task scheduling system based on an agent and a knowledge graph, used to implement the task scheduling method based on an agent and a knowledge graph as described in any one of claims 1 to 6, characterized in that: The task scheduling system based on intelligent agent and knowledge graph includes: a knowledge graph module, an API scheduling module and an API execution engine; The knowledge graph module is used to: Obtaining user task requirements and a knowledge graph; the knowledge graph includes interface information of multiple application programming interfaces; Based on the user task requirement, retrieve interface information of all application programming interfaces corresponding to the user task requirement from the knowledge graph; The API orchestration module is used to: Utilize the large language model to analyze the user's task requirements and obtain the task content; Based on the task content, all application programming interfaces corresponding to the user's task requirements are arranged to obtain an execution plan of the application programming interfaces; The API execution engine is used to execute various application programming interfaces corresponding to user task requirements based on the execution plan.

8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the task scheduling method based on an agent and a knowledge graph as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the task scheduling method based on intelligent agent and knowledge graph as described in any one of claims 1-6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the task scheduling method based on intelligent agent and knowledge graph as described in any one of claims 1-6.

Citation Information

Cited By

  • Business process reconstruction method and system based on large model and knowledge graph collaboration

    CN121745862A