A method and system for unified access and aggregated calling of multi-source heterogeneous large models, and a storage medium
Patent Information
- Application Number
- CN202611291784.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-25
- Publication Date
- 2026-10-16
AI Technical Summary
[0005]本发明的目的在于提供一种多源异构大模型的统一接入与聚合调用方法、系统及存储介质,解决了现有技术中模型接口适配过程形成的调用约束承载状态未直接参与模型路由,以及多模型输出出现任务需求未覆盖或结果冲突时缺乏可靠结果采信和定向补充调用机制的技术问题
[0065]This invention unifies the invocation description to form task requirement items and invocation semantic items. During the model adapter's conversion of the target model invocation request, it extracts the necessary constraint feature subset and the effective constraint feature subset actually carried by the target model interface. Based on the difference between the two feature subsets, a semantic mapping loss value is formed and written into the adaptation semantic state. The semantic mapping loss value adjusts the relationship weight between model service nodes and invocation semantic item nodes in the knowledge constraint neural routing network through a mapping penalty coefficient. This ensures that the model routing process simultaneously considers the task processing capability of candidate models, model running status, and the actual carrying capacity of the target model interface for necessary invocation constraints. This reduces the risk of invalid model calls and result distortion caused by interface degradation, and improves the accuracy of model combination selection.
Smart Images

Figure CN122925071A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and computer model service scheduling technology, specifically involving a unified access and aggregation invocation method, system and storage medium for multi-source heterogeneous large models. Background Technology
[0002] Multi-source heterogeneous large models typically provide inference capabilities through different service providers, private deployment environments, or industry model platforms. Different model interfaces differ in request fields, context organization, structured output, tool calls, and termination control. Business systems need to use model adapters to convert unified business requests into call requests that each model can accept. Existing unified access and model routing methods usually handle interface conversion and model selection separately, and the call constraints formed during the interface adaptation process are not directly involved in model routing.
[0003] For the same task, the model's inherent processing capabilities do not necessarily mean that its current interface can fully handle the necessary call constraints in the business request. Especially in scenarios involving structured output, long contexts, tool parameters, or multi-level field relationships, interface conversion may result in splitting of expressions, partial degradation, or missing constraints, causing discrepancies between the actual task conditions received by the model and the unified call description. If scheduling is still primarily based on model parameter size, static capability labels, or runtime status, it is easy to select call paths with insufficient interface capacity.
[0004] After multi-model collaborative invocation, situations may arise where task requirements are not covered or multiple model outputs conflict with each other. Re-invoking multiple models for the complete request increases redundant inference and data transmission; directly fusing based on a single output makes it difficult to reflect the adaptation semantic state of different model interfaces in historical invocations. Therefore, it is necessary to establish a continuous data relationship between semantic mapping loss values, model routing, conflict result acceptance, and supplementary invocations. This ensures that model selection considers not only model processing capabilities but also the actual capacity of the target model interface to meet the current necessary invocation constraints. Furthermore, the relationship should be continuously updated using actual invocation results to reduce invalid model invocations and result distortion caused by interface degradation. Summary of the Invention
[0005] The purpose of this invention is to provide a unified access and aggregation calling method, system, and storage medium for multi-source heterogeneous large models. It solves the technical problems in the prior art where the calling constraint carrying state formed during the model interface adaptation process does not directly participate in model routing, and where there is a lack of reliable result acceptance and targeted supplementary calling mechanism when multiple model outputs have uncovered task requirements or conflicting results.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] This invention provides a unified access and aggregation invocation method, system, and storage medium for multi-source heterogeneous large models. For situations where a model has task processing capabilities but the target model interface cannot fully bear the necessary invocation constraints, during the model adaptation process, a subset of necessary constraint features of the invocation semantic items and a subset of effective constraint features actually carried by the target model interface are extracted. A semantic mapping loss value is formed based on the difference between the two, and this semantic mapping loss value is written into the adaptation semantic state, enabling the actual constraint-bearing state of the model interface to participate in subsequent model routing.
[0008] The semantic mapping loss value is further used to form a mapping penalty coefficient. This coefficient adjusts the relationship weights between model service nodes and calling semantic item nodes in the knowledge-constrained neural routing network. This ensures that when determining model combinations, the network considers the candidate model's task processing capabilities, running status, and the actual capacity of the target model's interface for the currently called semantic item. When model output fails to cover task requirements or results conflict, supplementary calling conditions are determined based on the corresponding model's adaptation semantic state and historical adaptation mapping observations. Targeted supplementary calls are then executed for unmet or conflicting task requirements. The model capability observations and adaptation mapping observations generated by these supplementary calls update the model capability relationship graph again, creating a continuous data processing loop encompassing interface adaptation, relationship weight adjustment, model routing, result processing, and state updates.
[0009] Step S1: Generate a unified call description; receive business requests, perform field identification and data structure transformation on business requests from different call entry points, and generate a unified call description. The unified call description includes at least a request content field, a context association field, and a call control field. Task requirement items are formed based on the request content field and the context association field, and call semantic items are formed based on the call control field and the data associated with the call control field. Task requirement items represent the content requirements that the model output needs to meet and serve as data objects used in model routing, model output verification, and result aggregation. Call semantic items represent the machine call control relationship that needs to be maintained between the unified call description and the target model call interface, including at least one of system instruction semantic items, context constraint semantic items, tool call semantic items, structured output semantic items, modal input semantic items, streaming return semantic items, and termination control semantic items. Each task requirement item and call semantic item is assigned a corresponding identifier to establish a definite correspondence between subsequent model routing results, model output, and feedback data and the corresponding task requirement items and call semantic items.
[0010] Step S2: Form an adaptive semantic state; establish a model access capability description for each candidate model. The model access capability description records the correspondence between the call semantic items in the unified call description and the target model interface fields, interface capabilities, or call methods. Each candidate model has a corresponding model adapter. The model adapter reads the unified call description and converts it into a target model call request that meets the target model interface requirements based on the model access capability description.
[0011] While performing the transformation, the model adapter forms mapping markers for the call semantics items involved in the current business request. These mapping markers include direct mapping, equivalent transformation, split mapping, downgraded mapping, or no-support mapping. Direct mapping indicates that the target model interface has fields or calling mechanisms capable of directly carrying the corresponding call semantic item; equivalent transformation indicates that the target model interface uses different data representations, but the transformation maintains the call control relationship required by the corresponding call semantic item; split mapping indicates that a call semantic item needs to be expressed through multiple fields, multiple calling parameters, or multiple processing steps in the target model interface; downgraded mapping indicates that the target model interface can only express some of the necessary call constraints in the corresponding call semantic item; no-support mapping indicates that the target model interface cannot express the necessary call control relationship required by the corresponding call semantic item.
[0012] For call semantic items that form split mapping tags or downgrade mapping tags, the model adapter extracts a subset of necessary constraint features from the corresponding call semantic item, and determines a subset of effective constraint features that the target model interface can actually carry based on the target model interface fields, call parameters, and interface capabilities. The necessary constraint features are data constraints that are essential for maintaining the call control relationship of the corresponding call semantic item and can be identified by a computer program, including at least one of field type constraints, field dependency constraints, required field constraints, context span constraints, tool parameter constraints, modal input constraints, or termination condition constraints. The effective constraint features are the necessary constraint features that the target model interface can still actually express after the corresponding mapping processing.
[0013] When the necessary constraint feature subset is not empty, a semantic mapping loss value is formed based on the difference between the necessary constraint feature subset and the effective constraint feature subset. In one implementation, the semantic mapping loss value is determined according to the following formula:
[0014] (1)
[0015] In equation (1), This represents the semantic mapping loss value. For the necessary constraint feature subset corresponding to the invoke semantic item, This is a subset of the effective constraint features actually carried by the target model interface. It is the set of constraint features in the necessary constraint feature subset that are not covered by the effective constraint feature subset. The number of uncovered constraint features. The total number of necessary constraint features. The severity adjustment coefficient is preset. The semantic mapping loss value, the severity adjustment coefficient and the ratio of the number of elements in the two sets are all dimensionless, and the exponent term in equation (1) is a dimensionless quantity.
[0016] When a semantic term is invoked to form a direct mapping marker and all necessary constraint features are carried by the target model interface, the semantic mapping loss value is set to 0. When a semantic term is invoked to form an equivalent transformation marker, the existence of constraint feature loss is determined based on the effective constraint feature subset after the equivalent transformation. When a semantic term is invoked to form a non-supporting mapping marker, the corresponding candidate model is processed according to the necessary invocation semantic conditions in the subsequent candidate model constraint stage.
[0017] The model adapter writes the mapping category code, semantic mapping loss value, historical adaptation mapping observation state, and model running state into preset positions in the state tensor contained in the adaptation semantic state. The state tensor is a fixed-length numerical data structure for the model capability relationship graph and knowledge-constrained neural routing network to read. Different preset positions in the state tensor correspond to unique state meanings, and the same preset position maintains the same meaning in different service requests. When the system runs for the first time and there is no historical observation data, the positions in the state tensor corresponding to the historical adaptation mapping observation states are initialized with a preset initial value of 0.
[0018] Step S3: Execute knowledge-constrained neural routing; establish a model capability relationship graph, which includes at least task requirement nodes, model service nodes, and invocation semantic item nodes. Task requirement nodes correspond to the task requirement items formed in S1, model service nodes correspond to candidate models capable of participating in model invocation, and invocation semantic item nodes correspond to the invocation semantic items formed in S1. A model capability relationship is established between task requirement nodes and model service nodes to represent the model capability status of candidate models in handling corresponding task requirement items; an adaptation mapping relationship is established between model service nodes and invocation semantic item nodes to represent the mapping method, semantic mapping loss value, and historical adaptation mapping observation status of the corresponding model interface in handling the corresponding invocation semantic item. Model service nodes are also associated with model running status, which is formed by model service running monitoring results and indicates whether the target model service currently meets the invocation conditions.
[0019] Before executing knowledge-constrained neural routing, candidate model constraints are formed based on model capability relationships, adaptation semantic states, and model runtime states. For necessary task requirements, if a candidate model does not meet the corresponding necessary model capability, the candidate model is excluded from the candidate model range corresponding to the task requirement. For necessary invocation semantics, if the adaptation semantic state of the candidate model indicates that the necessary invocation semantics does not support mapping, the candidate model is excluded from the candidate model range that depends on the corresponding invocation semantics. If the model runtime state indicates that the candidate model does not currently meet the invocation conditions, the corresponding candidate model is excluded from the current candidate model range.
[0020] For candidate models that are not excluded by the candidate model constraints and have semantic mapping loss for the corresponding call semantic item, a mapping penalty coefficient is formed based on the semantic mapping loss value. The mapping penalty coefficient is a dimensionless state variable between 0 and 1. When the semantic mapping loss value is 0, the mapping penalty coefficient is 1; as the semantic mapping loss value increases, the mapping penalty coefficient decreases according to a preset loss sensitivity relationship. In one implementation, the semantic mapping loss value is multiplied by a preset loss sensitivity weight, and the result is subtracted from 1 to form the mapping penalty coefficient; when the result is less than 0, the mapping penalty coefficient is set to 0.
[0021] The mapping penalty coefficient is multiplied by the basic relation weights between the model service node and the corresponding calling semantic item node to obtain the relation weights entering the knowledge-constrained neural routing network. Adaptive mapping relationships that are directly mapped and have no semantic mapping loss retain their basic relation weights; adaptive mapping relationships corresponding to split mappings or downgraded mappings have their relation weights decayed according to the degree of semantic mapping loss.
[0022] After candidate model constraints and relation weight adjustments, the corresponding model capability relationship graph is input into the knowledge-constrained neural routing network. The knowledge-constrained neural routing network employs a neural network capable of performing information propagation for different node types and different relation types. In one implementation, node representations are updated according to the following formula:
[0023] (2)
[0024] In equation (2), For nodes In the Layer node representation, For nodes In the Layer node representation, The node currently performing information aggregation. For nodes Adjacent nodes that have a relationship with each other For nodes The set of adjacent nodes, Adjacent nodes To the node The relation weights adjusted by the mapping penalty coefficient when transmitting information. For nodes With nodes Relationship types Transformation parameters for the node's own information. For relation type The corresponding information transformation parameters, It is a non-linear activation function. This is an index for neural network layers. Node representations and transformation parameters are used for feature transformations within the neural network. The weights are dimensionless relational weights, and the two sides of equation (2) are node representation vectors of the same dimension.
[0025] The input data for the task requirement node comes from the task requirement item formed by this business request. The input data for the model service node comes from the model capability status and model running status. The call semantic item node and its relation data come from the model access capability description and the semantic status of this adaptation. The semantic mapping loss value is applied to the corresponding relation weight through the mapping penalty coefficient, so that the information contribution of candidate models whose interfaces cannot fully bear the necessary call constraints on the corresponding call semantic item propagation path decreases as the semantic mapping loss increases.
[0026] The knowledge-constrained neural routing network forms routing representations corresponding to candidate models through information propagation between nodes. Based on the routing representations, the initial model combination and the processing allocation relationship between the task requirements and the models in the initial model combination are determined. When determining the initial model combination, all necessary task requirements are processed by at least one model that satisfies the constraints of the candidate models, and target model call requests are only sent to models with corresponding task requirement processing allocation relationships.
[0027] The training data for the knowledge-constrained neural routing network comes from model call results obtained during model capability verification or historical model call results generated during system operation. The training data includes at least the task requirements for the corresponding business request, the current model capability relationship graph state, the adaptation semantic state corresponding to the model interface, the actual model call, and the state where the model output satisfies the corresponding task requirements. When the model capability state, model running state, or adaptation semantic state changes, the corresponding changes modify the candidate model constraints, relationship weights, and inputs to the knowledge-constrained neural routing network through the model capability relationship graph.
[0028] Step S4: Establish requirement coverage and result conflict states; based on the processing allocation relationship formed in S3, send target model call requests to the models in the initial model combination through the corresponding model adapters and obtain model outputs. For models with different output data structures, convert the model outputs into a unified result structure, which includes at least a model identifier, response content, and request execution status. The result alignment and conflict handling module decomposes the response content into one or more result semantic units based on the task requirement items formed in S1, and establishes a correspondence between the result semantic units and the task requirement items.
[0029] For structured model output, a correspondence is established between result semantic units and task requirement items based on field paths, data object identifiers, or predetermined output structures. For unstructured model output, a correspondence is established based on the semantic representation of task requirement items and the semantic representation of different content fragments in the model output. For each necessary task requirement item, it is checked whether there is a result semantic unit that satisfies the conditions of the corresponding necessary fields, key objects, object relationships, or output structures. If a result semantic unit that meets the conditions exists, the corresponding task requirement item is determined as a covered task requirement item; if no result semantic unit that meets the conditions exists, the corresponding task requirement item is determined as an uncovered task requirement item. The requirement coverage status is formed by the coverage of each task requirement item.
[0030] When multiple result semantic units correspond to the same task requirement, semantic consistency and structural consistency are determined for each result semantic unit. Semantic consistency determines whether the key objects, object relationships, or constraints involved in the corresponding task requirement can be simultaneously met for each result semantic unit. Structural consistency determines whether the field types, field relationships, and necessary data objects in the structured output meet the output structure requirements of the corresponding task requirement. When multiple result semantic units corresponding to the same task requirement have differences in key objects, object relationships, constraint values, or output structure that cannot be simultaneously met, the corresponding task requirement is identified as a conflicting task requirement, and the model identifier and corresponding adaptation semantic state of the conflicting result semantic unit are recorded, thus forming a result conflict state.
[0031] After a result conflict state is formed, for each result semantic unit involved in the conflict, the historical adaptation mapping observation state sequence of its source model on the call semantic item corresponding to the conflicting task requirement item is extracted. The historical adaptation mapping observation state sequence is saved in the order of call observation time and is used to represent the adaptation mapping state of the same model interface for the corresponding call semantic item in multiple historical call observations.
[0032] For each model and the corresponding invocation semantic item for the conflicting task requirements, a historical adaptation reliability is formed based on the historical adaptation mapping observation state sequence, historical task completion status, and interface change interval. In one implementation, the historical adaptation reliability is determined according to the following formula:
[0033] (3)
[0034] In equation (3), For the model For calling semantic items Historical fit reliability For model indexing, To invoke the semantic item index, For historical access to the sequence number, This represents the total number of historical data calls within the current time window. The time decay factor, For the first Model in historical call observation For calling semantic items The adaptation mapping observation state, For the first In historical call observations and call semantics The associated task requirement completion status, This is an indicator function that takes the value 1 if the condition within the parentheses is true, and 0 if the condition is false. To change the attenuation coefficient of the interface, For the model The number of calls observed since the most recent substantial change to the current time for the interface parameters. , , , and All are dimensionless quantities. To measure the number of times observations are called, the exponent term in equation (3) is calculated using the corresponding normalized count.
[0035] For multiple invocation semantic items involved in the same result semantic unit, the corresponding historical adaptation confidence is arranged according to a preset order of invocation semantic items to form a historical adaptation confidence tensor corresponding to the result semantic unit. Different positions in the historical adaptation confidence tensor correspond to unique invocation semantic items, and the meaning of the invocation semantic items corresponding to the same position in different business requests remains consistent.
[0036] Step S5: Execute targeted supplementary invocation; when there are uncovered task requirements in the requirement coverage state or conflicting task requirements in the result conflict state, a supplementary invocation requirement is formed using the uncovered or conflicting task requirements as the processing object. The supplementary invocation requirement includes at least the task requirement that needs to be supplemented, the invocation semantic item corresponding to the corresponding task requirement, the obtained result semantic unit, the adaptation semantic state corresponding to the invoked model, and the corresponding requirement coverage state or result conflict state.
[0037] For conflicting task requirements, the acceptance weight is determined based on the historical adaptation confidence tensor corresponding to each result semantic unit involved in the conflict. The acceptance weight is a dimensionless state quantity between 0 and 1, used to represent the degree of acceptance of the corresponding result semantic unit in the current conflicting task requirement. In one implementation, based on the necessary invocation semantic items involved in the current conflicting task requirement, the corresponding confidence components are read from the historical adaptation confidence tensor and normalized and combined according to the preset importance states of the necessary invocation semantic items to obtain the acceptance weight of the corresponding result semantic unit. For example, the confidence components of each necessary invocation semantic item corresponding to the current conflicting task requirement in the historical adaptation confidence tensor are read, multiplied by the preset importance weight of each invocation semantic item, summed, and the sum is divided by the total importance weight to obtain the acceptance weight of the corresponding result semantic unit.
[0038] When the highest acceptance weight reaches or exceeds the preset fusion threshold, the result processing continues to be performed based on the result semantic unit corresponding to the highest acceptance weight and other result semantic units consistent with the result semantic unit; when the highest acceptance weight is lower than the preset fusion threshold, the final processing result of the corresponding task requirement item is not determined directly based on the existing conflict results, but a supplementary call requirement is formed, and the historical adaptation confidence tensor corresponding to each candidate model is written into the model capability relationship graph as a supplementary routing condition.
[0039] A supplementary invocation description is generated based on the supplementary invocation requirements. The supplementary invocation description retains the request content, necessary context, existing result semantic units, conflicting objects, and invocation semantic items that directly correspond to the uncovered or conflicting task requirements, and does not repeatedly carry request content that is unrelated to the current supplementary task requirements.
[0040] To address the supplementary invocation requirement, candidate model constraints are re-formed, and knowledge-constrained neural routing is executed. When an already invoked model that produces uncovered or conflicting results adopts a specific mapping method for the invocation semantic item corresponding to the supplementary invocation requirement, and there exists a candidate model that satisfies the capability corresponding to the supplementary invocation requirement but adopts a different mapping method for the invocation semantic item, the supplementary model is determined from the candidate models adopting different mapping methods. When there are no candidate models adopting different mapping methods, the supplementary model is determined based on the candidate model's historical adaptation confidence tensor, model capability state, and model running state.
[0041] The supplementary model's corresponding model adapter converts the supplementary call description into a supplementary target model call request, and sends the supplementary target model call request to the supplementary model. After obtaining the supplementary model's output, the supplementary model's output is converted into a unified result structure, forming supplementary result semantic units corresponding to uncovered or conflicting task requirement items, and the requirement coverage status and result conflict status of the corresponding task requirement items are redefined.
[0042] When there are still uncovered task requirements or conflicting task requirements that need to be processed, the supplementary call continues according to the updated model capability relationship diagram; when all necessary task requirements have obtained result semantic units that meet the corresponding task requirement conditions, and there are no result conflicts that need to be processed, the supplementary call ends; when the preset call resource boundary, response boundary, or available model boundary is reached, the call stops, and the current requirement coverage state and result conflict state are retained.
[0043] Step S6: Generate aggregated output and update the status; taking task requirement items as the aggregation unit, based on the source model, model capability status of the source model, corresponding adaptation semantic status, historical adaptation reliability tensor, and consistency relationship between different result semantic units corresponding to each task requirement item, determine the retained result, supplementary result, or result to be fused corresponding to the task requirement item.
[0044] When a task requirement item has only one result semantic unit that satisfies the corresponding task requirement condition, the result semantic unit is determined as the retained result of the corresponding task requirement item. When multiple result semantic units have consistent content that can be simultaneously true, the consistent content is selected or structurally merged. When a supplementary result semantic unit can eliminate the conflict of the original result, the supplementary result semantic unit is used to update the processing result of the corresponding task requirement item. After processing each task requirement item, the aggregated output is formed according to the processing dependencies between the task requirement items.
[0045] While generating the aggregated output, model capability observations and adaptation mapping observations are generated based on this model call. Model capability observations indicate whether the actual processing result of the model on the current task requirement item meets the corresponding task requirement conditions; adaptation mapping observations indicate whether the actual model output after the called semantic item is mapped by the corresponding model adapter meets the structural conditions and task requirement conditions associated with the corresponding called semantic item.
[0046] For a given model and a given invocation semantics, in one implementation, the adaptation mapping observation state is updated according to the following formula:
[0047] (4)
[0048] In equation (4), For the first Model in historical call observation For calling semantic items The adaptation mapping observation state, For the first Model in historical call observation For calling semantic items The updated adaptation mapping observation status For state update coefficients, For the first Historical call observations are targeted at the model. and calling semantic items The current adaptive mapping observations formed; , , and All are dimensionless quantities.
[0049] When the result returned by the target model after corresponding adaptation mapping simultaneously satisfies the structural conditions and task requirements of the corresponding call semantic item, a positive adaptation mapping observation is formed. When the original call path does not satisfy the corresponding task requirement, and a supplementary model with different adaptation mapping relationships forms a supplementary result semantic unit that satisfies the conditions for the same task requirement, a reverse adaptation mapping observation is formed. When there are differences between model outputs, but the interface mapping relationship between the differences and the call semantic item cannot be determined based on the model call data, the corresponding adaptation mapping observation state is not changed based on the differences.
[0050] The updated model capability state, adaptation mapping observation state, semantic mapping loss value, and adaptation semantic state are written into the model capability relationship graph and used for candidate model constraints, relationship weight adjustment, and knowledge constraint neural routing for subsequent business requests.
[0051] This invention also provides a unified access and aggregation invocation system for multi-source heterogeneous large models, including a unified access module, a model adaptation module, a model capability relationship graph maintenance module, a knowledge constraint neural routing module, a model invocation execution module, a result alignment and conflict handling module, and an aggregation feedback module. The unified access module receives business requests, forms a unified invocation description, task requirement items, and invocation semantic items, and transmits the unified invocation description to the model adaptation module, and the task requirement items and invocation semantic items to the model capability relationship graph maintenance module.
[0052] The model adaptation module includes multiple model adapters corresponding to candidate models. Each model adapter performs a transformation on the unified invocation description based on the corresponding model access capability description, forming a target model invocation request and an adapted semantic state. When the invocation semantic item uses split mapping or downgrade mapping, the model adapter further extracts necessary constraint feature subsets and effective constraint feature subsets, forming a semantic mapping loss value and writing it into the state tensor contained in the adapted semantic state. The adapted semantic state is transmitted to the model capability relationship graph maintenance module, and the target model invocation request is transmitted to the model invocation execution module after the corresponding candidate model is determined to be a model in the initial model combination or a supplementary model.
[0053] The model capability graph maintenance module maintains task requirement nodes, model service nodes, and calling semantic item nodes, as well as the model capability relationship between task requirement nodes and model service nodes, and the adaptation mapping relationship between model service nodes and calling semantic item nodes. It also receives model running status, model capability observations, semantic mapping loss values, and adaptation mapping observations to update the model capability graph.
[0054] The knowledge-constrained neural routing module reads the model capability relationship graph, forms candidate model constraints based on necessary model capabilities, necessary semantic terms, and model running status, forms a mapping penalty coefficient based on semantic mapping loss value, and dynamically decays the relation weights of the corresponding adaptation mapping relationship. Through the knowledge-constrained neural routing network, it determines the initial model combination or supplementary model within the range of models that meet the candidate model constraints, as well as the processing allocation relationship between the corresponding task requirement items and the model.
[0055] The model invocation execution module invokes the target model through the corresponding model adapter according to the processing allocation relationship, and transmits the obtained model output to the result alignment and conflict handling module. The result alignment and conflict handling module converts the model output into a unified result structure, forming result semantic units, requirement coverage states, and result conflict states. When a result conflict state is formed, it further obtains the historical adaptation mapping observation state sequence corresponding to the model involved in the conflict and forms a historical adaptation confidence tensor. When the supplementary invocation triggering condition is met, a supplementary invocation requirement is formed and transmitted to the model capability relationship graph maintenance module and the knowledge constraint neural routing module.
[0056] The aggregation feedback module receives result semantic units, requirement coverage status, result conflict status, adaptation semantic status, and historical adaptation confidence tensors. Based on the processing results corresponding to each task requirement item, it forms an aggregation output, simultaneously generating model capability observations and adaptation mapping observations. These observations are then transmitted to the model capability graph maintenance module. This allows the semantic mapping loss status formed by model interface adaptation to enter the model routing process via the model capability graph. The model output generated by model routing, after result processing, again forms model capability and adaptation mapping feedback.
[0057] The present invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program causes the processor to perform the following processes: formation of a unified call description, parsing of task requirement items and call semantic items, transformation of target model call request, extraction of necessary constraint features, extraction of effective constraint features, formation of semantic mapping loss, formation of adaptation semantic state, establishment and updating of model capability relationship graph, formation of candidate model constraints, dynamic adjustment of relationship weights, neural routing of knowledge constraints, model call, formation of result semantic unit, formation of requirement coverage state, formation of result conflict state, formation of historical adaptation reliability, supplementary call, formation of aggregated output, and updating of model capability state and adaptation semantic state.
[0058] In one implementation, the model access capability description is formed during the model adapter registration phase. When accessing a new candidate model, a correspondence is established between the call semantic items and the target model interface fields or calling mechanisms based on the target model interface definition. Simultaneously, interface carrying feature records are established for necessary constraint features that can be determined by the interface definition. For call semantic items whose complete carrying relationship cannot be directly determined from the interface definition, the corresponding call is executed through the target model interface, and an adaptation mapping observation is formed based on the interface return status, output structure, and task conditions that can be determined by the program.
[0059] Furthermore, relatively stable relational data and dynamic state data are maintained separately in the model capability relational graph. The task categories supported by the candidate model, the semantic item mapping rules, the necessary constraint features, and the interface field relationships are considered as relatively stable relational data; the model running status, model capability observations, semantic mapping loss values, historical adaptation reliability, and adaptation mapping observations are considered as dynamic state data that can be updated during the invocation process.
[0060] Furthermore, when the same model has multiple different interface versions or different access paths, the model access capability description, semantic mapping loss value, and adaptation mapping relationship are maintained separately for each access path. When different access paths have different adaptation states for the same call semantic item, the model capability relationship graph records the adaptation mapping state of each access path, enabling the knowledge-constrained neural routing process to determine the corresponding access path while determining the model service.
[0061] Furthermore, when forming the supplementary call description, only the request content, necessary context, existing conflict results, and call semantic items corresponding to the uncovered or conflicting task requirements are retained. This allows the supplementary call to centrally process task requirements that have not yet been met or that are in conflict, and reduces the repeated transmission of data and repeated model processing of data corresponding to task requirements that have already been met.
[0062] Through the above technical solution, the interface adaptation process not only generates the transformation result of the call request, but also determines the semantic mapping loss generated when the interface actually carries the necessary call constraints based on the necessary constraint feature subset and the effective constraint feature subset. The semantic mapping loss value is applied to the relationship weight between the model service node and the call semantic item node through a mapping penalty coefficient, so that the knowledge constraint neural routing network considers both the task processing capability of the candidate model and the actual carrying capacity of the target model interface for the current necessary call constraints during information propagation.
[0063] For models with corresponding task processing capabilities but whose interfaces can only perform split mapping or downgrade mapping of necessary call constraints, the relation weights of the corresponding propagation paths are reduced based on the semantic mapping loss, allowing the interface constraint carrying state to directly participate in model combination determination. When different model outputs conflict, a historical adaptation reliability tensor is formed by observing the historical adaptation mapping state corresponding to the current conflicting task requirement, and the existing results are determined based on the historical adaptation reliability to see if they meet the direct fusion conditions. If the direct fusion conditions are not met, the historical adaptation reliability and adaptation semantic state are used together as supplementary routing conditions, enabling supplementary calls to re-determine the model or model access path for the currently unresolved task requirement. The results formed by the supplementary calls and the adaptation mapping observations continue to update the model capability relationship graph, thus forming a closed-loop data processing process in which interface adaptation, relation weight adjustment, model routing, result conflict handling, and state updates are interconnected.
[0064] Compared with the prior art, the present invention has the following beneficial effects:
[0065] This invention unifies the invocation description to form task requirement items and invocation semantic items. During the model adapter's conversion of the target model invocation request, it extracts the necessary constraint feature subset and the effective constraint feature subset actually carried by the target model interface. Based on the difference between the two feature subsets, a semantic mapping loss value is formed and written into the adaptation semantic state. The semantic mapping loss value adjusts the relationship weight between model service nodes and invocation semantic item nodes in the knowledge constraint neural routing network through a mapping penalty coefficient. This ensures that the model routing process simultaneously considers the task processing capability of candidate models, model running status, and the actual carrying capacity of the target model interface for necessary invocation constraints. This reduces the risk of invalid model calls and result distortion caused by interface degradation, and improves the accuracy of model combination selection.
[0066] The candidate model range is limited based on necessary model capabilities, necessary invocation semantic conditions, and model runtime status. Within this limited range, the initial model combination and the processing allocation relationship between task requirements and candidate models are determined. This avoids sending invocation requests to models with insufficient interface capacity, reducing invalid inference and data transmission that do not meet invocation constraints. The model output is converted into a unified result structure and decomposed into result semantic units corresponding to task requirements, forming requirement coverage states and result conflict states. Supplementary invocation requirements are generated for uncovered and conflicting task requirements, avoiding repeated invocation of multiple models for complete business requests and reducing redundant inference and data transmission overhead. For result conflict states, historical adaptation mapping observation state sequences are extracted and formed into a historical adaptation reliability tensor. The adoption weight is determined based on the historical adaptation reliability. When the highest adoption weight is lower than a preset fusion threshold, a targeted supplementary invocation is executed to enhance the reliability of conflict result adoption and reduce aggregation result bias caused by distortion of single model output. Based on the model capability observations and adaptation mapping observations generated by this call, the model capability state and adaptation semantic state are updated, so that interface adaptation, relation weight adjustment, model routing, result conflict handling and state update form a closed loop, which improves the system's adaptability to changes in model interface and running state, and reduces the system maintenance complexity. Attached Figure Description
[0067] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.
[0068] Figure 1 This is a flowchart of the method of the present invention.
[0069] Figure 2 This is a flowchart of the sub-process for handling conflicting results and forming historical adaptation reliability in this invention.
[0070] Figure 3 This is a flowchart of the aggregation output and status update sub-process of the present invention. Detailed Implementation
[0071] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the embodiments of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0072] The following is in conjunction with the appendix Figures 1-3 The embodiments of the present invention will be described in detail below.
[0073] Example 1: This example provides a unified access and aggregation method for multi-source heterogeneous large models. The system pre-registers multiple candidate models that can provide model inference services. Each candidate model is configured with a model identifier, a model access capability description, and a model adapter. The model identifier is used to distinguish different model services within the system; the model access capability description records the call semantics that the corresponding model interface can receive, the mapping method corresponding to the call semantics, and the necessary constraint features that the interface can actually carry; the model adapter is used to complete the data conversion between the unified call description and the corresponding model call interface.
[0074] Upon receiving a business request, the unified access module converts the data from the business system into a unified call description. The unified call description includes request content fields, context association fields, and call control fields. Based on the request content, the unified access module identifies the task requirements that need to be completed by the model and forms task requirement items from those that can independently perform result verification and result combination.
[0075] For example, when a business request requires generating a content summary, extracting key objects, and returning them according to a specified data structure, separate task requirement items are generated for summarizing, extracting key objects, and returning structured results. Corresponding identifiers are then set for each task requirement item. Simultaneously, corresponding invocation semantic items are generated based on system instructions, contextual constraints, and structured output requirements in the business request. Task requirement items represent the content requirements that the model ultimately needs to complete, while invocation semantic items represent the invocation control relationships that need to be maintained during the target model's interface invocation.
[0076] After the unified invocation description is generated, it is transmitted to the model adaptation module. The model adaptation module calls the corresponding model adapter for each candidate model. Each model adapter reads the model access capability description and converts the unified invocation description into a target model invocation request that the corresponding target model can receive. At the same time, it generates mapping tags for the invocation semantic items involved in this business request.
[0077] For example, for structured output semantic items, when the target model interface has an independent field for receiving structure definitions, the model adapter writes the structured output constraints into the corresponding field and forms a direct mapping mark; when the target model interface needs to express structured output requirements through model instructions and output validation, a split mapping mark is formed; when the target model interface can only receive some structure constraints, a downgrade mapping mark is formed; when the target model interface cannot bear the corresponding structured output constraints, a non-supported mapping mark is formed.
[0078] When the structured output semantic items form split mapping tags or downgrade mapping tags, the model adapter further extracts the necessary constraint features from the structured output semantic items. For example, necessary constraint features include field type requirements, multi-level field dependency requirements, and non-empty requirements for required fields. The model adapter reads the structural constraints that the target model interface can actually carry, forms an effective constraint feature subset that can be actually transmitted through the target model interface, and then forms a semantic mapping loss value based on the necessary constraint features not covered by the effective constraint feature subset.
[0079] The model adapter writes the mapping category encoding, semantic mapping loss value, historical adaptation mapping observation state, and model running state into the corresponding preset positions in the adaptation semantic state. For the same invoked semantic item, different candidate models can generate different semantic mapping loss values. For example, candidate model A can only carry field type constraints for structured output semantic items, while candidate model B can directly carry field type constraints, field dependency constraints, and required field constraints. Therefore, the semantic mapping loss value of candidate model A for the corresponding structured output semantic item is higher than that of candidate model B.
[0080] The model capability relationship graph maintenance module establishes the task requirement node and call semantic item node corresponding to this business request, and reads the registered model service nodes. For each model service node, it reads the model capability status and model running status, establishes model capability relationships between the task requirement node and the model service node with corresponding processing capabilities, establishes adaptation mapping relationships between the model service node and the call semantic item node, and writes the adaptation semantic state and semantic mapping loss value formed by this model adapter into the corresponding adaptation mapping relationship.
[0081] When a structured output task requirement is a necessary task requirement, and a structured output semantic item is an indispensable necessary invocation semantic item, candidate models that are in a state of not supporting mapping for that invocation semantic item will not be included in the candidate model range for the corresponding task requirement. Models in a state of not being able to be invoked will also not be included in the candidate model range for this time.
[0082] For candidate models that are not excluded but have split or downgraded mappings, a mapping penalty coefficient is formed based on the corresponding semantic mapping loss value. This coefficient is then used to attenuate the relationship weight between the corresponding model service node and the calling semantic item node. The greater the semantic mapping loss, the lower the effective relationship weight passed from the calling semantic item to the model service node.
[0083] After candidate model constraints and relation weight adjustments, the model capability relationship graph is input into the knowledge-constrained neural routing network. The knowledge-constrained neural routing network propagates information between task requirement nodes, model service nodes, and calling semantic item nodes. For model service nodes, input information includes model capability state, model running state, task information of connected task requirement nodes, and the corresponding adaptation semantic state of the calling semantic item. After neural network processing, a candidate model routing representation is formed. Then, based on the task requirement item coverage relationship, the initial model combination and the processing allocation relationship between task requirement items and each model are determined.
[0084] For example, when model A satisfies the model capabilities and invocation semantic constraints corresponding to the summary task requirements, and model B satisfies the model capabilities and invocation semantic constraints corresponding to the key object extraction task requirements, processing allocation relationships are established between the summary task requirements and model A, and between the key object extraction task requirements and model B, respectively. The model invocation execution module only sends the corresponding target model invocation request to the model with the aforementioned processing allocation relationship.
[0085] After the outputs of Model A and Model B are returned, the result alignment and conflict resolution module converts the different model outputs into a unified result structure and decomposes them according to the task requirements. The summary content returned by Model A forms a summary result semantic unit and establishes a correspondence with the summary task requirements; the key object content returned by Model B forms a key object result semantic unit and establishes a correspondence with the key object extraction task requirements. The structured result task requirements determine whether the results satisfy the corresponding conditions based on the corresponding fields and data structures.
[0086] When model B fails to return content that satisfies the key object extraction task requirements, the key object extraction task requirements are in an uncovered state. When multiple models produce semantic units of summary results, but different summary results form object relationships that cannot be simultaneously established for the same key object, the summary task requirements are in a result conflict state. At the same time, the model identifier that produces the conflicting results and the corresponding adaptation semantic state of each model are recorded.
[0087] When a conflict exists, the system reads the historical adaptation mapping observation sequence of each source model involved in the conflict for the call semantic item corresponding to the current conflicting task requirement, and forms a historical adaptation reliability based on the time decay of recent observations, historical task completion status, and interface parameter change interval. The historical adaptation reliability corresponding to different call semantic items forms a historical adaptation reliability tensor in a preset order.
[0088] The acceptance weight of semantic units of conflict results is determined based on the historical adaptation confidence tensor. When the highest acceptance weight reaches the preset fusion threshold, the aggregation process continues to be performed on the semantic units of results that meet the fusion conditions; when the highest acceptance weight is lower than the preset fusion threshold, no existing conflict result is directly selected, and a supplementary call request is formed.
[0089] For key objects not covered, the supplementary invocation requirements include the key object extraction task requirements, corresponding invocation semantic items, the original invocation model's corresponding adaptation semantic state, and the already obtained result semantic units. For conflicting task requirements, the supplementary invocation requirements also include conflicting objects, conflicting relationships, and the historical adaptation confidence tensors corresponding to each result semantic unit. After the model capability relationship graph is updated according to the supplementary invocation requirements, candidate model constraints, relationship weight adjustments, and knowledge-constrained neural routing are performed again.
[0090] When the original invocation model uses downgraded mapping for the corresponding necessary invocation semantics, and there are candidate models that use different mapping methods and meet the current task requirements, a supplementary model is determined from the corresponding candidate model range. The supplementary model only receives supplementary invocation descriptions corresponding to task requirements that are not currently covered or conflict with task requirements; task requirements that have already been met are not executed repeatedly.
[0091] After the supplementary model returns its output, it re-forms the result semantic unit and redetermines the requirement coverage status and result conflict status of the corresponding task requirements. When the supplementary result satisfies the corresponding task requirements and eliminates the original result conflict, the result conflict status is updated.
[0092] When all necessary task requirements have obtained result semantic units that meet the corresponding conditions and there are no result conflicts requiring further processing, the aggregation feedback module organizes different processing results according to the task requirements to form an aggregated output. After the aggregated output is formed, the system records the actual task requirements processed by different models, the mapping method of the corresponding invoked semantic items, the semantic mapping loss value, the adopted result semantic units, and the results formed by supplementary calls, and forms model capability observations and adaptation mapping observations accordingly. The model capability relationship graph updates the model capability state and adaptation semantic state based on the observations, and the updated state is used for subsequent business requests.
[0093] Example 2: This example further illustrates the implementation of the model capability relationship graph and the knowledge-constrained neural routing network. The model capability relationship graph adopts a heterogeneous relational data structure, including a set of task requirement nodes, a set of model service nodes, and a set of call semantic item nodes. Task requirement nodes at least include a task requirement identifier, a task requirement semantic representation, a task capability category, and a necessity state; model service nodes at least include a model identifier, a model capability state, and a model running state; call semantic item nodes at least include a call semantic item identifier, a call semantic category, and a necessity state.
[0094] The semantic representation of task requirements is formed by the language coding network based on the content of the task requirements, or by the structured task categories and attributes provided by the business system. Model capability status indicates the processing capability of candidate models for different task requirements; model running status indicates whether the model service currently meets the invocation conditions. The model capability relationship between task requirement nodes and model service nodes includes the capability status of candidate models for the corresponding task requirements and historical model capability observations; the adaptation mapping relationship between model service nodes and invocation semantic item nodes includes the mapping method in the model access capability description, semantic mapping loss value, mapping markers formed by the current business request, and historical adaptation mapping observation status.
[0095] The model capability relationship graph can be stored using a graph data storage structure, or it can be represented using node data tables and relationship data tables. During model routing, corresponding relationship data is formed based on the nodes and relationships involved in the current task. Regardless of the data storage format used, the task requirements, model services, and call semantic items maintain an association that can be read by the knowledge-constrained neural routing network.
[0096] When executing model routing, candidate model constraints are first applied based on the model capability relationship graph. For necessary task requirements, if there is no model capability relationship between the model service node and the corresponding task requirement node that satisfies the necessary model capability conditions, the corresponding model will not be included in the candidate model range corresponding to that task requirement. For necessary invocation semantics, if the corresponding model forms an unsupported mapping state for that invocation semantics, the model will not be included in the candidate model range dependent on the necessary invocation semantics. If the model's running status indicates that the corresponding model currently does not meet the invocation conditions, it will also be excluded from the current candidate model range.
[0097] After candidate model constraints are completed, relation weight adjustments are performed on adaptation mapping relationships with semantic mapping loss. Relationship weight adjustments use a mapping penalty coefficient that is monotonically opposite to the semantic mapping loss value. When the semantic mapping loss value is 0, the corresponding adaptation mapping relationship retains its basic relation weight; as the semantic mapping loss increases, the corresponding relation weight decreases. Relationship weight adjustments only apply to the adaptation mapping relationship between the model service node and the corresponding calling semantic item node, and do not change model capability relationships unrelated to that calling semantic item.
[0098] After knowledge constraint processing and relation weight adjustment, knowledge-constrained neural routing is executed using the remaining model capability relations. The knowledge-constrained neural routing network can be implemented using relational graph convolutional networks, graph attention networks, or heterogeneous graph neural networks. Task requirement nodes transmit task requirement data to connected model service nodes, and semantic item nodes transmit call semantics and adaptation semantic states to model service nodes based on adaptation mapping relationships. Model service nodes then integrate their own model capability states and model running states to form a routing representation.
[0099] The routing results between task requirements and model service nodes are formed based on the routing representation of the model service nodes. When a candidate model can continuously process multiple task requirements with processing dependencies and satisfy the corresponding calling semantic constraints, the multiple task requirements are assigned to the corresponding candidate models; when different task requirements are processed by different candidate models, an initial model combination including multiple models is formed based on the routing results between each task requirement and the candidate models.
[0100] The knowledge-constrained neural routing network uses model capability validation results or historical business call results to form training data. Each training data includes task requirement items, the corresponding model capability relationship graph state, adaptation semantic state, the actual called model, and the task requirement satisfaction state corresponding to the actual model output. As model capability observations and adaptation mapping observations are updated, the dynamic state in the model capability relationship graph changes accordingly, so that the same task requirement can obtain different candidate model constraints, relationship weights, and routing inputs when the model running status or interface adaptation status changes.
[0101] In one implementation, when the same model has multiple different interface versions or different access paths, adaptation mapping relationships are maintained separately for each access path. When different access paths have different mapping states or different semantic mapping loss values for the same call semantic item, the model capability relationship graph records the relationship between the model service and the corresponding access path, and the access path corresponding to the model service is further determined during the model routing process. Thus, while keeping the main model unchanged, the actual model access path adopted is changed according to the adaptation semantic state.
[0102] For historical adaptation reliability, the system saves the adaptation mapping observation status according to the model, invocation semantics, and historical invocation observation sequence number, and simultaneously saves the completion status of the corresponding task requirements. When there is a substantial change in the target model interface in terms of field definition, parameter range, context window, or invocation control method, the interface change observation position is recorded. After a result conflict occurs, the historical adaptation reliability calculation reads the corresponding historical data based on the invocation semantics corresponding to the current conflicting task requirement, and reduces the impact of observation data before the interface version change on the current result conflict handling through interface change attenuation.
[0103] Example 3: This example illustrates the implementation of system deployment, exception handling, feedback updates, and computer-readable storage media. A unified access module is deployed in a computing device and provides a unified request entry point to the business system. Business requests received via different communication methods are converted into a unified call description before entering the model routing process, enabling subsequent model adaptation, model capability relationship processing, and model result processing to use a unified data structure.
[0104] The model adaptation module adopts a registerable model adapter structure. When a new candidate model is added, a corresponding model identifier, model access capability description, and model adapter are established. A corresponding model service node and its association with task requirement nodes and semantic item invocation nodes are added to the model capability relationship graph. When the target model interface changes, the corresponding model access capability description and model adapter conversion rules are updated. When interface changes cause changes in the semantic item invocation mapping method or the effective constraint feature subset, these changes are reflected in the semantic mapping loss value and adaptation semantic status of subsequent business requests and are entered into the model capability relationship graph.
[0105] The model invocation execution module generates invocation status for each actual model invocation. These statuses include at least one of the following: invocation success, connection failure, request timeout, interface rejection, and return structure exception. When a connection failure or interface rejection occurs, the corresponding execution result is transmitted to the model capability relationship graph maintenance module. This module updates the corresponding model execution status based on the model service's operational status. When a model's execution status meets a preset uncallable condition, the corresponding model is excluded during subsequent model routing through candidate model constraints.
[0106] When a model call is successful but the model output cannot be converted into a unified result structure according to the corresponding model adaptation rules, the corresponding model output is identified as structurally unavailable. The structurally unavailable state indicates that the model-returned data cannot be parsed normally by the current unified result conversion rules; the uncovered task requirement item indicates that the model output can be read, but no result semantic unit satisfying the corresponding task requirement conditions is formed. The system records both types of states separately, allowing interface or data structure anomalies and insufficient task processing results to enter different subsequent processing paths.
[0107] For result conflicts, the system distinguishes between ordinary model output differences and adaptation mapping state changes based on the available model output states. When multiple model outputs for the same task requirement differ, but the adaptation semantic state of the corresponding call semantic item does not exist to indicate that the interface mapping affects the result, a result conflict state is formed. The system uses historical adaptation reliability to determine whether supplementary calls are needed, but does not directly form reverse adaptation mapping observations based on the differences.
[0108] When the original model fails to produce a result that satisfies the corresponding task requirements after applying a downgraded mapping for necessary call semantic items, but a supplementary model using a different mapping method produces a result that satisfies the requirements for the same task requirement item, a corresponding reverse adaptation mapping observation is generated. The model access capability description and adaptation mapping observation are maintained separately. The model access capability description represents the mapping relationship at the target model interface rule level, while the adaptation mapping observation represents the dynamic state formed during system operation based on the model call results. Both types of data are used together to form the adaptation semantic state corresponding to subsequent business requests.
[0109] When a substantial change occurs in the model interface, the model adaptation module rereads the model interface definition and updates the model access capability description. For changed call semantics, the relationship between necessary constraint features and effective constraint features is redefined, and the semantic mapping loss value is updated. The interface change status is also transmitted to the historical adaptation reliability calculation process to reduce the impact of historical adaptation mapping observations from earlier interface versions on the current result conflict judgment.
[0110] The system includes a processor and a computer-readable storage medium storing a computer program. When the processor reads and executes the computer program, it performs the following tasks: receiving business requests, forming a unified invocation description, parsing task requirement items and invocation semantic items, model adaptation, extracting necessary constraint features, extracting effective constraint features, forming semantic mapping loss, forming adaptation semantic state, establishing and updating the model capability relationship graph, forming candidate model constraints, adjusting relationship weights, routing knowledge constraints neurally, invoking the model, forming result semantic units, judging requirement coverage, judging result conflicts, forming historical adaptation reliability, supplementing invocation, aggregating results, forming model capability observations, forming adaptation mapping observations, and updating the state.
[0111] Through the above processing, the semantic mapping loss and adaptation semantic state formed in the unified access phase enter the knowledge constraint neural routing process through the model capability relationship graph. The model call results generated by the knowledge constraint neural routing are processed by the task requirement item level results to form new model capability observations and adaptation mapping observations, and the model capability relationship graph is updated again, so that the model interface adaptation, relationship weight adjustment, model routing, model result processing and state feedback form a closed loop data processing relationship.
[0112] Example 4: This example uses the complex multimodal research report analysis business in the financial field as an application scenario to illustrate the specific data processing process of semantic mapping loss quantification, relation weight adjustment, historical adaptation confidence formation, and supplementary invocation. The computing nodes are configured with 8 NVIDIA A100 Tensor Core graphics processors, and the unified access module, model capability relation graph maintenance module, and knowledge constraint neural routing module are deployed in a containerized microservice architecture based on a Kubernetes cluster.
[0113] The unified access module receives business requests sent by the terminal business system. The business request carries a 150-page portable document-formatted financial analysis report, requiring the extraction of hidden debt risk entities from the report, the formation of a risk transmission chain based on the context, and the output of analysis results according to a preset JSON Schema structure.
[0114] The unified access module converts business requests into a unified call description. This unified call description includes request content fields, context association fields, and call control fields. The request content fields include risk entity extraction tasks and risk transmission chain analysis tasks; the context association fields include the data block index corresponding to the full report; and the call control fields are parsed to form structured output semantic items, context constraint semantic items, and termination control semantic items.
[0115] The structured output semantics require the output data to adopt a four-level nested structure and be organized according to preset field types, field hierarchical relationships, and required field rules. The context constraint semantics require the target model to be able to handle a range of related text exceeding 100,000 tokens. The termination control semantics specifies the stopping conditions that need to be recognized when the model output ends.
[0116] The model adaptation module calls the corresponding model adapter for each of the multiple candidate models. For an open-source candidate model A with 130 billion parameters, model adapter A reads the model access capability description. This description records that the current model interface of candidate model A can natively support a flat key-value structure, but cannot directly support nested structures exceeding two levels. Therefore, model adapter A generates a degradation mapping mark for the structured output semantic items.
[0117] Model adapter A extracts a subset of necessary constraint features from the structured output semantic items. In this embodiment, the subset of necessary constraint features includes three necessary constraint features: field type strong validation constraints, multi-level nested subordinate association constraints, and required field non-empty constraints. Based on the actual carrying capacity of the model interface of candidate model A, the model interface can directly carry field type strong validation constraints, but cannot natively carry multi-level nested subordinate association constraints and required field non-empty constraints through the current interface. Therefore, the effective constraint feature subset includes field type strong validation constraints, totaling one effective constraint feature.
[0118] Based on the necessary constraint feature subset and the effective constraint feature subset, model adapter A determines the semantic mapping loss value according to equation (1). The severity adjustment coefficient is set to 1.5, the total number of necessary constraint features is 3, and the number of necessary constraint features not covered by the effective constraint feature subset is 2. According to the corresponding calculation, the semantic mapping loss value of candidate model A for the structured output semantic item is 0.632.
[0119] In this embodiment, the adaptation semantic state uses a 128-dimensional state tensor. The first preset position of the state tensor records the mapping category code, the second preset position records the semantic mapping loss value, the third preset position records the historical adaptation mapping observation state of the corresponding invoked semantic item, the fourth preset position records the model running state, and the remaining preset positions are used to record the interface carrying features formed by the model access capability description and other states corresponding to the currently invoked semantic item. Model adapter A writes 0.632 into the preset position used to record the semantic mapping loss of the structured output semantic item.
[0120] For candidate model B, which can directly carry preset structured output constraints through the model interface, the corresponding model adapter B forms a direct mapping mark for the structured output semantic items. Since field type strong validation constraints, multi-level nested subordinate association constraints, and required field non-empty constraints can all be directly carried through the corresponding interface of candidate model B, the semantic mapping loss value of candidate model B for the structured output semantic items is set to 0.
[0121] The model capability graph maintenance module receives the adaptation semantic state passed by each model adapter and updates the model capability graph. The model capability graph includes task requirement nodes corresponding to the current business request, model service nodes corresponding to candidate model A and candidate model B, and call semantic item nodes corresponding to structured output semantic items, context constraint semantic items, and termination control semantic items.
[0122] The knowledge-constrained neural routing module performs candidate model constraints and relationship weight adjustments based on the updated model capability relationship graph. In this embodiment, a linear mapping penalty relationship is used for semantic mapping loss, with a preset loss sensitivity weight of 0.8. The semantic mapping loss value is multiplied by the loss sensitivity weight, and the result is subtracted from 1 to obtain the mapping penalty coefficient; when the result is less than 0, the mapping penalty coefficient is set to 0.
[0123] Candidate model A has a semantic mapping loss of 0.632 for the structured output semantic item, and the corresponding mapping penalty coefficient is 0.4944 according to the linear mapping penalty relationship. The knowledge-constrained neural routing module multiplies the basic relationship weight between the model service node and the structured output semantic item node of candidate model A by 0.4944 to obtain the relationship weight entering the knowledge-constrained neural routing network. Candidate model B has a semantic mapping loss of 0 for the structured output semantic item, and the corresponding mapping penalty coefficient is 1. Therefore, candidate model B maintains the basic relationship weight for the adaptation mapping relationship.
[0124] After the aforementioned relational weight adjustments, candidate model A contributes less information to the propagation path of structured output semantic items than candidate model B. The knowledge-constrained neural routing network simultaneously forms routing representations based on the task processing capabilities, contextual constraint adaptation status, and model running status of each candidate model. In this embodiment, the knowledge-constrained neural routing module determines that candidate model B and another candidate model C, which meets the long text processing conditions, form an initial model combination. Candidate model B handles structured risk entity extraction, while candidate model C handles long text contextual association analysis.
[0125] The model invocation execution module sends target model invocation requests to candidate model B and candidate model C respectively. After candidate model B and candidate model C return their model outputs, the result alignment and conflict handling module converts the outputs of the two models into a unified result structure and decomposes them into result semantic units according to the current task requirements.
[0126] For the task requirement item of risk entity extraction, candidate model B forms the first result semantic unit, which records that the target entity has implicit guarantee risk with a risk exposure of 500 million yuan; candidate model C forms the second result semantic unit, which records that the target entity has operating cash flow disruption risk and no implicit guarantee was identified. The result alignment and conflict handling module determines, based on the difference in the risk object status of the two result semantic units, that the two result semantic units cannot simultaneously be used as the determination result for the same risk entity extraction task requirement item, thus creating a result conflict state.
[0127] After a result conflict is established, the result alignment and conflict handling module reads the historical adaptation mapping observation state sequences of candidate model B and candidate model C on the structured output semantic items and context constraint semantic items corresponding to the current conflict task requirements. The historical adaptation mapping observation state sequences are saved in the order of the invocation of observations, and each historical invocation observation also saves the completion status of the corresponding task requirement item and the model interface change status.
[0128] The result alignment and conflict resolution module calculates the historical adaptation reliability based on the historical adaptation mapping observation state sequence, and forms a historical adaptation reliability tensor according to the order of the invocation semantic items corresponding to the current conflict task requirement items. In this embodiment, based on the stored historical invocation observation sequence, the acceptance weight of candidate model B corresponding to the first result semantic unit is 0.89, and the acceptance weight of candidate model C corresponding to the second result semantic unit is 0.42.
[0129] In this embodiment, the preset fusion threshold is set to 0.90. Since the highest acceptance weight of 0.89 in the two current result semantic units is lower than the preset fusion threshold of 0.90, the result alignment and conflict handling module does not directly select the first result semantic unit or the second result semantic unit as the determination result of the risk entity extraction task requirement item, but forms a supplementary calling requirement.
[0130] The supplementary invocation requirement retains the currently identified conflict object, the first result semantic unit, the second result semantic unit, the corresponding context index, and the historical adaptation confidence tensors corresponding to candidate model B and candidate model C. The supplementary invocation requirement and the invocation semantic item corresponding to the current conflict task requirement are jointly written into the model capability relationship graph.
[0131] The knowledge-constrained neural routing module re-executes candidate model constraints and relation weight adjustments based on supplementary invocation requirements. In this embodiment, candidate model D has a native context processing range of 200,000 lexical units, and its corresponding model interface can directly map the current structured output semantic items and context constraint semantic items. Candidate model D meets the model capability conditions corresponding to the current conflict task requirements and has a different adaptation mapping state with the invocation path that produces the conflict result. Therefore, the knowledge-constrained neural routing module determines candidate model D as the supplementary model.
[0132] The supplementary call description sent to candidate model D no longer includes the requirements for processing regular financial data fields that have already been completed and do not conflict. Instead, it retains the content and context indexes that directly correspond to implicit guarantee risks, cash flow disruption risks, and the corresponding chains of evidence. After candidate model D returns the supplementary model output, the results are aligned with the conflict resolution module to form a supplementary result semantic unit.
[0133] The supplementary result semantic unit supports the risk object judgment of the first result semantic unit regarding implicit guarantee risk, and extracts data related to the related party fund pool agreement from the corresponding content on page 87 of the report. The result alignment and conflict handling module re-executes the consistency judgment based on the supplementary result semantic unit and the existing result semantic unit to eliminate the result conflict state corresponding to the current risk entity extraction task requirement item.
[0134] The aggregation feedback module generates an aggregated output based on the updated semantic units of the results, and simultaneously records the task processing status, adaptation mapping status, and result adoption status of candidate models B, C, and D in this call. Candidate model D processes the current structured output semantic items through direct mapping and generates results that satisfy the corresponding structural conditions and task requirements, forming corresponding positive adaptation mapping observations. The corresponding adaptation mapping observations are written back to the model capability relationship graph for model routing in subsequent identical or related business requests.
[0135] In the system test of this embodiment, a test set consisting of 20,000 high-concurrency business requests was used to compare the traditional load balancing round-robin routing, static parameter capability baseline routing, and the model routing mechanism of this embodiment. All three routing methods used the same set of business requests and the same set of candidate models.
[0136] The structured field strict fit rate represents the proportion of business requests in the final aggregated output that meet the constraints of preset field types, nesting relationships, and required fields out of the total number of test business requests; the model scheduling output conflict occurrence rate represents the proportion of business requests that generate conflicting task requirements after the initial model call out of the total number of test business requests; the invalid token computation resource consumption ratio represents the proportion of tokens that did not enter the final aggregated output and were generated by uncovered tasks, repeated complete calls, or excluded conflict results out of the total number of tokens in the model output; the average complex multi-requirement conflict handling time represents the average processing time from the formation of a result conflict state to the corresponding conflicting task requirement reaching the termination condition.
[0137] Table 1 shows the performance verification data for multi-model collaborative scheduling;
[0138] Strict fit of structured fields 62.4% 71.8% 98.3% An increase of 26.5 percentage points Model scheduling output conflict rate 24.1% 19.5% 7.2% Decreased by 12.3 percentage points Invalid lexical computational resource consumption ratio 38.6% 31.4% 11.5% Decreased by 19.9 percentage points Average time spent handling complex, multi-demand conflicts 4.8s 4.5s 1.2s Reduced by 3.3 seconds
[0139] Based on the above test results, under the same set of business requests and candidate models, after applying semantic mapping loss to the adaptation mapping relationship in the knowledge-constrained neural routing, the system can reduce the impact of model paths whose interfaces cannot fully bear the necessary call constraints on the routing results before model calls, so that model access paths that meet the structured output constraints can obtain the corresponding relationship propagation advantages.
[0140] After a conflicting state is formed, a historical adaptation confidence tensor is generated based on the historical adaptation mapping observation state sequence. A preset fusion threshold is used to determine whether to execute a supplementary call. This allows the system to re-determine a supplementary model for specific conflict task requirements when the existing adaptation history of conflicting results is insufficient to support direct acceptance, without repeatedly executing other task requirements that have already been met. The results generated by the supplementary call and the adaptation mapping observations continue to update the model capability relationship graph, forming a continuous data processing closed loop involving semantic mapping loss, model routing, conflict handling, and adaptation state updates.
[0141] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.
[0142] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. It should be noted that any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A unified access and aggregation method for multi-source heterogeneous large models, characterized in that, Includes the following steps: S1: Receive business requests, form a unified invocation description, and parse task requirements and invocation semantics; S2: Based on the model access capability description of the candidate model, the unified call description is converted into a target model call request through the model adapter; for the call semantic item of split mapping or downgrade mapping, the necessary constraint feature subset and the effective constraint feature subset actually carried by the target model interface are extracted, and a semantic mapping loss value is formed based on the difference between the necessary constraint feature subset and the effective constraint feature subset, and the semantic mapping loss value is written into the adaptation semantic state. S3: Write the task requirement item, the candidate model, the invocation semantic item, and the adaptation semantic state into the model capability relationship diagram. Limit the range of candidate models according to the necessary model capabilities, necessary invocation semantic conditions, and model running state. Form a mapping penalty coefficient according to the semantic mapping loss value. Attenuate the relationship weight between the corresponding model service node and the invocation semantic item node in the knowledge-constrained neural routing network to determine the initial model combination and the processing allocation relationship between the task requirement item and the candidate model. S4: Call the initial model combination, convert the model output into a unified result structure and decompose it into result semantic units corresponding to the task requirement items, forming a requirement coverage state and a result conflict state; S5: When there are uncovered task requirements in the requirement coverage state or conflicting task requirements in the result conflict state, a supplementary call requirement is formed, the model capability relationship graph is updated, and a supplementary model is determined through the knowledge constraint neural routing network to obtain a supplementary result semantic unit. S6: Generate an aggregated output based on the result semantic unit, the adaptation semantic state, the requirement coverage state, and the result conflict state, and update the model capability state and the adaptation semantic state based on the model capability observation and adaptation mapping observation formed in this call, for model routing of subsequent business requests.
2. The unified access and aggregation invocation method for multi-source heterogeneous large models according to claim 1, characterized in that, The unified invocation description includes a request content field, a context association field, and an invocation control field; the task requirement item is formed based on the request content field and the context association field, and is used to represent the content requirements that the model output needs to meet in the business request; the invocation semantic item is formed based on the invocation control field and the data associated with the invocation control field, and includes at least one of the following: system instruction semantic item, context constraint semantic item, tool invocation semantic item, structured output semantic item, modal input semantic item, streaming return semantic item, and end control semantic item.
3. The unified access and aggregation invocation method for multi-source heterogeneous large models according to claim 1, characterized in that, The model access capability description records the mapping methods supported by the target model interface for each call semantic item. When the model adapter transforms the target model call request, it forms direct mapping markers, equivalent transformation markers, split mapping markers, downgraded mapping markers, or unsupported mapping markers for the call semantic items involved in this business request. For the split mapping markers and downgraded mapping markers, the semantic mapping loss value is formed based on the proportion of necessary constraint features not covered by the effective constraint feature subset to the total number of necessary constraint features and the preset severity adjustment coefficient. The mapping category code, semantic mapping loss value, historical adaptation mapping observation state, and model running state are written into the corresponding preset positions in the state tensor contained in the adaptation semantic state.
4. The unified access and aggregation invocation method for multi-source heterogeneous large models according to claim 1, characterized in that, The model capability relationship graph includes at least task requirement nodes, model service nodes, and call semantic item nodes. A model capability relationship is established between the task requirement nodes and the model service nodes to represent the capability status of the candidate model in handling the corresponding task requirement item. An adaptation mapping relationship is established between the model service nodes and the call semantic item nodes to represent the mapping status of the model interface in handling the corresponding call semantic item. The mapping penalty coefficient is jointly determined by the semantic mapping loss value and the preset loss sensitivity weight, and decreases as the semantic mapping loss value increases. The knowledge-constrained neural routing network uses the mapping penalty coefficient to perform multiplicative decay on the relation weights of the corresponding adaptation mapping relationship, and performs information propagation between nodes according to the model capability relationship and the decayed adaptation mapping relationship to form the routing representation corresponding to each candidate model.
5. The unified access and aggregation invocation method for multi-source heterogeneous large models according to claim 4, characterized in that, Before the knowledge-constrained neural routing network generates model routing results, candidate model constraints are formed based on the necessary model capabilities corresponding to the task requirements, the necessary call control conditions corresponding to the call semantics, and the model running status. Models that do not meet the necessary model capabilities, cannot complete the necessary call semantic mapping, or are in an uncallable state are excluded from the current candidate model range. The knowledge-constrained neural routing network then determines the model routing results from the excluded candidate model range.
6. The unified access and aggregation invocation method for multi-source heterogeneous large models according to claim 1, characterized in that, When determining the initial model combination, a processing allocation relationship between the task requirements and the candidate models is established based on the processing dependencies between the task requirements and the task requirements that each candidate model can handle, so that the initial model combination covers all necessary task requirements, and the target model call request is sent only to the candidate models that have the corresponding task requirement processing allocation relationship.
7. The unified access and aggregation invocation method for multi-source heterogeneous large models according to claim 1, characterized in that, After converting the model output into a unified result structure, the model output is divided into one or more result semantic units based on the identifier of the task requirement item, the semantic representation of the task requirement item, and the content boundaries in the model output. A correspondence is established between each result semantic unit and one or more task requirement items. When any necessary task requirement item does not have a result semantic unit that satisfies the necessary fields, key objects, object relationships, or output structure conditions corresponding to that task requirement item, the necessary task requirement item is determined as an uncovered task requirement item.
8. The unified access and aggregation invocation method for multi-source heterogeneous large models according to claim 7, characterized in that, When the same task requirement item corresponds to multiple result semantic units, semantic consistency judgment and structural consistency judgment are performed on the multiple result semantic units. When the multiple result semantic units have differences in the key objects, object relationships, constraint values or output structures required by the task requirement item that cannot be met at the same time, the corresponding task requirement item is identified as a conflicting task requirement item, and the model identifier that generates the difference and its corresponding adaptation semantic state are recorded. For each result semantic unit that generates a result conflict state, the historical adaptation mapping observation state sequence of the corresponding candidate model on the calling semantic item corresponding to the conflicting task requirement item is extracted, and the historical adaptation mapping observation state sequence is used to form the historical adaptation confidence tensor corresponding to each result semantic unit based on the time decay mechanism and the historical adaptation mapping observation state sequence.
9. A unified access and aggregation invocation system for multi-source heterogeneous large models, used to execute the unified access and aggregation invocation method for multi-source heterogeneous large models as described in any one of claims 1-8, characterized in that, It includes a unified access module, a model adaptation module, a model capability relationship graph maintenance module, a knowledge constraint neural routing module, a model call execution module, a result alignment and conflict handling module, and an aggregation feedback module; The unified access module is used to receive business requests, generate a unified call description, and parse task requirement items and call semantic items. The model adaptation module includes model adapters corresponding to multiple candidate models, used to convert the unified call description into a target model call request according to the corresponding model access capability description, and form an adaptation semantic state according to the mapping method of the call semantic item in the target model interface. When forming a split mapping mark or a downgrade mapping mark, a semantic mapping loss value is formed according to the necessary constraint feature subset of the call semantic item and the effective constraint feature subset actually carried by the target model interface and written into the adaptation semantic state. The model capability relationship graph maintenance module is used to establish and update the model capability relationship graph, so that task requirement items, candidate models, calling semantic items, model capability status, semantic mapping loss value and adaptation semantic status are associated. The knowledge-constrained neural routing module is used to form candidate model constraints based on the model capability relationship graph, form a mapping penalty coefficient based on the semantic mapping loss value and adjust the relation weights of the corresponding adaptation mapping relationship, and use the knowledge-constrained neural routing network to determine the initial model combination or supplementary model under the candidate model constraints. The model invocation execution module is used to invoke the initial model combination or the supplementary model through the corresponding model adapter and obtain the model output; The result alignment and conflict handling module is used to convert the model output into a unified result structure, decompose the model output into result semantic units corresponding to the task requirement items, and form requirement coverage state and result conflict state. When forming the result conflict state, a historical adaptation mapping observation state sequence corresponding to the conflicting task requirement item is used to form a historical adaptation confidence tensor, and a supplementary call requirement is formed when the supplementary call triggering condition is met. The aggregation feedback module is used to form an aggregation output based on the result semantic unit, the adaptation semantic state, the historical adaptation confidence tensor, the demand coverage state, and the result conflict state, and to form model capability observation and adaptation mapping observation to update the model capability state and adaptation semantic state. The system further includes a processor and a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the processor executes the computer program, it controls the unified access module, the model adaptation module, the model capability relationship graph maintenance module, the knowledge constraint neural routing module, the model call execution module, the result alignment and conflict handling module, and the aggregation feedback module to perform corresponding processing.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the unified access and aggregation invocation method for a multi-source heterogeneous large model as described in any one of claims 1 to 8.