Text processing method and system based on multi-modal feature fusion and storage medium

CN122713388BActive Publication Date: 2026-10-13SUZHOU SHENMA WUXIN INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202611223952.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-10-13
Estimated Expiration
2046-08-13

AI Technical Summary

Technical Problem

该方法虽实现了局部知识编辑和更新路径的智能分流,但其变化感知主要面向文本形式的文档变更,缺少对规则结构、表格等多模态特征进行深度融合分析的网络设计,无法全面表征规则变化的核心内容、变化类型及影响范围

Benefits of technology

[0066]本发明通过多模态特征融合中引入的稀疏约束机制与动态门控融合策略,有效解决了异构模态信息密度差异导致的数值型关键变化易被文本语义淹没的底层难题:在交叉注意力对齐过程中,针对表格特征向量数值型元素占比动态构建二值掩码并施加稀疏约束,能够强制保留税率调整、阈值修正等稀疏但决定性的数值特征的注意力响应,防止非数值型文本语义对注意力权重的稀释,使得融合后的多模态特征可精确标定变化的核心要素与量化偏离程度;在此基础上,通过文本梯度变化率、结构拓扑差异度和表格数值偏离度分别量化各模态的变化显著性并动态生成门控系数进行加权融合,确保融合特征的表达始终由实际发生显著变化的模态主导,进而使后续基于该融合特征计算的变化影响评分具备高区分度,为决策树增强神经网络输出模型参数编辑、高频知识库更新或外部API调用的三级差异化更新决策提供可靠依据,最终实现规则知识在频繁变动场景下从多模态精准感知到分级资源高效调度的全链路闭环优化。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122713388B_ABST
    Figure CN122713388B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of data updating, and particularly relates to a text processing method and system based on multi-modal feature fusion and a storage medium. The method acquires original and updating rule data, extracts text, structural graph and table feature vectors, calculates cross-modal attention weights in a multi-modal feature fusion network, and applies sparse constraints to the table modal to suppress the attention dilution of non-numeric information on numeric key changes. Based on the change significance of each modal, a gating coefficient is dynamically generated for weighted fusion, and multi-modal fusion features are output. According to the fusion features, the change type is identified and the rule change influence score is calculated. A decision tree enhanced neural network outputs a three-level decision result of model parameter updating, high-frequency knowledge base updating or external knowledge base updating according to the above, and performs multi-level LoRA fine-tuning or rank-one knowledge editing, mixed vector index construction and external API calling with attenuation cache respectively. The present application realizes accurate perception and efficient updating of rule knowledge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data updating, and in particular relates to a text processing method, system and storage medium based on multimodal feature fusion. Background Technology

[0002] In the realm of international trade, rule knowledge is characterized by high-frequency changes, diverse sources and heterogeneity, and wide-ranging impact. Large language models typically rely on full retraining or simple fine-tuning for knowledge updates, which suffers from high update costs and slow response times when faced with frequent changes in tariffs and control measures. Existing technologies attempt to improve this through multimodal processing, caching acceleration, and knowledge editing, but they still have significant limitations when dealing with the rapid, incremental updates to trade rules.

[0003] Patent application CN119862961A discloses a multimodal reasoning evolution system for knowledge data classification based on a deep model. It extracts and fuses multimodal features from heterogeneous multi-source data through a dynamic semantic memory network and a cross-modal collaborative classification enhancement module, and dynamically updates the memory content based on the correlation between new and old knowledge. While this scheme achieves the fusion of multimodal information and the dynamic evolution of knowledge, it primarily relies on a single memory network for knowledge updates. It lacks a hierarchical processing mechanism for knowledge of different importance and timeliness, and the update process is indiscriminate, easily leading to wasted computational resources. Furthermore, it lacks specific protective measures against catastrophic forgetting, making it difficult to guarantee model performance stability in frequent update scenarios.

[0004] Patent application CN121981251A discloses a multi-level caching and self-feedback-driven retrieval enhancement and reasoning acceleration system. It employs a three-level caching structure to store historical interactions with perfect matches, similar reasoning results, and hot knowledge from the knowledge base, accelerating reasoning by reusing cached data to reduce redundant computation. However, this three-level caching design focuses on reasoning acceleration rather than knowledge updating itself. It does not construct an update architecture that hierarchically edits and stores knowledge based on its importance, and it lacks the ability to fusion and perceive multimodal changes in rule text, structure, and tables. Therefore, it cannot accurately capture the multidimensional changes in trade rules to guide knowledge update decisions and fails to meet the high-timeliness and accuracy update requirements when rule content changes frequently.

[0005] Chinese patent CN120763272B discloses an adaptive update method for a large language model knowledge base that combines document and interactive feedback. It achieves precise updates to specific knowledge points through a two-way splitting of rank-one editing and incremental fine-tuning, and is equipped with verification and rollback mechanisms. While this method achieves intelligent splitting of local knowledge editing and update paths, its change perception is primarily focused on text-based document changes. It lacks a network design that deeply integrates and analyzes multimodal features such as rule structures and tables, and therefore cannot comprehensively represent the core content, change type, and scope of impact of rule changes. Furthermore, its anti-forgetting measures mainly rely on version management and rollback, lacking a proactive incremental learning protection mechanism that combines experience replay, knowledge distillation, and elastic weight merging. Faced with frequent and continuous updates of rule knowledge, the model's ability to retain existing knowledge is insufficient.

[0006] The existing technologies described above suffer from the following problems: While they improve knowledge updates from single dimensions such as multimodal dynamic evolution, multi-level caching acceleration, and knowledge editing diversion, none of them achieve the organic synergy of accurate perception of multimodal rule changes, hierarchical knowledge update execution driven by a three-level cache, and proactive incremental anti-forgetting mechanisms within a unified framework. Faced with the multiple challenges of update timeliness, resource efficiency, and model stability brought about by frequent changes in international trade rules, existing methods cannot simultaneously capture comprehensive multimodal change features such as text, structure, and tables to accurately quantify the impact of changes and guide hierarchical update strategies. They also cannot construct a three-level update architecture based on knowledge importance and timeliness, integrating parameter editing, high-frequency knowledge bases, and external knowledge bases to achieve an optimal balance between computational resources and response speed. Furthermore, they cannot proactively prevent catastrophic forgetting of key knowledge during continuous updates through methods such as experience replay, knowledge distillation, and elastic weight merging. Therefore, how to integrate accurate perception of rule changes through deep fusion of multimodal features, hierarchical knowledge update execution through three-level caching collaboration, and proactive knowledge consistency assurance during the update process constitutes a key technical problem urgently needing to be solved in this field. Summary of the Invention

[0007] To address the shortcomings of existing technologies, this invention proposes a text processing method, system, and storage medium based on multimodal feature fusion. This method acquires original and updated rule data, extracts text, structure graph, and table feature vectors, and in a multimodal feature fusion network, utilizes a cross-attention mechanism to calculate cross-modal attention weights. Sparse constraints are applied to the table modality to suppress the dilution of attention to numerical key changes by non-numerical information. Based on the saliency of changes in each modality, gate coefficients are dynamically generated and weighted to output multimodal fused features. The change type is identified based on the fused features, and the rule change impact score is calculated. A decision tree-enhanced neural network then outputs three-level decision results: model parameter update, high-frequency knowledge base update, or external knowledge base update. These results are used to perform multi-level LoRA fine-tuning or rank-one knowledge editing, hybrid vector index construction, and external API calls with decay caching, respectively. This invention solves the problem of key changes being easily submerged in multimodal heterogeneous information fusion, achieving accurate perception and hierarchical, efficient updating of rule knowledge.

[0008] To achieve the above objectives, the present invention provides the following technical solution:

[0009] Text processing methods based on multimodal feature fusion include:

[0010] The original rule data and updated rule data are obtained, and text features, structure graph features and table features are extracted respectively. The multimodal feature fusion network is used to align and fuse the features of each modality using a cross-attention mechanism to generate multimodal fused features.

[0011] Based on the multimodal fusion features, the change type of the rule change is identified, and the rule change impact score is calculated by weighted summation of rule range score, rule depth score, rule association score and usage frequency score;

[0012] The change level is determined based on the rule change impact score. The change level and the multimodal fusion feature are input together into the decision tree-enhanced neural network model, and the update method decision result is output. The update method includes model parameter update, high-frequency knowledge base update and external knowledge base update.

[0013] When the decision is to update the model parameters, perform either multi-level LoRA fine-tuning or ROME-based rank-one knowledge editing, wherein multi-level LoRA fine-tuning selectively adjusts the parameters of the affected layer according to the type of change, and stores the updated knowledge in the first-level cache.

[0014] When the decision is to update the high-frequency knowledge base, the update rule data is semantically and structurally segmented to generate knowledge blocks, a hybrid vector index is constructed and stored in the second-level cache;

[0015] When the decision is to update an external knowledge base, rule data is obtained through an external API and stored in the third-level cache using a decaying caching strategy.

[0016] Specifically, generating multimodal fusion features includes:

[0017] Modal parsing is performed on the original rule data and the updated rule data respectively to extract text feature vectors representing semantic continuity and context dependence, structural graph feature vectors representing topological constraints and dependent paths between nodes, and table feature vectors representing numerical precision and key-value correspondence under row and column alignment.

[0018] In the cross-attention mechanism, the text feature vector is used as the query vector, the structure graph feature vector is used as the first key vector and the first value vector to calculate the text-structure cross-modal attention weight matrix, and the table feature vector is used as the second key vector and the second value vector to calculate the text-table cross-modal attention weight matrix.

[0019] The proportion of numerical elements in the table feature vector is statistically analyzed. When the proportion is lower than a preset threshold, the table modality is determined to be a sparse modality. A sparsity constraint is applied to the text-table cross-modal attention weight matrix. The sparsity constraint constructs a binary mask matrix using the numerical labels of each element position in the table feature vector. The binary mask matrix is ​​multiplied element-wise with the text-table cross-modal attention weight matrix to retain the attention weights corresponding to the numerical elements and reset the attention weights corresponding to the non-numerical elements to zero.

[0020] Specifically, generating multimodal fusion features also includes:

[0021] The structure-aligned representation is obtained by weighting and summing the text-structure cross-modal attention weight matrix with the first value vector, and the table-aligned representation is obtained by weighting and summing the text-table cross-modal attention weight matrix after sparse constraints with the second value vector.

[0022] The structural alignment representation and the table alignment representation are respectively subjected to residual connection and layer normalization with the text feature vector to obtain structural fusion features and table fusion features;

[0023] The text change significance score, structure change significance score, and table change significance score are calculated based on the gradient change rate of the text feature vector, the topological difference of the structure graph feature vector, and the numerical deviation of the table feature vector, respectively.

[0024] The three significance scores of change are input into a normalized exponential function to generate text modality gating coefficients, structural modality gating coefficients, and table modality gating coefficients. The text feature vector, the structural fusion feature, and the table fusion feature are weighted and summed according to the text modality gating coefficients, the structural modality gating coefficients, and the table modality gating coefficients to output the multimodal fusion feature.

[0025] Specifically, changes in the calculation rules affect the scoring, including:

[0026] The multimodal fusion features are input into a change type classifier consisting of a first fully connected layer and a normalized exponential function. The first fully connected layer maps the multimodal fusion features into a classification vector with a dimension equal to the preset number of change types. The normalized exponential function calculates the probability value corresponding to each element in the classification vector. The preset change type corresponding to the maximum probability value is determined as the change type of the rule change. The preset change types include numerical revision, clause addition / deletion, condition change, and rule repeal.

[0027] Based on the change type, a matching query is performed in a pre-built type-weight mapping table to obtain the range weight coefficient, depth weight coefficient, association weight coefficient, and usage frequency weight coefficient corresponding to the change type. In the type-weight mapping table, the usage frequency weight coefficient corresponding to the numerical revision type is configured to be greater than its association weight coefficient, and the association weight coefficient corresponding to the clause addition / deletion type is configured to be greater than its usage frequency weight coefficient.

[0028] Specifically, the score for the impact of rule changes is calculated by a weighted sum of the rule scope score, rule depth score, rule association score, and usage frequency score, and also includes:

[0029] The multimodal fusion features are respectively input into the rule range feature extractor, rule depth feature extractor, rule association feature extractor and usage frequency feature extractor to obtain the rule range sub-feature vector, rule depth sub-feature vector, rule association feature vector and usage frequency sub-feature vector in sequence;

[0030] The rule range sub-feature vector is input into the second fully connected layer, and the rule range score, which represents the number of rule entries involved in the rule change, is output.

[0031] The rule depth sub-feature vector is input into the third fully connected layer, and the rule depth score, which represents the level depth of the rule change in the rule hierarchy tree, is output.

[0032] Specifically, the score for the impact of rule changes is calculated by a weighted sum of the rule scope score, rule depth score, rule association score, and usage frequency score, and also includes:

[0033] The rule-related sub-feature vector is input into the fourth fully connected layer, and the rule association score, which represents the number of association rules that have a reference dependency relationship with the change, is output.

[0034] The usage frequency sub-feature vector is input into the fifth fully connected layer, and the usage frequency score, which represents the total number of times the rule involved in the change is queried and invoked within a preset historical period, is output.

[0035] The rule range score is multiplied by the range weight coefficient, the rule depth score is multiplied by the depth weight coefficient, the rule association score is multiplied by the association weight coefficient, and the usage frequency score is multiplied by the usage frequency weight coefficient. The sum of the four products is used to obtain the rule change impact score.

[0036] Specifically, the output update method decision results include:

[0037] The rule change impact score is compared with a pre-defined level threshold range to determine the change level. The level threshold range includes a first threshold, a second threshold, and a third threshold. When the rule change impact score is greater than or equal to the first threshold, it is determined to be a first change level. When the rule change impact score is greater than or equal to the second threshold and less than the first threshold, it is determined to be a second change level. When the rule change impact score is greater than or equal to the third threshold and less than the second threshold, it is determined to be a third change level. When the rule change impact score is less than the third threshold, it is determined to be a fourth change level.

[0038] The change level is encoded as a one-hot vector, and the one-hot vector is concatenated with the multimodal fusion feature to obtain the decision input vector.

[0039] Specifically, the output update method decision results also include:

[0040] The decision input vector is input into a decision tree-enhanced neural network model, which includes decision tree layers and neural subnetwork layers.

[0041] In the decision tree layer, the change level is used as the branch condition to route the decision input vector to the branch path corresponding to the change level, and each branch path is set with an independent path weight matrix.

[0042] In the neural sub-network layer, after the decision input vector is linearly transformed using the path weight matrix, three original decision scores corresponding to model parameter updates, high-frequency knowledge base updates, and external knowledge base updates are output through activation functions and fully connected layers.

[0043] Specifically, the output update method decision results also include:

[0044] Obtain the storage occupancy rate of each cache in the current knowledge base, the amount of currently available graphics processor computing power resources, and the timestamp of the last update execution; calculate the update resource constraint vector based on the storage occupancy rate, computing power resources, and timestamp.

[0045] The updated resource constraint vector is weighted element-wise with the three original decision scores to obtain the modified decision score. The modified decision score is then input into a normalized exponential function to output the execution probability of each update method. The update method with the highest execution probability is determined as the decision result of the update method.

[0046] Specifically, performing rank-one knowledge editing based on multi-level LoRA fine-tuning or ROME includes:

[0047] Determine whether the change type belongs to numerical revision or rule repeal. If so, perform rank-one knowledge editing based on ROME. If the change type belongs to clause addition or deletion or condition change, perform fine-tuning based on multi-level LoRA.

[0048] When performing rank-one knowledge editing based on ROME, the target numerical entity and the original numerical value corresponding to the target numerical entity in the original rule data are extracted from the multimodal fusion features. The target numerical entity and the original numerical value are input into each feedforward layer of the pre-trained rule knowledge big language model. The target numerical entity is used as input and the original numerical value is used as output. The causal attribution score of each hidden state dimension in each feedforward layer to the original numerical value is calculated.

[0049] Specifically, performing rank-one knowledge editing based on multi-level LoRA fine-tuning or ROME also includes:

[0050] The feedforward layer containing the maximum causal attribution score is determined as the target editing layer, and the hidden state dimension interval corresponding to the maximum causal attribution score in the target editing layer is determined as the target neuron location.

[0051] The difference between the updated value of the target numerical entity in the update rule data and the original value is calculated. A rank-one update vector is generated based on the difference. The weight matrix corresponding to the position of the target neuron in the target editing layer is added element by element to the rank-one update vector to obtain the updated weight matrix, thus completing the rank-one knowledge editing.

[0052] Specifically, performing rank-one knowledge editing based on multi-level LoRA fine-tuning or ROME also includes:

[0053] When performing multi-level LoRA fine-tuning, a matching query is performed in the preset type-level mapping table according to the change type to obtain the set of affected layers corresponding to the change type. In the type-level mapping table, the set of affected layers corresponding to the clause addition / deletion type includes the self-attention layer and the feedforward layer, and the set of affected layers corresponding to the condition change type includes the feedforward layer.

[0054] In each layer contained in the affected layer set, a first low-rank decomposition matrix and a second low-rank decomposition matrix are inserted into the query projection matrix and value projection matrix of that layer, respectively;

[0055] Using the multimodal fusion features as fine-tuning input and the text feature vector corresponding to the update rule data as fine-tuning target, forward and backward propagation are performed on the first low-rank decomposition matrix and the second low-rank decomposition matrix to update the matrix element values ​​of the first low-rank decomposition matrix and the second low-rank decomposition matrix, and all model parameters outside the affected layer set are frozen.

[0056] Specifically, performing rank-one knowledge editing based on multi-level LoRA fine-tuning or ROME also includes:

[0057] The change type, the hierarchical identifier of the target editing layer, and the dimensional interval index of the target neuron location are used as the first knowledge update record, or the change type and the hierarchical identifier of each layer in the affected layer set are used as the second knowledge update record. The first knowledge update record or the second knowledge update record is associated with the updated model parameters and stored in the first-level cache. The first knowledge update record and the second knowledge update record are used to allow the rule knowledge big language model to query the edited model region when it is updated in the future within a preset time length, so as to adjust the search space of the causal attribution score.

[0058] Text processing systems based on multimodal feature fusion include:

[0059] The text processing module is configured to: acquire raw rule data and updated rule data, extract text features, structure graph features and table features respectively, and align and fuse the features of each modality through a multimodal feature fusion network using a cross-attention mechanism to generate multimodal fusion features;

[0060] The scoring module is configured to: identify the change type of rule change based on the multimodal fusion features, and calculate the rule change impact score by weighted summation of rule range score, rule depth score, rule association score and usage frequency score;

[0061] The multi-level caching decision module is configured to: determine the change level based on the rule change impact score, input the change level and the multimodal fusion feature into the decision tree-enhanced neural network model, and output the update method decision result, wherein the update method includes model parameter update, high-frequency knowledge base update and external knowledge base update;

[0062] When the decision is to update the model parameters, perform either multi-level LoRA fine-tuning or ROME-based rank-one knowledge editing, wherein multi-level LoRA fine-tuning selectively adjusts the parameters of the affected layer according to the type of change, and stores the updated knowledge in the first-level cache.

[0063] When the decision is to update the high-frequency knowledge base, the update rule data is semantically and structurally segmented to generate knowledge blocks, a hybrid vector index is constructed and stored in the second-level cache;

[0064] When the decision is to update an external knowledge base, rule data is obtained through an external API and stored in the third-level cache using a decaying caching strategy.

[0065] Compared with the prior art, the beneficial effects of the present invention are:

[0066] This invention effectively solves the underlying problem that key numerical changes caused by differences in information density across heterogeneous modalities are easily submerged by textual semantics by introducing a sparse constraint mechanism and a dynamic gating fusion strategy in multimodal feature fusion. During cross-attention alignment, a binary mask is dynamically constructed based on the proportion of numerical elements in the table feature vector, and sparse constraints are applied. This forces the retention of attention responses to sparse but crucial numerical features such as tax rate adjustments and threshold corrections, preventing the dilution of attention weights by non-numerical textual semantics. This allows the fused multimodal features to accurately identify the core elements of change and quantify the degree of deviation. Based on this... The method quantifies the significance of changes in each modality by measuring the text gradient change rate, structural topology difference, and table numerical deviation, and dynamically generates gating coefficients for weighted fusion. This ensures that the expression of the fused feature is always dominated by the modality that has actually undergone significant changes, thereby enabling the subsequent change impact score calculated based on the fused feature to have high discriminative power. This provides a reliable basis for the three-level differentiated update decision of decision tree augmented neural network output model parameter editing, high-frequency knowledge base updates, or external API calls. Ultimately, it realizes the end-to-end closed-loop optimization of rule knowledge from accurate multimodal perception to efficient hierarchical resource scheduling in frequently changing scenarios. Attached Figure Description

[0067] Figure 1 This is a flowchart of the text processing method based on multimodal feature fusion in Embodiment 1 of the present invention;

[0068] Figure 2 This is a logic diagram of the text processing method based on multimodal feature fusion in Embodiment 1 of the present invention;

[0069] Figure 3 A flowchart for generating multimodal fusion features is provided for Embodiment 2 of the present invention. Detailed Implementation

[0070] Example 1

[0071] Please see Figure 1 and Figure 2 The present invention provides an embodiment of a text processing method based on multimodal feature fusion, comprising:

[0072] S1. Obtain the original rule data and the updated rule data, extract text features, structure graph features and table features respectively, and use the cross-attention mechanism to align and fuse the features of each modality through a multimodal feature fusion network to generate multimodal fusion features;

[0073] S2. Based on the multimodal fusion features, identify the change type of the rule change, and calculate the rule change impact score by weighted summation of rule range score, rule depth score, rule association score and usage frequency score;

[0074] S3. Determine the change level based on the rule change impact score, input the change level and the multimodal fusion feature together into the decision tree-enhanced neural network model, and output the update method decision result. The update method includes model parameter update, high-frequency knowledge base update and external knowledge base update.

[0075] S4. When the decision is to update the model parameters, perform rank-one knowledge editing based on multi-level LoRA fine-tuning or ROME, wherein multi-level LoRA fine-tuning selectively adjusts the parameters of the affected layer according to the change type and stores the updated knowledge in the first-level cache.

[0076] S5. When the decision is to update the high-frequency knowledge base, the update rule data is semantically and structurally segmented to generate knowledge blocks, a hybrid vector index is constructed and stored in the second-level cache.

[0077] S6. When the decision is to update the external knowledge base, obtain the rule data through the external API and store it in the third-level cache with a decay caching strategy.

[0078] In this embodiment, the core of high-frequency knowledge base updates lies in transforming non-parametric rule changes into structured knowledge blocks and constructing a highly timely index. After the decision tree augmented neural network outputs a high-frequency knowledge base update decision, the system first performs structured parsing on the update rule data, identifying tags such as chapters, clauses, items, and headings to generate a rule hierarchy structure tree. Using leaf nodes as the basic unit, the system calculates the cosine similarity between the text feature vectors corresponding to adjacent leaf nodes and the structural correlation degree of whether the two nodes share a parent node. When the cosine similarity is greater than 0.7 and the structural correlation degree is greater than 0.5, adjacent leaf nodes are merged into an initial knowledge block. For tabular data containing, for example, a table of tariff rate adjustments for some imported goods, the system parses the table title, header, and data rows, combining each data row with its corresponding header information to generate a key-value pair table knowledge block, such as tariff code 01012100, commodity name improved breeding horse, and new tariff rate 5%. Each knowledge block is assigned a hybrid feature vector, which is composed of a 128-dimensional semantic vector obtained by principal component analysis of the text feature vector, a 3-dimensional structural vector consisting of a node level normalization value of 0.714, a parent node identifier MD5 hash normalization value of 0.843, and a sibling node number normalization value of 0.3, a 3-dimensional numerical vector consisting of a value of 25 normalized to 0.25, a unit percentage encoding of 2, and an upper limit threshold type encoding of 0, and a 5-dimensional keyword vector consisting of the term frequency-inverse document frequency values ​​of five keywords: import tariff, tax rate, ad valorem tax, most-favored-nation, and applicable tax rate. The total dimension is 139. These hybrid feature vectors are then used to construct a hierarchical navigable small world graph index. The system calculates the comprehensive cache value score of a knowledge block as 0.52 using a weighted formula based on the rule change impact score (1.20), usage frequency score (0.90), rule association score (0.60), and knowledge block storage size (3.17 kilobytes). When the storage occupancy rate of the second-level cache reaches the threshold of 80%, the system prioritizes eliminating knowledge blocks with lower comprehensive cache value scores to ensure the rapid retrieval of high-frequency and high-impact rule knowledge.

[0079] In this embodiment, the core of external knowledge base updates lies in acquiring authoritative data through an application programming interface (API) and establishing a dynamically decaying hot and cold tiered storage system. After receiving an external knowledge base update decision, the system first reads the data source identifier WCO_TARIC_v3 carried in the update rule data. Using underscores as delimiters, it splits the data to obtain the rule issuing organization code WCO and the interface version number TARIC_v3. Using this identifier as the key, it matches and queries the external API adaptation registry, reading the corresponding communication protocol type HTTPS_POST, authentication credential field name X-API-Key, authentication credential value a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6, request body template identifier TARIC_QUERY_TEMPLATE_v3, and response body parsing rule set identifier TARIC_RESPONSE_RULES_v3. The Unified Application Programming Interface (UAPI) request builder determines the request method to be the Hypertext Transfer Protocol (HTTP) POST method based on the communication protocol type HTTPS_POST. It loads a template file from the request body template library and fills in the commodity tariff code 01012100, the query date May 24, 2026, and the trade partner country code CN from the update rule data according to the placeholder positions. It then sends the request to the World Customs Organization (WCO) API server and receives the raw response data. The system loads the parsing rule file based on the response body parsing rule set identifier and extracts structured rule fields from the raw response data using JSON path expressions. These fields include the rule text adjusting the import tariff rate for improved breeding horses originating from country A to 5%, the effective date June 1, 2026, the numeric rule parameter 5%, and the rule identifier WCO_2026_CN_TARIFF_001. The multi-dimensional validation pipeline then performs three levels of validation sequentially: Format integrity validation reads the preset list of required fields and checks that the rule text, effective date, and rule identifier fields are not empty, passing the validation; Numerical range validation compares the numerical rule parameter 5% with its preset reasonable value range of 0% to 100%, and the value falls within the range, passing the validation; Cross-validation uses the rule identifier WCO_2026_CN_TARIFF_001 as the query key to query the existing rule field values ​​from the knowledge graph associated with the rule knowledge big language model. It finds that the existing text text is "The import tariff rate for improved breeding horses originating from country A is adjusted to 8%", and the existing tax rate is 8%, which is inconsistent with the tax rate of 5% in the structured rule field obtained this time. Furthermore, the current system time, May 24, 2026, is not within the preset change window of January 1st of each year associated with this rule identifier within 30 days, therefore a conflict exception flag is output.The exception handling process re-adds the application programming interface call request to the request queue and increments the retry count by 1. Since the retry count of 1 does not exceed the preset retry limit of 3, the exponential backoff waiting time formula is used: the base waiting time is 2000 milliseconds multiplied by 2 to the power of 0 equals 2000 milliseconds. After this waiting time, the request is resent. After the retry, the multi-dimensional verification pipeline does not output any exception markers. The system enters the cache decay parameter configuration stage, obtains the rule change impact score of 1.20 and the change type numerical revision obtained from the previous calculation as the joint query key, matches the interval of 1.0 to 1.5 where the rule change impact score of 1.20 is located and the sub-table corresponding to the change type numerical revision in the decay parameter mapping table, and reads the base lifetime value of 1800 seconds and the decay rate coefficient of 0.0005. The system performs an active invalidation operation on the existing cache entry in the third-level cache with the rule identifier WCO_2026_CN_TARIFF_001 as the index key, and deletes its index key from the index table of the third-level cache. The system then constructs a third-level cache storage object, which includes structured rule fields, a base lifetime value of 1800 seconds, a decay rate coefficient of 0.0005, the current system timestamp, and a rule identifier. The rule change impact score of 1.20 is compared with a preset hot data threshold of 0.8. Since 1.20 is greater than or equal to 0.8, the storage object is serialized and stored in the solid-state drive-based hot data storage layer. When this third-level cache storage object is queried and accessed at 14:30:00 on May 24, 2026, the system records the timestamp of this access and applies the decay formula: the base lifetime value of 1800 seconds multiplied by the negative decay rate coefficient of the natural constant e (0.0005) multiplied by the difference between the timestamp of this access and the timestamp of creation raised to the power of e (i.e., 1800 × e). -0.0005×(查询时间戳一创建时间戳) The system calculates the decayed current lifetime value to be 121.7 seconds, which is lower than the preset failure threshold of 300 seconds. The system marks the storage object as invalid and generates an asynchronous pre-update request based on the rule identifier WCO_2026_CN_TARIFF_001 and adds it to the pre-update request queue. The request is retrieved by an independent pre-update thread pool, and the complete process of calling the external application programming interface is re-executed. The returned update rule data is re-verified and overwritten into the third-level cache storage object to ensure the continuous timeliness of the cached data.

[0080] Example 2

[0081] Please see Figure 3 It should be further explained that, in this embodiment, generating multimodal fusion features includes:

[0082] S101. Modal parsing is performed on the original rule data and the updated rule data respectively to extract text feature vectors representing semantic continuity and context dependence, structural graph feature vectors representing topological constraints and dependent paths between nodes, and table feature vectors representing numerical precision and key-value correspondence under row and column alignment.

[0083] S102. In the cross-attention mechanism, the text feature vector is used as the query vector, the structure graph feature vector is used as the first key vector and the first value vector to calculate the text-structure cross-modal attention weight matrix, and the table feature vector is used as the second key vector and the second value vector to calculate the text-table cross-modal attention weight matrix.

[0084] S103. Calculate the proportion of numerical elements in the table feature vector. When the proportion is lower than a preset proportion threshold, determine that the table modality is a sparse modality. Apply a sparsity constraint to the text-table cross-modal attention weight matrix. The sparsity constraint constructs a binary mask matrix using the numerical labels of each element position in the table feature vector. Multiply the binary mask matrix element-by-element with the text-table cross-modal attention weight matrix to retain the attention weights corresponding to the numerical elements and reset the attention weights corresponding to the non-numerical elements to zero.

[0085] S104. The text-structure cross-modal attention weight matrix is ​​weighted and summed with the first value vector to obtain the structure-aligned representation, and the text-table cross-modal attention weight matrix after sparse constraint is weighted and summed with the second value vector to obtain the table-aligned representation;

[0086] S105. Perform residual connection and layer normalization processing on the structure alignment representation and the table alignment representation with the text feature vector respectively to obtain the structure fusion feature and the table fusion feature.

[0087] S106. Calculate the text change significance score, structure change significance score, and table change significance score based on the gradient change rate of the text feature vector, the topological difference degree of the structure graph feature vector, and the numerical deviation degree of the table feature vector, respectively.

[0088] S107. Input the three significance scores of change into the normalized exponential function to generate text modality gating coefficients, structural modality gating coefficients and table modality gating coefficients. Perform a weighted summation on the text feature vector, the structural fusion feature and the table fusion feature according to the text modality gating coefficient, the structural modality gating coefficient and the table modality gating coefficient, and output the multimodal fusion feature.

[0089] In this embodiment, the 2026 tariff adjustment plan released by the General Administration of Customs in January 2026 is used as the updated rule data, and the 2025 tariff implementation plan released in January 2025 is used as the original rule data. Both sets of data contain tariff adjustment clause texts expressed in natural language, chapter structure diagrams composed of clause numbers and citation relationships, and commodity tariff rate tables composed of commodity tariff codes as rows and tariff rate parameters as columns. These three types of modal information cover the three dimensions of text, structure, and tables. Next, a specific complete example will be used to illustrate the entire process. The example is only to illustrate the feasibility at the computational level and does not represent actual values. The specific values ​​can be determined by those skilled in the art through simulation experiments or physical experiments. Specific examples include:

[0090] The system performs modal parsing on both the original and updated rule data. Specifically, the system first reads the file format identifiers of the two datasets, identifying the portions with the .txt extension as text modality, the portions with the .graph extension as structure modality, and the portions with the .csv extension as table modality. For text modal parsing, the system uses a pre-trained Chinese BERT encoder with a 12-layer Transformer structure, a 768-dimensional hidden layer, and 12 multi-head attention heads. Each clause text is input into the encoder with a sentence beginning marker and a sentence ending marker. The system extracts the 768-dimensional vector corresponding to the sentence beginning marker position from the hidden state vector output by the last layer of the encoder. This vector is used as the text feature vector for that clause. This text feature vector represents the semantic continuity between words within the clause and the logical dependencies between the clause and its context clauses. A total of 256 text feature vectors are parsed from both the original and updated rule data. For the parsing of structural modalities, the system connects the reference relationships, membership relationships, and exception relationships between clauses with directed edges. The reference relationship edges are labeled as type 1, the membership relationship edges as type 2, and the exception relationship edges as type 3, constructing a directed acyclic graph (DAG) containing 256 nodes and 187 directed edges. This DAG is then input into a three-layer graph convolutional network. The first layer of the graph convolutional network has an input dimension of 256 and an output dimension of 512, the second layer has an input dimension of 512 and an output dimension of 512, and the third layer has an input dimension of 512 and an output dimension of 512. The output vector of each node in the third layer is taken as the structural graph feature vector of the clause corresponding to that node. This structural graph feature vector represents the topological position of the node in the rule hierarchy and the length and direction of the dependency path between it and other nodes. The original rule data and the updated rule data each generate 256 512-dimensional structural graph feature vectors. For parsing the table modality, the system traverses the commodity tax rate table row by row, using the content of the tariff code column cell in each row as the row identifier key. All numeric cell content from the third column onwards in that row, such as import tariff rates, value-added tax rates, and consumption tax rates, are extracted as floating-point numerical feature elements. Non-numeric cell content, such as column headers and notes, is converted into 64-dimensional embedding vectors through a lightweight text embedding layer and used as non-numeric feature elements. The numerical feature elements and 64-dimensional embedding vectors are concatenated and arranged according to the original column order of the table to form the table feature vector for that row. The row identifier key is stored separately as an index mapping table. All table feature vectors from all rows are stacked in row order to form a two-dimensional matrix, and then flattened into a 1024-dimensional table feature vector. The flattened table feature vector maintains the same row and column alignment. The original rule data and the updated rule data each generate a 1024-dimensional table feature vector.In this embodiment, the original rule data table feature vector obtained by parsing contains a total of 156 numerical elements and a total of 868 non-numerical embedding vectors. The proportion of numerical elements to the total dimension of 1024 of the table feature vector is 0.152, and this proportion will be used for subsequent sparsity determination.

[0091] The system performs the calculation of two sets of cross-modal attention weight matrices in the cross-attention mechanism. Specifically, the system first projects the text feature vector of the updated rule data through a linear projection layer. The weight matrix of the linear projection layer has a size of 768 rows and 64 columns, resulting in a 64-dimensional query vector. This query vector is then split into 8-head segments under the multi-head attention mechanism, with each attention head assigned an 8-dimensional query sub-vector. The structure graph feature vector of the original rule data is projected through two independent linear projection layers. The weight matrix of the first linear projection layer has a size of 512 rows and 64 columns, resulting in a 64-dimensional first key vector. The weight matrix of the second linear projection layer also has a size of 512 rows and 64 columns, resulting in a 64-dimensional first value vector. This first value vector is also split into 8-head segments, with each segment consisting of an 8-dimensional first key sub-vector and a first value sub-vector. Taking the first attention head as an example, the dot product of the 8-dimensional query sub-vector and each 8-dimensional first key sub-vector is calculated. The dot product result is divided by the scaling factor 2.828, which is the square root of 8, to obtain the original attention score of each node in the structure of the text under this head. The weight of the first attention head is obtained by taking the normalized exponential function of the original attention score. The weights of the first attention heads of the 8 attention heads are concatenated in the dimensional direction to obtain the text-structure cross-modal attention weight matrix. The size of this matrix is ​​256 rows and 256 columns. The element value of the i-th row and j-th column of the matrix represents the attention weight of the i-th clause text in the update rule data to the j-th structural node in the original rule data. The system uses the exact same computational process to project the original rule data's table feature vector into a 64-dimensional second key vector and a 64-dimensional second value vector through two linear projection layers. After splitting by the number of heads (8), the system calculates the dot product, scaling, and normalized exponential function with the same query vector to obtain a text-table cross-modal attention weight matrix. This matrix has a size of 256 rows and 1024 columns. The element value in the i-th row and k-th column of the matrix represents the attention weight of the i-th clause text in the updated rule data to the k-th element in the original rule data table feature vector. In this embodiment, the weight matrices of both sets of linear projection layers are randomly initialized using a normal distribution with a mean of 0 and a standard deviation of 0.02.

[0092] The system determines the sparsity of the table feature vector and applies attention sparsity constraints accordingly. Specifically, the system reads the binary label vector corresponding to the feature vector of the original rule data table generated in S101. The length of the binary label vector is 1024, of which 156 positions corresponding to numerical elements are labeled as 1 and 868 positions corresponding to non-numerical embedding vectors are labeled as 0. The system calculates the number of elements labeled as 1 (156) divided by the total length (1024) to obtain the proportion of numerical elements as 0.152. The system reads a preset ratio threshold of 0.3. This threshold was determined as follows: 500 samples of real trade rule tables were collected from publicly available data from the General Administration of Customs of China, the EU's TARIC tariff database, and the Japan Customs Association's tariff tables. The ratio of numeric cells to the total number of cells in each table was calculated. The ratio of the 500 samples ranged from 0.05 to 0.72, with a mean of 0.35. Considering that in tables where the proportion of numeric elements is less than 0.3, text descriptions and titles dominate and the numeric information is sparsely distributed, the system sets 0.3 as the empirical boundary for distinguishing between sparse and dense modes. Since 0.152 is less than 0.3, the system determines that the table mode is sparse. The system constructs a binary mask matrix based on a binary labeled vector. The construction method is as follows: the binary labeled vector is copied 256 times along the row direction, generating a 256-row, 1024-column binary mask matrix. In this matrix, all row elements corresponding to columns marked as 1 in the original binary labeled vector are 1, and all row elements corresponding to columns marked as 0 are 0. The system performs element-wise multiplication of the text-table cross-modal attention weight matrix calculated in S102 with the binary mask matrix. After multiplication, the attention weight values ​​corresponding to the 156 columns of the table feature vector's numerical elements remain unchanged, while the attention weight values ​​corresponding to the 868 columns of the non-numerical embedding vectors all become zero, thus achieving zeroing suppression of the attention response to non-numerical feature elements. In this embodiment, if the input table is a non-sparse modal table with a numerical element ratio exceeding 0.3, the sparsity constraint operation is skipped, and the original text-table cross-modal attention weight matrix output in S102 is directly used for subsequent operations.

[0093] The system generates both structure-aligned and table-aligned representations. Specifically, the system uses the text-structure cross-modal attention weight matrix output in S102 as weights, and the 8-head concatenation result of the first value vector projected in S102 as the weighted vector. A weighted summation operation is performed on each row; that is, for the 256 nodes of the structure graph feature vector, the value vector of each node is weighted according to its corresponding text-structure attention weight and then summed to obtain a structure-aligned representation with the same dimension as the text feature vector, which is 768. Similarly, the system uses the text-table cross-modal attention weight matrix processed with sparse constraints in S103 as weights, and the 8-head concatenation result of the second value vector projected in S102 as the weighted vector. A weighted summation operation is performed on each row to obtain a table-aligned representation with the same dimension as the text feature vector, also with a dimension of 768. In this embodiment, the value vector with a larger weight in the structure-aligned representation corresponds to the structure node most closely related to the updated text clause reference, and the value vector with a larger weight in the table-aligned representation corresponds to the numerical tax rate parameter most closely related to the updated text clause.

[0094] The system performs residual connections and layer normalization on the structure alignment representation and table alignment representation respectively. Specifically, for the structure fusion feature, the system reads the structure alignment representation generated by S104 and the text feature vector of the update rule data generated by S101. Both have a dimension of 768. The system performs element-wise addition and calculates the mean of the 768 dimensions of the sum as a set of data. The mean is calculated by dividing the sum of the data by 768. The variance is calculated by dividing the sum of the squares of each element of the data by the mean by 768. The system then divides each element by the mean and the square root of the sum of the variance and the smoothing factor 0.00001 to obtain the normalized value. This normalized value is then multiplied by a learnable scaling parameter of 1.0 and a learnable offset parameter of 0.0. The scaling parameter and offset parameter are updated during training through gradient backpropagation, with initial values ​​of 1.0 and 0.0 respectively. The output is a structure fusion feature with a dimension of 768. For table fusion features, the system employs the exact same operational procedure: element-wise addition of the table alignment representation generated in S104 with the text feature vector of the update rule data, calculation of the mean and variance, layer normalization, and output of table fusion features with dimension 768. In this embodiment, residual connections ensure that the original text semantics of the update rule data are preserved through an explicit addition path after fusion. Layer normalization normalizes the feature vectors from two different sources—the structural alignment representation and the table alignment representation—to the same numerical distribution space with a mean of 0 and a variance of 1, eliminating gating fusion bias caused by the difference in the magnitude of the two modal features.

[0095] The system calculates the significance score of changes in each of the three modalities. Specifically, the system reads the text feature vectors of the original rule data and the updated rule data, respectively, and inputs the two text feature vectors into the BERT encoder used in S101 for one forward propagation. During the forward propagation, the gradient values ​​of the encoder's output at each layer with respect to the two input feature vectors are recorded. The gradient value vector of the last layer of the encoder is taken, and the L2 norm of the difference between the two gradient value vectors is calculated, which is the square root of the sum of the squares of the differences in each dimension. The gradient change rate is 0.12, which is used as the significance score of text change. The numerical range of this score has no upper limit but has a lower limit of 0, which means that the gradient responses of the two text feature vectors in the encoder are completely consistent. The system reads the feature vectors of the structure graph from the original rule data and the structure graph from the updated rule data. It inputs the two directed acyclic graphs into a graph edit distance calculation function. The function outputs the minimum number of edit operations required to convert the original structure graph into the updated structure graph. Edit operation types include node addition, node deletion, edge addition, edge deletion, and edge remarking. In this calculation, the minimum number of edit operations is 5. The total number of nodes in the structure graph is 256. Dividing 5 by 256 yields a normalized topological dissimilarity score of 0.0195, which serves as the score for the significance of the structural change. This score ranges from 0 to 1, where 0 indicates that the two graphs have completely identical structures. The system reads the table feature vectors of the original rule data and the updated rule data. It extracts the values ​​of 156 numerical elements from the original rule data table feature vector and the values ​​of 156 numerical elements corresponding to the same index position from the updated rule data table feature vector. For each pair of values, a relative deviation rate is calculated. The formula is the absolute value of the difference between the updated rule data value and the original rule data value, divided by the absolute value of the original rule data value. When the original rule data value is zero, the absolute value of the updated rule data value is used. The 156 relative deviation rates range from 0.05, 0.08, 0.12 to 0.93. The average relative deviation rate is 0.67, obtained by summing the 156 relative deviation rates and dividing by 156. This average relative deviation rate serves as a score for the significance of table changes. The score ranges from 0 to positive infinity, where 0 indicates that all numerical elements have not changed. In this embodiment, the three scores quantify the degree of semantic change in the text modality, the degree of topological change in the structural modality, and the degree of numerical change in the table modality, respectively, providing a numerical basis for the subsequent dynamic allocation of gating coefficients.

[0096] The system generates modal gating coefficients based on three change significance scores and performs weighted fusion to output multimodal fusion features. Specifically, the system combines the text change significance score (0.12), structural change significance score (0.0195), and table change significance score (0.67) calculated by S106 into a three-dimensional input vector [0.12, 0.0195, 0.67]. This three-dimensional input vector is then input into a normalized exponential function. The calculation process of the normalized exponential function is as follows: the power value with the natural constant e as the base and 0.12 as the exponent is approximately 1.127. The power value with a power of 0.0195 is approximately 1.020, and the power value with a power of 0.67 is approximately 1.954. The sum of the three powers is 1.127 + 1.020 + 1.954 = 4.101. Normalizing each power value by dividing it by 4.101, we get the text modality gating coefficient as 1.127 ÷ 4.101 = 0.275, the structural modality gating coefficient as 1.020 ÷ 4.101 = 0.249, and the table modality gating coefficient as 1.954 ÷ 4.101 = 0.476. The sum of the three gating coefficients is 1.000. The system reads the update rule data text feature vector generated by S101, which has a dimension of 768; the structure fusion feature vector generated by S105, which has a dimension of 768; and the table fusion feature vector, which has a dimension of 768. The system multiplies the text modality gate coefficient 0.275 with each of the 768 dimensions of the text feature vector; the system multiplies the structure modality gate coefficient 0.249 with each of the 768 dimensions of the structure fusion feature vector; and the system multiplies the table modality gate coefficient 0.476 with each of the 768 dimensions of the table fusion feature vector. The three weighted 768-dimensional vectors are then summed element-wise according to their corresponding dimension positions to output the final 768-dimensional multimodal fusion feature. In this embodiment, since the table change significance score of 0.67 is significantly higher than the text change significance score of 0.12 and the structural change significance score of 0.0195, the normalized exponential function automatically assigns the largest gating coefficient of 0.476 to the table modality. This ensures that the multimodal fusion feature is primarily expressed by the table numerical deviation information at the numerical level, with text semantic changes and structural topological changes as auxiliary expressions. As a result, when the fusion feature is used to calculate the subsequent change influence score, it ensures that the influence score has high discriminative power for numerical key changes.

[0097] It should be further explained that, in this embodiment, changes in the calculation rules affect the score, including:

[0098] S201. Input the multimodal fusion feature into a change type classifier composed of a first fully connected layer and a normalized exponential function. Map the multimodal fusion feature into a classification vector with a dimension equal to the number of preset change types through the first fully connected layer. Calculate the probability value corresponding to each element in the classification vector through the normalized exponential function. Determine the preset change type corresponding to the maximum probability value as the change type of the rule change. The preset change types include numerical revision, clause addition / deletion, condition change, and rule repeal.

[0099] S202. Based on the change type, perform a matching query in the pre-built type-weight mapping table to obtain the range weight coefficient, depth weight coefficient, association weight coefficient, and usage frequency weight coefficient corresponding to the change type. In the type-weight mapping table, the usage frequency weight coefficient corresponding to the numerical revision type is configured to be greater than its association weight coefficient, and the association weight coefficient corresponding to the clause addition / deletion type is configured to be greater than its usage frequency weight coefficient.

[0100] S203. Input the multimodal fusion features into the rule range feature extractor, rule depth feature extractor, rule association feature extractor and usage frequency feature extractor respectively to obtain the rule range sub-feature vector, rule depth sub-feature vector, rule association feature vector and usage frequency sub-feature vector in sequence;

[0101] S204. Input the rule range sub-feature vector into the second fully connected layer and output the rule range score, which represents the number of rule entries involved in the rule change.

[0102] S205. Input the rule depth sub-feature vector into the third fully connected layer and output the rule depth score, which represents the level depth of the rule change in the rule hierarchy tree.

[0103] S206. Input the rule association sub-feature vector into the fourth fully connected layer and output the rule association score, which represents the number of association rules that have a reference dependency relationship with the change.

[0104] S207. Input the usage frequency sub-feature vector into the fifth fully connected layer, and output the usage frequency score representing the total number of times the rule involved in the change was queried within a preset historical period. In this embodiment, the preset historical period is set based on the periodic characteristics of international trade rule query business and the statistical analysis results of system query logs. The system sets the preset historical period to 365 calendar days. The reason for this setting is as follows: International trade rules, especially tariff adjustment schemes, are usually revised and published on an annual cycle. The World Customs Organization and the customs administrations of various countries concentrate on the implementation of new rules around January 1st each year. The peak query times of corporate compliance departments and customs brokers are concentrated within 30 calendar days before and after the rule takes effect. Therefore, a complete annual cycle can cover all query stages from the release and implementation of the rule to its daily application. The system extracts the timestamps of all query records from the query log database in seconds, groups them by rule identifier, and counts the total number of query calls for each rule in the most recent 365 calendar days as training labels for the usage frequency feature extractor. In implementation, the system uses the current system time of 13:00:00 on May 24, 2026 as the base time, and goes back 365 calendar days to 13:00:00 on May 24, 2025. The query counts corresponding to the rule identifiers during this period are accumulated to obtain the usage frequency score of the rule, which is 0.90. This score indicates that the query frequency of this rule in the past 365 calendar days is in the top 10% of the entire rule database.

[0105] S208. Multiply the rule range score by the range weight coefficient, the rule depth score by the depth weight coefficient, the rule association score by the association weight coefficient, and the usage frequency score by the usage frequency weight coefficient, and sum the four product results to obtain the rule change impact score.

[0106] As a concrete example, the following is a complete computational example illustrating the entire process. This example is only for demonstrating computational feasibility and does not represent actual values. Specific values ​​can be determined through simulation or physical experiments conducted by those skilled in the art. In this embodiment, the system inputs 768-dimensional multimodal fusion features into a variation type classifier. Specifically, this variation type classifier consists of a first fully connected layer and a normalized exponential function layer connected in series. The first fully connected layer internally stores a weight matrix and a bias vector. The weight matrix is ​​a 768-row, 4-column two-dimensional floating-point array with a total of 3072 elements. The bias vector is a 4-dimensional floating-point array, with four bias values ​​corresponding to the four output dimensions: numerical revision, clause addition / deletion, condition change, and rule repeal. The 3072 initial values ​​of the weight matrix are filled with normally distributed random numbers with a mean of 0 and a standard deviation of 0.02, and the four initial values ​​of the bias vector are all filled with 0. The first fully connected layer receives a 768-dimensional input vector and performs matrix multiplication. It multiplies the input vector as a 1x768 matrix with a 768x4 weight matrix, resulting in a 1x4 intermediate vector. This intermediate vector is then element-wise added to the bias vector, outputting a 4-dimensional classification vector. The original values ​​of each dimension of this 4-dimensional classification vector in this calculation are 3.42, 0.85, 0.53, and -0.21, respectively. The system then inputs this 4-dimensional classification vector into a normalized exponential function layer. This layer uses the natural constant e ≈ 2.71828 as the base to calculate the power of the first dimension value 3.42 of the 4-dimensional classification vector, resulting in 2.71828. 3.42 =30.57, the power of the second dimension value 0.85 is 2.71828. 0.85 =2.34, the power of the third dimension value 0.53 is 2.71828. 0.53 =1.70, the exponent of the fourth dimension value -0.21 is 2.71828. -0.21=0.81. Adding 30.57 + 2.34 + 1.70 + 0.81 yields a sum of exponents of 35.42. The probability corresponding to the numerical revision type is 30.57 ÷ 35.42 = 0.863, the probability corresponding to the clause addition / deletion type is 2.34 ÷ 35.42 = 0.066, the probability corresponding to the condition change type is 1.70 ÷ 35.42 = 0.048, and the probability corresponding to the rule repeal type is 0.81 ÷ 35.42 = 0.023. The sum of the four probability values ​​is 1.000. The system iterates through the four probability values, initializes the current maximum value variable to 0, and compares it sequentially with 0.863, 0.066, 0.048, and 0.023. The maximum value is then updated to 0.863, corresponding to index 0, which is the numerical revision type. The numerical revision is thus determined as the type of change for this instance. The classifier underwent supervised training before deployment. The training set contained 5000 samples with change type labels. Each sample's label was a one-hot encoded form, with numerical revisions corresponding to [1,0,0,0], clause additions / deletions to [0,1,0,0], condition changes to [0,0,1,0], and rule obsolescence to [0,0,0,1]. The classifier used a cross-entropy loss function and the Adam optimizer, with a learning rate of 0.001, a batch size of 32, and 50 training epochs. The early stopping condition was that the validation loss did not decrease for 5 consecutive epochs. After training, the classification accuracy on the test set was 0.94.

[0107] The system uses the output change type enumeration value "numerical revision" as the query key to look up the four weight coefficients of the corresponding row in the type-weight mapping table. Specifically, the type-weight mapping table is a hard-coded lookup table data structure containing 4 rows and 4 columns. The first row stores the range weight coefficient (0.2), depth weight coefficient (0.1), association weight coefficient (0.2), and usage frequency weight coefficient (0.5) corresponding to the numerical revision type. The second row stores the weight coefficients (0.3, 0.2, 0.4, and 0.1) corresponding to the clause addition / deletion type. The third row stores the weight coefficients (0.3, 0.2, 0.3, and 0.2) corresponding to the condition change type. The fourth row stores the weight coefficients (0.4, 0.2, 0.3, and 0.1) corresponding to the rule obsolescence type. The mapping table was constructed as follows: 200 real rule change cases were collected from publicly available tariff adjustment announcements from the General Administration of Customs of China, notices of changes in trade control measures from the Ministry of Commerce, and notifications of revisions to World Trade Organization rules. Each case included one rule change record and a ranking of the update priorities triggered by the change in the business system. Two or more international trade compliance experts independently ranked the update urgency based on the actual impact of the change on three business lines: tariff calculation, license approval, and quota management. The Spearman rank correlation coefficient of the average expert rankings of the 200 cases was used as the optimization objective. A grid search was used with a search step size of 0.05 to traverse all 160,000 combinations of the four weight coefficients in the range of 0 to 1. The combination corresponding to the maximum Spearman rank correlation coefficient of 0.89 was selected as the final weight configuration. The system stored the four values—range weight coefficient (0.2), depth weight coefficient (0.1), association weight coefficient (0.2), and usage frequency weight coefficient (0.5)—into four temporary floating-point variables.

[0108] The system inputs the same 768-dimensional multimodal fusion feature into four feature extractors in parallel. Specifically: The rule range feature extractor internally stores a one-dimensional floating-point weight array of length 768. The 768 initial values ​​of this array are filled with normally distributed random numbers with a mean of 0 and a standard deviation of 0.02. During the training phase, the number of actual rule clauses involved is used as the regression label. The weights are updated using the mean squared error loss function and a stochastic gradient descent optimizer with a learning rate of 0.01. After 500 training epochs, the system converges. The 768-dimensional multimodal fusion feature is then multiplied with the weight array, and the summation of each element-wise results in a scalar value of 2.8, which serves as the rule range sub-feature vector. The rule depth feature extractor stores another one-dimensional floating-point weight array of length 768, initialized in the same way. During the training phase, the normalized value of the rule's level depth divided by the maximum tree depth of 4 is used as the regression label. After training, the dot product outputs a scalar value of 0.7, which serves as the rule depth sub-feature vector. The rule association feature extractor stores a third one-dimensional floating-point weight array of length 768. The training label is the natural logarithm of the number of association rules divided by the natural logarithm of the largest number of association rules among all rules. The dot product output is a scalar value of 0.6, which serves as the rule association sub-feature vector. The frequency feature extractor stores a fourth one-dimensional floating-point weight array of length 768. The training label is the total number of query calls within the last 365 calendar days divided by the largest total number of query calls among all rules. The dot product output is a scalar value of 0.9, which serves as the usage frequency sub-feature vector. The four feature extractors update their weight arrays independently during training and do not share parameters.

[0109] The system inputs the rule range sub-feature vector value of 2.8 into the second fully connected layer. Specifically, the second fully connected layer is a fully connected network with an input dimension of 1 and an output dimension of 1. Internally, it stores a weight scalar and a bias scalar, with initial values ​​of a random number normally distributed with a mean of 0 and a standard deviation of 0.02, and 0, respectively. During the training phase, the actual number of rule entries is used as the regression label, employing the mean squared error loss function and the Adam optimizer with a learning rate of 0.001. After training, the weight scalar converges to 1.003, and the bias scalar converges to -0.008. The system calculates 2.8 × 1.003 + -0.008 = 2.8004 and outputs a rule range score of 2.8, indicating that this change involves approximately 3 rule entries, which is within 1 entry of the difference between this change and the 2 tariff adjustment plan that actually involves 2 tariff codes.

[0110] The system inputs the rule depth sub-feature vector value of 0.7 into the third fully connected layer. The structure of the third fully connected layer is exactly the same as that of the second fully connected layer. The training label is a normalized value of the actual layer depth 2 ÷ maximum depth 4 = 0.5. After training, the weight scalar converges to 1.001 and the bias scalar converges to 0.001. The system calculates 0.7 × 1.001 + 0.001 = 0.7017 and outputs a rule depth score of 0.7. This score corresponds to an actual layer depth of 0.7 × 4 = 2.8 layers, meaning the change occurs at the 3rd subheading level, which is consistent with the layer position of the 8th subheading in the actual tariff code column.

[0111] The system inputs the rule association sub-feature vector value of 0.6 into the fourth fully connected layer. The fourth fully connected layer has the same structure. The training label is the normalized value of the natural logarithm of the actual number of association rules (5) 1.609 ÷ the natural logarithm of the maximum number of associations (approximately 3.912) = 0.411. After training, the weight scalar converges to 1.002 and the bias scalar converges to -0.003. The system calculates 0.6 × 1.002 + -0.003 = 0.5982 and outputs a rule association score of 0.6. This score inversely calculates the number of association rules as exp(0.6 × 3.912) approximately = 5, which is consistent with the number of reference relationships of the actual tax items involved in the value-added tax and consumption tax regulations.

[0112] The system inputs a frequency sub-feature vector value of 0.9 into the fifth fully connected layer. The fifth fully connected layer has the same structure. The training label is the normalized value of 0.875, calculated as the total number of actual query calls (8750) ÷ the maximum total number of query calls (10000). After training, the weight scalar converges to 0.999 and the bias scalar converges to 0.002. The system calculates 0.9 × 0.999 + 0.002 = 0.9011 and outputs a usage frequency score of 0.9, indicating that the query frequency of this rule in the past 365 calendar days is in the top 10% of the entire rule base, corresponding to an average monthly query frequency of approximately 729 times for this tax item in the actual query log.

[0113] The system performs a weighted summation to obtain the rule change impact score. Specifically, the system reads the range weight coefficient (0.2), depth weight coefficient (0.1), association weight coefficient (0.2), and usage frequency weight coefficient (0.5) from four temporary floating-point variables cached in S202. It also reads the rule range score (2.8), rule depth score (0.7), rule association score (0.6), and usage frequency score (0.9) from the outputs of S204 to S207. The system calculates the rule range score (2.8 × range weight coefficient 0.2) = 0.56, the rule depth score (0.7 × depth weight coefficient 0.1) = 0.07, the rule association score (0.6 × association weight coefficient 0.2) = 0.12, and the usage frequency score (0.9 × usage frequency weight coefficient 0.5) = 0.45. Finally, it adds 0.56 + 0.07 + 0.12 + 0.45 to obtain the rule change impact score of 1.20. The system reads the preset first threshold of 0.8, the second threshold of 0.6, and the third threshold of 0.3. It compares 1.20 with the first threshold of 0.8. If the condition that 1.20 is greater than or equal to 0.8 is met, the change level is determined as the first change level, and the corresponding output is identified as the P0 level core change. The system then proceeds to the subsequent model parameter update decision branch.

[0114] It should be further explained that, in this embodiment, the output update method decision result includes:

[0115] S301. The rule change impact score is compared with a pre-defined level threshold range to determine the change level. The level threshold range includes a first threshold, a second threshold, and a third threshold. When the rule change impact score is greater than or equal to the first threshold, it is determined to be a first change level. When the rule change impact score is greater than or equal to the second threshold and less than the first threshold, it is determined to be a second change level. When the rule change impact score is greater than or equal to the third threshold and less than the second threshold, it is determined to be a third change level. When the rule change impact score is less than the third threshold, it is determined to be a fourth change level.

[0116] S302. Encode the change level into a one-hot vector, and concatenate the one-hot vector with the multimodal fusion feature to obtain the decision input vector.

[0117] S303. Input the decision input vector into the decision tree-enhanced neural network model, wherein the decision tree-enhanced neural network model includes a decision tree layer and a neural subnetwork layer;

[0118] S304. In the decision tree layer, the change level is used as the branch condition to route the decision input vector to the branch path corresponding to the change level, and each branch path is set with an independent path weight matrix.

[0119] S305. In the neural sub-network layer, after linearly transforming the decision input vector using the path weight matrix, the three original decision scores corresponding to model parameter updates, high-frequency knowledge base updates, and external knowledge base updates are output through the activation function and fully connected layer.

[0120] S306. Obtain the storage occupancy rate of each cache in the current knowledge base, the amount of currently available graphics processor computing power resources, and the timestamp of the last update execution. Calculate the update resource constraint vector based on the storage occupancy rate, computing power resources, and timestamp.

[0121] S307. The updated resource constraint vector is weighted element-wise with the three original decision scores to obtain the modified decision score. The modified decision score is input into the normalized exponential function to output the execution probability of each update method. The update method corresponding to the highest execution probability is determined as the update method decision result.

[0122] As a concrete example, the following is a complete calculation to illustrate the entire process. This example is only to demonstrate the feasibility at the computational level and does not represent actual values. The specific values ​​can be determined through simulation or physical experiments conducted by those skilled in the art. In this embodiment, a complete example of the output update method decision result is as follows. Continuing from the aforementioned embodiment on the impact of rule changes on the score, the system uses the output rule change impact score of 1.20 and the output 768-dimensional multimodal fusion feature as inputs. The 768 dimensions of this multimodal fusion feature are all 32-bit floating-point numbers, ranging from -2.8 to 2.9, with a mean of 0.03 and a variance of 0.98.

[0123] The system compares the rule change impact score of 1.20 with pre-defined level threshold ranges to determine the change level. Specifically, the system internally stores the preset level thresholds as three floating-point constants: the first threshold is 0.8, the second threshold is 0.6, and the third threshold is 0.3. These three thresholds are determined as follows: 200 rule change records that have completed update processing are extracted from the system's historical update log. Each record contains a rule change impact score and the actual update method used in that update. The 200 scores are sorted in descending order from highest to lowest. The 50th score (0.82) is rounded down to 0.8 as the first threshold, the 100th score (0.61) is rounded down to 0.6 as the second threshold, and the 150th score (0.32) is rounded down to 0.3 as the third threshold, ensuring that each of the four change levels contains approximately 50 historical records. The system reads the score of 1.20 and first compares it with the first threshold of 0.8. Since 1.20 is greater than 0.8, the change level variable is assigned a value of 1, corresponding to the first change level. The system no longer compares with subsequent thresholds and exits the comparison loop directly.

[0124] The system encodes the change level variable value 1 into a one-hot vector. Specifically, the system creates a one-dimensional integer array of length 4, with array indices from 0 to 3. The element at index 0 is assigned the value 1, and the elements at indices 1, 2, and 3 are all assigned the value 0, resulting in the one-hot vector [1, 0, 0, 0]. The system reads the 768-dimensional multimodal fusion feature output by S107. This fusion feature is stored in memory as a one-dimensional floating-point array of length 768. The system creates a one-dimensional floating-point array of length 772 as the decision input vector. Using a memory copy operation, the 768 elements of the 768-dimensional fusion feature array are copied sequentially to indices 0 to 767 of the decision input vector array. The four elements 1, 0, 0, and 0 of the one-hot vector array are copied sequentially to indices 768, 769, 770, and 771 of the decision input vector array. The first 768 elements of the decision input vector are the multimodal fusion feature values, and the last four elements are the one-hot encoded change level values.

[0125] The system inputs a 772-dimensional decision input vector into a decision tree-enhanced neural network model. Specifically, the neural network model's memory storage structure includes a decision tree layer object and a neural sub-network layer object. The decision tree layer object maintains a branch mapping table containing four key-value pairs: keys are integers 1, 2, 3, and 4, and values ​​are pointers to the first, second, third, and fourth branch path objects, respectively. Each branch path object stores an independent path weight matrix. The path weight matrix for the first branch path is 772 rows and 128 columns, with 98,816 elements. The path weight matrices for the second, third, and fourth branches are also 772 rows and 128 columns. These four matrices are stored independently, with each element initially filled with a normally distributed random number with a mean of 0 and a standard deviation of 0.02. The four matrices do not share memory. The decision tree layer reads the element at index 768 of the decision input vector, which has a value of 1. It determines that the current change level is the first change level, and uses the integer 1 as the key to search in the branch mapping table to obtain the pointer to the first branch path object. It then passes the memory address of the decision input vector to the first branch path object to complete the routing operation.

[0126] The neural sub-network layer receives the decision input vector and path weight matrix passed from the first branch path object and performs matrix multiplication. The 1x772 decision input vector is treated as a 1×772 matrix, and the 772x128 path weight matrix is ​​treated as a 772×128 matrix. After matrix multiplication, a 1×128 intermediate vector is obtained. Each element of the intermediate vector is the sum of the products of the 772 elements of the decision input vector and the corresponding 772 elements of the path weight matrix. The system inputs each of the 128 elements of the intermediate vector into an activation function, which is a linear rectified function. The calculation rule is to judge each element value: if the element value is greater than 0, output the element value; if the element value is less than or equal to 0, output 0. After element-by-element processing, a 128-dimensional activation vector is obtained, in which all negative elements have been set to zero. The system inputs a 128-dimensional activation vector into a fully connected layer. This layer internally stores a 128x3 weight matrix and a bias vector of length 3. The weight matrix has 384 elements, and the bias vector has 3 elements. The initial values ​​of the weight matrix elements are filled with normally distributed random numbers with a mean of 0 and a standard deviation of 0.02. The initial values ​​of the three elements of the bias vector are all 0. The system treats the 128-dimensional activation vector as a 1×128 matrix and performs matrix multiplication with the 128×3 weight matrix to obtain a 1×3 intermediate output vector. The intermediate output vector is then added element-wise to the bias vector to output a 3-dimensional vector. The first element of this 3-dimensional vector, with a value of 0.82, corresponds to the original decision score updated by the model parameters; the second element, with a value of 0.15, corresponds to the original decision score updated by the high-frequency knowledge base; and the third element, with a value of 0.03, corresponds to the original decision score updated by the external knowledge base.

[0127] The system obtains real-time resource metrics through three system monitoring interfaces to construct and update the resource constraint vector. Specifically, the system calls the cache monitoring interface to read the used storage bytes and total storage bytes of the first-level cache. The total capacity of the first-level cache is 2,147,483,648 bytes (2 gigabytes), and the used storage bytes are 901,943,132 bytes, accounting for 901,943,132 ÷ 2,147,483,648 = 0.42. The total capacity of the second-level cache is 1,073,741,8240 bytes. That is, 10 gigabytes, the number of used storage bytes is 6,227,702,589 bytes, the percentage is 6,227,702,589 ÷ 1073,741,8240 = 0.58. The total capacity of the third-level cache is 1,073,741,82400 bytes, which is 100 gigabytes, the number of used storage bytes is 783,914,778,62 bytes, the percentage is 783,914,778,62 ÷ 1073,741,824,000 = 0.73. The system takes the maximum value of the three percentages, 0.73, as the overall storage utilization rate. The system calls the graphics processor management interface to query the current graphics processor model, which is NVIDIA A100. The total video memory is 4,294,967,2960 bytes (40 gigabytes), with 2,791,728,7424 bytes used and 150,323,855,36 bytes available. Simultaneously, the system checks the current graphics processor's compute unit utilization rate at 65% and the available compute unit utilization rate at 35%. The system takes the minimum of the available compute unit utilization rate (150,323,855,36 ÷ 4,294,967,2960 = 0.35) and the available compute unit utilization rate (0.35) to obtain the available computing power resource amount as 0.35. The system then calls the update log query interface to read the timestamp of the last model parameter update execution completion as May 24, 2026, at 10:30:00. The current system timestamp is May 24, 2026, at 13:00:00. Subtracting the two timestamps gives the time interval since the last update as 9000 seconds. The system sequentially combines three values—overall storage occupancy rate (0.73), available computing power (0.35), and time interval since last update (9000 seconds)—to form a 3D update resource constraint vector.

[0128] The system performs resource constraint correction and final decision-making. Internally, the system stores a 3x3 resource correction matrix. The first row corresponds to the resource correction coefficients for model parameter updates ([0.1, 0.5, 0.4]), the second row to the resource correction coefficients for high-frequency knowledge base updates ([0.6, 0.2, 0.2]), and the third row to the resource correction coefficients for external knowledge base updates ([0.2, 0.1, 0.7]). This matrix is ​​determined by assigning weights to the resource consumption types of the three update methods: model parameter updates consume significant amounts of GPU computing power, high-frequency knowledge base updates consume significant amounts of cache storage space, and external knowledge base updates are affected by cache expiration. The coefficient values ​​are then calculated through pairwise comparisons using the analytic hierarchy process (AHP). The system first normalizes the time interval since the last update (9000 seconds). The system's preset normalization baseline is 3600 seconds, or 1 hour. 9000 ÷ 3600 = 2.5. This value is then input into an exponential decay function with the natural constant e as the base and -2.5 as the exponent to calculate the normalized timeliness factor, which is 2.71828. -2.5 =0.082, then subtract 0.082 from 1 to get the timeliness pressure factor of 0.918, indicating that 2.5 hours have passed since the last update and the timeliness pressure is relatively high. The resource constraint correction value for updating the system's computational model parameters is: Overall storage occupancy rate 0.73×0.1 + Available computing power resources 0.35×0.5 + Timeliness pressure factor 0.918×0.4 = 0.073 + 0.175 + 0.367 = 0.615. The resource constraint correction value for updating the system's high-frequency knowledge base is: 0.73×0.6 + 0.35×0.2 + 0.918×0.2 = 0.438 + 0.07 + 0.184 = 0.692. The system calculates the resource constraint correction value for the external knowledge base update: 0.73×0.2+0.35×0.1+0.918×0.7=0.146+0.035+0.643=0.824. The system then multiplies the three original decision scores (0.82, 0.15, and 0.03) output by S305 element-wise with the corresponding resource constraint correction values ​​(0.615, 0.692, and 0.824) to obtain the corrected decision scores: model parameter update correction score is 0.82×0.615=0.504, high-frequency knowledge base update correction score is 0.15×0.692=0.104, and external knowledge base update correction score is 0.03×0.824=0.025. The system inputs three corrected decision scores of 0.504, 0.104, and 0.025 into a normalized exponential function to calculate a power value of 2.71828 with the natural constant e as the base and 0.504 as the exponent. 0.504 =1.655, the power of 0.104 is 2.71828. 0.104 =1.110, with 0.025 as the exponent, the power value is 2.71828. 0.025=1.025, the sum of the three powers is 1.655 + 1.110 + 1.025 = 3.790, the execution probability of model parameter update is 1.655 ÷ 3.790 = 0.437, the execution probability of high-frequency knowledge base update is 1.110 ÷ 3.790 = 0.293, the execution probability of external knowledge base update is 1.025 ÷ 3.790 = 0.270, and the sum of the three execution probabilities is 1.000. The system compares 0.437, 0.293, and 0.270, and the maximum value is 0.437, corresponding to the model parameter update method. The update method decision result is determined to be model parameter update. This result will drive the subsequent execution of multi-level LoRA fine-tuning or ROME rank-one knowledge editing operation branches.

[0129] It should be further explained that, in this embodiment, performing rank-one knowledge editing based on multi-level LoRA fine-tuning or ROME includes:

[0130] S401. Determine whether the change type belongs to numerical revision or rule repeal. If so, perform rank-one knowledge editing based on ROME. If the change type belongs to clause addition or deletion or condition change, perform fine-tuning based on multi-level LoRA.

[0131] S402. When performing rank-one knowledge editing based on ROME, extract the target numerical entity and the original value corresponding to the target numerical entity in the original rule data from the multimodal fusion features. Input the target numerical entity and the original value into each feedforward layer of the pre-trained rule knowledge big language model. With the target numerical entity as input and the original value as output, calculate the causal attribution score of each hidden state dimension in each feedforward layer to the original value.

[0132] S403. The feedforward layer containing the maximum causal attribution score is determined as the target editing layer, and the hidden state dimension interval corresponding to the maximum causal attribution score in the target editing layer is determined as the target neuron location.

[0133] S404. Calculate the difference between the updated value of the target numerical entity in the update rule data and the original value, generate a rank-one update vector based on the difference, add the weight matrix corresponding to the target neuron position in the target editing layer to the rank-one update vector element by element to obtain the updated weight matrix, and complete the rank-one knowledge editing.

[0134] S405. When performing multi-level LoRA fine-tuning, a matching query is performed in the preset type-level mapping table according to the change type to obtain the set of affected layers corresponding to the change type. In the type-level mapping table, the set of affected layers corresponding to the clause addition / deletion type includes the self-attention layer and the feedforward layer, and the set of affected layers corresponding to the condition change type includes the feedforward layer.

[0135] S406. In each layer contained in the set of affected layers, insert a first low-rank decomposition matrix and a second low-rank decomposition matrix into the query projection matrix and the value projection matrix of that layer, respectively.

[0136] S407. Using the multimodal fusion features as fine-tuning input and the text feature vector corresponding to the update rule data as fine-tuning target, perform forward and backward propagation on the first low-rank decomposition matrix and the second low-rank decomposition matrix, update the matrix element values ​​of the first low-rank decomposition matrix and the second low-rank decomposition matrix, and freeze all model parameters outside the affected layer set.

[0137] S408. The change type, the hierarchical identifier of the target editing layer, and the dimensional interval index of the target neuron position are used as the first knowledge update record, or the change type and the hierarchical identifier of each layer in the affected layer set are used as the second knowledge update record. The first knowledge update record or the second knowledge update record is associated with the updated model parameters and stored in the first-level cache. The first knowledge update record and the second knowledge update record are used for the rule knowledge big language model to query the edited model region when it is updated in the future within a preset time length, so as to adjust the search space of the causal attribution score.

[0138] As a concrete example, the following is a complete calculation to illustrate the entire process. This example is only to illustrate the feasibility at the computational level and does not represent actual values. The specific values ​​can be determined through simulation or physical experiments conducted by those skilled in the art. In this embodiment, the system follows the steps described above regarding the output update method decision results. It uses the determined model parameter update decision results, the identified change types as numerical revisions, the 768-dimensional multimodal fusion features output by S107, and the original rule data and updated rule data as inputs for this step to perform the rank-one knowledge editing operation based on ROME. The specific example process is as follows:

[0139] The system performs a change type determination to determine the parameter update path. Specifically, the system reads the change type enumeration value output by S201. This enumeration value is stored in memory as a 32-bit integer variable, currently with a value of 0. In the system definition, integer value 0 corresponds to numerical revision type, integer value 1 corresponds to clause addition / deletion type, integer value 2 corresponds to condition change type, and integer value 3 corresponds to rule repeal type. The system internally maintains a path branching judgment logic. This logic takes the change type integer value as input. First, it checks if the input value is equal to 0 or 3. If it is equal to 0 or 3, the first branch is executed, assigning the parameter update path variable to 0, indicating entry into the ROME rank-one knowledge editing branch. If the input value is neither equal to 0 nor 3, it checks if the input value is equal to 1 or 2. If it is equal to 1 or 2, the second branch is executed, assigning the parameter update path variable to 1, indicating entry into the multi-level LoRA fine-tuning branch. The current change type integer value is 0, which matches the judgment condition of the first branch. The system assigns the parameter update path variable a value of 0 and enters the ROME rank-one knowledge editing branch in S402. S405 to S407 are skipped and not executed. In this embodiment, the judgment logic uses integer exact matching instead of floating-point comparison to avoid branch errors caused by floating-point rounding errors.

[0140] The system performs the first step of the ROME rank-one knowledge editing process, extracting the target numerical entity and its original value from the multimodal fusion features. Specifically, the system reads the 768-dimensional multimodal fusion features output by S107, where each of the 768 dimensions of the fusion features is a 32-bit floating-point number. The system inputs the fused features into a pre-trained entity recognition decoder, which is a single-layer fully connected network with an input dimension of 768 and an output dimension of 768. Its weight matrix has a size of 768 rows and 768 columns, and its bias vector has a length of 768. The training method for the weight matrix and bias vector is as follows: 8,000 sentences containing numerical entities are extracted from all tariff adjustment announcements issued by the General Administration of Customs of China from 2000 to 2025. The start and end character positions of the numerical entities in each sentence are manually labeled. The sentences are encoded into 768-dimensional feature vectors by the BERT encoder used by S101 and used as training inputs. The labeled position information is converted into 768-dimensional binary label vectors. The start and end positions in the label vector are marked as 1, and the remaining positions are marked as 0. The system is trained for 100 epochs using the binary cross-entropy loss function and the Adam optimizer with a learning rate of 0.0001. After training, the entity recognition accuracy is 0.96. After receiving the 768-dimensional fused features, the entity recognition decoder outputs a 768-dimensional confidence vector. Each dimension value represents the confidence that the position in that dimension belongs to a numerical entity, ranging from 0 to 1. The system performs element-wise binarization on this 768-dimensional vector with a confidence threshold of 0.5, marking elements with a confidence score greater than or equal to 0.5 as 1 and elements with a confidence score less than 0.5 as 0, resulting in a continuous interval of dimensions marked as 1. In this embodiment, the preset confidence threshold of 0.5 is based on the statistical analysis of the entity recognition decoder's training data and the conventional setting of the binary classification decision boundary. The entity recognition decoder used 8,000 sentences containing numerical entities extracted from all tariff adjustment announcements issued by the General Administration of Customs of China from 2000 to 2025 during the training phase. Each sentence was converted into a 768-dimensional feature vector by the BERT encoder and used as training input. The start and end character positions of the numerical entities in each sentence were manually labeled, and the labeled position information was converted into a 768-dimensional binary label vector. The start and end positions of the entity were marked as 1, and the remaining positions were marked as 0. The decoder output layer uses the Sigmoid activation function to compress the value of each dimension in the 768-dimensional output vector to the interval between 0 and 1, representing the confidence that the position in that dimension belongs to a numerical entity. After training, the system plotted precision-recall curves on an independent validation set with confidence thresholds ranging from 0.1 to 0.9 and a step size of 0.05. It calculated the F1 score corresponding to each threshold. When the threshold was 0.5, the precision reached 0.96, the recall reached 0.95, and the F1 score reached its maximum value of 0.955. Therefore, the system set 0.5 as the default confidence threshold.From a probabilistic perspective, 0.5 indicates that the model considers the probability of this dimension belonging to an entity to be greater than the probability of it not belonging to an entity. It is the Bayesian optimal decision boundary that minimizes conditional risk in binary classification problems.

[0141] The system maps back to the original text based on the dimensional interval index, finds the corresponding text segment in the original rule data as "import tariff rate is 5%", separates the numerical part "5%" as the target numerical entity, and uses the Arabic numeral 5 corresponding to "5%" as the original value. The system inputs the target numerical entity text "5%" and the original value 5.0 into a pre-trained rule knowledge large language model. This rule knowledge large language model is an autoregressive language model based on a Transformer decoder architecture, containing 24 Transformer layers, each containing a self-attention sub-layer and a feedforward sub-layer. The hidden layer dimension is 1024, the intermediate dimension of the feedforward sub-layer is 4096, the vocabulary size is 51200, the total number of parameters is 1.3 billion, and the model weights are stored in 32-bit floating-point format. The model was pre-trained on a corpus containing historical tariff documents from the General Administration of Customs of China, trade control announcements from the Ministry of Commerce, and World Trade Organization rules. The pre-training corpus contained 50 billion lexical units. The pre-training task was next-word prediction. The optimizer was AdamW, with a cosine decay learning rate of 0.0001 and a peak learning rate of 500,000 steps. The system used the lexical embedding vectors obtained by lexicalizing 5% of the target numerical entity text as model input. After one forward propagation, the model's predicted output value was obtained. The mean squared error between this predicted output value and the original value of 5.0 was calculated as the baseline error. The system iterates through all 24 feedforward sub-layers of the model, performing causal attribution calculations for each hidden state dimension of each feedforward sub-layer: For the j-th hidden state dimension of the i-th feedforward sub-layer, the activation value of that dimension is temporarily set to zero, while the other dimensions remain unchanged. The model's predicted output value for the original value 5.0 is recalculated, and the mean squared error between the zeroed-off predicted output value and 5.0 is calculated. The absolute value of the difference between the zeroed-off mean squared error and the baseline error is taken as the causal attribution score of the j-th hidden state dimension of the i-th feedforward sub-layer. A higher causal attribution score indicates a greater causal contribution of that dimension to the model's output of the original value 5.0. In this embodiment, the 24 feedforward sub-layers of the model contain a total of 24 × 4096 = 98304 hidden state dimensions, and the total number of causal attribution calculations is 98304, with each calculation completing one full forward propagation.

[0142] The system determines the target editing layer and target neuron location based on the calculated 98,304 causal attribution scores. Specifically, the system iterates through all 98,304 causal attribution scores, using a maximum value variable to record the maximum value among the currently iterated scores (initialized to 0.0), and a location variable to record the layer index and dimension index corresponding to the maximum value. After the iteration is complete, the causal attribution score corresponding to the dimension with index 2560 in the 18th feedforward sub-layer is 0.91, which is the global maximum among the 98,304 scores. The system identifies the 18th feedforward sub-layer as the target editing layer and assigns its layer identifier to 18. The system uses the dimension index 2560, where the maximum causal attribution score of 0.91 is located, as the baseline. Rounding up to a multiple of 512 yields 2048, and rounding down to a multiple of 512 yields 3583. However, the upper limit of the dimension range for the 18th feedforward sub-layer is 4095, so the rounding down result is corrected to 3071. The final determined dimension range for the target neuron location is 1024 consecutive dimensions from index 2048 to index 3071. In this embodiment, the baseline granularity of 512 for dimension range expansion is set based on the following: In an independent editing experiment with 100 numerical rule entities, the accuracy of the edited model on 50 related knowledge test questions was tested under five configurations of expansion granularity: 64, 128, 256, 512, and 1024. At granularity 512, the related knowledge retention rate was 0.94, and the editing accuracy was 0.97. The combined score of these two indicators was the highest, therefore 512 was selected as the default expansion granularity.

[0143] The system performs the generation of the rank-one update vector and the update of the weight matrix. Specifically, the system reads the update value corresponding to 5% of the target numerical entity from the structured rule field of the update rule data. The update rule data is stored in the rule data buffer in the system memory. The data structure of this buffer is a key-value pair mapping table, where the key is the tariff code column string and the value is a dictionary of all rule parameters corresponding to that tariff code column. The system queries the parameter dictionary using the tariff code column corresponding to the target numerical entity as the key, reads the value of the import tariff rate field as 3%, and converts 3% to the Arabic numeral 3 as the update value. The system calculates the difference between the update value 3 and the original value 5; 3 minus 5 equals -2. The system generates a rank-one update vector based on the difference of -2. The generation method is as follows: The system reads the key vectors corresponding to the 1024 hidden state dimensions (indices 2048 to 3071) from the 18th layer feedforward sub-layer cache already completed in S402. Each key vector is the result of a linear transformation of the hidden state using the key projection matrix, and each key vector has a dimension of 64. The system averages these 1024 64-dimensional key vectors across each dimension to obtain a 64-dimensional key vector mean. The 64 dimensions of the key vector mean are distributed between 0.02 and 0.08. The system then multiplies this 64-dimensional key vector mean by the difference of -2 as a scaling factor to obtain a 64-dimensional rank-one update vector. The 64 dimensions of the rank-one update vector are distributed between -0.16 and -0.04. The system reads the weight matrix sub-block corresponding to the dimension interval index 2048 to 3071 of the target neuron position in the target editing layer, i.e., the 18th feedforward sub-layer. This sub-block is a column slice of the second linear projection matrix of the feedforward sub-layer, with a size of 4096 rows and 1024 columns, and the data type is 32-bit floating-point number. The system treats each row of the weight matrix sub-block as a 1024-dimensional row vector, expands the 64 dimensions of the rank-one update vector to 1024 dimensions by repeating the 64 dimensions 16 times, and adds them element-wise to the corresponding positions of the 1024 columns of the weight matrix sub-block. An offset from -0.16 to -0.04 is accumulated and added to the original weight value to obtain the updated weight matrix sub-block, completing the rank-one knowledge editing. After the update is completed, the system writes the updated weight matrix sub-block back to the corresponding offset address in the model weight file. The system performs real-time verification of the edit, re-inputting the word embedding vector of 5% of the target numerical entity into the edited rule-based large language model. The model predicts an output value of 3.02, which deviates from the updated value of 3 by 0.02. The system reads the preset edit tolerance threshold of 0.05. Since 0.02 is less than 0.05, the edit verification is marked as passed. If the deviation is greater than 0.05, the edit verification is marked as failed, and the system automatically rolls back the weight matrix sub-block to the backup value before editing. In this embodiment, the preset edit tolerance threshold of 0.05 is based on the business tolerance of the numerical revision task for the accuracy of tariff calculation and the statistical deviation analysis of the model editing experiment.In international trade compliance scenarios, a single revision of the tariff rate directly affects the tax payable on imported goods. Customs tax calculation systems typically control the rate deviation within one percentage point as an acceptable error limit. Internally, the system needs to further compress the allowable error to 1 / 20th of this limit, or 0.05, to ensure that the edited model output does not generate cumulative rounding bias in subsequent tax calculation inferences. During the system design phase, after performing ROME rank-one knowledge editing on 100 known numerical revision samples, the absolute deviation between the model's predicted output and the actual updated values ​​before and after the editing was measured. Statistical results showed that 95% of the editing deviation values ​​were concentrated between 0.01 and 0.04, 99% were less than 0.05, and only one set reached 0.06 due to the high coupling between the numerical entity and the contextual semantics. Setting the editing tolerance threshold to 0.05 not only allows 99% of normal editing results to be considered acceptable but also effectively intercepts a small number of abnormal edits exceeding the confidence interval to trigger rollback protection. Therefore, the editing tolerance threshold is fixed at 0.05 in the system configuration file.

[0144] In this example, S405 to S407 are skipped because S401 has been branched to the ROME rank-one knowledge editing branch. The system does not perform any operations related to multi-level LoRA fine-tuning, and the type-level mapping table lookup, low-rank decomposition matrix insertion, and parameter update operations related to multi-level LoRA fine-tuning are not triggered.

[0145] The system stores the metadata of this ROME rank-one knowledge edit as the first knowledge update record in the first-level cache. Specifically, the system creates a structured data object with four fields as the first knowledge update record: the first field is the change type, storing a string value for numerical revision; the second field is the target editing layer identifier, storing an integer value of 18; the third field is the starting index of the target neuron position dimension interval, storing an integer value of 2048; and the fourth field is the ending index of the target neuron position dimension interval, storing an integer value of 3071. The system serializes the first knowledge update record into a JSON string, with the content {"change_type":"numerical revision","target_layer":18,"neuron_start":2048,"neuron_end":3071}, and a total string length of 79 bytes. The system associates this JSON string with the storage address pointer of the sub-block of the 18th layer feedforward sub-layer weight matrix after S404 update and stores the associated data pair in the first-level cache. The first-level cache is an embedded key-value storage database deployed in the graphics processor's video memory. The database is named LevelOneCache and has a total capacity of 21474-83648 bytes, or 2 gigabytes. The storage engine uses a hash index structure. The key is the string "18_numerical revision", which is formed by concatenating the target editing level identifier "18" and the change type numerical revision in the knowledge update record. The value is the cache object composed of the memory address pointer of the weight matrix sub-block and the serialized first knowledge update record. This first knowledge update record is used within the next 30 calendar days. When the system performs causal attribution calculation on the same rule knowledge big language model again, the rule knowledge big language model first checks whether there is a knowledge update record in the first-level cache that matches the current change type. If it exists, it reads the target editing layer level identifier 18 and the starting index 2048 and ending index 3071 of the target neuron position dimension interval. The search range of the causal attribution score is reduced from the default 98304 dimensions (all 4096 hidden state dimensions of all 24 feedforward sub-layers) to only 1024 dimensions (indexes 2048 to 3071 of the 18th feedforward sub-layer). The reduced search space size is 1024 dimensions, and the reduction ratio is 1024 ÷ 98304 ≈ 0.0104, or about 1.04%. This reduces the editing and positioning time of subsequent similar knowledge from about 120 seconds of traversing 98304 dimensions to about 1.25 seconds of traversing 1024 dimensions, a speedup of about 96 times.In this embodiment, the expiration eviction policy of the first-level cache adopts a hybrid strategy of time and access frequency: the system scans the creation timestamp of all cache entries in the first-level cache every day. If the current system time minus the creation timestamp exceeds 30 calendar days, i.e., 2,592,000 seconds, the cache entry is marked as overwhelmable. At the same time, the system maintains an access counter for each cache entry. If the access counter of an entry is zero in the last 7 calendar days and the creation time has exceeded 30 calendar days, the entry is marked as overwhelmable first. When the available capacity of the first-level cache is less than 20% of the total capacity, the system cleans up cache entries in batches according to the order of overwhelmable status and creation time from earliest to latest, releasing at least 10% of the total capacity space each time.

[0146] It should be further explained that this embodiment performs semantic and structural segmentation on the update rule data to generate knowledge blocks, including:

[0147] S501. Perform structured parsing on the updated rule data, identify the chapter markers, clause numbers, sub-clause numbers, item numbers and sub-item numbers, and generate a rule hierarchy structure tree containing node identifiers, node levels, parent node identifiers and a list of child nodes. Each leaf node of the rule hierarchy structure tree corresponds to an independent rule statement.

[0148] S502. Using the leaf nodes of the rule hierarchy structure tree as basic units, calculate the semantic similarity and structural correlation between adjacent leaf nodes. When the semantic similarity is greater than a preset semantic similarity threshold and the structural correlation is greater than a preset structural correlation threshold, merge the adjacent leaf nodes into an initial knowledge block. The semantic similarity is calculated based on the cosine similarity of the text feature vectors corresponding to the adjacent leaf nodes, and the structural correlation is calculated based on whether the adjacent leaf nodes have the same parent node in the rule hierarchy structure tree.

[0149] S503. Identify all table elements in the update rule data, perform row and column parsing on each table element, extract the table title, header row, data row and table note, and combine each data row with its corresponding header information to generate a table knowledge block. Each table knowledge block contains numeric constraint information in the form of key-value pairs and a corresponding context description.

[0150] S504. Scan all reference markers in the initial knowledge blocks and table knowledge blocks, identify cross-knowledge block reference dependencies, mark multiple knowledge blocks with direct or indirect reference dependencies as an associated knowledge block group, and assign a unique group identifier to the associated knowledge block group.

[0151] S505. Generate a hybrid feature vector for each knowledge block. The hybrid feature vector is composed of a semantic vector, a structural vector, a numerical vector, and a keyword vector. Specifically: the semantic vector is obtained by dimensionality reduction of the text feature vector corresponding to the knowledge block; the structural vector is encoded by the node level, parent node identifier, and number of sibling nodes of the knowledge block in the rule hierarchy structure tree; the numerical vector is encoded by all numerical data contained in the knowledge block and their corresponding units and threshold types; and the keyword vector is obtained by the word frequency-inverse document frequency vector of the core keywords extracted from the knowledge block.

[0152] S506. Obtain the version number of the knowledge block that already exists in the second-level cache, compare the version of the knowledge block generated this time with the knowledge block with the same node identifier in the second-level cache, and mark the newly added knowledge block, the modified knowledge block and the deleted knowledge block.

[0153] S507. Index the hybrid feature vectors corresponding to the newly added knowledge block and the modified knowledge block to generate new index entries. Logically delete the index entries corresponding to the deleted knowledge block. Perform an incremental index merging operation to physically remove the logically deleted index entries and merge adjacent index pages.

[0154] S508. Calculate the comprehensive cache value score for each knowledge block. The comprehensive cache value score is equal to the rule change impact score multiplied by the first weight coefficient, plus the usage frequency score corresponding to the knowledge block multiplied by the second weight coefficient, plus the rule association score corresponding to the knowledge block multiplied by the third weight coefficient, minus the storage size of the knowledge block multiplied by the fourth weight coefficient.

[0155] S509. When the storage occupancy rate of the second-level cache reaches the preset storage threshold, knowledge blocks and their corresponding index entries are eliminated in order of increasing comprehensive cache value score until the storage occupancy rate of the second-level cache is lower than the preset storage threshold.

[0156] S510. Store all generated knowledge blocks, hybrid feature vectors, hybrid vector indexes, associated knowledge block group information and version numbers into the second-level cache, and update the metadata information of the second-level cache. The metadata information includes knowledge block identifier, group identifier, version number, creation time, last access time and comprehensive cache value score.

[0157] It should be further explained that the incremental index merging operation performed in this embodiment includes:

[0158] S5071. Calculate the proportion of logically deleted index entries in the second-level cache to the total number of index entries. When the proportion reaches a preset merging threshold, trigger an incremental index merging operation.

[0159] S5072. Divide the hybrid vector index into multiple index segments of equal size, each index segment containing consecutive index entries; scan each index segment, remove logically deleted index entries, and generate a new index segment; merge multiple adjacent small index segments into a large index segment, update the root node of the index to point to the new index segment address; delete the old index segment file to release storage space.

[0160] In this embodiment, the method further includes: establishing a cross-caching level consistency verification mechanism, assigning a globally unique version number to each knowledge block, the version number being automatically incremented each time the knowledge block is updated; when retrieving a knowledge block from the first-level cache, the second-level cache, or the third-level cache, first obtaining the latest version number of the knowledge block; comparing the version numbers of the same knowledge block in different cache levels, if there are inconsistent version numbers, the knowledge block with the highest version number is used as the standard, and the content of the knowledge block in other cache levels is updated accordingly; periodically performing a full consistency verification, scanning knowledge blocks in all cache levels, and identifying and fixing version inconsistency issues.

[0161] Next, a specific complete example will be used to illustrate the entire process. This example is only to illustrate the feasibility at the computational level and does not represent actual values. The specific values ​​can be determined by those skilled in the art through simulation experiments or physical experiments. In this embodiment, the system uses the 2026 tariff adjustment plan as the update rule data input. This update rule data is stored in plain text file format at the system file system path / data / rules / 2026 / tariff_adjustment.txt, with UTF-8 encoding. The total file size is 12560 bytes, containing 4 chapters, 18 clauses, and 3 commodity tax rate tables. The file content begins with Chapter 1, "Import Tariff Rate Adjustment," and ends with "This plan will be implemented from January 1, 2026." The specific example is as follows:

[0162] The system performs structured parsing on the update rule data to generate a rule hierarchical structure tree, specifically: the system scans the full text using a regular expression-based hierarchical tag recognizer, which internally stores 8 regular expression rules, which are in sequence: the first rule matches a string ending with a Chinese numeral plus "chapter" and identifies it as a chapter tag, the second rule matches a string ending with "第" (No.) plus a Chinese numeral plus "条" (clause) and identifies it as a clause tag, the third rule matches a string starting with a parenthesized Chinese numeral plus a right parenthesis and identifies it as a sub-clause tag, the fourth rule matches a string starting with an Arabic numeral plus a dot and identifies it as an item tag, the fifth rule matches a string starting with a parenthesized Arabic numeral plus a right parenthesis and identifies it as a sub-item tag, and the 6th to 8th rules respectively perform fallback matching when the indentation hierarchy is inconsistent. The system reads lines of text line by line starting from the first byte of the file, sequentially applies the 8 regular expressions to each line of text for matching attempts, and after a successful match, records the tag type, tag text corresponding to that line, and the starting byte offset of that line in the file. A total of 4 chapter tags are identified in this scan, which are Chapter 1, Chapter 2, Chapter 3, and Chapter 4 respectively; 18 clause tags, which are Article 1 to Article 18 respectively; 25 sub-clause tags; 40 item tags; and 56 sub-item tags. The system takes the root node as the starting node of the hierarchical structure tree, the node identifier of the root node is ROOT, and the hierarchy level is 0. The system traverses all matching results and constructs parent-child relationships according to the tag types and occurrence order: chapter tags are used as child nodes of the root node, with node identifiers sequentially from CH01 to CH04, all at hierarchy level 1, and all with the parent node identifier ROOT; the first clause tag appearing after each chapter tag is used as a child node of that chapter, with node identifiers from ART01 to ART18, at hierarchy level 2, and the parent node identifier is the node identifier of that chapter; sub-clause, item, and sub-item tags appearing after a clause tag are mounted under the corresponding parent node following the same proximity attribution principle. The system creates a structure for each node, and the structure contains five fields: the node identifier field is a string with a maximum length of 20 bytes, the node hierarchy field is an integer with a value range from 0 to 7, the parent node identifier field is a string with a maximum length of 20 bytes, the child node list field is a dynamic array that can store up to 50 child node identifiers, and the node original text offset field is a 32-bit integer that records the starting byte offset of the original text corresponding to the node in the file. The system stores all node structures in a hash map in the memory with the node identifier as the key, the number of buckets in the hash map is 128, the bucket index is calculated by applying the CRC32 hash function to the first 4 bytes of the node identifier string, and the chaining method is used to resolve hash collisions. After all nodes are inserted, the total number of leaf nodes in the rule hierarchical structure tree is 56, and each leaf node corresponds to one sub-item node, that is, an independent rule statement that cannot be further divided at the hierarchy level.

[0163] The system performs knowledge block merging operations using the 56 leaf nodes of the rule hierarchy structure tree as the basic unit. Specifically, the system arranges the 56 leaf nodes into an ordered list according to their preorder traversal order in the rule hierarchy structure tree, and traverses 55 pairs of adjacent leaf nodes in this list. For the i-th pair of adjacent leaf nodes, the system reads the text feature vector extracted from the rule statement corresponding to the i-th leaf node in S101. This vector is a 768-dimensional 32-bit floating-point array. Simultaneously, it reads the 768-dimensional text feature vector of the (i+1)-th leaf node. The system calculates the dot product of the two vectors: multiplying the corresponding dimensions of the two vectors and summing the 768 products to obtain the dot product value; it calculates the L2 norm of the first vector: squaring each of the 768 dimension values, summing them, and then taking the square root; the L2 norm of the second vector is calculated in the same way. Dividing the dot product value by the product of the two L2 norms yields the cosine similarity value, which ranges from 0 to 1. The system calculates structural relevance: It retrieves the parent node identifier strings of the i-th leaf node and the (i+1)-th leaf node, respectively, and uses a string comparison function to determine if the two parent node identifiers are completely equal. If they are equal, the structural relevance value is 1.0; if they are not equal, it continues to retrieve and compare the grandparent node identifiers of the two leaf nodes. If the grandparent node identifiers are equal, the structural relevance value is 0.5; if the grandparent node identifiers are also not equal, the structural relevance value is 0.0. The system reads a preset semantic similarity threshold of 0.7 and a preset structural relevance threshold of 0.5. The basis for setting these two thresholds is as follows: In 50 knowledge block merging experiments with different threshold combinations, 81 combinations of threshold combinations ranging from 0.5 to 0.9 with a step size of 0.05 were tested. The 32 initial knowledge blocks generated under the combination of semantic similarity 0.7 and structural relevance 0.5 showed the highest average retrieval recall rate of 0.91 and the highest retrieval precision of 0.88 in subsequent retrieval tests. The system compares the calculated cosine similarity value with 0.7 and the structural correlation value with 0.5. If both are greater than or equal to their respective thresholds, the i-th and (i+1)-th leaf nodes are merged into one initial knowledge block. During merging, the rule texts of the two leaf nodes are concatenated with a period, and the merged node identifier is formed by concatenating the node identifiers of the two leaf nodes with underscores. If either condition is not met, the nodes are not merged, and each becomes an independent initial knowledge block. After traversing 55 pairs of adjacent leaf nodes, 56 leaf nodes are merged into 32 initial knowledge blocks. The data structure of each initial knowledge block includes a string of knowledge block text content, an array of leaf node identifiers, and the start and end node identifiers of the knowledge block in the rule hierarchy structure tree.

[0164] The system identifies all table elements in the update rule data and generates table knowledge blocks. Specifically, the system uses a table detector to scan the raw byte stream of the update rule data. The table detector identifies HTML table tags, using the character sequence " "As a table start marker, character sequence"The system uses the following character sequences as markers: "" as the table end marker, "" as the row start marker, "" as the cell start marker, "" as the cell end marker, and "" as the row end marker. The system detected three complete tables in the update rule data. For the first table, the system extracted the table title as "Adjustment Table of Import Tariff Rates for Some Commodities," located in a line of plain text before the table start marker. The system also extracted the header row, containing three column headers: tariff code, commodity name, and new tariff rate, located between the first row start marker and the first row end marker. Eight data rows were extracted, each located between a row start marker and a row end marker. The table footer text was extracted as "This table is effective from January 1, 2026," located in a line of plain text after the table end marker. The system processed each of the eight data rows: For the j-th data row, the system extracted the text content of three cells within that row. The first cell contained the tariff code string (e.g., 01012100), the second cell contained the commodity name string (e.g., "improved variety"). Using "horse" as an example, the third cell contains the new tax rate percentage value followed by a percentage sign, for example, 5%. The system generates a table knowledge block for the j-th data row. This table knowledge block's data structure contains four key-value pairs: the key "Tax Code" corresponds to the string "01012100", the key "Product Name" corresponds to the string "Improved breed of horse", the key "New Tax Rate" corresponds to the string "5%", and the key "Tax Rate Value" corresponds to the floating-point number 0.05. It also includes a context description field, whose content is the table title section, "Adjustment Table of Import Tariff Rates for Goods," and the table notes: "This table is effective from 202..." The string concatenation results implemented from January 1, 2016. The first table generated 8 table knowledge blocks. The second and third tables used the exact same parsing and generation process, generating 5 and 7 table knowledge blocks respectively, for a total of 20 table knowledge blocks. Combined with the 32 initial knowledge blocks generated by S502, the system currently generates a total of 52 knowledge blocks. Each knowledge block is assigned a knowledge block identifier; the initial knowledge block identifiers are KB001 to KB032, and the table knowledge block identifiers are KB033 to KB052.

[0165] The system scans all 52 knowledge blocks for citation markers to identify cross-knowledge block citation dependencies. Specifically, the system internally stores a library of regular expressions for citation markers, containing eight regular expression rules: "See [number] + one or more Chinese characters + [bar]" for matching clause citations; "According to [number] + one or more Chinese characters + [chapters]" for matching chapter citations; "Referencing [number] + one or more numbers + [number]" for matching numbered citations; and "Based on [number] + one or more Chinese characters + [clause]" for matching clause citations. Variants of the above four rules handle differences between full-width and half-width characters and spaces. The system applies the eight regular expressions to the text content of each of the 52 knowledge blocks for matching, and the matching result is recorded as a triple containing the source knowledge block identifier, the cited text string, and the citation target node identifier. In the text of the 5th initial knowledge block, the system matched the string "see Article 10". The system traversed the 18 clause nodes to find the clause node whose text was Article 10. This clause node's node identifier was ART10. The original rule text corresponding to ART10 belonged to the 16th initial knowledge block. The system established a reference dependency edge, with the starting node being the identifier of the 5th initial knowledge block (KB005) and the ending node being the identifier of the 16th initial knowledge block (KB016). The edge type was clause reference. In the text of the 2nd table knowledge block, the system matched the string "according to the classification principle of Chapter 2" and searched for the chapter node with the identifier CH02. This chapter node had 5 sub-nodes corresponding to 5 initial knowledge blocks in the rule hierarchy structure tree. The system established 5 reference dependency edges, all starting at node KB034 and ending at the identifiers of the 5 initial knowledge blocks under Chapter 2. After traversing all 52 knowledge blocks, the system identified 12 direct reference dependency edges. These 12 direct edges were input into the transitive closure computation function, which used the Floyd algorithm to calculate the reachability relationships between knowledge blocks, resulting in 3 indirect reference dependency edges. The system constructed a directed graph using knowledge block identifiers as nodes and reference dependency edges as directed edges. A connected component algorithm was used to find all weakly connected components in this directed graph. Knowledge blocks belonging to the same weakly connected component were grouped into the same associated knowledge block group, forming 4 associated knowledge block groups: Group 1 contains 8 knowledge blocks, Group 2 contains 5 knowledge blocks, Group 3 contains 3 knowledge blocks, and Group 4 contains 2 knowledge blocks. An additional 34 knowledge blocks do not belong to any associated knowledge block group. The system assigned group identifiers G001, G002, G003, and G004 to the 4 associated knowledge block groups sequentially.

[0166] The system generates a hybrid feature vector for each knowledge block. Specifically, taking knowledge block identifier KB001 as an example, this knowledge block contains the first and second leaf nodes. The system generates semantic vectors, structural vectors, numerical vectors, and keyword vectors, and then concatenates them. The semantic vector generation process is as follows: The system reads the 768-dimensional text feature vectors corresponding to the two leaf nodes contained in KB001. Both vectors are stored in memory as contiguous arrays of 768 32-bit floating-point numbers. The system creates a new 768-dimensional floating-point array, and for the k-th dimension, positions 0 to 767. The k-th dimension values ​​of the two vectors are added and divided by 2.0 to obtain the average value of the k-th dimension. This average value is then filled into the k-th dimension of the new array to obtain a 768-dimensional mean vector. The system reads the pre-trained principal component analysis dimensionality reduction matrix, which is stored as a binary file at path / models / pca_reduction.bin. The file size is 768 × 128 × 4 = 393216 bytes, and the storage format is a row-major sequence of 32-bit floating-point numbers. The system loads the matrix as a 768-row, 128-column two-dimensional array. The 768-dimensional mean vector is treated as a 1-row, 768-column matrix and multiplied by the reduced-dimensional matrix to obtain a 1-row, 128-column product vector. This product vector is then used as a 128-dimensional semantic vector. The structure vector generation process is as follows: The system reads the leaf node containing KB001 from the rule hierarchy structure tree. The leaf node with the largest level value is level 5. The system presets the maximum level value to be 7. Dividing 5 by 7 yields a normalized level value of 0.7142857. The parent node identifier of this leaf node is read as ITEM03. The string ITEM03 is input into the MD5 hash function to obtain a 128-bit hash value. The first 4 bytes are interpreted as a 32-bit unsigned integer value of 3621458796. Dividing 3621458796 by 4294967295 yields a normalized parent node encoding value of 0.843. The number of sibling nodes of this leaf node under its parent node is read as 3. The system presets the maximum number of sibling nodes to be 10. Dividing 3 by 10 yields a normalized sibling count value of 0.3. In this embodiment, the maximum number of sibling nodes is preset to 10 based on statistical analysis of the hierarchical structure of international trade rule documents and the granularity requirements of normalized encoding. The system performs structural analysis on 500 real trade rule documents collected from the General Administration of Customs of China, the EU's TARIC database, and the Japan Customs Association. It extracts the rule hierarchy structure tree for each document and statistically analyzes the distribution of direct child nodes under each parent node. The results show that 95% of parent nodes contain between 1 and 8 child nodes, and 99% of parent nodes have no more than 10 child nodes. Only a few comprehensive chapters have 12 or 15 child nodes. To maintain sufficient numerical resolution in the normalized encoding of the number of sibling nodes in the structure vector while avoiding the compression of most data points into excessively small intervals after normalization due to a few extremely large groups of sibling nodes, the system uses the 99th percentile (10) as the preset value for the maximum number of sibling nodes.When the actual number of sibling nodes of a parent node is 3, its normalized value is 3 divided by 10 equals 0.3. This value can effectively characterize the relative position density of the node in the hierarchical structure.

[0167] The three normalized values, 0.7142857, 0.843, and 0.3, are sequentially combined to form a 3D structured vector. Numerical vector generation process: The system scans all numerical character sequences in the KB001 text content. When the value 25 is found (unit: percentage, threshold type: upper limit), the system divides 25 by the preset numerical normalization upper limit of 100 to obtain a normalized value of 0.25. In the unit encoding mapping table, percentage corresponds to the integer value 2, and in the threshold type mapping table, upper limit corresponds to the integer value 0. The three values ​​0.25, 2, and 0 are sequentially combined to form a 3D numerical vector. Keyword vector generation process: The system uses a Chinese word segmenter to segment the KB001 text content. The segmentation dictionary contains 50,000 trade-related professional terms. After segmentation, a word sequence containing 35 words is obtained. After filtering out the 12 stop words in the stop word list, 23 words remain. The five core keywords with the highest word frequency are: import tariff, tax rate, ad valorem tax, most-favored-nation, and applicable tax rate. The system calculates the term frequency (TNF) for each keyword: the number of times the keyword appears in KB001 is divided by 23 to obtain the TNF value; it also calculates the inverse document frequency (IVF): the quotient of the total number of knowledge blocks (52) divided by the number of knowledge blocks containing the keyword is taken as the natural logarithm to obtain the IVF value; the TNF value and the IVF value are multiplied to obtain the TNF-IVF value. The TNF-IVF values ​​for the five keywords are 0.34, 0.28, 0.19, 0.15, and 0.12, respectively, forming a 5-dimensional keyword vector. The system concatenates the 128-dimensional semantic vector, 3-dimensional structural vector, 3-dimensional numerical vector, and 5-dimensional keyword vector in memory in this order to form a 139-dimensional hybrid feature vector. The concatenated vector indices 0 to 127 are the semantic vector, 128 to 130 are the structural vector, 131 to 133 are the numerical vector, and 134 to 138 are the keyword vector.

[0168] The system performs a version comparison operation, specifically: The system reads the existing version number mapping table from the second-level cache. This mapping table is stored in the metadata partition of the second-level cache and is formatted as a LevelDB key-value database. The key is a node identifier string, and the value is an 8-character version number string. The system iterates through the 52 knowledge blocks generated this time, extracting the node identifier list of all leaf nodes contained in each knowledge block. For each node identifier in the node identifier list, a precise lookup is performed in the version number mapping table using each node identifier as the key. The first initial knowledge block KB001 contains two leaf node identifiers, neither of which have a corresponding record in the version number mapping table. The system marks KB001 as a newly added knowledge block, and this new mark is represented by a boolean variable isNew set to true. The tenth initial knowledge block KB010 contains one leaf node identifier, which has a corresponding record in the version number mapping table, with version number V00000003. The system reads the current text content of KB010 and calculates its MD5 hash value as d41d8cd98f00b204e98.

[0169] 00998ecf8427e, read the MD5 hash value of the previous version corresponding to this node identifier in the version number mapping table, which is d41d8c.

[0170] The hash values ​​d98f00b204e9800998ecf8427f are different. The system marks KB010 as a modified knowledge block, with the modification flag represented by a boolean variable `isModified` set to `true`. The version number increments from V00000003 to V00000004. The system performs a set difference operation between all node identifiers in the version number mapping table and all leaf node identifiers included in the currently generated knowledge block. This results in a set of node identifiers that exist in the version number mapping table but are not included in the current knowledge block. This set contains 3 node identifiers. The system marks the existing knowledge blocks corresponding to these 3 node identifiers as deleted knowledge blocks, with the deletion flag represented by a boolean variable `isDeleted` set to `true`. The version number increment rule is as follows: extract the last 8 digits from the version number string, convert the numeric part to an integer, add 1, format it as an 8-digit numeric string padded with leading zeros, and concatenate it with the character 'V' to obtain the new version number.

[0171] The system performs index building operations on newly added and modified knowledge blocks. Specifically, the system selects 15 knowledge blocks with `isNew` set to `true` and 7 knowledge blocks with `isModified` set to `true` from the S506 labeling results, totaling 22 knowledge blocks that need index updates. The system reads the 139-dimensional mixed feature vectors corresponding to each of these 22 knowledge blocks and organizes these vector data into a 22-row, 139-column two-dimensional floating-point array. The system calls the approximate nearest neighbor index builder, which implements a hierarchical navigable small-world graph indexing algorithm. The construction parameters are configured as follows: the maximum number of connections M per node is set to 16, the search width `efConstruction` is set to 100, and the distance metric type is set to Euclidean distance, i.e., L2 distance. The index builder inserts the 22 139-dimensional vectors as new nodes one by one into the existing hierarchical navigable small-world graph structure. The insertion process starts from the top layer, greedily searching for the nearest entry point and descending layer by layer, finding M nearest neighbors at each layer and establishing bidirectional connections. The system generates 22 new index entries for 22 knowledge blocks. Each index entry's storage structure in the index file includes: a 4-byte knowledge block identifier length prefix plus a knowledge block identifier string, a 2-byte mixed feature vector dimension prefix of 139, a mixed feature vector data block consisting of 139 4-byte floating-point numbers, and an 8-byte storage address pointer pointing to the physical storage offset of the knowledge block in the second-level cache. For the existing index entries corresponding to the 3 knowledge blocks marked as isDeleted as true in S506, the system reads the header flag bytes of these 3 index entries from the index file, rewrites the logical deletion flag bit (the 7th bit, the highest bit) of the header flag bytes from 0 to 1, without moving the physical storage location of the index entry or releasing the disk space it occupies. The system updates the index statistics structure in the second-level cache memory. The logical deletion index entry count field is increased by 3 from the original value of 2 and then updated to 5. The total index entry count field is increased by 22 from the original value of 47, minus 0 physical deletions, and then updated to 69. The logical deletion ratio is calculated as 5 ÷ 69 = 0.07246, which is approximately 7.2%.

[0172] The system determines whether to trigger an incremental index merge operation. Specifically, the system reads the preset merge threshold of 0.2, which means that a merge is triggered when the number of logically deleted index entries exceeds 20% of the total number of physical index entries. The system reads the current logical deletion ratio from the index statistics structure as 0.07246 and compares it with the merge threshold of 0.2. Since 0.07246 is less than 0.2, the condition is met, and the incremental index merge operation is not triggered. S5072 is skipped in the current update cycle and not executed. The system records the result of this check in the log file: timestamp 2026-05-24T13:00:06Z, logical deletion ratio 0.07246, merge threshold 0.2, merge trigger result: no. If the logical deletion ratio reaches 0.22 after an update, operation S5072 is triggered: The system obtains the total number of index entries in the current index file, which is 200. It divides the index into two segments of 100 entries each, with the first segment covering index entry numbers 0 to 99 and the second segment covering index entry numbers 100 to 199. For each index segment, all index entries are read from disk into a memory buffer. The system iterates through the header flag byte of each index entry in the buffer, removes entries with the logical deletion flag set to 1 from the buffer, and writes the remaining entries, arranged compactly, into a new index segment file. The first segment originally contained 15 logical deletion entries; after removal, 85 entries remained and were written to a new file. The second segment originally contained 20 logical deletion entries; after removal, 80 entries remained. Since 80 entries is less than 100 and is adjacent to the first segment, the system merges the remaining 85 entries from the first segment and the remaining 80 entries from the second segment into a new index segment of 165 entries. The system updates the index segment address array stored in the index root node, replaces the physical paths of the two old index segment files with the paths of the new merged index segment files, and calls the file system deletion interface to delete the two old index segment files to free up disk space. This merge freed up approximately 2200 bytes of space.

[0173] The system calculates the comprehensive cache value score for each knowledge block. Specifically, taking knowledge block identifier KB001 as an example, the system reads the rule change impact score calculated by S208 as 1.20, and the system's preset first weight coefficient is 0.3; the usage frequency score calculated by S207 is 0.9, and the system's preset second weight coefficient is 0.4; the rule association score calculated by S206 is 0.6, and the system's preset third weight coefficient is 0.2; the serialized byte size of KB001 in memory is 3248 bytes, which is converted to 3248 ÷ 1024 = 3.171875 kilobytes, and the system's preset fourth weight coefficient is 0.1. The system calculates the overall cache value score of KB001: 1.20 × 0.3 = 0.36, 0.9 × 0.4 = 0.36, 0.6 × 0.2 = 0.12, 3.171875 × 0.1 = 0.3171875. Subtracting 0.36 + 0.36 + 0.12 - 0.3171875 gives 0.5228125, approximately equal to 0.52. The system stores this calculated value of 0.52 in the metadata record of KB001. In this embodiment, the four weight coefficients are 0.3, 0.4, 0.2, and 0.1, with a total of 1.0. They are determined as follows: Five experts in international trade rules knowledge base management are invited to score the relative importance of four factors affecting the cache value of knowledge blocks, namely update urgency, access popularity, association breadth, and storage cost. A 4×4 pairwise comparison matrix is ​​constructed, and the eigenvector corresponding to the largest eigenvalue of the matrix is ​​calculated. After normalizing the eigenvector, four weight values ​​are obtained, which are 0.31, 0.38, 0.22, and 0.09, respectively. Taking one decimal place, the approximate values ​​are 0.3, 0.4, 0.2, and 0.1.

[0174] The system determines the storage utilization rate of the L2 cache and performs cache eviction. Specifically, the system reads the total capacity of the SSD partition where the L2 cache is located through the operating system's file system status query interface. The total capacity is 10737418240 bytes (10 gigabytes), and the used space is 7733148672 bytes (7.2 gigabytes). The storage utilization rate is calculated as 7733148672 ÷ 10737418240 = 0.7200, or 72.0%. The system reads the preset storage threshold as 0.8, or 80%. Comparing 0.72 and 0.8, 0.72 is less than 0.8, the current storage utilization rate does not exceed the threshold, and cache eviction is not triggered. The system records the storage utilization rate check result in the log file: timestamp 2026-05-24T13:00:07Z, current utilization rate 0.72, storage threshold 0.8, eviction triggered result: no. In this embodiment, the preset storage threshold of 0.8 is set based on the following: The second-level cache uses an NVMe solid-state drive, model Samsung PM9A3. Performance tests of this model under write load show that when the available space is below 20%, i.e., the storage occupancy rate exceeds 80%, the garbage collection mechanism is frequently triggered, causing the random write latency to increase from 110 microseconds to 380 microseconds, and the number of write input / output operations to decrease from 50,000 times per second to 18,000 times per second. Therefore, 0.8 is set as the performance protection threshold. If the storage occupancy rate exceeds 0.8, the system sorts all knowledge blocks in ascending order according to their comprehensive cache value score, and starts eviction from the knowledge block with the lowest score. For each evicted knowledge block, the system performs logical deletion of its index entry mark, release of mixed feature vector memory, and updates of the metadata record status field to "evicted". After each eviction, the storage occupancy rate is recalculated until the occupancy rate drops below 0.8, i.e., below 7.2 gigabytes.

[0175] The system stores all generated knowledge blocks and related data in the second-level cache. Specifically, the system creates a transaction context object and serializes the text content of 52 knowledge blocks into binary format. The serialization format is as follows: 4 bytes for a total of 52 knowledge blocks; for each knowledge block, write a 4-byte knowledge block identifier length prefix plus the knowledge block identifier string, a 4-byte text content length prefix plus a UTF-8 encoded text content byte sequence, and a 2-byte mixed feature vector dimension prefix of 139 plus a sequence of 139 4-byte floating-point numbers. The total size of the serialized data is approximately 1.8 megabytes. The system appends this binary data to the end of the second-level cache data partition file path / cache / L2 / data / kb_20260524.dat. The system also writes the updated portion of the hierarchical navigable small world graph index file to the second-level cache index partition path / cache / L2 / index / hnsw_20260524.idx.

[0176] The system serializes the grouping mapping table of the four related knowledge block groups into JSON format and writes it to the grouping mapping table file path / cache / L2 / meta / group_mapping.json. The JSON content is as follows:

[0177] {"G001":["KB005","KB016","KB018","KB022","KB023","KB034","KB035","KB041"],"G002":[...],"G003":[...],"G004":[...]};

[0178] The system updates the metadata information table of the second-level cache. This metadata information table is an SQLite database file located at the path / cache / L2 / meta / metadata.db. The database contains a knowledge block metadata table with a table structure containing 6 columns: knowledge block identifier (TEXT primary key), group identifier (TEXT, nullable), version number (TEXT, NOT null), creation time (INTEGER, storing Unix timestamp), last access time (INTEGER, storing Unix timestamp), and comprehensive cache value score (REAL, storing floating-point number). The system executes INSERT statements to insert new records for 15 newly added knowledge blocks, filling the creation time and last access time columns with the current Unix timestamp 1716555605, corresponding to May 24, 2026, 13:00:05 UTC; executes UPDATE statements to update the version number and last access time columns for 7 modified knowledge blocks; performs no SQL operations on 27 unchanged knowledge blocks; and executes UPDATE statements to set the version number column to an empty string to indicate that the knowledge blocks have been deleted. The system commits all write operations in the transaction context object to ensure atomicity and completes all operations for updating the second-level cache.

[0179] In this embodiment, the runtime example of the cross-caching level consistency verification mechanism is as follows: When the model parameter update transaction in the first-level cache is committed, the system synchronously triggers the cross-level version number synchronization process. The system checks that the target numerical entity 5% of the current ROME rank-one knowledge edit update corresponds to the knowledge block identifier KB045 in the second-level cache. The system reads the current version number of KB045 in the metadata information table of the second-level cache as KV000000000005, adds 1 to the numerical part of the version number to get KV000000000006, updates the version number column of KB045 in the second-level cache to KV000000000006, and simultaneously writes the mapping relationship between the version number KV0000000000006 and the knowledge block identifier KB045 into the version number registry. The version number registry is a hash table in the Redis in-memory database, with the key being the knowledge block identifier string and the value being the latest version number string. When the system retrieves knowledge block KB045 from the third-level cache, it first reads the version number field of KB045 from the third-level cache storage object, which is KV000000000005. Then, it sends an HGET command to the version number registry to query the latest version number of KB045, which returns KV000000000006. Since the two version number strings are not exactly equal, the system determines that the knowledge block in the third-level cache is an expired version and triggers the cache refresh process: reading the version number from the second-level cache...

[0180] The complete content of knowledge block KB045 of KV000000000006 is serialized and overwritten into the storage object of the corresponding rule in the third-level cache. The version number field in the storage object of the third-level cache is then updated to KV000000000006. Every Sunday at 3:00:00 AM, the system triggers a full consistency check task by the scheduled task. During task execution, the system scans the knowledge block identifier set of all records in the first-level cache knowledge update record table, scans all knowledge block identifiers and their version numbers in the second-level cache metadata information table where the version column is not empty, and scans the rule identifiers and their version numbers of all cached objects in the third-level cache storage layer. The system takes the union of the knowledge block identifiers of the three cache levels, and queries the version number of each knowledge block identifier in the union at each of the three levels. Using the version number in the version number registry as the base version, all cache entries with version numbers lower than the base version are marked as pending repair, and the cache synchronization function is called to repair them one by one. In this full check, a total of 52 knowledge block identifiers were scanned, and 3 entries with inconsistent versions were found, all of which were located in the third-level cache. The repair operation was to overwrite the corresponding entries in the third-level cache with the latest version of the knowledge block content in the second-level cache. All 3 repairs were completed successfully, and the total repair time was 45 milliseconds.

[0181] It should be further noted that this embodiment obtains rule data through an external API and stores it in the third-level cache using a caching strategy with decay, including:

[0182] S601. Obtain the data source identifier carried in the update rule data. The data source identifier is composed of the rule publishing agency code and the API version number.

[0183] S602. Based on the data source identifier, perform a matching query in the preset external API adaptation registry, and read the communication protocol type, authentication credential field name, authentication credential value, request body template identifier and response body parsing rule set identifier corresponding to the data source identifier.

[0184] S603. The unified API request builder is invoked. Based on the communication protocol type, the request method is determined to be either the Hypertext Transfer Protocol (HTTP) GET method or the HTTP POST method, along with the corresponding request header field set. The corresponding request body template is extracted from a pre-defined request body template library based on the request body template identifier. Placeholder markers are predefined in the request body template. The request parameter field values ​​from the update rule data are mapped and filled into the request body template according to the positions of the placeholder markers. An API call request conforming to the communication protocol type is generated. The API call request is sent to the external API server pointed to by the rule issuing agency code, and the original response data is received. In this embodiment, the construction of the pre-defined request body template library is based on the structured mapping and standardized abstraction of placeholders in the interface documents of mainstream external data sources in the international trade field. During the system initialization phase, the administrator imports the application programming interface (API) technical specification documents of various authoritative data sources through the management interface, including the third version query interface description of the World Customs Organization (WCO) TARIC API, the second version query interface description of the European Union's TARIC API, and the first version data extraction interface description of the United Nations' COMTRADE API. For each external data source, the system parses the required parameter set in its request body architecture definition, extracts the parameter names, data types, and required field tags, retains the fixed structure parts of the request body as the template skeleton, and replaces the variable parameter parts that need to be dynamically populated with placeholder tags enclosed in double curly braces. Taking the World Customs Organization TARIC application programming interface as an example, its request body template is stored in the TARIC_QUERY_TEMPLATE_v3.json file in the system template library directory. The template content is a complete JSON object string, which contains three placeholder tags: {{hs_code}} for the corresponding commodity tariff code column, {{query_date}} for the corresponding query date, and {{country_code}} for the corresponding trade partner country code. The fixed structure parts include the declaration of the query interface version and the specification of the returned data format. Each template uses a unique request body template identifier as a filename prefix and includes a version suffix. A reference relationship is established in the corresponding entry of the external application programming interface (API) adaptation registry through the request body template identifier field. When the API request builder receives the population task, it uses this identifier to accurately locate and load the corresponding template file in the template library, maps and matches the request parameter field values ​​in the update rule data according to the placeholder names, and replaces them one by one to generate a complete request body that conforms to the API communication protocol type.The template library supports hot reloading. When the external data source interface is upgraded or a backup data source is added, the administrator can upload a new template file and update the corresponding request body template identifier field in the adaptation registry to complete the expansion and update of the template library without stopping the system.

[0185] S604. Extract the corresponding response body parsing rule set from the preset parsing rule library according to the response body parsing rule set identifier. The response body parsing rule set contains at least one JSON path expression or at least one XML path expression. Use the JSON path expression to perform path matching and value extraction on the original response data, or use the XML path expression to perform node positioning and text content extraction on the original response data, and output structured rule fields. The structured rule fields include rule text, effective date, and numerical rule parameters. In this embodiment, the construction of the preset parsing rule library is based on the reverse abstraction of the response body structure of different external data sources and the standardized encapsulation of path expressions. During the initialization phase, the administrator imports the response body structure definition documents of various authoritative data sources through the management interface, including the JSON response structure description of the World Customs Organization TARIC Application Programming Interface Version 3, the XML response structure description of the European Union TARIC Application Programming Interface Version 2, and the JSON response structure description of the United Nations COMTRADE Application Programming Interface Version 1. For each external data source, the system analyzes the hierarchical path and node naming rules of the target rule field in its response body. The location paths of the rule body text field, the effective date field, the numeric rule parameter field, and the rule identifier field are written as independent path expressions. All path expressions of the same data source are aggregated into a response body parsing rule set, and stored in the system parsing rule base directory with the response body parsing rule set identifier of the data source as the file name prefix. Taking the response body parsing rule set of the World Customs Organization's TARIC application programming interface as an example, it is stored in the TARIC_RESPONSE_RULES_v3.json file under the parsing rule base directory. This file contains a JSON array with four JSON path expressions: the first path expression is $.data.tariff.description, which is used to extract the rule body text field from the tariff object under the data object of the original response data; the second path expression is $.data.tariff.effective_date, which is used to extract the effective date field; the third path expression is $.data.tariff.rate, which is used to extract the numeric rule parameter field; and the fourth path expression is $.data.metadata.regulation_id, which is used to extract the rule identifier field.Each response body parsing rule set is associated with its corresponding data source identifier in the external application programming interface (API) adaptation registry through the response body parsing rule set identifier field. When the system call parser processes the raw response data, it loads the corresponding file from the parsing rule library based on the response body parsing rule set identifier found in the adaptation registry, traverses the path expressions within the file to perform path matching and value extraction on the raw response data, and outputs structured rule fields. The parsing rule library supports hot reloading. When the external data source response body structure changes, the administrator can upload a new parsing rule set file and update the corresponding response body parsing rule set identifier field in the adaptation registry to smoothly upgrade the parsing rules without interrupting system operation.

[0186] S605. The structured rule field is input into a multi-dimensional validation pipeline. The multi-dimensional validation pipeline sequentially performs format integrity validation, numerical range validation, and cross-validation. The format integrity validation reads a preset list of required fields from the structured rule field. The list of required fields includes a rule body text field, an effective date field, and a rule identifier field. It checks whether the value of each required field is empty. If the value of any required field is empty, a format anomaly flag is output. The numerical range validation reads a preset reasonable value range associated with the numerical rule parameters and checks whether the value of each numerical rule parameter falls within the range. The corresponding preset reasonable value range is defined. If the value of any numerical rule parameter does not fall within the corresponding preset reasonable value range, a numerical anomaly mark is output. The cross-validation uses the rule identifier in the structured rule field as the query key, extracts the existing rule field value corresponding to the rule identifier from the knowledge graph associated with the pre-trained rule knowledge big language model, and compares the rule text, effective date, and numerical rule parameter in the structured rule field with the existing rule field value field by field. If there is a field value inconsistency and the current system time is not within the preset change window associated with the rule identifier, a conflict anomaly mark is output.

[0187] S607. When any one of the format exception flag, the numerical exception flag, or the conflict exception flag is generated, an exception handling process is triggered: the API call request is re-added to the request queue, the retry count value corresponding to the request is incremented by one, and when the retry count value is less than or equal to the preset maximum number of retry attempts, the waiting time is calculated according to the exponential backoff waiting time formula, which is: waiting time = base waiting time × 2. (重试计数值-1)After the waiting period, the API call request is resent. When the retry count is greater than the preset retry limit, the preset data source priority list is read, the data source identifier in the API call request is replaced with the backup data source identifier of the next priority in the data source priority list, the retry count is reset to zero, and the API call request is sent to the external API server corresponding to the backup data source identifier.

[0188] S608. When the multi-dimensional verification pipeline does not output any abnormal markers, the rule change impact score and the change type calculated in the previous step are obtained. The rule change impact score and the change type are used as a joint query key to perform a matching query in the preset decay parameter mapping table. The base lifetime value and decay rate coefficient corresponding to the joint query key are read. In the decay parameter mapping table, the higher the rule change impact score, the smaller the base lifetime value. The base lifetime value corresponding to the change type being a numerical revision is less than the base lifetime value corresponding to the change type being a clause addition or deletion. An active invalidation operation is performed on the existing cache entries in the third-level cache that use the rule identifier in the structured rule field as the index key. The status flag field of the existing cache entries is updated to the expired state, and the index key of the existing cache entries is deleted from the index table of the third-level cache. In this embodiment, the preset decay parameter mapping table adopts a two-dimensional mapping structure. Its construction is based on the analysis of the timeliness requirements of rule data under different change types and the simulation experiment of cache access mode. The system first defines the first-level key as an enumeration of change types, including four types: numerical revision, clause addition / deletion, condition change, and rule repeal. The second-level key is a continuous interval segmentation of the rule change's impact score, divided into four intervals from 0.0 to 2.0 with a step size of 0.5. For each combination of change type and impact score interval, the system extracts 200 external rule data samples matching that combination from the historical update log and calculates the average time interval and average effective reference duration of these samples when queried in the third-level cache. For the numerical revision type with an impact score in the range of 1.0 to 1.5, statistics show that the frequency of rule data under this combination being re-accessed by new query requests after an average of 1800 seconds drops to less than 37% of the initial frequency. Furthermore, the interval between the actual effective date and the publication date of this type of rule is usually within 30 calendar days, making the requirement for cache timeliness the most urgent. Therefore, the basic lifetime value is set to 1800 seconds. The decay rate coefficient of 0.0005 was determined by fitting an exponential decay model to the cache access sequence. The system used a base lifetime of 1800 seconds and a preset expiration threshold of 300 seconds as boundary conditions to solve for the parameter in the decay formula where the remaining lifetime should be slightly lower than the expiration threshold when the time equals twice the base lifetime. Simultaneously, before actual deployment, the Monte Carlo method was used to simulate the cache hit rate versus data freshness balance curve under 1000 different access patterns to verify that the decay rate coefficient of 0.0005 ensures that the average actual lifetime of cache entries falls near the optimal point. The final decay parameter mapping table is stored in the `decay_params.json` file in the system configuration directory in JSON format, allowing the system to precisely match and read it using a join query key when configuring the third-level cache storage object.

[0189] S609. Construct a third-level cache storage object. The data structure of the third-level cache storage object includes the structured rule field, the basic lifetime value, the decay rate coefficient, the current system timestamp, and the rule identifier. Read the preset hot data threshold and warm data threshold, and compare the rule change impact score with the hot data threshold and the warm data threshold. When the rule change impact score is greater than or equal to the hot data threshold, store the third-level cache storage object in the hot data storage layer of the third-level cache. The hot data storage layer uses a solid-state drive as the storage medium. When the rule change impact score is less than the hot data threshold but greater than or equal to the warm data threshold, store the third-level cache storage object in the warm data storage layer of the third-level cache. The warm data storage layer uses a mechanical hard drive as the storage medium. When the rule change impact score is less than the warm data threshold, store the third-level cache storage object in the cold data storage layer of the third-level cache. The cold data storage layer uses object storage as the storage medium.

[0190] S610. When the third-level cache storage object in the third-level cache is queried, record the timestamp of this call, and calculate the decayed current lifetime value according to the decay formula, which is: decayed current lifetime value = base lifetime value × e (-衰减速率系数×(本次调用时间戳-当前系统时间戳)) , where e is a natural constant; if the calculated current lifetime value after decay is lower than the preset failure threshold, the third-level cache storage object is marked as invalid, and an asynchronous pre-update request is generated based on the rule identifier. The asynchronous pre-update request is added to the pre-update request queue, and an independent pre-update thread retrieves the asynchronous pre-update request from the pre-update request queue, triggers an early external API call for the rule identifier, and re-executes the multi-dimensional verification pipeline and updates the third-level cache storage object with the update rule data returned by the call.

[0191] Next, a specific complete example will be used to illustrate the entire process. The example is only to illustrate the feasibility at the computational level and does not represent the actual values. The specific values ​​can be determined by those skilled in the art through simulation experiments or physical experiments. In this embodiment, a complete example of obtaining rule data through an external API and storing it in the third-level cache with a decay caching strategy is as follows: The system takes an independent external knowledge base update operation as an example. The data source identifier carried in the updated rule data is WCO_TARIC_v3. The external API server corresponding to this identifier is the application programming interface of the World Customs Organization TARIC tariff database.

[0192] The system reads the string field "Data Source Identifier" from the data structure of the update rule data. Its value is "WCO_TARIC_v3". Specifically, the system calls a string splitting function to split the string using the predefined delimiter constant "_", resulting in a string array of length 2. The first element, "WCO", serves as the rule issuing organization code, and the second element, "TARIC_v3", serves as the API version number. The rule issuing organization code "WCO" corresponds to the World Customs Organization, and the API version number "TARIC_v3" indicates the third version of the TARIC query interface for this external API. This version information is published by the World Customs Organization on its developer portal and imported by the system administrator through a configuration file during system initialization. In this embodiment, the data source identifier is concatenated using the following rules: the rule issuing organization code and the API version number are connected by an underscore, and the rule issuing organization code is uniformly represented by uppercase English letters. The API version number is represented by "_v" followed by a number, ensuring the global uniqueness and resolvability of the identifier.

[0193] The system uses "WCO_TARIC_v3" as the key to perform an exact match query for the key name in the preset external API adaptation registry. Specifically, the external API adaptation registry is stored as a JSON file in the system configuration directory " / config / api_registry.json". This file contains a top-level JSON object whose key is the data source identifier string and the value is the adaptation configuration object. The adaptation configuration object contains five required fields: The "protocol" field has the string "HTTPS_POST", indicating that a secure Hypertext Transfer Protocol (HTTP) is used and the request method is POST; the "auth_header" field has the string "X-API-Key", indicating that authentication credentials must be placed in the "X-API-Key" field of the HTTP request header; the "auth_value" field has the 48-character hexadecimal string "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6", which is assigned and encrypted by the World Customs Organization during developer registration and stored in the system's key management service; the "request_template" field has the string "TARIC_QUERY_TEMPLATE_v3", a unique identifier pointing to the request body template; and the "response_parser" field has the string "TARIC_RESPONSE_RULES_v3", a unique identifier pointing to the response body parsing rule set. The system stores these five field values ​​into corresponding temporary variables for later use. In this embodiment, the external API adaptation registry is maintained by the system administrator through the management interface. When adding a new external data source, the administrator needs to add the corresponding entry in the registry and verify the connection before it can take effect. The registry supports hot reloading and does not require restarting the system.

[0194] The system calls the unified API request builder to generate and send an HTTP request. Specifically, the request builder first determines to use the POST method based on "HTTPS_POST" and constructs a request header set: setting "Content-Type" to "application / json"; setting "X-API-Key" to "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"; and setting "Accept" to "application / json". Subsequently, the request builder loads the file "TARIC_QUERY_TEMPLATE_v3.json" from the template library directory " / templates / api_requests / " based on the template identifier "TARIC_QUERY_TEMPLATE_v3". The content of this file is a JSON string template: "{"hs_code":"{{hs_code}}","query_date":"{{query_date}}","country_code":"{{country_code}}"}". The system extracts the request parameter fields from the update rule data: the commodity tariff code "01012100", the query date "2026-05-24", and the trade partner country code "CN". It then performs template filling, replacing "{{hs_code}}" with "01012100", "{{query_date}}" with "2026-05-24", and "{{country_code}}" with "CN", resulting in the complete request body string. The request builder initializes an HTTPS connection using the libcurl library, setting the target URL to "https: / / api.wcoomd.org / taric / v3 / query", the connection timeout to 10000 milliseconds, the total timeout to 30000 milliseconds, and the request method to POST. It appends the request body string and request headers to the request, sends the request, and then synchronously waits for a response. The system receives HTTP status code 200 and a response body after 1820 milliseconds. The original response body data is a 4520-byte UTF-8 encoded JSON string. In this embodiment, the request builder also incorporates request replay protection, generating a unique idempotency key "Idempotency-Key" for each request and placing it in the request header to avoid data duplication due to network retransmissions.

[0195] The system loads the file "TARIC_RESPONSE_RULES_v3.json" from the parsing rule set identifier "TARIC_RESPONSE_RULES_v3" in the parsing rule base directory " / rules / api_responses / ". This file contains a JSON array, where each element is a path expression object. The system iterates through the array, parsing the original response data string. Specifically, it first uses the RapidJSON parser to parse the original response data into a DOM tree, then applies five JSON path expressions in sequence: the first, ".data.tariff.rate", extracts the tariff rate value 5.0; the second, ".data.tariff.effective_date", extracts the effective date string "2026-06-01"; the third, ".data.tariff.description", extracts the rule text "The import tariff rate for improved breeding horses originating from country A is adjusted to five percent", and extracts the tariff rate unit "percentage"; the fifth, "$.data.metadata.regulation_id", extracts the rule identifier "WCO_2026_CN_TARIFF_001". The system combines these values ​​into a structured rule field structure, which contains the following fields: the rule text is a string, the effective date is an ISO8601 date format string, the numeric rule parameter contains the value 5.0 and the unit "percentage", and the rule identifier is a string. In this embodiment, the parsing rule set supports hot updates, allowing administrators to adapt to changes in the external API response format by uploading new rule set files without stopping the system.

[0196] The system inputs structured rule fields into a multi-dimensional validation pipeline, specifically: this validation pipeline uses a chain-of-responsibility model to connect three validators. The format integrity validator receives the structured rule fields, reads the system's preset list of required fields (rule text, effective date, rule identifier), and checks each field value for an empty string or NULL. If all three fields are not empty, the validation passes. The numerical range validator reads the numerical rule parameter 5.0 and its associated preset reasonable value range [0, 100] (based on the legal range of tariff rates being 0% to 100%). If 5.0 is within the range, the validation passes. The cross-validator uses the rule identifier "WCO_2026_CN_TARIFF_001" as the query key and sends a Cypher query to the graph database through the Neo4jBolt driver to retrieve the stored rule field values: the text is "The import tariff rate for improved breeding horses originating from country A is adjusted to eight percent", the effective date is "2025-01-01", and the tariff rate is 8.0%. The cross-validator compared each field and found that the main text and the tax rate were different. Furthermore, the current system time "2026-05-24" was not within the preset change window associated with this rule, which is "30 days before or after January 1st each year." Therefore, a conflict anomaly flag was output, with the flag type being "non-window conflict." In this embodiment, the preset change window is specified by the rule-issuing agency in its announcement. The system automatically updates the window configuration by crawling official announcements. For this tariff adjustment, the official announcement's revised effective date is June 1, 2026, while the system knows the window only covers up to January 30th; therefore, it was correctly identified as an anomaly.

[0197] Because a conflict exception flag was triggered, the system executed the exception handling process, specifically: The system retrieved the retry count value corresponding to the request from the request context (initially 0), and incremented it by 1 to make it 1. The system read the global configuration: the preset maximum number of retries is 3, and the base waiting time is 2000 milliseconds. Since 1 ≤ 3, the system calculated the waiting time: base waiting time 2000... 2 (1-1)=2000 milliseconds. The system serializes the current API call request object and stores it in the Redis message queue "api_retry_queue", setting the delivery delay time to 2000 milliseconds. After 2000 milliseconds, the message queue consumer retrieves the request and re-executes S603 to S605. If subsequent retries still fail until the count reaches 4 (exceeding the upper limit of 3), the system reads the preset data source priority list (an array ["WCO_TARIC_v3","EU_TARIC_v2","UN_COMTRADE_v1"] in the configuration file). The current data source identifier is the first element of the list. The system retrieves the next element "EU_TARIC_v2" to replace the data source identifier in the request, resets the retry count to 0, and then sends a request to the EU TARICAPI. In this embodiment, the data source priority list is sorted according to the authority, timeliness, and availability of the data source. The World Customs Organization, as the primary data source, has the highest priority, followed by the EU database as an alternative, and the United Nations database as the last backup.

[0198] Assuming that after one retry, the multi-dimensional validation pipeline no longer outputs anomaly markers (e.g., external API return data matches the window period or is manually confirmed as a reasonable change), the system enters the cache decay parameter configuration. Specifically, the system obtains the previously calculated rule change impact score of 1.20 and the change type "numerical revision". The system uses these two values ​​as composite keys to look up the data in the two-dimensional mapping table in the configuration file " / config / decay_params.json". The first-level key of this mapping table is the change type, and the second-level key is the impact score range. For the type "numerical revision", the system locates the sub-table and matches the impact score range "1.0-1.5", obtaining a base lifetime value of 1800 seconds and a decay rate coefficient of 0.0005. The rationale for this setting is that numerical revisions usually require rapid confirmation, and a high impact score exacerbates this urgency; therefore, a shorter base lifetime of 1800 seconds is configured. The coefficient of 0.0005 was selected after simulating cache access patterns, enabling the cache to decay to near the expiration threshold within approximately twice the base lifetime. Then, the system performs proactive invalidation on the existing cache entry in the third-level cache with the index key "WCO_2026_CN_TARIFF_001": a DEL command is sent in the Redis cache management platform to delete the key, and the metadata table is updated to mark the entry as "expired". In this embodiment, the proactive invalidation operation is atomic, avoiding the reading of dirty data.

[0199] The system constructs a third-level cache storage object, specifically defined using ProtocolBuffers to define a message format containing the following fields: structured rule field (nested message), basic time-to-live value (int32), decay rate coefficient (float), current system timestamp (int64), and rule identifier (string). The system fills in the values ​​of each field; the current system timestamp is taken from the Unix seconds obtained by the system call clock_gettime, which is 1716555608. The system reads preset hot data thresholds of 0.8 and warm data thresholds of 0.3. These two thresholds are derived from cluster analysis of access patterns of 2000 external rule data: data with an impact score ≥0.8 is accessed an average of 15.3 times in 24 hours, suitable for SSDs; data between 0.3 and 0.8 is accessed an average of 4.1 times, suitable for HDDs; and data <0.3 is accessed an average of 0.7 times, suitable for object storage. The current impact score is 1.20, ≥0.8, therefore the storage object is serialized into binary and written to the hot data storage layer. The hot data storage layer corresponds to the mounted NVMeSSD partition " / mnt / cache / L3 / hot / ", and the filename uses the MD5 hash value of the rule identifier "a3f2b1c9d4e5f6a7b8c9d0e1f2a3b4c5.bin" to ensure even distribution. Simultaneously, the system inserts a record into the index table (RocksDB) of the third-level cache, with the rule identifier as the key and the file path and metadata as the value. In this embodiment, the tiered storage strategy allows the system to dynamically migrate data based on access patterns; when the data access frequency decreases, it can automatically degrade from the hot layer to a warm or cold layer.

[0200] Simulate a query call: When the system receives a query request at 14:30:00 on May 24, 2026 (timestamp 1716561000), it locates the hot storage layer file through the index table and loads the storage object. Record the timestamp of this call as 1716561000, and calculate the current lifetime value after decay: base lifetime 1800. exp(-0.0005 (1716561000-1716555608))=1800 exp(-0.0005 5392)=1800 exp(-2.696)≈1800 0.0676 = 121.7 seconds. The system's preset expiration threshold is 300 seconds (based on user experience, cached data is at higher risk when its remaining lifespan is less than 5 minutes). 121.7 < 300, therefore, the cached object is deemed invalid. The system marks the cached object as invalid and sends a message containing a rule identifier and high priority to the pre-update request queue "prefetch_queue". A thread in an independent pre-update thread pool retrieves the message from the queue and executes the complete external API retrieval and cache refresh process from S601 to S609. The entire process takes approximately 2.1 seconds. During this time, the query request uses the old cached data as a fallback return, and switches to the new data after the refresh is complete. In this embodiment, the asynchronous pre-update mechanism ensures that even if the cache is about to expire, the system can fetch the latest data in advance, reducing the latency perceived by the user, while ensuring service availability through fallback returns.

[0201] Example 3

[0202] This invention provides an embodiment of a text processing system based on multimodal feature fusion, comprising:

[0203] The text processing module is configured to: acquire raw rule data and updated rule data, extract text features, structure graph features and table features respectively, and align and fuse the features of each modality through a multimodal feature fusion network using a cross-attention mechanism to generate multimodal fusion features;

[0204] The scoring module is configured to: identify the change type of rule change based on the multimodal fusion features, and calculate the rule change impact score by weighted summation of rule range score, rule depth score, rule association score and usage frequency score;

[0205] The multi-level caching decision module is configured to: determine the change level based on the rule change impact score, input the change level and the multimodal fusion feature into the decision tree-enhanced neural network model, and output the update method decision result, wherein the update method includes model parameter update, high-frequency knowledge base update and external knowledge base update;

[0206] When the decision is to update the model parameters, perform either multi-level LoRA fine-tuning or ROME-based rank-one knowledge editing, wherein multi-level LoRA fine-tuning selectively adjusts the parameters of the affected layer according to the type of change, and stores the updated knowledge in the first-level cache.

[0207] When the decision is to update the high-frequency knowledge base, the update rule data is semantically and structurally segmented to generate knowledge blocks, a hybrid vector index is constructed and stored in the second-level cache;

[0208] When the decision is to update an external knowledge base, rule data is obtained through an external API and stored in the third-level cache using a decaying caching strategy.

[0209] Example 4

[0210] An electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement a text processing method based on multimodal feature fusion.

[0211] A computer-readable storage medium having computer instructions stored thereon, which, when executed, perform a text processing method based on multimodal feature fusion.

[0212] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments under the guidance of the present invention without departing from the spirit and scope of protection of the present invention. All of these variations are within the scope of protection of the present invention.

Claims

1. A text processing method based on multimodal feature fusion, characterized in that, include: The original rule data and updated rule data are obtained, and text features, structure graph features and table features are extracted respectively. The multimodal feature fusion network is used to align and fuse the features of each modality using a cross-attention mechanism to generate multimodal fused features. Based on the multimodal fusion features, the change type of the rule change is identified, and the rule change impact score is calculated by weighted summation of rule range score, rule depth score, rule association score and usage frequency score; The change level is determined based on the rule change impact score. The change level and the multimodal fusion feature are input together into the decision tree-enhanced neural network model, and the update method decision result is output. The update method includes model parameter update, high-frequency knowledge base update and external knowledge base update. When the decision is to update the model parameters, perform either multi-level LoRA fine-tuning or ROME-based rank-one knowledge editing, wherein multi-level LoRA fine-tuning selectively adjusts the parameters of the affected layer according to the type of change, and stores the updated knowledge in the first-level cache. When the decision is to update the high-frequency knowledge base, the update rule data is semantically and structurally segmented to generate knowledge blocks, a hybrid vector index is constructed and stored in the second-level cache; When the decision is to update the external knowledge base, the rule data is obtained through the external API and stored in the third-level cache with a decaying caching strategy. The generated multimodal fusion features include: Modal parsing is performed on the original rule data and the updated rule data respectively to extract text feature vectors representing semantic continuity and context dependence, structural graph feature vectors representing topological constraints and dependent paths between nodes, and table feature vectors representing numerical precision and key-value correspondence under row and column alignment. In the cross-attention mechanism, the text feature vector is used as the query vector, the structure graph feature vector is used as the first key vector and the first value vector to calculate the text-structure cross-modal attention weight matrix, and the table feature vector is used as the second key vector and the second value vector to calculate the text-table cross-modal attention weight matrix. The proportion of numerical elements in the table feature vector is counted. When the proportion is lower than a preset threshold, the table modality is determined to be a sparse modality. Sparse constraints are applied to the text-table cross-modal attention weight matrix. The sparse constraints construct a binary mask matrix using the numerical labels of each element position in the table feature vector. The binary mask matrix is ​​multiplied element-wise with the text-table cross-modal attention weight matrix to retain the attention weights corresponding to the numerical elements and reset the attention weights corresponding to the non-numerical elements to zero. The structure-aligned representation is obtained by weighting and summing the text-structure cross-modal attention weight matrix with the first value vector, and the table-aligned representation is obtained by weighting and summing the text-table cross-modal attention weight matrix after sparse constraints with the second value vector. The structural alignment representation and the table alignment representation are respectively subjected to residual connection and layer normalization with the text feature vector to obtain structural fusion features and table fusion features; The text change significance score, structure change significance score, and table change significance score are calculated based on the gradient change rate of the text feature vector, the topological difference of the structure graph feature vector, and the numerical deviation of the table feature vector, respectively. The three significance scores of change are input into a normalized exponential function to generate text modality gating coefficients, structural modality gating coefficients, and table modality gating coefficients. The text feature vector, the structural fusion feature, and the table fusion feature are weighted and summed according to the text modality gating coefficients, the structural modality gating coefficients, and the table modality gating coefficients to output the multimodal fusion feature.

2. The text processing method based on multimodal feature fusion as described in claim 1, characterized in that, The changes in the calculation rules affect the score, including: The multimodal fusion features are input into a change type classifier consisting of a first fully connected layer and a normalized exponential function. The first fully connected layer maps the multimodal fusion features into a classification vector with a dimension equal to the preset number of change types. The normalized exponential function calculates the probability value corresponding to each element in the classification vector. The preset change type corresponding to the maximum probability value is determined as the change type of the rule change. The preset change types include numerical revision, clause addition / deletion, condition change, and rule repeal.

3. The text processing method based on multimodal feature fusion as described in claim 2, characterized in that, The weighted summation of the rule change impact score based on rule range score, rule depth score, rule association score, and usage frequency score includes: Based on the change type, a matching query is performed in a pre-built type-weight mapping table to obtain the range weight coefficient, depth weight coefficient, association weight coefficient, and usage frequency weight coefficient corresponding to the change type. In the type-weight mapping table, the usage frequency weight coefficient corresponding to the numerical revision type is configured to be greater than its association weight coefficient, and the association weight coefficient corresponding to the clause addition / deletion type is configured to be greater than its usage frequency weight coefficient.

4. The text processing method based on multimodal feature fusion as described in claim 3, characterized in that, The weighted summation of the rule change impact score based on the rule range score, rule depth score, rule association score, and usage frequency score also includes: The multimodal fusion features are respectively input into the rule range feature extractor, rule depth feature extractor, rule association feature extractor and usage frequency feature extractor to obtain the rule range sub-feature vector, rule depth sub-feature vector, rule association feature vector and usage frequency sub-feature vector in sequence; The rule range sub-feature vector is input into the second fully connected layer, and the rule range score, which represents the number of rule entries involved in the rule change, is output. The rule depth sub-feature vector is input into the third fully connected layer, and the rule depth score, which represents the level depth of the rule change in the rule hierarchy tree, is output.

5. The text processing method based on multimodal feature fusion as described in claim 4, characterized in that, The weighted summation of the rule change impact score based on the rule range score, rule depth score, rule association score, and usage frequency score also includes: The rule-related sub-feature vector is input into the fourth fully connected layer, and the rule association score, which represents the number of association rules that have a reference dependency relationship with the change, is output. The usage frequency sub-feature vector is input into the fifth fully connected layer, and the usage frequency score, which represents the total number of times the rule involved in the change is queried and invoked within a preset historical period, is output. The rule range score is multiplied by the range weight coefficient, the rule depth score is multiplied by the depth weight coefficient, the rule association score is multiplied by the association weight coefficient, and the usage frequency score is multiplied by the usage frequency weight coefficient. The sum of the four products is used to obtain the rule change impact score.

6. The text processing method based on multimodal feature fusion as described in claim 5, characterized in that, The output update method decision result includes: The rule change impact score is compared with a pre-defined level threshold range to determine the change level. The level threshold range includes a first threshold, a second threshold, and a third threshold. When the rule change impact score is greater than or equal to the first threshold, it is determined to be a first change level. When the rule change impact score is greater than or equal to the second threshold and less than the first threshold, it is determined to be a second change level. When the rule change impact score is greater than or equal to the third threshold and less than the second threshold, it is determined to be a third change level. When the rule change impact score is less than the third threshold, it is determined to be a fourth change level. The change level is encoded as a one-hot vector, and the one-hot vector is concatenated with the multimodal fusion feature to obtain the decision input vector.

7. The text processing method based on multimodal feature fusion as described in claim 6, characterized in that, The output update method decision result also includes: The decision input vector is input into a decision tree-enhanced neural network model, which includes decision tree layers and neural subnetwork layers. In the decision tree layer, the change level is used as the branch condition to route the decision input vector to the branch path corresponding to the change level, and each branch path is set with an independent path weight matrix. In the neural sub-network layer, after the decision input vector is linearly transformed using the path weight matrix, three original decision scores corresponding to model parameter updates, high-frequency knowledge base updates, and external knowledge base updates are output through activation functions and fully connected layers.

8. The text processing method based on multimodal feature fusion as described in claim 7, characterized in that, The output update method decision result also includes: Obtain the storage occupancy rate of each cache in the current knowledge base, the amount of currently available graphics processor computing power resources, and the timestamp of the last update execution; calculate the update resource constraint vector based on the storage occupancy rate, computing power resources, and timestamp. The updated resource constraint vector is weighted element-wise with the three original decision scores to obtain the modified decision score. The modified decision score is then input into a normalized exponential function to output the execution probability of each update method. The update method with the highest execution probability is determined as the decision result of the update method.

9. The text processing method based on multimodal feature fusion as described in claim 8, characterized in that, The execution of rank-one knowledge editing based on multi-level LoRA fine-tuning or ROME includes: Determine whether the change type belongs to numerical revision or rule repeal. If so, perform rank-one knowledge editing based on ROME. If the change type belongs to clause addition or deletion or condition change, perform fine-tuning based on multi-level LoRA. When performing rank-one knowledge editing based on ROME, the target numerical entity and the original numerical value corresponding to the target numerical entity in the original rule data are extracted from the multimodal fusion features. The target numerical entity and the original numerical value are input into each feedforward layer of the pre-trained rule knowledge big language model. The target numerical entity is used as input and the original numerical value is used as output. The causal attribution score of each hidden state dimension in each feedforward layer to the original numerical value is calculated.

10. The text processing method based on multimodal feature fusion as described in claim 9, characterized in that, The execution of rank-one knowledge editing based on multi-level LoRA fine-tuning or ROME also includes: The feedforward layer containing the maximum causal attribution score is determined as the target editing layer, and the hidden state dimension interval corresponding to the maximum causal attribution score in the target editing layer is determined as the target neuron location. The difference between the updated value of the target numerical entity in the update rule data and the original value is calculated. A rank-one update vector is generated based on the difference. The weight matrix corresponding to the position of the target neuron in the target editing layer is added element by element to the rank-one update vector to obtain the updated weight matrix, thus completing the rank-one knowledge editing.

11. The text processing method based on multimodal feature fusion as described in claim 10, characterized in that, The execution of rank-one knowledge editing based on multi-level LoRA fine-tuning or ROME also includes: When performing multi-level LoRA fine-tuning, a matching query is performed in the preset type-level mapping table according to the change type to obtain the set of affected layers corresponding to the change type. In the type-level mapping table, the set of affected layers corresponding to the clause addition / deletion type includes the self-attention layer and the feedforward layer, and the set of affected layers corresponding to the condition change type includes the feedforward layer. In each layer contained in the affected layer set, a first low-rank decomposition matrix and a second low-rank decomposition matrix are inserted into the query projection matrix and value projection matrix of that layer, respectively; Using the multimodal fusion features as fine-tuning input and the text feature vector corresponding to the update rule data as fine-tuning target, forward and backward propagation are performed on the first low-rank decomposition matrix and the second low-rank decomposition matrix to update the matrix element values ​​of the first low-rank decomposition matrix and the second low-rank decomposition matrix, and all model parameters outside the affected layer set are frozen.

12. The text processing method based on multimodal feature fusion as described in claim 11, characterized in that, The execution of rank-one knowledge editing based on multi-level LoRA fine-tuning or ROME also includes: The change type, the hierarchical identifier of the target editing layer, and the dimensional interval index of the target neuron location are used as the first knowledge update record, or the change type and the hierarchical identifier of each layer in the affected layer set are used as the second knowledge update record. The first knowledge update record or the second knowledge update record is associated with the updated model parameters and stored in the first-level cache. The first knowledge update record and the second knowledge update record are used to allow the rule knowledge big language model to query the edited model region when it is updated in the future within a preset time period, so as to adjust the search space of the causal attribution score.

13. A text processing system based on multimodal feature fusion, used to implement the text processing method based on multimodal feature fusion as described in any one of claims 1-12, characterized in that, include: The text processing module is configured to: acquire raw rule data and updated rule data, extract text features, structure graph features and table features respectively, and align and fuse the features of each modality through a multimodal feature fusion network using a cross-attention mechanism to generate multimodal fusion features; The scoring module is configured to: identify the change type of rule change based on the multimodal fusion features, and calculate the rule change impact score by weighted summation of rule range score, rule depth score, rule association score and usage frequency score; The multi-level caching decision module is configured to: determine the change level based on the rule change impact score, input the change level and the multimodal fusion feature into the decision tree-enhanced neural network model, and output the update method decision result, wherein the update method includes model parameter update, high-frequency knowledge base update and external knowledge base update; When the decision is to update the model parameters, perform either multi-level LoRA fine-tuning or ROME-based rank-one knowledge editing, wherein multi-level LoRA fine-tuning selectively adjusts the parameters of the affected layer according to the type of change, and stores the updated knowledge in the first-level cache. When the decision is to update the high-frequency knowledge base, the update rule data is semantically and structurally segmented to generate knowledge blocks, a hybrid vector index is constructed and stored in the second-level cache; When the decision is to update an external knowledge base, rule data is obtained through an external API and stored in the third-level cache using a decaying caching strategy.

14. A computer-readable storage medium, characterized in that, It stores computer instructions, which, when executed, perform the text processing method based on multimodal feature fusion as described in any one of claims 1-12.

Citation Information

Patent Citations

  • Method for updating knowledge base of large language model in combination with document and interactive feedback

    CN120763272B

  • Multi-level cache and self-feedback driven retrieval enhancement generation reasoning acceleration system

    CN121981251A

  • Knowledge data classification multi-modal reasoning evolution system based on depth model

    CN119862961A

  • Multi-modal bill processing method based on dynamic knowledge enhancement

    CN120470018A