A large model-based command query processing system and method thereof

CN122528908APending Publication Date: 2026-08-07TIANJIN KUNRUI INTERNET TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TIANJIN KUNRUI INTERNET TECHNOLOGY CO LTD
Filing Date
2026-06-01
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

然而,这类技术多采用单路径解码结构,无法根据输入语义复杂度动态调整生成结构,导致在多任务、跨领域命令解析场景下容易出现意图识别不稳定、参数槽位边界不清晰、结构化语义片段单一的问题

Benefits of technology

本发明通过在传统大模型基础架构上引入多分支生成子结构、多世界语义模拟模块以及自生结构重写模块,使得解码器不再受限于固定生成路径,而能够根据输入语义特征和分支差异度动态调整解码结构,从而显著提升意图识别的稳定性与生成的结构严谨性。相比现有技术中单路径、静态结构的解码方式,本发明在复杂命令、多实体依赖、跨领域上下文混杂的场景下,能够自适应生成更符合语义逻辑的解码结构,确保意图类别、参数槽位和结构化语义片段的抽取更加准确完整,降低生成错误和解释歧义的概率,大幅提升命令解析的可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122528908A_ABST
    Figure CN122528908A_ABST
Patent Text Reader

Abstract

The application discloses a command query processing system and method based on a large model, comprising the following steps: receiving and processing a natural language command input by a user to generate a standard semantic input set; retrieving context information, combining the standard semantic input set and a large model prompt strategy to generate an inference input set; calling an improved T5 model to perform semantic analysis and intent recognition on the inference input set to generate a preliminary structured command; performing executability constraint verification on the preliminary structured command to generate a standardized execution command; running the standardized execution command to obtain an execution result, and performing formatting and consistency verification to generate feedback data; dynamically updating a large model prompt strategy and a command mapping strategy, and generating a next round of standardized execution command. The application combines large model reasoning and multi-source rule verification, realizes intelligent analysis and adaptive execution of command query, and has the advantages of semantic precision, adjustable structure and reliable execution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent command processing, and in particular to a command query processing system and method based on a large model. Background Technology

[0002] Existing large-scale model-assisted command query processing techniques typically rely on a fixed encoder-decoder framework. This framework generates executable instructions by semantically parsing natural language commands and enhances contextual relevance through retrieval-enhanced generation mechanisms. However, these techniques often employ a single-path decoding structure, failing to dynamically adjust the generation structure based on input semantic complexity. This leads to issues such as unstable intent recognition, unclear parameter slot boundaries, and limited structured semantic fragments in multi-task, cross-domain command parsing scenarios. Furthermore, existing methods utilize rule base constraints in a relatively static manner; rule validation is usually performed only once after generation, making it difficult to establish stable closed-loop adaptive capabilities.

[0003] Furthermore, existing large-scale model prompting and command mapping strategies typically rely on manual settings or offline statistical methods for maintenance, lacking a real-time update mechanism based on execution feedback. This makes it difficult for the model to automatically calibrate inference biases during actual deployment. Execution result verification also largely depends on simple matching or template comparison, failing to quantitatively assess the credibility of structured results and impacting overall executability. In summary, existing technologies still have significant shortcomings in dynamic generation capabilities, adaptive rule validation, consistency verification, and continuous optimization of prompting / mapping strategies.

[0004] Therefore, how to provide a command query processing system and method based on a large model is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] One objective of this invention is to propose a command query processing method based on a large model. This invention integrates large model reasoning and multi-source rule verification to achieve intelligent parsing and adaptive execution of command queries, and has the advantages of semantic accuracy, adjustable structure and reliable execution.

[0006] A command query processing method based on a large model according to an embodiment of the present invention includes the following steps: It receives natural language commands input by users, performs word segmentation, syntactic analysis, entity extraction and normalization on the commands, and generates a standard semantic input set; The retrieval enhancement generation mechanism retrieves contextual information from the domain knowledge base and rule base, and generates a reasoning input set by combining the standard semantic input set and the preset large model hint strategy. The improved T5 model is invoked to perform semantic parsing and intent recognition on the inference input set, and preliminary structured commands are generated according to preset format requirements and command mapping strategies. Based on a rule base and a lightweight rule engine, the executable constraints of the initial structured commands are validated, and standardized execution commands are generated when the validation passes. Run standardized execution commands and obtain execution results; format and verify the consistency of the execution results; and generate feedback data. The large model prompting strategy and command mapping strategy are dynamically updated based on feedback data, and the next round of standardized execution commands are generated.

[0007] Optionally, the natural language commands include query requests, operation instructions, and task description statements.

[0008] Optionally, the generation of the inference input set specifically includes: Based on the standard semantic input set, extract the keyword set, entity set and semantic relation set, and concatenate them in a preset order, including arranging the keyword features, entity features and semantic relation features in sequence and synthesizing them into a continuous feature sequence to generate a unified feature representation; Using unified feature representation as query conditions, a text channel retrieval is performed in the domain knowledge base based on the retrieval enhancement generation mechanism to obtain a context candidate set, and a rule channel retrieval is performed in the rule base to obtain a rule candidate set; A comprehensive relevance score is calculated for each candidate in the context candidate set and the rule candidate set, and a candidate set with a score is generated. The comprehensive relevance score is obtained by linearly combining the semantic weight coefficient and the rule weight coefficient with the semantic matching degree index and the entity constraint matching degree index. The candidate set is sorted based on the comprehensive relevance score. Context information and rule entries with scores exceeding the preset relevance threshold and a number not exceeding the preset number of entries are selected from the sorting results to form the target context set and the target rule set. The target context set, target rule set, standard semantic input set, and preset large model hint strategy are structurally combined to generate the inference input set.

[0009] Optionally, the generation of the initial structured commands specifically includes: The inference input set is fed into the encoder of the improved T5 model. Through multi-layer attention and feedforward processing, a contextual semantic representation is generated and combined with the initial hidden state at the decoder to generate a basic hidden state sequence. The improved T5 model improves the decoder structure based on the original T5 model. This includes introducing a multi-branch generation substructure into the original autoregressive single-path generation structure of the decoder, setting a multi-world semantic simulation module after the multi-branch generation substructure, and replacing the fixed structure of the original decoder with a self-generated structure rewriting module. Using the basic hidden state sequence as input, multiple branch input sequences are generated by copying through a multi-branch generator substructure. Then, each branch input sequence is subjected to nonlinear transformation and attention calculation through multiple preset decoding parameters to generate intermediate sequences corresponding to multiple generator branches. Each intermediate sequence is input into the multi-world semantic simulation module, and the world state vector and command state vector are updated position by position. During the update process, branch scoring indicators, including semantic consistency score and command executability score, are calculated. Parallel simulation is performed on each sequence to obtain the multi-world semantic simulation results. Based on the results of multi-world semantic simulation, the branch scoring index is compared, and the target generation branch is selected according to the preset branch scoring threshold and the number of branches to be retained, and a set of target intermediate sequences is generated. The self-generated structure rewriting module receives the target intermediate sequence set, performs condition extraction and threshold comparison processing, generates a set of triggering conditions, and calculates the comprehensive triggering intensity based on the scoring conditions and divergence conditions. Based on the comprehensive trigger strength, the attention path, feedforward network path, and decoding path structure of the decoder are added, deleted, split, and recombined to obtain the updated composite decoding structure; In the updated composite decoding structure, autoregressive generation is performed on the intermediate sequences of each target to output the intent category, parameter slots and structured semantic fragments, and preliminary structured commands are generated according to preset format requirements and command mapping strategies.

[0010] Optionally, the generation of the standardized execution command specifically includes: The initial structured commands are input into the lightweight rule engine, which parses the command type, parameter name, and parameter value to generate command parsing results and retrieves parameter type constraint rules, parameter range constraint rules, resource dependency constraint rules, and permission constraint rules. Based on the command parsing results, type consistency verification is performed on each parameter value according to the corresponding parameter type constraint rules to generate a type verification result set. Perform parameter range constraint validation on the parameter values ​​that pass the type validation and their corresponding parameter range constraint rules, and generate a range validation result set; Based on the command parsing results, the resource identifiers recorded in the dependency resource constraint rules are compared with the current system resource status, and the role identifiers recorded in the permission constraint rules are compared with the permission identifiers of the current calling subject, generating a dependency resource verification result set and a permission verification result set. The result sets of type validation, range validation, dependency resource validation, and permission validation are taken as input. Constraint consistency is judged in the lightweight rule engine. When no failure flag is recorded in all validations, the command parsing result is restructured and fields are completed to generate a standardized execution command.

[0011] Optionally, the generation of the feedback data specifically includes: Standardized execution commands are sent to the system call interface for execution according to command type, and the execution results generated during the execution process are collected, parsed, and aggregated to generate an execution result dataset; The text fields, structured fields, and status fields in the execution result dataset are parsed and formatted. The parsed fields are then mapped and rearranged according to preset result format rules to generate a candidate structured result set. Based on the field values ​​in the candidate structured result set and the command type field, parameter key field, and parameter value field in the standardized execution command, the execution result verification process is performed to generate a consistency score. When the score reaches a preset consistency threshold, the candidate structured result set is determined as a structured result set. The structured result set is returned to the user interface, and the standardized execution command, execution result dataset, structured result set and consistency score are summarized to generate feedback data.

[0012] Optionally, the generation of the next round of standardized execution commands specifically includes: The feedback data is parsed and processed to extract standardized execution commands, execution result datasets, structured result sets and consistency scores, generating command sample sets, execution status label sets and consistency score sets; Based on the execution status label set and the consistency score set, statistical analysis is performed on the large model prompting strategy and command mapping strategy corresponding to each command sample to generate the strategy adjustment intensity. Based on the intensity of the strategy adjustment, the role-based prompting strategy, task-based prompting strategy, output format-based prompting strategy, and constraint-based prompting strategy in the large model prompting strategy are updated with weights, thresholds, and template additions and deletions to generate the updated large model prompting strategy. Based on the intensity of policy adjustment, weight updates, priority reordering, and rule addition / deletion processing are performed on the intent-to-command type mapping rules, slot-to-parameter field mapping rules, semantic structure-to-command format assembly rules, and instruction constraint verification rules in the command mapping policy to generate an updated command mapping policy. The inference input set is structured and assembled based on the updated large model hint strategy, and instructions are mapped based on the updated command mapping strategy to generate standardized execution commands corresponding to the structured semantic fragments in the next round.

[0013] According to an embodiment of the present invention, a command query processing system based on a large model includes: The natural language processing module is used to receive and process natural language commands input by the user and generate a standard semantic input set; The retrieval enhancement generation module is used to retrieve contextual information from the domain knowledge base and rule base based on the retrieval enhancement generation mechanism, and generate the large model inference input set by combining the standard semantic input set and the large model hint strategy; The model inference module is used to call the improved T5 model to perform semantic parsing and intent recognition on the large model inference input set, and generate preliminary structured commands based on the command mapping strategy. The executability verification module is used to perform executability constraint verification on preliminary structured commands based on the rule base and lightweight rule engine, and generate standardized execution commands. The execution result processing module is used to run standardized execution commands, obtain execution results, perform formatting and consistency verification, and generate feedback data. The strategy update module is used to dynamically update the large model hint strategy and command mapping strategy based on feedback data, and generate standardized execution commands for the next round of inference.

[0014] The beneficial effects of this invention are: This invention introduces a multi-branch substructure generation module, a multi-world semantic simulation module, and a self-generated structure rewriting module onto the traditional large-scale model architecture. This allows the decoder to move beyond a fixed generation path and dynamically adjust its decoding structure based on input semantic features and branch differences, significantly improving the stability of intent recognition and the rigor of the generated structure. Compared to existing single-path, static decoding methods, this invention can adaptively generate decoding structures that better conform to semantic logic in scenarios with complex commands, multiple entity dependencies, and mixed cross-domain contexts. This ensures more accurate and complete extraction of intent categories, parameter slots, and structured semantic fragments, reducing the probability of generation errors and interpretation ambiguities, and greatly improving the reliability of command parsing.

[0015] Meanwhile, this invention, through a dual-channel retrieval enhancement mechanism combining a domain knowledge base and a rule base, achieves joint modeling of contextual semantics and constraint rules, making the generation process more controllable and interpretable. After generating the initial structured commands, this invention further introduces multiple constraints such as execution type constraints, range constraints, resource dependencies, and permission checks from a lightweight rule engine, ensuring that standardized execution commands always meet the system's executable conditions. This avoids common problems in existing technologies, such as unexecutable generated results, out-of-bounds parameters, or missing key dependencies leading to execution failures. Furthermore, by constructing a comprehensive execution result consistency verification mechanism, this invention can quantitatively score candidate structured result sets and use a consistency threshold as the selection criterion, thereby improving the credibility and stability of the structured result output.

[0016] More importantly, this invention incorporates execution feedback data into the policy update process. Through continuous dynamic optimization of the prompting and command mapping strategies, a complete closed-loop adaptive system is constructed, enabling the self-calibration and evolution of large-scale model inference behavior. Compared to existing technologies that rely on manual maintenance of prompting and mapping rules, this invention can automatically adjust weights, add or delete templates, and rearrange rules based on actual execution performance, allowing the model to continuously enhance its adaptability to domain tasks during ongoing use. This mechanism not only reduces manual maintenance costs but also significantly improves the stability and performance of large-scale models in long-term deployments, enabling command parsing, verification, execution, and optimization to form a true interconnected closed loop, possessing a higher level of intelligence and engineering application value. In summary, this invention achieves a comprehensive technological improvement in terms of adjustable structure, controllable semantics, feasible verification, and usable feedback, demonstrating significant technological advancement and engineering application effects. Attached Figure Description

[0017] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a command query processing method based on a large model proposed in this invention; Figure 2 This is a schematic diagram of the improved T5 model structure for a command query processing method based on a large model proposed in this invention. Detailed Implementation

[0018] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0019] refer to Figure 1-2 A command query processing method based on a large model includes the following steps: It receives natural language commands input by users, performs word segmentation, syntactic analysis, entity extraction and normalization on the commands, and generates a standard semantic input set; The retrieval enhancement generation mechanism retrieves contextual information from the domain knowledge base and rule base, and generates a reasoning input set by combining the standard semantic input set and the preset large model hint strategy. The improved T5 model is invoked to perform semantic parsing and intent recognition on the inference input set, and preliminary structured commands are generated according to preset format requirements and command mapping strategies. Based on a rule base and a lightweight rule engine, the executable constraints of the initial structured commands are validated, and standardized execution commands are generated when the validation passes. Run standardized execution commands and obtain execution results; format and verify the consistency of the execution results; and generate feedback data. The large model prompting strategy and command mapping strategy are dynamically updated based on feedback data, and the next round of standardized execution commands are generated.

[0020] In this embodiment, the natural language commands include query requests, operation instructions, and task description statements.

[0021] In this embodiment, the generation of the inference input set specifically includes: Based on the standard semantic input set, extract the keyword set, entity set and semantic relation set, and concatenate them in a preset order, including arranging the keyword features, entity features and semantic relation features in sequence and synthesizing them into a continuous feature sequence to generate a unified feature representation; Using unified feature representation as query conditions, a text channel retrieval is performed in the domain knowledge base based on the retrieval enhancement generation mechanism to obtain a context candidate set, and a rule channel retrieval is performed in the rule base to obtain a rule candidate set. The context candidate set is determined by the semantic matching degree index and the keyword matching ratio, and the rule candidate set is determined by the entity matching coverage rate and the number of constraint condition matching. A comprehensive relevance score is calculated for each candidate in the context candidate set and the rule candidate set, and a candidate set with a score is generated. The comprehensive relevance score is obtained by linearly combining the semantic matching degree index and the entity constraint matching degree index with the semantic weight coefficient and the rule weight coefficient. The semantic matching degree index is used to characterize the degree of semantic matching between the standard semantic input set and the candidate options. The entity constraint matching degree index is calculated based on the entity matching coverage and the number of constraint condition matching, and is used to characterize the degree of matching between the key entities in the standard semantic input set and the key entities and constraint elements in the candidate options. The candidate set is sorted based on the comprehensive relevance score. Context information and rule entries with scores exceeding a preset relevance threshold and a number not exceeding a preset number of entries are selected from the sorting results to form a target context set and a target rule set. When the length of the target context set and the target rule set exceeds the maximum input length of the large model, the entries with the lowest scores are discarded in sequence to meet the length constraint. The target context set, target rule set, standard semantic input set, and preset large model hint strategy are structurally concatenated to generate the inference input set. The large model hint strategy is a set of structured hint rules based on the domain task, including role hint strategy, task hint strategy, output format hint strategy, and constraint hint strategy. It is formed by manual setting, sample optimization, and automatic generation from feedback data. The structured concatenation includes inserting system hint segments at the beginning, which are determined by the role hint strategy for model role settings and by the task hint strategy for inference task types. In the middle, context segments marked as domain knowledge and rule segments marked as rule constraints are inserted according to the source type. At the end, user command segments composed of the standard semantic input set are inserted.

[0022] In this embodiment, the generation of the preliminary structured commands specifically includes: The inference input set is fed into the encoder of the improved T5 model. Through multi-layer attention and feedforward processing, a contextual semantic representation is generated and combined with the initial hidden state at the decoder to generate a basic hidden state sequence. The improved T5 model improves the decoder structure based on the original T5 model. This includes introducing a multi-branch generation substructure into the original autoregressive single-path generation structure of the decoder, setting a multi-world semantic simulation module after the multi-branch generation substructure, and replacing the fixed structure of the original decoder with a self-generated structure rewriting module. The generation of the basic hidden state sequence specifically includes: feeding the inference input set into the multi-layer stacked structure of the improved T5 model encoder in sequence; in each encoding layer, performing self-attention processing on the input sequence to generate an attention output sequence; then performing feedforward network processing on the attention output sequence to generate a feedforward output sequence; and using residual connections and layer normalization between the self-attention processing and the feedforward network processing to normalize and superimpose the corresponding sequences, so that the encoded representations of each layer output are passed to the next encoder layer in the order of the encoding layers; after all encoding layers have been processed, the final context semantic representation is obtained; and the context semantic representation and the initial hidden state at the decoding end are concatenated at the sequence level according to a preset combination method to generate the basic hidden state sequence. Using the basic hidden state sequence as input, multiple branch input sequences are generated by copying through a multi-branch generator substructure. Then, each branch input sequence is subjected to nonlinear transformation and attention calculation through multiple preset decoding parameters to generate intermediate sequences corresponding to multiple generator branches. The generation of intermediate sequences corresponding to the multiple generation branches specifically includes: inputting the basic hidden state sequence into the multi-branch generation substructure; performing sequence-level replication on the basic hidden state sequence in the branch replication unit according to the preset number of branches to generate multiple branch input sequences; and sending each branch input sequence into the branch processing unit; in the branch processing unit, performing linear transformation, nonlinear activation processing, self-attention calculation, and residual connection and layer normalization processing sequentially on each branch input sequence according to preset multiple sets of decoding parameters to generate the corresponding branch processing sequence; and outputting each branch processing sequence as an intermediate sequence corresponding to the multiple generation branches after all branch processing sequences have been generated. Each intermediate sequence is input into the multi-world semantic simulation module, and the world state vector and command state vector are updated position by position. During the update process, branch scoring indicators, including semantic consistency score and command executability score, are calculated. Parallel simulation is performed on each sequence to obtain the multi-world semantic simulation results. The position-by-position update specifically includes: feeding each intermediate sequence into the state update unit of the multi-world semantic simulation module according to the sequence position; reading the branch feature vector of the current position at each position; performing linear transformation and nonlinear activation processing on the world state vector according to the preset update weight coefficient to generate the first update vector; performing linear transformation and attention weighting processing on the command state vector according to the preset command-related weight coefficient to generate the second update vector; performing residual superposition and layer normalization processing on the first update vector and the second update vector with the world state vector and command state vector of the previous position respectively to form the world state vector and command state vector of the current position; and outputting the updated two types of state vectors to the state update process of the next position. The calculation of the branch scoring index specifically includes: after completing the state update at each position, inputting the world state vector and command state vector corresponding to each intermediate sequence into the scoring calculation unit, performing a semantic similarity measurement on the world state vector to obtain a semantic consistency score, performing a conditional matching measurement on the command state vector to obtain a command executability score, and linearly weighting the semantic consistency score and the command executability score according to a preset branch scoring weight coefficient to form the corresponding branch scoring index. The parallel simulation specifically includes: inputting all intermediate sequences simultaneously into the parallel processing unit of the multi-world semantic simulation module, assigning an independent state update path to each intermediate sequence, performing position-by-position update and score calculation sequentially in each path, maintaining synchronous execution of the state update and score calculation process in all paths, outputting the corresponding world state vector set, command state vector set and branch score index set after all paths have been processed, and combining the data sets generated by each path to generate the multi-world semantic simulation result; Based on the results of multi-world semantic simulation, the branch scoring index is compared, and the target generation branch is selected according to the preset branch scoring threshold and the number of branches to be retained, and a set of target intermediate sequences is generated. The self-generated structure rewriting module receives the target intermediate sequence set, performs condition extraction and threshold comparison processing, generates a set of triggering conditions, and calculates the comprehensive triggering intensity based on the scoring conditions and divergence conditions. The generation of the trigger condition set specifically includes: inputting the target intermediate sequence set into the condition generation unit of the self-generated structure rewriting module, reading the branch scoring index and semantic difference index of each target intermediate sequence respectively, performing a scoring comparison on the branch scoring index according to a preset scoring threshold to generate scoring conditions, performing a difference comparison on the semantic difference index according to a preset divergence threshold to generate divergence conditions, and adding each scoring condition and each divergence condition to the trigger condition set in sequence. The semantic difference index is obtained by comparing the world state vectors corresponding to each generated branch pairwise, performing position-level difference calculation on the comparison results and weighting them according to preset difference weight coefficients. The calculation of the comprehensive trigger strength specifically includes: inputting the set of trigger conditions into the trigger calculation unit of the self-generated structure rewriting module; extracting the corresponding condition values ​​for the scoring conditions and the divergence conditions in the trigger calculation unit; performing linear weighting on the condition values ​​of the scoring conditions according to the preset first trigger weight coefficient to obtain the first trigger value; performing linear weighting on the condition values ​​of the divergence conditions according to the preset second trigger weight coefficient to obtain the second trigger value; and adding the first trigger value and the second trigger value together to form the comprehensive trigger strength. Based on the comprehensive trigger strength, the attention path, feedforward network path, and decoding path structure of the decoder are added, deleted, split, and recombined to obtain the updated composite decoding structure; The updated composite decoding structure is obtained by: inputting the comprehensive trigger strength into the structure adjustment unit of the self-generated structure rewriting module; performing path addition processing on the attention path of the decoder according to the triggering rules corresponding to the comprehensive trigger strength; performing path deletion processing on the attention path according to the preset deletion rules; performing path splitting processing on the decoding path structure according to the preset splitting rules; performing path recombining processing on the decoding path structure according to the preset recombining rules; and performing path adjustment processing on the feedforward network path according to the preset expansion and deletion rules. After all the path and path adjustments are completed, the path structure retained according to the adjustment rules, the adjusted attention path, and the feedforward network path are combined according to the structural arrangement order of the decoder to obtain the updated composite decoding structure. In the updated composite decoding structure, autoregressive generation is performed on the intermediate sequences of each target to output the intent category, parameter slots and structured semantic fragments, and preliminary structured commands are generated according to preset format requirements and command mapping strategies. The output of intent category, parameter slot, and structured semantic fragment specifically includes: inputting each target intermediate sequence into the updated composite decoding structure, performing autoregressive generation sequentially through the decoding path structure to obtain the output symbol sequence, performing label recognition processing on the output symbol sequence according to preset intent label rules to generate intent category, performing boundary determination and content extraction processing on the output symbol sequence according to preset slot boundary rules to generate parameter slot, performing structured recombination processing on the output symbol sequence according to preset semantic structure rules to generate structured semantic fragment, and outputting intent category, parameter slot, and structured semantic fragment as the generation result; Command mapping strategy is a set of structured mapping rules, including intent-to-command type mapping rules, slot-to-parameter field mapping rules, semantic structure-to-command format assembly rules, and instruction constraint verification rules. It is formed by manual setting, sample optimization, and automatic updates through feedback data.

[0023] In this embodiment, the generation of the standardized execution command specifically includes: The initial structured commands are input into the lightweight rule engine, which parses the command type, parameter name, and parameter value to generate command parsing results including command type field, parameter key field, and parameter value field, and retrieves parameter type constraint rules, parameter range constraint rules, resource dependency constraint rules, and permission constraint rules. Based on the command parsing results, type consistency verification is performed on each parameter value according to the corresponding parameter type constraint rules to generate a type verification result set. The type verification result set records the type verification pass and type verification fail flags for each parameter. Perform parameter range constraint verification on the parameter values ​​that pass the type verification and the corresponding parameter range constraint rules, and generate a range verification result set. The range verification result set records the range verification pass flag and the range verification fail flag for each parameter. Based on the command parsing results, the resource identifiers recorded in the dependency resource constraint rules are compared with the current system resource status, and the role identifiers recorded in the permission constraint rules are compared with the permission identifiers of the current calling subject. A dependency resource verification result set and a permission verification result set are generated. The dependency resource verification result set records the verification flags for whether the resource dependency is satisfied, and the permission verification result set records the verification flags for whether the permission conditions are satisfied. The result sets of type validation, range validation, dependency resource validation, and permission validation are taken as input. Constraint consistency is judged in the lightweight rule engine. When no failure flag is recorded in all validations, the command parsing result is restructured and fields are completed to generate a standardized execution command.

[0024] In this embodiment, the generation of the feedback data specifically includes: Standardized execution commands are sent to the system call interface for execution according to command type, and the execution results generated during the execution process are collected, parsed, and aggregated to generate an execution result dataset; The text fields, structured fields, and status fields in the execution result dataset are parsed and formatted. The parsed fields are then mapped and rearranged according to preset result format rules to generate a candidate structured result set. Based on the field values ​​in the candidate structured result set and the command type field, parameter key field, and parameter value field in the standardized execution command, the execution result verification process is performed to generate a consistency score. When the score reaches a preset consistency threshold, the candidate structured result set is determined as a structured result set. The result verification process includes calculating the matching degree index, status index, and anomaly index for the field matching degree, execution status reliability, and abnormal information degree, respectively. The matching degree index is multiplied by the matching weight coefficient, the status index is multiplied by the status weight coefficient, and the anomaly index is multiplied by the anomaly weight coefficient. The three products are then added to generate a consistency score. The structured result set is returned to the user interface, and the standardized execution command, execution result dataset, structured result set and consistency score are summarized to generate feedback data.

[0025] In this embodiment, the generation of the next round of standardized execution commands specifically includes: The feedback data is parsed and processed to extract standardized execution commands, execution result datasets, structured result sets and consistency scores, generating command sample sets, execution status label sets and consistency score sets; Based on the execution status label set and the consistency score set, statistical analysis is performed on the large model prompt strategy and command mapping strategy corresponding to each command sample to generate the strategy adjustment strength. The strategy adjustment strength is obtained by performing addition operations on the product of the prompt performance score and the prompt adjustment weight coefficient, and the product of the mapping performance score and the mapping adjustment weight coefficient. Based on the intensity of the strategy adjustment, the role-based prompting strategy, task-based prompting strategy, output format-based prompting strategy, and constraint-based prompting strategy in the large model prompting strategy are updated with weights, thresholds, and template additions and deletions to generate the updated large model prompting strategy. Based on the intensity of policy adjustment, weight updates, priority reordering, and rule addition / deletion processing are performed on the intent-to-command type mapping rules, slot-to-parameter field mapping rules, semantic structure-to-command format assembly rules, and instruction constraint verification rules in the command mapping policy to generate an updated command mapping policy. The inference input set is structured and assembled based on the updated large model hint strategy, and instructions are mapped based on the updated command mapping strategy to generate standardized execution commands corresponding to the structured semantic fragments in the next round.

[0026] A command query processing system based on a large model, comprising: The natural language processing module is used to receive and process natural language commands input by the user and generate a standard semantic input set; The retrieval enhancement generation module is used to retrieve contextual information from the domain knowledge base and rule base based on the retrieval enhancement generation mechanism, and generate the large model inference input set by combining the standard semantic input set and the large model hint strategy; The model inference module is used to call the improved T5 model to perform semantic parsing and intent recognition on the large model inference input set, and generate preliminary structured commands based on the command mapping strategy. The executability verification module is used to perform executability constraint verification on preliminary structured commands based on the rule base and lightweight rule engine, and generate standardized execution commands. The execution result processing module is used to run standardized execution commands, obtain execution results, perform formatting and consistency verification, and generate feedback data. The strategy update module is used to dynamically update the large model hint strategy and command mapping strategy based on feedback data, and generate standardized execution commands for the next round of inference. Example

[0027] To verify the feasibility of this invention in practice, it was applied to the intelligent query and task execution system of a large-scale government service platform. This platform has long relied on manual processing of users' natural language inquiries and operational commands. Due to the highly heterogeneous business rules, API calls, and approval processes across different departments, the system struggles to accurately understand users' natural language requests, frequently resulting in inaccurate intent recognition, incomplete parameter extraction, and inconsistent command mapping, leading to a high task execution failure rate. The command query processing method based on a large model proposed in this invention addresses the problem of the difficulty in automatically converting natural language commands into executable system commands and alleviates the issues of frequent manual intervention and unstable execution chains in existing technologies.

[0028] In this application scenario, when staff input cross-departmental business processing requests in natural language, this invention first performs word segmentation, syntactic analysis, and entity extraction on the input, processing it into a structured standard semantic input set. Subsequently, through a retrieval-enhanced generation mechanism, contextual information and business rules related to the semantic input are obtained from the knowledge base and rule base, and together with a preset large model prompting strategy, a large model inference input set is formed, enabling the system to perform inference within a complete semantic context. After receiving the inference input set, the improved T5 model sequentially performs semantic parsing, multi-branch generation, semantic simulation, and self-generated structure rewriting, obtaining the intent category, parameter slots, and structured semantic fragments from the output, and generating preliminary structured commands through a command mapping strategy.

[0029] The system sends the initial structured commands to a lightweight rule engine, where they are validated item by item against parameter type constraints, range constraints, resource dependency constraints, and permission constraints. Once all conditions are met, a standardized execution command is generated. The government platform receives this command and invokes internal interfaces to execute tasks, such as information queries, certificate status verification, or material submission, and sends the execution results back to the system. After field parsing, formatting, and consistency verification, the execution results are processed to obtain structured results, which are then aggregated with the command, execution result data, and consistency score to form feedback data.

[0030] Throughout the application process, feedback data is used to dynamically update the large model prompting strategy and command mapping strategy, enabling the system to continuously learn the platform's business logic, user expression habits, and implicit relationships between rules. After a period of actual operation, the platform has been able to reliably rely on this invention to complete the conversion of natural language into executable commands in multi-department collaborative scenarios, reducing the workload of manual semantic interpretation and parameter supplementation, and making the execution of complex instructions smoother. Staff observed that this invention can maintain high structured output quality even when dealing with fuzzy descriptions, cross-departmental chained tasks, and missing parameters, and continuously improves the accuracy of command generation and consistency verification capabilities with the accumulation of feedback.

[0031] This embodiment demonstrates that the present invention can effectively solve the problem of the difficulty in implementing natural language commands in real business environments. By improving the structure of the large model and the dynamic strategy update mechanism, it achieves highly adaptable and stable command parsing and execution support, providing a reliable foundation for the government service platform to continuously process large-scale natural language commands.

[0032] Table 1. Performance Comparison of the Invention and Traditional Command Query Processing Methods As can be clearly seen from Table 1, the method of the present invention is superior to the traditional method in many indicators.

[0033] In terms of intent recognition accuracy, the traditional method achieves 82.4%, while the method of this invention reaches 96.1%, an improvement of 13.7 percentage points. This improvement is mainly due to the improved T5 multi-branch generation structure adopted in this invention, which enables the model to select the generation sequence with a higher score from multiple candidate semantic paths. At the same time, the multi-world semantic simulation module performs parallel verification of semantic consistency and command executability, improving parsing stability and thus making the intent recognition results more accurate.

[0034] In terms of parameter extraction completeness, traditional methods achieve only 75.7%, while this invention reaches 94.8%, an improvement of 19.1 percentage points. This advantage stems from the structured semantic fragment generation mechanism, which explicitly outputs slot boundaries during the decoding stage and, combined with the slot-to-parameter field mapping rules of the command mapping strategy, makes parameter identification more complete. Furthermore, the self-generated structure rewriting module can automatically adjust the decoding path structure during multiple rounds of generation, ensuring that parameter extraction remains correct even under complex sentence structures.

[0035] Regarding command executability pass rate, the traditional method achieves an executability rate of 68.3%, while this invention reaches 93.5%, an improvement of 25.2 percentage points. This improvement stems from the lightweight rule engine of this invention, combined with a structured command generation process, which achieves full coverage verification of parameter types, parameter ranges, resource dependencies, and permission constraints. Furthermore, the consistency verification mechanism ensures a higher degree of matching between the model-generated commands and the execution environment, thereby significantly improving command executability.

[0036] Regarding end-to-end processing latency, traditional methods have an average latency of 920 milliseconds, while this invention reduces it to 460 milliseconds, a reduction of 460 milliseconds. This is because this invention uses structured concatenation to generate input, significantly reducing the length of invalid inference in the model. Simultaneously, multi-branch and multi-world simulations are processed in parallel, avoiding the latency accumulation caused by serial verification in traditional methods. The lightweight rule engine's decision time is also significantly lower than that of traditional large rule tree matching structures, resulting in a significant reduction in overall latency.

[0037] Regarding the success rate of multi-round tasks, the traditional method achieves 63.2%, while this invention reaches 90.4%, an improvement of 27.2 percentage points. This is due to the dynamic updating capability of the feedback data in this invention, which can use consistency scores, structured result sets, and execution status for the iteration of prompting strategies and command mapping strategies. This allows the model to gradually learn business logic in multi-round instruction chains, thereby improving the continuous execution capability of complex tasks.

[0038] Regarding error recovery success rate, the traditional method achieves 47.5%, while this invention reaches 85.7%, an improvement of 38.2 percentage points. The main reason is that this invention can locate semantic deviations through consistency scoring when execution fails and reconstruct commands using updated strategies, while the traditional method lacks semantic backtracking capabilities and is prone to continuous deviations on the error path.

[0039] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A command query processing method based on a large model, characterized in that, Includes the following steps: It receives natural language commands input by users, performs word segmentation, syntactic analysis, entity extraction and normalization on the commands, and generates a standard semantic input set; The retrieval enhancement generation mechanism retrieves contextual information from the domain knowledge base and rule base, and generates a reasoning input set by combining the standard semantic input set and the preset large model hint strategy. The improved T5 model is invoked to perform semantic parsing and intent recognition on the inference input set, and preliminary structured commands are generated according to preset format requirements and command mapping strategies. Based on a rule base and a lightweight rule engine, the executable constraints of the initial structured commands are validated, and standardized execution commands are generated when the validation passes. Run standardized execution commands and obtain execution results; format and verify the consistency of the execution results; and generate feedback data. The large model prompting strategy and command mapping strategy are dynamically updated based on feedback data, and the next round of standardized execution commands are generated.

2. The command query processing method based on a large model according to claim 1, characterized in that, The natural language commands include query requests, operation instructions, and task description statements.

3. The command query processing method based on a large model according to claim 1, characterized in that, The generation of the inference input set specifically includes: Based on the standard semantic input set, extract the keyword set, entity set and semantic relation set, and concatenate them in a preset order, including arranging the keyword features, entity features and semantic relation features in sequence and synthesizing them into a continuous feature sequence to generate a unified feature representation; Using unified feature representation as query conditions, a text channel retrieval is performed in the domain knowledge base based on the retrieval enhancement generation mechanism to obtain a context candidate set, and a rule channel retrieval is performed in the rule base to obtain a rule candidate set; A comprehensive relevance score is calculated for each candidate in the context candidate set and the rule candidate set, and a candidate set with a score is generated. The comprehensive relevance score is obtained by linearly combining the semantic weight coefficient and the rule weight coefficient with the semantic matching degree index and the entity constraint matching degree index. The candidate set is sorted based on the comprehensive relevance score. Context information and rule entries with scores exceeding the preset relevance threshold and a number not exceeding the preset number of entries are selected from the sorting results to form the target context set and the target rule set. The target context set, target rule set, standard semantic input set, and preset large model hint strategy are structurally combined to generate the inference input set.

4. The command query processing method based on a large model according to claim 1, characterized in that, The generation of the preliminary structured commands specifically includes: The inference input set is fed into the encoder of the improved T5 model. Through multi-layer attention and feedforward processing, a contextual semantic representation is generated and combined with the initial hidden state at the decoder to generate a basic hidden state sequence. The improved T5 model improves the decoder structure based on the original T5 model. This includes introducing a multi-branch generation substructure into the original autoregressive single-path generation structure of the decoder, setting a multi-world semantic simulation module after the multi-branch generation substructure, and replacing the fixed structure of the original decoder with a self-generated structure rewriting module. Using the basic hidden state sequence as input, multiple branch input sequences are generated by copying through a multi-branch generator substructure. Then, each branch input sequence is subjected to nonlinear transformation and attention calculation through multiple preset decoding parameters to generate intermediate sequences corresponding to multiple generator branches. Each intermediate sequence is input into the multi-world semantic simulation module, and the world state vector and command state vector are updated position by position. During the update process, branch scoring indicators, including semantic consistency score and command executability score, are calculated. Parallel simulation is performed on each sequence to obtain the multi-world semantic simulation results. Based on the results of multi-world semantic simulation, the branch scoring index is compared, and the target generation branch is selected according to the preset branch scoring threshold and the number of branches to be retained, and a set of target intermediate sequences is generated. The self-generated structure rewriting module receives the target intermediate sequence set, performs condition extraction and threshold comparison processing, generates a set of triggering conditions, and calculates the comprehensive triggering intensity based on the scoring conditions and divergence conditions. Based on the comprehensive trigger strength, the attention path, feedforward network path, and decoding path structure of the decoder are added, deleted, split, and recombined to obtain the updated composite decoding structure; In the updated composite decoding structure, autoregressive generation is performed on the intermediate sequences of each target to output the intent category, parameter slots and structured semantic fragments, and preliminary structured commands are generated according to preset format requirements and command mapping strategies.

5. The command query processing method based on a large model according to claim 1, characterized in that, The generation of the standardized execution command specifically includes: The initial structured commands are input into the lightweight rule engine, which parses the command type, parameter name, and parameter value to generate command parsing results and retrieves parameter type constraint rules, parameter range constraint rules, resource dependency constraint rules, and permission constraint rules. Based on the command parsing results, type consistency verification is performed on each parameter value according to the corresponding parameter type constraint rules to generate a type verification result set. Perform parameter range constraint validation on the parameter values ​​that pass the type validation and their corresponding parameter range constraint rules, and generate a range validation result set; Based on the command parsing results, the resource identifiers recorded in the dependency resource constraint rules are compared with the current system resource status, and the role identifiers recorded in the permission constraint rules are compared with the permission identifiers of the current calling subject, generating a dependency resource verification result set and a permission verification result set. The result sets of type validation, range validation, dependency resource validation, and permission validation are taken as input. Constraint consistency is judged in the lightweight rule engine. When no failure flag is recorded in all validations, the command parsing result is restructured and fields are completed to generate a standardized execution command.

6. The command query processing method based on a large model according to claim 1, characterized in that, The generation of the feedback data specifically includes: Standardized execution commands are sent to the system call interface for execution according to command type, and the execution results generated during the execution process are collected, parsed, and aggregated to generate an execution result dataset; The text fields, structured fields, and status fields in the execution result dataset are parsed and formatted. The parsed fields are then mapped and rearranged according to preset result format rules to generate a candidate structured result set. Based on the field values ​​in the candidate structured result set and the command type field, parameter key field, and parameter value field in the standardized execution command, the execution result verification process is performed to generate a consistency score. When the score reaches a preset consistency threshold, the candidate structured result set is determined as a structured result set. The structured result set is returned to the user interface, and the standardized execution command, execution result dataset, structured result set and consistency score are summarized to generate feedback data.

7. The command query processing method based on a large model according to claim 1, characterized in that, The generation of the next round of standardized execution commands specifically includes: The feedback data is parsed and processed to extract standardized execution commands, execution result datasets, structured result sets and consistency scores, generating command sample sets, execution status label sets and consistency score sets; Based on the execution status label set and the consistency score set, statistical analysis is performed on the large model prompting strategy and command mapping strategy corresponding to each command sample to generate the strategy adjustment intensity. Based on the intensity of the strategy adjustment, the role-based suggestion strategy, task-based suggestion strategy, output format suggestion strategy, and constraint suggestion strategy in the large model suggestion strategy are updated with weights, adjusted with thresholds, and have templates added or deleted to generate the updated large model suggestion strategy. Based on the intensity of policy adjustment, weight updates, priority reordering, and rule addition / deletion processing are performed on the intent-to-command type mapping rules, slot-to-parameter field mapping rules, semantic structure-to-command format assembly rules, and instruction constraint verification rules in the command mapping policy to generate an updated command mapping policy. Based on the updated large model hint strategy, a structured concatenation of the inference input set is constructed. Based on the updated command mapping strategy, instruction mapping is performed to generate standardized execution commands corresponding to the next round of structured semantic fragments.

8. A command query processing system based on a large model, executing the command query processing method based on a large model as described in any one of claims 1 to 7, characterized in that, include: The natural language processing module is used to receive and process natural language commands input by the user and generate a standard semantic input set; The retrieval enhancement generation module is used to retrieve contextual information from the domain knowledge base and rule base based on the retrieval enhancement generation mechanism, and generate the large model inference input set by combining the standard semantic input set and the large model hint strategy; The model inference module is used to call the improved T5 model to perform semantic parsing and intent recognition on the large model inference input set, and generate preliminary structured commands based on the command mapping strategy. The executability verification module is used to perform executability constraint verification on preliminary structured commands based on the rule base and lightweight rule engine, and generate standardized execution commands. The execution result processing module is used to run standardized execution commands, obtain execution results, perform formatting and consistency verification, and generate feedback data. The strategy update module is used to dynamically update the large model hint strategy and command mapping strategy based on feedback data, and generate standardized execution commands for the next round of inference.