Multi-model inference method, device, medium and program product based on graph structure
By constructing a directed acyclic graph (DAG) to explicitly represent model relationships, and combining optimization algorithms and mechanisms, the problems of rigid path planning and insufficient version consistency in multi-model collaborative analysis are solved, achieving efficient and interpretable attribution analysis, which is suitable for complex business scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING NEUSOFT VIEWHIGH CO LTD
- Filing Date
- 2025-10-30
- Publication Date
- 2026-07-14
AI Technical Summary
In existing multi-model collaborative analysis systems, the model relationships are not explicitly structured and lack graph structure optimization capabilities, resulting in low execution efficiency, rigid path planning, redundant data access, and insufficient version consistency, making it difficult to achieve efficient and interpretable attribution analysis in complex business scenarios.
By employing a graph-based multi-model inference method, the attribution relationships of the analysis models are explicitly analyzed. Graph computation is used to optimize the inference path. Combined with topological sorting, bundle search, threshold pruning, and early stopping mechanisms, the efficiency and controllability of path traversal are achieved. Furthermore, the traceability and execution performance of the analysis process are ensured through observability checkpoints and version consistency mechanisms.
It achieves efficient path planning for multi-model collaborative analysis, improves execution performance and interpretability, ensures the accuracy and real-time nature of analysis, supports flexible attribution needs in complex scenarios, and has self-adjusting and optimization capabilities.
Smart Images

Figure CN121503659B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic digital data processing, and in particular to a multi-model reasoning method based on graph structures. Background Technology
[0002] In data analytics and decision support systems, complex business problems often require the collaborative work of multiple analytical models. These models have complex dependencies and diverse call paths, and attribution analysis often needs to perform deep backtracking within limited time and computing resources. For example, in hospital operations management, identifying a "declining profit" problem might require analyzing multiple aspects such as revenue changes, cost structure, disease composition, and case grouping (DRG) to pinpoint the root cause. In existing technologies, multi-model collaborative analysis typically relies on manually pre-arranging call chains or on a scheduling engine executing them in a fixed sequence during runtime. This approach has the following shortcomings:
[0003] 1) Model relationships are not explicitly structured: Existing systems often embed model relationships in business process configurations, script calls, or static dependency tables, lacking a unified machine-readable structure to express causal relationships, dependency directions, weight priors, and drill-down dimensions between models, which makes it impossible for the system to automatically deduce the optimal execution path or dynamically adjust the links.
[0004] 2) Lack of graph structure optimization capability in inference chain construction: In multi-model inference scenarios, different models may have multiple reachable paths, cross-layer jump relationships, or parallel dependencies. Existing solutions mostly adopt linear sequential execution, which cannot optimize execution efficiency and result quality, and it is also difficult to select the optimal path based on conditions during task execution.
[0005] 3) Inefficient attribution analysis: When the analysis target needs to trace back multiple driving factors, the existing system often performs full calculations layer by layer, lacking means to reduce unnecessary node execution, resulting in response delays and waste of computing resources, and failing to ensure the integrity of the analysis while taking into account performance and real-time performance.
[0006] 4) Insufficient optimization of model data access and execution can easily lead to performance bottlenecks in the execution process.
[0007] 5) Insufficient version consistency and traceability: The model definition and call chain updates are not synchronized, which can easily lead to inconsistencies between the graph structure and the model version, affecting the accuracy of the results. At the same time, the lack of observable records of the traversal and execution process makes it difficult to backtrack and verify the analysis process.
[0008] Although existing technologies, such as reasoning chain methods driven by large language models, can achieve automatic mapping from natural language to multi-model sequential links, their model relationship expressions are still mainly linear, resulting in low execution efficiency, rigid path planning, redundant data access, and insufficient traceability. The intelligence, performance, and interpretability of multi-model collaborative analysis are also insufficient. Summary of the Invention
[0009] This invention provides a multi-model inference method, device, medium, and program product based on graph structure. By explicitly analyzing model attribution relationships and utilizing graph computation to optimize inference paths, it improves inference execution efficiency and enhances the intelligence, performance, and interpretability of multi-model collaborative analysis.
[0010] In a first aspect of the present invention, a multi-model reasoning method based on graph structure is provided, the method comprising the steps of:
[0011] S1: Query the task target node in the graph database and start from it. Traverse the graph database according to the corresponding driving model to expand the inference path. The graph database includes multiple directed acyclic graphs. Each directed acyclic graph is mapped from the metadata of the registered analysis model. Each analysis model corresponds to an analysis problem and includes an attribution field. The attribution field includes a driving model subfield for listing the upstream analysis model IDs that this model depends on, an influence model subfield for listing the downstream analysis model IDs that the result of this model will affect, an edge weight prior subfield for indicating the historical attribution strength of the dependency relationship indicated by the driving model subfield and the influence model subfield, a dimension label subfield for indicating the attribution dimension, and a trigger condition subfield for indicating the path control rule. The nodes of the directed acyclic graph represent analysis model instances, and the edges of the directed acyclic graph represent the dependency relationships between analysis models and are accompanied by edge weight priors, dimension labels, and trigger condition attributes.
[0012] S2: Generate a task topology execution graph based on the model nodes and corresponding driving models involved in the extended inference path, where each node in the task topology execution graph represents a model instance to be executed, and the edges represent the dependencies between model instances to be executed.
[0013] S3: Schedule the actual execution of each model node in sequence according to the task topology execution graph to obtain the interpretation result corresponding to the task target node. Each model node is only added to the scheduling queue after all its upstream nodes have completed execution and successfully returned data.
[0014] In a second aspect of the invention, a computer device is provided, including a processor, a memory, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described in the first aspect.
[0015] In a third aspect of the invention, a computer-readable storage medium is provided having a computer program / instructions stored thereon, characterized in that the computer program / instructions, when executed by a processor, implement the steps of the method described in the first aspect.
[0016] In a fourth aspect of the invention, a computer program product is provided, comprising a computer program / instructions, characterized in that, when executed by a processor, the computer program / instructions implement the steps of the method described in the first aspect.
[0017] Compared with existing multi-model inference methods, the present invention has the following advantages:
[0018] 1) Explicit management of attribution relationships: By combining model assets with graph structures, information such as inter-model dependencies, edge weights (weights) priors, and dimension labels are explicitly stored in the form of graph structures, realizing the persistence, visualization, and versioning of relationships, avoiding the problems of implicit coupling and difficulty in tracing dependencies in traditional solutions.
[0019] 2) Efficient Path Planning: By introducing a combination of topological sorting, bundle search, threshold pruning, and early stopping mechanisms on a directed acyclic graph (DAG), efficient and controllable path traversal is achieved. This ensures attribution analysis coverage while reducing complexity and response latency, enabling near real-time inference in complex multi-level scenarios, outperforming existing technologies that rely solely on sequential traversal or a single search strategy.
[0020] 3) Execution performance optimization: Reduce redundant calculations and I / O accesses by batch data retrieval, pre-aggregation, result caching and result reuse; combined with dynamic degradation and asynchronous recovery mechanisms, ensure overall execution performance when high latency or high cost models exist, and improve near real-time inference capabilities.
[0021] 4) Full Observability and Version Consistency: Observability checkpoints are set up at key stages to record execution parameters, output results, time consumption, and resource usage, forming full-link traceability capability; at the same time, by synchronizing the model version with the graph relationship version, the model instances and dependencies called in the inference link are ensured to be consistent, avoiding deviations in analysis results caused by version inconsistencies.
[0022] 5) Feedback-driven adaptive optimization: Based on observable data, the edge weights, triggering conditions, and dimension labels of the graph structure are dynamically adjusted to optimize path priority; at the same time, the bundle search width, pruning threshold, and early stopping conditions of the execution layer are adjusted so that the system can continuously improve path planning and execution efficiency according to actual operation, and has the ability to self-regulate and continuously optimize.
[0023] 6) Adapt to complex attribution scenarios: Supports cross-level jump paths and conditional rollback, and can flexibly respond to multi-level and multi-dimensional attribution needs. For example, in medical revenue analysis, it can drill down directly from the whole hospital to the disease level, ensuring the flexibility and robustness of the analysis link.
[0024] Other features and advantages of the present invention will become clearer after reading the detailed description of the embodiments of the present invention in conjunction with the accompanying drawings. Attached Figure Description
[0025] Figure 1 This is a flowchart of an embodiment of the method according to the present invention.
[0026] For clarity, these figures are schematic and simplified, showing only the details necessary for understanding the invention, while omitting other details. Detailed Implementation
[0027] The embodiments and examples of the present invention will now be described in detail with reference to the accompanying drawings.
[0028] The scope of the invention will become apparent from the detailed description given below. However, it should be understood that while the detailed description and specific examples illustrate preferred embodiments of the invention, they are given for illustrative purposes only.
[0029] The analysis model library includes two or more analysis models, each corresponding to an analysis question such as "Are the costs of cardiology departments abnormal in the past six months?" and encapsulated in a JSON file. The schema structure of each analysis model may include basic metadata, data access, input parameters, analysis logic, output structure, interpretation rules, and relationships. The relationships field includes the drivers subfield (listing the upstream analysis model IDs that this model depends on), the impacts subfield (listing the downstream analysis model IDs that the model's results will affect), the weight hint subfield (representing the historical attribution strength of the dependencies indicated by the drivers and impacts subfields), the dimension tags subfield (representing the attribution dimensions), and the conditions subfield (representing the triggering conditions for path control rules). During the model registration phase, core metadata of the analytical model is collected and stored, including a unique identifier (model_id), version number, business domain, execution type, input / output schema, and data access description. The registered analytical model is then stored as a model asset.
[0030] The metadata of the analytical models in the analytical model library is mapped to a Directed Acyclic Graph (DAG). Nodes in the DAG represent analytical model instances, and edges represent dependencies (drivers, impacts) between analytical models, along with attributes such as edge weight hints, dimension tags, and trigger conditions. Trigger conditions are a set of pre-judgment logic that must be satisfied before a model path is included in the inference chain for execution. They control the effectiveness of path expansion, avoiding redundant path traversal and invalid model execution. These are added control edge attributes during DAG construction to improve execution efficiency and control granularity in the path planning phase. They are set by domain experts and data engineers when constructing dependencies between models, serving as path control rules. The addition of trigger conditions significantly reduces the number of invalid paths and is a pre-control measure for the bundle search + pruning + early stopping strategy. The graph structure is stored in a graph database (such as Memgraph, Neo4j, etc.) that supports high-performance querying and traversal, enabling persistent, versionable, and incremental updates of relational data.
[0031] When adding or adjusting an analysis model, the local structure of the DAG can be dynamically updated without requiring a full reconstruction. Specifically, when adding or adjusting a model, the upstream and downstream nodes related to the changed model can be located based on the dependency information in the model definition, forming a local subgraph, and the corresponding incremental update operation can be performed in the graph database.
[0032] - When adding a new model, insert the new model node and its inbound and outbound edges;
[0033] - When adjusting dependencies, update the direction, weight, dimension label, and other attributes of existing edges;
[0034] - When deleting a dependency, remove the corresponding edge and check if it affects connectivity.
[0035] After the graph structure is updated, the topology sequence, path cache, and other auxiliary indexes of the affected areas are automatically refreshed to avoid triggering a full graph reconstruction. At the same time, all changes are marked with version identifiers to ensure the traceability of model relationships, and the execution scheduling module is notified through an event mechanism so that the latest version of the graph structure can be used for path planning and task scheduling, thereby realizing the dynamic evolution of the graph structure and the maintenance of local consistency.
[0036] Figure 1 A flowchart of a preferred embodiment of the graph-based multi-model reasoning method according to the present invention is shown.
[0037] In step S1, the task target node in the graph database is queried and, starting from it, the inference path is extended by traversing the graph database according to the corresponding driving model.
[0038] During path reasoning, before extending to a certain model node, the system reads the triggering conditions of that edge and determines whether they are met. If they are not met, the path branch is skipped.
[0039] In this embodiment, inference path expansion is based on topology sorting and bundle search algorithms. Topology sorting constructs an initial node execution sequence and ensures that the execution of each model node follows its dependent nodes. During execution, the system always starts from the target problem (task target node, starting model) and searches upwards for its predecessor models according to the "dependency" relationship described by the drivers subfield of the analysis model. Path execution always follows the direction from the "depended model" to the "downstream model that depends on this model". The impact subfield of the analysis model is not used for path expansion or scheduling control; it is only used to establish reverse dependencies during graph structure initialization, i.e., marking which other models the output of a certain model will be used for. Combined with drivers, it is used to derive the complete graph structure relationships. Subsequently, the bundle search algorithm is used to control the number of inference path expansions. The "degree of control" over the number of path expansions is explicitly set by the following three types of dynamically adjustable parameters:
[0040] - Beam width: The number of paths retained per layer (e.g., setting it to 5 means that a maximum of 5 highest-scoring paths will be expanded per round);
[0041] - Pruning threshold (prune_threshold): Paths with scores below this value are discarded;
[0042] - Early stop threshold (stop_threshold): The extension will be terminated when the cumulative interpretation intensity reaches a certain value (such as 80%) or the system resource usage reaches the limit.
[0043] These three factors together constitute the hard boundary and soft constraint of path expansion, which is a configurable execution strategy with a clear, observable, and adjustable degree of control.
[0044] The number of inference path extensions is controlled by one or more of the following:
[0045] - In the path expansion of each layer, only the paths with the highest scores and the number of paths indicated by the bundle width are retained to avoid path explosion due to too many connections between models.
[0046] - Paths with scores below the pruning threshold are discarded, meaning they are no longer expanded further to save computational resources. The system can set a pruning threshold, `prune_threshold`, which is usually a normalized floating-point number (e.g., 0.4). When a path score is less than this value, it is considered a "low-priority path" and is not expanded. The pruning threshold can be configured based on domain expert experience or dynamically adjusted according to the total number of paths or resource consumption (described in detail below) to ensure that the path expansion process focuses on the set of paths with stronger interpretability and lower resource cost; and
[0047] - If the cumulative explanation strength or detected resource usage of some paths in the current path set has reached the early stopping threshold, the further expansion of the inference path will be terminated. This avoids the expansion of low-contribution paths after the explanation contribution has become saturated, thereby avoiding resource overload and improving overall response efficiency.
[0048] The route score can take into account the following factors and be ranked according to a weighted formula (configurable):
[0049] - Weight hint: Indicates the historical attribution strength or importance of the path;
[0050] - Dimension_match_score: Whether the path dimension matches the current problem context. For example, if the analysis object is "department", then paths that include the "department" label will be given priority.
[0051] - Explain success rate: The frequency with which the model has provided effective attribution results in similar tasks in the past, i.e., its contribution to the explanation of results in historical attribution tasks;
[0052] - Execution resource cost (resource_cost): The model's historical average execution time and computational load. The lower the score, the higher the efficiency.
[0053] The success rate of historical interpretation of the model can be derived in the following way:
[0054] - The frequency with which this model appears in the final explanation path in attribution tasks;
[0055] - In the execution results, the percentage of the metrics returned by the model in the interpretations accepted or adopted by the end users;
[0056] - In multi-round dialogues, the model's output was not questioned by users or rerun multiple times, which can be used as a basis for judging its validity.
[0057] The system automatically maintains the historical explanatory success rate attribute for each model node by performing statistical analysis on the attribution logs (described below).
[0058] Cumulative explain power is a control parameter used during the inference phase to determine whether a path is "sufficiently explainable" of the problem. It represents the degree to which the problem metrics are cumulatively covered in the currently expanded path set. Its calculation method is as follows:
[0059] Suppose the user's question is "Why is the hospital's total revenue declining?", the system's ultimate goal is to explain the fluctuations in this metric.
[0060] Each attribution path carries an "influence weight" label (such as edge weight prior weight_hint × model score), and the cumulative explanatory strength is the ratio of the total influence of the current path set to the degree of target fluctuation (e.g., the current path explains 85% of the decrease).
[0061] The resources mentioned above refer to the real-time computing resource consumption during the inference process, which mainly include: CPU utilization (model concurrent execution pressure), memory usage (model execution results and path cache space), network bandwidth (if the model data retrieval involves a remote database), and path number threshold (e.g., the total number of currently expanded paths ≥ the set maximum number of paths).
[0062] Traditional attribution paths follow a strict hierarchical relationship (e.g., hospital-wide → hospital area → department → disease). However, in real-world attribution scenarios, such as medical revenue analysis, there may be a need to drill down directly from the hospital-wide model to the disease level, skipping certain intermediate levels. To achieve this capability, in this embodiment, the system allows directed edges with non-continuous levels when constructing the Directed Acyclic Graph (DAG). For example, it allows direct connections from the "hospital-wide revenue model" to the "disease structure analysis model," as long as the input and output fields of both are compatible and a clear driver / impact relationship is set in the model definition. The system can then establish cross-level connections. During path expansion, the path scoring function does not force "hierarchical integrity" as a hard constraint, but rather scores based on a combination of factors such as edge weight priors, dimension label matching, and historical interpretation success rate. High-scoring cross-level paths can normally enter the bundle search queue and participate in the final inference chain construction, thereby supporting dynamic penetration of the hierarchical structure and achieving cross-level jumps.
[0063] When an intermediate-level model in a path is pruned or downgraded due to missing data, execution failure, low score, or other reasons, the system can attempt to find alternative paths through a conditional fallback strategy to ensure the overall attribution chain remains closed. Specifically, a set of candidate model nodes for each layer can be set during path expansion; if an intermediate-level node in the main path is removed, the system will attempt to fall back to the previous node; among the candidate connection edges of that node, it will re-evaluate whether it can skip the current layer and directly connect to the next-next-layer model; if there are candidate edges with scores higher than the pruning threshold, the system will retain the fallback path. All fallback paths can be labeled "non-critical path" and participate in subsequent asynchronous completion mechanisms.
[0064] In step S2, a task topology execution graph is generated based on the model nodes and corresponding driver models involved in the extended inference path. Each node in the task topology execution graph represents a model instance to be executed, and edges represent the dependencies between model instances to be executed. Before scheduling, the system generates this graph structure for each path and uniformly constructs a DAG for scheduling. Its formation method is as follows: model nodes and their driver model subfields (drivers) are read sequentially from the path's starting point to its ending point, forming directed edges that "must be executed first"; duplicate model nodes in multiple paths are merged, retaining only one execution record. After construction, the system marks all nodes with an in-degree of 0 as "schedulable initial nodes." Node triggering and status monitoring are performed through the task dependency graph scheduler. The task dependency graph scheduler is the component responsible for execution graph traversal and task scheduling, and its specific functions include:
[0065] - Monitor the incoming edge status of all model nodes, and trigger the execution of this node when all upstream nodes have finished executing;
[0066] -Start the model scheduling logic corresponding to the node (including data preparation, parameter injection, and task distribution);
[0067] - Record the execution status of each node (pending scheduling, in execution, successful, failed, skipped);
[0068] - Trigger retry, skip, or rollback strategies for failed nodes based on the configuration;
[0069] - Once all endpoint nodes are in a stable state (either successful or terminated), the task is marked as complete.
[0070] This mechanism ensures that execution scheduling strictly follows the dependency graph order and supports full-link state observability during execution.
[0071] In step S3, the actual execution of each model node is scheduled in sequence according to the task topology execution graph to obtain the interpretation result corresponding to the task target node. Each model node is only added to the scheduling queue after all its upstream nodes have completed execution and successfully returned data.
[0072] Throughout the task execution process, observability checkpoints can be set to record input parameters, execution logic, output results, time consumption, and resource usage, forming a structured log to ensure full traceability. A version verification mechanism can be used to ensure consistency between the model version and the graph relationship version during path execution, avoiding analytical biases.
[0073] The execution process can be optimized using one or more of the following methods.
[0074] 1) If multiple nodes in the path access the same data source, merge the data retrieval requests into a single retrieval to reduce the number of data interface calls.
[0075] 2) Reusable intermediate metrics are pre-calculated at upstream nodes in the execution path for direct reference by downstream models, avoiding redundant calculations. Reusable intermediate results typically possess the following characteristics: they are depended upon by multiple downstream models (i.e., the same metric appears repeatedly in multiple model input_schemas); they do not depend on downstream results, meaning their calculation is not affected by feedback or reverse correction; and they have no strong user parameter dependency, meaning the results are generated solely by data, making them suitable for caching. The system analyzes the dependency edges in the execution path to identify the "field symmetry" between the output fields of upstream nodes and the input fields of downstream nodes. If the above conditions are met, the system automatically caches the result of that field during execution and marks it as a "reusable intermediate metric" for direct use by downstream models.
[0076] 3) If a path or node is identified as a hot path or node, its execution result is cached so that subsequent requests with the same parameters can directly hit the cache and return the execution result, thus speeding up the response. The system can identify hot paths and hot nodes based on the following dimensions: the same path structure appears more frequently than a threshold (e.g., 10 times / minute) in the last N inference tasks; the node has a high execution frequency and high repetition rate (e.g., the number of times it has been called in the past hour exceeds an empirically set threshold); the path has a high score and is often used as a core interpretation link; the execution result fluctuates little, indicating strong caching capability. Once identified as a hot path / hot node, the system stores its execution result in a high-speed cache, sets a cache expiration time (e.g., 5 minutes), and subsequent requests with the same parameters can directly hit the cache, making the response faster.
[0077] 4) For model nodes whose execution time or resource consumption exceeds the set load, a dynamic degradation mechanism is provided. This means that in scenarios with limited resources or high real-time requirements, a lower-cost approximate model is invoked for alternative execution. The system evaluates the execution load of model nodes based on the following metrics: average execution time (exceeding a set threshold, such as 3 seconds); peak CPU / memory usage exceeding twice the average; large data fetch volume (e.g., fetching over a million records at once); and increased failure rate under concurrent calls. Nodes meeting any of these conditions can be marked as "high-resource-consuming nodes," and the system can apply rate limiting, degradation, or asynchronous strategies to them.
[0078] 5) The main process returns the core results first, while some non-critical paths are executed asynchronously and delayed. The results from the non-critical paths are then merged with the core results to update the analysis and interpretation; this is the asynchronous feedback mechanism. The main process can be defined as: the set of paths with the highest cumulative interpretation strength in the current task, typically composed of paths with high scores. Non-critical paths can be defined as: branches with lower remaining scores and smaller interpretation contributions, often used to supplement interpretations but not core causal chains.
[0079] Based on the execution results and performance indicators, feedback can be provided to the graph structure layer and the execution scheduling layer to achieve bidirectional linkage control, enabling the system to continuously converge to a better path, more stable execution and higher explanatory power in multiple rounds of attribution reasoning, forming a complete closed loop.
[0080] Therefore, in the embodiments, the method of the present invention may further include one or more of the following:
[0081] - Based on the relative contribution of each model node and its connected edges to the overall explanation result, determine the prior adjustment value of the edge weights of each edge in the current graph structure. The edge weight adjustment value can be calculated based on indicators such as the number of times the edge is hit in the actual path, the influence strength of the model output on the final explanation result, and the relative weight of the path before early cessation. The influence strength of the model output on the final explanation result can be calculated based on the causal relationship and numerical proportion between the output field of the model node and the target indicator. Common methods include attribution approximation (such as proportional weighting) or Shapley value approximation. For example, if a model outputs "income of a certain disease decreased by 2 million," and the target indicator is "total income decreased by 5 million," then its explanatory strength is 200 / 500 = 40%. This type of contribution is aggregated by path and used for path scoring and edge weight updates. The relative weight of a path before early cessation refers to the proportion of the explanatory contribution of a certain path to the total contribution of all paths. For example, if a path explains 70% of the change in the target indicator, its relative weight is 0.7 in the context of a total explanatory amount of 100%. The system uses this metric to measure path importance, which is used for early stopping detection and weight feedback. The formula for calculating the edge weight adjustment value is: weight_hint new =λ*score+(1-λ)*weight_hint old The score is a weighted sum of edge hit frequency and path relative contribution value, with λ being the response coefficient (empirically taken as 0.4). This mechanism achieves dynamic convergence of edge weights, improving the accuracy of subsequent path ranking. By combining statistical information from multiple executions, the system uses a moving average or exponential weighted update strategy to adjust the weight_hint parameter of corresponding edges in the DAG, thereby dynamically optimizing the priority ranking in the subsequent path planning process.
[0082] - Based on the hit rate of model nodes in different analysis tasks, identify which combinations of trigger conditions are more likely to activate the attribution path. Raise the frequency of trigger conditions to the default priority trigger conditions, and lower the frequency or failure rate of conditions to improve path scheduling accuracy. The system can set a statistical window (e.g., 30 rounds of inference) to record the number of rounds each trigger condition is hit and calculate the hit rate (number of hits / total number of hits). If the hit rate is higher than a set threshold (empirical value of 70%), it is judged as a "high-frequency condition" and its default trigger level is automatically increased; if it is lower than the threshold (empirical value of 20%), it is downgraded or removed.
[0083] -Based on the retention of dimension labels in the final interpretation results, if certain labels appear in multiple rounds of inference, their priority in dimension label matching during path selection will be increased; otherwise, their importance will be reduced or they will be removed from the dimension label list to avoid labels misleading path selection.
[0084] After receiving the feedback mentioned above at the graph structure layer, the corresponding edge attribute fields are updated through the graph database based on the adjustment feedback of edge weight priors, trigger conditions, and / or dimension labels. This dynamically adjusts the edge weight priors (weight_hint), trigger conditions, and dimension labels, achieving adaptive optimization at the path structure level. All feedback adjustment actions are marked through version control to ensure that the graph structure evolution process is traceable and rollbackable.
[0085] In embodiments, the method of the present invention may further include one or more of the following:
[0086] - Based on the number of paths, average depth, pruning ratio, early stopping trigger position, and / or model execution time in each round of inference, the bundle width parameter (bundle width) is automatically adjusted to keep path expansion within an acceptable range. The average depth represents the average number of levels from the starting node to the ending node in the attribution path. After path expansion, the system calculates the depth of each path by subtracting one from the number of nodes, and then averages the depth across all paths. This metric reflects the complexity of the inference chain and guides bundle width adjustment. For example, if the system detects a sharp increase in the number of paths or the average depth exceeds a preset limit (pre-configured, such as 6 levels), it indicates that the path expansion is too wide, and the bundle width will be automatically tightened (e.g., from 8 to 5). If the number of paths is too small or the explanatory coverage is insufficient, the bundle width will be widened to increase the number of candidate paths. This mechanism ensures a balance between the breadth of path expansion and resource utilization.
[0087] - If an early stopping condition is detected as being triggered too early, affecting the completeness of the explanation, the early stopping threshold will be relaxed or the explanation intensity threshold will be increased. For example, if the attribution path has not yet covered the main explanation structure (e.g., explanation rate <60%), or the average path depth is too shallow (e.g., <3), and the system still triggers early stopping due to resource thresholds or default explanation intensity limitations, it is considered premature early stopping. The system will record this situation and automatically increase the explanation intensity threshold or delay the early stopping trigger point.
[0088] - If a large number of low-contribution paths are frequently expanded, the pruning threshold or path scoring criteria will be increased. After the task is completed, the system analyzes the cumulative explanatory contribution and hit count of each path, and calculates the score of each path and whether it enters the main explanatory chain. If a path score is low (e.g., below the pruning threshold (empirical value < 0.4)), but is repeatedly expanded (e.g., more than 5 times) in multiple rounds of inference, yet never enters the main path or contributes very little to the final explanatory result, it is judged as a "frequently expanded low-contribution path." The system will increase the pruning threshold to tighten expansion, or increase the path scoring criteria, such as increasing the minimum score threshold required for path retention, increasing the weight requirements for key factors (e.g., historical validity, edge weights), and increasing the penalty weight for paths with high resource consumption or poor label matching, further raising the threshold for their retention. By adjusting the entry conditions for path retention, paths with low scores are less likely to have the opportunity to continue expanding, improving inference efficiency and result accuracy.
[0089] - Based on the average execution time, resource consumption, and / or cache hit rate of model nodes, the degradation trigger threshold for high-overhead nodes and the range of non-critical paths where asynchronous backfilling is enabled are dynamically adjusted to improve overall execution stability and efficiency. The degradation trigger threshold refers to a set of multi-dimensional resource boundary parameters used to determine whether a model degradation strategy needs to be executed. These typically include upper limits for execution time, resource usage, failure rate, and hit rate. The system can set independent thresholds for each model; otherwise, a system-wide common configuration threshold can be used. Asynchronous backfilling of non-critical paths can postpone the execution scheduling of these nodes to improve the main process response speed, and update the final interpretation structure after asynchronous backfilling in the background. For example, the system records the model's average execution time, CPU / memory consumption, failure rate, and other performance metrics, comparing them with set thresholds (e.g., execution time > 3 seconds, memory > 512MB). Once any dimension is exceeded, it is considered a high-overhead (computational cost) node, automatically triggering the degradation mechanism and using an approximate model or cached results to replace execution.
[0090] All execution parameter adjustments retain historical versions in the system configuration policy, supporting rolling optimization and policy rollback based on feedback data.
[0091] The method of this invention not only ensures the accuracy and traceability of multi-model inference in complex scenarios, but also takes into account execution efficiency and system adaptive optimization capabilities. It can be widely applied to complex business scenarios that require multi-model collaborative computing and interpretable analysis, such as hospital operation management, medical quality control analysis, and supply chain optimization.
[0092] In another embodiment, a computer device is provided, including a processor, a memory, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described above.
[0093] In another embodiment, a computer-readable storage medium is provided that stores a computer program / instructions thereon, characterized in that the computer program / instructions, when executed by a processor, implement the steps of the method described above.
[0094] In another embodiment, a computer program product is provided, including a computer program / instructions, characterized in that the computer program / instructions, when executed by a processor, implement the steps of the method described above.
[0095] The various embodiments described herein, or their specific features, structures, or characteristics, may be suitably combined in one or more embodiments of the invention. Furthermore, in some cases, the order of steps described in the flowcharts and / or pipeline processes may be modified where appropriate, and they need not be performed in the exact order described. Additionally, various aspects of the invention may be implemented using software, hardware, firmware, or combinations thereof, and / or other computer-implemented modules or devices that perform the described functions. Software implementations of the invention may include executable code stored in a computer-readable medium and executed by one or more processors. Computer-readable media may include computer hard disk drives, ROM, RAM, flash memory, portable computer storage media such as CD-ROM, DVD-ROM, flash drives, and / or other devices having a Universal Serial Bus (USB) interface, and / or any other suitable tangible or non-transitory computer-readable medium or computer memory on which executable code can be stored and executed by a processor. The invention may be used in conjunction with any suitable operating system.
[0096] Unless explicitly stated otherwise, the singular forms “a” and “the” used herein include the plural meaning (i.e., meaning “at least one”). It should be further understood that the terms “having,” “comprising,” and / or “including” as used in the specification indicate the presence of the described features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The term “and / or” as used herein includes any and all combinations of one or more of the listed related items.
[0097] The foregoing has described some preferred embodiments of the present invention. However, it should be emphasized that the present invention is not limited to these embodiments, but can be implemented in other ways within the scope of the present invention. Those skilled in the art can make various modifications and variations to the present invention based on the inventive concept and without departing from the scope of the present invention, and such modifications or variations still fall within the protection scope of the present invention.
Claims
1. A multi-model reasoning method based on graph structure, characterized in that, The method includes: S1: Query the task target node in the graph database and start from it. Traverse the graph database according to the corresponding driving model to expand the inference path. The graph database includes multiple directed acyclic graphs. Each directed acyclic graph is mapped from the metadata of the registered analysis model. Each analysis model corresponds to an analysis problem and includes an attribution field. The attribution field includes a driving model subfield for listing the upstream analysis model IDs that this model depends on, an influence model subfield for listing the downstream analysis model IDs that the result of this model will affect, an edge weight prior subfield for indicating the historical attribution strength of the dependency relationship indicated by the driving model subfield and the influence model subfield, a dimension label subfield for indicating the attribution dimension, and a trigger condition subfield for indicating the path control rule. The nodes of the directed acyclic graph represent analysis model instances, and the edges of the directed acyclic graph represent the dependency relationships between analysis models and are accompanied by edge weight priors, dimension labels, and trigger condition attributes. S2: Generate a task topology execution graph based on the model nodes and corresponding driving models involved in the extended inference path, where each node in the task topology execution graph represents a model instance to be executed, and the edges represent the dependencies between model instances to be executed. S3: Schedule the actual execution of each model node in sequence according to the task topology execution graph to obtain the interpretation result corresponding to the task target node. Each model node is only added to the scheduling queue after all its upstream nodes have completed execution and successfully returned data. If a path or node is identified as a hot path or hot node, its execution result is cached so that subsequent identical requests can directly hit the cache and return the execution result.
2. The method according to claim 1, characterized in that, The inference path expansion is based on topology sorting and beam search algorithms. Topology sorting constructs an initial sequence of node executions and ensures that the execution of each model node follows its dependent nodes. The beam search algorithm controls the number of inference path expansions, which is controlled by one or more of the following: - In the path expansion of each layer, only the paths with the highest path scores and the number specified by the bundle width are retained; - Discard paths with a score below the pruning threshold; and - If the cumulative explanation strength or detected resource usage of some paths in the current path set has reached the early stopping threshold, further expansion of the inference path will be terminated.
3. The method according to claim 1, characterized in that, The execution is further optimized according to one or more of the following: If multiple nodes in the path access the same data source, merge the data retrieval requests into a single retrieval to reduce the number of data interface calls; Reusable intermediate index results are pre-calculated at upstream nodes of the path for direct reference by downstream models; For model nodes that consume more time or resources than the set load, in scenarios with limited resources or high real-time requirements, an approximate model with lower computational cost is called for alternative execution. The main process returns the core results first, while some non-critical paths are executed asynchronously and delayed. The results from the non-critical paths are then merged with the core results to update the analysis and interpretation results.
4. The method according to claim 1, characterized in that, The method further includes one or more of the following: Based on the relative contribution of each model node and its connected edges to the overall interpretation result, determine the prior adjustment value of the edge weight of each edge in the current graph structure; Based on the hit rate of model nodes in different analysis tasks, triggering conditions with higher hit frequency are promoted to default priority triggering conditions. Based on the retention of dimension labels in the final interpretation result, if certain labels appear in multiple rounds of inference, their dimension label matching priority during path filtering is increased.
5. The method according to claim 2, characterized in that, The method further includes one or more of the following: The bundle width is automatically adjusted based on the number of paths, average depth, pruning ratio, early stopping trigger position, and / or model execution time in each round of inference. If the early stopping condition is detected to be triggered too early, relax the early stopping threshold or increase the explanation strength threshold. If a large number of low-contribution paths are frequently expanded, increase the pruning threshold or improve the path scoring criteria.
6. The method according to claim 3, characterized in that, The method further includes: Based on the average execution time, resource consumption, and / or cache hit rate of model nodes, dynamically adjust the degradation trigger threshold for high-overhead nodes and the range of non-critical paths for enabling asynchronous backfilling.
7. The method according to claim 4, characterized in that, The method further includes: Based on feedback from adjustments to edge weight priors, triggering conditions, and / or dimension labels, update the attribute fields of the corresponding edges through the graph database.
8. A computer device, comprising a processor, a memory, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1-7.
9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1-7.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1-7.