Archives intelligent question answering and automatic registration method and system based on large language model

By encoding archival business rules and data into vectors using a large language model and establishing a bijective mapping relationship, the problem of synchronous correction of data and rules in traditional archival management systems is solved. This achieves highly consistent automatic recording and query accuracy, and improves data reliability and version management capabilities.

CN122633640APending Publication Date: 2026-08-25BEIJING HANGXING YONGZHI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610810035.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-05
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Traditional record management systems lack in-depth collaboration and dynamic verification capabilities during the query and cataloging process, making it difficult to synchronize and correct data and rules, which affects data quality, consistency and credibility. Furthermore, manual correction is inefficient and prone to errors.

Method used

A large language model is used to encode archival business rules and raw data into rule vectors and data vectors, establish a bijective mapping relationship, identify fields that need to be corrected through tensor shrinkage operation and semantic gradient, and propagate the bibliographic correction in the association graph to generate a bibliographic version chain.

Benefits of technology

It achieves highly consistent automatic cataloging of archival data, reduces semantic bias and rule conflicts, improves query accuracy and data reliability, and enhances version management capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122633640A_ABST
    Figure CN122633640A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of archive management, in particular to an archive intelligent question-answering and automatic recording method and system based on a large language model. The method encodes archive business rules and original data into rule vectors and data vectors, and establishes a bijective mapping relationship to generate a reciprocal coding space. By encoding the query request into a query tensor, the tensor contraction operation is used to constrain the reasoning path, and the reconstruction is triggered when the rule is violated to generate the reasoning result. Then, the semantic gradient is calculated to identify and correct the recording field, and the correction is propagated in the association graph, and the rule is used to make a decision when there is a conflict. Finally, the field difference set is calculated, marked, merged and written to generate a recording version chain. The application realizes the intelligent linkage of question-answering and recording, and improves the automation degree and data consistency of archive processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of archival management technology, and in particular to an intelligent question-answering and automatic cataloging method and system for archives based on a large language model. Background Technology

[0002] Traditional record management systems typically employ keyword-based matching for retrieval, combined with predefined data entry templates or rule engines, to handle record queries and cataloging. When a user submits a query, the system searches the database and returns relevant record entries. For cataloging, the record administrator must manually verify the record content according to business rules and then fill in or correct it in the system.

[0003] Current practices treat data processing and rule execution as two relatively independent processes. Archival data is stored in a database, while business rules are typically maintained separately in the form of program code, configuration files, or natural language documents. This separation makes it difficult for the system to achieve deep collaboration and dynamic verification between data and rules when performing complex queries or intelligent processing. The query process relies on pre-set indexes and matching logic, lacking the ability to follow and reason about the inherent logic of business rules in real time, making it difficult to handle semantically complex queries or queries requiring multi-step logical deduction.

[0004] When archival cataloging information needs to be revised based on new discoveries or rules, traditional methods often require manual identification of all related archives and individual modification. This process is not only inefficient but also highly susceptible to human error, leading to contradictions or inconsistencies in the cataloging information between related archives. There is a lack of a mechanism to automatically and accurately identify the scope of the revision, synchronously and coordinately propagate changes among related archives, and ensure that all modifications comply with established business rules. This affects the overall quality, consistency, and reliability of archival data, and also creates difficulties for version management and traceability. Summary of the Invention

[0005] The embodiments of the present invention provide a method and system for intelligent question answering and automatic cataloging of archives based on a large language model, which can solve the problems in the prior art.

[0006] A first aspect of this invention provides a method for intelligent question answering and automatic cataloging of archives based on a large language model, comprising:

[0007] Obtain the original data and business rules of the archives, encode the business rules and original data of the archives into rule vectors and data vectors, establish a bijective mapping relationship between the rule vectors and data vectors, and generate a reciprocal encoding space;

[0008] Upon receiving a file query request, the request is encoded into a query tensor in the reciprocal encoding space. The inference path of the rule vector and the data vector is constrained simultaneously through tensor contraction operation. When the rule vector violates the file business rules after being restored by bijective mapping, tensor reconstruction is triggered to generate the inference result.

[0009] The semantic gradient of the reasoning result relative to the original archival data in the inverse coding space is calculated, and the recording fields that need to be corrected are identified along the direction of the semantic gradient, and recording instructions are generated.

[0010] According to the cataloging instructions, the cataloging correction is propagated to the related archives in the archive association map according to the topological distance. When a conflict occurs in the propagation path, the archive business rules are restored through bijective mapping and the decision is executed to generate cataloging data.

[0011] Calculate the field difference set between the catalog data and the original archival data, mark the field difference set with timestamps and inference traceability identifiers, merge the marked difference set with the unmodified fields and write them, and concatenate the written records into a catalog version chain.

[0012] Archival business rules and original archival data are encoded into rule vectors and data vectors, respectively. A bijective mapping relationship is established between the rule vectors and data vectors to generate a reciprocal encoding space, including:

[0013] Dependency parsing is performed on the archival business rules to extract the constraints and rule dependencies, construct a rule dependency graph, encode the constraint nodes in the rule dependency graph into a set of constraint vectors, encode the rule dependencies into a relation matrix, and generate rule vectors through tensor multiplication of the constraint vector set and the relation matrix;

[0014] Semantic parsing is performed on the original data of the archives to extract entities and entity attributes. Entities are encoded into sets of entity vectors and entity attributes are encoded into attribute tensors. The projection coordinates of the entity vector sets in the attribute tensor space are calculated and the projection coordinates are used as data vectors.

[0015] Based on rule vectors and data vectors, a forward mapping function and an inverse mapping function are constructed. The forward mapping function maps the rule vectors to the semantic space where the data vectors are located to generate a constraint subspace. The inverse mapping function maps the data vectors back to the rule space where the rule vectors are located to generate a verification subspace.

[0016] Calculate the composite mapping error of the forward mapping function and the inverse mapping function. When the composite mapping error is lower than the preset error threshold, it is confirmed that the forward mapping function and the inverse mapping function constitute a bijective mapping relationship, and a reciprocal encoding space is generated.

[0017] In the reciprocal encoding space, the file query request is encoded as a query tensor. Tensor contraction operations simultaneously constrain the inference paths of both the rule vector and the data vector. When the rule vector, after being restored by bijective mapping, violates the file business rules, tensor reconstruction is triggered, generating inference results including:

[0018] Semantic parsing is performed on the file query request to extract the query intent and query constraints. The query intent is encoded into an intent vector, and the query constraints are encoded into a constraint tensor. The tensor outer product of the intent vector and the constraint tensor is calculated to generate the query tensor.

[0019] Tensor contraction is performed on the query dimension of the query tensor and the constraint dimension of the rule vector, and the contracted rule response vector sequence is calculated as the rule inference path; tensor contraction is performed on the intent dimension of the query tensor and the semantic dimension of the data vector, and the contracted data matching vector sequence is calculated as the data inference path.

[0020] Extract the intermediate rule response vector from the rule response vector sequence, restore the intermediate rule response vector to the rule expression through bijective mapping, and determine whether the rule expression violates the archival business rules.

[0021] When a rule expression violates the archive business rules, the corresponding dimension index of the violation location in the query tensor is calculated, and tensor decomposition and reorganization operations are performed on the query tensor based on the dimension index to generate a reconstructed query tensor.

[0022] The reconstructed query tensor is re-operated with tensor shrinkage to generate a corrected rule response vector sequence and a corrected data matching vector sequence. The corrected rule response vector sequence and the corrected data matching vector sequence are then fused to generate the inference result.

[0023] When a rule expression violates a record business rule, the corresponding dimension index of the violation location in the query tensor is calculated. Based on the dimension index, tensor decomposition and reorganization operations are performed on the query tensor to generate a reconstructed query tensor, which includes:

[0024] When a rule expression violates the archival business rules, the sequence position of the constraint that violates the archival business rules in the rule response vector sequence is extracted, and the sequence position is converted into the dimension index and index range of the query tensor through coordinate mapping;

[0025] Based on the dimension index and index range, extract the violation dimension slice from the query tensor, perform tensor decomposition on the violation dimension slice to obtain the tensor component set, calculate the inner product similarity between each tensor component in the tensor component set and the archive business rule vector, and divide the tensor component set into the retained component set and the violation component set according to the inner product similarity.

[0026] Extract compliance vectors corresponding to constraints from the archival business rules, perform tensor expansion on the compliance vectors to generate compliance tensor components, calculate the tensor inner product of the compliance tensor components and each retained component in the retained component set to determine the fusion weight, and perform weighted summation on the compliance tensor components and the retained component set according to the fusion weight to generate the modified component set.

[0027] Tensor summation is performed on the modified component set to reconstruct the modified violation dimension slice. Based on the dimension index and index range, the modified violation dimension slice replaces the original violation dimension slice at the corresponding dimension index position in the query tensor, generating the reconstructed query tensor.

[0028] The semantic gradient of the inference result relative to the original archival data in the inverse coding space is calculated. The descriptive fields requiring correction are identified along the semantic gradient direction, and descriptive instructions are generated, including:

[0029] The reasoning result is encoded as a result vector, the original data of the archive is encoded as an original vector, the vector difference between the result vector and the original vector is calculated in the inverse encoding space, and the semantic gradient is obtained by performing directional decomposition on the vector difference in each encoding dimension.

[0030] Bidirectional decoding verification is performed on the semantic gradient. The semantic gradient is mapped to the semantic space and the rule space through the forward mapping function and the backward mapping function respectively to obtain the forward decoding vector and the backward decoding vector. The mapping consistency deviation between the forward decoding vector and the backward decoding vector is calculated, and the mismatched semantic gradient is filtered out based on the mapping consistency deviation.

[0031] Along the gradient direction of the mismatch semantic gradient, the mismatch semantic gradient is restored to the archive field identifier through a bijective mapping relationship, and the descriptive field that needs to be corrected is located based on the archive field identifier.

[0032] Extract the corresponding inference field values ​​from the inference results, calculate the encoding distance between the inference field values ​​and the field values ​​of the recording fields in the inverse encoding space, generate field correction vectors based on the encoding distance, verify the compliance of the field correction vectors through the inverse mapping function, and assemble them into recording instructions after verification.

[0033] Based on the cataloging instructions, cataloging corrections are propagated to related archives according to topological distance in the archival association map. When conflicts occur in the propagation path, the archival business rules are restored through bijective mapping and the adjudication is executed, generating cataloging data including:

[0034] Locate the source archive node in the archive association map based on the archive field identifier in the cataloging instruction, calculate the topological distance from the source archive node to each associated archive node, and construct the cataloging propagation sequence according to the topological distance;

[0035] The inference field values ​​in the cataloging instructions are propagated to the associated archive nodes in the cataloging propagation sequence. During the propagation process, the propagation source identifier is marked for the associated archive nodes. When an associated archive node receives multiple inference field values ​​from different propagation source identifiers, the associated archive node is marked as a conflicting archive node.

[0036] Extract multiple inference field values ​​received by the conflict archive node and encode them into an inference vector. Use the inverse mapping function in the bijective mapping relationship to restore the inference vector into an archive business rule expression. Execute the adjudication according to the rule priority in the archive business rule expression to obtain the adjudication inference field value.

[0037] Write the adjudication reasoning field value into the corresponding cataloging field of the conflict archive node, and merge the corrected cataloging fields of all related archive nodes in the cataloging propagation sequence with the corrected cataloging fields of the source archive node to generate cataloging data.

[0038] Calculate the set of field differences between the descriptive data and the original archival data, mark the field difference set with timestamps and inference traceability identifiers, merge the marked difference set with the unmodified fields and write them into the record set, and concatenate the written records into a descriptive version chain including:

[0039] Perform field-level comparison between the cataloging data and the original archival data, and extract fields with inconsistent values ​​to assemble a field difference set;

[0040] The field values ​​before and after modification in the field difference set are encoded into difference vector pairs. The difference vector pairs are mapped to the inverse encoding space through a bijective mapping relationship, and the tensor shrinkage trajectory offset is calculated as the rule deviation. The rule deviation is then marked on the field difference set.

[0041] Mark the field difference set with a timestamp, encode the tensor shrinkage path of the inference result corresponding to the field difference set in the reciprocal encoding space as an inference source identifier and mark it to the field difference set to generate the marked field difference set;

[0042] The modified field values ​​in the marked field difference set are merged with the unmodified fields in the original archive data. The merged results are then assembled into write records and written to the archive database.

[0043] Extract the inference tracing identifier from the written record and restore it to a tensor shrinking path. Calculate the path similarity between the tensor shrinking paths of different written records as the version association degree. Serialize the written records by pointer reference according to the timestamp order and version association degree to generate a cataloging version chain.

[0044] A second aspect of this invention provides an intelligent question-answering and automatic cataloging system for archives based on a large language model, comprising:

[0045] The rule vector unit is used to acquire the original data of the archives and the business rules of the archives, encode the business rules of the archives and the original data of the archives into rule vectors and data vectors, establish a bijective mapping relationship between the rule vectors and data vectors, and generate a reciprocal encoding space.

[0046] The query tensor unit is used to receive file query requests. In the reciprocal encoding space, the file query request is encoded into a query tensor. The inference path of the rule vector and the data vector is constrained by the tensor contraction operation. When the rule vector violates the file business rules after being restored by bijective mapping, tensor reconstruction is triggered to generate the inference result.

[0047] The semantic gradient unit is used to calculate the semantic gradient of the reasoning result relative to the original data of the archive in the reciprocal coding space, identify the recording fields that need to be corrected along the semantic gradient direction, and generate recording instructions.

[0048] The association graph unit is used to propagate the recording correction to the associated archives according to the topological distance in the archival association graph based on the recording instructions. When a conflict occurs in the propagation path, it is restored to the archival business rules through bijective mapping and the decision is executed to generate recording data.

[0049] The difference marking unit is used to calculate the field difference set between the catalog data and the original archival data, mark the field difference set with timestamps and inference traceability identifiers, merge the marked difference set with the unmodified fields and write them, and concatenate the written records into a catalog version chain.

[0050] A third aspect of the present invention provides an electronic device, comprising:

[0051] processor;

[0052] Memory used to store processor-executable instructions;

[0053] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0054] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0055] This method unifies the previously separate semantic reasoning, rule constraints, and data cataloging operations into a single coding space during archival data processing. This establishes a reversible verification relationship between the reasoning results and archival rules, thereby reducing cataloging errors and rule conflicts caused by semantic biases and achieving a more consistent automated cataloging process. By introducing tensor contraction constraints and violation reconstruction mechanisms during the reasoning process, the reasoning path possesses dynamic error correction capabilities, reducing invalid reasoning branches and improving the accuracy and stability of question answering and cataloging. Utilizing semantic gradients to locate fields requiring correction allows for precise mapping of overall semantic biases to specific data fields, improving the accuracy and automation of field-level corrections. Topological propagation in the association graph, combined with rule adjudication, helps maintain semantic consistency across multiple archives and suppresses error propagation. Furthermore, through the construction of difference sets, reasoning source identifiers, and version chains, each cataloging modification possesses a traceable reasoning path and consistency assessment capabilities, thereby enhancing the system's data reliability, interpretability, and version evolution management capabilities. Attached Figure Description

[0056] Figure 1 This is a flowchart illustrating the intelligent question-answering and automatic cataloging method for archives based on a large language model in this embodiment.

[0057] Figure 2 This is a flowchart of the file business rule violation handling and query tensor reconstruction process in this embodiment. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0059] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0060] Figure 1 This is a flowchart illustrating the intelligent question-answering and automatic cataloging method for archives based on a large language model, as described in an embodiment of the present invention. Figure 1 As shown, the intelligent question-answering and automatic cataloging method for archives based on a large language model includes:

[0061] Obtain the original data and business rules of the archives, encode the business rules and original data of the archives into rule vectors and data vectors, establish a bijective mapping relationship between the rule vectors and data vectors, and generate a reciprocal encoding space;

[0062] Upon receiving a file query request, the request is encoded into a query tensor in the reciprocal encoding space. The inference path of the rule vector and the data vector is constrained simultaneously through tensor contraction operation. When the rule vector violates the file business rules after being restored by bijective mapping, tensor reconstruction is triggered to generate the inference result.

[0063] The semantic gradient of the reasoning result relative to the original archival data in the inverse coding space is calculated, and the recording fields that need to be corrected are identified along the direction of the semantic gradient, and recording instructions are generated.

[0064] According to the cataloging instructions, the cataloging correction is propagated to the related archives in the archive association map according to the topological distance. When a conflict occurs in the propagation path, the archive business rules are restored through bijective mapping and the decision is executed to generate cataloging data.

[0065] Calculate the field difference set between the catalog data and the original archival data, mark the field difference set with timestamps and inference traceability identifiers, merge the marked difference set with the unmodified fields and write them, and concatenate the written records into a catalog version chain.

[0066] Archival business rules and original archival data are encoded into rule vectors and data vectors, respectively. A bijective mapping relationship is established between the rule vectors and data vectors to generate a reciprocal encoding space, including:

[0067] Dependency parsing is performed on the archival business rules to extract the constraints and rule dependencies, construct a rule dependency graph, encode the constraint nodes in the rule dependency graph into a set of constraint vectors, encode the rule dependencies into a relation matrix, and generate rule vectors through tensor multiplication of the constraint vector set and the relation matrix;

[0068] Semantic parsing is performed on the original data of the archives to extract entities and entity attributes. Entities are encoded into sets of entity vectors and entity attributes are encoded into attribute tensors. The projection coordinates of the entity vector sets in the attribute tensor space are calculated and the projection coordinates are used as data vectors.

[0069] Based on rule vectors and data vectors, a forward mapping function and an inverse mapping function are constructed. The forward mapping function maps the rule vectors to the semantic space where the data vectors are located to generate a constraint subspace. The inverse mapping function maps the data vectors back to the rule space where the rule vectors are located to generate a verification subspace.

[0070] Calculate the composite mapping error of the forward mapping function and the inverse mapping function. When the composite mapping error is lower than the preset error threshold, it is confirmed that the forward mapping function and the inverse mapping function constitute a bijective mapping relationship, and a reciprocal encoding space is generated.

[0071] In the actual operation of an archive management system, archive business rules and raw archive data are often stored in different databases or configuration files. Archive business rules typically exist in the form of XML configuration, JSO7 rule files, or database tables, and include archive classification rules, descriptive field constraints, data quality verification rules, etc. Raw archive data is distributed across multiple data tables, including archive metadata tables, archive full-text tables, and attachment information tables. To achieve collaborative reasoning between rules and data, it is necessary to uniformly encode this heterogeneous information into a single computable vector space.

[0072] Dependency resolution for archival business rules begins with parsing the rule file. Suppose an archival system contains the following business rule: "The retention period for official documents must be one of permanent, periodic 30 years, or periodic 10 years, and when the document's classification is Confidential or Top Secret, the retention period must not be less than 30 years." The dependency resolution process first extracts the constraints in this rule, including the field constraint "Retention period ∈ {Permanent, Periodic 30 years, Periodic 10 years}" and the condition constraint "If the classification ∈ {Confidential, Top Secret}, then the retention period ∈ {Permanent, Periodic 30 years}". These constraints are represented as nodes in the rule dependency graph, with each node containing attributes such as constraint type, constraint field, and constraint value range. Rule dependencies are represented as directed edges between nodes. For example, the value of the "Classification" field affects the constraint range of the "Retention period" field; therefore, a directed edge is established in the dependency graph from the Classification node to the Retention period node.

[0073] After constructing the rule dependency graph, the constraint nodes in the graph are encoded into a set of constraint vectors. Each constraint node is converted into a high-dimensional vector, typically with a dimension of 512 or 768, consistent with the embedding dimensions of commonly used pre-trained language models. The encoding process uses a BERT-based semantic encoder. The textual description of the constraint, "The retention period must be one of permanent, periodic 30 years, or periodic 10 years," is input into the encoder, and the output vector at the [CLS] position is extracted as the vector representation of that constraint. For constraints containing numerical ranges, a numerical embedding layer is added during vector encoding to fuse numerical information into the vector representation. The rule dependencies are encoded into a relation matrix, with the rows and columns of the matrix corresponding to nodes in the dependency graph. With nodes If there is a dependency relationship between the matrix elements, then... The value is set as the strength weight of the dependency. The weight value is determined according to the strictness of the dependency. The weight of a mandatory dependency is close to 1, and the weight of a suggestive dependency is between 0.3 and 0.7.

[0074] The generation of rule vectors is accomplished through tensor multiplication. Assume the set of constraint vectors contains... There are constraint vectors, denoted as... The dimension of each constraint vector is The relation matrix is ​​denoted as First, arrange the constraint vector set into matrix form. , of which Behavioral constraint vector Tensor product operations are calculated as follows: , obtained This is a rule vector matrix that incorporates dependencies. Each row is normalized to ensure the vector magnitude is 1, facilitating subsequent distance calculations. Finally, All row vectors are aggregated into a single regular vector through weighted average or max pooling operations. .

[0075] Semantic parsing of the original archival data employs named entity recognition and relation extraction techniques. For an archival record, such as the title "Notice Regarding the 2025 Annual Work Summary Meeting," with the responsible party being "Office" and the date "2025-12-15," the semantic parsing process extracts the entities "2025 Annual Work Summary Meeting," "Office," and "2025-12-15," while also identifying entity attributes, including the event type attribute of "Meeting," the organizational structure attribute of "Office," and the time attribute of the date. Entity encoding uses the same BERT encoder as constraint encoding to encode the textual description of the entities into entity vectors. For records containing... The file records of each entity generate a set of entity vectors. .

[0076] Encoding entity attributes into attribute tensors is a complex process. An attribute tensor is a three-dimensional tensor. ,in The number of attribute types; common archive attribute types include time attributes, spatial attributes, subject attributes, and security classification attributes, etc. Values ​​range from 10 to 20. Each slice of the attribute tensor Corresponding to a certain attribute type, the first in the slice The line represents the first The attribute feature vector is a feature vector of an entity along this attribute dimension. The generation of the attribute feature vector combines the semantic information of the entity with the type information of the attribute, and calculates the interaction features between the entity vector and the attribute type embedding vector through a multi-head attention mechanism.

[0077] The calculation of data vectors is achieved through projected coordinates. The set of entity vectors is arranged into a matrix. The attribute tensor is expanded into a matrix form. The formula for calculating projected coordinates is: The projected coordinate matrix is ​​obtained. Each row of this matrix represents the projected coordinates of an entity in the attribute tensor space. Principal component analysis is performed on the projected coordinate matrix to reduce its dimensionality, retaining the previous values. Principal components, usually The value can be 128 or 256 to generate a dimensionality-reduced data vector. .

[0078] The construction of forward and inverse mapping functions is based on a neural network architecture. Forward mapping function... A three-layer fully connected neural network is used. The first layer transfers the rule vector from... The first layer is mapped to 512 dimensions, the second layer is mapped to 256 dimensions after passing through the ReLU activation function, and the third layer is mapped to... The dimension is aligned with the dimension of the data vector. Inverse mapping function. Using a symmetrical network structure, sequentially from Dimensional mapping to 256-dimensional, 512-dimensional, Dimension. The forward mapping function maps the rule vector to the semantic space where the data vector resides, and the mapping result... With data vector Located in the same space, distance or similarity can be directly calculated. The constraint subspace generated after mapping is a set of vectors in the semantic space that satisfy the rule constraints, which can be calculated... The neighborhood range is determined. The inverse mapping function maps the data vector back to the rule space where the rule vector resides. The mapping result is used to verify whether the data conforms to the business rules. The verification subspace is the set of inverse mappings of all legal data vectors in the rule space.

[0079] The confirmation of the bijective mapping relationship is accomplished through the calculation of the composite mapping error. The composite mapping error consists of two parts: the forward-inverse composite error and the inverse-forward composite error. The forward-inverse composite error is calculated as the difference between the rule vector after forward mapping and then inverse mapping and the original rule vector. The calculation formula is as follows: ,in This represents the Euclidean distance. The inverse-forward composite error calculation differs between the original data vector and the data vector after inverse mapping followed by forward mapping. The formula is as follows: The total composite mapping error is the weighted sum of the two error components. Weighting coefficient The value is usually set to 0.5, indicating that the combined error in both directions is given equal importance.

[0080] The preset error threshold is determined based on the accuracy requirements of the application scenario. In archival cataloging applications, due to the high stringency of business rules, the error threshold is typically set between 0.01 and 0.05. When the calculated composite mapping error... When the error is less than the preset error threshold, the forward mapping function and the reverse mapping function are considered to satisfy the approximate conditions of bijective mapping.

[0081] In the reciprocal encoding space, the file query request is encoded as a query tensor. Tensor contraction operations simultaneously constrain the inference paths of both the rule vector and the data vector. When the rule vector, after being restored by bijective mapping, violates the file business rules, tensor reconstruction is triggered, generating inference results including:

[0082] Semantic parsing is performed on the file query request to extract the query intent and query constraints. The query intent is encoded into an intent vector, and the query constraints are encoded into a constraint tensor. The tensor outer product of the intent vector and the constraint tensor is calculated to generate the query tensor.

[0083] Tensor contraction is performed on the query dimension of the query tensor and the constraint dimension of the rule vector, and the contracted rule response vector sequence is calculated as the rule inference path; tensor contraction is performed on the intent dimension of the query tensor and the semantic dimension of the data vector, and the contracted data matching vector sequence is calculated as the data inference path.

[0084] Extract the intermediate rule response vector from the rule response vector sequence, restore the intermediate rule response vector to the rule expression through bijective mapping, and determine whether the rule expression violates the archival business rules.

[0085] When a rule expression violates the archive business rules, the corresponding dimension index of the violation location in the query tensor is calculated, and tensor decomposition and reorganization operations are performed on the query tensor based on the dimension index to generate a reconstructed query tensor.

[0086] The reconstructed query tensor is re-operated with tensor shrinkage to generate a corrected rule response vector sequence and a corrected data matching vector sequence. The corrected rule response vector sequence and the corrected data matching vector sequence are then fused to generate the inference result.

[0087] Upon receiving a user's file query request, the system first performs deep semantic analysis. Specifically, natural language processing (NLP) techniques are used to segment the query text into semantic units, identifying core verbs, key entities, and qualifiers. For example, if a user queries "find the personnel file of Zhang San in 2025," the system identifies "find" as the query intent, and "2025," "personnel department," "Zhang San," and "transfer" as query constraints. In the intent encoding stage, the query intent is mapped to a predefined intent space, which includes basic intent types such as retrieval, statistics, and association analysis. A word embedding model is then used to convert the intent text into a 128-dimensional intent vector. Each dimension of the vector represents a semantic attribute of the intent. For the extracted query constraints, a multi-dimensional constraint representation needs to be constructed. Time constraints, department constraints, name constraints, and file type constraints are encoded as independent vectors to form a constraint matrix. ,in Indicates the number of constraints. This represents the feature dimension of each constraint. A tensor operation is performed on the constraint tensors to introduce interaction relationships between the constraint dimensions, generating a third-order constraint tensor. The first dimension of this tensor corresponds to the time granularity, the second dimension to the organizational structure hierarchy, and the third dimension to the entity attribute space. This is achieved by calculating the intent vector. With constraint tensor The outer product of the tensors yields the query tensor. This query tensor integrates user intent and all constraint information, and its dimensions are expanded to... .

[0088] During the tensor shrinking phase, it is necessary to handle the rule constraint path and the data matching path separately. For rule inference, the query tensor is extracted. The query dimensions related to business rules typically correspond to compliance requirements and access control requirements for document management. This involves setting up a set of rule vectors. Expanded along the constraint dimension, it becomes a rule tensor. ,in Represents the feature dimension of the rule. Performs tensor shrinkage operation. Dimensional compression is performed along the second mode to obtain a sequence of regular response vectors. Sequence length It depends on the depth of inference. Each vector in the sequence represents the activation state of the rule constraint at a specific inference step, and the vector element values ​​reflect the matching strength of each rule.

[0089] Parallel execution of tensor shrinking for data matching paths. The query tensor... Intent dimension and data vector set Constructed data tensors Perform a shrinkage operation, where Represents the semantic dimension of data. (Through...) Calculate, compress semantic dimensions, and generate a data matching vector sequence. This sequence reflects the semantic response strength of the archival data at each reasoning step, with vector elements corresponding to the matching scores of candidate archival records. and The modal index symbol for tensor shrinkage operations indicates which dimension of the tensor the shrinkage operation is performed along.

[0090] Vectors from intermediate inference steps are selected from the rule response vector sequence for rule verification. Specifically, the index in the selection sequence is located at... Vectors representing intervals, indicating key states in the reasoning chain. Response vector to selected intermediate rules. Using a pre-established bijective mapping function This function performs an inverse mapping, restoring the representation of the vector space to a symbolic regular expression. The restoration process involves looking up vectors... In the nearest neighbor of the rule vector set, read the corresponding rule template, fill the template parameter position with the vector activation value, and generate a complete rule expression, such as "IF file classification = confidential THE7 visitor rank ≥ department level".

[0091] Perform compliance checks on the restored rule expressions. Logically compare the rule expressions with the pre-stored archive business rule base to check for issues such as unauthorized access, time conflicts, and process violations. For example, if a restoration rule requires "ordinary users can view confidential files," which contradicts the rule base's "confidential files are only accessible to authorized personnel," it is determined to be a rule violation. Record the position index of the violated rule in the sequence. And the specific type of violation identifier.

[0092] When a rule violation is detected, it is necessary to locate the source of the violation in the query tensor. The location of the violation is calculated by tracing the tensor contraction path in reverse. Corresponding tensor slices ,in This indicates the dimension index that caused the violation. Perform Tucker decomposition on this slice, breaking the query tensor down into core tensors. With factor matrix The product form. The column vectors corresponding to the violated dimensions in the corrected factor matrix are recalculated by minimizing the degree of conflict with the rule constraints, resulting in the corrected factor matrix. The corrected factor matrix and the core tensor are recombine to generate the reconstructed query tensor. This tensor eliminates the abnormal constraint components that cause rule violations.

[0093] Using the reconstructed query tensor Re-execute the tensor shrinkage operation. Calculate the following steps according to the previously described procedure. and The corrected rule response vector sequence is obtained. Matching vector sequences with the corrected data These two sequences have eliminated rule conflicts, ensuring that the reasoning process conforms to archival business standards.

[0094] During the fusion phase, the rule constraints and data matching results need to be integrated into the final inference output. A position-by-position weighted fusion is performed on the two corrected vector sequences to calculate... ,in and For the weighting coefficients, satisfying The weight is dynamically adjusted based on the query type, with increased weighting for queries emphasizing compliance. Value, improves for queries that emphasize semantic matching value.

[0095] like Figure 2 As shown, the flowchart of the file business rule violation handling and query tensor reconstruction in this embodiment is illustrated.

[0096] When a rule expression violates a record business rule, the corresponding dimension index of the violation location in the query tensor is calculated. Based on the dimension index, tensor decomposition and reorganization operations are performed on the query tensor to generate a reconstructed query tensor, which includes:

[0097] When a rule expression violates the archival business rules, the sequence position of the constraint that violates the archival business rules in the rule response vector sequence is extracted, and the sequence position is converted into the dimension index and index range of the query tensor through coordinate mapping;

[0098] Based on the dimension index and index range, extract the violation dimension slice from the query tensor, perform tensor decomposition on the violation dimension slice to obtain the tensor component set, calculate the inner product similarity between each tensor component in the tensor component set and the archive business rule vector, and divide the tensor component set into the retained component set and the violation component set according to the inner product similarity.

[0099] Extract compliance vectors corresponding to constraints from the archival business rules, perform tensor expansion on the compliance vectors to generate compliance tensor components, calculate the tensor inner product of the compliance tensor components and each retained component in the retained component set to determine the fusion weight, and perform weighted summation on the compliance tensor components and the retained component set according to the fusion weight to generate the modified component set.

[0100] Tensor summation is performed on the modified component set to reconstruct the modified violation dimension slice. Based on the dimension index and index range, the modified violation dimension slice replaces the original violation dimension slice at the corresponding dimension index position in the query tensor, generating the reconstructed query tensor.

[0101] When a large language model performs inference based on a query tensor, the inference results may violate the inherent business rules of record management. For example, record borrowing rules may require that records classified as "confidential" should not be accessed by unauthorized personnel, but the model's inference process may generate a result allowing access due to misjudgment of data association. In this case, the query tensor needs to be reconstructed to ensure that the inference process returns to a compliant path.

[0102] Precise location of violations is a prerequisite for tensor reconstruction. When a rule expression violates archival business rules, the first step is to extract the sequence position of the violation constraint from the rule response vector sequence. The rule response vector sequence records the entire process of rule verification, with each vector corresponding to the verification result of a constraint. By scanning this sequence, vectors with negative values ​​or values ​​exceeding a threshold are identified; the sequence position of these vectors is the violation position. For example, if the 15th vector in the sequence corresponds to the constraint "archival security level matches user permissions," and this vector has a value of -0.87, indicating a violation, then the violation position is 15.

[0103] Converting sequence positions into dimensional indexes of the query tensor requires establishing a coordinate mapping mechanism. Query tensors are typically multidimensional structures, such as four-dimensional tensors. ,in Corresponding to the query intent dimension, Corresponding to the physical dimension of the archive, Corresponding time range dimension, The corresponding attribute limits the dimension. Each position in the rule response vector sequence has a mapping relationship with a certain dimension range of the query tensor. Using a pre-defined mapping table, position 15 in the sequence can be converted into a dimension index, for example, mapping to the index range of the third dimension. This indicates that the violation occurred at positions 8 to 12 in the time range dimension. Violation dimension slices are extracted from the query tensor based on the dimension index and index range. Taking a four-dimensional query tensor as an example, if the violation occurs in the third dimension index range... Then extract the slice. This slice retains complete information from other dimensions, focusing only on the specific dimensional interval where the violation occurred. The extracted violation dimension slice shape is as follows: , where 5 indicates that the index range contains 5 positions.

[0104] Tensor decomposition is performed on the dimensionality-violating slices, using the Tucker decomposition method to decompose the slices into a combination of a core tensor and a factor matrix. The Tucker decomposition can be represented as... ,in For the core tensor, For the first A factor matrix of dimension 1 Indicates the first Tensor products of dimension 1. The core tensor can be obtained through higher-order singular value decomposition, and further expanded into a set of tensor components. Each component This represents the slice's representation under a specific pattern. The similarity between the inner product of each tensor component and the archival business rule vector is calculated to determine whether a component violates regulations. Archival business rule vector The semantic features of compliance constraints are encoded. For tensor components... First, flatten it into vector form. Then calculate the inner product similarity. .like Below the threshold (For example, 0.6) indicates that the component deviates from the business rules and is classified as a set of non-compliant components. Otherwise, it is divided into a set of reserved components. .

[0105] The compliance vectors corresponding to the constraints are extracted from the archival business rules. These rules are stored in a structured format, such as "Access is prohibited when the security level is confidential and the user's permission level is less than 3". The rule is then converted into a semantic vector representation, and a compliance vector is generated using a rule encoder. This vector has the same dimension as the rule response vector and contains positive semantic features of the constraints. Tensor quantization expansion is performed on the compliance vector to generate compliance tensor components. Compliance Vector Since it is a one-dimensional vector, it needs to be expanded to the same dimensional structure as the violating dimensional slice. An outer product expansion method is used, selecting representative components from the set of retained components. For reference, calculate the outer product. ,in This indicates the broadcast outer product operation. Extract the shape information of the reference component. Generate compliant tensor components. The multidimensional structure of the slices is preserved while compliant semantics are injected. The fusion weights are determined by calculating the tensor inner product between the compliant tensor component and each retained component in the retained component set. For the retained components... Calculate the tensor inner product Normalize all weights to obtain the merged weights. ,in The temperature parameter controls the smoothness of the weight distribution. Based on the fusion weights, a weighted sum of the compliant tensor components and the retained component sets is generated to produce a modified component set. The modified components are calculated as follows: ,in The base weight for the compliance component is typically set between 0.4 and 0.7 to ensure that compliance semantics dominate. The modified component set contains... Other modified variants generated through similar logic form a new set of tensor components. Tensor summation is performed on the modified component set to reconstruct the modified dimensionality violation slice. Then, an inverse Tucker decomposition process is used to recombine the modified component set into the core tensor. Then, it is reconstructed into a corrected slice using the factor matrix. The reconstruction process ensures that the dimensional shape of the slice is consistent with the original dimensionally violated slice, i.e. .

[0106] Based on the dimension index and index range, the original slice at the corresponding position in the query tensor will be replaced to correct any violations of the dimension slice rule. In the query tensor... In the middle, the third dimension index range Original slices Replace with correction slice Generate the reconstructed query tensor The replacement operation maintains the continuity of the tensor, and semantic abrupt changes at slice junctions are avoided through boundary smoothing. The smoothing method uses linear interpolation, performing numerical transitions between indices 7 and 8 and 12 and 13, with a transition window width of 2 index units.

[0107] After reconstruction, the query tensor regains its compliance with the document business rules, and subsequent inference processes will be based on the corrected tensor. By accurately locating the violation dimension and replacing it with a compliant expression, the computational overhead of regenerating the entire tensor is avoided, while preserving the original semantic features of the query intent, ensuring that the question-and-answer results both conform to business specifications and meet user query needs.

[0108] The semantic gradient of the inference result relative to the original archival data in the inverse coding space is calculated. The descriptive fields requiring correction are identified along the semantic gradient direction, and descriptive instructions are generated, including:

[0109] The reasoning result is encoded as a result vector, the original data of the archive is encoded as an original vector, the vector difference between the result vector and the original vector is calculated in the inverse encoding space, and the semantic gradient is obtained by performing directional decomposition on the vector difference in each encoding dimension.

[0110] Bidirectional decoding verification is performed on the semantic gradient. The semantic gradient is mapped to the semantic space and the rule space through the forward mapping function and the backward mapping function respectively to obtain the forward decoding vector and the backward decoding vector. The mapping consistency deviation between the forward decoding vector and the backward decoding vector is calculated, and the mismatched semantic gradient is filtered out based on the mapping consistency deviation.

[0111] Along the gradient direction of the mismatch semantic gradient, the mismatch semantic gradient is restored to the archive field identifier through a bijective mapping relationship, and the descriptive field that needs to be corrected is located based on the archive field identifier.

[0112] Extract the corresponding inference field values ​​from the inference results, calculate the encoding distance between the inference field values ​​and the field values ​​of the recording fields in the inverse encoding space, generate field correction vectors based on the encoding distance, verify the compliance of the field correction vectors through the inverse mapping function, and assemble them into recording instructions after verification.

[0113] After obtaining the inference results, it is necessary to compare and analyze them with the original archival data to identify the specific fields that require cataloging corrections. The inference results are represented as... This vector maintains the same dimension as the data vector in the inverse encoding space, typically represented as a dense vector with 512 or 768 dimensions. Simultaneously, the original archival data is encoded into the original vector. This encoding process is consistent with the aforementioned data vector generation method, ensuring comparability between the two within the same encoding space. The vector difference between the resulting vector and the original vector is calculated in the inverse encoding space. This vector difference reflects the degree of semantic deviation between the inference result and the original data. Directional decomposition is performed on the vector difference along each encoding dimension to obtain the semantic gradient. ,in Indicates the first Difference values ​​in each dimension The normalization process, which represents the magnitude of the vector difference, ensures that the semantic gradient is directional and unaffected by its magnitude.

[0114] To verify the reliability of semantic gradients, a bidirectional decoding verification mechanism is needed. This is achieved through the forward mapping function. The semantic gradient is mapped to the semantic space to obtain the forward decoding vector. This mapping function typically employs a multilayer perceptron structure to transform the gradient vectors of the encoding space into interpretable semantic feature vectors. Simultaneously, through the inverse mapping function... The semantic gradient is mapped to the rule space to obtain the inverse decoding vector. This mapping function maps the gradient vector to the constraint space defined by the archival business rules. The mapping consistency deviation between the forward and backward decoding vectors is calculated. ,in This is a bridging function used to transform rule space vectors into semantic space for direct comparison. When mapping consistency deviations occur... Exceeding the preset threshold When this threshold is reached, it indicates that the semantic gradient is inconsistent during the forward and reverse decoding processes, and it is marked as a mismatch semantic gradient. This threshold is usually dynamically adjusted according to the different types of files; for personnel files, it can be set to 0.15, and for financial files, it can be set to 0.08 to ensure stricter consistency requirements.

[0115] After filtering out the mismatch semantic gradient, field location is performed along the gradient direction of the mismatch semantic gradient. (Mismatch semantic gradient) This indicates in which semantic dimensions the inference results deviate significantly from the original data, and that this deviation fails to simultaneously satisfy semantic rationality and rule compliance. A mapping function from the encoding space to the archive field space is established through a bijective mapping relationship. ,in This represents a set of file field identifiers. The mismatch semantic gradient is then restored to the file field identifiers. The restoration process first identifies the dimensions with the largest absolute values ​​in the gradient vector, typically selecting the top 10 dimensions. Then, it queries a pre-built mapping table between the encoding space and the field space, which records the correspondence between each encoded dimension and a record field. For example, if the 37th dimension primarily responds to the "date of birth" field, and the 102nd dimension primarily responds to the "education level" field, then when these dimensions dominate the mismatch semantic gradient, the corresponding fields are identified as the bibliographical fields that need correction.

[0116] After locating the bibliographic field that needs correction, extract the corresponding inferred field value from the inference results. Assume the located bibliographic field is "Work Unit," and the inferred value for this field in the inference results is "A Certain City Planning and Design Institute," while the original data shows the field value as "City Planning Institute." Then, extract the inferred field value... Field values ​​of the bibliographic field Encode them separately to obtain the inference value vector. With the recorded value vector Calculate the coding distance in the reciprocal coding space. This encoding distance reflects the degree of semantic difference between two field values. When the encoding distance exceeds the field correction threshold... At that time, it was deemed necessary to perform record-keeping correction. A field correction vector was generated based on the encoded distance. ,in To correct the intensity factor, it is usually set between 0.8 and 1.0. This factor controls the aggressiveness of the correction. A smaller factor makes the correction more conservative and avoids over-modifying the original data.

[0117] To ensure the compliance of the corrections, the field correction vectors are validated using a reverse mapping function. (Reverse mapping function) Mapping the field correction vector back to the rule space yields the rule validation vector. The rule verification vector is matched against the rule constraints in the archive business rule base to check whether the corrected field values ​​violate the established rules. For example, for the "date of birth" field, rule constraints might include that the date format must be an eight-digit year-month-day sequence, the date of birth cannot be later than the date the archive was created, and the date of birth and age fields must be consistent. Using a rule matching algorithm, the cosine similarity between the rule verification vector and each rule constraint vector is calculated. When the similarity of all key rules is higher than 0.9, the correction compliance verification is considered successful. If the verification fails, the correction strength coefficient is adjusted. Alternatively, mismatched semantic gradients can be re-screened until a correction scheme that can both correct the bias and satisfy the rule constraints is found.

[0118] After successful verification, the field correction vectors are assembled into a bibliographic instruction. The bibliographic instruction uses a structured JSO7 format, containing key information such as field identifier, original value, correction value, correction vector, and verification status. Specifically, the format is as follows: the field identifier records the name of the field to be corrected and its unique identifier in the database; the original value records the field content before correction; the correction value records the new field content derived from the inference; the correction vector records the numerical representation of the field correction vector, facilitating subsequent propagation calculations; the verification status indicates the result of the rule verification, including three states: passed, partially passed, and failed; the confidence score is calculated based on a combination of coding distance and verification similarity, reflecting the reliability of the correction. The generated bibliographic instruction also includes a timestamp and an inference tracing identifier. The timestamp records the precise time the instruction was generated, and the inference tracing identifier records the inference path and intermediate results that triggered the correction, ensuring the traceability of the correction process. When multiple fields need to be corrected simultaneously, the bibliographic instructions for each field are sorted according to their dependencies, prioritizing the correction of the underlying fields that other fields depend on. For example, "Years of Service" should be corrected before "Time of Joining the Workforce" to avoid cascading inconsistencies. This systematic recording instruction generation mechanism enables fully automated processing from semantic deviation identification to rule-based correction.

[0119] Based on the cataloging instructions, cataloging corrections are propagated to related archives according to topological distance in the archival association map. When conflicts occur in the propagation path, the archival business rules are restored through bijective mapping and the adjudication is executed, generating cataloging data including:

[0120] Locate the source archive node in the archive association map based on the archive field identifier in the cataloging instruction, calculate the topological distance from the source archive node to each associated archive node, and construct the cataloging propagation sequence according to the topological distance;

[0121] The inference field values ​​in the cataloging instructions are propagated to the associated archive nodes in the cataloging propagation sequence. During the propagation process, the propagation source identifier is marked for the associated archive nodes. When an associated archive node receives multiple inference field values ​​from different propagation source identifiers, the associated archive node is marked as a conflicting archive node.

[0122] Extract multiple inference field values ​​received by the conflict archive node and encode them into an inference vector. Use the inverse mapping function in the bijective mapping relationship to restore the inference vector into an archive business rule expression. Execute the adjudication according to the rule priority in the archive business rule expression to obtain the adjudication inference field value.

[0123] Write the adjudication reasoning field value into the corresponding cataloging field of the conflict archive node, and merge the corrected cataloging fields of all related archive nodes in the cataloging propagation sequence with the corrected cataloging fields of the source archive node to generate cataloging data.

[0124] Upon receiving the cataloging instruction, the system first parses the archival field identifier carried within it. This identifier is uniquely encoded and comprises three parts: archival category code, archival entity code, and field location code. Using this identifier, nodes are located within a pre-constructed archival association graph. This graph employs a directed graph structure, where each node represents an archival entity, and edges represent the relationships between archives, with attributes including association type and association strength. The located node is the source archival node, serving as the starting point for cataloging correction propagation.

[0125] Topological distance calculations are performed on the source archive node using a breadth-first search algorithm, scanning layer by layer all directly or indirectly associated archive nodes. Topological distance is defined as the number of edges along the shortest path from the source archive node to the target archive node. Directly associated archive nodes have a topological distance of 1, archive nodes associated through an intermediate node have a topological distance of 2, and so on. During the calculation, a distance record table is maintained to record the shortest topological distance between each associated archive node and the source archive node. When multiple paths reach the same node, the shortest distance is retained. After traversal, all associated archive nodes are sorted in ascending order of topological distance, and nodes with the same topological distance are sorted in descending order of association strength, forming a cataloging propagation sequence. This sequence ensures that associated archives closer to the source archive node receive cataloging corrections first.

[0126] The inferred field values ​​in the cataloging instruction are propagated sequentially to the associated archive nodes along the cataloging propagation sequence. Starting from the node with a topological distance of 1, propagation proceeds sequentially to nodes with topological distances of 2, 3, and so on, performing the field value propagation operation for each associated archive node. During propagation, not only the inferred field value itself is transmitted, but a propagation source identifier is also attached to the field value. The propagation source identifier records the source node code and propagation path code of the inferred field value. When an associated archive node receives an inferred field value for the first time, it temporarily stores the value in the node's pending confirmation field buffer and records the propagation source identifier. In subsequent propagation processes, if the associated archive node receives an inferred field value for the same cataloging field again, it compares the propagation source identifier of the newly received value with the propagation source identifier of the stored value. If the propagation source identifiers are different, it indicates that the node received potentially inconsistent field values ​​from different propagation paths. At this time, the associated archive node is marked as a conflict archive node, and all received inferred field values ​​and their corresponding propagation source identifiers are stored in the conflict record set.

[0127] For nodes marked as conflict archive nodes, all inference field values ​​are extracted from their conflict record sets. These inference field values ​​may be of different data types, such as text, numeric, and date. Vector encoding is performed on each inference field value. Text field values ​​are encoded into fixed-dimensional vectors using a pre-trained language model, numeric field values ​​are normalized and mapped to the same vector space, and date field values ​​are converted to timestamps before vector embedding. All the encoded vectors of inference field values ​​are combined into an inference vector set, in which each vector corresponds to a possible field value candidate.

[0128] The inverse mapping function in the reciprocal encoding space is invoked, forming a bijective mapping relationship with the forward mapping function. The inference vector set is input into the inverse mapping function, which employs a reverse neural network architecture to decode the inference vectors layer by layer, restoring them to archival business rule expressions. These archival business rule expressions are structured, including rule type, scope of application, constraints, and rule priority. The rule type defines the category of archival fields constrained by the rule; the scope of application defines the types and time range of archives for which the rule is effective; the constraints describe the logical conditions that field values ​​must satisfy; and the rule priority is an integer value from 0 to 100, with higher values ​​indicating higher priority. During the restoration process, the semantic components in the inference vectors are parsed into the constituent parts of the rule expression, and an attention mechanism is used to identify the implicit rule constraints within the vectors.

[0129] After obtaining the rule expressions for archival business, the rule adjudication process is executed. First, the rule expressions corresponding to the inference field values ​​in the conflict record set are compared, and the rule priority value in each rule expression is extracted. A priority comparison sequence is constructed, arranging all rule expressions from highest to lowest priority. The rule expression with the highest priority is selected as the basis for adjudication, and the field values ​​constrained by this rule expression are extracted as the adjudication inference field values. If multiple rule expressions have the same highest priority, their applicable scope is further compared, and the rule expression whose applicable scope more precisely matches the current archival node attribute is selected. If a distinction still cannot be made, the strictness of the constraints is compared, and the field value corresponding to the rule expression with the stricter constraints is selected. This multi-level comparison ensures the uniqueness and interpretability of the adjudication.

[0130] The adjudication inference field value obtained from the ruling is written to the corresponding cataloging field of the conflict archive node. Before writing, the adjudication inference field value is verified to ensure it meets the basic constraints of the archive field, including data type checks, field length checks, and format validity checks. After successful verification, the adjudication inference field value is updated to the cataloging field of the conflict archive node, and an adjudication log is recorded. The log content includes the time of the conflict, the rule expressions involved in the adjudication, the adjudication result, and other field values ​​that were not adopted. For associated archive nodes that have not experienced a conflict in the cataloging propagation sequence, the received inference field value is directly written to the corresponding cataloging field without executing the adjudication process.

[0131] This process summarizes the corrected cataloging fields of all associated archival nodes in the cataloging propagation sequence, including fields determined through adjudication and those determined through direct propagation. The corrected fields of these associated archival nodes are then merged with the corrected fields of the source archival nodes themselves. During merging, fields are grouped according to their archival entity codes, with each archival entity corresponding to a set of corrected fields. For each corrected field, the field name, the original value before correction, the new value after correction, the correction source identifier, and the correction time are recorded. The corrected fields of all archival entities are combined into a structured dataset, which constitutes the generated cataloging data. This dataset contains field correction information for all affected archives during this cataloging propagation process, providing a complete data foundation for subsequent difference calculations and version management.

[0132] Calculate the set of field differences between the descriptive data and the original archival data, mark the field difference set with timestamps and inference traceability identifiers, merge the marked difference set with the unmodified fields and write them into the record set, and concatenate the written records into a descriptive version chain including:

[0133] Perform field-level comparison between the cataloging data and the original archival data, and extract fields with inconsistent values ​​to assemble a field difference set;

[0134] The field values ​​before and after modification in the field difference set are encoded into difference vector pairs. The difference vector pairs are mapped to the inverse encoding space through a bijective mapping relationship, and the tensor shrinkage trajectory offset is calculated as the rule deviation. The rule deviation is then marked on the field difference set.

[0135] Mark the field difference set with a timestamp, encode the tensor shrinkage path of the inference result corresponding to the field difference set in the reciprocal encoding space as an inference source identifier and mark it to the field difference set to generate the marked field difference set;

[0136] The modified field values ​​in the marked field difference set are merged with the unmodified fields in the original archive data. The merged results are then assembled into write records and written to the archive database.

[0137] Extract the inference tracing identifier from the written record and restore it to a tensor shrinking path. Calculate the path similarity between the tensor shrinking paths of different written records as the version association degree. Serialize the written records by pointer reference according to the timestamp order and version association degree to generate a cataloging version chain.

[0138] In the process of cataloging archival data, in order to ensure the traceability of data modifications and compliance with business rules, it is necessary to conduct detailed difference detection and version management between the cataloged data and the original archival data.

[0139] When performing field-level comparisons between cataloging data and original archival data, a field-by-field traversal approach is used. Specifically, the cataloging data and original archival data are parsed according to a predefined field structure, extracting metadata fields such as archive title, archive number, creation date, responsible party, security classification, and retention period. For each field, the field value in the cataloging data is compared to the corresponding field value in the original archival data to ensure complete consistency. When a difference is detected in the value, text content, or format of a field, the field name, the original field value, and the modified field value are recorded as a single difference unit. By traversing all fields, all identified difference units are assembled into a field difference set. In practical application, if the responsible party field in the original archival data is "Zhang San," and the cataloging data corrects it to "Li Si," then this difference unit contains the field name "Responsible Party," the original field value "Zhang San," and the modified field value "Li Si." If the creation date field is corrected from "2025-05-12" to "2025-06-15," another difference unit is generated accordingly. All the difference units are summarized to form a complete set of field differences.

[0140] To quantify the impact of field modifications on archival business rules, it is necessary to calculate the rule deviation of the field modifications. The pre-modification and post-modification field values ​​of each difference unit in the field difference set are converted into numerical representations. For text-type fields, the same vectorization method as the original archival data encoding is used, encoding both the pre-modification and post-modification field values ​​as vectors, forming difference vector pairs. These difference vector pairs are mapped to a reciprocal encoding space through a bijective mapping relationship. In the reciprocal encoding space, the vector corresponding to the pre-modification field value should evolve along a specific tensor contraction path to a state conforming to the rules under rule constraints, and the vector corresponding to the post-modification field value also corresponds to a tensor contraction path. The offset between these two tensor contraction paths is calculated; this offset reflects the change in rule conformity caused by the field modification. Specifically, the trajectory coordinate sequences of the two paths in the reciprocal encoding space are extracted, and the Euclidean distance between the coordinate sequences is calculated as the tensor contraction trajectory offset. The larger this offset value, the higher the degree of deviation of the field modification from the business rules. The calculated value is then marked as the rule deviation degree to the corresponding difference unit. For numeric fields, the relative rate of change of the values ​​before and after modification can be directly calculated as an auxiliary deviation indicator. By marking the deviation according to the rules, modifications to fields with higher deviations can be given priority in subsequent review processes.

[0141] When timestamping the field difference set, the current system time is used as the identifier for the time the modification occurred. The timestamp is recorded in a standard format, accurate to the millisecond level, ensuring that modification operations at different times can be accurately distinguished. The timestamp is appended to the metadata structure of the field difference set as a global attribute of the difference set. To achieve complete traceability of the inference process, the tensor shrinking path executed in the reciprocal encoding space when generating the inference result needs to be encoded and saved. The tensor shrinking path contains the complete computational trajectory from encoding the archive query request into a query tensor, through the joint constraints of the rule vector and data vector, until the generation of the inference result. This path can be represented as a sequence of intermediate tensor states in the reciprocal encoding space, where each tensor state records the inference process at the [number]th [position]. The tensor state sequence is serialized and encoded into a storable inference tracing identifier. Encoding methods can employ path hashing or compression to reduce storage overhead while ensuring the integrity of the tracing information. The encoded inference tracing identifier is appended to the field difference set, ensuring that each difference set carries the inference logic underlying that difference. After marking the timestamp and inference tracing identifier, the marked field difference set is generated.

[0142] When merging the marked field difference set with the original archival data, it is necessary to distinguish between modified and unmodified fields. All modified field values ​​are extracted from the marked field difference set; these fields represent the results of the cataloging corrections. All fields not appearing in the field difference set are extracted from the original archival data; these fields did not change during the cataloging process, and their values ​​remain unchanged. The modified and unmodified field values ​​are then assembled according to the standard field structure of archival data, ensuring all necessary fields are present and generating a complete archival data record. This record serves as the data payload for a write operation, with added metadata such as timestamps and inference / origin identifiers, and assembled into a write record. The write record is submitted to the archival database to execute the write operation, updating the corresponding archival data content. During the write process, the archival database maintains historical versions from being overwritten, using an append-only approach to store the new version data, ensuring the integrity of historical data.

[0143] To construct the version evolution relationship of archival records, multiple write records need to be chained together according to chronological order and logical correlation. The reasoning tracing identifier in each write record is extracted and restored to a tensor shrinking path in the inverse encoding space through reverse decoding. For the tensor shrinking paths corresponding to different write records, the similarity between paths is calculated to quantify the correlation strength between versions. The path similarity calculation is based on the geometric distance of the path trajectory and the consistency of the path topology. Two paths are aligned using a dynamic time warping algorithm, and the cosine similarity between the corresponding tensor states after alignment is calculated. The average value is taken as the path similarity. The higher the path similarity value, the more strongly the two record revisions are based on similar reasoning logic, indicating a strong correlation between versions. The path similarity is recorded as the version correlation. Write records are arranged chronologically according to their timestamps, and those that are temporally adjacent and have a version correlation exceeding a preset threshold are chained together using pointer references. Each write record stores a pointer to the previous version record and a pointer to the next version record, forming a doubly linked list structure. For write records with low version correlation, it may indicate that the correction was based on a different reasoning path or business scenario, and is marked as a branch node in the version chain. By concatenating pointer references, a complete cataloging version chain is generated. This version chain records the complete evolution history of the archive data from its original state through multiple cataloging corrections, supporting application needs such as version backtracking, difference comparison, and correction logic auditing.

[0144] A second aspect of this invention provides an intelligent question-answering and automatic cataloging system for archives based on a large language model, comprising:

[0145] The rule vector unit is used to acquire the original data of the archives and the business rules of the archives, encode the business rules of the archives and the original data of the archives into rule vectors and data vectors, establish a bijective mapping relationship between the rule vectors and data vectors, and generate a reciprocal encoding space.

[0146] The query tensor unit is used to receive file query requests. In the reciprocal encoding space, the file query request is encoded into a query tensor. The inference path of the rule vector and the data vector is constrained by the tensor contraction operation. When the rule vector violates the file business rules after being restored by bijective mapping, tensor reconstruction is triggered to generate the inference result.

[0147] The semantic gradient unit is used to calculate the semantic gradient of the reasoning result relative to the original data of the archive in the reciprocal coding space, identify the recording fields that need to be corrected along the semantic gradient direction, and generate recording instructions.

[0148] The association graph unit is used to propagate the recording correction to the associated archives according to the topological distance in the archival association graph based on the recording instructions. When a conflict occurs in the propagation path, it is restored to the archival business rules through bijective mapping and the decision is executed to generate recording data.

[0149] The difference marking unit is used to calculate the field difference set between the catalog data and the original archival data, mark the field difference set with timestamps and inference traceability identifiers, merge the marked difference set with the unmodified fields and write them, and concatenate the written records into a catalog version chain.

[0150] A third aspect of the present invention provides an electronic device, comprising:

[0151] processor;

[0152] Memory used to store processor-executable instructions;

[0153] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0154] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0155] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for intelligent question answering and automatic cataloging of archives based on a large language model, characterized in that: include: Obtain the original data and business rules of the archives, encode the business rules and original data of the archives into rule vectors and data vectors, establish a bijective mapping relationship between the rule vectors and data vectors, and generate a reciprocal encoding space; Upon receiving a file query request, the request is encoded into a query tensor in the reciprocal encoding space. The inference path of the rule vector and the data vector is constrained simultaneously through tensor contraction operation. When the rule vector violates the file business rules after being restored by bijective mapping, tensor reconstruction is triggered to generate the inference result. The semantic gradient of the reasoning result relative to the original archival data in the inverse coding space is calculated, and the recording fields that need to be corrected are identified along the direction of the semantic gradient, and recording instructions are generated. According to the cataloging instructions, the cataloging correction is propagated to the related archives in the archive association map according to the topological distance. When a conflict occurs in the propagation path, the archive business rules are restored through bijective mapping and the decision is executed to generate cataloging data. Calculate the field difference set between the catalog data and the original archival data, mark the field difference set with timestamps and inference traceability identifiers, merge the marked difference set with the unmodified fields and write them, and concatenate the written records into a catalog version chain.

2. The method according to claim 1, characterized in that, Archival business rules and original archival data are encoded into rule vectors and data vectors, respectively. A bijective mapping relationship is established between the rule vectors and data vectors to generate a reciprocal encoding space, including: Dependency parsing is performed on the archival business rules to extract the constraints and rule dependencies, construct a rule dependency graph, encode the constraint nodes in the rule dependency graph into a set of constraint vectors, encode the rule dependencies into a relation matrix, and generate rule vectors through tensor product operation of the constraint vector set and the relation matrix; Semantic parsing is performed on the original data of the archives to extract entities and entity attributes. Entities are encoded into sets of entity vectors and entity attributes are encoded into attribute tensors. The projection coordinates of the set of entity vectors in the attribute tensor space are calculated and the projection coordinates are used as data vectors. Based on rule vectors and data vectors, a forward mapping function and an inverse mapping function are constructed. The forward mapping function maps the rule vectors to the semantic space where the data vectors are located to generate a constraint subspace. The inverse mapping function maps the data vectors back to the rule space where the rule vectors are located to generate a verification subspace. Calculate the composite mapping error of the forward mapping function and the inverse mapping function. When the composite mapping error is lower than the preset error threshold, it is confirmed that the forward mapping function and the inverse mapping function constitute a bijective mapping relationship, and a reciprocal encoding space is generated.

3. The method according to claim 1, characterized in that, In the reciprocal encoding space, the file query request is encoded as a query tensor. Tensor contraction operations simultaneously constrain the inference paths of both the rule vector and the data vector. When the rule vector, after being restored by bijective mapping, violates the file business rules, tensor reconstruction is triggered, generating inference results including: Semantic parsing is performed on the file query request to extract the query intent and query constraints. The query intent is encoded into an intent vector, and the query constraints are encoded into a constraint tensor. The tensor outer product of the intent vector and the constraint tensor is calculated to generate the query tensor. Tensor contraction is performed on the query dimension of the query tensor and the constraint dimension of the rule vector, and the contracted rule response vector sequence is calculated as the rule inference path; tensor contraction is performed on the intent dimension of the query tensor and the semantic dimension of the data vector, and the contracted data matching vector sequence is calculated as the data inference path. Extract the intermediate rule response vector from the rule response vector sequence, restore the intermediate rule response vector to the rule expression through bijective mapping, and determine whether the rule expression violates the archival business rules. When a rule expression violates the archive business rules, the corresponding dimension index of the violation location in the query tensor is calculated, and tensor decomposition and reorganization operations are performed on the query tensor based on the dimension index to generate a reconstructed query tensor. The reconstructed query tensor is re-operated with tensor shrinkage to generate a corrected rule response vector sequence and a corrected data matching vector sequence. The corrected rule response vector sequence and the corrected data matching vector sequence are then fused to generate the inference result.

4. The method according to claim 3, characterized in that, When a rule expression violates a record business rule, the corresponding dimension index of the violation location in the query tensor is calculated. Based on the dimension index, tensor decomposition and reorganization operations are performed on the query tensor to generate a reconstructed query tensor, which includes: When a rule expression violates the archival business rules, the sequence position of the constraint that violates the archival business rules in the rule response vector sequence is extracted, and the sequence position is converted into the dimension index and index range of the query tensor through coordinate mapping; Based on the dimension index and index range, extract the violation dimension slice from the query tensor, perform tensor decomposition on the violation dimension slice to obtain the tensor component set, calculate the inner product similarity between each tensor component in the tensor component set and the archive business rule vector, and divide the tensor component set into the retained component set and the violation component set according to the inner product similarity. Extract compliance vectors corresponding to constraints from the archival business rules, perform tensor expansion on the compliance vectors to generate compliance tensor components, calculate the tensor inner product of the compliance tensor components and each retained component in the retained component set to determine the fusion weight, and perform weighted summation on the compliance tensor components and the retained component set according to the fusion weight to generate the modified component set. Tensor summation is performed on the modified component set to reconstruct the modified violation dimension slice. Based on the dimension index and index range, the modified violation dimension slice replaces the original violation dimension slice at the corresponding dimension index position in the query tensor, generating the reconstructed query tensor.

5. The method according to claim 1, characterized in that, The semantic gradient of the inference result relative to the original archival data in the inverse coding space is calculated. The descriptive fields requiring correction are identified along the semantic gradient direction, and descriptive instructions are generated, including: The reasoning result is encoded as a result vector, the original data of the archive is encoded as an original vector, the vector difference between the result vector and the original vector is calculated in the inverse encoding space, and the semantic gradient is obtained by performing directional decomposition on the vector difference in each encoding dimension. Bidirectional decoding verification is performed on the semantic gradient. The semantic gradient is mapped to the semantic space and the rule space through the forward mapping function and the backward mapping function respectively to obtain the forward decoding vector and the backward decoding vector. The mapping consistency deviation between the forward decoding vector and the backward decoding vector is calculated, and the mismatched semantic gradient is filtered out based on the mapping consistency deviation. Along the gradient direction of the mismatch semantic gradient, the mismatch semantic gradient is restored to the archive field identifier through a bijective mapping relationship, and the descriptive field that needs to be corrected is located based on the archive field identifier. Extract the corresponding inference field values ​​from the inference results, calculate the encoding distance between the inference field values ​​and the field values ​​of the recording fields in the inverse encoding space, generate field correction vectors based on the encoding distance, verify the compliance of the field correction vectors through the inverse mapping function, and assemble them into recording instructions after verification.

6. The method according to claim 1, characterized in that, Based on the cataloging instructions, cataloging corrections are propagated to related archives according to topological distance in the archival association map. When conflicts occur in the propagation path, the archival business rules are restored through bijective mapping and the adjudication is executed, generating cataloging data including: Locate the source archive node in the archive association map based on the archive field identifier in the cataloging instruction, calculate the topological distance from the source archive node to each associated archive node, and construct the cataloging propagation sequence according to the topological distance; The inference field values ​​in the cataloging instructions are propagated to the associated archive nodes in the cataloging propagation sequence. During the propagation process, the propagation source identifier is marked for the associated archive nodes. When an associated archive node receives multiple inference field values ​​from different propagation source identifiers, the associated archive node is marked as a conflicting archive node. Extract multiple inference field values ​​received by the conflict archive node and encode them into an inference vector. Use the inverse mapping function in the bijective mapping relationship to restore the inference vector into an archive business rule expression. Execute the adjudication according to the rule priority in the archive business rule expression to obtain the adjudication inference field value. Write the adjudication reasoning field value into the corresponding cataloging field of the conflict archive node, and merge the corrected cataloging fields of all related archive nodes in the cataloging propagation sequence with the corrected cataloging fields of the source archive node to generate cataloging data.

7. The method according to claim 1, characterized in that, Calculate the set of field differences between the descriptive data and the original archival data, mark the field difference set with timestamps and inference traceability identifiers, merge the marked difference set with the unmodified fields and write them into the record set, and concatenate the written records into a descriptive version chain including: Perform field-level comparison between the cataloging data and the original archival data, and extract fields with inconsistent values ​​to assemble a field difference set; The field values ​​before and after modification in the field difference set are encoded into difference vector pairs. The difference vector pairs are mapped to the inverse encoding space through a bijective mapping relationship, and the tensor shrinkage trajectory offset is calculated as the rule deviation. The rule deviation is then marked on the field difference set. Mark the field difference set with a timestamp, encode the tensor shrinkage path of the inference result corresponding to the field difference set in the reciprocal encoding space as an inference source identifier and mark it to the field difference set to generate the marked field difference set; The modified field values ​​in the marked field difference set are merged with the unmodified fields in the original archive data. The merged results are then assembled into write records and written to the archive database. Extract the inference tracing identifier from the written record and restore it to a tensor shrinking path. Calculate the path similarity between the tensor shrinking paths of different written records as the version association degree. Serialize the written records by pointer reference according to the timestamp order and version association degree to generate a cataloging version chain.

8. An intelligent question-answering and automatic cataloging system for archives based on a large language model, used to implement the method as described in any one of claims 1-7, characterized in that, include: The rule vector unit is used to acquire the original data of the archives and the business rules of the archives, encode the business rules of the archives and the original data of the archives into rule vectors and data vectors, establish a bijective mapping relationship between the rule vectors and data vectors, and generate a reciprocal encoding space. The query tensor unit is used to receive file query requests. In the reciprocal encoding space, the file query request is encoded into a query tensor. The inference path of the rule vector and the data vector is constrained by the tensor contraction operation. When the rule vector violates the file business rules after being restored by bijective mapping, tensor reconstruction is triggered to generate the inference result. The semantic gradient unit is used to calculate the semantic gradient of the reasoning result relative to the original data of the archive in the reciprocal coding space, identify the recording fields that need to be corrected along the semantic gradient direction, and generate recording instructions. The association graph unit is used to propagate the recording correction to the associated archives according to the topological distance in the archival association graph based on the recording instructions. When a conflict occurs in the propagation path, it is restored to the archival business rules through bijective mapping and the decision is executed to generate recording data. The difference marking unit is used to calculate the field difference set between the catalog data and the original archival data, mark the field difference set with timestamps and inference traceability identifiers, merge the marked difference set with the unmodified fields and write them, and concatenate the written records into a catalog version chain.

9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.