Context semantic consistency control method and device supporting user correction, computer equipment and storage medium
By constructing a dual-tree separation architecture of source interaction data tree and context view tree, the context semantic consistency control of large language models in complex interaction scenarios is realized, solving the semantic distortion problem caused by automatic compression in existing technologies and improving the accuracy and reliability of model inference.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
- Filing Date
- 2026-04-15
- Publication Date
- 2026-05-12
AI Technical Summary
When large language models deal with complex interactive scenarios, the existing automatic compression schemes are prone to loss or distortion of key information due to the limitation of the context window, which can lead to semantic drift and result in inconsistent output with earlier conclusions.
A dual-tree separation architecture of source interactive data tree and context view tree is constructed. The tree diagram is displayed through a visual interface, semantic drift is detected and users are allowed to make corrections, forming a visual and interactive closed-loop process to ensure that the context content is manually verified.
It improves the accuracy and reliability of reasoning in large language models, and ensures semantic consistency of contextual content through user intervention correction, thereby reducing the risk of semantic drift.
Smart Images

Figure CN122021653A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of large language model technology, and in particular to a context semantic consistency control method, apparatus, computer device and storage medium that supports user correction. Background Technology
[0002] With the widespread application of large language models in various professional fields, these models often need to handle complex interactive scenarios involving a large amount of specialized information and long-term, multi-turn dialogues. Due to the limitation on the number of lexical units in the context window, it is often necessary to perform compression processing such as summarizing, rewriting, or merging on historical interaction content to accommodate new interaction information.
[0003] Currently, commonly used context compression schemes typically perform automatic compression in a "black box" manner, simplifying historical interaction content through methods such as summarizing, rewriting, or merging. However, in many business scenarios, interaction data has strong logical connections, temporal dependencies, or professional constraints. "Black box" compression processing can easily lead to the loss or distortion of key information, operation order, or core constraints, causing semantic drift and making the output provided by the large language model inconsistent with earlier conclusions or established rules.
[0004] Therefore, existing technologies suffer from the problem that the contextual content relied upon by large language models during reasoning is easily distorted. Summary of the Invention
[0005] Based on this, the purpose of this application is to at least solve one of the above-mentioned technical defects, in particular the technical defect that the context content on which the large language model is based during reasoning is easily distorted after compression in the prior art. This application provides a context semantic consistency control method, apparatus, computer device and storage medium that can reduce the semantic distortion of the context content of the large language model after compression and support user correction.
[0006] Firstly, this application provides a contextual semantic consistency control method that supports user correction, including:
[0007] Obtain the source interaction data tree and context view tree corresponding to the current dialogue event stream; the source interaction data tree arranges each interaction node in the current dialogue event stream in chronological order, and each interaction node has a side link to the previous compressed versions of the interaction content; the context view tree organizes the latest compressed version of the interaction content of each interaction node according to the topic type.
[0008] The visualization interface displays a first tree diagram generated based on the source interactive data tree and a second tree diagram generated based on the context view tree.
[0009] Based on the source interaction data tree and context view tree, determine the semantic drift score of each interaction node, and based on the semantic drift score of each interaction node, determine whether there is a target interaction node with a preset semantic drift level.
[0010] If a target interaction node exists, then the target interaction node will be highlighted in the second tree diagram;
[0011] In response to the user's processing operation on the target interaction node, the source interaction data tree and the context view tree are updated to update the first tree diagram and the second tree diagram, and the process returns to the step of determining the semantic drift score of each interaction node based on the source interaction data tree and the context view tree, until there is no target interaction node; wherein, the updated context view tree is used to assemble the context content and input it into the large language model.
[0012] In one exemplary embodiment, the source interaction data tree maintains a compressed version chain for each interaction node; based on the source interaction data tree and the context view tree, the semantic drift score of each interaction node is determined, including:
[0013] Based on the compressed version chain of each interaction node, the source reference for the interaction content of each interaction node is determined from the compressed version interaction content of each interaction node in each interaction node.
[0014] Based on the source-back baseline of the interaction content of each interaction node and the latest compressed version of the interaction content of each interaction node, the semantic drift value of each interaction node under each semantic drift evaluation dimension is determined.
[0015] The semantic drift values of each interaction node under each semantic drift evaluation dimension are weighted and summed to obtain the semantic drift score of each interaction node.
[0016] In one exemplary embodiment, based on the compressed version chain of each interaction node, a source-following benchmark for the interaction content of each interaction node is determined from the historical compressed version interaction content of each interaction node, including:
[0017] If the compressed version chain of the interaction node records the interaction content of the origin-priority version, then the interaction content corresponding to the origin-priority version will be used as the origin-priority reference for the interaction content of the interaction node; the origin-priority version is a version that has been corrected or confirmed.
[0018] If the compressed version chain of the interaction node does not record the interaction content of the origin priority version, then the original version interaction content recorded in the compressed version chain will be used as the origin reference for the interaction content of the interaction node.
[0019] In one exemplary embodiment, based on the source-back baseline of the interaction content of each interaction node and the latest compressed version of the interaction content of each interaction node, the semantic drift value of each interaction node under each semantic drift evaluation dimension is determined, including:
[0020] For each interaction node, key constraints are extracted from the source baseline and the latest compressed version of the interaction content to obtain the baseline power business key constraint set and the latest power business key constraint set for each interaction node.
[0021] Based on the source benchmark of the interaction content of each interaction node and the latest compressed version of the interaction content, the similarity of the interaction content is determined. Also, based on the benchmark set of key power business constraints and the latest set of key power business constraints of each interaction node, the coverage of key power business constraints, the consistency deviation of structured fields and the consistency deviation of time series are determined.
[0022] The similarity of interaction content, coverage of key constraints in power business, consistency deviation of structured fields, and consistency deviation of time sequence are determined as the semantic drift values of each interaction node under each semantic drift evaluation dimension.
[0023] In one exemplary embodiment, the processing operation includes a review trigger operation and a correction operation; in response to the user's processing operation on the target interaction node, the source interaction data tree and the context view tree are updated, including:
[0024] In response to a user's review trigger action on a target interaction node, the system retrieves the baseline and the latest compressed version of the interaction content of the target interaction node, and generates comparison information to be displayed on the visualization interface. The comparison information is used to provide guidance when the user edits the interaction content of the target interaction node.
[0025] In response to a user's correction operation on the latest compressed version of the interactive content of the target interactive node, obtain the content before correction and the content after correction, and determine the correction type based on the content before correction and the content after correction.
[0026] Update the source interactive data tree and context view tree according to the update strategy corresponding to the correction type.
[0027] In an exemplary embodiment, the source interaction data tree and the context view tree are updated according to the update strategy corresponding to the correction type, including:
[0028] If the correction type is expansion correction, then determine whether the number of lexical units in the corrected content exceeds the upper limit of the number of lexical units in the target interactive node;
[0029] If the limit is exceeded, the number of words to be released will be determined based on the corrected content and the upper limit of the number of words. In other topic groups outside the topic group to which the target interactive node belongs, interactive nodes that have not been confirmed and have not been corrected will be selected from low to high importance scores and added to the set of nodes to be compressed.
[0030] If the total number of releasable words in the node set to be compressed is less than the number of words to be released, then other unconfirmed and uncorrected interactive nodes in the topic group to which the target interactive node belongs are selected from low to high importance scores and added to the node set to be compressed to obtain the first supplemented node set;
[0031] If the total number of releasable tokens in the first supplemented set of nodes to be compressed is less than the number of tokens to be released, then in other topic groups outside the topic group to which the target interactive node belongs, interactive nodes that have been confirmed but not corrected are selected from low to high importance scores and added to the first supplemented set of nodes to be compressed, thus obtaining the second supplemented set of nodes to be compressed.
[0032] If the total number of releasable tokens in the second supplemented set of nodes to be compressed is less than the number of tokens to be released, then in the topic group to which the target interactive node belongs, other interactive nodes that have been confirmed but not corrected are selected from low to high importance scores and added to the second supplemented set of nodes to be compressed, resulting in the third supplemented set of nodes to be compressed.
[0033] If the total number of releasable words in the third supplemented set of nodes to be compressed is less than the number of words to be released, then in other topic groups outside the topic group to which the target interactive node belongs, select from the corrected interactive nodes in order of importance from low to high, and add them to the third supplemented set of nodes to be compressed, thus obtaining the fourth supplemented set of nodes to be compressed.
[0034] If the total number of releasable words in the fourth supplemented set of nodes to be compressed is less than the number of words to be released, then in the topic group to which the target interactive node belongs, select from other corrected interactive nodes in order of importance from low to high, and add them to the fourth supplemented set of nodes to be compressed, thus obtaining the fifth supplemented set of nodes to be compressed.
[0035] If the total number of releasable tokens in the node set to be compressed after the fifth supplement is greater than or equal to the number of tokens to be released, then perform a back-to-source compression operation on the node set to be compressed after the fifth supplement to release the number of tokens to be released in order to update the source interactive data tree and context view tree.
[0036] If the total number of releasable tokens in the compressed node set after the fifth supplement is less than the number of tokens to be released, a token budget shortage message will be generated and displayed on the visualization interface; the token budget shortage message is used to guide the user to re-perform the correction operation.
[0037] In an exemplary embodiment, the source interaction data tree and the context view tree are updated according to the update strategy corresponding to the correction type, including:
[0038] If the correction type is simplified correction, the amount of words that can be released is determined based on the content before and after correction.
[0039] Overcompressed nodes are filtered out from each interaction node and sorted from high to low importance scores to form a set of nodes to be released; overcompressed nodes are interaction nodes whose current word count is lower than the current word count limit by a preset ratio.
[0040] The word element quota is allocated in descending order of importance score of each node in the node set to be released, until all the releaseable word element quotas are allocated.
[0041] For the target node to be released that has obtained the word element quota, perform back-to-source expansion, trace back along the compressed version chain of the target node to be released, and search for at least one target version interaction content whose word element count does not exceed the upper limit of the word element count of the target node to be released and whose compression degree is lower than the current compressed version.
[0042] If it exists, the target version interaction content with the lowest compression level among the target version interaction content will be used as the latest compressed version interaction content of the target node to be released, so as to update the source interaction data tree and context view tree;
[0043] If it does not exist, the previous compressed version of the interaction content of the target node to be released is obtained, and it is recompressed with the target length set as the maximum number of lexical units of the target node to be released. The compressed result is used as the latest compressed version of the interaction content of the target node to be released, so as to update the source interaction data tree and the context view tree.
[0044] Secondly, this application provides a context semantic consistency control device that supports user correction, the device comprising:
[0045] The acquisition module is used to acquire the source interaction data tree and context view tree corresponding to the current dialogue event stream. The source interaction data tree arranges each interaction node in the current dialogue event stream in chronological order, and each interaction node has a side link to the previous compressed versions of the interaction content. The context view tree organizes the latest compressed version of the interaction content of each interaction node according to the topic type.
[0046] The visualization module is used to display a first tree diagram generated based on the source interactive data tree and a second tree diagram generated based on the context view tree in the visualization interface;
[0047] The determination module is used to determine the semantic drift score of each interaction node based on the source interaction data tree and the context view tree, and to determine whether there is a target interaction node with a semantic drift level of a preset level based on the semantic drift score of each interaction node.
[0048] The highlighting module is used to highlight the target interactive node in the second tree diagram if the target interactive node exists.
[0049] The response module is used to respond to the user's processing operation on the target interaction node, update the source interaction data tree and the context view tree to update the first tree diagram and the second tree diagram, and return to execute the step of determining the semantic drift score of each interaction node based on the source interaction data tree and the context view tree, until there is no target interaction node; wherein, the updated context view tree is used to assemble the context content and input it into the large language model.
[0050] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method.
[0051] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0052] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0053] The context semantic consistency control method, apparatus, computer device, and storage medium provided in this application, which support user correction, acquire the source interaction data tree and context view tree corresponding to the current dialogue event stream. The source interaction data tree arranges each interaction node in the current dialogue event stream in chronological order, with each interaction node having a side link to its previous compressed versions of interaction content. The context view tree organizes the latest compressed versions of interaction content for each interaction node according to topic type. A visualization interface displays a first tree diagram generated based on the source interaction data tree and a second tree diagram generated based on the context view tree. Based on the source interaction data tree and the context view tree, the semantic drift score of each interaction node is determined, and based on the semantic drift score of each interaction node, it is determined whether there is a target interaction node with a preset semantic drift level. If a target interaction node exists, it is highlighted in the second tree diagram. In response to the user's processing operation on the target interaction node, the source interaction data tree is updated accordingly. The system updates the first and second tree diagrams based on the source interaction data tree and the context view tree, and then returns to the previous steps to determine the semantic drift score of each interaction node based on the source interaction data tree and the context view tree, until no target interaction node exists. The updated context view tree is used to assemble the context content and input it into the large language model. In this way, by constructing a dual-tree separation architecture of the source interaction data tree and the context view tree, and establishing an active detection and highlighting mechanism driven by semantic drift level in the visualization interface, the system systematically solves the problem that the semantics of the context content on which the large language model is based during inference are easily distorted after compression. By transforming the information loss caused by compression from an invisible black box process into a visualized, interactive, and correctable closed-loop process, users can intuitively locate distorted nodes and intervene to correct them through processing operations, ensuring that the context content input into the model has been manually verified, thereby improving the accuracy, reliability, and credibility of the model's inference basis. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 A flowchart illustrating a context semantic consistency control method supporting user correction provided in an embodiment of this application;
[0056] Figure 2 A flowchart illustrating a semantic drift score calculation method provided in this application embodiment;
[0057] Figure 3A flowchart illustrating a user calibration and cascade control method provided in an embodiment of this application;
[0058] Figure 4 A schematic diagram of a cascaded compression process for expandable correction provided in an embodiment of this application;
[0059] Figure 5 A schematic diagram of a simplified correction reverse release mechanism provided in an embodiment of this application;
[0060] Figure 6 This is a schematic diagram of the overall flow of a context content processing method provided in an embodiment of this application;
[0061] Figure 7 A flowchart illustrating another context semantic consistency control method supporting user correction provided in an embodiment of this application;
[0062] Figure 8 A schematic diagram of the structure of a context semantic consistency control device that supports user correction, provided in an embodiment of this application;
[0063] Figure 9 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0064] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0065] This application aims to address issues such as the loss of key power business constraints, distortion of equipment parameters, and confusion of operating procedures caused by context compression in the application of large language models for power systems. It provides a closed-loop mechanism for detecting compression result drift, visual review, and user correction write-back for power systems. This mechanism enables power professionals to confirm or modify the compression results, and write the confirmed or modified results back to the context view tree after structured processing. At the same time, it triggers a global re-evaluation of compressed scheduling, thereby reducing the risk of semantic drift and ensuring the integrity of key power business constraints and the accuracy of physical parameters in the context on which subsequent large language model inference is based.
[0066] In one exemplary embodiment, Figure 1 A flowchart illustrating a context semantic consistency control method supporting user correction provided in this application embodiment is shown below. Figure 1As shown, a context semantic consistency control method supporting user correction is provided. Taking the application of this method to a server as an example, the method includes the following steps S102 to S110. Wherein:
[0067] Step S102: Obtain the source interaction data tree and context view tree corresponding to the current dialogue event stream; the source interaction data tree organizes each interaction node in the current dialogue event stream in chronological order, and each interaction node has a side link to the previous compressed version of the interaction content; the context view tree organizes the latest compressed version of the interaction content of each interaction node according to the topic type.
[0068] The source interaction data tree is a data structure used to persistently store the entire history of dialogues. It maintains a complete compressed version chain for each interaction node according to the chronological order of the interactions, recording all versions from the original content to each compression, confirmation, and correction. In practical applications, the source interaction data tree must meet the following functional requirements: maintain the interaction content representation of each interaction round and each interaction step in chronological order; support backtracking from any compressed version to the original version and the latest user-confirmed / latest user-corrected version; and support the growth and querying of the compressed version chain. In power system applications, the source interaction content representation may include, but is not limited to: uncompressed original dialogue text, online monitoring data query results for power equipment, power grid operation status query results, call requests and return results of fault diagnosis and analysis tools, query results of dispatching operation procedures, referenced content of maintenance standards, diagnostic suggestions or operation instructions output by the model, etc.
[0069] The context view tree is a data structure used to reference, group, sort, and select versions of the contextual content representation of the current input large language model under the constraint of lexical budget. It is a data structure optimized for large language model input, referencing only the latest available versions of each interaction node in the source interaction data tree and grouping and sorting them according to topic type (such as business type, device representation, work order identifier) for organization and management during visual review and context assembly.
[0070] In this application, the source interactive data tree and the context view tree are linked through a Source Reference field. The Source Reference is used to reverse-locate the mapping relationship of one or more source nodes / source fragments in the source interactive data tree from the target node in the context view tree. The Source Reference is the foundation for implementing review comparison and traceable write-back. In the dual-tree implementation of this application, the Source Reference is represented as a pointer or index from the context view tree node to the source interactive data tree node.
[0071] An interaction node can refer to a complete interaction round.
[0072] In practical applications, when a single interaction step in an interaction round involves multiple subsequent parallel tool calls or subtask executions, the return results of these parallel branches may converge to the same subsequent interaction node, making that subsequent interaction node have multiple predecessor interaction nodes. In this case, the local topology of the source interaction data tree and the context view tree presents a directed acyclic graph structure.
[0073] The latest compressed version of interactive content refers to the result of the latest compression of the interactive content of the original version, the interactive content of the user-confirmed version, or the interactive content of the user-corrected version. The interactive content of each compressed version includes the original version of interactive content and the result of each compression.
[0074] Optionally, the server loads the source interaction data tree and context view tree corresponding to the current dialogue event stream from memory or a database.
[0075] Step S104: In the visualization interface, display the first tree diagram generated based on the source interactive data tree and the second tree diagram generated based on the context view tree.
[0076] The visual interface can refer to a review interface with a two-column layout, where the first column displays a visual view of the source interactive data tree, i.e., the first tree diagram, and the second column displays a visual view of the context view tree, i.e., the second tree diagram.
[0077] Optionally, the server displays the source interactive data tree and the context view tree side-by-side in a tree view within the visualization interface.
[0078] In this application, the context view tree is organized and displayed according to group identifiers, showing the latest compressed version. For example, Group 1 "#1 Main Transformer Oil Chromatography Analysis" contains 3 interactive rounds; Group 2 "#2 Relay Protection Setting Verification" contains 2 interactive rounds; and Group 3 "#3 Maintenance Plan Scheduling" contains 4 interactive rounds. The metadata displayed by each node includes the version number (version number L2 indicates that it has undergone 2 compressions), the number of terms, the semantic drift score, the semantic drift level identifier (e.g., color coding: green, yellow, or red), and the confirmed or corrected markers.
[0079] This application provides a node linkage mechanism. When a user selects a target interactive node in the second tree diagram, the corresponding source node or source fragment is located in the first tree diagram based on the source mapping field carried by the node, and the mapping relationship is displayed in a highlighted and connected manner. When a user selects a source node in the first tree diagram, all compressed nodes that reference that source node are highlighted in the second tree diagram.
[0080] Step S106: Based on the source interaction data tree and the context view tree, determine the semantic drift score of each interaction node, and based on the semantic drift scores of each interaction node, determine whether there is a target interaction node whose semantic drift level is a preset level.
[0081] Among them, the semantic drift score is used to evaluate the deviation value of the latest version of the interaction node from its interaction content source benchmark (such as the original version, the user confirmation version, or the user correction version) in terms of key information.
[0082] Among them, the semantic drift level is a quantitative index used to evaluate the degree of deviation of the content of the latest version of an interaction node from its interaction content source benchmark (such as the original version, the user confirmation version, or the user correction version) in terms of key information.
[0083] Among them, the preset level usually refers to the "dangerous" level, indicating that the interaction content of this node may have undergone unacceptable distortion. In this application, the levels can be divided into three types: "dangerous", "warning", or "safe".
[0084] Among them, the target interaction node refers to an interaction node whose semantic drift level reaches a preset level (such as the "dangerous" level) that requires manual intervention.
[0085] Optionally, the server calculates the semantic drift score of the interaction content of the latest compressed version of each interaction node in the context view tree based on the source interaction data tree and the context view tree, and based on the semantic drift score of each interaction node, determines the semantic drift level of each interaction node according to the comparison between the semantic drift score and the preset threshold, and determines whether there is an interaction node whose semantic drift level reaches the "dangerous" level, so as to determine whether there is a target interaction node.
[0086] In practical applications, the semantic drift level of the interaction node can be determined based on the semantic drift score D(n) and the preset thresholds (T_low and T_high): when D(n) < T_low, the risk level is safe (can be marked as green) and no manual review is required; when T_low ≤ D(n) < T_high, the risk level is warning (can be marked as yellow) and manual review is recommended; when D(n) ≥ T_high, the risk level is dangerous (can be marked as red), and it is forced to enter the manual review process and the compressed content of this node is suspended from use. In the application scenario of the large language model for power systems, the preset threshold can refer to the power safety threshold, and the power safety threshold is dynamically determined according to the type of power business task. For fault diagnosis tasks, a lower safety threshold (smaller T_low and T_high) is adopted because any parameter loss during the diagnosis process may lead to misjudgment, and for daily inspection tasks, a relatively higher safety threshold can be adopted.
[0087] Step S108: If a target interaction node exists, then the target interaction node is highlighted in the second tree diagram.
[0088] Optionally, when a target interactive node is found to have a semantic drift level that reaches a preset level (such as "dangerous"), the server highlights or colors the node in the second tree diagram to prompt the user to pay attention.
[0089] In practical applications, when a target interaction node with a dangerous level is detected, the node is marked in red in the visualization interface and an alarm prompt is displayed; the use of the latest compressed version of the interaction content of the interaction node is suspended, and the interaction content of the previous level of the node is temporarily rolled back during context assembly; the interaction node is added to the mandatory review queue, waiting for user review and confirmation or correction.
[0090] Step S110: In response to the user's processing operation on the target interaction node, update the source interaction data tree and the context view tree to update the first tree diagram and the second tree diagram, and return to execute the step of determining the semantic drift score of each interaction node based on the source interaction data tree and the context view tree, until there is no target interaction node; wherein, the updated context view tree is used to assemble context content and input it into the large language model.
[0091] Among them, processing operations refer to interactive behaviors such as reviewing, confirming, or correcting the target interaction node performed by the user.
[0092] Optionally, after a user performs a processing operation (such as review, confirmation, or correction) on a target node, the server updates the corresponding version information in the source interaction data tree and context view tree, and refreshes the first and second tree diagrams. This process is repeated until the drift level of all interaction nodes drops to a safe range, and finally the updated context view tree is assembled into context content and input into the large language model.
[0093] The aforementioned contextual semantic consistency control method supporting user correction involves obtaining the source interaction data tree and context view tree corresponding to the current dialogue event stream. The source interaction data tree arranges each interaction node in the current dialogue event stream in chronological order, with each interaction node having a side link to its previous compressed versions of interaction content. The context view tree organizes the latest compressed versions of interaction content for each interaction node according to topic type. A visualization interface displays a first tree diagram generated from the source interaction data tree and a second tree diagram generated from the context view tree. Based on the source interaction data tree and the context view tree, the semantic drift score of each interaction node is determined, and based on the semantic drift score of each interaction node, it is determined whether there is a target interaction node with a preset semantic drift level. If a target interaction node exists, it is highlighted in the second tree diagram. In response to user actions on the target interaction node, the source interaction data tree and the context view tree are updated. The process involves updating the first and second tree diagrams, and then returning to the previous steps to determine the semantic drift score of each interaction node based on the source interaction data tree and the context view tree, until no target interaction node exists. The updated context view tree is used to assemble the context content and input it into the large language model. By constructing a dual-tree separation architecture of the source interaction data tree and the context view tree, and establishing a semantic drift level-driven active detection and highlighting mechanism in the visualization interface, the problem of semantic distortion in the context content relied upon for reasoning in large language models after compression is systematically solved. By transforming the information loss caused by compression from an invisible black-box process into a visualized, interactive, and correctable closed-loop process, users can intuitively locate distorted nodes and intervene to correct them through processing operations, ensuring that the context content input into the final model is manually verified, thus improving the accuracy, reliability, and credibility of the model's reasoning basis.
[0094] In an exemplary embodiment, the source interaction data tree maintains a compressed version chain for each interaction node; based on the source interaction data tree and the context view tree, the semantic drift score of each interaction node is determined, including: based on the compressed version chain of each interaction node, determining the interaction content source-background benchmark for each interaction node in the previous compressed version interaction content of each interaction node; based on the interaction content source-background benchmark of each interaction node and the latest compressed version interaction content of each interaction node, determining the semantic drift value of each interaction node under each semantic drift evaluation dimension; and performing a weighted summation of the semantic drift values of each interaction node under each semantic drift evaluation dimension to obtain the semantic drift score of each interaction node.
[0095] The compressed version chain is a list of versions maintained by the source interaction data tree for each interaction node, organized in order of compression hierarchy. The compressed version chain refers to a chain-like structure formed by organizing different compressed versions of interaction content for the same interaction node in order of compression version. It includes at least the original version (L0), and may also include the original version (L0), multiple compressed versions (L1, L2, ..., Ln), the user-verified version (L_verified), and the user-corrected version (L_corrected).
[0096] Among them, the interactive content back-to-origin benchmark (C_ref) refers to the reference version used for drift detection and back-to-origin compression in the compressed version chain.
[0097] Among them, semantic drift assessment is a quantitative perspective for measuring information loss, which may include semantic similarity, key information coverage, structured field consistency, and temporal consistency.
[0098] Optionally, the server traverses each interaction node in the context view tree. For each interaction node, it first determines the origin-back baseline of the interaction content within its compressed version chain. Then, it compares the origin-back baseline with the latest compressed version of the interaction content, calculating the values for each semantic drift evaluation dimension. Finally, it multiplies the values for each semantic drift evaluation dimension by a preset weight and sums them to obtain the semantic drift score for that node.
[0099] In this embodiment, by constructing a compressed version chain and defining the source reference for interactive content, a complete record and precise anchoring of the information evolution process of each interactive node is achieved. Based on this, quantitative scoring is performed from multiple semantic drift evaluation dimensions, which can comprehensively and objectively assess the degree of content distortion. This multi-dimensional and quantitative detection method solves the problem that traditional solutions cannot accurately judge content distortion based solely on human experience or a single indicator. It provides a scientific and accurate basis for subsequent highlighting and user intervention, and is the core detection link to ensure the quality of contextual content.
[0100] In one exemplary embodiment, based on the compressed version chain of each interaction node, the source-following benchmark for the interaction content of each interaction node is determined from the compressed version interaction content of each interaction node in each previous interaction node. This includes: if the compressed version chain of the interaction node records the interaction content of the source-following priority version, then the interaction content corresponding to the source-following priority version is used as the source-following benchmark for the interaction content of the interaction node; the source-following priority version is a version that has been corrected or confirmed; if the compressed version chain of the interaction node does not record the interaction content of the source-following priority version, then the original version interaction content recorded in the compressed version chain is used as the source-following benchmark for the interaction content of the interaction node.
[0101] Among them, the backsource priority version refers to the version marked with "backsource_priority=true" in the version chain, including the user-confirmed version and the user-corrected version. It represents high-quality content that has been manually verified and has the highest priority when comparing backsource versions.
[0102] Optionally, in response to the user's review trigger operation, the server reads the compressed version chain of the target interaction node from the source interaction data tree, traverses the version chain, and checks whether there is a priority version for returning to the source (i.e., the version confirmed or corrected by the user). If it exists, the latest version is taken as the reference for returning to the source of the interaction content. If it does not exist, the original version L0 is taken as the reference for returning to the source. This reference for returning to the source will be used for subsequent comparison display and drift evaluation.
[0103] In practical applications, the compressed version chain may record user-verified versions (L_verified) and user-corrected versions (L_corrected). Both user-verified and user-corrected versions are marked with a backsource priority flag (backsource_priority=true) in the compressed version chain. This flag affects subsequent compression behavior as follows: when the system needs to perform further compression on a corrected node (e.g., due to increased pressure coefficient requiring further compression), the backsource compression path selection logic is adjusted to prioritize using the latest user-verified or user-corrected version for backsource compression, rather than directly using the original version (L0). Specifically, if a version with backsource_priority=true exists for the node, that version is used as the backsource baseline, and compression is performed on it to generate a new compressed version L_(n+1). If no version with backsource_priority=true exists for the node, backsource compression is performed from L0 according to the original backsource strategy. This correction-priority backsource strategy ensures that the semantic anchoring effect of user correction or user confirmation is maintained throughout subsequent compression cycles.
[0104] The extended data structures of the compressed version chain include: version_id (unique version identifier), compress_level (compressed version L0 / L1 / … / Ln / L_verified / L_corrected), source_type (version source type origin / auto_compress / user_verified / user_corrected, origin indicates from the original version, auto_compress indicates from the automatically compressed version, user_verified indicates from the user-confirmed version, and user_corrected indicates from the user-corrected version), backsource_priority (back-to-source priority marker), corrected_from_version_id (identifier of the corrected version), correction_reason (correction reason marker, which can be selected as missing device parameters, omission of procedural constraints, etc.), created_by (creator identifier, which can be automatically generated by the system or a user ID), created_at (creation timestamp), token_len (number of tokens), and drift_score (semantic drift score of the compressed version interaction content relative to the interaction content back-to-source benchmark C_ref, used for backtracking analysis).
[0105] In this embodiment, by prioritizing the source version as the comparison benchmark, the review comparison is always based on high-quality content recognized by the user. This solves the problem that when the original version is used as the sole benchmark, it may lead to misjudgment or unnecessary review because the user has subsequently confirmed or corrected some content, but it is still compared with the original version. This ensures that the review process is always based on the latest semantic anchor points that have been manually verified, which greatly improves the relevance and efficiency of the review. It is a key design to ensure the continuous optimization of the quality of contextual content.
[0106] The next embodiment takes the application of the large language model of the power system as an example to introduce the specific implementation of the semantic drift numerical calculation method in the power system application scenario. In the power system application scenario, the semantic drift risk brought about by compression processing is particularly prominent. Power business data has the following special characteristics: (1) Data carries physical law constraints. For example, there are strict physical relationships between parameters such as voltage, current, and frequency. The loss of any parameter due to compression may lead to subsequent analysis producing conclusions that are inconsistent with physical laws; (2) Operation procedures have strong temporality and strong constraints. The execution order of dispatch instructions and the preconditions for equipment operation cannot be arbitrarily omitted or rewritten; (3) The safety boundary requirements are extremely high. Once key constraints such as equipment rated parameters, protection settings, and safe operation thresholds are omitted or tampered with during compression, it may lead to unsafe operation suggestions output by the model. For example, in the scenario of power equipment fault diagnosis, the multi-round dialogue between maintenance personnel and the large language model may involve: online monitoring data of equipment (such as dissolved gas analysis data in transformer oil and partial discharge monitoring data), historical fault records (including fault time, fault type, and handling measures), and maintenance procedure requirements (including operation steps, safety measures, and acceptance standards). As the number of dialogue rounds increases, key parameters and constraints discussed in the early stages may be lost or distorted after multiple compressions, causing the model to provide recommendations in subsequent rounds that are inconsistent with early diagnostic conclusions or procedural requirements. The technical solution of the next embodiment can retain key constraints and physical parameters of power operations, accurately calculate semantic drift scores, and determine semantic drift levels, ensuring that the context upon which the large language model's reasoning is based always faithfully reflects the actual state of power equipment and procedural requirements.
[0107] In an exemplary embodiment, based on the source-back benchmark of the interaction content of each interaction node and the latest compressed version of the interaction content of each interaction node, the semantic drift value of each interaction node under each semantic drift evaluation dimension is determined, including: performing key constraint extraction on the source-back benchmark of the interaction content of each interaction node and the latest compressed version of the interaction content to obtain the benchmark set of key constraints for power business and the latest set of key constraints for power business of each interaction node; determining the interaction content similarity based on the source-back benchmark of the interaction content of each interaction node and the latest compressed version of the interaction content; and determining the coverage rate of key constraints for power business, the structured field consistency deviation, and the temporal consistency deviation based on the benchmark set of key constraints for power business and the latest set of key constraints for power business of each interaction node; and determining the interaction content similarity, key constraint coverage rate, structured field consistency deviation, and temporal consistency deviation corresponding to each interaction node as the semantic drift value of each interaction node under each semantic drift evaluation dimension.
[0108] Among them, the set of key constraints for benchmark power business is a set of core information reflecting the operational safety of the power system, extracted from the source benchmark of the interactive content.
[0109] Among them, the latest set of key constraints for power operations is a set of core information reflecting the operational safety of the power system, extracted from the latest compressed version of the interactive content.
[0110] In this application, the Power Business Critical Constraints (PBCC) set includes equipment rated parameters (such as rated voltage, rated current, rated capacity, insulation class, etc.), safe operation thresholds (such as protection settings, alarm thresholds, operating temperature range, etc.), operating procedure numbers and key steps (such as maintenance procedure numbers, operation ticket numbers, safety measure requirements), timing constraints (such as the order of operations, maintenance window time, scheduled maintenance cycle), and equipment identification information (such as equipment number, installation location, and bay to which it belongs).
[0111] The similarity of interactive content can be represented as Sim(C_ref, C_compress), which corresponds to the semantic similarity between the source reference C_ref of the interactive content and the latest compressed version of the interactive content C_compress. It can be evaluated by embedding cosine similarity or a large language model.
[0112] The coverage rate of key constraints in the power business can be represented as Coverage(K), which measures whether key constraint items in the source reference C_ref of the interaction content are still retained in the compressed version of the interaction content. To avoid overlapping measurement between Coverage(K) and the following StructDiff(F_ref,F_compress) and SeqDiff(S_ref,S_compress), Coverage(K) only determines whether the constraint item exists, and does not directly determine whether the structured value has been tampered with (as reflected by StructDiff), nor does it determine whether the order of the ordered constraint items is correct (as reflected by SeqDiff).
[0113] In this application, the formula for calculating the coverage rate of key constraints in the power business is as follows:
[0114] Coverage(K)=|K_retained| / |K_total|;
[0115] Where K_total is the set of key constraints extracted from C_ref, and K_retained is the set of C_ref constraints whose corresponding retained items can still be found in the compressed content extraction set. C_ref constraint k = (constraint_type, field_name, field_value, unit, position, extract_method), where constraint_type is the constraint type; field_name is the field name; field_value is the field value (null or text); unit is the unit (null if no unit is specified); and position is the source location identifier, used for backtracking evidence and interface highlighting / jumping. In one implementation, position uses a joint representation to cover both "text extraction" and "procedure library derivation" sources. For constraints extracted from source text, position... `n = (source_node_id, start_offset, end_offset)`, where `source_node_id` is the source node ID, and `start_offset` and `end_offset` are the start and end character positions in the text of that node. For mandatory clauses derived through comparison with the specification database, `position = (standard_id, clause_id)`, where `standard_id` is the specification number, and `clause_id` is the clause number (or clause positioning key); `extract_method` is the extraction method marker (e.g., REGEX regular expression template matching / NER named entity recognition / RULE_DB specification database comparison). The retained matching key `retain_key(k)` is defined as follows: when `k` belongs to a structured constraint, `retain_key(k) = (constraint_type, field_name)`; when `k` belongs to an unstructured text constraint, `retain_key(k) = (constraint_type, field_name, normalize(field_value))`; when `k` belongs to an ordered constraint, `retain_key(k) = (constraint_type, field_name)`. `position` and `extract_method` are not involved in Coverage determination. Structured constraints include equipment parameters, DGA gas data, protection settings, action time limits, and time constraints; unstructured text constraints include procedure numbers, operation actions, fault types, and mandatory clauses; ordered constraints include operation sequence and timing constraints. The existence of ordered constraints is determined by Coverage through `retain_key` matching, and the correctness of the order is determined separately by `SeqDiff`.
[0116] The structured field consistency deviation can be represented as StructDiff(F_ref, F_compress), used to detect whether the values and / or units of structured fields have been tampered with or distorted during the compression process. To avoid duplicate measurement with Coverage and SeqDiff, StructDiff only calculates structured constraint items (excluding ordered constraint items) for which the corresponding fields can be found in both the source-background C_ref of the interactive content and the latest compressed version of the interactive content C_compress. Missing fields are not included in StructDiff again.
[0117] In this application, key constraints need to be extracted from the source reference C_ref and the latest compressed version of the interactive content C_compress, respectively, and structured constraint items need to be filtered to form structured field sets F_ref={f_i=(constraint_type_i,field_name_i,field_value_i,unit_i)} and F_compress={f'_j=(constraint_type'_j,field_name'_j,field_value'_j,unit'_j)}. For each field f_i in F_ref, a field f'_j with the same structured matching key struct_key(f)=(constraint_type,field_name) is searched in F_compress. If a corresponding field is found but the normalized field_value is inconsistent with / or unit, it is recorded as a tampered field; if they are consistent, it is recorded as a consistent field; if no corresponding field is found, it is considered as a missing field (reflected by Coverage) and is not included in StructDiff. Let F_matched be the set of F_ref structured fields that can be found in the latest compressed version of the interactive content, and N_tampered be the number of fields that have been tampered with. Then StructDiff = N_tampered / |F_matched|. When |F_matched| = 0, StructDiff = 0.
[0118] For example, the source reference C_ref of the interactive content contains three structured fields: "rated voltage 220kV", "rated capacity 240MVA" and "oil temperature 78℃". In the latest compressed version of the interactive content C_compress, "rated voltage 220kV" is retained and correct, the "rated capacity" field is missing, and "oil temperature" has been mistakenly compressed from 78℃ to 7.8℃. In this case, F_matched contains two fields, one of which has been tampered with, and StructDiff=1 / 2=0.5.
[0119] Among them, the timing consistency deviation can be expressed as SeqDiff(S_ref, S_compress), which is a quantitative metric for detecting whether the order of ordered constraint items such as operation steps is disrupted after compression. The timing consistency deviation is used to detect whether the execution order of ordered constraint items (such as operation step sequences) is reversed or disrupted during the compression process. To avoid double counting with Coverage and StructDiff, SeqDiff only compares the order of ordered constraint items that can be matched in both the interactive content source benchmark C_ref and the latest compressed version of the interactive content C_compress, and does not detect the existence of constraint items (reflected by Coverage) or numerical accuracy (reflected by StructDiff).
[0120] In this application, ordered constraint item sequences need to be extracted from the interactive content source benchmark C_ref and the latest compressed version of the interactive content C_compress respectively. Ordered constraint items refer to constraint items with a clear sequential execution order in business semantics, including operation step sequences, event orders in timing constraint conditions, etc. For the ordered constraint item sequence S_ref = (s1, s2,..., s p ) of the interactive content source benchmark C_ref and the ordered constraint item sequence S_compress of the latest compressed version of the interactive content C_compress, the system matches them according to the constraint item content (field_value) to establish the corresponding relationship between the elements of the C_ref sequence and the C_compress sequence (i.e., the compressed sequence). After the matching is completed, calculate the number of inversion pairs of the C_compress sequence relative to the C_ref sequence. The inversion pair is defined as: for any two elements s i and s j (i < j) in the C_ref sequence, if their position relationship in the compressed sequence is reversed (i.e., s i appears after s j ), then (s i , s j ) forms an inversion pair. Let N_inv be the number of inversion pairs and N_pairs be the total number of ordered pairs of matchable elements (i.e., C(q, 2), where q is the number of ordered constraint items that can be matched in both C_ref and the compressed content), then SeqDiff = N_inv / N_pairs; when N_pairs = 0 (i.e., there are no ordered constraint items or no matching items), SeqDiff = 0.
[0121] For example, C_ref contains the sequence of operation steps [Step 1: Disconnect QF1, Step 2: Disconnect QS1, Step 3: Disconnect QS2], which becomes [Step 1: Disconnect QF1, Step 2: Disconnect QS2, Step 3: Disconnect QS1] after compression. Matching by content: QF1 is in position 1 in both sequences, QS1 is in position 2 in the C_ref sequence and position 3 in the compressed sequence, and QS2 is in position 3 in the C_ref sequence and position 2 in the compressed sequence. There is one inversion pair (QS1, QS2), and the total number of ordered pairs is C(3,2) = 3. SeqDiff = 1 / 3 ≈ 0.333.
[0122] Optionally, see Figure 2 For each interaction node, the server retrieves the interaction content from the source baseline and the latest compressed version, and performs a three-stage key constraint extraction (regular expression template matching, named entity recognition, and procedure database comparison) to generate a baseline power business key constraint set and a latest power business key constraint set. Subsequently, four dimensions are calculated: 1) interaction content similarity, obtained through cosine similarity of embedded vectors; 2) key constraint coverage, i.e., the proportion of constraint items retained in the latest set to those in the baseline set; 3) structured field consistency deviation, i.e., the proportion of tampered structured fields to those matched fields; and 4) temporal consistency deviation, i.e., the proportion of reversed logarithms to the total ordered logarithms. These four values collectively constitute the semantic drift values of the interaction node under multiple semantic drift evaluation dimensions.
[0123] In this application, for each interaction node n, the semantic drift score is calculated by determining the interaction content source reference C_ref and the latest compressed version interaction content C_compress of that interaction node, and performing key constraint extraction and comparison. The corresponding semantic drift score calculation model is D(n):
[0124] D(n)=α·(1-Sim(C_ref,C_compress))+β·(1-Coverage(K))+γ·StructDiff(F_ref,F_compress)+δ·SeqDiff(S_ref,S_compress);
[0125] Wherein, α, β, γ, and δ are preset weight coefficients, satisfying α+β+γ+δ=1. In power system applications, β>δ>γ>α can be set to reflect the primary importance of key constraint coverage in power scenarios and the crucial role of temporal consistency in power operation safety. β mainly reflects whether key constraint items are still retained, δ mainly reflects whether the execution order of ordered operation steps is maintained, α reflects the overall semantic fidelity, and γ mainly reflects whether the values and units of the retained structured fields are consistent. In one implementation, α=0.10, β=0.40, γ=0.20, and δ=0.30 can be set. In practical applications, when C_ref does not contain the constraint type detected by a certain component, that component is not applicable to the current node, and its weight is not included in the normalized denominator. Specifically, let W be the sum of the weights of all applicable components, and the drift score is normalized as D(n)=D(n)_raw / W, where D(n)_raw is the weighted sum of the above formula. The applicability criteria for each component are as follows: Sim is always applicable; Coverage is applicable when K_total > 0; StructDiff is applicable when |F_matched| > 0; and SeqDiff is applicable when N_pairs > 0. When all components are applicable, W = α + β + γ + δ = 1, and normalization does not change the score. This mechanism avoids the dilution of semantic drift scores due to the zero-value contribution of inapplicable components, ensuring that the semantic drift score accurately reflects the actual degree of drift in the applicable dimension.
[0126] Regarding the three-stage key constraint extraction (regular expression template matching, named entity recognition, and procedure database comparison), to uniformly represent different types of constraint items, each extraction result is structured into a constraint item record: k=(constraint_type,field_name,field_value,unit,position,extract_method). In the first stage, regular expression template matching, a set of pre-defined regular expression templates for power business is used to extract structured parameters and constraint information from the source text. The system maintains a dictionary of power parameter names and a dictionary of units, and configures different templates for different types of information. Example templates include, but are not limited to:
[0127] 1) Equipment parameter templates match the format "parameter name + optional separator + value + unit" (e.g., "rated voltage: 220kV", "rated capacity 240MVA", "oil temperature 78℃"). The parameter name is derived from a power parameter name dictionary (e.g., rated voltage, rated current, rated capacity, active power, reactive power, oil temperature, etc.); the unit is taken from a power unit dictionary (e.g., kV, A, kA, MVA, MW, Mvar, ℃, etc.); the regular expression for the equipment parameter template can be represented as: (?P <name>(Parameter name set)\s*[::=-–]?\s*(?P <value>\d+(?:\.\d+)?)\s*(?P <unit>(Unit set).
[0128] 2) DGA gas data templates match the format "gas name + optional separator + value + ppm" (e.g., "CO2=2500ppm", "H2=120ppm", "CH480ppm", "C2H4:120ppm"). The gas name is limited to H2, CH4, C2H2, C2H4, C2H6, CO, and CO2, but can be expanded to include O2, N2, and Total Combustible Gas (TDCG). Optional separators can be equal signs, colons, or spaces. The regular expression for a DGA gas data template can be represented as: (?P <gas>H2|CH4|C2H2|C2H4|C2H6|CO|CO2|O2|N2|TDCG)\s*[=::=-–]?\s*(?P <value>\d+(?:\.\d+)?)\s*ppm.
[0129] 3) The protection setting template matches the format of "setting name + value + unit" and / or "action time limit + value + time unit" (e.g., "overcurrent stage I setting 1200A", "overcurrent stage II setting 800A", "zero sequence overcurrent setting 50A", "action time limit 0.5s", etc.).
[0130] 4) Time constraint templates match date-time expressions and relative time expressions (e.g., "March 15, 2024", "within 72 hours", "every 6 months", etc.). Each matching result generates a constraint record added to the PBCC set, for example, (Equipment Parameter, Rated Voltage, 220 kV, (node_1, 10, 18), REGEX), (Time Constraint, Date, 2024-03-15, null, (node_2, 0, 9), REGEX).
[0131] In the second stage of named entity recognition, non-standard expressions not covered by the regular expression templates in the first stage are supplemented and extracted using a pre-trained power industry named entity recognition model. The identified entity types include, but are not limited to: equipment number / equipment object (e.g., "#1 main transformer", "110kV A line"), procedure number (e.g., "DL / T 596"), operation action (e.g., "disconnecting disconnector", "closing circuit breaker"), and fault type (e.g., "local overheating", "partial discharge"). For entities in the recognition results that are directly related to power safety, the system generates constraint item records according to entity type and adds them to the PBCC set, for example, (procedure, procedure number, DL / T 596, null, (node_1,35,43), NER), (operation, operation action, disconnecting disconnector, null, (node_2,12,16), NER), (equipment object, equipment number, #1 main transformer, null, (node_3,0,4), NER).
[0132] In the third stage of the procedure database comparison, for the procedure number extracted in the second stage, the pre-set power operation procedure database is queried to obtain the mandatory constraint clauses in the procedure (such as "voltage must be checked before grounding", "protection devices should be confirmed to be in operation before operation", etc.), and each clause is derived as a constraint item record and added to the PBCC set. In one implementation, a record is generated for each mandatory clause: (mandatory clause, clause, "<clause number>:<clause content>", null, (standard number, clause number), RULE_DB), for example (mandatory clause, clause, "4.3.2: voltage must be checked before grounding", null, (DL / T 596, 4.3.2), RULE_DB).
[0133] After merging and deduplicating the extraction results from the above three stages, the final set of key constraints for power operations, PBCC={k1,k2,…,k_m}, is formed. During deduplication, normalization keys (constraint_type, field_name, normalize(field_value), unit) can be used as the basis for judgment. When the same constraint item is extracted repeatedly using different methods, the master record and its position and extract_method information can be retained to support traceability.
[0134] In this embodiment, by customizing a key constraint extraction method for power business scenarios and refining semantic drift assessment into four dimensions—similarity, coverage, structural consistency, and temporal consistency—the accurate quantification of context distortion in the large language model of the power system is achieved. This solves the problem that general semantic similarity indicators are difficult to detect professional distortions such as power parameter tampering, loss of operating procedures, and disordered order of operating steps. It ensures that in the highly reliable field of power, any information loss affecting operational safety can be accurately captured and quantified, providing a highly reliable decision-making basis for subsequent manual review and correction.
[0135] In an exemplary embodiment, the processing operation includes a review trigger operation and a correction operation; in response to the user's processing operation on the target interaction node, the source interaction data tree and the context view tree are updated, including: in response to the user's review trigger operation on the target interaction node, obtaining the source baseline and the latest compressed version of the interaction content of the target interaction node, and generating comparison information to be displayed on the visualization interface; the comparison information is used to provide guidance when the user edits the interaction content of the target interaction node; in response to the user's correction operation on the latest compressed version of the interaction content of the target interaction node, obtaining the content before correction and the content after correction, and determining the correction type based on the content before correction and the content after correction; updating the source interaction data tree and the context view tree according to the update strategy corresponding to the correction type.
[0136] Among them, the review trigger operation refers to the interactive behavior in which the user clicks or selects the target interactive node in the visual interface to start the comparison and viewing.
[0137] Among them, the correction operation refers to the user's behavior of editing and modifying the latest version of the content of the target interactive node.
[0138] Among them, the correction type is determined based on the direction of change in the number of words before and after correction, including expansion correction (the number of words increases), simplification correction (the number of words decreases), and equal-length correction (the number of words remains unchanged).
[0139] Optionally, when a user clicks on a highlighted target interactive node in the context view tree, the server responds with a review trigger operation, retrieves the source reference of the interactive content for that node from the source interactive data tree, and retrieves the latest compressed version of the interactive content for that node from the context view tree. These are then displayed side-by-side in the visualization interface, with the source reference C_ref on the left and the latest compressed version C_compress on the right. The left panel provides a version switching function, allowing users to switch between viewing the source reference C_ref and the original version L0. The table also lists the key constraints in the source reference C_ref and their retention status (retained / lost / modified) in the latest compressed version C_compress, as well as the creation time, compression level, and semantic drift score of the latest compressed version C_compress. When the user edits and submits the latest compressed version of the interactive content, the server responds with a correction operation, calculates the difference in the number of terms before and after correction, and determines the correction type. Subsequently, the server updates the latest compressed version of the interactive content in the source interactive data tree and the context view tree according to different update strategies, such as expanded, simplified, or fixed-length.
[0140] If applied to the field of power system technology, the review interface can also provide the following enhanced functions to address the special characteristics of power business data: parameter consistency verification to automatically detect whether the numerical parameters (such as voltage, current, temperature, etc.) are consistent before and after compression; procedure reference integrity verification to detect whether the operation procedure number and key steps referenced in C_ref are retained after compression; and timing consistency verification to detect whether the time sequence of events is consistent with C_ref after compression.
[0141] In this embodiment, the comparison information provided during the review phase enables users to quickly understand where the distortion is, while the type determination during the correction phase ensures that subsequent data updates can accurately match the user's intent (expansion or simplification). This phased and strategic interactive design significantly improves the efficiency and accuracy of users in processing distorted content and is a key human-computer collaboration link to ensure the quality of contextual content.
[0142] In practical applications, refer to Figure 3 In the review interface, users can confirm or edit the latest compressed version of the interactive content of the target interactive node. Confirmation refers to the user confirming that the latest compressed version of the interactive content of the target interactive node is consistent with or acceptable to the source code baseline. At this time, the server marks the version as confirmed, records the confirming user's identifier and confirmation time, records the confirmation event in the version chain of that node, and sets the node's `backsource_priority` to `true`, prioritizing this node for compression during source code compression. Correction refers to the user editing the target content representation to create a corrected content representation. At this time, the server performs token count constraint verification and strategy selection, version chain writing, and correction metadata recording. The lexical quantity constraint verification and strategy selection refers to calculating the number of lexicals in the correction content. When the correction content does not exceed the current allocated lexical quantity limit of the node, the version chain writing step is allowed. When the correction content exceeds the limit, an over-limit prompt is output, and two correction strategies are provided for the user to choose from: the first correction strategy is to refuse to write the correction content into the version chain and prompt the user to adjust the correction content to not exceed the lexical quantity limit before resubmitting; the second correction strategy is to allow the correction version to be written into the version chain and trigger lexical budget rebalancing after writing to release lexical space on other nodes to meet the context lexical budget constraint. After the correction content is written into the version chain, the system will recalculate the pressure coefficient and redistribute the lexical quantity limit of each node, and calculate the actual lexical quota to be released accordingly. Version chain writing refers to generating a new version identifier for the correction content, setting source_type to user_corrected, setting backsource_priority to true, writing the correction content into the version chain of the corresponding node, and switching the currently available version of the node in the context organization structure to the correction version. The calibration metadata record refers to the record of information such as the calibrated version identifier, source mapping set, creation time, creation user identifier, and calibration reason label (optional) to ensure traceability.
[0143] In this application, after a user corrects the content written to the version chain, the server treats the correction event as a compression scheduling reentry request and executes the following processing flow: First, the change in token quantity is calculated and its direction is determined. Specifically, the change in the number of tokens before and after correction, ΔT = token_len(L_corrected) - token_len(L_previous), is calculated, and the direction of change is determined: ΔT > 0 indicates expansion correction (the user supplements information lost during compression), ΔT < 0 indicates simplification correction (the user believes the compressed content can still be simplified), and ΔT = 0 indicates equal-length correction (the user only modified the content but did not change the length). The determination of the direction of change affects the selection of subsequent cascading control strategies. Second, the context pressure is reassessed based on the change in token quantity. ΔT is injected into the total token usage of the context, triggering a recalculation of the pressure coefficient, which in turn causes a redistribution of the upper limit of the number of tokens at each level of nodes. The pressure coefficient calculation method and the hierarchical soft upper limit allocation method can adopt the corresponding mechanisms in existing context compression management schemes; this application does not limit them. Based on the correction direction, the subsequent processing path is as follows: For expanded correction (ΔT > 0), if the number of lexical units in the corrected node does not exceed the upper limit of the number of lexical units after recalculation, the semantic drift score is directly updated; otherwise, the technical solution of the next embodiment is used to perform cascade compression, and the semantic drift score is updated after completion; For simplified correction (ΔT < 0), the technical solution of the next embodiment is used to perform reverse release, and the semantic drift score is updated after completion; For equal-length correction (ΔT = 0), the total number of lexical units remains unchanged, the pressure coefficient remains unchanged, and the semantic drift score is directly updated to ensure that the semantic changes of the corrected content are correctly reflected in the drift evaluation of the associated nodes.
[0144] In an exemplary embodiment, the source interaction data tree and context view tree are updated according to the update strategy corresponding to the correction type, including: if the correction type is expansion correction, it is determined whether the number of tokens in the corrected content exceeds the upper limit of the number of tokens in the target interaction node; if it exceeds, the number of tokens to be released is determined based on the corrected content and the upper limit of the number of tokens, and unconfirmed and uncorrected interaction nodes are selected from the topic groups other than the topic group to which the target interaction node belongs, in order of importance score from low to high, and added to the node set to be compressed; if the total number of releasable tokens in the node set to be compressed is less than the number of tokens to be released, in the topic group to which the target interaction node belongs, the nodes to be compressed are selected from the topic groups to which the target interaction node belongs, in order of importance score from low to high, and added to the node set to be compressed; if the total number of releasable tokens in the node set to be compressed is less than the number of tokens to be released, the nodes to be compressed are selected from the topic groups to which the target interaction node belongs, in order of importance score from low to high, and added to the node set to be compressed; if the total number of releasable tokens in the node set to be compressed is less than the number of releasable tokens, the nodes to be compressed are selected from the topic groups to which the target interaction node belongs, in order of importance score from low to high, and added to the node set to be compressed; Based on importance scores, unconfirmed and uncorrected interaction nodes are selected from low to high to supplement the node set to be compressed, resulting in the first supplemented node set. If the total number of releaseable tokens in the first supplemented node set is less than the number of tokens to be released, then from topic groups other than the target interaction node's topic group, confirmed but uncorrected interaction nodes are selected from importance scores from low to high to supplement the first supplemented node set, resulting in the second supplemented node set. If the total number of releaseable tokens in the second supplemented node set is less than the number of tokens to be released, then from the topic group of the target interaction node, confirmed but uncorrected interaction nodes are selected from topic groups other than the target interaction node's topic group, based on importance scores from low to high, to supplement the first supplemented node set. The nodes to be compressed are selected from the confirmed but uncorrected interactive nodes in the second supplementary set, from lowest to highest importance, resulting in the third supplementary set. If the total number of releaseable tokens in the third supplementary set is less than the number of tokens to be released, then in other topic groups outside the target interactive node's topic group, the nodes to be compressed are selected from the corrected interactive nodes in the third supplementary set, from lowest to highest importance, resulting in the fourth supplementary set. If the total number of releaseable tokens in the fourth supplementary set is less than the number of tokens to be released, then in other topic groups outside the target interactive node's topic group, the nodes to be compressed are selected from the corrected interactive nodes in the fourth supplementary set, from lowest to highest importance, resulting in the fourth supplementary set. From low to high, select nodes to be compressed from other already corrected interactive nodes to obtain the fifth set of nodes to be compressed. If the total number of releaseable tokens in the fifth set of nodes to be compressed is greater than or equal to the number of tokens to be released, then perform a back-to-source compression operation on the fifth set of nodes to be compressed to release the tokens to be released, so as to update the source interactive data tree and context view tree. If the total number of releaseable tokens in the fifth set of nodes to be compressed is less than the number of tokens to be released, then generate a token budget shortage message and display it on the visualization interface. The token budget shortage message is used to guide the user to re-perform the correction operation.
[0145] In this context view tree, a topic group is a collection of nodes organized by topic type, and interactive nodes within the same group belong to the same business topic. The specific method for classifying nodes by topic type can adopt the grouping mechanism found in existing context compression management methods.
[0146] The importance score quantifies the priority of a node in the current dialogue context; the lower the score, the higher the priority for compression. The specific method for determining the importance score of different nodes can employ the importance score determination model from existing context compression management methods.
[0147] In the large language model of power systems, importance scores are used to characterize the retention priority of nodes in the current power business dialogue event flow context. In practical applications, the importance score S_imp can be calculated based on features such as the topic type of the node, security risk level, relevance to the current request, recent access time, number of citations, and whether it has been confirmed / corrected. The lower the score, the higher the priority as a node to be compressed; the higher the score, the higher the priority for retention or for reverse release.
[0148] The number of releasable tokens refers to the difference between the current number of tokens in a node and the upper limit of the number of tokens after recalculation.
[0149] The set of nodes to be compressed is a candidate set of nodes used to perform the compression operation.
[0150] When a user performs a confirmation operation in this application, the server records the confirmation information corresponding to the user's confirmation operation. The confirmation information includes the confirming user identifier, confirmation timestamp, etc., and is written to the version chain and / or audit log to support traceability and auditing.
[0151] Optionally, when a user performs expanded correction (resulting in longer content) and the corrected content exceeds the node's maximum number of terms, the server calculates the number of terms to be released. Then, a multi-level, priority-based node selection process is initiated: First priority: Selecting unconfirmed and uncorrected low-importance nodes from other topic groups; Second priority: Selecting unconfirmed and uncorrected low-importance nodes from its own topic group; Third priority: Selecting confirmed but uncorrected low-importance nodes from other topic groups; Fourth priority: Selecting confirmed but uncorrected low-importance nodes from its own topic group; Fifth priority: Selecting corrected low-importance nodes from other topic groups; Sixth priority: Selecting corrected low-importance nodes from its own topic group. For each selected node, its releaseable term count is incremented until the accumulated value reaches or exceeds the number of terms to be released. Finally, a back-to-source compression operation is performed on the selected set of nodes to be compressed, releasing term space. However, if the total number of releasable tokens in the compressed node set after the fifth supplement is less than the number of tokens to be released, an insufficient token budget message will be generated and displayed on the visualization interface to prompt the user to re-perform the correction operation.
[0152] For the convenience of those skilled in the art, Figure 4 A schematic diagram of the cascaded compression process for expandable correction is provided. For expandable correction, after the pressure coefficient is recalculated, the server reassesses the compression requirements of each node. Cascaded compression triggered by the correction event must adhere to the following protection rules:
[0153] (1) Verified Node Freeze Protection: Nodes marked as verified will not be selected as compression targets in the current cascade evaluation unless the pressure coefficient exceeds the preset protection release threshold P_unfreeze. The principle for setting the value of P_unfreeze is: set it at a high level close to the upper limit of the pressure coefficient to ensure that protection is only released when the context is severely overloaded. In practical applications, the value range of P_unfreeze is 0.80-0.95, with a preferred value of 0.85, meaning that the frozen protection of verified nodes is only released when the total usage of context tokens exceeds 85% of the token budget and continues to rise. This mechanism prevents content that has just been verified by the user from being immediately overwritten by cascade compression.
[0154] (2) Compression Exemption Window for Corrected Nodes: For a newly written corrected version, the system sets a step window W_exempt. Within W_exempt of the corrected interaction steps, the node will not participate in the automatic compression candidate. The principle for determining W_exempt is: take 1-2 times the recent average number of active interaction steps of the group to which the corrected node belongs, to ensure that the corrected content can only be compressed after it has been used by the model in at least the next round of complete group interaction. In practical applications, the value range of W_exempt can be 3-10 interaction steps, with a default value of 5. After the window expires, if the node still needs to be compressed, it can be executed according to the back-to-source strategy in the above embodiment.
[0155] (3) Group-based compression skew: When the correction type is expansion correction (ΔT>0) and the number of tokens in the corrected node exceeds its upper limit Cap(node), token space needs to be released in other interactive nodes. If the number of tokens in the corrected content does not exceed Cap(node), the token increment of the interactive node can be absorbed by its own spare quota, without triggering group compression skew. When release is required, the objects to be compressed are determined according to the following hierarchical selection process: First, calculate the token quota to be released. The first step is to release R units, which is the portion of the corrected number of lexical units that exceeds the upper limit of the number of lexical units for that node. When the corrected number of lexical units does not exceed the upper limit, R=0, and there is no need to release space in other nodes. The second step is to sort all unconfirmed and uncorrected interaction nodes in other groups outside the group to which the target interaction node belongs, according to their importance scores from low to high, and add them to the node set to be compressed in turn until the estimated number of lexical units that can be released in the node set to be compressed (the sum of the positive values of the difference between the current number of lexical units and the upper limit of the recalculated number of lexical units) ≥ R. The third step is to select other unconfirmed and uncorrected interaction nodes in the group to which the target interaction node belongs, according to their importance scores from low to high, to supplement the node set to be compressed. The fourth step is to add confirmed but uncorrected interaction nodes to the node set to be compressed in the same order (first outside the group to which the target interaction node belongs, then within the group to which the target interaction node belongs) in order. Fifth, if all uncorrected interaction nodes are insufficient to release R tokens, then the corrected interaction nodes are added to the node set to be compressed in the same order (first outside the group to which the target interaction node belongs, then within the group to which the target interaction node belongs). Sixth, if the node set to be compressed is sufficient to release R tokens, then the nodes in the node set to be compressed are subjected to back-to-source compression. If the node set to be compressed is still insufficient to release R tokens, then a token budget shortage message is generated and displayed on the visualization interface.
[0156] The basis for the back-to-source compression strategy of expanded correction is that the contexts corresponding to the same group identifier are related to each other. The expanded correction of a certain node in the group by the user implies the intention that "the group needs to retain more details". Therefore, relatively unimportant content in other groups should be compressed first, and the content of the same group should only be compressed when there is insufficient space in other groups.
[0157] In this embodiment, a multi-level, priority-based cascading compression selection strategy is designed to intelligently alleviate compression pressure when user expansion correction causes contextual limitations to be exceeded. This strategy reflects the priority order of "outer first, inner second; unconfirmed first, confirmed second; uncorrected first, corrected second," maximizing the protection of content on the same topic as the correction node and high-value content that has been confirmed or corrected by the user. It solves the problem of secondary distortion that may be caused by simply truncating or arbitrarily compressing other content after expansion correction, ensuring that the user's intent (to retain more details) is prioritized, while recycling the word space in the most reasonable way, maintaining the overall structural integrity and content fidelity of the context.
[0158] In an exemplary embodiment, the source interaction data tree and context view tree are updated according to the update strategy corresponding to the correction type, including: if the correction type is a simplified correction, the amount of releasable word elements is determined based on the content before and after correction; over-compressed nodes are screened in each interaction node and sorted from high to low according to their importance scores to form a set of nodes to be released; over-compressed nodes are interaction nodes whose current word element count is lower than a preset proportion of the current word element count limit; word element quotas are allocated sequentially from high to low according to the importance scores of each node to be released in the set of nodes to be released until all releasable word element quotas are allocated; a back-to-source expansion is performed on the target node to be released that has obtained word element quotas, along the compression of the target node to be released. The compressed version chain is traced back to find at least one target version interaction content with a word count not exceeding the word count limit of the target node to be released and a compression level lower than the current compressed version. If it exists, the target version interaction content with the lowest compression level among all target version interaction content is taken as the latest compressed version interaction content of the target node to be released, so as to update the source interaction data tree and context view tree. If it does not exist, the previous compressed version interaction content of the target node to be released is obtained, and recompressed with the word count limit of the target node to be released as the target length. The compression result is taken as the latest compressed version interaction content of the target node to be released, so as to update the source interaction data tree and context view tree.
[0159] Among them, over-compressed nodes refer to nodes whose current number of lexical elements is far below their upper limit for the number of lexical elements, indicating that their content may be over-compressed and there is room for information recovery.
[0160] Among them, the releaseable lexical quota is the total amount of lexical space released by the user through simplification and correction.
[0161] Among them, back-to-source unpacking refers to the operation of replacing the current version of an overcompressed node with a version that has more complete information.
[0162] Optionally, when a user performs a shortened correction (the content becomes shorter after correction), the server calculates the available token quota (i.e., the absolute value of the difference in the number of tokens before and after correction). Then, over-compressed nodes are filtered from all interactive nodes and sorted by importance score from highest to lowest, forming a set of nodes to be released. The set of nodes to be released is traversed, and token quotas are allocated to each node sequentially until all available token quotas are allocated. For nodes that have obtained token quotas, a back-to-source expansion is performed, i.e., tracing back along their compressed version chain to find at least one target version of interactive content with a token count not exceeding its upper limit and a compression level lower than the current compressed version (the lower the compression level, the more complete the information). If such a version exists, it is directly switched to the version with the lowest compression level; if not, the previous compressed version is taken, and recompressed with the node's token count upper limit as the target length, generating an intermediate version between the current version and the previous version as the new current version.
[0163] For the convenience of those skilled in the art, Figure 5 A schematic diagram of the reverse release mechanism for simplified correction is provided. When the correction type is simplified correction (ΔT<0), the server performs a reverse release, the steps of which include:
[0164] Step 1: Distribute the releaseable token quota |ΔT| to other nodes currently in an overcompressed state according to their importance score. "Overcompressed state" refers to a node whose current token count is significantly lower than the recalculated maximum token count. The specific criterion is: token_len(node) < η·Cap(node), where Cap(node) is the recalculated maximum token count for that node, and η is the overcompression criterion coefficient, ranging from 0.3 to 0.6, with a preferred value of 0.5. Nodes meeting the criteria are sorted from highest to lowest importance score to form a list of nodes to be released.
[0165] Step 2: Assign release quotas to each node in the list of nodes to be released, in descending order of priority. The quota allocated to each node is... The smaller of the remaining release quota is used until the release quota |ΔT| is fully allocated. A back-to-source expansion operation is triggered for the node that has received a release quota. The specific process of back-to-source expansion is as follows: Traverse the compressed version chain of the node backward from the current version, searching for a target version that satisfies the condition that "the number of terms in the target version is less than or equal to the upper limit of the number of terms after recalculation (Cap(node)) of the node, and the compression level of the target version is lower than the current version (i.e., the information is more complete)". If a target version that meets the conditions is found, the version with the lowest compression level is selected from the target versions to replace the current available version of the node in the context view tree; if there is no earlier version in the compressed version chain that meets the upper limit of the number of terms (i.e., all earlier versions exceed the upper limit), the most recent earlier version is recompressed, with the target length set to Cap(node), generating an intermediate version with information content between the current version (L_n) and an earlier version (L_(n-1)), which is then used as the current version (L_n).
[0166] Step 3: After the back-to-source expansion is completed, the semantic drift score of the expanded nodes is recalculated to verify whether the expansion has improved the information retention quality.
[0167] The reverse release mechanism of the above-mentioned simplified correction is not available in existing context compression schemes (which only support monotonic compression direction). In the prior art, compression is an irreversible unidirectional process, while this application introduces a bidirectional adjustment mechanism of "compression-release" for the first time through user correction events.
[0168] In this embodiment, by introducing a reverse release and source expansion mechanism triggered by simplified correction, bidirectional adjustment capability in context compression management is achieved, overcoming the limitation of traditional solutions that can only compress in one direction and cannot utilize the space released by the user to restore information of other nodes. When the user actively simplifies the content, the released word quota can be intelligently redistributed to those high-value nodes that have been over-compressed, allowing their information to be restored. This dynamic balance mechanism of compression and release improves the flexibility and overall fidelity of context management, ensuring that every correction operation by the user generates a positive chain effect and continuously optimizes the quality of the context content.
[0169] The correction event in this application triggers a local update propagation of semantic drift scores: for the target interaction node being corrected, the semantic drift score is recalculated, and the semantic drift risk marker for that node is cleared; for other interaction nodes that have content reference relationships with the target interaction node being corrected (referring to a relationship in the context view tree where a node references or depends on key constraints, device parameters, procedure clauses, or conclusion information of another node in its content representation; content reference relationships are represented by a reference identifier field or a set of dependency edges maintained by the node, where the reference identifier field is used to record the version identifier and / or source mapping identifier of the referenced node to support the location of associated nodes during semantic drift score propagation), their semantic drift scores are marked as "pending recalculation" and recalculated preferentially in the next drift detection cycle. This propagation mechanism ensures that the impact of the correction operation is correctly reflected in the drift assessment of associated nodes.
[0170] When generating the context content for the input large language model, this application selects the latest compressed version of the interaction content for each interaction node from the context view tree for expansion, which can be done using a depth-first search method. Subsequently, during inference, the large language model will be based on the context, which has been verified or corrected by power industry professionals, to ensure the integrity of key constraints in the power business and the accuracy of physical parameters.
[0171] To facilitate understanding by those skilled in the art, two embodiments are provided below to illustrate the implementation process of the technical solution of this application in specific power system application scenarios.
[0172] Example 1 corresponds to a transformer fault diagnosis scenario. In this scenario, maintenance personnel engage in multi-round dialogue with a large language model to diagnose a fault in the main transformer of a 220kV substation. This includes: Interaction Round 1: "The user uploads dissolved gas analysis (DGA) data in the transformer oil, including H2=150ppm, CH4=80ppm, C2H2=5ppm, C2H4=120ppm, C2H6=30ppm, CO=500ppm, and CO2=3000ppm. The model analysis suggests a possible thermal fault, primarily characterized by localized overheating." Interaction Round 2: "The user queries the transformer's historical fault records, and the system returns three fault events from the past five years along with their handling measures." Interaction Round 3: "The user requests to compile a maintenance plan based on the maintenance procedure Q / XXX NNNN-YYYY." After multiple rounds of dialogue, the content of Interaction Round 1 is compressed. Since there is no user-confirmed or corrected version in the compressed version chain of Interaction Node 1, the source reference C_ref for the interaction content is the original version L0. Key Constraint Extraction (PBCC) was performed on the source reference C_ref of the interactive content, extracting seven DGA gas data constraint items (all structured constraints): k1: (DGA gas data, H2, 150, ppm); k2: (DGA gas data, CH4, 80, ppm); k3: (DGA gas data, C2H2, 5, ppm); k4: (DGA gas data, C2H4, 120, ppm); k5: (DGA gas data, C2H6, 30, ppm); k6: (DGA gas data, CO, 500, ppm); k7: (DGA gas data, CO2, 3000, ppm). Compression content inspection revealed that k3 (C2H2=5ppm) and k7 (CO2=3000ppm) were omitted during compression; the value of k4 (C2H4) was incorrectly compressed from 120ppm to 12ppm; the remaining four items were retained and correct. The corresponding semantic drift scores are calculated as follows: Semantic similarity Sim=0.85 (hypothetical); Key constraint coverage=5 / 7≈0.714 (K_total=7, K_retained=5, k3 and k7 are missing, k4 has an incorrect value but the field name exists, and it is judged as retained according to the structured constraint item retain_key); Structured field bias StructDiff=1 / 5=0.20 (F_matched=5 fields, the value of k4 is tampered, N_tampered=1); Temporal consistency bias SeqDiff is not applicable (DGA data does not involve ordered constraints, N_pairs=0). Applicable component weights W=α+β+γ=0.70, D=(0.10×(1-0.85)+0.40×(1-0.714)+0.20×0.20) / 0.70=0.241.Since D=0.241>T_high (fault diagnosis threshold=0.15), it is determined to be a dangerous drift, triggering a mandatory review.
[0173] The operations and maintenance personnel discovered missing C2H2 and CO2 data and an incorrect C2H4 value in the review interface. A correction operation was performed: restoring complete DGA data and correcting the C2H4 value. This correction was an expansion-type correction (ΔT = +50 tokens). Before correction, the number of tokens for this node was 60; after correction, it was 110. This correction event was used as a compression scheduling reentry trigger, recalculating the pressure coefficient and redistributing the maximum number of tokens for each node. After recalculation, the Cap(node) for this node was 85. Following a group-based compression bias strategy, unconfirmed and uncorrected nodes are prioritized for compression from groups other than the group to which the correction node belongs. Therefore, an unconfirmed historical record in the "#3 Maintenance Plan Scheduling" group is automatically compressed, releasing 30 tokens, which meets the release requirements.
[0174] Example 2 corresponds to a power dispatching operation scenario. In this scenario, the dispatcher engages in multi-round dialogue with the large language model to create a power outage maintenance operation ticket for a 110kV line. This includes interaction round 1: "Dispatcher inputs 'Please create a power outage maintenance operation ticket for 110kV Line A, the maintenance content is to replace insulators' and provides line topology information: the line starts from the low-voltage 110kV I section busbar of the 220kVA substation, passes through bus-side disconnector QS2, circuit breaker QF1, and line-side disconnector QS1 to substation B". Interaction round 2: The model queries the protection setting database and returns "Line A overcurrent I section setting 1200A, action time 0s; overcurrent II section setting 800A, action time 0.5s; zero-sequence overcurrent setting 50A", and generates a draft of the operation steps, containing 6 operation steps. Interaction round 3: "Dispatcher requests to add a voltage testing step to the safety measures". Interaction round 4: "Dispatcher confirms the safety measures list". As the subsequent dialogue continued (interaction rounds 5-8 involved other line scheduling tasks), the content of interaction round 2 was compressed. Since there was no user confirmation or correction version in the compressed version chain of interaction round 2, the original version L0 was used as the source reference C_ref. Drift detection was performed on C_ref: First, critical constraint extraction (PBCC) was performed, extracting the following constraint items from C_ref: k1: (protection setting, "overcurrent stage I setting", "1200", "A"); k2: (protection setting, "overcurrent stage II setting", "800", "A"); k3: (protection setting, "zero-sequence overcurrent setting", "50", "A"); k4: (action time limit, "overcurrent stage I action time limit", "0", "s"); k5: (action time limit, "overcurrent stage II action time limit"); k6: (Time constraint, "Operation Step 1", "Disconnect Circuit Breaker QF1", null); k7: (Time constraint, "Operation Step 2", "Disconnect Line Side Disconnector QS1", null); k8: (Time constraint, "Operation Step 3", "Disconnect Bus Side Disconnector QS2", null); k9: (Time constraint, "Operation Step 4", "Voltage Testing", null); There are a total of 9 constraint items, of which k1-k5 are structured constraint items and k6-k9 are ordered constraint items. For simplicity, only the first 4 operation steps are listed here. The 6 operation steps in C_ref are all included in the PBCC set during actual extraction. The next step is to check the compressed content. After compression, the complete information of 2 constraint items, k1 (overcurrent stage I setting 1200A) and k2 (overcurrent stage II setting 800A), is retained. k3 (zero-sequence overcurrent setting) is missing; k4 (overcurrent stage I action time limit 0s) and k5 (overcurrent stage II action time limit 0.5s) are missing.The step field name for k6 (operation step 1) is retained, but the description is simplified; it is determined to be retained based on retain_key matching. The step field names for k7 and k8 are both retained, and they are determined to be retained based on retain_key matching, but the order of their corresponding operation contents is reversed after compression to "first disconnect bus-side disconnector QS2, then disconnect line-side disconnector QS1". k9 (voltage testing) is retained. K_retained=6 (k1, k2, k6, k7, k8, k9), Coverage=6 / 9≈0.667. Finally, the semantic drift score is calculated: Semantic similarity Sim: Sim=0.65 (the operation steps text is significantly simplified); Key constraint coverage: Coverage=6 / 9≈0.667 (three constraint items, k3, k4, and k5, are missing); Structured field deviation StructDiff: Five structured numerical fields (k1-k5) are extracted from F_ref of C_ref, and two fields (k1:1200A, k2:800A) can be matched in the compressed content, and the values and units are correct, StructDiff=0. / 2=0; Timing consistency deviation SeqDiff: The ordered constraint sequence of C_ref is [Step 1: Disconnect QF1, Step 2: Disconnect QS1, Step 3: Disconnect QS2, Step 4: Test for voltage], and the corresponding sequence of compressed content is [Step 1: Disconnect QF1, Step 2: Disconnect QS2, Step 3: Disconnect QS1, Step 4: Test for voltage]. After matching the operation content, the inversion pairs are calculated: (QS1, QS2) are reversed, the number of inversion pairs N_inv=1, the total number of ordered pairs N_pairs=C(4,2)=6, SeqDiff=1 / 6≈0.167. D=(0.10×(1-0.65)+0.40×(1-0.667)+0.20×0+0.30×0.167) / 1.00=0.218. Since D=0.218>T_high (scheduling operation threshold=0.12), it is determined to be a dangerous drift. The use of the compressed content is suspended and the previous version is rolled back, triggering a mandatory review.
[0175] The dispatcher found two key issues in the review interface: (1) The disconnector operation sequence was reversed - disconnecting the bus-side disconnector first and then the line-side disconnector is an incorrect operation sequence, which may cause the disconnector break to break down when the line is under load. This problem was effectively captured by the SeqDiff component (SeqDiff=0.167); (2) The zero-sequence overcurrent setting and action time limit parameters were lost - key parameters were missing when judging the grounding protection coordination and time limit coordination. The dispatcher performed the correction: restored the correct operation sequence and supplemented the zero-sequence overcurrent setting and action time limit data. The correction type is the expansion correction (ΔT=+45 words). Before the correction, the number of words in this node was 55, and after the correction it was 100. The correction event was used as the compressed dispatch re-entry trigger, the pressure coefficient was recalculated and the upper limit of the number of words in each node was redistributed. After the recalculation, the Cap(node) of this node was 120, and R = max(0,100 - 120) = 0. Since the number of corrected lexical units does not exceed the upper limit after recalculation, the lexical unit increment of this node is absorbed by its own spare quota, without triggering cascade compression, and directly enters the semantic drift score update propagation.
[0176] For the convenience of those skilled in the art, Figure 6 A schematic diagram of the overall process of the technical solution in this application is provided. Figure 6 The overall process illustrated uses a dialogue event flow in the power system domain as an example. Specifically, this process includes: acquiring the source interaction data tree and context view tree constructed from the dialogue event flow for power business; wherein, the source interaction data tree stores the original interaction content and its corresponding compressed version chain during the interaction process between the user and the power system large language model; the context view tree organizes the latest compressed version interaction content input to the power system large language model under lexical budget constraints, and records the reference relationships, grouping identifiers, and assembly order information of the latest compressed version interaction content; and performing drift detection on the latest compressed version interaction content of each interaction node in the context view tree, based on semantic similarity. The system calculates semantic drift scores based on key power business constraint coverage, structured field consistency deviation, and timing consistency deviation. Based on these scores and a preset power security threshold, it identifies target interaction nodes requiring review. A visualization interface containing a first and second tree structure is generated. The semantic drift level of each target interaction node is marked on the visualization interface, and a review entry point is provided for each node. In response to user review operations, the system determines the source reference C_ref for the interaction content of the target node. If a user-confirmed or user-corrected version exists in the compressed version chain of the node, C_ref is the latest version; otherwise, C_ref is the original version L0. The system then displays the results. The system compares the latest compressed version's interactive content with C_ref and the original version L0; it receives user confirmation or correction commands for the latest compressed version's interactive content, and performs lexical count constraint checks on the corrected content during correction; when the corrected content does not exceed the currently allocated lexical count limit, it writes the corrected content into the compressed version chain and updates the context view tree; when the corrected content exceeds the currently allocated lexical count limit, it outputs an over-limit warning and receives the user's selection of a first correction strategy or a second correction strategy, where the first correction strategy is to refuse to write the corrected content into the compressed version chain, and the second correction strategy is to allow the corrected content to be written into the compressed version chain and... Update the context view tree; after the corrected content is written to the version chain, trigger compression scheduling re-entry and compression requirement reassessment based on the corrected content as a correction event, including freezing protection for confirmed interaction nodes; when the user selects the second correction strategy, release the lexical space in other interaction nodes in the context view tree to meet the context lexical budget constraint based on the portion of the corrected content's lexical number exceeding the node's lexical number limit; when the correction type is simplified correction, perform the reverse release of simplified correction, releasing the lexical space to other nodes; assemble the context content based on the updated context view tree and input it into the large language model to process power business requests.
[0177] Compared with existing technical solutions that rely solely on automatic compression, this application, taking the application to large language models of power systems as an example, has at least the following advantages:
[0178] (1) Through a drift detection mechanism designed specifically for the characteristics of power business data, it can automatically identify the loss or alteration of key constraints such as power equipment parameters, safety thresholds, and operating procedures during the compression process, as well as the reversal or disruption of the execution order of operating steps. When drift occurs, it actively triggers review alarms to prevent unsafe contextual content from being used for subsequent reasoning. This drift detection is not a general text similarity comparison, but a domain-specific detection method that combines the coverage of key constraints in power business, the consistency of structured fields, and the consistency of time sequence. It can capture semantic deviations in power business that cannot be reflected by general similarity indicators, especially the safety-related step sequence constraints in operating procedures.
[0179] (2) By visualizing and mapping the source interactive data tree and the context data tree in a two-column configuration, power professionals can intuitively review the retention of equipment parameters and procedural constraints in the source interactive data tree by the compression results on the same interface. Combined with the drift risk level indication, they can quickly locate the nodes that need attention, thereby improving the transparency and interpretability of context management.
[0180] (3) The closed-loop control mechanism of user correction event-driven compression scheduling reentry makes the correction operation not only a local modification of the content of a single node, but also a new trigger source entering the compression scheduling loop, causing a global response—including confirmed node freeze protection, compression exemption window for correction nodes, group-based compression skew strategy, and reverse release mechanism for simplified correction. This closed-loop control makes manual correction and automatic compression system form an organic whole, and introduces a bidirectional "compression-release" adjustment capability that existing solutions do not have.
[0181] (4) By setting a priority flag for returning to the source in the compressed version chain, the path selection logic for subsequent return-to-source compression is modified: when it is necessary to compress the corrected or confirmed node again, the return to the source is prioritized from the user-corrected version or user-confirmed version rather than the automatically compressed version, so as to ensure that the semantic anchoring effect of user correction is maintained in subsequent compression cycles and avoid the problem of "user painstaking correction or confirmation being overwritten by automatic compression".
[0182] (5) By recording the history and source pointers of the compression version chain, the compression and correction process can be traced, rolled back and audited, thus meeting the compliance requirements of the power system for the traceability of operation records.
[0183] In another embodiment, such as Figure 7 As shown, a context semantic consistency control method that supports user correction is provided. Taking the application of this method to a server as an example, the method includes the following steps:
[0184] Step S702: Obtain the source interaction data tree and context view tree corresponding to the current dialogue event stream; the source interaction data tree organizes each interaction node in the current dialogue event stream in chronological order, and each interaction node has a side link to the previous compressed version of the interaction content; the context view tree organizes the latest compressed version of the interaction content of each interaction node according to the topic type.
[0185] Step S704: In the visualization interface, display the first tree diagram generated based on the source interactive data tree and the second tree diagram generated based on the context view tree.
[0186] Step S706: Based on the compressed version chain of each interaction node, determine the source reference for the interaction content of each interaction node from the previous compressed version interaction content of each interaction node.
[0187] Step S708: Based on the source reference of the interaction content of each interaction node and the latest compressed version of the interaction content of each interaction node, determine the semantic drift value of each interaction node under each semantic drift evaluation dimension.
[0188] Step S710: The semantic drift values of each interaction node under each semantic drift evaluation dimension are weighted and summed to obtain the semantic drift score of each interaction node.
[0189] Step S712: Based on the semantic drift score of each interactive node, determine whether there is a target interactive node with a preset semantic drift level.
[0190] Step S714: If a target interaction node exists, then the target interaction node is highlighted in the second tree diagram.
[0191] Step S716: In response to the user's processing operation on the target interaction node, update the source interaction data tree and the context view tree to update the first tree diagram and the second tree diagram, and return to execute the step of determining the semantic drift score of each interaction node based on the source interaction data tree and the context view tree, until there is no target interaction node; wherein, the updated context view tree is used to assemble the context content and input it into the large language model.
[0192] It should be noted that the specific limitations of the above steps can be found in the specific limitations of a context semantic consistency control method that supports user correction, as described above.
[0193] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0194] The context semantic consistency control device supporting user correction provided in the embodiments of this application is described below. The context semantic consistency control device supporting user correction has the same inventive concept as the context semantic consistency control method supporting user correction described above. The solution to the problem provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more embodiments of the context semantic consistency control device supporting user correction provided below can be found in the limitations of the context semantic consistency control method supporting user correction described above. The context semantic consistency control device supporting user correction described below and the context semantic consistency control method supporting user correction described above can be referred to each other, and will not be repeated here.
[0195] In one exemplary embodiment, Figure 8 A schematic diagram of a context semantic consistency control device supporting user correction is provided in an embodiment of this application, as shown below. Figure 8 As shown, the context semantic consistency control device supporting user correction includes: an acquisition module 802, a visualization module 804, a determination module 806, a highlighting module 808, and a response module 810, wherein:
[0196] The acquisition module 802 is used to acquire the source interaction data tree and context view tree corresponding to the current dialogue event stream; the source interaction data tree arranges each interaction node in the current dialogue event stream in chronological order, and each interaction node has a side link to the previous compressed version of the interaction content; the context view tree organizes the latest compressed version of the interaction content of each interaction node according to the topic type.
[0197] The visualization module 804 is used to display a first tree diagram generated based on the source interactive data tree and a second tree diagram generated based on the context view tree in the visualization interface;
[0198] The determination module 806 is used to determine the semantic drift score of each interaction node based on the source interaction data tree and the context view tree, and to determine whether there is a target interaction node with a preset semantic drift level based on the semantic drift score of each interaction node.
[0199] The highlighting module 808 is used to highlight the target interactive node in the second tree diagram if the target interactive node exists.
[0200] The response module 810 is used to respond to the user's processing operation on the target interaction node, update the source interaction data tree and the context view tree to update the first tree diagram and the second tree diagram, and return to execute the step of determining the semantic drift score of each interaction node based on the source interaction data tree and the context view tree, until there is no target interaction node; wherein, the updated context view tree is used to assemble the context content and input it into the large language model.
[0201] In an exemplary embodiment, the source interaction data tree maintains a compressed version chain for each interaction node; the determining module 806 is specifically used to determine the interaction content back-to-source benchmark for each interaction node based on the compressed version chain of each interaction node, in the previous compressed version interaction content of each interaction node; based on the interaction content back-to-source benchmark of each interaction node and the latest compressed version interaction content of each interaction node, determine the semantic drift value of each interaction node under each semantic drift evaluation dimension; and perform a weighted summation of the semantic drift values of each interaction node under each semantic drift evaluation dimension to obtain the semantic drift score of each interaction node.
[0202] In an exemplary embodiment, the determining module 806 is specifically used to: if the compressed version chain of the interaction node records the interaction content of the origin-priority version, then use the interaction content corresponding to the origin-priority version as the origin-priority reference for the interaction content of the interaction node; the origin-priority version is a version that has been corrected or confirmed; if the compressed version chain of the interaction node does not record the interaction content of the origin-priority version, then use the original version interaction content recorded in the compressed version chain as the origin-priority reference for the interaction content of the interaction node.
[0203] In an exemplary embodiment, the determining module 806 is specifically used to perform key constraint extraction on the source-background and latest compressed version of the interaction content of each interaction node, respectively, to obtain the base set of key constraints for power business and the latest set of key constraints for power business of each interaction node; based on the source-background and latest compressed version of the interaction content of each interaction node, the interaction content similarity is determined; and based on the base set of key constraints for power business and the latest set of key constraints for power business of each interaction node, the coverage rate of key constraints for power business, the structured field consistency deviation, and the temporal consistency deviation are determined; and the interaction content similarity, key constraint coverage rate, structured field consistency deviation, and temporal consistency deviation corresponding to each interaction node are determined as the semantic drift value of each interaction node under each semantic drift evaluation dimension.
[0204] In an exemplary embodiment, the processing operations include a review trigger operation and a correction operation; the response module 810 is specifically used to respond to the user's review trigger operation for the target interaction node, obtain the source baseline and the latest compressed version of the interaction content of the target interaction node, and generate comparison information to be displayed on the visualization interface; the comparison information is used to provide guidance when the user edits the interaction content of the target interaction node; in response to the user's correction operation for the latest compressed version of the interaction content of the target interaction node, obtain the content before correction and the content after correction, and determine the correction type based on the content before correction and the content after correction; and update the source interaction data tree and the context view tree according to the update strategy corresponding to the correction type.
[0205] In an exemplary embodiment, the response module 810 is specifically configured to, if the correction type is expansion correction, determine whether the number of tokens in the corrected content exceeds the upper limit of the number of tokens in the target interactive node; if it exceeds, determine the number of tokens to be released based on the content before and after correction, and select unconfirmed and uncorrected interactive nodes from other topic groups outside the topic group to which the target interactive node belongs, in order of importance score from low to high, to add them to the node set to be compressed; if the total number of releaseable tokens in the node set to be compressed is less than the number of tokens to be released, select unconfirmed and uncorrected interactive nodes from the topic group to which the target interactive node belongs, in order of importance score from low to high. Other interactive nodes are added to the node set to be compressed, resulting in the first supplemented node set. If the total number of releaseable tokens in the first supplemented node set is less than the number of releaseable tokens, then confirmed but uncorrected interactive nodes are selected from other topic groups outside the target interactive node's topic group, ranked from low to high importance, and added to the first supplemented node set, resulting in the second supplemented node set. If the total number of releaseable tokens in the second supplemented node set is less than the number of releaseable tokens, then confirmed but uncorrected interactive nodes are selected from other topic groups outside the target interactive node's topic group, ranked from low to high importance, and added to the second supplemented node set. The other corrected interactive nodes are added to the second supplemented set of nodes to be compressed, resulting in the third supplemented set of nodes to be compressed. If the total number of releaseable tokens in the third supplemented set of nodes to be compressed is less than the number of tokens to be released, then, in other topic groups besides the target interactive node's topic group, nodes are selected from the already corrected interactive nodes and added to the third supplemented set of nodes to be compressed, ranked from lowest to highest importance, resulting in the fourth supplemented set of nodes to be compressed. If the total number of releaseable tokens in the fourth supplemented set of nodes to be compressed is less than the number of tokens to be released, then, in other topic groups besides the target interactive node's topic group, nodes are selected from the already corrected interactive nodes and added to the third supplemented set of nodes to be compressed, ranked from lowest to highest importance, resulting in the fourth supplemented set of nodes to be compressed. Select other corrected interactive nodes to be added to the fourth supplementary set of nodes to be compressed, resulting in the fifth supplementary set of nodes to be compressed. If the total number of releasable tokens in the fifth supplementary set of nodes to be compressed is greater than or equal to the number of tokens to be released, then perform a back-to-source compression operation on the fifth supplementary set of nodes to be compressed, releasing the tokens to be released in order to update the source interactive data tree and context view tree. If the total number of releasable tokens in the fifth supplementary set of nodes to be compressed is less than the number of tokens to be released, then generate a token budget shortage warning message and display it on the visualization interface. The token budget shortage warning message is used to guide the user to re-perform the correction operation.
[0206] In an exemplary embodiment, the response module 810 is specifically configured to: if the correction type is simplified correction, determine the amount of releasable word units based on the content before and after correction; filter over-compressed nodes among the interaction nodes and sort them from high to low importance scores to form a set of nodes to be released; over-compressed nodes are interaction nodes whose current word unit count is lower than a preset proportion of the current word unit count limit; allocate word unit quotas to each node to be released in the set of nodes to be released in descending order of importance scores until all releasable word unit quotas are allocated; perform a back-to-source expansion on the target node to be released that has obtained word unit quotas, tracing back along the compressed version chain of the target node to be released to find... If there exists at least one target version of interactive content with a word count not exceeding the upper limit of the word count of the target node to be released and a compression level lower than the current compressed version, then if such a target version of interactive content exists, the target version of interactive content with the lowest compression level among all target version of interactive content is used as the latest compressed version of interactive content for the target node to be released, so as to update the source interactive data tree and the context view tree; if not, then the previous compressed version of interactive content for the target node to be released is obtained, and recompressed with the upper limit of the word count of the target node to be released as the target length, and the compression result is used as the latest compressed version of interactive content for the target node to be released, so as to update the source interactive data tree and the context view tree.
[0207] In one exemplary embodiment, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the context semantic consistency control methods supporting user correction described in the above embodiments.
[0208] In one exemplary embodiment, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the context semantic consistency control methods supporting user correction in the above embodiments.
[0209] In one exemplary embodiment, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the user-corrected context semantic consistency control methods described in the above embodiments.
[0210] Indicatively, such as Figure 9 As shown, Figure 9 This is a schematic diagram of the internal structure of a computer device 900 provided in an embodiment of this application. The computer device 900 can be provided as a server. (Refer to...) Figure 9 The computer device 900 includes a processing component 902, which further includes one or more processors, and memory resources represented by memory 901 for storing instructions, such as application programs, that can be executed by the processing component 902. The application programs stored in memory 901 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 902 is configured to execute instructions to perform the context semantic consistency control method supporting user correction in any of the above embodiments.
[0211] The computer device 900 may also include a power supply component 903 configured to perform power management of the computer device 900, a wired or wireless network interface 904 configured to connect the computer device 900 to a network, and an input / output (I / O) interface 905. The computer device 900 may operate on an operating system stored in memory 901, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0212] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0213] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0214] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0215] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.< / value> < / gas> < / unit> < / value> < / name>
Claims
1. A contextual semantic consistency control method supporting user correction, characterized in that, The method includes: Obtain the source interaction data tree and context view tree corresponding to the current dialogue event stream; the source interaction data tree arranges each interaction node in the current dialogue event stream in chronological order, and each interaction node has a side link to the previous compressed version of the interaction content; the context view tree organizes the latest compressed version of the interaction content of each interaction node according to the topic type. The visualization interface displays a first tree diagram generated based on the source interactive data tree and a second tree diagram generated based on the context view tree; Based on the source interaction data tree and the context view tree, the semantic drift score of each interaction node is determined, and based on the semantic drift score of each interaction node, it is determined whether there is a target interaction node with a semantic drift level of a preset level. If the target interaction node exists, then the target interaction node is highlighted in the second tree diagram; In response to a user's processing operation on the target interaction node, the source interaction data tree and the context view tree are updated to update the first tree diagram and the second tree diagram, and the process returns to the step of determining the semantic drift score of each interaction node based on the source interaction data tree and the context view tree, until the target interaction node no longer exists; wherein, the updated context view tree is used to assemble context content and input it into the large language model.
2. The method according to claim 1, characterized in that, The source interaction data tree maintains a compressed version chain for each interaction node; The step of determining the semantic drift score of each interaction node based on the source interaction data tree and the context view tree includes: Based on the compressed version chain of each interaction node, the source reference for the interaction content of each interaction node is determined from the previous compressed version interaction content of each interaction node. Based on the source-back benchmark of the interaction content of each interaction node and the latest compressed version of the interaction content of each interaction node, the semantic drift value of each interaction node under each semantic drift evaluation dimension is determined. The semantic drift values of each interaction node under each semantic drift evaluation dimension are weighted and summed to obtain the semantic drift score of each interaction node.
3. The method according to claim 2, characterized in that, The step of determining the source-background for the interaction content of each interaction node based on the compressed version chain of each interaction node in the historical compressed version interaction content of each interaction node includes: If the compressed version chain of the interaction node records the interaction content of the origin-priority version, then the interaction content corresponding to the origin-priority version is used as the origin-priority reference for the interaction content of the interaction node; the origin-priority version is a version that has been corrected or confirmed. If the compressed version chain of the interaction node does not record the interaction content of the origin-priority version, then the original version interaction content recorded in the compressed version chain will be used as the origin-priority reference for the interaction content of the interaction node.
4. The method according to claim 2, characterized in that, The determination of the semantic drift value of each interaction node under each semantic drift evaluation dimension, based on the source-back benchmark of the interaction content of each interaction node and the latest compressed version of the interaction content of each interaction node, includes: For each interaction node, key constraints are extracted from the source baseline and the latest compressed version of the interaction content to obtain the baseline power business key constraint set and the latest power business key constraint set for each interaction node. Based on the source reference of the interaction content of each interaction node and the latest compressed version of the interaction content, the similarity of the interaction content is determined. Also, based on the reference set of key power business constraints and the latest set of key power business constraints of each interaction node, the coverage of key power business constraints, the consistency deviation of structured fields and the consistency deviation of time series are determined. The similarity of the interaction content, the coverage of key constraints of power business, the consistency deviation of structured fields, and the consistency deviation of time sequence are determined as the semantic drift values of each interaction node under each semantic drift evaluation dimension.
5. The method according to claim 1, characterized in that, The processing operations include review triggering operations and correction operations; The step of updating the source interaction data tree and the context view tree in response to a user's processing operation on the target interaction node includes: In response to a user's review trigger operation on the target interaction node, the system obtains the source baseline and the latest compressed version of the interaction content of the target interaction node, and generates comparison information to be displayed on the visualization interface; the comparison information is used to provide guidance when the user edits the interaction content of the target interaction node. In response to the user's correction operation on the latest compressed version of the interaction content of the target interaction node, the system obtains the content before correction and the content after correction, and determines the correction type based on the content before correction and the content after correction. The source interaction data tree and the context view tree are updated according to the update strategy corresponding to the correction type.
6. The method according to claim 5, characterized in that, The step of updating the source interaction data tree and the context view tree according to the update strategy corresponding to the correction type includes: If the correction type is expansion correction, then determine whether the number of lexical units in the corrected content exceeds the upper limit of the number of lexical units in the target interactive node; If the limit is exceeded, the number of words to be released is determined based on the corrected content and the upper limit of the number of words. In other topic groups outside the topic group to which the target interactive node belongs, interactive nodes that have not been confirmed and have not been corrected are selected from low to high importance scores and added to the set of nodes to be compressed. If the total number of releasable tokens in the node set to be compressed is less than the number of tokens to be released, then in the topic group to which the target interactive node belongs, other interactive nodes that have not been confirmed and have not been corrected are selected from low to high importance scores to supplement the node set to be compressed, thus obtaining the node set to be compressed after the first supplement. If the total number of releasable morphemes in the first supplemented set of nodes to be compressed is less than the number of morphemes to be released, then in other topic groups outside the topic group to which the target interactive node belongs, interactive nodes that have been confirmed but not corrected are selected from low to high importance scores and added to the first supplemented set of nodes to be compressed, thus obtaining the second supplemented set of nodes to be compressed. If the total number of releasable tokens in the second supplemented set of nodes to be compressed is less than the number of tokens to be released, then in the topic group to which the target interactive node belongs, other interactive nodes that have been confirmed but not corrected are selected from low to high importance scores and added to the second supplemented set of nodes to be compressed, thus obtaining the third supplemented set of nodes to be compressed. If the total number of releasable lexical units in the third supplemented set of nodes to be compressed is less than the number of lexical units to be released, then in other topic groups outside the topic group to which the target interactive node belongs, the interactive nodes that have been corrected are selected from the corrected interactive nodes in order of importance from low to high to add to the third supplemented set of nodes to be compressed, thus obtaining the fourth supplemented set of nodes to be compressed. If the total number of releasable morphemes in the fourth supplemented set of nodes to be compressed is less than the number of morphemes to be released, then in the topic group to which the target interactive node belongs, in order of importance score from low to high, select from other corrected interactive nodes to be added to the fourth supplemented set of nodes to be compressed, to obtain the fifth supplemented set of nodes to be compressed. If the total number of releasable tokens in the fifth-supplemented set of nodes to be compressed is greater than or equal to the number of tokens to be released, then a back-to-source compression operation is performed on the fifth-supplemented set of nodes to be compressed to release the number of tokens to be released, so as to update the source interaction data tree and the context view tree. If the total number of releasable tokens in the compressed node set after the fifth supplement is less than the number of tokens to be released, a token budget shortage warning message is generated and displayed on the visualization interface; the token budget shortage warning message is used to guide the user to re-perform the correction operation.
7. The method according to claim 5, characterized in that, The step of updating the source interaction data tree and the context view tree according to the update strategy corresponding to the correction type includes: If the correction type is a simplified correction, then the amount of word units that can be released is determined based on the content before and after the correction. Over-compressed nodes are selected from the interactive nodes and sorted from high to low importance scores to form a set of nodes to be released; the over-compressed nodes are interactive nodes whose current word count is lower than a preset ratio of the current word count limit. The word element quota is allocated in descending order of importance score for each node in the set of nodes to be released, until the releaseable word element quota is fully allocated. For the target node to be released that has obtained the word element quota, perform back-to-source expansion, trace back along the compressed version chain of the target node to be released, and search for at least one target version interaction content whose word element count does not exceed the upper limit of the word element count of the target node to be released and whose compression degree is lower than the current compressed version. If it exists, the target version interaction content with the lowest compression level among the target version interaction content is taken as the latest compressed version interaction content of the target node to be released, so as to update the source interaction data tree and the context view tree; If it does not exist, the previous compressed version of the interaction content of the target node to be released is obtained, and it is recompressed with the target length set as the upper limit of the number of lexical units of the target node to be released. The compression result is used as the latest compressed version of the interaction content of the target node to be released, so as to update the source interaction data tree and the context view tree.
8. A contextual semantic consistency control device supporting user correction, characterized in that, The device includes: The acquisition module is used to acquire the source interaction data tree and context view tree corresponding to the current dialogue event stream; the source interaction data tree arranges each interaction node in the current dialogue event stream in chronological order, and each interaction node has a side link to the previous compressed version of the interaction content; the context view tree organizes the latest compressed version of the interaction content of each interaction node according to the topic type. A visualization module is used to display, in a visualization interface, a first tree diagram generated based on the source interactive data tree and a second tree diagram generated based on the context view tree; The determination module is used to determine the semantic drift score of each interaction node based on the source interaction data tree and the context view tree, and to determine whether there is a target interaction node with a semantic drift level of a preset level based on the semantic drift score of each interaction node. A highlighting module is used to highlight the target interactive node in the second tree diagram if the target interactive node exists. The response module is used to update the source interaction data tree and the context view tree in response to the user's processing operation on the target interaction node, so as to update the first tree diagram and the second tree diagram, and return to execute the step of determining the semantic drift score of each interaction node based on the source interaction data tree and the context view tree, until the target interaction node no longer exists; wherein, the updated context view tree is used to assemble context content and input it into the large language model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.