A content intent based heterogeneous execution backend unified routing method and system

By performing synonym substring matching and capability priority decision-making within the unified access gateway, combined with queries from the main discovery service and the registry center, the routing problem of heterogeneous execution backends in the unified access gateway is solved, achieving efficient and reliable request routing and tenant authorization control.

CN123164046APending Publication Date: 2026-11-24DIGITAL CHINA FINANCIAL SOFTWARE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611337362.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In existing technologies, unified access gateways have difficulty determining the appropriate execution backend based on user request content. In particular, during the routing process between large language models, MCP tools, and intelligent agents, there are risks such as inaccurate intent recognition, excessive reliance on external models, request processing latency, and unauthorized calls. Furthermore, there is a lack of a unified authorization mechanism in multi-tenant scenarios.

Method used

By performing synonym substring matching and capability priority decision-making within the unified access gateway, combined with queries from the main discovery service and the registry center, unified routing for heterogeneous execution backends is achieved, reducing external network interactions and model inference. Tenant authorization scope verification and fallback mechanisms are adopted to ensure the availability and legitimacy of routing targets.

Benefits of technology

It improves the ability identification certainty and request processing continuity of heterogeneous execution backends, reduces the risk of external model dependence and unauthorized calls, and simplifies gateway management and request sending process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123164046A_ABST
    Figure CN123164046A_ABST
Patent Text Reader

Abstract

This invention discloses a unified routing method and system for heterogeneous execution backends based on content intent, relating to the field of network routing request technology. The method includes: a unified access gateway receiving messages and tenant credentials, extracting messages to be classified and obtaining the tenant's authorization scope; determining the optimal capability within the gateway process without calling a large model, based on synonym substring matching and capability priority from a capability definition table; obtaining the routing target according to a routing rule table; for agent targets, obtaining available instances through the main discovery service and the agent card registry of the registration center, and downgrading to the authorized model set when no available instances are found or authorization verification fails; generating a unified routing target object, and sending requests to a large language model, MCP tool, or agent according to the target type. Through the technical solution of this invention, automatic routing and unified distribution of heterogeneous execution backends are achieved, reducing external large model calls and improving the availability, authorization controllability, and processing efficiency of routing calls.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network routing request technology, and in particular to a unified routing method for heterogeneous execution backends based on content intent, a unified routing system for heterogeneous execution backends based on content intent, an electronic device, and a computer-readable storage medium. Background Technology

[0002] With the development of large language model applications, access gateways for these applications need to access not only the large language models themselves, but also tools provided by the Model Context Protocol (MCP) and agents capable of performing specific tasks. Large language models, MCP tools, and agents differ in service interfaces, target identifiers, instance organization methods, availability status, and invocation methods. The scope of models, MCP tools, and agents allowed for access may also differ between tenants. Therefore, a unified access gateway needs to determine the required execution capabilities based on the request content after receiving a user request and forward the request to the appropriate execution backend.

[0003] In existing technologies, unified access gateways typically forward requests based on model identifiers, service identifiers, or pre-configured fixed routes explicitly carried in the request. When the request is mainly expressed in the form of natural language messages and does not explicitly specify the execution backend, the gateway has difficulty determining the capabilities required by the user based on the message content. It may easily forward the request to a backend that does not match the user's intent, or require the client to adapt to different types of backend interfaces.

[0004] To achieve intent recognition based on request content, some solutions send user messages to external large models or other semantic analysis services for classification. This approach requires additional network communication and model inference, potentially increasing request processing latency and call costs, and impacting gateway routing when the external model service is unavailable. Other rule-based solutions based on keywords or synonyms typically determine routing capabilities according to single hits, first matches, or a fixed order. When a user message matches multiple capabilities simultaneously, it is difficult to consistently determine the optimal capability based on a unified matching result and priority.

[0005] Furthermore, when the routing target is an agent, existing gateways typically rely on a single service discovery method to obtain agent instances. When the service discovery interface does not return an available instance, it may be impossible to continue querying using other registration information, and there is a lack of a backup routing mechanism for situations where agents are unavailable, thus affecting the continuity of request processing. In multi-tenant scenarios, if the authorization verification of different types of execution backends is completed independently by each backend, or if permission judgment is performed only after the routing target is determined, there may be a risk of sending requests to unauthorized targets, and this may lead to inconsistent authorization processing logic in the gateway.

[0006] Therefore, existing technologies still lack a unified routing scheme for heterogeneous execution backends based on content intent, which can determine the required capabilities based on user messages without calling external large models for intent classification, and determine available and authorized routing targets among large language models, MCP tools and intelligent agents by combining tenant authorization scope and execution backend availability, and complete request sending in a unified routing target form. Summary of the Invention

[0007] To address the aforementioned issues, this invention provides a unified routing method, system, device, and storage medium for heterogeneous execution backends based on content intent. By employing a synonym substring matching, quantity scoring, and capability priority decision-making mechanism within the unified access gateway process without invoking external large models, it reduces external network interactions and model inference overhead during intent classification, improving the determinism of classification and routing results. By querying routing rules based on optimal capabilities and distinguishing between large language models, MCP tools, and agents, combined with hierarchical queries from the main discovery service and registry center, and authorization model rollback, it enhances the adaptability of heterogeneous execution backend selection and the continuity of requests when agents are unavailable. By performing unified authorization verification on the routing target to be verified based on the tenant's authorization scope before invocation, and performing authorization model rollback for unauthorized targets, it reduces the risk of unauthorized invocation. By generating a unified routing target object to complete unified sending for different types of backends, it simplifies gateway routing branches and backend access processing.

[0008] To achieve the above objectives, this invention provides a unified routing method for heterogeneous execution backends based on content intent, executed by a unified access gateway, comprising: Receive a request containing a message list and tenant credentials, extract user messages to be classified from the message list, and obtain the authorization scope of the current tenant based on the tenant credentials. The authorization scope includes an authorization model set, an authorization MCP tool set, and an authorization agent set. Within the unified access gateway process and without calling the large model during intent classification, for each capability in the capability definition table, the number of different synonyms appearing as substrings in the user message to be classified in the synonym list for that capability is counted, and the statistical result is determined as the score of that capability; when there are capabilities with scores greater than zero, the best capability is determined from the capabilities with scores greater than zero in descending order of scores, and in the case of the same scores, in descending order of capability priority; After determining the optimal capability, the routing rule table is queried according to the optimal capability to obtain the initial routing target corresponding to the optimal capability. The initial routing target includes an initial routing target type and an initial target identifier. Based on the initial routing target, a routing target to be verified is determined. The routing target to be verified includes a routing target type and a routing target identifier. Specifically: when the initial routing target type is a large language model or an MCP tool, the initial routing target is determined as the routing target to be verified; when the initial routing target type is an agent, based on the initial target identifier, available agent instances are first queried from the main discovery service, and if no available agent instances are found, available agent instances are then queried from the agent card registry in the registry center; if an available agent instance is found, the obtained available agent instance is determined as the routing target to be verified; if no available agent instance is found after the above queries, a large language model from the authorized model set is determined as the routing target to be verified. Before initiating a call to the execution backend, authorization verification is performed on the route target to be verified based on the route target type to be verified and the authorization scope; if the route target to be verified belongs to the authorization set corresponding to its route target type, the route target to be verified is determined as the final route target; if the route target to be verified does not belong to the authorization set corresponding to its route target type, a large language model in the authorization model set is determined as the final route target. Based on the final routing target, a unified routing target object is generated, including the final routing target type and the final target identifier. Based on the final routing target type in the unified routing target object, the request is sent to the large language model, MCP tool, or intelligent agent identified by the final target identifier in the unified routing target object.

[0009] In the above technical solution, preferably, the user message to be classified is the last user message in the message list; when the scores of each capability are all zero, a large language model in the authorization model set is determined as the final routing target.

[0010] In the above technical solution, preferably, the capability definition table includes multiple capability definition items arranged in a predetermined order, and each capability definition item includes a capability identifier, a list of synonyms, and a capability priority.

[0011] In the above technical solution, preferably, when there are two or more abilities with the same score and the same ability priority, the ability whose corresponding ability definition item is located at the first position in the predetermined order among the two or more abilities is determined as the best ability.

[0012] In the above technical solution, preferably, each capability in the capability definition table has a capability identifier; the routing rule table includes multiple routing rule entries, and each routing rule entry includes a capability identifier, a routing target type, and a target identifier; Based on the optimal capability, query the routing rule table, including: The system queries routing rule entries that match the capability identifier of the best capability, and uses the routing target type and target identifier in the queried routing rule entries as the initial routing target type and the initial target identifier, respectively.

[0013] In the above technical solution, preferably, obtaining the current tenant's authorization scope based on the tenant credentials includes: Based on the tenant credentials, query the authorization service to obtain the authorization model set, authorization MCP tool set, and authorization agent set corresponding to the current tenant; The authorization verification includes: Based on the type of the route target to be verified, select the corresponding authorization set from the authorization range, and determine whether the route target to be verified belongs to the selected authorization set.

[0014] In the above technical solution, preferably, the capability definition table and the routing rule table are provided by the configuration center, and the method further includes: In response to the configuration change notification from the configuration center, update the currently used capability definition table and routing rule table in the unified access gateway using an atomic replacement method.

[0015] This invention also proposes a unified routing system for heterogeneous execution backends based on content intent, including a unified access gateway, an authorization service, a master discovery service, a registration center, and multiple execution backends; the multiple execution backends include a large language model, an MCP tool, and an agent, and the registration center includes an agent card registry; The unified access gateway includes: The request processing unit is configured to receive a request containing a message list and tenant credentials, extract user messages to be classified from the message list, and obtain the authorization scope of the current tenant based on the tenant credentials. The authorization scope includes an authorization model set, an authorization MCP tool set, and an authorization agent set. The intent classification unit is used within the process of the unified access gateway, without calling the large model during the intent classification process, to count the number of different synonyms appearing as substrings in the user message to be classified for each capability in the capability definition table, and to determine the statistical result as the score of the capability; when there are capabilities with scores greater than zero, the best capability is determined from the capabilities with scores greater than zero in descending order of scores, and in the case of the same scores, in descending order of capability priority. An initial routing unit is used to query a routing rule table based on the optimal capability to obtain an initial routing target corresponding to the optimal capability. The initial routing target includes an initial routing target type and an initial target identifier. A routing target processing unit is configured to determine, based on the initial routing target, a routing target to be verified, including the type of the routing target to be verified and the identifier of the routing target to be verified, wherein: when the initial routing target type is a large language model or an MCP tool, the initial routing target is determined as the routing target to be verified; when the initial routing target type is an agent, based on the initial target identifier, an available agent instance is first queried from the main discovery service, and if no available agent instance is obtained, an available agent instance is then queried from the agent card registry; if an available agent instance is obtained, the obtained available agent instance is determined as the routing target to be verified; if no available agent instance is obtained after the above queries, a large language model from the authorized model set is determined as the routing target to be verified. An authorization verification unit is configured to perform authorization verification on the route target to be verified based on the route target type and the authorization scope before initiating a call to the execution backend; if the route target to be verified belongs to the authorization set corresponding to its route target type, the route target to be verified is determined as the final route target; if the route target to be verified does not belong to the authorization set corresponding to its route target type, a large language model from the authorization model set is determined as the final route target; and The request sending unit is configured to generate a unified routing target object including a final routing target type and a final target identifier based on the final routing target, and send the request to the large language model, MCP tool, or intelligent agent identified by the final target identifier in the unified routing target object according to the final routing target type in the unified routing target object.

[0016] The present invention also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the electronic device performs the content intent-based heterogeneous execution backend unified routing method disclosed in any of the above technical solutions.

[0017] The present invention also proposes a computer-readable storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, the processor executes any of the content intent-based heterogeneous execution backend unified routing methods disclosed in the above technical solutions.

[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) By performing capability identification within the unified access gateway process and not calling external large models during intent classification, substring matching is performed on the synonyms in the capability definition table, and capability scores are formed based on the number of hits of different synonyms. The best capability is then determined by combining capability priority. This reduces the overhead of external network interaction and model inference during intent classification, reduces the dependence on the availability of external model services, and improves the determinism and repeatability of capability identification and routing decisions.

[0019] (2) By querying the routing rule table based on the best capability, the initial routing target containing the routing target type and target identifier is obtained, and the large language model, MCP tool and intelligent agent are uniformly represented as routing target objects. It can perform consistent routing and request sending between heterogeneous execution backends based on user message content, reducing the need for clients to adapt to different backend interfaces and target formats separately, and facilitating the gateway to manage different types of execution backends in a unified manner.

[0020] (3) By first querying the main discovery service in the intelligent agent routing scenario, and then querying the intelligent agent card registry in the registry center when no available instance is obtained, and then falling back to the authorization model when no available instance is obtained, and performing unified authorization verification on the routing target to be verified according to the tenant's authorization scope before the call, and performing authorization model fallback on unauthorized targets, the risk of request failure caused by single discovery service failure or missing intelligent agent instance is reduced, and calls to the unauthorized execution backend are avoided, thereby enhancing multi-tenant access isolation and request processing continuity.

[0021] (4) By providing the capability definition table and routing rule table by the configuration center, and updating the corresponding data currently used by the unified access gateway in an atomic replacement manner when receiving the configuration change notification, the single configuration field is avoided to be in a partially written state during the update process, so that the updated configuration takes effect on subsequent requests, reducing the risk of routing anomalies caused by runtime configuration updates. Attached Figure Description

[0022] Figure 1 This is a schematic diagram of the system framework of a content intent-based heterogeneous execution backend unified routing method disclosed in an embodiment of the present invention. Figure 2 This is a schematic diagram of the routing process of a content intent-based heterogeneous execution backend unified routing method disclosed in one embodiment of the present invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0024] The present invention will now be described in further detail with reference to the accompanying drawings: like Figure 1 and Figure 2 As shown, this invention provides a unified routing method for heterogeneous execution backends based on content intent. This method operates on a unified access gateway for large language model applications. The unified access gateway, acting as the request entry point between upstream applications and the execution backend, can receive dialogue requests or completion requests. The execution backend includes a large language model, an MCP tool, and an intelligent agent. The large language model can handle dialogue generation, content generation, or vector processing tasks; the MCP tool can handle business queries, data processing, or report generation tasks; and the intelligent agent can sequentially execute multiple processing steps according to the task objectives.

[0025] The system receives a request containing a message list and tenant credentials. The message list may include one or more messages, from which the unified access gateway extracts the user message relevant to the intent classification. Tenant credentials are used to determine the tenant to which the request belongs and to obtain the set of authorized models, authorized MCP tools, and authorized agents that the tenant can access. The user message serves as input for content routing, while the authorized scope serves as the basis for subsequent routing target verification and degradation processing.

[0026] After obtaining the user message to be classified, intent classification is performed within the unified access gateway process. This intent classification process does not invoke the large language model, nor does it initiate network requests to external large model services. In one implementation, the user message to be classified can first be converted to lowercase form, and then the capabilities in the capability definition table can be traversed one by one. Each capability represents a type of business processing capability that can be matched by user intents, and is configured with a corresponding synonym list and capability priority.

[0027] For each capability, determine whether each synonym in its synonym list appears as a substring in the user message to be classified. Even if a synonym appears multiple times in the user message, it is only counted as one distinct synonym to achieve deduplication. The number of distinct synonyms appearing in the user message is used as the score for that capability. A score of zero indicates that no synonyms were matched for that capability; a score greater than zero indicates that the capability is included in the candidate range.

[0028] When one or more capabilities have scores greater than zero, the capabilities are first compared in descending order of score. If the scores are the same, they are then compared in descending order of priority to determine the best capability from the candidate capabilities. The above processing only involves string substring matching, integer accumulation, and integer comparison, which can be completed within the gateway process without consuming the inference computing power of the large language model.

[0029] After determining the optimal capability, the routing rule table is queried using the optimal capability as the query condition. The routing rule table establishes a mapping relationship between capabilities and routing targets. The query result is parsed into an initial routing target, which includes at least an initial routing target type and an initial target identifier. The initial routing target type is used to distinguish between large language models, MCP tools, and intelligent agents, while the initial target identifier is used to determine the specific execution object within the corresponding type.

[0030] When the initial route target type is a large language model or MCP tool, since the routing rule table already provides the corresponding target type and target identifier, the initial route target can be directly determined as the route target to be verified.

[0031] When the initial route target type is an agent, the system first queries the main discovery service for available agent instances based on the initial target identifier. If the main discovery service provides an available instance, it designates that instance as the route target to be verified. If the main discovery service does not provide an available agent instance, it then queries the agent card registry in the registry center based on the same initial target identifier. If the agent card registry provides an available agent instance, it designates that instance as the route target to be verified. If neither the main discovery service nor the agent card registry provides an available agent instance, a large language model is selected from the authorized model set as the route target to be verified. This establishes a hierarchical fallback relationship between the main discovery service, the agent card registry, and the authorized model set.

[0032] The route target to be verified includes the route target type and the target identifier. When an available agent instance is determined as the route target to be verified, its target type is agent, and its target identifier is used to identify the obtained available agent instance; when a large language model determined from the authorized model set is determined as the route target to be verified, its target type is large language model, and its target identifier is used to identify the selected large language model.

[0033] Before actually invoking the backend, based on the type of the route target to be verified, the corresponding authorization set is determined within the current tenant's authorization scope, and authorization verification is performed on the route target to be verified. If the route target to be verified belongs to the corresponding authorization set, it is determined as the final route target; if the route target to be verified does not belong to the corresponding authorization set, no request is sent to the unauthorized target, but instead a large language model is determined from the authorization model set as the final route target. Since the degradation target is taken from the current tenant's authorization model set, it avoids sending requests to the original unauthorized target.

[0034] After obtaining the final routing target, a unified routing target object is generated. The unified routing target object includes at least the final routing target type and the final target identifier, and uses the same data structure to carry the three types of execution backends: the large language model, the MCP tool, and the intelligent agent. In one implementation, the unified routing target object can be implemented as a regular object, an enumerated object, or an immutable object generated through a factory method. The above implementations only change the way the object is organized in the program; they do not change the final routing target type used to distinguish target categories or the final target identifier used to determine the specific backend.

[0035] Based on the final route target type in the unified routing target object, the appropriate invocation branch is selected, and the original request is sent to the large language model, MCP tool, or intelligent agent identified by the final target identifier. For upstream applications, regardless of the type of the actual backend being executed, a request can be initiated through the unified access gateway without the upstream application needing to determine again whether to invoke the model, tool, or intelligent agent.

[0036] In this implementation, intent classification is achieved by using synonym substring matching, deduplication counting, and capability priority comparison within the unified access gateway process, reducing additional large model inference and external network interactions during intent classification. By unifying the representation of the large language model, MCP tools, and agents, the same request processing chain can be routed to three types of heterogeneous execution backends. Through multi-level agent fallback and tenant authorization verification before invocation, the continuity of request processing when agents are unavailable is improved, and the risk of sending requests to unauthorized execution backends is reduced.

[0037] In the above embodiments, preferably, the message list can simultaneously include previous user messages, messages returned by the execution backend, and user messages of the current round. The unified access gateway determines the last user message from the message list and uses it as the user message to be classified. In one embodiment, the last appearing user message can be determined from the end of the message list backwards based on the message's order and message role. This allows intent classification to be tailored to the user's natural language input in the current round, without affecting the current routing decision due to earlier historical messages.

[0038] After obtaining the last user message, the score for each capability is calculated according to the aforementioned implementation method. If the last user message is empty, or if no synonym for any capability appears in it, then the score for each capability is zero. In this case, the optimal capability is not forcibly generated, nor is the routing rule table queried based on the non-existent optimal capability. Instead, a large language model is determined from the set of authorization models as the final routing target.

[0039] After using the large language model in the authorization model set as the final routing target, a unified routing target object is still generated according to the final routing target type and final target identifier, and a request is sent to the corresponding large language model. Therefore, for requests whose specific capabilities cannot be determined based on content, subsequent processing can still be completed along the unified routing chain.

[0040] In this implementation, by selecting the last user message in the message list, the routing decision can be made closer to the user's intent in the current round; by falling back to the authorization model set when all capability scores are zero, the interruption of request processing due to empty messages or no synonym match is avoided, while ensuring that the fallback target is within the authorization range of the current tenant.

[0041] In the above embodiments, preferably, the capability definition table includes multiple capability definition items arranged in a predetermined order. Each capability definition item corresponds to a capability and includes a capability identifier, a synonym list, and a capability priority. The capability identifier is used to distinguish different business capabilities; the synonym list is used to store one or more strings that can characterize the capability; and the capability priority is used to provide further comparison criteria when multiple capabilities have the same score.

[0042] To illustrate the scoring process, we can denote the user message to be categorized (converted to lowercase) as q, and the set of all capabilities as: C = {c1, c2, ..., c} N}, Among them, c i Let c represent the i-th ability, i=1,2,…,N; i The list of synonyms is denoted as S. i , will ability c i The ability priority is denoted as p i , will ability c i The score is denoted as σ. i Ability priority p i Positive integers can be used. In one configuration method, when the priority of each capability is not set individually, the default value of 10 can be used.

[0043] Ability C i The score is 1 when the synonym 's' appears as a substring in the user message 'q', and 0 otherwise. For S...i By performing a judgment on each different synonym in the equation and summing the results, the ability score σ in non-negative integer form can be obtained. i .

[0044] This score is not the total number of times a synonym appears in the user message. For example, if the same synonym appears multiple times in the user message, the corresponding indicator function will still only take one 1; if two different synonyms from the synonym list both appear in the user message, they will be scored separately. This reduces the excessive influence of repeated occurrences of a single word on the ability score.

[0045] The predetermined order of capability definition items in the capability definition table also provides a stable order for capability traversal and configuration management. When adding a new capability, a new capability definition item can be added; when adjusting the expression scope of a certain business capability, the synonym list of that capability definition item can be modified; when it is necessary to change the business orientation among capabilities of the same type, the capability priority can be adjusted.

[0046] In this implementation, by organizing capability identifiers, synonym lists, and capability priorities into capability definition items, natural language content can be converted into comparable non-negative integer scores. By deduplicating different synonyms, the impact of repeated occurrences of a single word on the classification results is reduced, and the classification results can be repeatedly obtained from the same input and the same capability definition table.

[0047] In the above implementation, preferably, after scoring each capability, capabilities with scores greater than zero are formed into a candidate set. Within the candidate set, capabilities are first ranked based on their scores σ. i As the primary comparison variable, and then with capability priority p i As a secondary comparison quantity.

[0048] First, compare the scores of each candidate ability, and give priority to the ability with the higher score; when two or more abilities have the same score, then compare the priority of the corresponding abilities, and give priority to the ability with the higher priority.

[0049] If two or more abilities have the same score and priority, a third-level arbitration is performed based on the predetermined order of the corresponding ability definitions in the ability definition table, selecting the ability at the beginning of the predetermined order as the best ability. For example, when traversing the ability definition table, the currently determined best ability can be retained; when encountering a subsequent ability with the same score and priority as the current best ability, the current best ability is not replaced, thus naturally retaining the ability that appears earlier in the predetermined order.

[0050] In this implementation, by using a hierarchical arbitration relationship of scoring, capability priority, and predetermined order, a unique best capability can still be determined even when multiple capabilities are hit simultaneously and have the same score and priority. This avoids unstable routing results due to different set traversal methods or operating environments, and improves the certainty and repeatability of intent classification.

[0051] In the above embodiments, preferably, each capability in the capability definition table has a capability identifier. The routing rule table includes multiple routing rule entries, each of which includes a capability identifier, a routing target type, and a target identifier. The capability identifier serves as the association field between the capability definition table and the routing rule table, enabling the best capability obtained from intent classification to be converted into a specific routing target.

[0052] After determining the optimal capability, obtain the capability identifier of that optimal capability and search the routing rule table for routing rule entries with the same capability identifier. Once a matching routing rule entry is found, use its routing target type as the initial routing target type and its target identifier as the initial target identifier, thus forming the initial routing target.

[0053] When the route target type is a large language model, the target identifier can be the model name to determine the specific model to be invoked; when the route target type is an MCP tool, the target identifier can be a combination of "service name / tool ​​name" to simultaneously determine the service providing the tool and the specific tool within that service; when the route target type is an agent, the target identifier can be the agent's capability identifier to facilitate the subsequent discovery of available agent instances.

[0054] "Service name / tool ​​name" is just one implementation of the MCP tool target identifier. In other implementations, other reversible encoding methods that can reconstruct the target service and target tool can also be used. Regardless of the encoding used, as long as the target identifier enables the unified access gateway to determine the corresponding execution object, it can be used to construct the routing target.

[0055] At the program implementation level, the initial route target, the route target to be verified, and the final route target can use the same basic data structure, and the target type or target identifier within them can be updated at different processing stages. The final unified route target object can be a regular object, an enumeration object, or an immutable object created through a factory method. All implementations use the target type and target identifier as the basic information for uniformly representing the three types of heterogeneous execution backends.

[0056] In this implementation, the capability definition table and the routing rule table are linked by capability identifiers, and the natural language classification results are converted into clear target types and target identifiers. By adopting a unified target representation form for the model, MCP tool and agent, subsequent authorization verification and request sending can process unified data objects, reducing the need to set up independent routing data structures for different backends.

[0057] In the above embodiments, preferably, the tenant credential can be the application key provided by the tenant when accessing the unified access gateway. The authorization service stores or can query the execution backend authorization information corresponding to each tenant. The unified access gateway initiates a query to the authorization service based on the tenant credential carried in the request. The authorization service verifies the tenant credential and returns the set of authorization models, the set of authorization MCP tools, and the set of authorization agents corresponding to the current tenant.

[0058] The authorized model set records the large language models that the current tenant is allowed to access; the authorized MCP tool set records the MCP tools that the current tenant is allowed to invoke; and the authorized agent set records the agents that the current tenant is allowed to invoke. These three sets together constitute the authorization scope of the current request and are used for authorization verification after intent classification, routing rule lookup, and agent instance lookup are completed.

[0059] Authorization verification occurs before the call to the execution backend is initiated. First, the appropriate authorization set is selected based on the type of the route target to be verified: if the route target type is a large language model, the authorization model set is selected; if it is an MCP tool, the authorization MCP tool set is selected; if it is an agent, the authorization agent set is selected. Then, it is determined whether the route target to be verified belongs to the selected authorization set. In a specific implementation, the identifier of the route target to be verified can be matched with the identifiers of targets in the corresponding authorization sets to determine the set affiliation of the route target to be verified.

[0060] If the target to be verified belongs to the corresponding authorization set, it indicates that the current tenant is allowed to access that target, and therefore the target to be verified is determined as the final route target. If the target to be verified does not belong to the corresponding authorization set, the request is not sent to that target. Instead, a large language model is determined from the current tenant's authorization model set as the final route target. Since this degradation model is directly selected from the authorization model set, it can maintain request processing while avoiding the continued use of the original unauthorized target.

[0061] The aforementioned authorization verification is set within a unified routing chain, rather than using separate permission processing logic on different execution backends. This ensures that regardless of whether the intent classification result ultimately points to a model, the MCP tool, or an agent, it undergoes the same authorization process before the actual invocation.

[0062] In this implementation, the authorization set corresponding to the three types of execution backends is obtained through the tenant credentials, and the corresponding authorization set is selected to complete the verification based on the type of the route target to be verified, so that the content routing result is constrained by the tenant's authorization scope; by automatically falling back to the authorization model set when the target is not authorized, the risk of unauthorized calls caused by the intent classification result pointing to the unauthorized backend is reduced, and the three types of backends adopt a consistent permission processing entry.

[0063] In the above implementation, preferably, the capability definition table and the routing rule table are provided by the configuration center. The capability definition table carries synonyms and capability priorities for each capability, and the routing rule table carries the mapping between capabilities and routing targets. During operation, the unified access gateway uses the currently effective capability definition table to complete intent classification and uses the currently effective routing rule table to determine the initial routing target.

[0064] The configuration center can push configuration change notifications to the unified access gateway. When operators add capabilities, modify synonyms, adjust capability priorities, or change the routing targets corresponding to capabilities, they can modify the corresponding configurations in the configuration center and trigger configuration change notifications without stopping or restarting the unified access gateway.

[0065] After receiving a configuration change notification, the unified access gateway retrieves the revised capability definition table and routing rule table, and updates the corresponding data currently in use using atomic field replacement. Atomic field replacement means that when a current configuration field changes from an old value to a new value, the replacement is completed in a single, indivisible action, preventing subsequent requests from reading an intermediate state consisting of parts of the old and parts of the new fields.

[0066] After the atomic replacement is completed, the next request entering the intent classification and routing decision process is processed according to the updated capability definition table and routing rule table. It should be noted that this implementation method is limited to the atomic replacement of relevant configuration fields and does not require setting up cross-table version snapshots or additional version consistency control mechanisms.

[0067] In this implementation, by using configuration center push and atomic field replacement, capabilities, synonyms, priorities, and routing targets can be updated during the operation of the unified access gateway and take effect on subsequent requests, reducing the gateway restarts required for configuration adjustments; atomic replacement can prevent a single configuration field from being in a partially written state during the update process, thereby reducing the risk of routing anomalies caused by runtime configuration updates.

[0068] In the above implementation, when no available agent instance is available, or the route target to be verified fails the authorization verification, the unified access gateway determines a large language model from the authorized model set as the downgraded route target. In other implementations, the above downgrade process can also downgrade to a fallback agent, or return a suggestive fallback response.

[0069] This implementation only changes the processing result after routing failure, without altering the intent classification, optimal capability determination, routing rule query, and authorization verification processes in the aforementioned implementations. Specifically, the unified access gateway can still determine the score of each capability within its own process based on the substring matching results between the user message and the synonym list of each capability, and then determine the optimal capability based on the score and capability priority; the unified access gateway can also query the routing rule table based on the optimal capability to obtain the initial routing target, and when the initial routing target is an agent, it sequentially queries the agent card registry of the main discovery service and the registry center.

[0070] In one supplementary implementation, a fallback agent can be pre-configured. When the initial route target type is an agent, and the unified access gateway obtains no available agent instances from either the main discovery service or the agent card registry, the unified access gateway will no longer identify the large language model in the authorized model set as the route target to be verified, but will instead identify the fallback agent as the route target to be verified. Thus, the route target type to be verified is an agent, and the target identifier is the target identifier of the fallback agent.

[0071] If tenant authorization control needs to continue, the unified access gateway can perform authorization verification on the fallback agent based on the target identifier of the fallback agent and the current set of authorized agents for the tenant. If the fallback agent belongs to the set of authorized agents, the fallback agent is determined as the final routing target, and a unified routing target object is generated with the final routing target type being an agent and the final target identifier being the target identifier of the fallback agent. Then, the request is sent to the fallback agent based on the unified routing target object.

[0072] Using the above processing method, the primary discovery service and the agent card registry still constitute a primary-to-secondary agent instance query chain; only when no available agent instance is provided in this query chain will the fallback agent accept the corresponding request. Therefore, the fallback agent will not affect the process of selecting the execution backend according to the content intent under normal circumstances, and can provide a further processing path for the request when the target agent is temporarily unregistered, undiscovered, or unavailable.

[0073] In another supplementary implementation, when the route target to be verified does not belong to the authorization set corresponding to its type, the original route target to be verified can be replaced with a fallback agent instead of being downgraded to the large language model in the authorization model set. In an optional implementation, the fallback agent can be determined from the current tenant's authorization agent set to ensure that the replaced route target conforms to the current tenant's authorization scope. The unified access gateway uses the determined fallback agent as the final route target, generates the corresponding unified route target object, and sends the request to the fallback agent.

[0074] This approach involves having a fallback agent with the appropriate processing capabilities handle the original route requests that fail the authorization verification. This prevents the unified access gateway from continuing to call execution backends that are not authorized by the current tenant, while also preserving the possibility of further processing the requests.

[0075] In another supplementary implementation, when neither the main discovery service nor the agent card registry provides an available agent instance, the unified access gateway may refrain from selecting another execution backend and instead generate a fallback response, which is then returned to the request initiator. The fallback response indicates that no available agent instance matching the user message has been found. In this processing branch, the unified access gateway terminates backend routing for this request and does not initiate calls to the unavailable initial route target.

[0076] Accordingly, when the route target to be verified does not belong to the authorized set corresponding to its type, the unified access gateway can also generate a fallback response and return it as the processing result of this request. The fallback response can be used to indicate that the current tenant does not have the permission to call the corresponding execution backend, but there are no restrictions on the specific text, data structure, or return format of the fallback response.

[0077] By using a fallback response, the routing process can be terminated in a timely manner when no acceptable execution backend exists, avoiding calls to unavailable or unauthorized execution backends. This also allows the request initiator to know why the request was not sent to the execution backend, so that the request initiator can re-initiate the request, adjust the request content, or adopt other processing methods.

[0078] The aforementioned methods of downgrading to a fallback agent and returning a suggestive fallback response can be implemented separately. In specific applications, different downgrading methods can be configured for the two cases of not obtaining an available agent instance and failing authorization verification, or the same downgrading method can be used for both cases. For example, downgrading to a fallback agent can be performed when no available agent instance is obtained, while returning a suggestive fallback response when the route target to be verified fails authorization verification; alternatively, downgrading to a fallback agent can be performed in both cases, or a suggestive fallback response can be returned in both cases.

[0079] This invention also proposes a unified routing system for heterogeneous execution backends based on content intent, including a unified access gateway, an authorization service, a master discovery service, a registration center, and multiple execution backends; the multiple execution backends include a large language model, an MCP tool, and an agent, and the registration center includes an agent card registry.

[0080] Functionally, the system comprises four interconnected processing parts: request access, intent classification, routing decision, and permissions and fault tolerance. Within the unified access gateway, the request processing unit corresponds to the request access part, the intent classification unit to the intent classification part, the initial routing unit and the routing target processing unit to the routing decision and target availability processing part, and the authorization verification unit and the request sending unit to the pre-call authorization processing and final execution part.

[0081] The request processing unit is used to receive a request containing a message list and tenant credentials, extract user messages to be classified from the message list, and obtain the authorization scope of the current tenant based on the tenant credentials. The authorization scope includes the authorization model set, the authorization MCP tool set, and the authorization agent set. The intent classification unit, within the unified access gateway process and without invoking the large model during intent classification, counts the number of different synonyms appearing as substrings in the user message to be classified for each capability in the capability definition table, and determines the statistical result as the score of the capability; when there are capabilities with scores greater than zero, the best capability is determined from the capabilities with scores greater than zero in descending order of scores, and in the case of the same scores, in descending order of capability priority. The initial routing unit is used to query the routing rule table based on the best capability to obtain the initial routing target corresponding to the best capability. The initial routing target includes the initial routing target type and the initial target identifier. The routing target processing unit is used to determine the routing target to be verified, including the type of the routing target to be verified and the identifier of the routing target to be verified, based on the initial routing target. Specifically: when the initial routing target type is a large language model or an MCP tool, the initial routing target is determined as the routing target to be verified; when the initial routing target type is an agent, based on the initial target identifier, it first queries the main discovery service for available agent instances, and if no available agent instances are found, it queries the agent card registry for available agent instances; if an available agent instance is found, the obtained available agent instance is determined as the routing target to be verified; if no available agent instances are found after the above queries, a large language model from the authorized model set is determined as the routing target to be verified. The authorization verification unit is used to perform authorization verification on the route target to be verified based on the target type and authorization scope before initiating a call to the execution backend; if the route target to be verified belongs to the authorization set corresponding to its target type, the route target to be verified is determined as the final route target; if the route target to be verified does not belong to the authorization set corresponding to its target type, a large language model from the authorization model set is determined as the final route target; and The request sending unit is used to generate a unified routing target object including the final routing target type and the final target identifier according to the final routing target, and send the request to the large language model, MCP tool or intelligent agent identified by the final target identifier in the unified routing target object according to the final routing target type in the unified routing target object.

[0082] In this implementation, user messages, optimal capabilities, initial routing targets, routing targets to be verified, and final routing targets are sequentially transmitted between functional units to form a complete system data chain from request access to execution backend invocation; by combining local intent classification, heterogeneous target parsing, agent multi-level fallback, and unified authorization verification within the unified access gateway, the three types of execution backends can be governed and invoked by the same system architecture.

[0083] The present invention also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the electronic device executes any of the content intent-based heterogeneous execution backend unified routing methods disclosed in the above embodiments, and completes processes such as request parsing, user message extraction, tenant authorization scope acquisition, capability scoring, optimal capability determination, routing rule query, agent instance query, authorization verification, unified routing target object generation, and request sending.

[0084] In this embodiment, the processor executes a computer program in the memory, enabling the electronic device to complete deterministic intent classification during the local program execution process, and sequentially complete heterogeneous routing target resolution, availability processing, authorization verification, and request sending; by fixing the data transmission relationship between each processing stage in a programmatic manner, it is convenient to deploy the above-mentioned unified routing method on a gateway server or corresponding computing device.

[0085] The present invention also proposes a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, causes the processor to execute any of the content intent-based heterogeneous execution backend unified routing methods disclosed in the above embodiments.

[0086] In this embodiment, the program instructions for implementing the unified routing method are stored in a computer-readable storage medium, enabling the method to be loaded and executed in the form of a computer program, and allowing different deployment environments to complete content intent classification, heterogeneous target routing, authorization processing, and request sending in the same step sequence.

[0087] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for content intent based heterogeneous execution backend uniform routing, the method comprising: Executed by the unified access gateway, including: Receive a request containing a message list and tenant credentials, extract user messages to be classified from the message list, and obtain the authorization scope of the current tenant based on the tenant credentials. The authorization scope includes an authorization model set, an authorization MCP tool set, and an authorization agent set. Within the unified access gateway process and without calling the large model during intent classification, for each capability in the capability definition table, the number of different synonyms appearing as substrings in the user message to be classified in the synonym list for that capability is counted, and the statistical result is determined as the score of that capability; when there are capabilities with scores greater than zero, the best capability is determined from the capabilities with scores greater than zero in descending order of scores, and in the case of the same scores, in descending order of capability priority; After determining the optimal capability, the routing rule table is queried according to the optimal capability to obtain the initial routing target corresponding to the optimal capability. The initial routing target includes an initial routing target type and an initial target identifier. Based on the initial routing target, a routing target to be verified is determined. The routing target to be verified includes a routing target type and a routing target identifier. Specifically: when the initial routing target type is a large language model or an MCP tool, the initial routing target is determined as the routing target to be verified; when the initial routing target type is an agent, based on the initial target identifier, available agent instances are first queried from the main discovery service, and if no available agent instances are found, available agent instances are then queried from the agent card registry in the registry center; if an available agent instance is found, the obtained available agent instance is determined as the routing target to be verified; if no available agent instance is found after the above queries, a large language model from the authorized model set is determined as the routing target to be verified. Before initiating a call to the execution backend, authorization verification is performed on the route target to be verified based on the route target type to be verified and the authorization scope; if the route target to be verified belongs to the authorization set corresponding to its route target type, the route target to be verified is determined as the final route target; if the route target to be verified does not belong to the authorization set corresponding to its route target type, a large language model in the authorization model set is determined as the final route target. Based on the final routing target, a unified routing target object is generated, including the final routing target type and the final target identifier. Based on the final routing target type in the unified routing target object, the request is sent to the large language model, MCP tool, or intelligent agent identified by the final target identifier in the unified routing target object.

2. The method of claim 1, wherein, The user message to be classified is the last user message in the message list; when the scores of each capability are all zero, a large language model in the authorization model set is determined as the final routing target.

3. The method of claim 1, wherein, The capability definition table includes multiple capability definition items arranged in a predetermined order. Each capability definition item includes a capability identifier, a list of synonyms, and a capability priority.

4. The method of claim 3, wherein, When there are two or more abilities with the same score and the same ability priority, the ability whose corresponding ability definition item is located at the beginning of the predetermined order among the two or more abilities is determined as the best ability.

5. The method of claim 3, wherein, Each capability in the capability definition table has a capability identifier; the routing rule table includes multiple routing rule entries, and each routing rule entry includes a capability identifier, a routing target type, and a target identifier. Based on the optimal capability, query the routing rule table, including: The system queries routing rule entries that match the capability identifier of the best capability, and uses the routing target type and target identifier in the queried routing rule entries as the initial routing target type and the initial target identifier, respectively.

6. The method of claim 1, wherein, The scope of authorization for the current tenant is obtained based on the tenant credentials, including: Based on the tenant credentials, query the authorization service to obtain the authorization model set, authorization MCP tool set, and authorization agent set corresponding to the current tenant; The authorization verification includes: Based on the type of the route target to be verified, select the corresponding authorization set from the authorization range, and determine whether the route target to be verified belongs to the selected authorization set.

7. The method of claim 1, wherein, The capability definition table and the routing rule table are provided by the configuration center, and the method further includes: In response to the configuration change notification from the configuration center, update the currently used capability definition table and routing rule table in the unified access gateway using an atomic replacement method.

8. A content intent based heterogeneous execution backend unified routing system, characterized in that, It includes a unified access gateway, authorization service, master discovery service, registration center, and multiple execution backends; the multiple execution backends include a large language model, MCP tools, and intelligent agents, and the registration center includes an intelligent agent card registry. The unified access gateway includes: The request processing unit is configured to receive a request containing a message list and tenant credentials, extract user messages to be classified from the message list, and obtain the authorization scope of the current tenant based on the tenant credentials. The authorization scope includes an authorization model set, an authorization MCP tool set, and an authorization agent set. The intent classification unit is used within the process of the unified access gateway, without calling the large model during the intent classification process, to count the number of different synonyms appearing as substrings in the user message to be classified for each capability in the capability definition table, and to determine the statistical result as the score of the capability; when there are capabilities with scores greater than zero, the best capability is determined from the capabilities with scores greater than zero in descending order of scores, and in the case of the same scores, in descending order of capability priority. An initial routing unit is used to query a routing rule table based on the optimal capability to obtain an initial routing target corresponding to the optimal capability. The initial routing target includes an initial routing target type and an initial target identifier. A routing target processing unit is configured to determine, based on the initial routing target, a routing target to be verified, including the type of the routing target to be verified and the identifier of the routing target to be verified, wherein: when the initial routing target type is a large language model or an MCP tool, the initial routing target is determined as the routing target to be verified; when the initial routing target type is an agent, based on the initial target identifier, an available agent instance is first queried from the main discovery service, and if no available agent instance is obtained, an available agent instance is then queried from the agent card registry; if an available agent instance is obtained, the obtained available agent instance is determined as the routing target to be verified; if no available agent instance is obtained after the above queries, a large language model from the authorized model set is determined as the routing target to be verified. An authorization verification unit is configured to perform authorization verification on the route target to be verified based on the route target type and the authorization scope before initiating a call to the execution backend; if the route target to be verified belongs to the authorization set corresponding to its route target type, the route target to be verified is determined as the final route target; if the route target to be verified does not belong to the authorization set corresponding to its route target type, a large language model from the authorization model set is determined as the final route target; and The request sending unit is configured to generate a unified routing target object including a final routing target type and a final target identifier based on the final routing target, and send the request to the large language model, MCP tool, or intelligent agent identified by the final target identifier in the unified routing target object according to the final routing target type in the unified routing target object.

9. An electronic device, comprising: The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the electronic device performs the content intent-based heterogeneous execution backend unified routing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by a processor, the processor performs the content intent-based heterogeneous execution backend unified routing method as described in any one of claims 1 to 7.