Tool scheduling methods, devices and equipment
By using a multi-level knowledge graph and a three-stage heuristic planning process, the problems of inaccurate retrieval and high latency in tool scheduling are solved, achieving efficient and reliable tool scheduling and generating logically correct workflows.
Patent Information
- Application Number
- CN202611200808.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-07
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies lack awareness of the input-output topology between tools during tool scheduling, resulting in inaccurate retrieval, I/O incompatibility, low planning reliability, and high planning latency, failing to meet the high efficiency and reliability requirements of complex tasks.
A multi-level knowledge graph and a three-stage heuristic planning process are adopted. By constructing a multi-level knowledge graph and a three-stage heuristic planning process, combined with semantic retrieval and heuristic search of the multi-level knowledge graph, tool scheduling data is generated to ensure I/O reliability and flexibility.
It enables the rapid filtering and generation of logically correct workflows from a massive tool library, improving the efficiency and reliability of tool scheduling and solving the problems of short-sightedness and high latency in the planning process.
Smart Images

Figure CN123114571A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of tool scheduling, and in particular to a tool scheduling method, apparatus and equipment. Background Technology
[0002] The intelligent tool scheduling task aims to automatically analyze users' complex scientific research or operational needs through algorithms, and intelligently select, orchestrate, and combine multiple tools from a massive, heterogeneous software tool library to generate a logically sound, automatically executable workflow. This task has significant application value in fields such as bioinformatics, chemical computation, and data science automation.
[0003] When scheduling tools, related technologies often employ flat or single-semantic knowledge bases, lacking a dual understanding of the "input-output topology" and "functional semantics" between tools. This results in low and inaccurate macroscopic retrieval efficiency. During the planning and generation phase, these technologies rely on LLM (Large Language Model) planning, which suffers from I / O (Input / Output) incompatibility due to the "illusion" problem, leading to low planning reliability and a high failure rate. Alternatively, they rely on graph search algorithms, resulting in high maintenance costs and an inability to flexibly combine new tools. Another related technology uses a hybrid planning mode, a sequential "step-by-step" interaction, which suffers from "shortsightedness" (i.e., inability to foresee the impact of locally optimal choices on the global picture) and extremely high planning latency. Summary of the Invention
[0004] The embodiments of this application aim to at least partially solve one of the technical problems in the related art. Therefore, the purpose of the embodiments of this application is to provide a tool scheduling method, apparatus, device, and medium that improves the reliability and efficiency of tool scheduling.
[0005] This application provides a tool scheduling method, comprising: acquiring a query task and parsing the query task to generate a query object, wherein the query object includes a query vector, query constraints, an initial format, and a target format; acquiring a pre-established multi-level knowledge graph and the corresponding vector index of the multi-level knowledge graph; performing semantic retrieval on the vector index based on the query vector to determine the target community of the multi-level knowledge graph; and performing search processing based on the target community, query vector, query constraints, vector index, and multi-level knowledge graph to generate tool scheduling data.
[0006] For example, the multi-level knowledge graph includes a first level, a second level, a third level, and a fourth level. The multi-level knowledge graph is built based on the following method: acquiring tool data; extracting and processing the tool data to determine the first, second, and third levels of the multi-level knowledge graph, wherein the third level includes multiple tool entities, the second level includes the format link relationships of each tool entity, the format link relationships include a first association relationship representing the input format of each tool entity, and a second association relationship representing the output format of each tool entity, and the first level includes the constraint attributes of each tool entity; performing multi-dimensional clustering processing on the multiple tool entities based on the format link relationships to determine the fourth level, wherein the fourth level includes multiple communities, and each community includes multiple tool entities; generating a community summary for each community based on the functional description data and keyword data corresponding to the tool entities within each community.
[0007] For example, the vector index corresponding to the multi-level knowledge graph includes the description vector corresponding to the tool entity; multi-dimensional clustering is performed on multiple tool entities based on the format link relationship to determine the fourth level, including: calculating the matching degree based on the first and second association relationships of multiple tool entities to obtain the topological score of any two tool entities; calculating the semantic similarity based on the description vectors of multiple tool entities to obtain the similarity of any two tool entities; performing a weighted calculation based on the topological score and similarity to determine the similarity matrix, and performing community detection on the similarity matrix to obtain multiple communities and the third association relationship between the tool entity and the community.
[0008] For example, the vector index corresponding to the multi-level knowledge graph also includes the summary vector corresponding to the community summary; semantic retrieval of the vector index based on the query vector to determine the target community of the multi-level knowledge graph includes: performing similarity calculation based on the summary vector and the query vector to obtain the similarity calculation result; selecting a preset number of communities corresponding to the similarity calculation results as the target community.
[0009] For example, the search process based on the target community, query vector, query constraints, vector index, and multi-level knowledge graph generates tool scheduling data, including: filtering based on the target community, query vector, query constraints, vector index, and multi-level knowledge graph to determine candidate tool entities and candidate subgraphs; starting from the target format, performing a heuristic search based on the candidate subgraphs and candidate tool entities to generate a heuristic map, wherein the heuristic map includes the distance value between the input format and the target format corresponding to each candidate tool entity; and performing a guided search based on the initial format, target format, candidate tool entities, and heuristic map to generate tool scheduling data.
[0010] For example, the selection of candidate tool entities and candidate subgraphs is carried out based on the target community, query vector, query constraints, vector index, and multi-level knowledge graph. This includes: calculating the similarity between the description vectors corresponding to the tool entities in the target community based on the query vector to determine the initial tool entities; selecting the initial tool entities based on the constraint attributes of the tool entities to obtain candidate tool entities; and obtaining candidate subgraphs based on the candidate tool entities and their corresponding format link relationships.
[0011] For example, starting with the target format, a heuristic search is performed based on candidate subgraphs and candidate tool entities to generate a heuristic map, including: using the target format as the initial search node of a circular queue, setting the distance value as an initial value, and saving the target format and the corresponding distance value to the heuristic map; based on the format linking relationship of the candidate subgraphs, using candidate tool entities whose output format is the current input format of the circular queue as predecessor tools; obtaining the input format corresponding to each predecessor tool; if the input format of at least one predecessor tool is not stored in the heuristic map, adding the input format of the corresponding predecessor tool to the circular queue, setting the distance value of the corresponding input format to the sum of the initial value and the preset value, and adding the corresponding input format and the distance value of the corresponding input format to the heuristic map.
[0012] For example, guided search based on initial format, target format, candidate tool entities, and heuristic map to generate tool scheduling data includes: when the initial format does not contain the target format, using the initial format as the current format, and determining the target tool entity of the candidate tool entities based on the current format; performing batch search based on the target tool entity, the output format of the target tool entity, and the distance value of the output format to generate tool scheduling sub-data; if the tool scheduling sub-data passes verification, using the tool scheduling sub-data as the tool scheduling data of the current format, and using the output format corresponding to the end of the tool scheduling sub-data as the current format, or if the tool scheduling sub-data fails verification, performing batch search again based on the target tool entity, the output format of the target tool entity, and the distance value of the output format, until the initial format includes the target format or the batch search reaches a preset number of times, and then outputting the tool scheduling data.
[0013] Another embodiment of this application provides a tool scheduling device, which includes: a parsing module for acquiring query tasks and parsing the query tasks to generate query objects, wherein the query objects include query vectors, query constraints, an initial format, and a target format; an acquisition module for acquiring a pre-established multi-level knowledge graph and the corresponding vector indexes of the multi-level knowledge graph; a retrieval module for performing semantic retrieval on the vector indexes based on the query vectors to determine the target communities of the multi-level knowledge graph; and a search module for performing search processing based on the target communities, query vectors, query constraints, vector indexes, and the multi-level knowledge graph to generate tool scheduling data.
[0014] Another embodiment of this application provides an electronic device having a computer program stored thereon, which, when executed by a processor, implements the steps of the method of any of the above embodiments.
[0015] Another embodiment of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method of any of the above embodiments.
[0016] In the above embodiments, the tool scheduling method includes: acquiring a query task and parsing the query task to generate a query object, wherein the query object includes a query vector, query constraints, an initial format, and a target format; acquiring a pre-established multi-level knowledge graph and the corresponding vector index of the multi-level knowledge graph; performing semantic retrieval on the vector index based on the query vector to determine the target community of the multi-level knowledge graph; and performing search processing based on the target community, query vector, query constraints, vector index, and multi-level knowledge graph to generate tool scheduling data. By parsing query tasks, query objects containing query vectors, query constraints, initial formats, and target formats are generated. Combining a multi-level knowledge graph and its vector index, semantic retrieval using query vectors is used to locate target communities. Then, based on the target communities, query vectors, query constraints, vector indexes, and multi-level knowledge graph, search processing is carried out to generate tool scheduling data. Relying on the hierarchical retrieval architecture of the multi-level knowledge graph, semantic retrieval is used to locate target communities to achieve a large-scale coarse screening, effectively reducing the search scope. At the same time, semantic matching and query constraints are combined with query vectors to filter, taking into account user business needs and the hard conditions for tool operation, improving the accuracy of tool matching, thereby efficiently completing tool screening and scheduling data generation, and improving the overall efficiency of tool scheduling. Attached Figure Description
[0017] Figure 1 Flowchart of the tool scheduling method provided for the embodiments of this application; Figure 2 A flowchart of a multi-level knowledge graph construction method provided for embodiments of this application; Figure 3Flowchart of another tool scheduling method provided for embodiments of this application; Figure 4 A block diagram of a tool scheduling device provided for another embodiment of this application; Figure 5 A block diagram of an electronic device provided for another embodiment of this application. Detailed Implementation
[0018] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0019] The intelligent tool scheduling task aims to automatically analyze users' complex scientific research or operational needs through algorithms, and intelligently select, orchestrate, and combine multiple tools from a massive, heterogeneous software tool library to generate a logically sound, automatically executable workflow. This task has significant application value in fields such as bioinformatics, chemical computation, and data science automation.
[0020] Currently, most intelligent tool scheduling algorithms suffer from significant shortcomings in knowledge base organization and plan generation. On the one hand, a single, flat tool knowledge base relies solely on semantic similarity for retrieval, lacking awareness of the "input-output" topological relationships between tools. This leads to inaccurate macro-level retrieval, a noisy candidate tool set, and significantly increases the difficulty of subsequent planning. On the other hand, in the planning generation stage, over-reliance on the reasoning capabilities of large language models (LLMs) results in inherent "illusion" problems, often causing I / O format incompatibility in the generated toolchain, leading to low reliability and a high failure rate. Furthermore, existing step-by-step planning models lack a "global perspective," easily falling into the "short-sighted" trap of "local optima," while the sequential interaction mechanism of "one question per step" also results in extremely high planning delays. Consequently, in practical scientific research automation applications, existing frameworks cannot meet the high requirements of complex tasks for planning efficiency, reliability, and optimality.
[0021] The purpose of this application is to propose a tool scheduling method based on a multi-layer knowledge graph and a multi-stage screening intelligent tool scheduling framework. This method aims to solve the problem that existing technologies are unable to achieve "macro-level rapid screening" in a massive tool library while ensuring the I / O reliability and flexibility of "micro-level planning". It also solves the core technical problems of the planning process getting stuck in local optima due to "short-sightedness" and high latency due to serial interaction.
[0022] In view of this, this application provides a tool scheduling method that aims to solve the above problems by constructing a two-dimensional multi-layer knowledge graph and designing a three-stage heuristic planning process (stage 1: global analysis and coarse screening; stage 2: heuristic candidate retrieval; stage 3: batch guided generation). By deeply integrating the reliability of the multi-layer knowledge graph with the flexibility of LLM, it achieves rapid macro-level screening while ensuring the I / O reliability of micro-level planning, thereby solving the problems of "short-sightedness" and high latency in the planning process.
[0023] Figure 1 A flowchart illustrating the tool scheduling method provided for embodiments of this application.
[0024] like Figure 1 As shown, the tool scheduling method 100 provided in this application includes, for example, steps S110-S140.
[0025] Step S110: Obtain the query task and parse and process the query task to generate a query object, wherein the query object includes a query vector, query constraints, initial format and target format.
[0026] For example, a query task may include natural language input by the user, which is parsed and processed by a planner to obtain a query object (Global_Query_Object). The planner includes an LLM-based agent, where the initial format (Initial_Input_Formats) is the starting format parsed from the query task, the final format (Final_Target_Format) is the final target format parsed from the query task, the query constraints (Static_Constraints) are the constraints parsed from the query task, such as the runtime environment, runtime version, etc., and the query vector (Query_Vector) is obtained by parsing the LLM and encoding it by a vector embedding model.
[0027] Step S120: Obtain the pre-established multi-level knowledge graph and the corresponding vector index of the multi-level knowledge graph.
[0028] For example, a multi-level knowledge graph may have a first level (L1), a second level (L2), a third level (L3), and a fourth level (L4). The third level (L3) includes multiple tool entities, and the second level (L2) includes the format link relationships for each tool entity. These format link relationships include a first association representing the input format of each tool entity (e.g., (L3: tool entity) -- [HAS_INPUT] --> (L2: input format)) and a second association representing the output format of each tool entity (e.g., (L3: tool entity) -- [PRODUCES] --> (L2: input format)). The output format is as follows: The first level (L1) includes the constraint attributes of each tool entity, such as the tool's operating environment and version. The fourth level (L4) includes multiple communities, each with a corresponding community ID (Identifier). By extracting and processing the acquired tool data (such as collected metadata, including functions, versions, I / O, etc.), the first, second, and third levels of the multi-level knowledge graph can be determined. Based on the format link relationships, the tool entities are clustered in multiple dimensions to determine the fourth level and generate a community summary for each community. The vector index includes the summary vector corresponding to the community summary (the vector index corresponding to L4) and the description vector corresponding to the tool entity (the vector index corresponding to L3). The summary vector is obtained by vectorizing the community summary, and the description vector is obtained by vectorizing the functional description data and keyword data of each tool entity. The multi-level knowledge graph and its corresponding vector index are established and stored together in the offline stage for querying after a query task is obtained in the online stage.
[0029] Step S130: Perform semantic retrieval on the vector index based on the query vector to determine the target community of the multi-level knowledge graph.
[0030] For example, cosine similarity is calculated based on the summary vector and the query vector to obtain the similarity calculation result; a preset number of communities corresponding to the similarity calculation results are selected as target communities. The preset number is, for example, TOP-K. Taking K=2 as an example, the top 2 communities with the highest similarity calculation results are selected as target communities (Target_Communities).
[0031] Step S140 involves performing search processing based on the target community, query vector, query constraints, vector index, and multi-level knowledge graph to generate tool scheduling data.
[0032] For example, within the tool entities corresponding to the target community, the tool entities are filtered based on the query vector, query constraints, and the description vector of the tool entities to obtain candidate tool entities. Candidate subgraphs can be obtained based on the candidate entities and the second level of the corresponding multi-level knowledge graph. Starting from the target format, a heuristic search is performed based on the candidate subgraphs and candidate tool entities to obtain a heuristic map. The heuristic map includes the distance value (h(n)) between the input format and the target format corresponding to each candidate tool entity. Finally, a guided search is performed based on the initial format, target format, candidate tool entities, and heuristic map to obtain tool scheduling data.
[0033] In the above embodiments, query objects containing query vectors, query constraints, initial format, and target format are generated by parsing query tasks. Combined with a multi-level knowledge graph and its vector index, the target community is located using semantic retrieval of query vectors. Then, search processing is carried out based on the target community, query vectors, query constraints, vector index, and multi-level knowledge graph to generate tool scheduling data. Relying on the hierarchical retrieval architecture of the multi-level knowledge graph, the target community is first located through semantic retrieval to achieve a large-scale coarse screening, effectively reducing the search scope. At the same time, semantic matching and query constraints are combined with query vectors to achieve filtering, taking into account user business needs and the hard conditions for tool operation, improving the accuracy of tool matching, thereby efficiently completing tool screening and scheduling data generation, and improving the overall efficiency of tool scheduling.
[0034] In one example, the multi-level knowledge graph includes a first level, a second level, a third level, and a fourth level. The multi-level knowledge graph is constructed as follows: tool data is acquired; the tool data is extracted and processed to determine the first, second, and third levels of the multi-level knowledge graph. The third level includes multiple tool entities; the second level includes the format link relationships of each tool entity, including a first association relationship representing the input format of each tool entity and a second association relationship representing the output format of each tool entity; the first level includes the constraint attributes of each tool entity; multi-dimensional clustering is performed on the multiple tool entities based on the format link relationships to determine the fourth level, which includes multiple communities, each community containing multiple tool entities; and a community summary is generated for each community based on the functional description data and keyword data corresponding to the tool entities within each community.
[0035] Specifically, tool data (including functionality, I / O, version, etc.) is collected, L3 (tool entity) and L2 (format) entities are extracted, and L1 (constraint attributes) are defined. Strict I / O relationships (format linking relationships) are established between tools and formats. For example, the first association is: (L3: tool entity) -- [HAS_INPUT] --> (L2: input format); the second association is: (L3: tool entity) -- [PRODUCES] --> (L2: output format). Based on the format linking relationships, multiple tool entities are clustered in multiple dimensions to obtain multiple communities. These communities are used as the fourth level. LLM is used to analyze the functionality (functional description data and keyword data, where keyword data is functional description data) of all L3 tool entities within an L4 community, generating a high-level summary "community summary". This community summary is stored as an attribute on the L4 node.
[0036] The definitions of each level of the multi-level knowledge graph are as follows: (1) L4: Community Layer, automatically generated macroscopic "tool function cluster" through the "two-dimensional clustering" algorithm. Attributes include community_summary (used for L4 coarse screening). (2) L3: Tool Layer, including core tool entities. (3) L2: Format Layer, standardized data format, exists as an independent node, serves as the anchor point for L3-L2 I / O links, and is the basis for reliability planning and heuristic computing. (4) L1: Attribute Layer, static attributes (constraint attributes) of tool entities, exist as attributes of L3 tool nodes. Attribute example: constraints:[environment:Python, auth:free], version: 3.9+, used for attribute filtering in the "heuristic candidate retrieval" stage.
[0037] In one example, the vector index corresponding to the multi-level knowledge graph includes the description vector corresponding to the tool entity; multi-dimensional clustering is performed on multiple tool entities based on the format link relationship to determine the fourth level, including: calculating the matching degree based on the first and second association relationships of multiple tool entities to obtain the topological score of any two tool entities; calculating the semantic similarity based on the description vectors of multiple tool entities to obtain the similarity of any two tool entities; performing a weighted calculation based on the topological score and similarity to determine the similarity matrix, and performing community detection on the similarity matrix to obtain multiple communities and the third association relationship between the tool entity and the community.
[0038] Specifically, multi-dimensional clustering processing includes two dimensions, such as matching degree and semantic similarity. For matching degree, based on L3-L2 links (format link relationships), the "input-output matching degree" between tool entities is calculated (e.g., if Tool_A's PRODUCES (output format) and Tool_B's HAS_INPUT (input format) completely match, then the A->B topology score is 1). The L3 tool entity description vector is obtained by vectorizing the corresponding functional description data and keyword data. The cosine similarity between any two tool entities is calculated to obtain their similarity. Based on the obtained topology score and similarity, a weighted algorithm is used for weighted calculation; for example, a fusion score of 0.5. Topology score +0.5 Semantic scores, obtained from multiple fusion scores of various tool entities, yield a Tool-Tool similarity matrix. This similarity matrix is then used to run a community detection algorithm (such as Louvain) to generate L4 communities and third-party associations. Each community can include multiple tool entities. The third-party association, for example, is an L4-L3 link: (L3: Tool Entity) -- [BELONGS_TO] --> (L4: Community), which indicates which community (BELONGS_TO) a tool entity belongs to.
[0039] Figure 2 A flowchart of a multi-level knowledge graph construction method provided for the implementation of this application is shown below. Figure 2 As shown, the multi-level knowledge graph construction method 200 includes steps S201-S204, for example.
[0040] Step S201: Obtain tool data.
[0041] For example, tool data is collected, which includes features, I / O, version, etc.
[0042] Step S202: Extract data from the tool data.
[0043] For example, extract the L3 (tool entity) and L2 (format) entities, and define L1 (constraint attribute).
[0044] Step S203: Construct a hierarchical knowledge graph (first level, second level, third level) and a hierarchical vector index (description vector).
[0045] For example, a basic graph is constructed based on L3, L2, and L1, strictly establishing the I / O relationships (format linking relationships) between tools and formats. For instance, the first association is: (L3: Tool entity) -- [HAS_INPUT] --> (L2: Input format); the second association is: (L3: Tool entity) -- [PRODUCES] --> (L2: Output format). Vectorization of the functional description data and keyword data of the L3 tool entities yields a description vector (L3 hierarchical index).
[0046] Step S204: Construct a hierarchical knowledge graph (fourth level) and a hierarchical vector index (summary vector) to obtain a multi-level knowledge graph.
[0047] For example, the cosine similarity (semantic relationship) between any two tool entities can be calculated based on the description vector to obtain the similarity between any two tool entities. Based on L3-L2 links (formatted link relationships), the "input-output matching degree" (topological relationship) between tool entities is calculated to obtain a topological score. Based on the obtained topological score and similarity, a weighted algorithm is used to perform weighted calculation. Based on multiple fusion scores obtained from multiple tool entities, a Tool-Tool similarity matrix can be obtained. Then, a community detection algorithm (such as Louvain) is run on the similarity matrix to perform fusion clustering to identify L4 communities, generate L4 communities and third association relationships, update the hierarchical knowledge graph based on L4 communities and third association relationships, construct L4 level nodes, and obtain a multi-level knowledge graph. Each community can include multiple tool entities. Using LLM to analyze the functions of all L3 tool entities within an L4 community, a high-level general "community summary" (L4 level summary) is generated. By vectorizing the community summary, a summary vector (L4 level summary index) is obtained.
[0048] After acquiring the query task in the online phase, a real-time three-stage planning process is initiated. This process is completed collaboratively by two core modules: Planner: An LLM-based intelligent agent responsible for high-level logical reasoning, intent parsing, and batch decision-making. Navigator: A deterministic algorithm module (non-LLM) that encapsulates all operations on the multi-level knowledge graph, responsible for performing "fact checking," "path calculation," and "contextual prediction," providing decision support for the Planner.
[0049] In one example, the vector index corresponding to the multi-level knowledge graph also includes the summary vector corresponding to the community summary; semantic retrieval of the vector index based on the query vector to determine the target community of the multi-level knowledge graph includes: calculating similarity based on the summary vector and the query vector to obtain the similarity calculation result; selecting a preset number of communities corresponding to the similarity calculation results as the target community.
[0050] Specifically, cosine similarity is calculated based on the summary vector and the query vector to obtain the similarity calculation result; a preset number of communities corresponding to the similarity calculation results are selected as target communities, such as TOP-K. Taking K=2 as an example, the top 2 communities with the highest similarity calculation results are selected as target communities (Target_Communities). Each target community has a corresponding community ID (Identifier).
[0051] In the above embodiments, by calculating the similarity between the query vector and the summary vector obtained from a comprehensive analysis of the user query, the target community can be quickly identified, thereby narrowing the search scope.
[0052] In one example, search processing based on the target community, query vector, query constraints, vector index, and multi-level knowledge graph is performed to generate tool scheduling data. This includes: filtering based on the target community, query vector, query constraints, vector index, and multi-level knowledge graph to determine candidate tool entities and candidate subgraphs; starting from the target format, heuristic search is performed based on the candidate subgraphs and candidate tool entities to generate a heuristic map, where the heuristic map includes the distance value between the input format and the target format corresponding to each candidate tool entity; and guided search is performed based on the initial format, target format, candidate tool entities, and heuristic map to generate tool scheduling data.
[0053] Specifically, within the tool entities corresponding to the target community, the tool entities are filtered based on the query vector, query constraints, and the description vector of the tool entities to obtain candidate tool entities. Based on the candidate entities and the second level of the corresponding multi-level knowledge graph, candidate subgraphs can be obtained. Starting from the target format, a heuristic search is performed based on the candidate subgraphs and candidate tool entities to obtain a heuristic map. The heuristic map includes the distance value (h(n)) between the input format and the target format corresponding to each candidate tool entity. Finally, guided search is performed based on the initial format, target format, candidate tool entities, and heuristic map to obtain tool scheduling data.
[0054] In one example, a filtering process is performed based on the target community, query vector, query constraints, vector index, and multi-level knowledge graph to determine candidate tool entities and candidate subgraphs. This includes: calculating the similarity between the description vectors corresponding to tool entities within the target community based on the query vector to determine the initial tool entities; filtering the initial tool entities based on the constraint attributes of the tool entities to obtain candidate tool entities; and obtaining candidate subgraphs based on the candidate tool entities and their corresponding format link relationships.
[0055] Specifically, within the target communities, the query vector is used to perform semantic retrieval on the description vectors corresponding to tool entities within the target communities. The top-N semantically relevant tool entities are determined as the initial tool entities (L3_Tool_ID_List) by calculating similarity. The Navigator module uses static constraints to filter the tool entities in the initial L3_Tool_ID_List to obtain candidate tool entities (Candidate_Pool). The Navigator then extracts these tool entities and their connected L2 format nodes (formatted link relationships) from the multi-level knowledge graph, resulting in a temporary candidate subgraph (Candidate_Subgraph).
[0056] In one example, starting with the target format, a heuristic search is performed based on candidate subgraphs and candidate tool entities to generate a heuristic map, including: using the target format as the initial search node of a circular queue, setting the distance value as an initial value, and saving the target format and the corresponding distance value to the heuristic map; based on the format linking relationship of the candidate subgraphs, using candidate tool entities whose output format is the current input format of the circular queue as predecessor tools; obtaining the input format corresponding to each predecessor tool; if the input format of at least one predecessor tool is not stored in the heuristic map, adding the input format of the corresponding predecessor tool to the circular queue, setting the distance value of the corresponding input format to the sum of the initial value and the preset value, and adding the corresponding input format and the distance value of the corresponding input format to the heuristic map.
[0057] Specifically, the heuristic search employs a reverse breadth-first search (RBFS) strategy. This strategy uses a FIFO (First In First Out) circular queue (Queue). The data structure includes a Heuristic Map (Dictionary) to store visited input formats and their distances (h(n) values); and a Queue (FIFO) to manage the input format nodes to be visited. The initial search node in the circular queue is the target format (Final_Target_Format) obtained from the query task, with the distance value distance = h(n) = 0 (initial value). After initialization, the data structure is Queue.push((Final_Target_Format, 0)) and Heuristic_Map[Final_Target_Format] = 0, using the target format as the current input format. When the Queue is not empty, candidate tool entities whose output format is the current input format of the circular queue are used as predecessor tools, such as the Navigator. In the Candidate_Subgraph, find all L3 tools (candidate tool entities) that have [PRODUCES] Current_Format. Use these candidate tool entities as predecessor tools, and add the input format corresponding to each predecessor tool to a circular queue. For example, for each found Tool (candidate tool entity), find all L2 input formats (Input_Format) with [HAS_INPUT] for that Tool. For each Input_Format, if it is not in the key of the Heuristic_Map (unvisited (new node)), store the corresponding predecessor tool's input format in the Heuristic_Map (Dictionary), record the distance from Heuristic_Map[Input_Format] = distance + 1, and add the corresponding predecessor tool's input format to the queue: Queue.push((Input_Format, distance + 1)). The loop continues until the input format corresponding to the corresponding predecessor tool is the initial format (Initial_Input_Formats), at which point the loop ends. The input formats added to the loop queue are traversed in a first-in-first-out order.
[0058] In the above embodiments, the target format is used as the starting point of the circular queue and the initial format is used as the ending point of the circular queue to obtain a heuristic map. The heuristic map includes key-value pairs of L2 input format → h(n) estimates, so that the minimum tool hops h(n) from each L2 input format node to the target format can be calculated based on the heuristic map.
[0059] In one example, a guided search is performed based on an initial format, a target format, candidate tool entities, and a heuristic map to generate tool scheduling data. This includes: when the initial format does not contain the target format, using the initial format as the current format, and determining the target tool entity of the candidate tool entities based on the current format; performing a batch search based on the target tool entity, the output format of the target tool entity, and the distance value of the output format to generate tool scheduling sub-data; if the tool scheduling sub-data passes verification, using the tool scheduling sub-data as the tool scheduling data of the current format, and using the output format corresponding to the end of the tool scheduling sub-data as the current format; or if the tool scheduling sub-data fails verification, performing a batch search again based on the target tool entity, the output format of the target tool entity, and the distance value of the output format, until the initial format includes the target format or the batch search reaches a preset number of times, and then outputting the tool scheduling data.
[0060] Specifically, using the initial format (Initial_Input_Formats) as the current format, it checks whether the target format (Final_Target_Format) is in the current format list. If it is, then the initial format is the target format, and the final toolchain (Final_Chain) is directly output. If not, the "navigator" (Validator) actively searches the heuristic map to find all candidate tool entities in the Candidate_Pool that can be satisfied by the initial format (Initial_Input_Formats), forming a list of usable tools (Verified_Usable_Tools) (target tool entities). For each target tool entity, its L2 output format is found, and the corresponding h(n) value (distance value) is retrieved from the Heuristic_Map, thereby generating a "smart menu" (containing [candidate tool entity, output format, remaining steps h(n)]). The planner performs batch heuristic decision-making (batch search) based on the smart menu. Receives the "smart menu" as context, and the LLM selects the optimal launch tool based on its "foresight" (h(n) value), and batch plans a 1-3 step sub-chain draft (Proposed_Sub_Chain) (tool scheduling sub-data). The "navigator" (Validator) receives the Proposed_Sub_Chain for batch validation and, against the heuristic map, checks the I / O (input and output format) compatibility of all L2 nodes within the sub-chain. If validation passes, the Proposed_Sub_Chain is added to the final toolchain (Final_Chain) (tool scheduling data). The final L2 output format of the sub-chain is updated to the current format for cyclic batch search; if validation fails, a failure message is reported to the planner, and the batch search is re-performed based on the target tool entity, the target tool entity's output format, and the distance value between the output formats (requiring the LLM to replan). When the goal is achieved (e.g., the initial format includes the target format) or the number of batch search loops is exceeded, the loop ends, and the output tool schedules data, thus achieving an efficient and reliable toolchain for generating "globally optimal" results.
[0061] The "Executor" receives (Final_Chain) and executes it sequentially, providing a closed-loop feedback loop. For example, when execution fails (e.g., due to version conflicts), it automatically extracts constraints and updates the L1 attributes of the corresponding L3 tool entities in the multi-level knowledge graph. Successful toolchain paths (e.g., Tool_A -> Tool_B) can be used to reverse-enhance the "topological relationship" weights in the multi-level knowledge graph, making the multi-level knowledge graph more accurate in the next offline reconstruction. Thus, by executing the toolchain, the multi-level knowledge graph achieves "self-healing" and "evolution."
[0062] Figure 3 Another tool scheduling method flowchart provided for the implementation of this application is shown below. Figure 3 As shown, the tool scheduling methods include S301-S305.
[0063] S301, Obtaining user information.
[0064] For example, user questions are used as query tasks to perform global analysis and coarse screening based on user questions.
[0065] S302, based on user questions, performs global analysis and preliminary screening to determine the target community.
[0066] For example, a pre-established multi-level knowledge graph and its corresponding vector indices (including summary vectors and description vectors) are obtained. A planner parses and processes the query task to obtain the query object (Global_Query_Object). The planner includes an LLM-based agent. The initial format (Initial_Input_Formats) is the starting format parsed from the query task, the final target format (Final_Target_Format) is the final target format parsed from the query task, and the static constraints (Static_Constraints) are the constraints parsed from the query task, such as the runtime environment and version. The query vector (Query_Vector) is obtained by parsing the LLM and encoding it using a vector embedding model. Cosine similarity (L4 vector retrieval) is calculated based on the summary vector and the query vector to obtain the similarity calculation result. A preset number of communities corresponding to the similarity calculation results are selected as target communities (locating communities in the multi-level knowledge graph). The preset number is, for example, TOP-K. Taking K=2 as an example, the top two communities with the highest similarity calculation results are selected as target communities.
[0067] S303, based on the target community, performs heuristic candidate retrieval and generates a heuristic map.
[0068] For example, within the target communities, L3 semantic retrieval is performed on the description vectors corresponding to tool entities within the target communities using query vectors. The top-N semantically relevant tool entities are determined as the initial tool entities (L3_Tool_ID_List) by calculating similarity. The Navigator module uses static constraints to filter the tool entities in the initial L3_Tool_ID_List to obtain candidate tool entities (Candidate_Pool). The Navigator extracts these tool entities and their connected L2 format nodes (formatted link relationships) from the multi-level knowledge graph, obtaining a temporary candidate subgraph (Candidate_Subgraph). Starting from the target format, a heuristic search is performed based on the candidate subgraph and candidate tool entities to obtain a heuristic map (Heuristic_Map).
[0069] S304 uses heuristic maps for batch guided generation and outputs the final toolchain.
[0070] For example, using the initial format (Initial_Input_Formats) as the current format, it checks whether the target format (Final_Target_Format) is in the current format list. If it is, it means that the initial format is the target format, and the final toolchain (Final_Chain) is directly output. If not, the "navigator" (Validator) actively searches the heuristic map to find all candidate tool entities in the Candidate_Pool that can be satisfied by the initial format (Initial_Input_Formats), forming a list of usable tools (Verified_Usable_Tools) (target tool entities). For each target tool entity, its L2 output format is found, and the corresponding h(n) value (distance value) is retrieved from the Heuristic_Map, thereby generating a "smart menu" (containing [candidate tool entity, output format, remaining steps h(n)]). The planner performs batch heuristic decision-making (batch heuristic search) based on the smart menu. Received as context, the LLM selects the optimal launch tool based on its "foresight" (h(n) value) and batch plans a 1-3 step sub-chain draft (Proposed_Sub_Chain) (tool scheduling sub-data). The "navigator" (Validator) receives the Proposed_Sub_Chain for batch validation and, referring to the heuristic map, checks the I / O (input and output formats) compatibility of all L2 nodes within the sub-chain. If validation passes, the Proposed_Sub_Chain is added to the final toolchain (Final_Chain) (tool scheduling data). The final L2 output format of the sub-chain is updated to the current format for cyclic batch search. If validation fails, a failure message is reported to the planner, and the batch search is re-performed based on the target tool entity, its output format, and the distance between the output formats (requiring the LLM to replan). When the goal is achieved (e.g., the initial format includes the target format) or the number of batch search loops is exceeded, the loop ends, and the tool scheduling data is output, thus achieving efficient and reliable generation of the "globally optimal" toolchain (final toolchain).
[0071] S305 executes the final toolchain and provides closed-loop feedback.
[0072] For example, the "Executor" receives the Final Chain, executes it sequentially, and outputs the execution results. It also performs a feedback loop; for instance, when execution fails (e.g., due to version conflicts), it automatically extracts constraints and updates the L1 attributes of the corresponding L3 tool entities in the multi-level knowledge graph. Successful toolchain paths (e.g., Tool_A -> Tool_B) can be used to reverse-enhance the weights of "topological relationships" in the multi-level knowledge graph, making it more accurate during the next offline reconstruction. Thus, by executing the toolchain, the multi-level knowledge graph achieves "self-healing" and "evolution."
[0073] In the above embodiments, the relevant technical problems are addressed by constructing a two-dimensional hierarchical graph and designing a three-stage heuristic planning process. "Two-dimensional community clustering" (integrating topology and semantics) and "hierarchical summarization" (L4) technology are utilized to solve the problem of inaccurate macroscopic retrieval. In the second stage, a "heuristic map" pre-computation is introduced to provide the planner with a "global view" to overcome the "short-sightedness" defect. Finally, through a "batch guided generation" mechanism (L3-L1), the "navigator" (Validator) proactively anticipates and provides "intelligent menus," and the LLM (Planner) makes batch proposals, which are then batch-verified by the graph using I / O. This framework aims to deeply integrate the reliability of the graph with the flexibility of the LLM, achieving rapid macroscopic screening while ensuring the I / O reliability of microscopic planning, thereby solving the "short-sightedness" and "high latency" problems in the planning process.
[0074] The tool scheduling method proposed in this application adopts the following: (1) a hierarchical graph construction mechanism: a collaborative clustering framework that integrates "input-output topology" (analyzing L3-L2 I / O links) and "functional semantics" (L3 tool vectors) to automatically generate L4 community layers and their hierarchical summaries. This mechanism realizes the structured organization of tool knowledge and solves the problem of inaccurate macro-retrieval and high recall noise caused by the lack of topology awareness in traditional flat knowledge bases. (2) a scheduling architecture based on three-stage heuristic planning: a planning process that combines "heuristic map pre-computation" and "batch guided generation" is designed. In the retrieval and map generation stages, the "heuristic estimate" (h(n)) of L2 format nodes is pre-computed through L4 community coarse screening and reverse graph search on L3 / L2 subgraphs, providing a "global view" for the planner. During the batch bootstrapping generation phase, the "Navigator" (Validator) proactively provides a "smart menu" with h(n), and the LLM (Planner) makes batch proposals and performs batch I / O verification by the graph to solve the problems of "short-sightedness", "high latency" and "I / O incompatibility" in traditional LLM planning.
[0075] Figure 4 A block diagram of a tool scheduling device provided in another embodiment of this application.
[0076] like Figure 4 As shown, another embodiment of this application provides a tool scheduling device 400, which includes: a parsing module 410, an acquisition module 420, a retrieval module 430, and a search module 440.
[0077] The parsing module 410 is used to obtain the query task, parse and process the query task, and generate a query object, wherein the query object includes a query vector, query constraints, initial format and target format; The acquisition module 420 is used to acquire a pre-established multi-level knowledge graph and the vector indexes corresponding to the multi-level knowledge graph; The retrieval module 430 is used to perform semantic retrieval on the vector index based on the query vector to determine the target community of the multi-level knowledge graph. Search module 440 is used to perform search processing based on target communities, query vectors, query constraints, vector indexes, and multi-level knowledge graphs to generate tool scheduling data.
[0078] For example, the multi-level knowledge graph includes a first level, a second level, a third level, and a fourth level. The multi-level knowledge graph is built based on the following method: acquiring tool data; extracting and processing the tool data to determine the first, second, and third levels of the multi-level knowledge graph, wherein the third level includes multiple tool entities, the second level includes the format link relationships of each tool entity, the format link relationships include a first association relationship representing the input format of each tool entity, and a second association relationship representing the output format of each tool entity, and the first level includes the constraint attributes of each tool entity; performing multi-dimensional clustering processing on the multiple tool entities based on the format link relationships to determine the fourth level, wherein the fourth level includes multiple communities, and each community includes multiple tool entities; generating a community summary for each community based on the functional description data and keyword data corresponding to the tool entities within each community.
[0079] For example, the vector index corresponding to the multi-level knowledge graph includes the description vector corresponding to the tool entity; multi-dimensional clustering is performed on multiple tool entities based on the format link relationship to determine the fourth level, including: calculating the matching degree based on the first and second association relationships of multiple tool entities to obtain the topological score of any two tool entities; calculating the semantic similarity based on the description vectors of multiple tool entities to obtain the similarity of any two tool entities; performing a weighted calculation based on the topological score and similarity to determine the similarity matrix, and performing community detection on the similarity matrix to obtain multiple communities and the third association relationship between the tool entity and the community.
[0080] For example, the vector index corresponding to the multi-level knowledge graph also includes the summary vector corresponding to the community summary; the retrieval module 430 is also used to perform similarity calculation based on the summary vector and the query vector to obtain the similarity calculation result; and select a preset number of communities corresponding to the similarity calculation results as the target community.
[0081] For example, the search module 440 is further configured to perform filtering based on the target community, query vector, query constraints, vector index, and multi-level knowledge graph to determine candidate tool entities and candidate subgraphs; starting from the target format, perform heuristic search based on the candidate subgraphs and candidate tool entities to generate a heuristic map, wherein the heuristic map includes the distance value between the input format and the target format corresponding to each candidate tool entity; and perform guided search based on the initial format, target format, candidate tool entities, and heuristic map to generate tool scheduling data.
[0082] For example, the search module 440 is further configured to perform similarity calculation on the description vectors corresponding to tool entities within the target community based on the query vector to determine the initial tool entities; to perform filtering processing on the initial tool entities based on the constraint attributes of the tool entities to obtain candidate tool entities; and to obtain candidate subgraphs based on the candidate tool entities and their corresponding format link relationships.
[0083] For example, the search module 440 is further configured to use the target format as the initial search node of the circular queue, set the distance value as the initial value, and save the target format and the corresponding distance value to the heuristic map; based on the format linking relationship of the candidate subgraph, use the candidate tool entity whose output format is the current input format of the circular queue as the predecessor tool; obtain the input format corresponding to each predecessor tool; if the input format of at least one predecessor tool is not stored in the heuristic map, add the input format of the corresponding predecessor tool to the circular queue, set the distance value of the corresponding input format to the sum of the initial value and the preset value, and add the corresponding input format and the distance value of the corresponding input format to the heuristic map.
[0084] For example, the search module 440 is further configured to, when the initial format does not contain the target format, use the initial format as the current format and determine the target tool entity of the candidate tool entity based on the current format; perform a batch search based on the target tool entity, the output format of the target tool entity, and the distance value of the output format to generate tool scheduling sub-data; if the tool scheduling sub-data passes the verification, use the tool scheduling sub-data as the tool scheduling data of the current format and use the output format corresponding to the end of the tool scheduling sub-data as the current format; or if the tool scheduling sub-data fails the verification, perform a batch search again based on the target tool entity, the output format of the target tool entity, and the distance value of the output format until the initial format includes the target format or the batch search reaches a preset number of times, and then output the tool scheduling data.
[0085] Figure 5 A block diagram of an electronic device provided for another embodiment of this application.
[0086] Another embodiment of this application provides an electronic device having a computer program stored thereon, which, when executed by a processor, implements the steps of the method of any of the above embodiments.
[0087] like Figure 5 As shown, for ease of understanding, embodiments of this application illustrate a specific electronic device 500.
[0088] Electronic device 500 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0089] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. The RAM 503 may also store various programs and data required for the operation of the electronic device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0090] Multiple components in electronic device 500 are connected to input / output (I / O) interface 505. These components include: input unit 506, such as a keyboard or mouse; output unit 507, such as various types of displays or speakers; storage unit 508, such as a hard disk or optical disk; and communication unit 509, such as a network interface card (NIC), modem, or wireless transceiver. Communication unit 509 allows electronic device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0091] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods described above. For example, in some embodiments, any one or more of the various methods described above can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of any one or more of the various methods described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform any one or more of the various methods described above by any other suitable means (e.g., by means of firmware).
[0092] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method in any of the above embodiments.
[0093] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this application, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0094] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0095] In the description of this application, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this application, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0096] In the description of this application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicating the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0097] Furthermore, the terms "first," "second," etc., used in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying relative importance, or implicitly specifying the number of technical features indicated in this embodiment. Therefore, features defined with terms such as "first" and "second" in the embodiments of this application can explicitly or implicitly indicate that the embodiment includes at least one of those features. In the description of this application, the word "multiple" means at least two or more, such as two, three, four, etc., unless otherwise explicitly and specifically defined in the embodiments.
[0098] In this application, unless otherwise explicitly specified or limited in the embodiments, the terms "installation," "connection," "joining," and "fixing" appearing in the embodiments should be interpreted broadly. For example, a connection can be a fixed connection, a detachable connection, or an integral part; it can also be a mechanical connection, an electrical connection, etc. Of course, it can also be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication between two components, or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific implementation.
[0099] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0100] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A tool scheduling method, characterized in that, The method includes: Obtain a query task, parse and process the query task to generate a query object, wherein the query object includes a query vector, query constraints, an initial format, and a target format; Obtain a pre-established multi-level knowledge graph and the corresponding vector indexes of the multi-level knowledge graph; Based on the query vector, semantic retrieval is performed on the vector index to determine the target community of the multi-level knowledge graph; Search processing is performed based on the target community, the query vector, the query constraints, the vector index, and the multi-level knowledge graph to generate tool scheduling data.
2. The method according to claim 1, characterized in that, The multi-level knowledge graph includes a first level, a second level, a third level, and a fourth level; the multi-level knowledge graph is built based on the following method: Obtain tool data; The tool data is extracted and processed to determine the first, second, and third levels of the multi-level knowledge graph. The third level includes multiple tool entities, the second level includes the format linking relationship of each tool entity, the format linking relationship includes a first association relationship that characterizes the input format of each tool entity, and a second association relationship that characterizes the output format of each tool entity. The first level includes the constraint attributes of each tool entity. Based on the aforementioned link relationships, multiple tool entities are subjected to multi-dimensional clustering to determine a fourth level, wherein the fourth level includes multiple communities, and each community includes multiple tool entities; Based on the functional description data and keyword data corresponding to the tool entities within each community, a community summary is generated for each community.
3. The method according to claim 2, characterized in that, The vector index corresponding to the multi-level knowledge graph includes the description vector corresponding to the tool entity; the multi-dimensional clustering of multiple tool entities based on the format link relationship to determine the fourth level includes: The matching degree is calculated based on the first and second association relationships of multiple tool entities to obtain the topology score of any two tool entities; Semantic similarity is calculated based on the description vectors of multiple tool entities to obtain the similarity between any two tool entities; A similarity matrix is determined by weighted calculation based on the topology score and the similarity, and community detection is performed on the similarity matrix to obtain the multiple communities and the third association relationship between the tool entity and the community.
4. The method according to claim 2, characterized in that, The vector index corresponding to the multi-level knowledge graph also includes the summary vector corresponding to the community summary; the step of performing semantic retrieval on the vector index based on the query vector to determine the target community of the multi-level knowledge graph includes: Similarity is calculated based on the summary vector and the query vector to obtain the similarity calculation result; Select a preset number of communities corresponding to the similarity calculation results as target communities.
5. The method according to claim 3, characterized in that, The process of searching and processing based on the target community, the query vector, the query constraints, the vector index, and the multi-level knowledge graph to generate tool scheduling data includes: Based on the target community, the query vector, the query constraints, the vector index, and the multi-level knowledge graph, a filtering process is performed to determine candidate tool entities and candidate subgraphs; Starting from the target format, a heuristic search is performed based on the candidate subgraph and the candidate tool entity to generate a heuristic map, wherein the heuristic map includes the distance value between the input format corresponding to each candidate tool entity and the target format; Based on the initial format, the target format, the candidate tool entities, and the heuristic map, a guided search is performed to generate tool scheduling data.
6. The method according to claim 5, characterized in that, The process of filtering candidates based on the target community, the query vector, the query constraints, the vector index, and the multi-level knowledge graph to determine candidate tool entities and candidate subgraphs includes: Based on the query vector, the similarity of the description vectors corresponding to the tool entities in the target community is calculated to determine the initial tool entities; Based on the constraint attributes of the tool entity, the initial tool entity is filtered to obtain candidate tool entities; Based on the candidate tool entities and their corresponding format link relationships, the candidate subgraph is obtained.
7. The method according to claim 6, characterized in that, The step of generating a heuristic map by performing a heuristic search based on the candidate subgraph and the candidate tool entities, starting from the target format, includes: The target format is used as the initial search node of the circular queue, the distance value is set as the initial value, and the target format and the corresponding distance value are saved to the heuristic map; Based on the format linking relationship of the candidate subgraph, the candidate tool entity whose output format is the current input format of the circular queue is used as the predecessor tool; Obtain the input format corresponding to each of the preceding tools; If the input format of at least one of the precursor tools is not stored in the heuristic map, the input format of the corresponding precursor tool is added to the circular queue, the distance value of the corresponding input format is set to the sum of the initial value and the preset value, and the corresponding input format and the distance value of the corresponding input format are added to the heuristic map.
8. The method according to claim 7, characterized in that, The process of guiding the search based on the initial format, the target format, the candidate tool entities, and the heuristic map to generate tool scheduling data includes: When the initial format does not contain the target format, the initial format is used as the current format, and the target tool entity of the candidate tool entity is determined based on the current format. Based on the target tool entity, the output format of the target tool entity, and the distance value of the output format, a batch search is performed to generate tool scheduling sub-data; If the tool scheduling sub-data passes verification, the tool scheduling sub-data is used as the current format tool scheduling data, and the output format corresponding to the end of the tool scheduling sub-data is used as the current format. Alternatively, if the tool scheduling sub-data fails verification, a batch search is performed again based on the target tool entity, the output format of the target tool entity, and the distance value of the output format until the initial format includes the target format or the batch search reaches a preset number of times, at which point the tool scheduling data is output.
9. A tool scheduling device, characterized in that, The device includes: The parsing module is used to obtain the query task, parse the query task, and generate a query object, wherein the query object includes a query vector, query constraints, an initial format, and a target format; The acquisition module is used to acquire a pre-established multi-level knowledge graph and the vector index corresponding to the multi-level knowledge graph; The retrieval module is used to perform semantic retrieval on the vector index based on the query vector to determine the target community of the multi-level knowledge graph; The search module is used to perform search processing based on the target community, the query vector, the query constraints, the vector index, and the multi-level knowledge graph to generate tool scheduling data.
10. An electronic device having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-8.
