A method and system for compiling a body temporal travel query

CN122925438APending Publication Date: 2026-10-16ZHEJIANG JUSHU TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611076809.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0003]现有数据查询编译方法中本体定义(即数据模型的业务语义层)通常只保留当前最新版本;本体中的对象类型定义、属性到物理列的映射、对象间链接触发规则等关键语义信息一旦发生变更,历史版本即被覆盖或丢弃;一旦数据模型发生变更,历史查询无法还原旧模型下的语义;例如,某字段在2023年名为客户风险等级,2024年更名为客户风险评级并调整了枚举值,使用当前本体查询2023年历史数据时,会因字段名或枚举值不匹配而报错或返回错误结果;

Benefits of technology

本发明在查询编译器中引入时间旅行机制,使得查询编译管线在接收到时间戳参数时,能够从版本化存储中检索对应历史时间点的本体定义和治理策略,并以此为基础完成编译;可解决本体与策略缺乏版本化管理导致的历史查询语义失真和审计结果不一致问题,实现了历史业务语义与治理规则的精准还原与匹配,使得数据审计能够以历史时间点的业务规则和访问控制规则来审查数据,满足金融监管对历史访问决策可重现性的合规要求;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122925438A_ABST
    Figure CN122925438A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of data governance audit, and discloses an ontology time travel query compiling method and system; the method comprises the following steps: receiving a query request containing a timestamp parameter; based on the timestamp parameter, retrieving a historical ontology definition version from an ontology version storage; based on the timestamp parameter, retrieving a historical governance strategy version from a governance strategy version storage; based on the historical ontology definition version and the historical governance strategy version, compiling the query request to generate a post-governance query statement conforming to the semantics of a historical time point; the application introduces a time travel mechanism in a query compiler, so that when the query compiling pipeline receives the timestamp parameter, the ontology definition and the governance strategy of the corresponding historical time point can be retrieved from the versioned storage, and the compiling is completed based on the ontology definition and the governance strategy, so that the data audit can review the data by using the business rules and the access control rules of the historical time point, and the compliance requirements of financial supervision on the reproducibility of historical access decisions are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data governance and auditing technology, and more specifically, to an ontology time travel query compilation method and system. Background Technology

[0002] In highly regulated industries such as finance and healthcare, data auditing and compliance reviews require the use of historical point-in-time business rules to examine current data. For example, regulators may require the use of anti-money laundering rules that took effect in 2023 to examine transaction data for the entire year of 2025, or to use the data model from the end of 2023 to semantically query customer asset data for 2024. The core of these requirements is that the semantics of the query are anchored to a specific point in the past, rather than defaulting to the current system state.

[0003] In existing data query compilation methods, the ontology definition (i.e., the business semantic layer of the data model) usually only retains the latest version. Once key semantic information such as object type definitions, attribute-to-physical column mappings, and inter-object link triggering rules in the ontology changes, the historical version is overwritten or discarded. Once the data model changes, historical queries cannot restore the semantics under the old model. For example, if a field was named Customer Risk Level in 2023 and renamed Customer Risk Rating in 2024 with an adjusted enumeration value, querying historical data from 2023 using the current ontology will result in an error or return incorrect results due to mismatch between the field name or enumeration value. Furthermore, existing governance strategies (including data access control rules, data anonymization rules, field-level permission rules, etc.) cannot automatically apply the governance rules at the time of the query, resulting in discrepancies between the audit results and the actual access results at that time. For example, the data anonymization rules in 2023 required masking the middle four digits of the mobile phone number, while in 2024 they were upgraded to masking the middle six digits. If the 2024 rules are used to audit the 2023 query, the data format that the user actually saw at that time cannot be restored. In addition, the existing query compiler only outputs the compiled results such as SQL statements, without attaching the ontology version and governance policy version information on which the compilation was based; auditors cannot verify which version of the ontology definition and governance policy was used to compile a certain historical query, resulting in an incomplete audit evidence chain.

[0004] In view of this, the present invention proposes an ontology time travel query compilation method and system to solve the above problems. Summary of the Invention

[0005] To overcome the aforementioned deficiencies of the prior art and achieve the above objectives, the present invention provides the following technical solution: An ontology time travel query compilation method, the method comprising: S1. Receive a query request containing a timestamp parameter, wherein the timestamp parameter is a specified historical time point or historical time interval; S2. Based on the timestamp parameter, retrieve the historical ontology definition version that is valid at the specified historical time point from the ontology version storage. The historical ontology definition version includes the set of object type definitions, attribute mappings and link triggering rules that are effective at the corresponding historical time point. S3. Based on the timestamp parameter, retrieve the historical governance strategy version that was valid at the specified historical time point from the governance strategy version storage; S4. Based on the historical ontology definition version and historical governance strategy version, the query request is compiled according to the preset governance-aware query compilation process to generate a post-governance query statement that conforms to the semantics of the historical time point. If there is no version record covering the specified historical time point in the ontology version storage or governance strategy version storage, an error compilation result is returned and no silent degradation is performed.

[0006] Furthermore, the method for retrieving a valid historical ontology definition version at a specified historical point in time from the ontology version store employs an ontology version retrieval function. The implementation is achieved through the following expression:

[0007]

[0008] in, For timestamp parameters, Stored for the original version. For the retrieved historical ontology definition version, This represents the total number of ontology definition versions stored in the ontology version store. Define the effective start time of the version of the i-th ontology. Define the effective and end times of the i-th ontology version. Define a version identifier for the i-th ontology. Define a set of object types for the i-th ontology definition version. Define the number of object types for the i-th ontology version.

[0009] Furthermore, the method for retrieving historical governance policy versions that were valid at a specified historical point in time from the governance policy version store employs a policy version retrieval function. The implementation is achieved through the following expression:

[0010]

[0011] in, For storing governance policy versions, To retrieve the historical governance strategy versions, K represents the total number of governance strategy versions in the governance strategy version storage. Let j be the effective start time of the j-th governance strategy version. Let j be the effective and end time of the governance strategy version. Let j be the version identifier of the governance policy. This refers to the content of the j-th governance strategy version.

[0012] Furthermore, the method for compiling the query request according to the preset governance-aware query compilation process is as follows: a temporary ontology binding runtime is built based on the historical ontology definition version, a temporary governance-aware compilation pipeline is built based on the historical governance strategy version, and abstract syntax tree construction, governance rule injection, governance optimization and target dialect SQL compilation are performed on the query request in the temporary compilation pipeline to generate the governed query statement.

[0013] Furthermore, the ontology version storage uses time intervals as indexes, and each ontology definition version record carries the effective start time and effective end time. When multiple ontology definition versions have time intervals that simultaneously cover a specified historical time point, the ontology definition version with the latest effective start time is selected as the search result.

[0014] Furthermore, the governance strategy version storage records a complete snapshot of each governance strategy change. Each complete snapshot carries the change time, change content, and change source, wherein the change time includes the effective start time and effective end time.

[0015] Furthermore, the method also includes: The version metadata is appended to the compilation result of the post-governance query statement. The version metadata includes: the identifier of the referenced historical ontology definition version, the effective time interval of the historical ontology definition version, the identifier of the referenced historical governance policy version, the effective time interval of the historical governance policy version, and the historical time point parameter specified in the query request.

[0016] Furthermore, the method also includes: When a query request contains multiple subqueries, and each subquery specifies a different historical time point, the following steps are executed independently for each subquery: Retrieve the corresponding historical ontology definition version based on the historical time point specified in the subquery; retrieve the corresponding historical governance strategy version based on the historical time point specified in the subquery; use the retrieved historical ontology definition version and historical governance strategy version to fully compile the subquery according to the preset governance-aware query compilation process, and generate a post-governance subquery statement corresponding to the semantics of the historical time point.

[0017] An ontology time travel query and compilation system, the system comprising: The ontology version retrieval module is used to retrieve historical ontology definition versions from the ontology version storage based on the timestamp parameter; The policy version retrieval module is used to retrieve historical governance policy versions from the governance policy version storage based on the timestamp parameter; The historical compilation module is used to compile query requests according to a preset governance-aware query compilation process using the retrieved historical ontology definition version and historical governance strategy version. The version metadata output module is used to append the referenced version identifier and effective time range to the compilation results; The version verification and error handling module outputs an error compilation result and does not perform silent downgrade when the ontology version retrieval module or the strategy version retrieval module fails to find a version covering the specified historical time point. The multi-subquery independent compilation module retrieves the corresponding historical ontology version and historical governance strategy version for each subquery and compiles them independently when the query request contains multiple subqueries and each subquery specifies a different historical time point.

[0018] The technical effects and advantages of the ontology time travel query compilation method and system of the present invention are as follows: This invention introduces a time travel mechanism into the query compiler, enabling the query compilation pipeline to retrieve the ontology definition and governance strategy corresponding to the historical time point from the versioned storage when it receives the timestamp parameter, and complete the compilation based on this. This solves the problem of semantic distortion of historical queries and inconsistent audit results caused by the lack of versioned management of ontology and strategy, and realizes the accurate restoration and matching of historical business semantics and governance rules. This allows data auditing to examine data based on the business rules and access control rules of the historical time point, meeting the compliance requirements of financial regulators for the reproducibility of historical access decisions. This invention stores ontology versions using time intervals as indexes and retrieves valid historical ontology definition versions at specified historical time points based on timestamp parameters. This ensures that the object type definitions, attribute mappings, and link triggering rules on which the query compilation is based are completely consistent with the historical time points. This solves the problem of semantic distortion in historical queries caused by the continuous evolution of ontology definitions in traditional systems and achieves the audit consistency requirement of understanding the data at that time using the business rules at that time. This invention stores a complete snapshot of each policy change through a governance policy version storage record, and retrieves the valid historical governance policy version at a specified historical time point based on the timestamp parameter. This ensures that the governance rules applied during the query compilation, such as access control, data anonymization, and field-level permissions, are completely matched with the historical time point. This solves the problem of inconsistency between historical audit results and actual access results caused by the continuous evolution of governance policies in traditional systems, and realizes the reproducibility, verifiability, and traceability of historical data access decisions. This invention provides verifiable rule-based evidence for the audit evidence chain by appending version metadata to the compilation results of the post-governance query statement. This metadata includes the version identifier of the referenced historical ontology definition and its effective time interval, the version identifier of the historical governance strategy and its effective time interval, as well as the historical time point parameter specified in the query request. This satisfies the compliance requirements of regulations such as the EU Digital Operations Resilience Act (DORA) on the reproducibility of historical access decisions by financial institutions. Attached Figure Description

[0019] Figure 1 This is a diagram illustrating the method steps of the present invention; Figure 2 This is a flowchart of the method framework of the present invention. Detailed Implementation

[0020] 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.

[0021] In one embodiment, an ontology time travel query compilation method is disclosed, such as Figure 1 , Figure 2 As shown, the methods mainly include: S1. Receive a query request containing a timestamp parameter, where the timestamp parameter is a specified historical time point or historical time range. S2. Based on the timestamp parameter, retrieve the historical ontology definition version that is valid at the specified historical time point from the ontology version storage. The historical ontology definition version includes the set of object type definitions, attribute mappings and link triggering rules that are effective at the corresponding historical time point. S3. Based on the timestamp parameter, retrieve the historical governance policy version that was valid at the specified historical time point from the governance policy version storage; S4. Based on the historical ontology definition version and historical governance strategy version, the query request is compiled according to the preset governance-aware query compilation process to generate a post-governance query statement that conforms to the semantics of the historical time point. If there is no version record covering the specified historical time point in the ontology version storage or governance strategy version storage, an error compilation result is returned and no silent degradation is performed.

[0022] The method for retrieving a valid historical ontology definition version at a specified historical point in time from the ontology version store uses the ontology version retrieval function. The implementation is achieved through the following expression:

[0023]

[0024] in, For timestamp parameters, Stored for the original version. For the retrieved historical ontology definition version, This represents the total number of ontology definition versions stored in the ontology version store. Define the effective start time of the version of the i-th ontology. Define the effective and end times of the i-th ontology version. Define a version identifier for the i-th ontology. Define a set of object types for the i-th ontology definition version. Define the number of object types for the i-th ontology version; The method for retrieving historical governance policy versions that were valid at a specified historical point in time from the governance policy version store uses a policy version retrieval function. The implementation is achieved through the following expression:

[0025]

[0026] in, For storing governance policy versions, To retrieve the historical governance strategy versions, K represents the total number of governance strategy versions in the governance strategy version storage. Let j be the effective start time of the j-th governance strategy version. Let j be the effective and end time of the governance strategy version. Let j be the version identifier of the governance policy. This refers to the content of the j-th governance strategy version; The generated post-governance query statement conforming to the semantics of historical time points is achieved through function compound compilation, and the expression is:

[0027] in, The query statement after processing. For SQL compilation functions, To optimize the function for governance, Inject functions for governance. Construct functions for AST, The default database dialect parameters, For query requests.

[0028] Specifically, it receives query requests containing timestamp parameters, which specify a historical point in time or a historical time interval. The timestamp parameter is the key input to trigger the time travel mechanism. Unlike regular queries, time travel queries explicitly declare the historical point in time to which their semantics are anchored. The compiler uses this information to enter the historical version search branch instead of using the current version by default. The timestamp parameter uses a UTC ISO 8601 format string; the effective time interval adopts left-closed and right-open semantics, that is, the effective start time is included in this version and the effective end time is not included in this version; when the effective end time is empty, it means that the version is still valid; when multiple versions' time intervals cover the specified historical time point, the version with the latest effective start time is selected as the search result. The query request takes the form of a structured object set, which includes the object type API name, the set of candidate attributes, link conditions, and filter conditions. The query requires that the object type name, attribute name, and link name use the names from the historical ontology version, rather than the names from the current ontology version.

[0029] Based on timestamp parameters From the ontology version storage Retrieves a historical ontology definition version that is valid at a specified historical point in time. Ontology version storage Indexed by time interval, each ontology definition version Record the effective start time and effective and termination time The search is performed using the ontology version search function. The specific expression is:

[0030] in, , This indicates that the current validity period is still in effect. For timestamp parameters, Stored for the original version. For the retrieved historical ontology definition version, This represents the total number of ontology definition versions stored in the ontology version store. Define the effective start time of the version of the i-th ontology. Define the effective and end times of the i-th ontology version. Define a version identifier for the i-th ontology. Define a set of object types for the i-th ontology definition version. Define the number of object types for the i-th ontology version. When multiple ontology version time intervals simultaneously cover the specified time point, select the ontology version with the latest effective start time as the search result, i.e.:

[0031] Historical Ontology Definition Version Includes a collection of object type definitions that took effect at the corresponding historical point in time. These definitions, including attribute mapping and link triggering rules, collectively constitute the business semantic layer at that historical point in time, ensuring that subsequent compilations can restore the business meaning at that time.

[0032] The purpose of this implementation plan is to accurately retrieve historical ontology definition versions from the ontology version storage using timestamp parameters. Its significance lies in ensuring that the business semantics (object type definitions, attribute mappings, link triggering rules) on which the query compilation is based are completely consistent with the specified historical time point, thereby solving the problem of historical query semantic distortion caused by the continuous evolution of ontology definitions in traditional systems, and ultimately achieving the audit consistency requirement of understanding the data at that time using the business rules at that time.

[0033] Based on timestamp parameters From the governance strategy version store Search for historical governance strategy versions that were valid at a specified historical point in time. Governance strategy version storage Record a complete snapshot of each governance strategy change, each complete snapshot Include the change time, i.e., the effective start time. and effective and termination time Changes include: content changes and source of changes; retrieval is performed using the strategy version retrieval function. The specific expression is:

[0034]

[0035] in, For storing governance policy versions, To retrieve the historical governance strategy versions, K represents the total number of governance strategy versions in the governance strategy version storage. Let j be the effective start time of the j-th governance strategy version. Let j be the effective and end time of the governance strategy version. Let j be the version identifier of the governance policy. This refers to the content of the j-th governance strategy version.

[0036] The purpose of this implementation plan is to accurately retrieve historical governance policy versions from the governance policy version storage by using timestamp parameters. This ensures that the governance rules applied during the query compilation, such as access control, data anonymization, and field-level permissions, are fully matched with the specified historical time point. This solves the problem of inconsistency between historical audit results and actual access results caused by the continuous evolution of governance policies in traditional systems. Ultimately, it achieves the reproducibility, verifiability, and traceability of historical data access decisions, meeting the compliance requirements of financial regulators for the reproducibility of historical access decisions.

[0037] Additionally, if the ontology version store or governance strategy version store does not contain a version record that covers a specified historical point in time, the compiler will return a compilation result containing an error message and will not perform silent downgrade processing. Furthermore, the ontology version store and governance strategy version store verify the uniqueness of the version identifier when registering a version; if the same version identifier has already been registered, an error will be returned to prevent historical snapshots from being overwritten by subsequent calls.

[0038] Based on historical ontology definition version and historical governance strategy version The query request Q is compiled according to a preset governance-aware query compilation process to generate a post-governance query statement S that conforms to the semantics of historical time points. The preset governance-aware query compilation process is a standard compilation pipeline inherent to the compiler and does not change due to time travel. This allows the current version input in the traditional compilation process to be replaced with historical version input, enabling the same compilation pipeline to output query statements that conform to historical semantics. The preset governance-aware query compilation process includes: building a temporary ontology binding runtime based on the historical ontology definition version, building a temporary governance-aware compilation pipeline based on the historical governance policy version, and performing abstract syntax tree construction, governance rule injection, governance optimization, and target dialect SQL compilation on the query request in the temporary compilation pipeline to generate a post-governance query statement; that is, the following sub-steps are executed sequentially: AST construction : Use historical ontology to define the version Collection of object type definitions Attribute mapping and link triggering rules will trigger query requests. Parse and construct as an initial abstract syntax tree ; Governance Injection Versions of historical governance strategies Governance strategy content (Including data access control rules, data anonymization rules, field-level permission rules, etc.) Inject the abstract syntax tree to generate the governed abstract syntax tree. ; Governance optimization The abstract syntax tree (AST) after injecting governance rules is optimized by eliminating redundant governance checks, merging similar permission verifications, and pushing down governance predicates to the data source layer, thus generating an optimized AST. ; SQL compilation : The optimized abstract syntax tree According to dialect parameters in the target database Compile into a specific SQL statement S; The governance-aware query compilation process supports multiple target database dialects; however, for the graph database AGE dialect, current time travel query compilation is not currently supported, and an error compilation result will be returned if this dialect is requested.

[0039] The purpose of this implementation plan is to input the retrieved historical ontology definition version and historical governance strategy version into a preset governance-aware query compilation process. Through the combination of functions such as AST construction, governance injection, governance optimization, and SQL compilation, a post-governance query statement that conforms to the semantics of the specified historical time point is generated. By utilizing the compiler's inherent standard compilation pipeline, time travel compilation can be achieved simply by replacing the input version without redesigning the compilation process. While maintaining the simplicity of the system architecture, it ensures that the output query statement simultaneously restores the historical business semantics and historical governance rules, enabling auditors to accurately reproduce the data access results at historical time points.

[0040] At the same time, version metadata is appended to the compiled result of the post-governance query statement. The version metadata includes: the version identifier of the referenced historical ontology definition, the effective time range of the historical ontology definition version, the version identifier of the referenced historical governance policy, the effective time range of the historical governance policy version, and the historical time point parameter specified in the query request.

[0041] In this embodiment, version metadata W is appended to the compilation result of the post-governance query statement S for auditing and traceability. Version metadata W includes: the referenced historical ontology definition version identifier, the effective time interval of the historical ontology definition version, the referenced historical governance policy version identifier, the effective time interval of the historical governance policy version, and the historical time point parameter specified in the query request, specifically including: The referenced historical ontology definition version identifier Used to uniquely identify the retrieved historical ontology definition version; the effective time range of the historical ontology definition version. The version identifier of the historical governance strategy cited. Used to uniquely identify the retrieved historical governance strategy version; the effective time range of the historical governance strategy version. The historical time point parameter specified in the query request. This refers to the parameter value of the historical time point or historical time interval specified in the query request; the final version metadata W is represented as:

[0042] Ultimately, the compilation result is an ordered pair:

[0043] Version metadata (W) ensures that auditors can trace the version of the rules on which the compilation was based, providing verifiable rule basis for the audit evidence chain.

[0044] Additionally, when a query request contains multiple subqueries, and each subquery specifies a different historical time point, the following steps are executed independently for each subquery: Retrieve the corresponding historical ontology definition version based on the historical time point specified in the subquery; retrieve the corresponding historical governance strategy version based on the historical time point specified in the subquery; use the retrieved historical ontology definition version and historical governance strategy version to fully compile the subquery according to the preset governance-aware query compilation process, and generate a post-governance subquery statement corresponding to the semantics of the historical time point.

[0045] In this implementation, when a query request contains multiple subqueries and each subquery specifies a different historical time point, the historical ontology definition version retrieval, historical governance strategy version retrieval, and governance-aware query compilation steps are executed independently for each subquery to generate a governed subquery statement corresponding to the semantics of the historical time point specified by the subquery. Specifically, when a query request contains multiple subqueries, and each subquery specifies a different historical time point, a complete time-travel compilation process is executed independently for each subquery: based on the historical time point specified by the subquery, the ontology version retrieval function is used. Retrieve valid historical ontology definition versions for the corresponding historical time point. ; Retrieve function via strategy version Retrieve valid versions of historical governance strategies for the corresponding historical time point. Use the retrieved and The subquery is fully compiled according to the preset governance-aware query compilation process to generate a governed subquery statement corresponding to the semantics of the historical time point. and version metadata Each subquery, after being compiled independently, is combined into the final query statement according to the union operation type (type). This is a joint operation type. This means either deduplicated join or not deduplicated join, where s is the s-th subquery.

[0046] The above solution enables the implementation of joint query scenarios across time points (such as audit analysis comparing data from different periods), ensuring that each subquery uses the business semantics and governance rules of its own specified time point, avoiding rule mismatch or semantic confusion when multiple time points are mixed in queries, thereby ensuring the accuracy and compliance traceability of the results of joint audits at multiple time points.

[0047] In one embodiment, an ontology time travel query compilation system is also disclosed, the system comprising: The ontology version retrieval module is used to retrieve historical ontology definition versions from the ontology version storage based on the timestamp parameter; The policy version retrieval module is used to retrieve historical governance policy versions from the governance policy version storage based on the timestamp parameter; The historical compilation module is used to compile query requests according to a preset governance-aware query compilation process using the retrieved historical ontology definition version and historical governance strategy version. The version metadata output module is used to append the referenced version identifier and effective time range to the compilation results; The version verification and error handling module outputs an error compilation result and does not perform silent downgrade when the ontology version retrieval module or the strategy version retrieval module fails to find a version covering the specified historical time point. The multi-subquery independent compilation module retrieves the corresponding historical ontology version and historical governance strategy version for each subquery and compiles them independently when the query request contains multiple subqueries and each subquery specifies a different historical time point.

[0048] This invention introduces a time travel mechanism into the query compiler, enabling the query compilation pipeline to retrieve the ontology definition and governance strategy corresponding to the historical time point from the versioned storage when it receives the timestamp parameter, and complete the compilation based on this. This solves the problem of semantic distortion of historical queries and inconsistent audit results caused by the lack of versioned management of ontology and strategy, and realizes the accurate restoration and matching of historical business semantics and governance rules. This allows data auditing to examine data based on the business rules and access control rules of the historical time point, meeting the compliance requirements of financial regulators for the reproducibility of historical access decisions. This invention stores ontology versions using time intervals as indexes and retrieves valid historical ontology definition versions at specified historical time points based on timestamp parameters. This ensures that the object type definitions, attribute mappings, and link triggering rules on which the query compilation is based are completely consistent with the historical time points. This solves the problem of semantic distortion in historical queries caused by the continuous evolution of ontology definitions in traditional systems and achieves the audit consistency requirement of understanding the data at that time using the business rules at that time. This invention stores a complete snapshot of each policy change through a governance policy version storage record, and retrieves the valid historical governance policy version at a specified historical time point based on the timestamp parameter. This ensures that the governance rules applied during the query compilation, such as access control, data anonymization, and field-level permissions, are completely matched with the historical time point. This solves the problem of inconsistency between historical audit results and actual access results caused by the continuous evolution of governance policies in traditional systems, and realizes the reproducibility, verifiability, and traceability of historical data access decisions. This invention provides verifiable rule-based evidence for the audit evidence chain by appending version metadata to the compilation results of the post-governance query statement. This metadata includes the version identifier of the referenced historical ontology definition and its effective time interval, the version identifier of the historical governance strategy and its effective time interval, as well as the historical time point parameter specified in the query request. This satisfies the compliance requirements of regulations such as the EU Digital Operations Resilience Act (DORA) on the reproducibility of historical access decisions by financial institutions.

[0049] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

[0050] All formulas in this manual are dimensionless and calculated numerically. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters and thresholds in the formulas are set by those skilled in the art according to the actual situation.

[0051] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A method for compiling an ontology time travel query, characterized in that, The method includes: S1. Receive a query request containing a timestamp parameter, wherein the timestamp parameter is a specified historical time point or historical time interval; S2. Based on the timestamp parameter, retrieve the historical ontology definition version that is valid at the specified historical time point from the ontology version storage. The historical ontology definition version includes the set of object type definitions, attribute mappings and link triggering rules that are effective at the corresponding historical time point. S3. Based on the timestamp parameter, retrieve the historical governance strategy version that was valid at the specified historical time point from the governance strategy version storage; S4. Based on the historical ontology definition version and historical governance strategy version, the query request is compiled according to the preset governance-aware query compilation process to generate a post-governance query statement that conforms to the semantics of the historical time point. If there is no version record covering the specified historical time point in the ontology version storage or governance strategy version storage, an error compilation result is returned and no silent degradation is performed.

2. The ontology time travel query compilation method according to claim 1, characterized in that, The method for retrieving a valid historical ontology definition version at a specified historical point in time from the ontology version store uses the ontology version retrieval function. The implementation is achieved through the following expression: in, For timestamp parameters, Stored for the original version. For the retrieved historical ontology definition version, This represents the total number of ontology definition versions stored in the ontology version store. Define the effective start time of the version of the i-th ontology. Define the effective and end times of the i-th ontology version. Define a version identifier for the i-th ontology. Define a set of object types for the i-th ontology definition version. Define the number of object types for the i-th ontology version.

3. The ontology time travel query compilation method according to claim 1, characterized in that, The method for retrieving historical governance policy versions that were valid at a specified historical point in time from the governance policy version store uses a policy version retrieval function. The implementation is achieved through the following expression: in, For storing governance policy versions, To retrieve the historical governance strategy versions, K represents the total number of governance strategy versions in the governance strategy version storage. Let j be the effective start time of the j-th governance strategy version. Let j be the effective and end time of the governance strategy version. Let j be the version identifier of the governance policy. This refers to the content of the j-th governance strategy version.

4. The ontology time travel query compilation method according to claim 1, characterized in that, The method for compiling a query request according to the preset governance-aware query compilation process is as follows: a temporary ontology binding runtime is built based on the historical ontology definition version, a temporary governance-aware compilation pipeline is built based on the historical governance strategy version, and the query request is processed in the temporary compilation pipeline to perform abstract syntax tree construction, governance rule injection, governance optimization and target dialect SQL compilation to generate a post-governance query statement.

5. The ontology time travel query compilation method according to claim 1, characterized in that, The ontology version storage uses time intervals as indexes. Each ontology definition version record carries the effective start time and effective end time. When multiple ontology definition versions have time intervals that simultaneously cover a specified historical time point, the ontology definition version with the latest effective start time is selected as the search result.

6. The ontology time travel query compilation method according to claim 1, characterized in that, The governance strategy version storage records a complete snapshot of each governance strategy change. Each complete snapshot carries the change time, change content, and change source. The change time includes the effective start time and effective end time.

7. The ontology time travel query compilation method according to claim 1, characterized in that, The method further includes: The version metadata is appended to the compilation result of the post-governance query statement. The version metadata includes: the identifier of the referenced historical ontology definition version, the effective time interval of the historical ontology definition version, the identifier of the referenced historical governance policy version, the effective time interval of the historical governance policy version, and the historical time point parameter specified in the query request.

8. The ontology time travel query compilation method according to claim 1, characterized in that, The method further includes: When a query request contains multiple subqueries, and each subquery specifies a different historical time point, the following steps are executed independently for each subquery: Retrieve the corresponding historical ontology definition version based on the historical time point specified in the subquery; retrieve the corresponding historical governance strategy version based on the historical time point specified in the subquery; use the retrieved historical ontology definition version and historical governance strategy version to fully compile the subquery according to the preset governance-aware query compilation process, and generate a post-governance subquery statement corresponding to the semantics of the historical time point.

9. An ontology time travel query compilation system, implementing the ontology time travel query compilation method according to any one of claims 1-8, characterized in that, The system includes: The ontology version retrieval module is used to retrieve historical ontology definition versions from the ontology version storage based on the timestamp parameter; The policy version retrieval module is used to retrieve historical governance policy versions from the governance policy version storage based on the timestamp parameter; The historical compilation module is used to compile query requests according to a preset governance-aware query compilation process using the retrieved historical ontology definition version and historical governance strategy version. The version metadata output module is used to append the referenced version identifier and effective time range to the compilation results; The version verification and error handling module outputs an error compilation result and does not perform silent downgrade when the ontology version retrieval module or the strategy version retrieval module fails to find a version covering the specified historical time point. The multi-subquery independent compilation module retrieves the corresponding historical ontology version and historical governance strategy version for each subquery and compiles them independently when the query request contains multiple subqueries and each subquery specifies a different historical time point.