Tool routing and context assembly method based on trusted learning log evidence

By calculating anomaly strength and credibility weight using robust statistics, constructing an evidence contract, and optimizing tool routing and context assembly, the instability of learning logs and conflicts of multi-source evidence in online education systems are resolved. This achieves stable and credible evidence processing in high-frequency business scenarios, ensuring the interpretability and accountability of the generated results.

CN122173366APending Publication Date: 2026-06-09SICHUAN QIMINGDAREN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SICHUAN QIMINGDAREN TECH CO LTD
Filing Date
2026-04-22
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In online education systems, noise and instability in learning logs, conflicts in multi-source evidence, resource constraints in tool calls, context budget limitations, and educational compliance requirements lead to unstable generated results. The lack of credible evidence processing, the lack of a unified contract and version standard for multi-source evidence, the reliance on experience in toolchain orchestration, the crude assembly strategy, and the lack of a process recording mechanism that allows for review and accountability make it difficult to maintain stability in high-frequency business.

Method used

By calculating anomaly strength using robust statistics, generating credible weights, constructing evidence contracts, fusing multi-source information, optimizing tool routing and context assembly, and employing slotted budget design and degradation strength-driven dynamic adjustment, evidence adjudication and replayable recording are achieved, ensuring stable and credible evidence output under conditions of high noise and multi-source conflict.

Benefits of technology

It improves the stability and reliability of the generated results, reduces noise sensitivity, ensures the interpretability and consistency of the output results, meets the stability requirements of high-frequency teaching operations, and realizes process recording that is reviewable and traceable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122173366A_ABST
    Figure CN122173366A_ABST
Patent Text Reader

Abstract

This invention discloses a tool routing and context assembly method based on trusted learning log evidence, comprising: calculating the anomaly intensity of learning log events using robust statistics and mapping it to trusted weights, and suppressing and reducing noise for anomaly events; aggregating the denoised logs by knowledge points to generate a log evidence contract including confidence level, source information, etc.; fusing log evidence, knowledge base retrieval evidence, and rule-constrained evidence to identify and adjudicate evidence conflicts; calculating degradation intensity based on window anomaly rate, log sparsity, conflict degree, and budget stress, and dynamically selecting tool routing and context assembly strategies; under budget constraints, selecting toolchain execution based on tool utility, and performing structural verification on the output. The context budget is managed by slots, and the proportion of each slot is dynamically adjusted according to the degradation intensity. Under slot constraints, fragments are selected for context assembly, and key conclusions are forcibly bound to evidence identifiers; online closed-loop updates are performed based on task performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of online education technology, and in particular to a tool routing and context assembly method based on trusted learning log evidence. Background Technology

[0002] In recent years, Large Language Models (LLMs) have demonstrated outstanding performance in natural language understanding, content generation, and inductive reasoning, and have been increasingly incorporated into online education, covering multiple stages such as teaching, learning, practice, testing, evaluation, and management. Typical application scenarios include: question explanation and Q&A, error attribution and knowledge point location, learning plan arrangement and daily summary, review path recommendation, personalized practice generation, and teacher lesson preparation and teaching research support. To improve the controllability and scalability of the system, the industry has further adopted the technical architecture of agents and tool flows, integrating LLMs with various tools such as question bank retrieval, knowledge base retrieval, knowledge graph services, error clustering services, plan generation services, and learning behavior analysis services to form a closed-loop processing flow for specific teaching tasks.

[0003] Under the aforementioned technological trends, to ensure that model outputs better match individual learning situations and are feasible, online education systems typically need to incorporate a large amount of learning logs as a key basis for decision-making. These learning logs generally include, but are not limited to: question answering results, answering time, number of retakes, viewing of explanations, page dwell time, navigation patterns, stage assessment scores, changes in knowledge point mastery, and completion status of review plans. Learning logs are characterized by large data volume, high generation frequency, strong temporal sequence, and diverse sources. They serve as an important data foundation for characterizing students' learning processes and states, and are also crucial inputs for intelligent agents in tool routing, evidence retrieval, and content generation.

[0004] However, learning logs exhibit significant engineering complexity in real-world business scenarios, primarily in the following aspects: First, log noise and instability: Abnormal behaviors such as excessive practice, random clicks, network fluctuations, blank answers, and duplicate submissions can significantly impact log reliability. Second, the risk of conflicting evidence from multiple sources: Evidence generated by different system modules and external tools may differ in caliber, version, or conclusion, easily leading to evidence conflicts. Third, resource constraints for tool calls: Agents typically require multiple rounds of calls to external tools when executing tasks, subject to limitations such as the number of calls, latency, concurrency, and failure rate. Fourth, context budget constraints: Model inference and generation have a fixed context length budget; without a context fragment selection and assembly strategy, key information may be squeezed out, citations may be missing, or content may drift. Fifth, educational compliance and quality audit requirements: Educational scenarios have clear compliance and quality requirements regarding "what is the basis," "what evidence was cited," and "why is it arranged this way," and the output must be reviewable, traceable, and repeatable.

[0005] Regarding the practical implementation of large language models combined with intelligent agents in online education, which relies on a large amount of learning logs, existing technologies typically suffer from the following defects and shortcomings, which are particularly prominent in highly constrained scenarios such as the final year of high school entrance exams: First, learning logs are directly input into the data, lacking credible evidence processing: Existing solutions often send learning logs directly into the generation process in the form of raw details, simple statistics, or coarse-grained labels, commonly only performing threshold filtering and anomaly removal. This approach lacks structured expression and credibility characterization of log evidence, especially failing to distinguish the impact of normal learning behavior on conclusions from abnormal behaviors such as excessive practice, random clicks, blank answers, and network fluctuations. This results in generated results that are sensitive to noise and have poor stability. Furthermore, it lacks constraints that bind key conclusions and evidence sources, making it difficult to establish a traceable chain of evidence.

[0006] Second, the lack of a unified agreement and version definition for multi-source evidence makes conflict resolution difficult: Online education systems often rely on multiple information sources simultaneously, including textbooks, exam outlines, question bank analyses, lecture notes, knowledge base retrieval fragments, and tool returns. Existing technologies generally lack a unified data structure to normalize key fields such as evidence source, time, version, scope of application, confidence level, and conflict relationships, making it difficult to align the interpretations of evidence from different sources. When encountering conflicting conclusions, simple priority rules or direct mixing are often relied upon, failing to explain the basis for the decision and failing to guarantee consistent output from the same input across different implementations.

[0007] Third, toolchain orchestration is overly empirical, lacking routing optimization and failure fallback under budget constraints: Agents typically require multiple rounds of calls to tools such as question bank retrieval, knowledge point mapping, incorrect question clustering, plan generation, and parsing verification. Existing solutions often employ fixed processes or a few heuristic branches, lacking deterministic routing strategies under constraints such as call limits, latency limits, and concurrency limits. They also lack a unified handling mechanism for exceptions such as tool failures, empty returns, and format mismatches. The result is high retries, uncontrollable end-to-end latency, and severe output degradation upon failure, making it difficult to meet the stability requirements of high-frequency services.

[0008] Fourth, the assembly strategy described below is crude and prone to degradation and drift under a fixed budget: Existing Retrieval Augmentation Generation (RAG) assembly mostly adopts a similarity ranking plus truncation and splicing approach, lacking slot budget allocation and fragment selection strategies under a fixed token budget. Typical consequences include: low-value fragments crowding out key constraints and core evidence; mixing conflicting fragments leading to generation drift; missing citations making it impossible to assign responsibility for conclusions; and inconsistent outputs for the same request under different search noise levels.

[0009] Fifth, there is a lack of a process recording mechanism that allows for review, accountability, and reproducibility: Educational settings emphasize quality auditing and compliance requirements, especially in areas such as lesson planning, explanation of incorrect answers, and learning suggestions. It is crucial to clearly identify which logs, materials, and analyses were used to reach conclusions. However, current technologies often only save the final output text or a small amount of search results, lacking a systematic record of tool usage patterns, evidence assembly processes, conflict resolution processes, and key conclusion citation relationships. This makes it impossible to review the process when disputes arise, to locate and correct erroneous conclusions, and to establish a sustainable closed-loop optimization mechanism.

[0010] Sixth, the lack of stable control strategies under degradation conditions leads to uncontrollable output in extreme cases: Under degradation conditions such as sparse logs, high anomaly rates, severe evidence conflicts, and tight tool budgets, existing solutions often either continue to generate data by brute force or fail outright, lacking controllable degradation mechanisms. These mechanisms could include prioritizing the output of strongly referenceable conservative conclusions, triggering supplementary evidence strategies, reverting to a coarser-grained stable knowledge layer, or enabling cache reuse to ensure consistency. Therefore, in high-pressure scenarios like the final year of high school entrance exams, it is difficult for the system to guarantee stable delivery. Therefore, there is an urgent need to propose a simple, accurate, and reliable tool routing and context assembly method based on trusted learning log evidence. This method should be able to maintain stable operation even under conditions of limited tool calls, high noise in learning logs, potential conflicts between multiple sources of evidence, and fixed context budget. This would enable learning logs to be reliably transformed into usable evidence, thereby supporting tool routing, evidence verification, and context assembly, and ensuring that the output results have clear evidence and a reproducible process record. Summary of the Invention

[0011] To address the aforementioned problems, the present invention aims to provide a tool routing and context assembly method based on trusted learning log evidence. The technical solution adopted by the present invention is as follows: The tool routing and context assembly method based on trusted learning log evidence includes the following steps: Step S1: Obtain the original learning log event sequence of students within a specified time window, calculate the anomaly intensity of any event based on robust statistics, map the anomaly intensity to the event confidence weight, and suppress the anomaly events according to the confidence weight to obtain the denoised event sequence. Step S2: Aggregate the denoised event sequence according to knowledge points or question indexes to generate log evidence candidates and calculate the log confidence of the log evidence candidates. Construct a log evidence contract that includes evidence identifier, source type, tracing information, version identifier, confidence and forced citation mark. Step S3: The log evidence contract, knowledge base retrieval evidence, and rule constraint evidence are integrated into a unified evidence contract set. Based on the standardized representation of evidence claims, evidence conflicts are identified, and the conflict evidence groups are adjudicated to select the winning evidence and update the conflict degree. Step S4: Calculate the degradation intensity based on window anomaly rate, log sparsity, evidence conflict degree and budget tension, and select tool routing strategy and context assembly strategy according to degradation intensity; Step S5: Under the constraints of tool call count and delay budget, select and execute the toolchain based on tool utility, perform structural verification on the tool output, and trigger a deterministic fallback chain or cache path when the verification fails. After execution, update the evidence contract set. Step S6: Divide the total context budget into log slots, knowledge slots, constraint slots, and tracing slots, and dynamically adjust the budget ratio of any slot according to the degradation intensity; select segments based on segment relevance, credibility, and conflict penalty under the slot budget constraint. Step S7: Assemble the selected fragments into a context, forcibly bind evidence identifiers to key conclusions, calculate the citation coverage, and trigger supplementary evidence, rollback, or downgraded output if the coverage is insufficient. Step S8: Refine the context layer by layer according to the three-level structure of coarse, medium and fine layers, and perform gating judgment based on quality score; if the standard is not met, fall back to step S5 to re-execute tool routing or fall back to step S6 segment selection; Step S9: Construct a comprehensive feedback score based on the task completion effect and perform online closed-loop updates.

[0012] Compared with the prior art, the present invention has the following beneficial effects: This invention transforms abnormal behaviors such as problem-solving, random points, and network jitter from "direct removal" to "continuous suppression" by calculating abnormal intensity and mapping reliable weights. This avoids information loss or misjudgment of boundary samples caused by simple threshold filtering, enabling stable log confidence to be output even in high-noise scenarios and reducing the sensitivity of the generated results to noise.

[0013] This invention incorporates multi-source information such as logs, knowledge bases, rules, and tool returns into the same data structure through the design of evidence contract fields (evidence identifier, source type, traceability information, version identifier, content hash, etc.), solving the alignment problem of evidence from different sources in terms of caliber, version, and scope of application, and providing a data foundation for conflict adjudication and compliance auditing.

[0014] This invention proposes a standardized and conflict group adjudication mechanism to transform "inconsistent conclusions" into quantifiable conflict levels and the selection of winning evidence, replacing the simple priority rules or direct mixing of existing technologies. This enables the output in conflict scenarios to have interpretable adjudication basis and ensures consistency when the same input is run multiple times.

[0015] This invention transforms toolchain selection from a "fixed process or heuristic branching" problem into a computable optimization problem through tool utility modeling and budget constraint optimization. Under hard constraints on the number of calls and latency budget, it prioritizes high-yield tools, reducing invalid calls and retries, thus making end-to-end latency controllable and meeting the stability requirements of high-frequency teaching services. Furthermore, this invention uses structural validation and a deterministic fallback chain to automatically switch to backup tools or cached paths when tools time out, return empty, or have format errors. This avoids single-point failures causing link interruptions, replacing the "hard failure or infinite retries" mode of existing technologies, and improving the system's fault tolerance and delivery stability in environments where tools are unreliable. This invention transforms the context budget from a coarse-grained model of "similarity ranking + truncation and splicing" to a refined allocation of four types of slots: "log / knowledge / constraint / source tracing". When the budget is tight, source tracing information and rule constraints are reserved first, avoiding low-value retrieval fragments from crowding out key evidence and improving the information density and usability of the context.

[0016] This invention integrates degradation intensity assessment with strategy linkage, quantifying anomaly rate, sparsity, conflict degree, and budget tension into control signals. Under high degradation, it automatically increases verification priority, traceability budget ratio, and reference requirements, while under low degradation, it releases personalized assembly space, enabling the system to maintain optimal stability under different operating conditions – a targeted trade-off.

[0017] In summary, this invention has the advantages of simple logic and high accuracy and reliability, and has high practical and promotional value in the field of online education technology. Attached Figure Description

[0018] 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 on the scope of protection. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a logic flowchart of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the present invention will be further described below with reference to the accompanying drawings and embodiments. The embodiments of the present invention include, but are not limited to, the following embodiments. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0021] like Figure 1 As shown, this embodiment provides a tool routing and context assembly method based on trusted learning log evidence, which includes the following steps: The first step is to obtain the original learning log event sequence of students within a specified time window, calculate the anomaly intensity of any event based on robust statistics, map the anomaly intensity to an event confidence weight, and suppress the anomaly events according to the confidence weight to obtain the denoised event sequence, including the following steps: (11) Students In the analysis window Learning events within are represented as: ;in, This represents the nth log event; Indicates the start timestamp of the analysis window; Indicates the timestamp of the end of the analysis window; This represents the sequence of events in the original learning log; This indicates the number of log events within the window.

[0022] The nth log event The expression is: ; in, This represents the timestamp of the nth log event; Indicates the behavior type of the nth log event (answer, view parsing, redo, skip, etc.); This indicates the response result (correct, incorrect, empty) for the nth log event. This indicates the time consumption characteristic corresponding to the nth log event; This represents the index of the question or knowledge point corresponding to the nth log event.

[0023] (12) From the original learning log event sequence Extract the time consumption characteristics of all events and form a time consumption set. : ; The expression for calculating the anomaly strength of any event based on robust statistics is as follows: ; ; ; in, The value represents the anomaly intensity of the nth log event. It is a dimensionless quantity. The larger the value, the more significantly the event's time consumption deviates from the typical time consumption level, and the more likely there is abnormal behavior or abnormal record. This represents the median time elapsed. This indicates the median absolute deviation of the time spent; This represents a stable term with a value greater than 0; This indicates median operations.

[0024] Preset abnormal threshold , Marking an event as an anomaly does not mean deleting it directly, but rather using it as a basis for subsequent calculations of trusted weight suppression and degradation intensity. When the degradation is mild, its weight can be reduced, while when the degradation is severe, a more stringent filtering strategy can be triggered.

[0025] when If the event occurs, the nth log event will be recorded as an exception and stored in the exception set. Its expression is: .

[0026] (13) The anomaly intensity is mapped to the event confidence weight, and its expression is: ; in, This represents the event trust weight of the nth log event. ; This represents the anomaly suppression strength coefficient. When... Sometimes, This indicates that the event perfectly matches the typical time consumption level; when When it increases, The exponential decay continuously reduces the contribution of unusually time-consuming events to subsequent evidence aggregation.

[0027] In engineering implementation, to ensure that extreme anomalies do not cause numerical disturbances to subsequent calculations, a lower bound for the reliable weights can be preset. This forms the truncated trusted weights: ; in, This represents the truncated trust weight of the nth log event. Here, we will consistently use this value in subsequent steps. Participate in evidence aggregation to ensure that each event is at most weakened, and that the value becomes unstable or completely loses usability due to the weight approaching 0.

[0028] Trigger condition definition: when When an event enters the anomaly set, its credibility weight decreases significantly. In scenarios requiring stronger conservative control, a strong anomaly suppression threshold can be introduced. ;when In this case, the trust weight is directly fixed to the lower bound: .

[0029] The second step involves aggregating the denoised event sequences by knowledge point or question index to generate log evidence candidates and calculating the log confidence of these candidates. A log evidence contract is then constructed, comprising the following steps: (21) From the original learning log event sequence Extract the index of questions or knowledge points corresponding to the nth log event. and form a set of aggregate bonds. ;in, This represents the set of aggregate keys. In engineering implementation, it can be used to... Perform deduplication to obtain a set of unique keys for iterating and aggregation.

[0030] (22) For the set of aggregate bonds any aggregate bond in Preset event index set: ;in, Indicates mapping to the first Aggregate bonds A collection of log event indexes; This indicates the value of the aggregate field corresponding to the nth log event; Represents the set of aggregate keys The first in There is an aggregation key. Here, n is the log event index, used to identify the nth log event and its corresponding aggregation field value. Trust weight after truncation of the nth log event .

[0031] (23) Mapping to the first Aggregate bonds Log event index collection Construct log evidence candidates, whose expression is: ; in, Indicates by the first Log evidence candidates generated from aggregation keys. In engineering implementation, Statistical fields can be further derived, such as the number of correct answers, the number of incorrect answers, the number of blank answers, and the number of times the parsing was viewed.

[0032] (24) Calculate the log confidence score of the log evidence candidates, the expression of which is: ; in, Indicates by the first Log evidence candidates generated by aggregation keys Log confidence; Represents the event index set The cardinality. Here, this confidence level is used to characterize the overall credibility of the log evidence formed within the current window for the knowledge point of this question.

[0033] (25) Triggering conditions for candidates to enter the evidence contract set: In order to avoid introducing unstable candidates in the case of extremely sparse logs or extremely heavy anomalies, the following candidate generation triggering conditions can be set: When the number of candidate events satisfies the following formula, the candidate will enter the subsequent evidence contract construction process: ;in, This represents the minimum number of events threshold; if If the candidate is weak evidence, it can be marked as a candidate with weak evidence only if the subsequent degradation intensity is high ( When the level is too high and there is insufficient evidence, it is included in the assembly as a supplement.

[0034] Additionally, a log confidence threshold can be set to determine whether the candidate should be forcibly included in the must-cite candidate pool: if , ; Strong citation suggestions are marked for log candidates (which can be mapped to the must-cite field when entering the subsequent evidence contract); Set the log confidence threshold; When the triggering condition is met, an event is present. When this happens, the event is classified into the set of anomalous events, and its contribution is reduced in subsequent aggregations. This reduction is determined by the event's credibility weight. This is reflected in the following: Furthermore, to characterize the overall degree of abnormal behavior within the analysis window, the window abnormality rate is defined as: ; when At that time, the window is determined to be in a "high anomaly" state, and... As the degradation intensity mentioned below The amount of input is used to improve the verification priority of subsequent tool routing and the proportion of the traceability budget for context assembly.

[0035] (26) This step is used to unify information from multiple sources, such as learning logs, knowledge base retrieval, textbook / syllabus rules, and external tool returns, into a computable, adjudicable, and accountable data structure to support subsequent conflict detection, budget-constrained routing, and context assembly. The scheme defines each citationable piece of evidence as an evidence contract. Its expression is: ; ; in, Indicates by the first Log evidence candidates generated by aggregation keys The generated q-th evidence contract record, i.e., the evidence contract entry; the evidence contract record serves as a unified set of evidence contracts. One of the elements; The unique identifier representing the qth log evidence contract is used for referencing, binding, and retrospective location. This indicates the evidence source type identifier for the qth log evidence contract, used to distinguish log evidence, knowledge base evidence, rule evidence, tool return evidence, etc. This represents the evidence tracing information of the qth log evidence contract, used to record the evidence generation chain (e.g., tool name, interface name, call time, data table name, collection terminal identifier, etc.). The evidence version identifier of the qth log evidence contract is used to record the question bank version, lecture note version, knowledge base index version or model configuration version, etc., to support version consistency verification; This represents the hash signature of the evidence content of the q-th log evidence contract, used to ensure that the evidence content is verifiable and reproducible (e.g., for...). (obtained by hashing) The confidence level of the evidence contract for the q-th log entry is used to indicate the degree of credibility of the evidence under the current task. The mandatory citation marker for the q-th log evidence contract indicates whether the evidence must be bound to the key conclusion. This indicates the scope of application of the evidence contract for the qth log entry, used to characterize which knowledge points, question types, time windows, or student groups the evidence is applicable to, thereby avoiding misuse across scopes; This represents the evidence content payload of the qth log evidence contract, used to store the core content that can be assembled (such as normalized conclusions, fragmented text, structured fields, numerical statistics, etc.). This represents the set of conflict group identifiers for the qth log evidence contract, used to record which conflict groups the evidence belongs to (can be empty), supporting subsequent conflict adjudication and downgrade output; This represents the assembly trajectory identifier of the log evidence contract of the qth entry, used to record the process information of evidence entering the context assembly (such as assembly round, level, compression method, reference location, etc.), which is convenient for review and auditing. This indicates the global number after the candidate log evidence is entered into the database to form an evidence contract entry. This is a mapping function for candidate log evidence to evidence contract record numbers.

[0036] The third step involves merging the log evidence contract with the knowledge base retrieval evidence and rule-constrained evidence into a unified set of evidence contracts. Based on the standardized representation of evidence claims, evidence conflicts are identified, and the conflicting evidence groups are adjudicated to select the winning evidence and update the conflict degree. This includes the following steps: This step is used to uniformly characterize evidence from different sources under the same confidence scale, avoiding the problem of "using different standards for log evidence, retrieval evidence, rule evidence, and tool evidence, making subsequent comparison and adjudication impossible." Specifically, it involves first defining the evidence based on the source type field of the evidence contract. The evidence is segmented; then the original credibility score for each source is calculated separately; finally, these scores are normalized and written into the evidence contract confidence field. ∈[0,1], for use in subsequent conflict resolution, budget allocation and rollback control.

[0037] In this embodiment, the log evidence contract, knowledge base retrieval evidence, and rule constraint evidence are integrated into a unified set of evidence contracts, denoted as... For any article of the evidentiary contract The source type of evidence is marked as And the source type of evidence is identified. The set of possible values ​​includes: log, kb, rule, and tool.

[0038] (31) Assigning confidence level to log source evidence: When the qth evidence contract item Evidence source type identifier satisfies At that time, the confidence level of the evidentiary contract for the q-th log entry is... To assign a value, the expression is: ;in, Indicates by the first Log evidence candidates generated by aggregation keys Log confidence level.

[0039] (32) Calculation of confidence level of evidence sourced from knowledge base retrieval: When the qth evidence contract item Evidence source type identifier satisfies Then, the confidence level of the evidence contract for the qth log entry is determined. To assign a value, the expression is: ; ; ; ; ;in, This indicates the content of the evidence contract and the task request in clause q. The correlation score; Represents a semantic similarity function; Indicates a task request; This indicates that the evidence is not timely; Indicates the current timestamp; Indicates the timestamp of evidence update; Indicates the length of the evidence content token; This represents the function for calculating the token length. This represents the total budget of the context token, used for length normalization. Indicates the normalized scale of timeliness; The calibration coefficient representing the correlation; Calibration coefficient indicating aging; Calibration factor indicating length; This represents the Sigmoid normalization function; This represents the original confidence score of the evidence in the knowledge base.

[0040] (33) Calculation of confidence level of evidence from rules, teaching materials, and examination syllabus: When the qth article of the evidence contract... Evidence source type identifier satisfies In such cases, the content typically originates from relatively stable and traceable authoritative sources (e.g., textbook definitions, exam syllabus entries, question type rules, and compliance constraints). The confidence level of this type of evidence is based on "authoritative benchmark + version consistency." The confidence level of the evidence contract for the q-th log entry is... To assign a value, the expression is: ; ; in, This represents the version consistency flag of the log evidence contract for the qth record; Indicates the current rule or textbook version identifier; Indicates an indicator function; This represents the baseline confidence level of rule-based evidence; This represents the version consistency gain coefficient; This represents the interval truncation function.

[0041] (34) Calculation of confidence level of source evidence returned by the tool: When the qth evidence contract item Evidence source type identifier satisfies In this case, the confidence level needs to reflect the reliability of the tool, the completeness of the returned format, and its adaptability to the current request. The confidence level of the evidence contract for the q-th log entry is... To assign a value, the expression is: ; in, This represents the reliability index of the j-th tool; This represents the matching score between the q-th log evidence contract and the current request; This indicates the evidence format integrity marker for the qth log evidence contract; Indicates the calibration coefficient for the reliability term; Indicates the calibration coefficient for the matching degree item; The calibration coefficient for the format integrity item.

[0042] (35) Confidence level of the evidentiary contract for the logbook contract of the qth item Perform lower and upper bound truncation: ;in, Indicates the lower bound of the confidence level; This indicates the upper bound of the confidence level. .

[0043] The fourth step involves calculating the degradation intensity based on window anomaly rate, log sparsity, evidence conflict, and budget constraints. Based on this degradation intensity, the tool routing strategy and context assembly strategy are selected, including the following steps: (41) Window anomaly rate The expression is: ;in, This indicates the abnormal intensity of the nth log event.

[0044] (42) Log sparsity The expression is: ; ; ;in, A flag indicating the validity of the nth log event; Indicates the valid event threshold; This represents the trust weight of the nth log event after truncation.

[0045] (43) Degree of conflict of evidence The expression is: ; ; ;in, Represents a unified set of evidentiary contracts The claim to standardize the log evidence contract in Article q of the law; The normalization approach proposes an extraction function whose output can be discrete labels or structured key values, such as knowledge point attribution = a certain knowledge point, or key steps in solving a problem = a certain rule. Indicates the terms of the evidentiary contract. Conflict determination value; Represents a unified set of evidentiary contracts The number of evidentiary contract entries in the document.

[0046] (44) Budget tightness The expression is: ; ; ; ; in, This indicates the number of tool calls that have occurred so far. Indicates the maximum number of times the tool can be called; This indicates the current cumulative toolchain time. Indicates the maximum total latency of the toolchain; This indicates the number of tokens currently used. Indicates the total budget for the token; Indicates the proportion of the tool budget consumed; Indicates the proportion of delayed budget consumption; Indicates the proportion of context budget consumption; Indicates the proportion of tool budget consumption The corresponding budget consumption weight; Indicates the proportion of delayed budget consumption The corresponding budget consumption weight; Indicates the proportion of context budget consumption The corresponding budget consumption weight.

[0047] (45) Calculate degradation intensity based on window anomaly rate, log sparsity, evidence conflict degree and budget tension. Its expression is: ; in, This represents the degenerate combination weight corresponding to the window anomaly rate; This represents the degenerate combination weight corresponding to log sparsity; This indicates the weight of the degenerate combination corresponding to the degree of evidence conflict; This indicates the degraded portfolio weights corresponding to budgetary constraints; This indicates a degenerate bias term.

[0048] The fifth step involves selecting and executing a toolchain based on tool utility, under constraints of tool call count and latency budget. The tool output undergoes structural verification; if verification fails, a deterministic fallback chain or cache path is triggered. After execution, the evidence contract set is updated, including the following steps: (51) Definition of tool benefit elements: Tool benefit is used to characterize the improvement of evidence quality and assembly quality after the tool is invoked. The scheme decomposes the benefit into three types of computable quantities: evidence gain, conflict resolution gain and reference coverage gain, and synthesizes them into total benefit in a weighted manner.

[0049] First, define the total confidence level of evidence before and after the tool is invoked: ; ; in, Indicates calling the tool Number of subsequent evidentiary contracts; This indicates the confidence level of the evidence obtained after the tool is invoked and updated. This represents the total confidence level of the evidence prior to the invocation; This represents the total confidence level of the evidence after calling tool j.

[0050] The evidence gain is defined as: ; Secondly, the amount of reduction in conflict intensity is defined as the conflict resolution gain: ;in, Conflict level before invocation To call the tool Post-conflict degree.

[0051] Define the increase in reference coverage as reference gain: ;in, and These represent the reference coverage before and after the call.

[0052] The total benefit of the tool is obtained by combining the three factors: ;in, These are the profit weights, and none of the three are simultaneously 0.

[0053] (52) In budget-constrained routing, a balance needs to be struck between benefits and costs. The cost and benefits of the tool are modeled to obtain the overall utility of the tool, which is expressed as follows: ; in, This represents the overall utility of the j-th tool; This represents the total revenue of the j-th tool; This represents the expected delay of the j-th tool; Let represent the expected failure probability of the j-th tool; This represents the expected output length of the j-th tool; Indicates the delay penalty coefficient; Indicates the failure penalty coefficient; Output length penalty coefficient.

[0054] (53) Toolchain selection under budget constraints: (531) Let the tool index sequence of the toolchain be... for: ;in, This indicates the number of tools actually invoked in the current instance.

[0055] Establish budget constraints: ; ;in, Indicates the maximum number of times the function can be called; This indicates the maximum total latency of the toolchain. This indicates that the tool expects a delay.

[0056] (532) Establish the objective function under budget constraints: ;in, It represents the overall utility of the toolchain.

[0057] (533) In engineering implementation, to avoid introducing a complex global solver, the scheme provides two feasible deterministic selection methods: greedy routing and bundle search routing. Both satisfy the above budget constraints and can be switched under different degradation intensities.

[0058] Greedy routing implementation: In greedy routing, first calculate the unit latency utility ratio of each tool: ;in, This represents the unit delay utility ratio of the j-th tool; It is a stable term that is greater than 0.

[0059] Beam search routing implementation (for high degradation or strong collisions). When the degradation intensity is high or the collision degree is large, a simple greedy approach may lead to subsequent failures to meet the requirements of mandatory verification and collision elimination in the early selection. Therefore, beam search is introduced to maintain a small number of candidate links. The beam width is defined as... And in each round of expanding the candidate toolchain set, the one with the highest utility is always retained. There are 10 candidate links. The candidate link is scored based on the total link utility: ; in, This indicates the score of the candidate toolchain.

[0060] (54) Perform structural verification on the tool output, including: (541) Construct the format validation function: ; This indicates that the output meets the expected structural constraints (all fields are complete, the types are correct, and key fields are parsable), and This indicates that the output does not meet the expected structural constraints; where, This represents the raw output of the m-th tool call; This represents the SchemaGuard structure verification function.

[0061] (542) Construct structural verification markers: ;in, This represents the structure check flag for the m-th output.

[0062] (543) Preset single call timeout threshold It then performs timeout and null return checks, the expression of which is: ; ;in, This represents the actual time taken for the m-th tool call; This indicates the timeout flag for the m-th tool call; This indicates an empty return flag for the m-th tool call; This indicates the exception trigger flag for the m-th tool call.

[0063] Define an empty return flag: ;when This flag indicates that the output is empty or missing key content (e.g., the key field is an empty string, the array length is 0, or there are no valid entries after parsing). This flag can be obtained through rule-based checks.

[0064] (55) Trigger a deterministic backoff chain or cache path when verification fails, including: (551) Preset tool rollback relationship diagram Construct the fallback successor selection function: ;in, Indicates the index of the successor backup tool for tool j; This represents the successor selection function after the rollback. To characterize the rollback depth, the number of rollback steps from the initial tool to the current tool is defined as... And give the maximum rollback depth threshold. .

[0065] (552) Rollback execution rules (deterministic, replayable): when When this happens, the following rollback rules are executed: If And if the budget still allows (remaining call counts and remaining delay budget are not exceeded), then the tool for this call will be removed from... Replace with backup tool and update the rollback depth to Then the call is re-executed and SchemaGuard verification is performed again; if If the budget is insufficient, further external calls should be stopped, and a cached or conservative path should be used. To ensure accountability, the rollback path must be written into the evidence contract's tracing field when a rollback occurs. With assembly trajectory field This allows for a retrospective analysis of the specific process of "original tool failure - use of backup tool - obtaining evidence".

[0066] Whether the budget allows can be determined by the following formula: the remaining number of calls is constrained as follows: ; The remaining delay budget constraint is .

[0067] (553) The expression for the cache path is: ;in, This represents the cached alternative output for the m-th tool call; This indicates a cache read function that returns the most recent valid tool result or public cache result for the student in the same type of task. This represents the index of the tool corresponding to the lowest m calls in the toolchain.

[0068] (56) This embodiment also includes conflict detection and adjudication, which is used to identify conflicting evidence with inconsistent claims within the same applicable scope in the evidence contract set, and to make a computable adjudication on the conflicting evidence, writing the conflict relationship back to the evidence contract field. Simultaneously update conflict level The goal of this step is not to forcibly eliminate differences, but to form clear conflict grouping and adjudication results, so that subsequent assembly can prioritize the assembly of citationable evidence, and not output key conclusions or trigger supplementary evidence if conflicts are not resolved.

[0069] First, the standardized representation of evidentiary claims: To ensure that conflict resolution is feasible and reviewable, the plan specifies each evidentiary contract. Content load By performing claim normalization extraction, the normalized claim of this evidence is obtained: ;in, The function is used to extract rules, and its output is a structured key or discrete label (e.g., "attribution knowledge point = K", "question type = T", "key step = R"), which is used for subsequent consistency comparison.

[0070] Second, overlapping scope of application determination (avoiding misjudgment of conflicts across scopes): Conflict detection is only performed when the scope of application overlaps, to prevent evidence from different knowledge points, question types, or time windows from being misjudged as conflicting. Regarding evidence... Define range overlap markers: ; in, Indicate the evidence is correct. The range overlap marker; Indicates the function for determining range overlap; Indicates the first The field indicating the scope of application of evidence.

[0071] Third, conflict determination and conflict matrix construction: for any The conflict determination is defined as follows: ; when At that time, the evidence was considered With evidence These form conflict edges. Further, all conflict edges are grouped into a conflict edge set: ; in, Indicates the terms of the evidentiary contract. Conflict determination value; Represents the set of conflicting edges; Fourth, conflict group generation and Backfilling: The collection of evidence indexes Treat it as a set of nodes, Treat it as a set of edges and construct a conflict graph. Among them, the set of evidence nodes Perform connected component decomposition on the conflict graph to obtain a set of conflict groups: ; Let r be the set of evidence indices for the r-th conflict group. Let r represent the number of conflict groups. To record conflict group identifiers in the evidence contract, assign a group identifier to each conflict group: the identifier of the r-th conflict group. And populate the conflict group field for each piece of evidence with: If evidence q does not belong to any conflict group, then It is an empty set. Here, Generate a function to identify conflict groups.

[0072] Fifth, conflict level update ( Based on conflict determination Update conflict level: .

[0073] Sixth, Conflict adjudication (choice of winning evidence within a group): for any conflicting group We need to select "winning evidence" that can be used for subsequent must-cite and assembly priority. Define the adjudication score for the evidence within the group: ;in, Source weights are used to reflect differences in source reliability; As a time-sensitive weight, it is used to reflect the difference between new and old evidence; This is the version consistency weight, used to reflect the priority of being consistent with the current version.

[0074] The timeliness weight is defined as follows: ; The version consistency weight is defined as: ;in, To ensure consistent version weights, For inconsistent version weights, and Then the conflict group The index of evidence for winning is: The winning evidence will be set as the primary evidence within the group and will be used preferentially during subsequent assembly. Simultaneously, the mandatory reference flag for the primary evidence can be set to 1. Evidence that did not win in the same group This allows setting the forced reference flag to 0 or maintaining its original value while lowering the assembly priority (this strategy is reflected in fragment selection). Here, This is the time-related decay coefficient; This serves as the identifier for the current version. For the index of the winning evidence in the r-th conflict group; This is to force the reference to the field.

[0075] Step 6: Divide the total context budget into slots for logs, knowledge, constraints, and tracing, and dynamically adjust the budget percentage for any slot based on degradation intensity; select segments under the slot budget constraints based on segment relevance, credibility, and conflict penalty, including the following steps: This step is used to determine the total budget for tokens within a fixed context. The budget is allocated to different information slots so that the assembly results cover key evidence while retaining necessary constraints and traceability information, avoiding situations where search fragments fill the context, key constraints are squeezed out, and citations cannot be traced.

[0076] (611) Total budget for context token The slots are divided into log slots, knowledge slots, constraint slots, and traceability slots, and their expressions are as follows: ; in, Indicates the log slot budget; Indicates the knowledge slot budget; Indicates the constraint slot budget; This indicates the budget for the traceability tank.

[0077] (612) Basic quota setting: In order to ensure that there is minimum accountability capability in any scenario, the scheme first provides a basic quota. , , and And satisfy: ;in, This serves as the base quota for traceability slots, ensuring that evidence identifiers and key version information can be retained even when budgets are tight.

[0078] (613) Dynamic sizing driven by degradation intensity: when degradation intensity When increasing the budget, the proportion of the constraint slot and the tracing slot needs to be increased to ensure that reproducible and low-drift results can still be output under conflict and noise scenarios. The solution introduces an increase in the size of the tracing slot and the constraint slot, and continuously controls their size using degradation intensity. First, the increase in the size of the tracing slot is defined: ; Redefine the constraint slot increment: ; in, , It is the addition coefficient, and satisfies To avoid the additional allocation exceeding the total budget, a dynamic budget is derived: ; ; Since the total budget is fixed, the budgets for log slots and knowledge slots need to be reduced accordingly. To maintain simplicity and reproducibility, the solution reduces the budgets for log slots and knowledge slots proportionally. First, define the total amount that can be reduced: ; Redefine the reduction allocation ratio: ; The budget percentage for any slot is dynamically adjusted based on the degradation intensity, and its expression is as follows: ; ; The above structure ensures that the budget conservation constraint always holds, and as the degradation intensity increases, the system automatically increases the proportion of constraints and attribution, thereby improving stability and accountability. This represents the base quota for the log slot budget; This represents the basic allocation for the knowledge slot budget; This indicates a reduction in the allocation ratio; This indicates the total amount that needs to be reduced in the log slots and knowledge slots.

[0079] (614) Budget Lower Bound Control: To avoid the complete loss of information due to the reduction of log slots or knowledge slots to 0 under extreme degradation conditions, this embodiment can set a lower bound for the slot budget: Log slot budget lower bound Knowledge slot budget lower bound And truncate the dynamic budget with a lower bound: ; When lower bound truncation violates budget conservation, priority can be given to... The corresponding difference will be deducted to ensure that the assembly still prioritizes the executable content, while retaining the necessary traceability.

[0080] (62) Selecting segments under slotting budget constraints based on segment relevance, credibility, and conflict penalty, including: (621) For the unified set of evidentiary contracts Any of the evidence contract clauses Several candidate fragments are generated based on the evidence source type identifier and the evidence content payload: ;in, Indicates the total number of candidate segments; Represents the set of candidate segments; This represents the p-th candidate segment.

[0081] To avoid introducing and Synonymous new variables, the scope of application of a fragment directly inherits the scope of application of its source evidence contract; at the same time, the mapping function between the fragment and the evidence contract is defined as: .

[0082] (622) Construct the fragment length cost, the expression of which is: ,in, Indicates the length of the p-th candidate fragment token; This represents the function for calculating the token length.

[0083] (623) Constructing fragment utility: Its expression is: ; in, This represents the fragment utility of the p-th candidate fragment; Represents the relevance weight; This represents the p-th candidate segment. With task request The correlation score; Indicates the credibility weight; This indicates that the mandatory citation marker (i.e., must-cite) increases the weight. Indicates the weight of the repetition penalty; Indicates the length penalty weight; Indicates the conflict penalty weight; Indicates the credibility of the evidence for the p-th candidate segment; This represents the conflict penalty term for the p-th candidate segment; This represents the repetition penalty term for the p-th candidate segment; This represents the must-cite promotion term for the p-th candidate segment.

[0084] (63) Budget constraint segment selection: This step is used to select from the candidate fragment set under the hard constraint of the slotting budget. The optimal subset is selected and an achievable deterministic selection strategy is given. The basic principle of selection is to maximize the total utility of the selected fragments without exceeding the budget of each slot, while ensuring that must-cite evidence is included first, and suppressing conflicting non-primary evidence and highly repetitive fragments, thereby stabilizing the quality of context assembly.

[0085] Fragment slot assignment definition and slot candidate set: To map fragments to four types of slots, a fragment slot function is defined: ;in, Representing fragments The appropriate slot type can be determined by the source type. The content attributes and source fields determine the slot allocation. For example, fragments originating from "log" are assigned to the "log" slot, fragments originating from "kb" are assigned to the "kb" slot, rule and template fragments are assigned to the "con" slot, and evidence identifier, version, and assembly trajectory fragments are assigned to the "tra" slot. Further, define the candidate slot set: ; ; ; ; in, , , and It is a set of candidate fragments for four types of slots.

[0086] (632) The optimal expression under the slot budget constraint, defining the set of selected segments as: And define the slot token occupancy on the selected set: ; ; ; ; The budget constraint is then: ; ; ; ; Under the above constraints, the objective of segment selection is to maximize total utility: ; Here, , , and The budget has been used for the four slots; (633) The mandatory inclusion of must-cite fragments and the pre-deduction of budget usage, in order to ensure accountability, first construct a set of must-cite fragments: And pre-deduct the must-cite budget for each slot; for example, the pre-deducted amount for the log slot is defined as: Other slots , and The same definition applies.

[0087] (634) Greedy selection for slots (default implementation, deterministic and reproducible): After pre-deducting the must-cite, select fragments from the remaining candidates for each slot. Taking log slots as an example, define the set of possible log slots: ; Define the remaining budget for the log slot: ; For candidate fragments Define the unit budget utility ratio: ; Here, according to Sort the log slots from largest to smallest, and try adding them to the selected set in turn. The condition for joining is that after joining, the number of times the membership does not exceed a certain threshold. The final selected set is defined as follows: ; and will The assembly context is formed by assembling the slots in the order of constraint slot → knowledge slot → log slot → traceability slot. The tracing slot is used to explicitly list the reference identifier and version information in the context, supporting subsequent forced binding by Binder.

[0088] Step 7: Assemble the selected fragments into a context, forcibly bind evidence identifiers to key conclusions, calculate citation coverage, and trigger supplementary evidence, rollback, or downgraded output if the coverage is insufficient. This includes the following steps: (71) Let the set of key conclusions be defined. for: ;in, Indicates the number of key conclusions; This represents the h-th key conclusion object.

[0089] (72) Establish the binding relationship between the conclusion and the evidence, the expression of which is: ;in, The conclusion-evidence binding function.

[0090] when Time represents the h-th key conclusion object. Citing Article q, the Evidence Contract Each key conclusion must be associated with at least one piece of evidence. ; in, Indicates the number of evidentiary contracts; This indicates that the operation is performed on all.

[0091] (73) Candidate Evidence Set and Binding Score: To ensure that binding is achievable and reviewable, the scheme constructs a candidate evidence set for each key conclusion and selects it based on the binding score. Definition of binding score for conclusions... The candidate evidence set is as follows: ;in, For the range matching function, ensure binding only occurs when the applicable ranges are consistent. Define binding scores for candidate evidence: The first item reflects the credibility of the evidence; the second item reflects the priority of must-cite; and the third item imposes a penalty on evidence in the conflict group (if the conflict group has already decided and the evidence is the winning evidence, then its...). Typically 1, the penalty can be offset. For each conclusion, the evidence with the highest score is selected as the binding object: And order: ;in, Denotes the set of candidate evidence for conclusion h; Indicates a range matching function; Indicates the binding score; To bind score weights; The conclusion h represents the selected evidence index; The cardinality of the set of evidence conflict groups.

[0092] (74) Calculate the reference coverage, the expression of which is: ; in, This indicates the reference coverage rate.

[0093] Preset reference coverage threshold ;when When, the citation coverage is deemed satisfactory; when When this happens, the reference coverage is deemed insufficient.

[0094] Step 8: Refine the context layer by layer according to the three-level structure of coarse, medium, and fine layers, and perform gating judgment based on quality scores; if the standard is not met, revert to step 5 to re-execute tool routing or revert to step 6 to select segments, including the following steps: (81) The preset hierarchical index is: ;in, Indicates a coarse layer; Indicates middle layer; Indicates a fine layer.

[0095] (82) Find the first Layer-based task requests coverage for: ;in, This represents the function for calculating coverage. Indicates the first Layer assembly context.

[0096] (83) The hierarchical reference coverage is calculated as follows: ; in, Indicates the first Hierarchical reference coverage; Indicates the first Layered evidence contract subset.

[0097] (84) The degree of hierarchical conflict is obtained, and its expression is: ; in, Indicates the first Degree of hierarchical conflict; Indicates the number of pieces of evidence at each level.

[0098] (85) The hierarchical budget overflow penalty is obtained, and its expression is: ; ; in, Indicates the first Token occupancy for the layer context; Indicates the first Hierarchical budget overflow penalty.

[0099] (86) Construct a hierarchical quality scoring function and perform gating judgment based on the quality score. Its expression is: ; in, Indicates the first Hierarchical quality score; Quality weights representing coverage; The quality weight represents the citation coverage. Quality weights representing the degree of conflict; The quality weight represents the level budget overflow penalty.

[0100] The ninth step is to construct a comprehensive feedback score based on the task completion results and perform online closed-loop updates.

[0101] First, the comprehensive feedback score The expression is: ; ; in, Indicates the completion rate of a plan or task; Indicates the follow-up inquiry rate; Indicates the improvement rate in post-testing; Indicates the retry rate; Indicates the completion rate of a plan or task. The corresponding feedback weights; Indicates post-test improvement rate The corresponding feedback weights; Indicates follow-up question rate The corresponding feedback weights; Retrieval rate The corresponding feedback weights; This indicates the pre-test score or baseline accuracy before executing this tool routing and context assembly; This represents the score or post-test accuracy obtained after performing this tool routing and context assembly. This represents the smallest positive number that prevents the denominator from being zero.

[0102] (92) Online updates of tool failure probability and expected delay: for each tool In this task, we can observe whether it fails and its actual time consumption. Define the failure observation flag: ;in, This indicates that the tool experienced a timeout, returned an empty value, or failed SchemaGuard verification during this task. This indicates success.

[0103] Probability of failure when using exponential sliding update: ;in, Let be the failure probability update rate. Similarly, for the expected delay, the delay of this observation is defined as . And update using EMA: ;in, To delay the update rate; and The failure probability before / after the update; and The expected delay before / after the update.

[0104] (93) Online calibration of source weights and conflict resolution weights, and the source weights used in conflict resolution. This reflects the differences in reliability of evidence from different sources. To avoid the mismatch of fixed weights in long-term operation, the scheme uses comprehensive feedback. To drive a slow calibration of the source weights, let... The current weight of a certain source type is defined and updated as follows: ;in, Update the step size for weights. and This defines the legal range for weights. The update rule ensures that when the overall feedback is better than the threshold, the weights of relevant sources increase slowly; when the overall feedback is lower than the threshold, the weights decrease slowly, thus reflecting the true effect to the conflict resolution process.

[0105] (94) Online adjustment of budget allocation and citation threshold: When there is insufficient long-term citation coverage or a high retry rate, the assembly strategy needs to be conservatively adjusted. Therefore, this embodiment adjusts the traceability allocation coefficient. With reference coverage threshold Introduce feedback-driven updates. Define reference gaps as: ; The traceability and allocation coefficient can then be updated as follows: ;in, To increase the step size, This serves as the upper bound. Meanwhile, to avoid overly conservative approaches after stable operation, a slow regression can be used for the reference coverage threshold: ; in, Update the step size for the threshold. and The threshold is within the valid range; For reference gaps; For traceability and allocation coefficients before / after the update; To facilitate tracing, an update step size has been added; This serves as the upper bound for the traceability and allocation coefficient. The reference threshold is set before / after the update. The strategy ensures that when the overall effect is good and stable, the threshold can be gradually reduced to free up assembly space; when the effect deteriorates or there are more follow-ups and retries, the tracing budget is increased and a higher reference requirement is maintained.

[0106] The above embodiments are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any changes made based on the design principles of the present invention, or any non-creative modifications made thereon, shall fall within the scope of protection of the present invention.

Claims

1. A tool routing and context assembly method based on trusted learning log evidence, characterized in that, Includes the following steps: Step S1: Obtain the original learning log event sequence of students within a specified time window, calculate the anomaly intensity of any event based on robust statistics, map the anomaly intensity to the event confidence weight, and suppress the anomaly events according to the confidence weight to obtain the denoised event sequence. Step S2: Aggregate the denoised event sequence according to knowledge points or question indexes to generate log evidence candidates and calculate the log confidence of the log evidence candidates. Construct a log evidence contract that includes evidence identifier, source type, tracing information, version identifier, confidence and forced citation mark. Step S3: The log evidence contract, knowledge base retrieval evidence, and rule constraint evidence are integrated into a unified evidence contract set. Based on the standardized representation of evidence claims, evidence conflicts are identified, and the conflict evidence groups are adjudicated to select the winning evidence and update the conflict degree. Step S4: Calculate the degradation intensity based on window anomaly rate, log sparsity, evidence conflict degree and budget tension, and select tool routing strategy and context assembly strategy according to degradation intensity. Step S5: Under the constraints of tool call count and delay budget, select and execute the toolchain based on tool utility, perform structural verification on the tool output, and trigger a deterministic fallback chain or cache path when the verification fails. After execution, update the evidence contract set. Step S6: Divide the total context budget into log slots, knowledge slots, constraint slots, and tracing slots, and dynamically adjust the budget ratio of any slot according to the degradation intensity; select segments based on segment relevance, credibility, and conflict penalty under the slot budget constraint. Step S7: Assemble the selected fragments into a context, forcibly bind evidence identifiers to key conclusions, calculate the citation coverage, and trigger supplementary evidence, rollback, or downgraded output if the coverage is insufficient. Step S8: Refine the context layer by layer according to the three-level structure of coarse, medium and fine layers, and perform gating judgment based on quality score; if the standard is not met, fall back to step S5 to re-execute tool routing or fall back to step S6 segment selection; Step S9: Construct a comprehensive feedback score based on the task completion effect and perform online closed-loop updates.

2. The tool routing and context assembly method based on trusted learning log evidence according to claim 1, characterized in that, Obtain the original learning log event sequence of students within a specified time window, calculate the anomaly intensity of any event based on robust statistics, map the anomaly intensity to an event confidence weight, and suppress the anomaly events according to the confidence weight to obtain the denoised event sequence, including the following steps: students In the analysis window Learning events within are represented as follows: ; in, This represents the nth log event; Indicates the start timestamp of the analysis window; Indicates the timestamp of the end of the analysis window; This represents the sequence of events in the original learning log; Indicates the number of log events within the window; The nth log event The expression is: ; in, This represents the timestamp of the nth log event; Indicates the behavior type of the nth log event; This indicates the response result for the nth log event; This indicates the time consumption characteristic corresponding to the nth log event; This represents the index of the question or knowledge point corresponding to the nth log event; From the original learning log event sequence Extract the time consumption characteristics of all events and form a time consumption set. : ; The expression for calculating the anomaly strength of any event based on robust statistics is as follows: ; ; ; in, Indicates the anomaly intensity of the nth log event; This represents the median time elapsed. This indicates the median absolute deviation of the time spent; This represents a stable term with a value greater than 0; This represents median operations; Preset abnormal threshold , ;when If the event occurs, the nth log event will be recorded as an exception and stored in the exception set. Its expression is: ; The expression for mapping anomaly intensity to event confidence weight is as follows: ; in, This represents the event trust weight of the nth log event. ; Indicates the abnormal suppression intensity coefficient; Preset lower bound of trusted weights This forms the truncated trusted weights: ; in, This represents the truncated trust weight of the nth log event.

3. The tool routing and context assembly method based on trusted learning log evidence according to claim 2, characterized in that, The denoised event sequences are aggregated by knowledge point or question index to generate log evidence candidates and calculate the log confidence of the log evidence candidates. A log evidence contract is constructed, which includes evidence identifier, source type, tracing information, version identifier, confidence, and mandatory citation mark, including the following steps: From the original learning log event sequence Extract the index of questions or knowledge points corresponding to the nth log event. and form a set of aggregate bonds. ;in, Represents the set of aggregate keys; For aggregate key set any aggregate bond in Preset event index set: ;in, Indicates mapping to the first Aggregate bonds A collection of log event indexes; This indicates the value of the aggregate field corresponding to the nth log event; Represents the set of aggregate keys Middle One aggregation bond; Mapped to the first Aggregate bonds Log event index collection Construct log evidence candidates, whose expression is: ; in, Indicates by the first Log evidence candidates generated from each aggregation key; The log confidence score for candidate log evidence is calculated using the following expression: ; in, Indicates by the first Log evidence candidates generated by aggregation keys Log confidence; Represents the event index set The cardinality; Construct a log evidence contract that includes evidence identifier, source type, tracing information, version identifier, confidence level, and mandatory citation marker. Its expression is: ; ; in, Indicates by the first Log evidence candidates generated by aggregation keys The generated q-th evidence contract record, i.e., the evidence contract entry; The unique identifier representing the log evidence contract of the qth entry; This indicates the type of evidence source for the log evidence contract of entry q; This represents the evidence tracing information for the q-th log evidence contract; This indicates the version identifier of the log evidence contract for the qth entry; This represents the hash signature of the evidence content of the q-th log evidence contract; This indicates the confidence level of the evidence contract for the qth log entry. This indicates the mandatory reference marker for the log evidence contract of the qth entry; This indicates the scope of application of the log evidence contract in Article q; This represents the evidentiary content payload of the log evidence contract of the qth entry; Represents the set of conflict group identifiers for the q-th log evidence contract; This represents the assembly trajectory identifier of the qth log evidence contract; This indicates the global number after the candidate log evidence is entered into the database to form an evidence contract entry.

4. The tool routing and context assembly method based on trusted learning log evidence according to claim 3, characterized in that, The log evidence contract is integrated with knowledge base retrieval evidence and rule-constrained evidence into a unified evidence contract set. Based on the standardized representation of evidence claims, evidence conflicts are identified. Conflicting evidence groups are adjudicated to select the winning evidence and the conflict degree is updated. This includes the following steps: The log evidence contract, knowledge base retrieval evidence, and rule constraint evidence are integrated into a unified set of evidence contracts, denoted as... For any article of the evidentiary contract The source type of evidence is marked as And the source type of evidence is identified. The possible values ​​for include: log, kb, rule, and tool; When the qth evidence contract item Evidence source type identifier satisfies At that time, the confidence level of the evidentiary contract for the q-th log entry is... To assign a value, the expression is: ;in, Indicates by the first Log evidence candidates generated by aggregation keys Log confidence; When the qth evidence contract item Evidence source type identifier satisfies Then, the confidence level of the evidence contract for the qth log entry is determined. To assign a value, the expression is: ; ; ; ; ; in, This indicates the content of the evidence contract and the task request in clause q. The correlation score; Represents a semantic similarity function; Indicates a task request; This indicates that the evidence is not timely; Indicates the current timestamp; Indicates the timestamp of evidence update; Indicates the length of the evidence content token; This represents the function for calculating the token length. Indicates the total budget of the context token; Indicates the normalized scale of timeliness; The calibration coefficient representing the correlation; Calibration coefficient indicating aging; Calibration factor indicating length; This represents the Sigmoid normalization function; This represents the original confidence score of the evidence in the knowledge base; When the qth evidence contract item Evidence source type identifier satisfies Then, the confidence level of the evidence contract for the qth log entry is determined. To assign a value, the expression is: ; ; in, This indicates the version consistency flag of the log evidence contract for the qth entry; Indicates the current rule or textbook version identifier; Indicates an indicator function; This represents the baseline confidence level of rule-based evidence; This represents the version consistency gain coefficient. Represents the interval cutoff function; When the qth evidence contract item Evidence source type identifier satisfies Then, the confidence level of the evidence contract for the qth log entry is determined. To assign a value, the expression is: ; in, This represents the reliability index of the j-th tool; This represents the matching score between the qth item of the instrument source evidence contract and the current request; This indicates the evidence format integrity marker for the qth log evidence contract; Indicates the calibration coefficient for the reliability term; Indicates the calibration coefficient for the matching degree item; The calibration coefficient for the format integrity item; Confidence level of the evidentiary contract for the qth log entry Perform lower and upper bound truncation: ;in, Indicates the lower bound of the confidence level; This indicates the upper bound of the confidence level.

5. The tool routing and context assembly method based on trusted learning log evidence according to claim 4, characterized in that, The degradation intensity is calculated based on window anomaly rate, log sparsity, evidence conflict, and budget constraints. The tool routing strategy and context assembly strategy are then selected based on the degradation intensity, including the following steps: The window anomaly rate The expression is: ;in, Indicates the anomaly intensity of the nth log event; The log sparsity The expression is: ; ; ;in, A flag indicating the validity of the nth log event; Indicates the valid event threshold; This represents the trust weight of the nth log event after truncation. The degree of conflict of evidence The expression is: ; ; ;in, Represents a unified set of evidentiary contracts The claim to standardize the log evidence contract in Article q of the law; Normalization advocates for extracting functions; Indicates the terms of the evidentiary contract. Conflict determination value; Represents a unified set of evidentiary contracts The number of evidentiary contract entries; The budget tightness The expression is: ; ; ; ; in, This indicates the number of tool calls that have occurred so far. Indicates the maximum number of times the tool can be called; This indicates the current cumulative toolchain time. Indicates the maximum total latency of the toolchain; This indicates the number of tokens currently used. Indicates the total budget for tokens; Indicates the proportion of the tool budget consumed; Indicates the proportion of delayed budget consumption; Indicates the proportion of context budget consumption; Indicates the proportion of tool budget consumption The corresponding budget consumption weight; Indicates the proportion of delayed budget consumption The corresponding budget consumption weight; Indicates the proportion of context budget consumption The corresponding budget consumption weight; Degradation intensity is calculated based on window anomaly rate, log sparsity, evidence conflict, and budget constraints. Its expression is: ; in, This represents the degenerate combination weight corresponding to the window anomaly rate; This represents the degenerate combination weight corresponding to log sparsity; This indicates the weight of the degenerate combination corresponding to the degree of evidence conflict; This indicates the degraded portfolio weights corresponding to budgetary constraints; This indicates a degenerate bias term.

6. The tool routing and context assembly method based on trusted learning log evidence according to claim 5, characterized in that, Under the constraints of tool call count and latency budget, a toolchain is selected and executed based on tool utility. The tool output is structurally validated. If the validation fails, a deterministic fallback chain or cache path is triggered. After execution, the evidence contract set is updated, including the following steps: By modeling the costs and benefits of the tool, we obtain its overall utility, which is expressed as follows: ; in, This represents the overall utility of the j-th tool; This represents the total revenue of the j-th tool; This represents the expected delay of the j-th tool; Let represent the expected failure probability of the j-th tool; This represents the expected output length of the j-th tool; Indicates the delay penalty coefficient; Indicates the failure penalty coefficient; Output length penalty coefficient; Let the tool index sequence of the toolchain be defined. for: ;in, Indicates the number of tools actually invoked in the current instance; Establish the objective function under budget constraints: ;in, This represents the overall utility of the toolchain. Use greedy routing or bundle search routing to select and execute the toolchain; Perform structural validation on the tool output, including: Construct a format validation function: ; This indicates that the output satisfies the expected structural constraints, and This indicates that the output does not meet the expected structural constraints; where, This represents the raw output of the m-th tool call; This represents the SchemaGuard structure verification function; Construct structure verification tags: ;in, This represents the structure check flag for the m-th output. Preset single call timeout threshold It then performs timeout and null return checks, the expression of which is: ; ;in, This represents the actual time taken for the m-th tool call; This indicates the timeout flag for the m-th tool call; This indicates an empty return flag for the m-th tool call; This indicates an exception trigger flag for the m-th tool call; When validation fails, a deterministic backoff chain or cache path is triggered, including: Preset tool rollback diagram Construct the fallback successor selection function: ;in, Indicates the index of the successor backup tool for tool j; This indicates the fallback successor selection function; The expression for the cache path is: ;in, This represents the cached alternative output for the m-th tool call; This indicates the cache read function; This represents the index of the tool corresponding to the lowest m calls in the toolchain.

7. The tool routing and context assembly method based on trusted learning log evidence according to claim 6, characterized in that, The total context budget is divided into log slots, knowledge slots, constraint slots, and tracing slots. The budget percentage of any slot is dynamically adjusted based on the degradation intensity. Segments are selected under the slot budget constraints based on fragment relevance, credibility, and conflict penalty, including the following steps: Total budget for context token The slots are divided into log slots, knowledge slots, constraint slots, and traceability slots, and their expressions are as follows: ; in, Indicates the log slot budget; Indicates the knowledge slot budget; Indicates the constraint slot budget; Indicates the budget for the traceability tank; The budget percentage for any slot is dynamically adjusted based on the degradation intensity, and its expression is as follows: ; ; in, This represents the base quota for the log slot budget; This represents the basic allocation for the knowledge slot budget; This indicates a reduction in the allocation ratio; This indicates the total amount that needs to be reduced in log slots and knowledge slots; Fragment selection under slotting budget constraints is based on fragment relevance, reliability, and conflict penalty, including: For the unified set of evidentiary contracts Any of the evidence contract clauses Several candidate fragments are generated based on the evidence source type identifier and the evidence content payload: ;in, Indicates the total number of candidate segments; Represents the set of candidate segments; This represents the p-th candidate segment; The cost of constructing the fragment length is expressed as: ,in, Indicates the length of the p-th candidate fragment token; This represents the function for calculating the token length. Constructing fragment utility: Its expression is: ; in, This represents the fragment utility of the p-th candidate fragment; Indicates the relevance weight; This represents the p-th candidate segment. With task request The correlation score; Indicates the credibility weight; This indicates that the reference marker is being forced to increase its weight. Indicates the weight of the repetition penalty; Indicates the length penalty weight; Indicates the conflict penalty weight; Indicates the credibility of the evidence for the p-th candidate segment; This represents the conflict penalty term for the p-th candidate segment; This represents the repetition penalty term for the p-th candidate segment; This represents the must-cite promotion term for the p-th candidate segment.

8. The tool routing and context assembly method based on trusted learning log evidence according to claim 7, characterized in that, The selected fragments are assembled into a context, and evidence identifiers are forcibly bound to key conclusions. Citation coverage is calculated, and if the coverage is insufficient, supplementary evidence, rollback, or downgraded output is triggered, including the following steps: Define a set of key conclusions. for: ;in, Indicates the number of key conclusions; This represents the h-th key conclusion object; The formula for establishing the link between conclusions and evidence is: ;in, Represents the conclusion-evidence binding function; when Time represents the h-th key conclusion object. Citing Article q, the Evidence Contract Each key conclusion must be associated with at least one piece of evidence. ; in, Indicates the number of evidentiary contracts; This indicates that the operation is performed on all. The expression for calculating reference coverage is: ; in, Indicates reference coverage; Preset reference coverage threshold ;when When, the citation coverage is deemed satisfactory; when When this happens, the reference coverage is deemed insufficient.

9. The tool routing and context assembly method based on trusted learning log evidence according to claim 8, characterized in that, The context is refined layer by layer according to a three-level structure of coarse, medium, and fine layers, and gating judgment is performed based on quality scores. If the criteria are not met, the process reverts to step S5 to re-execute tool routing or reverts to step S6 to select segments, including the following steps: The default hierarchical index is: ;in, Indicates a coarse layer; Indicates middle layer; Indicates fine layers; Find the first Layer-based task requests coverage for: ;in, This represents the function for calculating coverage. Indicates the first Layer assembly context; The hierarchical reference coverage is calculated as follows: ; in, Indicates the first Hierarchical reference coverage; Indicates the first Layered evidence contract subset; The degree of hierarchical conflict is calculated using the following expression: ; in, Indicates the first Degree of hierarchical conflict; Indicates the number of pieces of evidence at each level; The expression for the hierarchical budget overflow penalty is as follows: ; ; in, Indicates the first Token occupancy for the layer context; Indicates the first Hierarchical budget overflow penalty; Construct a hierarchical quality scoring function and perform gating judgments based on the quality scores. Its expression is: ; in, Indicates the first Hierarchical quality score; Quality weights representing coverage; The quality weight represents the citation coverage. Quality weights representing the degree of conflict; The quality weight represents the level budget overflow penalty.

10. The tool routing and context assembly method based on trusted learning log evidence according to claim 98, characterized in that, The comprehensive feedback score The expression is: ; ; in, Indicates the completion rate of a plan or task; Indicates the follow-up question rate; Indicates the improvement rate in post-testing; Indicates the retry rate; Indicates the completion rate of a plan or task. The corresponding feedback weights; Indicates post-test improvement rate The corresponding feedback weights; Indicates follow-up question rate The corresponding feedback weights; Retrieval rate The corresponding feedback weights; This indicates the pre-test score or baseline accuracy before executing this tool routing and context assembly; This represents the score or post-test accuracy obtained after performing this tool routing and context assembly. This represents the smallest positive number that prevents the denominator from being zero.