Rule version automatic matching method and system based on double time axis
Patent Information
- Application Number
- CN202611039181.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-11-03
AI Technical Summary
In existing technologies, historical objects are prone to incorrect evaluation when matching rules by only applying the latest rules, or manually specifying rule versions is inefficient and cannot guarantee consistency and traceability. This is especially true when the object's time attributes are diverse and the time intervals of rule versions are continuous and there are exceptions, making it impossible to balance historical compliance with current mandatory requirements.
An automatic rule version matching method based on dual timelines is adopted. By constructing a rule version timeline and an object time anchor, a unique match is performed using the effective time interval of the rule version and the time anchor of the target object. An exception handling mechanism is introduced to ensure the consistency and traceability of the matching results.
It automatically binds each target object to a unique and applicable rule version, ensuring the consistency and traceability of judgment results, flexibly handling exceptions, meeting audit requirements, and improving system applicability in complex environments.
Smart Images

Figure CN123030630A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data processing and rule matching technology, specifically relating to a method and system for automatic rule version matching based on dual time axes. Background Technology
[0002] In many industries, rules (such as technical specifications, laws and regulations, and enterprise standards) are constantly updated and iterated over time. When a system needs to determine the applicability of rules to a large number of historical objects (such as building facilities, equipment, and business records), traditional methods typically employ the following two approaches:
[0003] 1. Only apply the latest rules: Simply using the currently valid rules to judge all objects will cause historical objects to be incorrectly evaluated according to the requirements of the new rules, resulting in unreasonable judgment results.
[0004] 2. Manually specifying rule versions: Operators manually select the applicable rule version based on the object's time information, which is inefficient, prone to errors, and cannot guarantee the consistency and traceability of the judgment results.
[0005] Existing technologies lack a mechanism that can automatically, uniquely, and traceably match objects with historical rule versions. Especially when objects have diverse time attributes (such as completion time, commissioning time, and design review time), and the time intervals of rule versions are continuous and there are exceptions (such as functional changes or major hidden dangers), existing systems cannot take into account both historical compliance and current mandatory requirements.
[0006] Therefore, an automatic matching method for rule versions based on dual time axes is needed to ensure the uniqueness, stability, and auditability of the matching results. Summary of the Invention
[0007] This invention aims to overcome the problems of existing rule matching technologies, such as applying only the latest rules leading to incorrect evaluation of historical objects, or the inefficiency, error-proneness, and inability to guarantee consistency and traceability of manually specifying rule versions. It provides an automatic rule version matching method and system based on dual time axes that can automatically, uniquely, and traceably match target objects with historical rule versions, taking into account both historical compliance and current mandatory requirements.
[0008] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0009] The rule version automatic matching method based on dual timelines uses a rule version timeline and an object time anchor point to form a dual timeline for matching. Specifically, it includes the following steps:
[0010] S1, Building the rule version timeline:
[0011] Define a set of rule versions sorted by effective time. Each rule version contains an effective time. Using the effective time of each rule version as the left endpoint of the interval and the effective time of the next rule version as the right endpoint of the interval, construct a left-closed and right-open rule application interval. The application interval of the last rule version is from the effective time of that version to infinity.
[0012] S2, define the time anchor point:
[0013] Define a time anchor function for the target object to determine the applicable rule version, select a base time from multiple candidate time fields of the object and fix it to ensure that it remains unchanged throughout the system lifecycle;
[0014] S3, perform a unique match:
[0015] The applicable intervals of all rule versions constitute a complete division of the timeline and do not overlap with each other. For any target object, the corresponding time anchor point must fall into a unique rule applicable interval, and the rule version corresponding to this interval is the matching version.
[0016] S4, Exception Handling:
[0017] When the preset exception conditions are met, the matching result of step S3 is overridden, the currently valid rule version is returned, and the exception flag is set.
[0018] Preferably, in step S1, the applicable interval of the rule is defined as follows:
[0019] For the i-th rule version The corresponding applicable range is ;
[0020] For the last rule version The corresponding applicable range is ;
[0021] If the time anchor of the target object is earlier than the effective time of the first rule version, it is considered that no rule version applies or it is handled by the system's preset default rule.
[0022] Preferably, in step S3, the unique rule version is determined using a binary search algorithm, the specific process of which is as follows:
[0023] Search for rules that satisfy the condition in a set of rule versions sorted monotonically in ascending order of effective time. The largest version As a matching result, among The time anchor point for the target object p.
[0024] Preferably, in step S4, the preset exception conditions include:
[0025] Degree of change of object properties Or hit the risk candidate conditions And confirmed manually ;
[0026] in, ;
[0027] None indicates that the object's properties remain unchanged; Partial indicates that the object's properties have partially changed; Complete indicates that the object's properties have completely changed.
[0028] As a preferred option, a rule-level conflict resolution step is also included, as follows:
[0029] Define rule hierarchy set : ;
[0030] in to This indicates the rule hierarchy, arranged from highest to lowest priority.
[0031] Establish a partial order relation: , indicating decreasing priority;
[0032] When multiple rule versions conflict, the rule version with the higher level is selected as the final output.
[0033] Preferably, the selection rule for the time anchor point function is as follows:
[0034] Based on the target object type, select one of the fields: completion time, commissioning time, or design review time. Once the selected baseline time is fixed, it remains unchanged throughout the system's lifecycle, and the matching results of historical objects are not affected by subsequent rule version updates.
[0035] As a preferred option, each rule version in the rule version timeline also includes rule hierarchy attributes; the system maintains the validity status of each rule version, where valid versions participate in matching, while invalid versions do not participate in matching, but the historical objects that have been bound to them retain their original matching results.
[0036] As a preferred option, a pre-constraint process for state creation is also included, as detailed below:
[0037] The prerequisite constraints for system state creation must satisfy the following formula: This means that both manual confirmation and rule version matching must be satisfied when generating an official status.
[0038] Where f represents the formal state; This represents the operation that generates the formal state; This indicates manual confirmation of the status. This represents a function that determines the matching rule version based on the target object p and the rule version set V; This indicates the final version of the matching rule.
[0039] Preferably, the system status recording step is also included:
[0040] Define extended state ;
[0041] Here, Q represents the core state, including the formal state, closed-loop state, and risk state; vapplied represents the matched rule version; and ExceptionFlag represents the exception flag.
[0042] In addition, all official states contain vapplied.
[0043] This invention also provides an automatic rule version matching system based on dual timelines, including:
[0044] The rule version storage module is used to maintain a set of rule versions sorted by effective time. Each rule version contains an effective time and constructs a left-closed and right-open rule application range based on adjacent effective times. The application range of the last rule version is from the effective time of that version to infinity.
[0045] The time anchor extraction module is used to define time anchor functions for target objects that need to determine the applicable rule version, select a base time from multiple candidate time fields of the object and fix it to ensure that it remains unchanged throughout the system's lifecycle;
[0046] The matching calculation module is used to perform unique matching: the applicable intervals of all rule versions constitute a complete division of the time axis and do not overlap with each other. For any target object, the corresponding time anchor point must fall into a unique rule applicable interval, and the rule version corresponding to this interval is the matching version.
[0047] The exception handling module is used to override the matching result of the matching calculation module, return the current rule version, and set the exception flag when the preset exception conditions are met.
[0048] Compared with the prior art, the beneficial effects of this invention are: (1) Uniqueness: Through the dual constraints of the rule version timeline and the object time anchor, each target object is automatically bound to a unique applicable rule version, avoiding ambiguity or misuse of human selection when multiple versions coexist, and ensuring the consistency of the judgment results; (2) Traceability and stability: Once the time anchor is determined, it is fixed, and the matching result depends only on the object's own base time and the rule version's effective time, and does not change with subsequent additions, deletions, or modifications to the rule library. The compliance judgment results of historical objects can be reproduced at any time, meeting the requirements of auditing and traceability; (3) Flexibility: An exception handling mechanism is introduced. When an object undergoes a complete attribute change or triggers a high-risk condition and is confirmed manually, it can automatically switch to the latest rule version, adhering to the principle of non-retrogression while taking into account the current security bottom line and mandatory regulatory requirements; (4) Pre-emptive: Rule version matching is used as a pre-constraint for system status creation. All formal records (statuses) must be generated only after the rule version is determined, ensuring that every piece of data has a legal rule basis from the process perspective; (5) Efficiency: The rule version set is arranged by effective time. After the order, the matching process can use the binary search algorithm, with a time complexity of logarithmic level, so it can respond quickly even if the number of rule versions is large; (6) Hierarchical conflict resolution capability: built-in rule hierarchy structure (such as priority order of laws, mandatory norms, national standards, etc.), when there is a content conflict between different level rules, the higher level version is automatically selected, which improves the applicability of the system in complex normative environments; (7) Scalability and universality: the method does not depend on specific business areas and can be widely applied to high responsibility scenarios that require the tracing of historical version rules, such as fire protection facility operation and maintenance, engineering construction compliance judgment, equipment maintenance management, and legal compliance review. Attached Figure Description
[0049] Figure 1 This is a flowchart of an automatic rule version matching method based on dual time axes in this invention. Detailed Implementation
[0050] To more clearly illustrate the embodiments of the present invention, specific implementation methods will be described below with reference to the accompanying drawings. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without any creative effort.
[0051] like Figure 1 As shown, this invention provides an automatic rule version matching method based on dual timelines. It utilizes a rule version timeline and an object time anchor point to construct a dual timeline for matching, specifically including the following steps:
[0052] S1, Building the rule version timeline:
[0053] Define a set of rule versions sorted by effective time. Each rule version contains an effective time. Using the effective time of each rule version as the left endpoint of the interval and the effective time of the next rule version as the right endpoint of the interval, construct a left-closed and right-open rule application interval. The application interval of the last rule version is from the effective time of that version to infinity.
[0054] S2, define the time anchor point:
[0055] Define a time anchor function for the target object to determine the applicable rule version, select a base time from multiple candidate time fields of the object and fix it to ensure that it remains unchanged throughout the system lifecycle;
[0056] S3, perform a unique match:
[0057] The applicable intervals of all rule versions constitute a complete division of the timeline and do not overlap with each other. For any target object, the corresponding time anchor point must fall into a unique rule applicable interval, and the rule version corresponding to this interval is the matching version.
[0058] S4, Exception Handling:
[0059] When the preset exception conditions are met, the matching result of step S3 is overridden, the currently valid rule version is returned, and the exception flag is set.
[0060] The method of this invention serves as a pre-constraint layer of the system, determining the rule version before the target object enters the formal state, including: rule version time axis constraints, object time anchor point constraints, and exception triggering constraints.
[0061] The above constraints together constitute the extended constraint set Ψ. The generation of all object states must simultaneously satisfy the core state constraint Φ and the extended constraint Ψ.
[0062] Specifically, the method process of this invention is as follows:
[0063] 1. Rule version timeline construction:
[0064] Define the set of rule versions: ;
[0065] Each rule version is represented as: ;
[0066] in, Represents the rule identifier (string). Indicates the effective time of the rule (timestamp). This indicates the hierarchical attributes of rules (such as laws, mandatory regulations, national standards, etc.).
[0067] The rule's effective time follows a monotonically increasing sequence: ;
[0068] Based on the rule's effective time sequence, construct the rule's applicable interval (left-closed, right-open):
[0069] For the i-th rule version The corresponding applicable range is ;
[0070] For the last rule version The corresponding applicable range is
[0071] The validity status of system maintenance rule versions: valid versions participate in matching, while invalid versions do not participate in matching, but the historical objects already bound to them remain unchanged.
[0072] 2. Object time anchor function:
[0073] Define the object's time anchor function: ;
[0074] Where Object represents a target object as input. This indicates that a time value will be output.
[0075] Used to extract a unique baseline time value from a target object. The calculation rules for the time anchor point select from multiple candidate time fields based on the object type, for example:
[0076] ;
[0077] Time anchor stability rule: Once the object's time anchor is determined, it remains unchanged throughout the system's lifecycle to ensure that historical matching results can be reproduced and that rule updates do not affect existing results.
[0078] 3. Unique matching constraint:
[0079] For any target object p, there exists a unique rule version. satisfy:
[0080] ;
[0081] This uniqueness is contingent on the rule version timeline being monotonic and the intervals being continuous.
[0082] 4. Non-retroactivity principle and exception mechanism:
[0083] Default principle (non-retroactive): The target object is subject to the rule version corresponding to its time anchor point, i.e. ,in .
[0084] Exception triggering conditions: Exception handling is triggered when any of the following conditions are met:
[0085] (1) The object's attributes have undergone significant changes. );
[0086] (2) The risk candidate conditions are met and the results are confirmed manually. ;
[0087] (3) Satisfy the preset mandatory rules.
[0088] Define the degree of change of object properties:
[0089] .
[0090] Exception handling: When an exception is triggered, return the current rule version (usually the latest version), overwrite the original time matching result, and set the exception flag.
[0091] 5. Rule hierarchy and conflict resolution:
[0092] Define the rule hierarchy set: ;
[0093] in to This indicates the rule hierarchy, arranged from highest to lowest priority.
[0094] Establish a partial order relation: , indicating decreasing priority.
[0095] Hierarchical priority rule: When multiple rule versions conflict, the rule version with the higher hierarchy is selected first.
[0096] 6. Dual-time-axis matching algorithm:
[0097] The specific steps of the algorithm are as follows:
[0098] (1) Exception detection: If or If so, return to the current rule version and set the exception flag;
[0099] (2) Time matching: finding the time matching The largest version .
[0100] (3) Hierarchical filtering: Filter candidate rules that meet the hierarchical constraints.
[0101] (4) Conflict resolution: Select the final version according to the hierarchical priority rule.
[0102] (5) Output the matching rule version With the exception flag ExceptionFlag.
[0103] When the rule version set is sorted by effective time, this algorithm can be implemented using binary search, with a time complexity of O(n log n). .
[0104] 7. System state expansion and creation of prerequisite constraints:
[0105] Define extended system states: ;
[0106] Here, Q represents the core state, including the formal state, closed-loop state, and risk state; vapplied represents the matched rule version; and ExceptionFlag represents the exception flag.
[0107] Create prerequisite constraints: The generation of a formal state (such as formal state f) must simultaneously satisfy both human confirmation and rule version matching. ;
[0108] Rule applies legality constraints: ;
[0109] In addition, the present invention also provides an automatic rule version matching system based on dual time axes, including:
[0110] The rule version storage module is used to maintain a set of rule versions sorted by effective time. Each rule version contains an effective time and constructs a left-closed and right-open rule application range based on adjacent effective times. The application range of the last rule version is from the effective time of that version to infinity.
[0111] The time anchor extraction module is used to define time anchor functions for target objects that need to determine the applicable rule version, select a base time from multiple candidate time fields of the object and fix it to ensure that it remains unchanged throughout the system's lifecycle;
[0112] The matching calculation module is used to perform unique matching: the applicable intervals of all rule versions constitute a complete division of the time axis and do not overlap with each other. For any target object, the corresponding time anchor point must fall into a unique rule applicable interval, and the rule version corresponding to this interval is the matching version.
[0113] The exception handling module is used to override the matching result of the matching calculation module, return the current rule version, and set the exception flag when the preset exception conditions are met.
[0114] Based on the technical solution of this invention, the implementation process of this invention in practical applications will be illustrated through the following case scenarios. The specific application implementation scheme is as follows:
[0115] Taking the operation and maintenance of building fire protection facilities as an example, the system maintains multiple versions of fire protection codes (such as GB 50166-2019 and GB55036-2022). For a building completed in 2020, the system extracts its completion time as a time anchor. Assuming the specification versions take effect on January 1, 2019, and April 1, 2022, respectively, then... If the building falls within the applicable scope of the 2019 version of the standard, the system will automatically match the 2019 version of the standard. If the building's function changes in 2024... If the exception is triggered, the system will automatically match the latest specification (2022 version) and set an exception flag for auditing.
[0116] This embodiment verifies the automatic matching, exception handling, and stability effects of the present invention.
[0117] This invention is particularly applicable to high-responsibility scenarios such as fire protection facility operation and maintenance, engineering construction compliance assessment, and equipment maintenance management, where judgments need to be made based on historical version rules.
[0118] The above description is merely a detailed explanation of preferred embodiments and principles of the present invention. For those skilled in the art, there may be changes in specific implementation methods based on the ideas provided by the present invention, and these changes should also be considered within the scope of protection of the present invention.
Claims
1. A method for automatic rule version matching based on dual timelines, characterized in that, Matching is performed by using a dual timeline constructed from the rule version timeline and the object's time anchor point, specifically including the following steps: S1, Building the rule version timeline: Define a set of rule versions sorted by effective time. Each rule version contains an effective time. Using the effective time of each rule version as the left endpoint of the interval and the effective time of the next rule version as the right endpoint of the interval, construct a left-closed and right-open rule application interval. The application interval of the last rule version is from the effective time of that version to infinity. S2, define the time anchor point: Define a time anchor function for the target object to determine the applicable rule version, select a base time from multiple candidate time fields of the object and fix it to ensure that it remains unchanged throughout the system lifecycle; S3, perform a unique match: The applicable intervals of all rule versions constitute a complete division of the timeline and do not overlap with each other. For any target object, the corresponding time anchor point must fall into a unique rule applicable interval, and the rule version corresponding to this interval is the matching version. S4, Exception Handling: When the preset exception conditions are met, the matching result of step S3 is overridden, the currently valid rule version is returned, and the exception flag is set.
2. The rule version automatic matching method based on dual time axes according to claim 1, characterized in that, In step S1, the applicable interval of the rule is defined as follows: For the i-th rule version The corresponding applicable range is ; For the last rule version The corresponding applicable range is ; If the time anchor of the target object is earlier than the effective time of the first rule version, it is considered that no rule version applies or it is handled by the system's preset default rule.
3. The rule version automatic matching method based on dual time axes according to claim 2, characterized in that, In step S3, the unique rule version is determined using a binary search algorithm, and the specific process is as follows: Search for rules that satisfy the condition in a set of rule versions sorted monotonically in ascending order of effective time. The largest version As a matching result, among The time anchor point for the target object p.
4. The rule version automatic matching method based on dual time axes according to claim 3, characterized in that, In step S4, the preset exception conditions include: Degree of change of object properties Or hit the risk candidate conditions And confirmed manually ; in, ; None indicates that the object's properties remain unchanged; Partial indicates that the object's properties have partially changed; Complete indicates that the object's properties have completely changed.
5. The rule version automatic matching method based on dual time axes according to claim 4, characterized in that, It also includes rule-level conflict resolution steps, as detailed below: Define rule hierarchy set : ; in to This indicates the rule hierarchy, arranged from highest to lowest priority. Establish a partial order relation: , indicating decreasing priority; When multiple rule versions conflict, the rule version with the higher level is selected as the final output.
6. The rule version automatic matching method based on dual time axes according to claim 5, characterized in that, The selection rules for the time anchor point function are as follows: Based on the target object type, select one of the fields: completion time, commissioning time, or design review time. Once the selected baseline time is fixed, it remains unchanged throughout the system's lifecycle, and the matching results of historical objects are not affected by subsequent rule version updates.
7. The rule version automatic matching method based on dual time axes according to claim 6, characterized in that, In the rule version timeline, each rule version also contains rule hierarchy attributes; the system maintains the validity status of each rule version, where valid versions participate in matching, while invalid versions do not participate in matching, but the historical objects that have been bound to them retain their original matching results.
8. The rule version automatic matching method based on dual time axes according to claim 7, characterized in that, It also includes the pre-constraint process for state creation, as detailed below: The prerequisite constraints for system state creation must satisfy the following formula: This means that both manual confirmation and rule version matching must be satisfied when generating an official status. Where f represents the formal state; This represents the operation that generates the formal state; This indicates manual confirmation of the status. This represents a function that determines the matching rule version based on the target object p and the rule version set V. This indicates the final version of the matching rule.
9. The rule version automatic matching method based on dual time axes according to claim 8, characterized in that, It also includes the step of extending system status logging: Define extended state ; Here, Q represents the core state, including the formal state, closed-loop state, and risk state; vapplied represents the matched rule version; and ExceptionFlag represents the exception flag. In addition, all official states contain vapplied.
10. A rule version automatic matching system based on dual timelines, used to implement the rule version automatic matching method based on dual timelines as described in any one of claims 1-9, characterized in that, The rule version automatic matching system based on dual time axes includes: The rule version storage module is used to maintain a set of rule versions sorted by effective time. Each rule version contains an effective time and constructs a left-closed and right-open rule application range based on adjacent effective times. The application range of the last rule version is from the effective time of that version to infinity. The time anchor extraction module is used to define time anchor functions for target objects that need to determine the applicable rule version, select a base time from multiple candidate time fields of the object and fix it to ensure that it remains unchanged throughout the system's lifecycle; The matching calculation module is used to perform unique matching: the applicable intervals of all rule versions constitute a complete division of the time axis and do not overlap with each other. For any target object, the corresponding time anchor point must fall into a unique rule applicable interval, and the rule version corresponding to this interval is the matching version. The exception handling module is used to override the matching result of the matching calculation module, return the current rule version, and set the exception flag when the preset exception conditions are met.
