CN-122019441-A - Method and device for determining target path, storage medium, electronic equipment and product
Abstract
The application discloses a method, a device, a storage medium, electronic equipment and a product for determining a target path, which relate to the technical field of cloud computing and comprise the steps of matching a plurality of interface nodes conforming to a query request from an interface knowledge graph, wherein the plurality of interface nodes have corresponding relations with a plurality of intents corresponding to the query request; the method comprises the steps of taking a plurality of interface nodes as starting points, presetting node depth as traversing scale, determining a plurality of expansion interface nodes with first dependency relations with the plurality of interface nodes from an interface knowledge graph, establishing a candidate subgraph based on the plurality of interface nodes, the plurality of expansion interface nodes and second dependency relations among the plurality of expansion interface nodes, counting a plurality of interface calling paths existing in the candidate subgraph, and determining a target path from the plurality of interface calling paths through a scoring model. The method solves the problems that the cloud management platform has huge interfaces, complex dependency relationship and inaccurate path planning caused by the fact that the traditional retrieval mode is difficult to accurately understand the intention of the user.
Inventors
- GUO LIMIN
- GUO TAO
- FENG ZHEN
- KONG WEITING
- LIU YUANSONG
- ZHANG XIAOWEI
Assignees
- 济南浪潮数据技术有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260410
Claims (20)
- 1. A method for determining a target path, comprising: Matching a plurality of interface nodes conforming to a query request from an interface knowledge graph, wherein the plurality of interface nodes have corresponding relations with a plurality of intents corresponding to the query request; Taking the plurality of interface nodes as starting points, presetting node depth as traversing scale, and determining a plurality of expansion interface nodes with first dependency relationship with the plurality of interface nodes from the interface knowledge graph; establishing a candidate subgraph based on the plurality of interface nodes, the plurality of expansion interface nodes and a second dependency relationship existing among the plurality of expansion interface nodes; And counting a plurality of interface calling paths existing in the candidate subgraph, and determining a target path from the plurality of interface calling paths through a scoring model.
- 2. The method for determining a target path according to claim 1, wherein matching a plurality of interface nodes conforming to a query request from an interface knowledge graph comprises: coding a plurality of intentions corresponding to the query request to obtain a first semantic vector; calculating the similarity between the first semantic vector and a second semantic vector corresponding to each interface node in the interface knowledge graph to obtain a plurality of similarity scores; Determining interface nodes with the similarity scores larger than a preset similarity threshold value as candidate interface nodes to obtain a plurality of candidate nodes; and reprocessing the candidate nodes based on a preset multi-dimensional screening strategy to obtain the interface nodes.
- 3. The method for determining a target path according to claim 2, wherein reprocessing the plurality of candidate nodes based on a preset multidimensional screening policy to obtain the plurality of interface nodes comprises: determining a plurality of keywords of a plurality of intentions corresponding to the query request and a plurality of service domain labels corresponding to a plurality of candidate nodes in the interface knowledge graph; counting business domain labels containing at least one keyword in the keywords to obtain a plurality of target labels; And determining the plurality of interface nodes based on the candidate nodes corresponding to the plurality of target labels.
- 4. The method for determining a target path according to claim 1, wherein before the plurality of interface nodes conforming to the query request are matched from the interface knowledge graph, the method further comprises: Extracting semantic entities in the query request under the condition that the query request is a request issued by a target object for the first time, and combining structural intention units based on the semantic entities, wherein each structural intention unit comprises an operation intention and interface input parameters corresponding to the operation intention; determining the combination quantity of the structured intention units, and counting the connection quantity of logic connection words for connecting a plurality of intents, wherein the connection quantity is contained in the query request; And determining the complexity level corresponding to the query request according to the combination quantity and the connection quantity, and selecting a path planning strategy corresponding to the complexity level.
- 5. The method for determining a target path according to claim 4, wherein determining the complexity level corresponding to the query request according to the number of combinations and the number of connections comprises: Under the condition that the combination quantity is not zero and the connection quantity is zero, determining that the query type corresponding to the query request is simple query; And under the condition that the combination number is not zero and the connection number is not zero, determining that the query type corresponding to the query request is complex query.
- 6. The method for determining a target path according to claim 1, wherein counting a plurality of interface call paths existing in the candidate subgraph and determining a target path from the plurality of interface call paths through a scoring model comprises: correspondingly extracting path parameters from the interface call paths according to a plurality of scoring factors in the scoring model to obtain a plurality of scoring parameter sets, wherein the scoring factors comprise semantic relativity, path cost, authority matching degree and parameter completeness; respectively carrying out weighted summation on the plurality of scoring parameter sets to obtain a plurality of scoring results; the target path is determined based on the plurality of scoring results.
- 7. The method of claim 6, wherein the path cost in the plurality of scoring factors is equal to a sum of a delay weight times an average delay of all interfaces on the path, plus a sum of a failure rate weight times a failure rate of all interfaces.
- 8. The method of determining a target path according to claim 6, wherein the weighting and summing the plurality of scoring parameter sets to obtain a plurality of scoring results respectively, includes: Determining a first weight corresponding to the semantic relevance parameter, a second weight corresponding to the path cost parameter, a third weight corresponding to the authority matching degree parameter and a fourth weight corresponding to the parameter completeness parameter in each scoring parameter set; Calculating a first product value of the semantic relatedness parameter and the first weight, a second product value of the path cost parameter and the second weight, a third product value of the authority matching degree parameter and the third weight, and a fourth product value of the parameter completeness parameter and the fourth weight; adding and summing the first product value, the second product value, the third product value and the fourth product value to obtain a scoring result corresponding to each scoring parameter set; Summarizing the scoring results corresponding to each scoring parameter set to obtain a plurality of scoring results.
- 9. The method of determining a target path according to claim 6, wherein determining the target path based on the plurality of scoring results comprises: The scoring values corresponding to the scoring results are ranked in size, and the largest scoring value in the ranking results is determined; And determining the interface calling path associated with the maximum scoring numerical value as the target path.
- 10. The method of determining a target path according to claim 9, wherein after determining the interface call path associated with the maximum score value as the target path, the method further comprises: acquiring an execution sequence and a dependency relationship among the target path nodes and parameter information to be set of each node; Converting the target path into a directed acyclic graph based on the execution sequence, the dependency relationship and the parameter information, and taking the directed acyclic graph as a target execution plan; And dispatching the execution interface call according to the target execution plan.
- 11. The method according to claim 10, wherein after converting the target path into a directed acyclic graph based on the execution order, the dependency relationship, and the parameter information, and taking the directed acyclic graph as a target execution plan, the method further comprises: performing parameter integrity verification on the target execution plan to obtain a verification result; And generating a question request according to the description information of the missing parameter in the interface knowledge graph under the condition that the verification result indicates that the missing parameter exists in the target execution plan, wherein the question request is used for requesting the target object to supplement the value of the missing parameter.
- 12. The method of claim 10, wherein after scheduling execution interface calls according to the target execution plan, the method further comprises: Under the condition that any interface in the target execution plan fails to call execution, inquiring a front node with a compensation relation with a failed node in the interface knowledge graph; And sequentially calling the compensation interfaces corresponding to the front nodes according to the reverse order of the target execution plan so as to restore to the state before the target execution plan is executed.
- 13. The method of claim 10, wherein prior to scheduling execution interface calls according to the target execution plan, the method further comprises: Generating unique idempotent keys for all writing operation nodes marked as non-idempotent in the target execution plan; binding the idempotent keys with corresponding interface calling parameters, execution time stamps and identity marks of target objects, and storing the idempotent keys in an idempotent key log library; and under the condition that the target object repeatedly initiates the same intention query in different sessions, identifying the history successful execution record by comparing the idempotent key log library, and directly returning the original execution result.
- 14. The method of determining a target path according to claim 1, further comprising: Acquiring context indicating information carried in the query request under the condition that the query request is a request issued by a target object for the second time, wherein the context indicating information is used for pointing to the operation intention in the first query request; Determining a new operation intention based on the context reference information and session semantic cache information corresponding to the context reference information, and executing sub-graph expansion on the new operation intention only in the interface knowledge graph.
- 15. The method for determining a target path according to claim 1, wherein before the plurality of interface nodes conforming to the corresponding intention of the query request are matched from the interface knowledge graph, the method further comprises: extracting a plurality of interface semantic nodes from an interface document of a cloud management platform; Constructing a semantic association edge based on business logic association and data dependency relationship among the plurality of interface semantic nodes, wherein the semantic association edge at least comprises one of a first semantic association edge for indicating the execution sequence of the interfaces, a second semantic association edge for indicating the parameter transfer paths among the interfaces and a third semantic association edge for indicating the corresponding relationship between the write operation interface and the inverse operation interface; And constructing the interface knowledge graph based on the interface semantic nodes and the semantic association edges.
- 16. The method of claim 15, wherein the interface knowledge-graph includes a hot update mechanism, the hot update mechanism including: under the condition that the cloud management platform interface document is detected to be changed, analyzing the changed interface document to obtain an analysis result; based on the analysis result, performing at least one of the following operations of adding, modifying and marking as abandoned on the corresponding interface nodes and semantic association sides in the interface knowledge graph; and establishing a version mapping relation corresponding to the new version node for the interface node marked as abandoned.
- 17. A target path determining apparatus, comprising: The matching module is used for matching a plurality of interface nodes conforming to the query request from the interface knowledge graph, wherein the plurality of interface nodes have corresponding relations with a plurality of intentions corresponding to the query request; The first determining module is used for determining a plurality of expansion interface nodes with a first dependency relationship with the plurality of interface nodes from the interface knowledge graph by taking the plurality of interface nodes as starting points and presetting node depth as traversing scale; The establishing module is used for establishing a candidate subgraph based on the plurality of interface nodes, the plurality of expansion interface nodes and a second dependency relationship existing among the plurality of expansion interface nodes; and the second determining module is used for counting a plurality of interface calling paths existing in the candidate subgraph and determining a target path from the plurality of interface calling paths through a scoring model.
- 18. An electronic device, comprising: A memory for storing a computer program; Processor for implementing the steps of the method for determining a target path according to any one of claims 1 to 16 when executing said computer program.
- 19. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program, wherein the computer program, when being executed by a processor, realizes the steps of the method of determining a target path according to any one of claims 1 to 16.
- 20. A computer program product comprising a computer program which, when executed by a processor, implements the steps of the method of determining a target path according to any one of claims 1 to 16.
Description
Method and device for determining target path, storage medium, electronic equipment and product Technical Field The embodiment of the application relates to the technical field of cloud computing, in particular to a method and a device for determining a target path, a storage medium, electronic equipment and products. Background In the automatic interface calling scheme of the existing cloud management platform, a document retrieval based on keyword matching or direct calling LLM (Large Language Model ) mode for 'tool selection' is generally adopted to respond to a user natural language instruction. The method relies on an API (Application Programming Interface ) document written manually, logical association among intents can not be understood only through a keyword coarse granularity matching interface, and complex tasks with multiple steps and parameter dependence are difficult to deal with, while the method introduces semantic understanding capability of a LLM large language model, but the programming process is generated for a disposable and unstructured black box, modeling capability of explicit dependency among APIs is lacking, a generated call sequence usually fails due to omission of front-end operation, incapability of transmitting parameters or violation of execution sequence, and a path evaluation and optimization mechanism is not provided, so that an optimal solution cannot be selected among multiple candidate schemes. Aiming at the problems that in the related technology, the cloud management platform has huge interfaces, complex dependency relationship and inaccurate path planning caused by the fact that the user intention is difficult to understand accurately in the traditional retrieval mode, no effective solution is proposed at present. Disclosure of Invention The embodiment of the application provides a method and a device for determining a target path, a storage medium, electronic equipment and products, and aims to at least solve the problems that in the related technology, the number of interfaces of a cloud management platform is huge, the dependency relationship is complex, the intention of a user is difficult to accurately understand in a traditional retrieval mode, and the path planning is inaccurate. According to one embodiment of the application, a method for determining a target path is provided, which comprises the steps of matching a plurality of interface nodes conforming to a query request from an interface knowledge graph, counting a plurality of interface call paths existing in the candidate subgraph by taking the plurality of interface nodes as a starting point and presetting node depth as a traversing scale, determining a plurality of expansion interface nodes with first dependency relations with the plurality of interface nodes from the interface knowledge graph, and establishing a candidate subgraph based on the plurality of interface nodes, the plurality of expansion interface nodes and second dependency relations among the plurality of expansion interface nodes, and determining the target path from the plurality of interface call paths through a scoring model. According to another embodiment of the application, a determining device of a target path is provided, which comprises a matching module, a first determining module, a building module and a second determining module, wherein the matching module is used for matching a plurality of interface nodes conforming to a query request from an interface knowledge graph, the plurality of interface nodes have corresponding relations with a plurality of intentions corresponding to the query request, the first determining module is used for taking the plurality of interface nodes as starting points and presetting node depth as traversing scales, determining a plurality of expansion interface nodes with a first dependency relation with the plurality of interface nodes from the interface knowledge graph, the building module is used for building a candidate subgraph based on the plurality of interface nodes, the plurality of expansion interface nodes and a second dependency relation among the plurality of expansion interface nodes, and the second determining module is used for counting a plurality of interface calling paths existing in the candidate subgraph and determining the target path from the plurality of interface calling paths through a scoring model. According to a further embodiment of the application, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run. According to a further embodiment of the application there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above. According to a further