An integral calculation method and device based on an executable rule meta model

By using an executable rule meta-model approach, the integral rules are split into a seven-domain structure, generating immutable snapshots and supporting a dual time axis mechanism. This solves the problems of scattered and inconsistent integral rule configuration items in existing technologies, and achieves efficient and auditable integral calculation and management.

CN123141031APending Publication Date: 2026-11-20北京领雁科技股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611364047.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-04
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In existing banking and internet finance systems, the configuration items for points rules are scattered and lack an independently executable meta-model. This results in rules that cannot be combined and reused. The judgment order and calculation formula are fixed in the code, making it difficult to trace causal relationships. Inconsistent results occur when multiple conditions are concurrent, version management is inconsistent, auditing and dispute handling lack a basis, points are easily duplicated or omitted in high-concurrency scenarios, cost predictions are inconsistent, key information in points transaction records is missing, and debugging and explanation costs are increased.

Method used

The method based on the executable rule meta-model is adopted to decompose the integral rules into the fact domain, condition domain, calculation domain, control domain, accounting domain, version domain and audit domain, generating a seven-domain rule meta-model. An immutable rule snapshot is generated through compilation and verification, supporting dual time axis mechanism and conflict arbitration, realizing multi-level arbitration and frequency deduplication, unifying the processing of integral calculation and accounting flow, and generating interpretation chain records.

Benefits of technology

It enables the compilation, verification, and auditability of points rules, avoids duplicate point submissions, ensures real-time consistency, reduces maintenance costs, supports the reuse of multiple points types, provides a complete audit evidence chain, and reduces the risk of customer complaints.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123141031A_ABST
    Figure CN123141031A_ABST
Patent Text Reader

Abstract

The application discloses a kind of integral calculation method and device based on executable rule meta-model, belong to computer data processing technical field, the integral rule of this scheme is split into seven-domain metadata of fact domain, condition domain, calculation domain, control domain, account domain, version domain, audit domain, and is compiled as executable rule snapshot when publishing;Candidate rule screening, condition matching, calculation action, conflict arbitration, quota occupancy, effective period generation, entry path selection and audit record are executed at runtime;Different businesses are expressed by unified rule meta-model;Rule version snapshot guarantees historical playback;Priority, exclusive group, arbitration operator such as taking care of condition overlap;Quota occupancy account book is unified to top;Idempotent key and difference account book realize re-calculation and issue deduction;Rule configuration online, conflict pre-discovery, calculation certainty, top accuracy, historical playback, re-calculation disturbance reduction, budget controllable and audit integrity are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer data processing technology, and in particular to customer points processing technology in banking and internet finance scenarios, specifically to a points calculation method and apparatus based on an executable rule meta-model. Background Technology

[0002] In banking and internet finance scenarios, customer points are typically determined by multiple factors, including points type, points rules, customer scope, transaction or behavioral data, points accounts, crediting approval, and validity period management. Existing systems generally handle points distribution using fixed program logic or by developing separate programs for each activity: business personnel propose points activity requirements, developers write corresponding calculation programs based on specific scenarios such as debit card transactions, credit card transactions, contract signing, asset enhancement, birthday benefits, payouts, loan disbursements, and value points, and then write the calculation results into the customer's points account through batch tasks or real-time interfaces.

[0003] In existing solutions, the configuration items for points rules are typically scattered across different pages, table structures, or business modules. For debit card transaction rules, the current system needs to calculate basic points based on customer level, card type, and POS transaction amount, and perform additional checks for special card types and weekend transactions. For credit card transaction rules, it is also necessary to handle differences between standard cards, gold cards, and platinum cards, and select a scoring rule based on manually agreed priorities when conditions such as daily multipliers, weekend double multipliers, birthday multipliers, and double multipliers during special periods overlap.

[0004] For non-transactional scenarios such as business processing, asset enhancement, and customer birthdays, existing systems typically implement fixed-value calculation, proportional calculation, and tiered calculation logic through different batch tasks or different interfaces. Each type of rule needs to handle common constraints such as effective start and end dates, points validity period, real-time or audit-based crediting, daily or monthly scoring frequency, and approval workflow status.

[0005] Existing points rule management systems generally adopt a hybrid approach of page field configuration and program hard coding, resulting in a lack of independently executable meta-models for rule expression. The judgment order, calculation formula, capping, and conflict handling logic are all fixed in the code, making it impossible to combine and reuse rules. At the same time, the factual conditions, calculation actions, control constraints, and accounting actions lack hierarchical design, and the mixed logic makes it difficult to trace causal relationships. When multiple conditions are concurrent, there is a lack of a unified arbitration mechanism for priority, exclusivity, taking the highest value, superposition, or truncation, and the same input may yield inconsistent results in different execution environments. Transaction-level, daily-level, monthly-level, customer-level, and card-type-level capping depends on post-event aggregation, and in high-concurrency scenarios, when points are both audited and already credited, it is easy to exceed the limit or use them repeatedly. The lack of rule version snapshots means that historical recalculations cannot restore old parameters, and auditing and dispute handling lack a basis; the validity period, cross-year expiration, and deduction logic are tightly coupled with the issuance, and the deduction relies on an independent script, making it difficult to guarantee consistency in complex scenarios; the recalculation mechanism only supports full cleanup or incremental reruns, and cannot identify issued, under-issued, over-issued, or under-review statuses, which is prone to duplication or omission; cost prediction uses a temporary estimation method that is inconsistent with the official issuance, and the approval process only targets fields without verifying compilation, conflicts, budgets, and the impact on effective rules; in addition, the points transaction record only records the final value, lacking key information such as hit rules, version, conditions, reasons for non-hit, capping truncation, arbitration results, and accounting paths, significantly increasing the cost of debugging and explanation.

[0006] In summary, the existing system has significant technical deficiencies in terms of rule expression capabilities, execution determinism, concurrency control, version management, anomaly recovery, prediction and evaluation, and observability, making it difficult to meet the requirements of highly reliable, auditable, and evolvable points-based business. Summary of the Invention

[0007] To address the shortcomings of the prior art, this application provides an integral calculation method and apparatus based on an executable rule meta-model.

[0008] In its first aspect, this application proposes an integral calculation method based on an executable rule meta-model, comprising the following steps: Configure basic points parameters and draft rules, and determine points type, affiliated institution, exchange rate, validity period and account category; The rule draft is parsed into structured metadata, and a seven-domain rule meta-model is generated according to the heterogeneous domain model, which includes the fact domain, condition domain, calculation domain, control domain, accounting domain, version domain and audit domain. The data binding relationship between the domains in the seven-domain rule meta-model is fixed. Perform compilation verification on the seven-domain rule metamodel. After the verification passes, serialize the seven-domain metadata and inter-domain binding relationships and generate an immutable rule snapshot. Submit the rule snapshot for approval. Once approved, publish the rule snapshot using a dual timeline mechanism and simultaneously generate a rule effective index. Receive business fact data, standardize the business fact data into unified standard facts, and recall snapshots of effective candidate rules based on points type, organization, and fact type; Perform condition matching on each recalled candidate rule snapshot. After the condition matching is successful, perform integral calculation according to the operator graph defined in the computational domain to generate at least one candidate integral result.

[0009] Secondly, this application proposes an integral calculation device based on an executable rule meta-model, comprising: The basic parameter configuration module is used to configure basic points parameters and rule drafts, and to determine the points type, affiliated institution, exchange rate, validity period, and account category. The rule metamodel generation module is used to parse the rule draft into structured metadata and generate a seven-domain rule metamodel containing the fact domain, condition domain, calculation domain, control domain, accounting domain, version domain and audit domain according to the heterogeneous domain model. The data binding relationship between the domains in the seven-domain rule metamodel is fixed. The compilation and verification module is used to perform compilation and verification on the seven-domain rule meta-model. After the verification is passed, the seven-domain metadata and inter-domain binding relationships are serialized and an immutable rule snapshot is generated. The approval and release module is used to submit rule snapshots for approval. Once approved, the rule snapshots are released using a dual timeline mechanism, and an effective rule index is generated simultaneously. The fact receiving and rule recall module is used to receive business fact data, standardize the business fact data into unified standard facts, and recall effective candidate rule snapshots based on points type, organization, and fact type. The condition matching and calculation module is used to perform condition matching on each of the recalled candidate rule snapshots. After the condition matching is successful, it performs integral calculation according to the operator graph defined in the computation domain to generate at least one candidate integral result. The conflict arbitration module is used to perform deterministic conflict arbitration on multiple candidate integration results and output the final integration result; The frequency deduplication and quota control module is used to perform frequency deduplication and quota occupancy concurrency control on the final integration result; The accounting transaction generation module is used to generate a three-tiered accounting transaction record that includes calculated transaction record, pending transaction record, and account transaction record based on the accounting strategy. The three-tiered accounting transaction record are associated through the same calculation identifier. The Explanation Chain Generation Module is used to generate explanation chain records. The explanation chain record contains candidate rule information, reasons for misses, conditional branches, arbitration paths, capped cutoff values, and accounting paths.

[0010] The beneficial effects of this invention are: The points system is divided into fact, condition, calculation, control, accounting, version, and audit domains. Adding a new activity only requires configuring metadata such as customer scope, fact type, conditions, operators, cap, frequency, and crediting strategy on the page. The system uniformly compiles this into an immutable snapshot for execution, requiring no coding or release. Operators such as fixed values, proportions, tiers, stacking, truncation, and deductions can be freely combined to cover complex scenarios such as card swiping, asset enhancement, payroll, loans, and year-end promotions. Expansion only requires reusing the meta-model. Before release, the system automatically verifies customer scope, time, overlapping tiers, missing exclusive groups / priorities, and budget overruns to avoid duplicate points distribution and cost overruns. Multi-level arbitration is implemented through exclusive groups, priorities, accuracy, and the order of taking the highest value / stacking / truncation to ensure consistency in real-time, batch, recalculation, and prediction. The credit limit occupancy ledger uniformly manages credit points already credited, pending review, pending crediting, and points in the current batch, preventing the aggregation of primary and supplementary cards and concurrent over-issuance. Dual timelines support late data, recalculation, and audit restoration. The difference compensation ledger only processes the unpaid / underpaid / overpaid portions, avoiding a full rerun; the shadow ledger reuses snapshot and capping logic to provide consistent budget forecasting. Transaction layering supports high-risk transactions with pre-calculation and post-approval, releasing credit limits upon approval rejection; the explanation chain records candidate rules, reasons for non-hit, hit branches, arbitration truncation, and accounting paths, reducing customer complaints. The same engine supports multiple types such as bank points, equity points, and value points, which can be reused by institutional configuration; return deductions, reversals, and cross-year invalidations are handled uniformly by the accounting domain. Capping keys, frequency keys, and fact idempotent keys achieve deduplication and concurrency control, preventing missed / reissues; snapshot hashes, approval / release / calculation batches are linked to accounting transactions to form a complete audit evidence chain. Long-term expansion only requires metadata or operators, with complexity increasing more slowly with the number of rules, significantly reducing maintenance costs. Attached Figure Description

[0011] Figure 1 This is the overall flowchart of the present invention.

[0012] Figure 2 This is a schematic diagram of the seven-domain rule meta-model structure.

[0013] Figure 3 A schematic diagram illustrating the compilation, verification, and snapshot generation of the seven-domain rule meta-model.

[0014] Figure 4 This is a diagram showing the functional module breakdown and end-to-end working principle.

[0015] Figure 5 A diagram illustrating the working principle of rule configuration, compilation, approval, and release.

[0016] Figure 6 This is a diagram illustrating the timeline rules version and approval / release process.

[0017] Figure 7 This is a diagram illustrating the working principle of runtime integral calculation.

[0018] Figure 8 This is a diagram illustrating a multi-rule conflict arbitration mechanism.

[0019] Figure 9 This is a diagram illustrating the details of arbitration for multiple rule conflicts.

[0020] Figure 10 This is a schematic diagram of a quota-based capping mechanism.

[0021] Figure 11 This is a schematic diagram of the shadow ledger for prediction and difference recalculation compensation.

[0022] Figure 12 This is a structural framework diagram of the device. Detailed Implementation

[0023] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein; rather, these embodiments are provided so that a more thorough understanding of the invention can be achieved and that the full scope of the invention can be conveyed to those skilled in the art.

[0024] Firstly, this application proposes an integral calculation method based on an executable rule meta-model, such as... Figure 1 As shown, it includes the following steps: S1: Configure basic points parameters and rule drafts, and determine points type, affiliated institution, exchange rate, validity period and account category; Specifically, S1 includes maintaining the `point_type_config` (points type configuration table), `point_account_policy` (points account policy table), and `expire_policy` (points validity period policy table). The points type configuration table determines the points type, affiliated institution, redemption rate, validity period, account category, and crediting direction, configuring adaptation relationships with external systems such as transaction core, customer tags, card system, merchant blacklist, approval workflow, account core, and customer service work orders. The points account policy table defines policies such as points crediting direction, account category, primary and supplementary card aggregation, and whether crediting is subject to review. The points validity period policy table defines basic parameters such as fixed expiration, expiration by calendar year, expiration by a certain number of months from the acquisition date, and expiration across years. The adaptation layer uniformly converts external messages into CanonicalFact (normalized fact data structure) and retains `source_system` (source system), `source_event_id` (unique identifier of the source event), and `ingest_time` (access time) for fact idempotency, audit traceability, and anomaly replay.

[0025] The points type must include at least a points type code, points type name, points category, affiliated institution, minimum points redemption value, points redemption rate, card type, status, and effective date. Points type codes may include debit card points, credit card points, value points, and Star Coins, etc. The system generates an approval form when adding, modifying, activating, or deactivating points types, and controls the points type status to flow between pending submission, under review, returned, pending activation, activated, and deactivated based on the approval result. Activated points types cannot be directly deleted to ensure the traceability of published rules and historical points records.

[0026] S2: Parse the rule draft into structured metadata and generate a seven-domain rule meta-model containing the fact domain, condition domain, calculation domain, control domain, accounting domain, version domain, and audit domain according to the heterogeneous domain model. The data binding relationship between the domains in the seven-domain rule meta-model is fixed. Furthermore, such as Figure 2 As shown, the seven-domain rule meta-model includes: The fact domain declares the types of fact objects that rules can accept; the condition domain declares fields, operators, thresholds, and time windows, and the condition domain can only reference fields already declared in the fact domain; the calculation domain declares the integral calculation operator, and the input of the calculation domain comes from the matching results of the condition domain or the numerical fields of the fact domain; the control domain declares priority, exclusive groups, and capped dimensions; the accounting domain declares the real-time accounting policy, audit accounting policy, and integral validity period; the version domain provides the snapshot hash, effective time, and system time for the fact domain, condition domain, calculation domain, control domain, and accounting domain; and the audit domain subscribes to the output of each domain and generates trace events.

[0027] S2 specifically includes: Operations personnel maintain customer scope, card type, merchant, amount range, date attribute, calculation formula, cap, frequency, posting method, and audit level on the rule configuration console. Furthermore, the seven-domain rule meta-model is implemented using three types of structured metadata: "rule domain metadata table + inter-domain binding table + compilation constraint table." The system parses the rule draft (rule_draft) into rule_domain_meta (rule domain metadata table) and generates structured metadata according to fact domain, condition domain, calculation domain, control domain, accounting domain, version domain, and audit domain. Inter-domain references are written to rule_domain_binding (inter-domain binding table), and field types, operator signatures, and required constraints are written to rule_compile_constraint (compile constraint table), making the page configuration a compileable and verifiable data structure.

[0028] The rule domain metadata table `rule_domain_meta` records the field and operator definitions for each domain. The structured representation storing the seven domain metadata includes at least `rule_id` (rule number), `domain_type` (domain type), `field_path` (field path), `field_type` (field type), `source_system` (source system), `nullable_flag` (whether nullable), `operator_code` (operator code), `input_ref` (input reference), `output_symbol` (output symbol), and `constraint_expr` (constraint expression). The domain binding table `rule_domain_binding` records the input-output relationship between domains: `from_domain` (source domain), `from_symbol` (source output symbol), `to_domain` (target domain), `to_input` (target input parameter), `type_cast_policy` (type conversion policy), and `required_flag` (whether required). The compilation constraint table `rule_compile_constraint` records the compilation verification constraints: `constraint_code` (constraint code), `constraint_scope` (constraint scope), `check_expr` (verification expression), and `error_template` (error template). Through the three types of tables mentioned above, the rule configuration is transformed into a machine-verifiable data structure.

[0029] The configuration elements for different points scenarios are abstracted into a unified rule model. Each rule includes at least the rule number, rule name, points type, issuing institution, customer scope, rule validity period, points validity period, billing method, scoring frequency, rule status, applicant's employee ID, applicant's name, rule version number, and rule details. The rule details further include the calculation basis, calculation method, calculation parameters, capping parameters, exclusion parameters, priority parameters, and special processing parameters. Specifically, customer scope, card type, merchant, amount range, and date attributes are entered into the fact domain and condition domain; calculation formula, ratio, fixed value, and tiered parameters are entered into the calculation domain; capping, frequency, priority, and exclusive group are entered into the control domain; billing method, validity period, and deduction strategy are entered into the accounting domain; version number, effective time, and approval batch are entered into the version domain; and audit level, explanation field, and tracking event are entered into the audit domain.

[0030] The customer scope supports three input methods: first, selecting the customer scope through customer tags or categories within the system; second, importing the customer list from an external file; and third, having the customer scope file pushed from the bank's internal system. Before calculation, the rule engine converts the customer scope into a matching set of customers or tag conditions, and during calculation, it determines whether the customers corresponding to the input factual data belong to the valid customer scope of the rule.

[0031] The calculation methods include at least fixed value calculation, proportional calculation, tiered calculation, tiered proportional calculation, and integer multiple calculation. Fixed value calculation is used for scenarios such as signing a contract, first card opening, monthly login, points for special VIP customers, and fixed points for value points; proportional calculation is used for scenarios such as POS transaction amount, monthly AUM increase, and mortgage loan disbursement amount; tiered calculation is used for scenarios such as customer birthday, payout amount, and customer level; tiered proportional calculation is used for points calculation under combinations of customer level, card type, and transaction amount; and integer multiple calculation is used to generate points based on integer multiples of the POS transaction base.

[0032] To enable rule configurations to be directly translated into executable logic, this solution further defines a seven-domain rule metamodel, which further breaks down the unified rule model into compilable metadata comprising fact domain, condition domain, calculation domain, control domain, accounting domain, version domain, and audit domain. The fact domain declares the types of fact objects that the rule can accept, derived from the "calculation basis / business scenario / fact source" configuration in the rule draft. Examples include POS transactions, contract signing behavior, monthly AUM increases, birthday lists, payout amounts, loan disbursements, and customer level changes. POS transactions correspond to fields such as transaction amount, transaction time, card number, and merchant type; contract signing behavior corresponds to product code, signing channel, and signing time; monthly AUM increases correspond to customer number, beginning-of-month assets, ending-of-month assets, and increase amount; birthday lists correspond to customer number, birthday date, and customer level; payout amounts correspond to customer number, payout batch, and payout amount; and loan disbursements correspond to customer number, loan product, disbursement amount, and disbursement time. These fields first enter the fact domain; the condition domain and calculation domain can only reference fields already declared in the fact domain. The Conditions field declares fields, operators, thresholds, time windows, and data sources, such as customer level belonging to a specified set, transaction date falling on a weekend, supplier not on a blacklist, and payment amount falling into a specified tier. The Calculation field declares points calculation operators, base, ratio, fixed value, rounding method, and integer multiple rounding method. The Control field declares priority, exclusive groups, stacking method, higher-order take-all method, capping dimension, supplier transaction limit, and return deduction method. The Accounting field declares real-time posting, audited posting, primary and supplementary card aggregation, points validity period, and cross-year expiration method. The Version field declares version number, effective start and end dates, approval batch, and release batch. The Audit field declares mandatory output reasons for hits, reasons for misses, capping truncation, arbitration results, and idempotent keys.

[0033] The seven-domain rule metamodels are bound together through explicit input / output contracts: the fact domain declares field names, field types, source systems, and nullability; the condition domain can only reference fields declared in the fact domain and outputs matching results as boolean values, sets of hit tags, or interval hit objects; the computation domain references the output of the condition domain or fields declared in the fact domain and outputs candidate integrals (CandidatePoint); the control domain receives candidate integrals and outputs FinalPoint by combining priority, exclusive group, capping key, and frequency key; the accounting domain receives FinalPoint and accounting strategy and outputs accounting instruction (LedgerCommand); the version domain provides each domain with snapshot_hash, business activation time, and system release time; and the audit domain subscribes to the inputs and outputs of each domain and generates trace events (TraceEvent).

[0034] Specifically: the data binding relationship between domains is fixed in the following direction: the fact domain outputs the FactField. <t>(Fact Field with Type), Conditional Field Input FactField <t>(Fact fields with type) and output MatchResult<Boolean|RangeHit|EnumHit|TagSet> (Match results can include Boolean match, range match, enumeration match, or tag set match); the computed domain takes MatchResult (match result) or a numeric field from the fact domain and outputs PointValue. <decimal>(Decimal integral value); The control field takes CandidatePoint (candidate integral result), priority, exclusive_group, cap_key_template (capped key template), and freq_key_template (frequency key template) as input and outputs FinalPoint (final integral result); The accounting field takes FinalPoint (final integral result) and ledger_policy (accounting policy) as input and outputs LedgerCommand (accounting instruction); The version field provides snapshot_hash (rule snapshot hash), valid_time (business validity time), and system_time (system time) for the above fields; The audit field subscribes to the output of each field and generates TraceEvent (trace event). Any backreferences, cross-level jump references, or undeclared output symbols are considered compilation errors.

[0035] S3: Perform compilation verification on the seven-domain rule meta-model. After the verification passes, serialize the seven-domain metadata and inter-domain binding relationships and generate an immutable rule snapshot. S3 specifically includes: The RuleCompileService reads the seven-domain metadata and constructs an inter-domain dependency graph, checking field references, type compatibility, interval exclusivity, tier continuity, capped dimensions, frequency windows, exclusive groups, priority, and budget impact. The system further constructs a CoverageMatrix, performing condition space intersection checks on rules within the same integral type, institution, fact type, and validity period bucket. After successful verification, the seven-domain metadata, binding graph, compilation constraints, coverage matrix, conflict detection results, and effective time range are arranged in a deterministic order to generate a MerkleRoot hash, which is then written as a snapshot hash to the rule snapshot table. Rule snapshots are generated using a verifiable serialization mechanism: the system serializes the metadata of the fact domain, condition domain, computation domain, control domain, accounting domain, version domain, and audit domain into a Protocol Buffers (Google's structured data serialization framework) structure in a fixed field order. Using serialized fragments of each domain, inter-domain binding graphs, compilation constraints, and effective scope as leaf nodes in the Merkle tree, the system calculates the MerkleRoot layer by layer as the snapshot identifier for content addressing. This snapshot identifier is written as the rule version key into the computation log, pending invoice log, account log, and audit log. Any integral calculation can be reversed using the snapshot identifier to retrieve the complete rule context, operator parameters, and inter-domain dependency graph, thus ensuring that approval, execution, recalculation, and auditing use the same immutable execution approach.

[0036] Furthermore, the compilation verification performed on the seven-domain rule meta-model includes type safety verification and business constraint verification. Type safety verification includes constructing an inter-domain dependency graph, verifying the legality of field references, type compatibility, operator input and output types, topological sorting, dangling references, and circular dependencies; The type safety mechanism is a technical verification component of the compilation verification process. It ensures the consistency of data types passed between the seven fields, preventing runtime errors in field references or operator parameters from being discovered. Specifically, it includes: the fact field first generating a field symbol table to record field paths, field types, source systems, and nullability; when the condition field references a fact field, checking if the operator matches the field type; when the computed field references a condition field output or a fact field numeric field, checking if the operator signature and input type match; and further incorporating the control, accounting, versioning, and auditing fields into the dependency graph to check for undeclared inputs, dangling references, circular dependencies, duplicate output symbols, and missing required fields.

[0037] The type safety mechanism during the compilation phase includes four steps: First, the fact domain is scanned to generate a SymbolTable, where each symbol entry contains the field path, Java / SQL / Protobuf type (Java type, Structured Query Language type, and Protocol Buffer type), source system, enumeration value range, and value range. Second, the condition domain expression is parsed, resolving each field reference to a SymbolRef and checking if the operator supports the field type. For example, the Date field only allows date attributes, ranges, and equality operations, while the Decimal field allows comparison and tiering operations. Third, the operator signature in the computation domain is parsed, verifying that the input parameter type matches the condition domain output type. For example, the TierRatioOperator can only accept RangeHit. <decimal>(Decimal value range hit result), FixedPointOperator (fixed integral operator) does not allow receiving DateHit (date hit result); the fourth step is to continue to incorporate the inputs and outputs of the control domain, accounting domain, version domain and audit domain into the dependency graph, and check for dangling references, circular dependencies, duplicate output symbols and missing required inputs.

[0038] The dependency graph construction algorithm uses "domain.symbol" as nodes and directed edges from output_symbol to input_ref, i.e., from upstream domain output symbols to downstream domain input references. The compiler first registers nodes in the order of fact domain, condition domain, computation domain, control domain, accounting domain, versioning domain, and audit domain. Then, it establishes directed edges for each input_ref and performs topological sorting. If topological sorting fails, it returns CYCLE_DEPENDENCY (circular dependency error). If input_ref does not exist in the symbol table, it returns DANGLING_REFERENCE (dangling reference error). If the source node field_type does not match the target node expected_type and type_cast_policy does not allow conversion, it returns TYPE_MISMATCH (type mismatch error). The error return structure includes at least the following: rule_id, snapshot_candidate_id, domain_type, field_path, input_ref, expected_type, actual_type, reference_chain, and error_code.

[0039] Business constraint validation includes verifying interval mutual exclusion, gear continuity, capping dimension validity, frequency window validity, exclusive group integrity, priority conflict, budget impact, and constructing a condition space coverage matrix to discover overlapping rules. Overlapping rules are discovered by constructing the condition space coverage matrix, while other business constraint validations are implemented by dedicated checkers for intervals, gears, capping, frequency, exclusive groups, priorities, and budgets.

[0040] Business constraint validation refers to verifying the business restrictions in rules that affect the distribution of points, cost control, and handling of conflicts between multiple rules before the rules are published. It differs from type safety validation, which focuses on whether fields and operators can be correctly executed by machines; business constraint validation focuses on whether the execution results of the rules meet business control requirements.

[0041] The business constraint verification includes at least the following: whether the validity period of the rules and the validity period of the points are reasonable; whether the amount range, customer level range, and tier range are continuous or mutually exclusive; whether the rule conditions of the same points type, institution, fact type, and validity period overlap; whether the exclusive groups are missing; whether the priorities conflict; whether the capping dimension is complete; whether the frequency window is effective; whether the activity budget is exceeded; and whether the accounting method matches the audit strategy. Through business constraint verification, problems such as duplicate points allocation, missing capping, missing mutually exclusive rule relationships, and budget overruns can be detected before the rules are released.

[0042] Before approval, the rules undergo compilation verification. Compilation verification includes at least the following: field validity verification, calculation formula validity verification, tier range continuity or mutual exclusion verification, rule validity period and points validity period verification, capped dimension integrity verification, priority conflict verification, exclusive group conflict verification, budget impact verification, and dependent data source availability verification. After successful verification, a MerkleRoot rule snapshot hash value is generated. Approver approves the rule snapshot, not temporary page fields, thus preventing post-approval field tampering or discrepancies between the implementation and approval criteria.

[0043] When two rules overlap within the same points type, the same institution, the same customer scope, the same fact type, and the same validity period, the publishing module requires the configuration of an exclusive group, priority, or overlay strategy; otherwise, publishing is not permitted. This mechanism ensures that rule conflicts are discovered before deployment, rather than through manual reconciliation after points are distributed.

[0044] The "overlapping rules" are determined using a formal condition space approach, rather than simply comparing rule names or manual notations. The compiler first expands the condition domain of each rule into a CoverageMatrix, whose dimensions include at least the following: point type, institution, fact type, customer level, card type, merchant / supplier, amount range, date attribute, business validity period, frequency window, and capping dimension. Each dimension is normalized into a computable constraint object: the enumerated set is represented as a finite set, amount and time are represented as closed or half-open intervals, blacklists and whitelists are represented as set differences, and wildcard conditions are represented as the entire set.

[0045] The algorithm for determining rule overlap is as follows: Rules of the same integral type, institution, and fact type are compared pairwise, and the intersection of constraints in each dimension of the two rules is calculated. If the intersection of any dimension is empty, then the two rules do not have a scenario where they both hit. If the intersection of all dimensions is not empty, the intersection result forms a non-empty hyperrectangular region in the multidimensional condition space, and the system determines that the two rules overlap. For enumerated dimensions, set intersection is used; for interval dimensions, max(lower1, lower2) <= min(upper1, upper2) is used for judgment, where max(lower1, lower2) represents the larger of the two lower bounds, and min(upper1, upper2) represents the smaller of the two upper bounds. For exclusion conditions, the intersection of the set after subtracting the entire set is calculated. This detection uses pairwise comparisons when the number of rules is n, with a time complexity of O(n^2). 2 The number of dimensions compared each time is a fixed configuration item.

[0046] Upon detecting a non-empty intersection, the compiler continues to determine whether the conflict has been resolved by the control domain. If two rules are configured with the same exclusive_group but have different priorities, a WARNING-level conflict description is generated and approval is allowed. If stackable_flag=true and the accounting domain allows stacking, the stacking strategy is recorded and compilation continues. If result_policy=MAX / MIN is configured, the higher or lower strategy is recorded. If no exclusive group, priority, stacking flag, or result comparison strategy is configured, ERROR_CONFLICT_UNRESOLVED is returned, with error messages including rule_id_pair, overlap_dimensions, overlap_sample, missing_strategy, and suggested_actions.

[0047] Conflict error messages are returned to the operations configuration page in an interpretable structure. For example, `overlap_sample` can provide a sample hit scenario: "Points type = CARD_POINT, Institution = 001, Customer level = VIP, Card type = Platinum card, Transaction amount = [500, 1000], Date = Weekend, Validity period = [2026-06-01, 2026-06-30]". `suggested_actions` includes "Setting up the same exclusive group and configuring different priorities", "Setting up allowable stacking and specifying the account consolidation method", "Setting a high / low strategy", and "Narrowing the scope of customers or card types for one of the rules". Therefore, the system does not simply indicate a conflict, but returns a locatable and correctable intersection dimension and strategy gap.

[0048] To reduce O(n) 2 (Quadratic complexity, meaning the number of pairwise comparison rules increases quadratically with the number of rules) To address the cost of comparisons when the number of rules is large, the system first builds candidate indexes by point_type (integration type), org_id (organization code), fact_type (fact type), and validity period buckets, performing coverage matrix intersection calculations only within the same bucket. For the time dimension, interval trees are used to quickly filter out rules with overlapping validity periods. For enumerated dimensions such as customer level, card type, and merchant, bitmap encoding is used to accelerate set intersection operations. These optimizations do not change the decision logic but reduce the number of comparisons between irrelevant rules, allowing pre-release validation to maintain an acceptable response time even as the number of rules increases.

[0049] The snapshot serialization of the seven-domain rule metamodel employs deterministic encoding. The system first sorts the metadata lexicographically by domain_type, field_path, and operator_code, then serializes it into a RuleSnapshotProto (rule snapshot protocol buffer object), which includes nine field groups: fact_domain, condition_domain, calculation_domain, control_domain, ledger_domain, version_domain, audit_domain, binding_graph, and compile_constraints. The binding graph originates from the rule_domain_binding formed during the S2 rule draft parsing stage; the compiler reads this table in S3 and constructs the inter-domain dependency graph. Compilation constraints originate from the rule_compile_constraint written in S2 and the constraint set obtained in S3 based on operator signatures, field types, and business constraint templates. Non-deterministic map output is disabled during serialization to ensure that the same metadata generates the same byte sequence on different machines. Subsequently, SHA-256 (a 256-bit secure hash algorithm) is performed on the proto_bytes (protocol buffer byte stream) to obtain the snapshot_hash (rule snapshot hash), and the snapshot_hash is written to the rule_snapshot (rule snapshot table). When calculations, pending entries, account entries, audit traces, and difference compensations occur, the calc_flow (calculation flow table), pending_ledger (pending entry flow table), account_ledger (account flow table), audit_trace (audit trace table), and compensation_ledger (compensation flow table) record this snapshot_hash respectively, for reverse lookup of the rule snapshot used in that instance. The rule snapshot is a runtime standard format generated from the seven-domain rule meta-model after compilation verification, deterministic serialization, and hash calculation.

[0050] Through the above structure, the technical effect of the seven-domain rule metamodel is no longer the general "condition-action layering," but rather the formation of a compilable, verifiable, addressable, and replayable rule execution unit: errors in fields and operators can be accurately located before deployment; input and output types can be guaranteed to be consistent during runtime; the complete rule context can be restored by snapshot_hash during recalculation; and during auditing, the seven-domain metadata, dependency graph, and compilation constraints used in the current calculation can be traced back from the pipeline. This mechanism transforms rule configuration from a manually understood business description into a technical architecture that can be formally verified by the system.

[0051] like Figure 3 As shown, the aforementioned seven domain metadata are compiled into a rule snapshot when a rule is published. The rule snapshot contains the rule's complete parameters, expressions, external data reference versions, and execution order, and cannot be modified after publication; if business personnel modify the rule, a new version snapshot is generated. Through this design, business configurability no longer depends on hard-coded branches, and rule execution results can be repeatedly replayed and audited.

[0052] Specifically, a rule snapshot includes "rule snapshot content" and "rule effective index." The rule snapshot content itself stores complete seven-domain metadata, expressions, operator parameters, external data reference versions, execution order, and snapshot hash. The rule effective index is used to quickly recall snapshots at runtime, and its index fields include at least the points type, organization code, fact type code, business effective time range, system release time, rule status, and snapshot hash. At runtime, instead of directly scanning the snapshot content, it first queries the rule effective index based on the points type, organization code, fact type code, and business time in the normalized facts to obtain candidate snapshot hashes, and then loads the corresponding complete rule snapshot according to the snapshot hash.

[0053] The compilation snapshot and approval binding are implemented using a Merkle tree structure. The system uses the seven-domain metadata, inter-domain binding graph, compilation constraints, coverage matrix, conflict detection results, effective time range, and the data source version that the rule depends on as leaf nodes. First, SHA-256 is performed on each leaf node, then they are merged layer by layer in a fixed order to generate a MerkleRoot (Merkle root hash), which serves as the snapshot_hash (rule snapshot hash). The approval object in the approval flow `approval_order` stores this MerkleRoot (Merkle root hash), rather than storing variable page fields. After approval, the `rule_version` (rule version table) records `rule_id` (rule number), `version_no` (version number), `snapshot_hash` (rule snapshot hash), `approved_by` (approver), `approved_time` (approval time), and `business_valid_range` (business effective time range).

[0054] The immutable binding after approval is achieved through anti-tampering logs: the ApprovalCommitted event writes the snapshot_hash (rule snapshot hash), approver, approval time, approval conclusion, and the previous log hash (prev_log_hash) to the append-only audit_commit_log, and generates current_log_hash = SHA-256(prev_log_hash + approval_payload). If any rule field, effective time, or conflict policy is modified after approval, the recompiled MerkleRoot will inevitably change, and the system requires a re-initiation of the approval process. At runtime, only snapshots with an approval status of APPROVED and whose snapshot_hash matches the rule_effective_index are loaded, thus achieving an immutable binding between the substantive approval and the rule fields, conflict policies, and scope of effectiveness.

[0055] S4: Submit the rule snapshot for approval. After approval, publish the rule snapshot according to the dual timeline mechanism and generate the rule effective index simultaneously. At runtime, recall candidate rule snapshots based on the rule effective index. The dual timeline mechanism includes selecting the applicable rule snapshot according to the business time and restoring the historical rule snapshot according to the system time. Furthermore, the dual-timeline mechanism includes: The rule snapshot simultaneously records the business activation time and the system release time; At runtime, the rule snapshot that should be applied to the business is selected from the rule effective index based on the business time carried by the factual data; During auditing or recalculation, the system restores a snapshot of the rules actually published and used at the historical moment from the rule effective index based on the system time.

[0056] S4 specifically includes: the approval object of the approval order `approval_order` is `snapshot_hash` (rule snapshot hash), instead of a variable page field; after approval, the system writes `rule_id` (rule number), `version_no` (version number), `snapshot_hash` (rule snapshot hash), `point_type` (point type), `org_id` (organization code), `fact_type` (fact type code), `approved_by` (approver), `approved_time` (approval time), `business_valid_range` (business effective time range), `system_publish_time` (system release time), and `status` (rule status) to `rule_version` (rule version table) and `rule_effective_index` (rule effective index table); at runtime, the rule snapshot applicable to the business is selected according to the actual business time; during auditing or recalculation, the rule snapshot actually released and used by the system at that time can be restored according to the system time.

[0057] like Figure 4 As shown, this demonstrates the end-to-end chain of this method from configuration, compilation, running, accounting to recalculation and auditing, as well as the way that each step is associated with a unified key-value pair.

[0058] like Figure 5 As shown, the processing steps for rule drafting, seven-domain validation, snapshot freezing, approval and release, and rule index refresh are demonstrated in S2 to S4.

[0059] All new, modified, activated, and deactivated points rules require an approval process. Taking a branch initiation as an example, the approval process involves the branch operator submitting the rule, the branch manager approving it, the head office operator approving it, and the head office manager giving final approval. During the approval process, the rule status includes pending submission, under review, returned, pending activation, activated, and deactivated. Rules that have been approved but have not yet reached their effective date are in the pending activation state; once the effective date arrives, the rule publishing module switches them to the activated state.

[0060] When an enabled rule is modified, the system generates a new rule version while retaining the old version for continued calculation until the new version reaches its effective date. The rule engine selects the corresponding version based on the actual data occurrence date and the rule version's effective period. Therefore, before the rule's modification, deactivation, or activation effective date, the system still completes calculations using the old rule parameters. This mechanism ensures that the applicable rules at the time can be restored when historical data is recalculated.

[0061] The rule version selection employs a "dual timeline" mechanism: the business timeline represents the time when events such as transactions, actions, and asset enhancements occur; the system timeline represents the time when a rule is approved, released, recalculated, or revised. During normal calculations, the rule engine selects a snapshot of the rules that was valid at the time the event occurred, based on the business timeline; during auditing and tracing, it can reconstruct the snapshot of the rules actually used by the system at that time, based on the system timeline. This mechanism can distinguish between "rules that should have been applicable in the business context at that time" and "rules that had already been released by the system at that time," thereby supporting the accurate processing of supplementary data, late data, and historically corrected rules. A diagram illustrating the dual timeline rule version and approval / release mechanism is shown below. Figure 6 As shown.

[0062] S5: Receive business fact data, standardize the business fact data into unified standard facts, and recall effective candidate rule snapshots based on points type, organization, and fact type; S5 specifically includes: FactIngestAPI (fact access interface) receives business facts such as card transactions, contract signing behavior, asset enhancement, birthday lists, and loan disbursements, standardizes them into CanonicalFact (normalized fact data structure), and generates fact_key (fact idempotent key); RuleRuntimeService (rule runtime service) retrieves candidate RuleSnapshots from rule_effective_index (rule effective index table) or Redis (remote dictionary service cache) rule index based on point_type (point type), org_id (organization code), fact_type (fact type), and business_time (business occurrence time); the retrieved results only include approved, effective snapshots that match the fact type, avoiding reading unapproved drafts at runtime.

[0063] S6: Perform condition matching on each recalled candidate rule snapshot, and perform integral calculation according to the operator graph defined in the computational domain after the condition matching is successful, generating at least one candidate integral result; S6 specifically includes: ConditionEvaluator, which reads the condition domain and matches customer range, customer level, card type, merchant, amount range, date attribute, and frequency-related dimensions item by item, and outputs MatchSet and reasons for no match; OperatorExecutor, which executes operators such as fixed value, ratio, tier ratio, multiplier, rounding, taking the higher value, superposition, or deduction according to the operator graph of the calculation domain, and generates CandidatePoint; CandidatePoint includes at least rule_id, branch_id, snapshot_hash, raw_point, calculated_point, condition_vector, and operator_trace.

[0064] Figure 7 The sequence of fact standardization, rule coarse screening, condition fine screening, operator execution, and calculation flow into the database is shown in S5 to S6.

[0065] S7: Perform deterministic conflict arbitration on multiple candidate integration results and output the final integration result; Furthermore, the determination of conflict arbitration over multiple candidate integration results includes: An applicability range accuracy index is introduced. The applicability range accuracy is calculated based on the weights of the equality constraint, enumeration constraint, interval constraint, and time window constraint of the condition domain. The equality constraint has the highest weight, and the smaller the interval span, the higher the score. Arbitration is performed in a hierarchical order of exclusive group rules, priority descending order, scope of application and accuracy descending order, comparison of calculation results, superposition rules and stable fallback rules, forming a tree-like elimination path; Output arbitration details, which include the score, reason for elimination, and final winning rule for each candidate rule.

[0066] S7 specifically includes: ArbitrationService executes GroupStage, PriorityStage, ScopeScoreStage, ResultCompareStage, StackStage, and StableTieBreakStage sequentially on the CandidatePoint list under the same fact_key; where scopeScore is calculated by normalizing equality constraints, enumeration set convergence, interval span, time window, and exclusion condition penalty term; each level outputs kept, dropped, reason_code, and explanation, and writes the arbitration path into audit_arbitration_detail.

[0067] Multi-rule conflict arbitration mechanism such as Figure 8 As shown: When the same factual data hits multiple rules or multiple condition branches within the same rule, the conflict arbitration module determines the final score in the following order: exclusive group, priority, scope of application precision, calculation result comparison, and overlay flag. The exclusive group declares that rules within the same group cannot be effective simultaneously; priority handles concurrent hit conditions such as birthdays, weekends, and special periods; scope of application precision prioritizes the more precise rule when both general rules and card-specific rules are hit simultaneously; calculation result comparison determines whether the highest or lowest value is taken; and the overlay flag declares whether base scores and extra scores can be accumulated.

[0068] The accuracy of the applicable scope is not a manually described value, but is calculated from the tightness of the condition domain constraints. The system statistically analyzes equality constraints, enumeration set constraints, interval constraints, and exclusion constraints for each candidate rule: equality constraints have a higher weight than enumeration set constraints; the fewer the possible values ​​in the enumeration set, the higher the score; interval constraints are normalized according to the global value range of the field; the smaller the interval span, the higher the score; exclusion constraints are only used as a deduction to avoid broad exclusion conditions being misjudged as precise. After weighting each score, an accuracy score between 0 and 1 is generated. When the exclusion groups and priorities are the same and cannot be stacked, the rule with the higher accuracy score wins.

[0069] The conflict arbitration details are stored in JSON format along with the interpretation chain, recording the ruleId, snapshotHash, exclusiveGroup, priority, scopeScore, calculatedPoint, stackableFlag, decision, and reasonCode for each participating rule. The arbitration process forms a hierarchical tree-like elimination path: the first level records the exclusive group filtering results, the second level records the priority comparison results, the third level records the accuracy score comparison results, and subsequent levels record the results of taking higher / lower scores or combining scores. Operations personnel can use this to reconstruct the specific reasons for each rule's victory or defeat.

[0070] The conflict arbitration module employs a hierarchical stable sorting algorithm, with each level having clearly defined inputs, outputs, and elimination reasons. The input is a list of CandidatePoints (candidate score results) under the same fact_key (idempotent fact key). Each candidate contains rule_id (rule number), snapshot_hash (rule snapshot hash), exclusive_group (exclusive group), priority (priority), condition_vector (condition hit vector), scope_score (scope score), calculated_point (calculated score), stackable_flag (stackable flag), result_policy (result processing policy), and ledger_policy (ledger policy). The arbitrator executes the following stages in a fixed order: GroupStage (exclusive group processing stage), PriorityStage (priority processing stage), ScopeScoreStage (scope scoring stage), ResultCompareStage (result comparison stage), StackStage (overlay processing stage), and StableTieBreakStage (stable decision stage). Each stage outputs `remaining_candidates`, `dropped_candidates`, and `reason_code`. Subsequent stages only process the candidate set retained from the previous stage. The decision logic for the GroupStage is as follows: if a candidate rule's `exclusive_group` is empty, it is considered to be able to coexist with other non-exclusive rules; if multiple candidate rules have the same `exclusive_group`, they enter into competition within the same group and direct overlay is not allowed; if candidate rules from different `exclusive_groups` simultaneously hit, cross-group overlay is determined based on the accounting domain `stack_scope`. If a candidate in the same group is missing any of the necessary arbitration fields, namely priority, scope_score, or result_policy, then ARB_MISSING_STRATEGY (arbitration policy missing error) will be returned, preventing the release or runtime from returning to a pending review status.

[0071] The PriorityStage (priority processing stage) does not simply select based on page order. Instead, it normalizes the priority to an integer range [0, 1000] and requires that priorities within the same exclusive group be comparable. The system first uses `max(priority)` as the retention criterion; candidates with priorities lower than this value are eliminated and their reasons are recorded as `reason_code = LOWER_PRIORITY`. If multiple candidates have the highest priority, the comparison continues at the applicable range precision level. To avoid implicit order affecting the results, the system prohibits using the database return order as the priority.

[0072] The ScopeScoreStage (scope scoring stage) is calculated using the condition domain constraint tightness formula: scopeScore=normalize(ΣequalityWeight+ΣenumWeight+ΣrangeWeight+ΣtimeWindowWeight-ΣexclusionPenalty) The components include scopeScore (applicable scope score), normalize (normalization function), equalityWeight (equality constraint weight), enumWeight (enumeration constraint weight), rangeWeight (range constraint weight), timeWindowWeight (time window weight), and exclusionPenalty (exclusion penalty). The equation constraint `equalityWeight` is 1.0; the enumeration constraint `enumWeight` is 0.8 × (1 - |allowedSet| / |universeSet|), where `allowedSet` is the set of allowed values ​​and `universeSet` is the set of the entire universe. A smaller allowed set results in a higher score. The interval constraint `rangeWeight` is 0.6 × (1 - (upper - lower) / (globalMax - globalMin)), where `upper` is the upper bound of the interval, `lower` is the lower bound, `globalMax` is the global maximum value, and `globalMin` is the global minimum value. A smaller interval span results in a higher score. The time window constraint `timeWindowWeight` is 0.5 × (1 - windowDays / periodDays), where `windowDays` is the number of days in the window and `periodDays` is the number of days in the period. The exclusion condition `exclusionPenalty` is 0.2 × `excludedSetRatio`, where `excludedSetRatio` is the ratio of the excluded set. Finally, the scores are truncated and normalized to [0,1].

[0073] Accuracy calculations are independently normalized by field dimension to avoid bias caused by different units for amount and date fields. For example, if the global range of transaction amount is [0, 100000], the interval score for rule A with an amount constraint of [500, 1000] is higher than that for rule B with an amount constraint of [0, 100000]. If the customer level universeSet is {Ordinary, Gold, Platinum, Diamond}, the enumeration score for rule A limiting {Diamond} is higher than that for rule B limiting {Gold, Platinum, Diamond}. When priority is the same and cannot be superimposed, the candidate with the highest scopeScore wins; if the difference in scopeScore is less than epsilon=0.0001 (this threshold is based on the machine precision of IEEE 754 double-precision floating-point numbers, approximately 2.22 × 10⁻⁶), the candidate with the highest scopeScore wins. -16 Based on the actual calculation accuracy of scopeScore in the [0,1] interval after normalization, we take 10. -4 As a tolerance threshold for determining whether two scopeScore values ​​can be considered equal, the result comparison layer is then entered to avoid unstable arbitration caused by floating-point errors.

[0074] The ResultCompareStage, the result comparison layer, executes according to the result_policy control domain. If result_policy=MAX (maximum value), the candidate with the largest calculated_point is retained; if result_policy=MIN (minimum value), the candidate with the smallest calculated_point is retained; if result_policy=SUM (summation) and stackable_flag=true (stackable flag is true), the candidate integrals are merged into one or more accounting actions according to the ledger_policy; if result_policy is not configured and multiple candidates still exist, ARB_RESULT_POLICY_REQUIRED (error requiring result processing policy configuration) is returned. For candidates with the same integral value, the system does not directly select randomly but enters the StableTieBreakStage.

[0075] The StableTieBreakStage layer ensures completely consistent results across real-time, batch, recalculation, and prediction entry points. This layer generates a deterministic key in lexicographical order of snapshot_hash, rule_id, and branch_id, and is only used when all the preceding layers are indistinguishable and the rule control domain allows deterministic_tiebreak=true (allowing deterministic tail-break); otherwise, a pending arbitration result is generated.

[0076] The arbitration details JSON is stored in the audit_arbitration_detail table using a fixed schema, and is bound to the calculation flow through calc_id (calculation flow number). The structure includes arbitrationId (arbitration number), factKey (fact idempotency key), calcId (calculation identifier), snapshotHash (rule snapshot hash), inputCandidates (list of input candidate results), stages (list of arbitration stages), winner (winning candidate result), finalPoint (final score result), ledgerMergeResult (ledger merger result), and generatedAt (generation time). The inputCandidates list records the ruleId, branchId, priority, scopeScore, calculatedPoint, exclusiveGroup, and stackableFlag for each candidate. The stages array records stageName, kept, dropped, compareField, compareValue, reasonCode, and explanation layer by layer.

[0077] The tree-like elimination path is generated by the `stages` array. For example, the first-level node records "4 candidates in the CARD_PROMO exclusive group entered the competition", the second-level node records "rules with priority=20 and 70 are eliminated due to LOWER_PRIORITY", the third-level node records "two rules with priority=90 are compared in scopeScore, 0.873 wins and 0.711 is eliminated", and the fourth-level node records "finalPoint=620 after result_policy=MAX". When operations personnel or customer service personnel query the interpretation chain by `calc_id` (calculation sequence number), they can directly see which level each rule is at, which field it is eliminated by, and what comparison value it is compared with, instead of only seeing the final hit rule.

[0078] The technical advantage of the arbitration algorithm lies in extending "selection by priority" into a quantifiable, reproducible, and interpretable deterministic decision chain. Priority is only one layer; the scope and accuracy of application are calculated by formulas, the results are compared through control domain policies, the superposition is implemented through accounting domain merging policies, the fallback sorting ensures consistency through stable keys, and the arbitration JSON can prove the decision path of each calculation in reverse. Therefore, this scheme differs from the conventional sorting of common firewalls or routing tables that match sequentially, but is a dedicated arbitration mechanism for multi-dimensional conditions of integral rules, accounting merging, and audit replay.

[0079] like Figure 9 As shown, the arbitration process outputs arbitration details, including the rule number involved in the arbitration, the excluded rule, the reason for exclusion, the final adopted rule, and the final points. This detail is linked to the points transaction history, allowing the system to explain why a single transaction only calculates five times the points on the birthday instead of double points on weekends, and why points for special card types are higher than those for customer tiers.

[0080] S8: Perform frequency deduplication and quota usage concurrency control on the final integral results; S8 specifically includes: frequency deduplication is completed collaboratively by the deduplication service and the frequency service. Quota capping is implemented by the capping service. The DedupService first generates a dedup_key (deduplication key) according to FIRST_BY_FACT (first-time generation strategy), FIRST_BY_PERIOD (periodic generation strategy), or FIRST_BY_COMPOSITE (composite generation strategy), and then uses SET key value NX EX ttl (Redis atomic placeholder command, which means setting only if the key does not exist and includes an expiration time) to place a placeholder, preventing the same fact from entering the window repeatedly; the FrequencyService obtains the window sequence number through a Lua script (Redis script) that encapsulates INCR / DECR (increment / decrement commands), and rolls back and releases the deduplication key within the same script when the limit is exceeded; the CapService generates a cap_key based on dimensions such as customer, rule, card number, merchant, and daily / monthly cycle, and uses a Redis Lua script to complete the reading of the credit limit, calculation of the remaining credit limit, truncation of points, freezing of credit limit, or writing of credit limit to be credited in one go.

[0081] Furthermore, the frequency deduplication includes: Deduplication keys are generated based on deduplication strategies, which include first-time generation strategy, periodic generation strategy, and composite generation strategy. The deduplication bond is placed by atomic occupancy operation. If the occupancy is successful, the integration calculation process continues. If the occupancy fails, it is determined to be a duplicate fact. Generate frequency bonds and count them using an atomic counting script. If the frequency limit is exceeded, backtrack the count and release the deduplicated bonds within the same atomic operation.

[0082] Frequency Window and Deduplication Mechanism: For rules such as "first 5 transactions per day from the same supplier," "once a month for mobile banking login," "first-time contract signing," and "points awarded on the 2nd of each month," the system abstracts frequency requirements into a frequency window. The frequency window consists of object dimensions, event type, statistical period, allowed number of times, and deduplication fields. Before calculation, the rule engine queries processed and pending facts according to the frequency window. Facts exceeding the allowed number of times are no longer awarded points, and the reason for exceeding the frequency limit is recorded.

[0083] First-time rules generate deduplication keys using customer ID, event type, and first-occurrence identifier; periodic rules generate deduplication keys using customer ID, event type, and period number; supplier-restricted rules generate deduplication keys using customer ID, supplier ID, and transaction date. This design avoids writing separate programs for each type of frequency rule and reduces the risk of duplicate score submissions.

[0084] Frequency windows are executed using atomic counting. The system uses a user ID, rule number, window identifier, and time period to form the window key. A Lua script encapsulating Redis INCR / DECR performs atomic checks on the window key, and the INCR return value is used as the sequence number of the current event within the window. If the return value is less than or equal to the window limit, scoring is allowed; if the return value is greater than the limit, the same Lua script executes DECR to roll back and release the deduplication placeholder, while simultaneously recording the overclocking reason code. When the window key is first created, an expiration time consistent with the statistical period is set, causing windows for days, months, and calendar years to scroll automatically.

[0085] The deduplication key supports three strategies: initial generation, periodic generation, and composite generation. Initial generation uses the transaction serial number or behavior serial number as the deduplication key to ensure that repeated submissions of the same fact do not result in duplicate scoring. Periodic generation uses the user ID, event type, and period identifier as the deduplication key, suitable for scenarios such as only the first score is awarded upon login within the same calendar month. Composite generation uses a combination of user ID, merchant ID, date, card number, or rule number as the deduplication key, suitable for scenarios such as the first few transactions of the same merchant each day. This design avoids writing separate programs for each type of frequency rule and reduces the risk of duplicate scoring. The deduplication key is bound to the calculation flow and snapshot hash for storage. During recalculation or compensation, the historical records are first associated with the deduplication key to avoid duplicate distribution during the compensation phase.

[0086] The frequency window module employs a concurrency control sequence of "idempotency first, then counting, then calculation." The system first generates a `dedup_key` according to the configured rules and attempts to place a request using the Redis command `SET dedup_key calc_request_id NX EX ttl`. If `SETNX` fails, it indicates that the same fact or event within the same period has already been processed or is in the process of being processed. The system then directly queries the historical `calc_flow` using the `dedup_key` or returns `DUPLICATE_IN_PROGRESS`, without performing frequency counting. Only requests that successfully place duplicate requests enter the `INCR` counting stage, preventing the same fact from repeatedly consuming frequency window counts from the source.

[0087] The format of the frequency key freq_key is: FREQ:{rule_id}:{object_id}:{event_type}:{period_id}:{scope_hash}, where object_id can be customer number, card number, primary card number, merchant number, or a combination of customer and merchant; period_id is generated based on calendar day, calendar month, activity period, or rolling window; and scope_hash is calculated from the dimensions affecting frequency in the conditional field. When a frequency key is first created, an expiration time is set via EXPIRE. The expiration time equals the window end time plus the late data tolerance period, preventing duplicate score submissions due to premature window deletion.

[0088] Atomic counting uses the return value of RedisINCR within the Lua script as the unique sequence number of the current transaction within the window. If count <= limit, the system allows continued calculation and writes count to calc_flow.freq_sequence; if count > limit, the script immediately executes DECR to roll back the count, deletes the dedup_key that was just placed in place for this request, and returns FREQ_LIMIT_EXCEEDED along with the current window limit, the actual sequence number, and the window end time. Because INCR is executed serially in Redis's single-threaded model, the 5th and 6th concurrent transactions from the same user will not simultaneously read "4 transactions processed"; the 5th transaction will return 5, and the 6th transaction will return 6 and be rejected.

[0089] To prevent count leakage caused by DECR rollback failure, the system encapsulates the overclock rollback into a Lua script called freqCheckAndRollback. Internally, the script executes INCR, checks if the return value exceeds the limit; if it does, it performs DECR within the same script, deletes the dedup_key, and returns reject; if it does not exceed the limit, it retains the count and returns allow. This script combines "increment, check, rollback, and deduplication key release" into a single atomic operation, preventing network interruptions from causing INCR to succeed but DECR to fail.

[0090] The deduplication key generation strategy is declared as `dedup_strategy` in the rule metadata. The first-time generation strategy `FIRST_BY_FACT` uses the transaction serial number, behavior serial number, or external event number as the `dedup_key`, suitable for duplicate transaction submissions, interface retries, and duplicate message deliveries. The periodic generation strategy `FIRST_BY_PERIOD` uses the user ID, event type, and `period_id` as the `dedup_key`, suitable for the first points awarded upon login each month or the first points awarded during the birthday month. The composite generation strategy `FIRST_BY_COMPOSITE` uses a hash of fields such as user ID, merchant ID, card number, date, and rule number, suitable for the first few transactions of the same merchant each day or the periodic restrictions of the same customer and the same card type.

[0091] The deduplication key and calculation pipeline are bidirectionally bound. In Redis, the value of `dedup_key` stores either `calc_request_id` or `calc_id`, while the database `calc_flow` stores `dedup_key`, `freq_key`, `freq_sequence`, `dedup_strategy`, `snapshot_hash`, and `fact_key`. When a request arrives repeatedly, the system first finds the `calc_id` using `dedup_key`, then returns the original calculation result or the original rejection reason. During historical recalculation, `RecalcDiffJob` searches the historical `calc_flow` using `fact_key` and `dedup_key`, only compensating for the difference for the same `dedup_key`, without generating new frequency counts or new score submission qualifications.

[0092] For frequency usage in the "under review" or "pending payment" stages, the system categorizes the calc_flow status into FREQ_RESERVED, LEDGER_PENDING, COMMITTED, REJECTED, and ROLLBACKED. If subsequent payment fails or approval is rejected, the compensation task executes the freqRelease script based on calc_id: DECR is only executed on freq_key and dedup_key is released when calc_flow is still in FREQ_RESERVED or LEDGER_PENDING and no account transaction has been generated; if payment has already been made or compensation has been received, the frequency is not rolled back to prevent users from repeatedly obtaining window access through approval rejections.

[0093] In scrolling window scenarios, the system doesn't just use a single natural cycle key; instead, it employs an ordered set (ZSET) to record event timestamps. For the rule of "maximum 5 times within any 24-hour period," the script first deletes events outside the window using `ZREMRANGEBYSCORE`, then counts the number of events within the window using `ZCARD`. If the count is less than the limit, it then `ZADD` the current `fact_key` and the event timestamp. If the limit is reached, the script rejects the write operation and doesn't write anything. This logic is also executed atomically via a Lua script to prevent multiple concurrent requests from simultaneously seeing that the window's count is not full.

[0094] Audit details for frequency and deduplication control are written to the `audit_frequency_detail` table. Fields include `dedup_key` (deduplication key), `dedup_strategy` (deduplication strategy), `freq_key` (frequency key), `window_type` (window type), `period_id` (period number), `limit_count` (limit of attempts), `returned_count` (return count / current window count), `decision` (processing decision), `rollback_flag` (rollback flag), `ttl` (remaining time to live), `fact_key` (fact idempotent key), and `calc_id` (calculation sequence number). The interpretation chain can directly display "This is the 6th transaction within the window, the window limit is 5, count rollback has been performed and the deduplication key has been released," or "The same `dedup_key` already exists for `calc_id`, returning historical calculation results," making concurrent rejections and duplicate submissions interpretable.

[0095] The technical advantage of the above scheme lies in transforming frequency limiting and deduplication from ordinary query judgment into atomic and idempotent resource control: SETNX prevents the same fact from entering the window repeatedly, INCR / Lua ensures that the concurrent counting is not biased, DECR / Lua ensures that the over-limit rollback is not leaked, the binding of dedup_key (deduplication key) and calc_flow (calculation flow table) ensures that recalculation compensation is not sent repeatedly, the state machine controls whether to release the window qualification when the accounting fails, and the ZSET script supports the concurrency safety of the scrolling window.

[0096] Furthermore, the concurrency control of the credit limit occupancy is implemented through the credit limit occupancy ledger, including: generating a capping key based on customer dimension, rule dimension, card number dimension, and period dimension; The atomic script completes the entire process of reading the credit limit, calculating the remaining credit limit, truncating points, and writing the frozen credit limit in one go, ensuring the atomicity of querying, truncating, and occupying the credit limit. Points under review are managed in a pre-reserved mode. Points under review are written into the frozen amount field, and a scheduled task is configured to release the frozen amount after the timeout. When an accounting entry fails, the current state is recorded through a compensation state machine, and either the amount is rolled back or the accounting entry is retried.

[0097] Quota-based capping mechanism, such as Figure 10 As shown: The capping strategy does not employ post-event aggregation and truncation, but instead uses a quota occupancy ledger. The system generates a capping key for each capping dimension, which can be formed by combining fields such as customer number, rule number, points type, transaction day, calendar month, card number, primary card number, and supplier number. After the points calculation results are generated, the system first queries the points already credited, pending review, pending crediting, and points already calculated in this batch under the capping key to obtain the remaining quota, and then occupies or truncates the points for this batch. If the points for this batch require review, the quota also enters the "reviewed and occupied" state. The quota is released when the approval is rejected, and becomes officially occupied when the approval is passed.

[0098] The credit limit occupancy ledger ensures the atomicity of querying, truncation, and occupancy through Redis Lua scripts. The script takes the capping key as input and, within a single-threaded Redis execution model, reads the credited amount, pending credited amount, and frozen amount, calculating the remaining amount. If the current credits exceed the remaining amount, the remaining amount is truncated, and the actual available credits, truncated credits, and capping reason code are returned. Subsequently, the occupied amount or frozen amount is updated within the same script to prevent over-occupancy caused by concurrent requests reading the same remaining amount.

[0099] During the review process, points are managed using a pre-reservation model. The credit limit ledger stores three fields: confirmedAmount (confirmed credit limit), pendingAmount (credit limit pending payment), and frozenAmount (frozen credit limit). Calculation results requiring manual review are first written to frozenAmount (frozen credit limit) and a pre-reservation record with an expiration time is generated. Upon approval, the frozen credit limit is converted to credited or pending credit limit. Upon rejection, the frozen credit limit is released. If the review process times out, a scheduled task scans and releases frozen credit limits in batches according to the expireAt (expiration time) of the pre-reservation record to prevent permanent credit limit occupation due to process delays.

[0100] The credit limit ledger adopts a two-layer structure of "Redis (remote dictionary service cache) hot ledger + database cold ledger". In the Redis (remote dictionary service cache), the hash is stored as cap_key, with fields including limit_amount (credit limit), confirmed_amount (confirmed credit limit), pending_amount (credit limit pending), frozen_amount (frozen credit limit), version (version number), and updated_at (update time). The database table cap_ledger stores cap_key (credit limit ledger table), cap_dimension_json (capped dimension JSON data), period_start (period start time), period_end (period end time), limit_amount (credit limit), confirmed_amount (confirmed credit limit), pending_amount (credit limit pending), frozen_amount (frozen credit limit), version (version number), and status (status), which are used for persistence, auditing, and fault recovery. The cap_key is generated according to the cap dimensions template, such as rule number, points type, customer number, card number, primary card number, merchant number, and natural day or natural month, to ensure that the same cap resource falls to the same atomic key under concurrent requests.

[0101] The inputs to the Lua atomic occupancy script (Redis script) include cap_key (capping key), request_point (points to be used in this request), reserve_id (reserve ID), ledger_mode (ledger mode), expire_at (expiration time), and now (current time). The script internally executes the following steps: Read limit_amount (limit limit), confirmed_amount (confirmed amount), pending_amount (amount pending payment), and frozen_amount (frozen amount); Calculate used = confirmed_amount + pending_amount + frozen_amount (used amount = confirmed amount + pending amount + frozen amount). remain=limit_amount-used (Remaining credit limit = maximum credit limit - used credit limit); The calculation is: grant = min(request_point, max(remain, 0)). The points that can be issued this time are the smaller of the points used in this request and the non-negative remaining credit limit. cut=request_point-grant(Truncation points = Points used in this request - Points available for grant). If grant=0 (the available points for this issuance are 0), then no reservation is written and CAP_EXHAUSTED (the quota has been exhausted) is returned; if ledger_mode=REVIEW (review mode), then HINCRBYFLOAT frozen_amount grant (increases the frozen quota by the actual granted points) is executed and reserve_id (reservation number) is written to the reserve set; if ledger_mode=DIRECT (direct crediting mode), then HINCRBYFLOAT pending_amount grant (increases the pending crediting quota by the actual granted points).

[0102] The Lua return structure consists of: result_code, grant_point, cut_point, before_used (used credit before allocation), after_used (used credit after allocation), limit_amount, reserve_id, cap_version, and reason_code. The calculation flow (calc_flow) stores grant_point, cut_point, cap_key, reserve_id, and cap_version. If cut_point is greater than zero, the audit chain records CAP_TRUNCATED and the values ​​before and after the truncation. By saving before_used and after_used, the system can prove the immediate state of the credit ledger when a credit point was truncated in the event of a customer complaint or audit.

[0103] Credit limit pre-reservation under review is managed by the `cap_reservation` table, whose fields include `reserve_id` (pre-reservation number), `cap_key` (capping key), `calc_id` (calculation record number), `request_point` (requested points value), `grant_point` (actual granted points value), `frozen_point` (frozen points value), `reserve_status` (pre-reservation status), `expire_at` (expiration time), `approved_at` (approval time), `released_at` (release time), and `release_reason` (release reason). `reserve_status` includes at least `FROZEN` (frozen), `CONFIRMED` (confirmed), `RELEASED` (released), `EXPIRED` (expired), and `COMPENSATING` (compensation processing). When approval is granted, the confirmReservationLua script is executed. In the same atomic operation, frozen_amount is reduced by grant_points, while confirmed_amount or pending_amount is increased by grant_points. When approval is rejected, the releaseReservationLua script is executed, which only reduces frozen_amount and sets the reservation status to RELEASED.

[0104] The pre-reserved timeout release is executed by ReserveReleaseJob. The task scans the `cap_reservation` for records whose `status=FROZEN` has expired, grouped by `cap_key`, and calls the `releaseReservationLua` script in batches. The script first checks if the `reserve_id` is still in the frozen set to prevent duplicate releases due to concurrent approval and timeout releases. Upon successful release, `release_reason=TIMEOUT` is written; otherwise, `RETRYABLE_RELEASE_ERROR` is recorded and the file is added to the delayed retry queue. This mechanism prevents the approval process from freezing permanently due to a deadlock.

[0105] To handle accounting write failures, the credit limit module employs a compensation state machine. During the calculation phase, after successful Lua access, the calculated transaction log enters CAP_RESERVED; after successful posting or account transaction log writing, it enters LEDGER_COMMITTED; if the database write fails, the approval service times out, or the account core returns a failure, the compensation task executes the releaseReservation or rollbackPending script based on reserve_id, releasing frozen_amount or pending_amount, and marking calc_flow as CAP_RELEASED_AFTER_FAILURE. The compensation script is idempotent; during repeated execution, reserve_status is used to determine if the data has been released.

[0106] To ensure consistency between the Redis and database ledgers, the system employs asynchronous database write-to-database and version verification. Each time Lua updates the credit limit, it increments `cap_version` and writes the occupancy event to the Redis Stream `cap_ledger_event`. The database consumer writes the data to the database `cap_ledger_event_log` in the order of `cap_key` (capacity key) and `cap_version` (credit limit ledger version number). If a version number jump or consumer restart is detected, the Redis (remote dictionary service cache) hot ledger is restored by replaying the data in `cap_ledger_event_log` and `cap_reservation` (credit limit pre-reservation table). If a Redis (remote dictionary service cache) failure causes uncertainty in script execution results, the system queries the idempotent record based on `reserve_id` (pre-reservation number). If the record already exists, the original `grant_point` (actual granted credit value) is returned, preventing duplicate occupancy.

[0107] For scenarios where primary and supplementary card pooling, daily capping, and monthly capping coexist, the system supports cascading allocation of multiple capping keys. Lua scripts lock and allocate multiple `cap_key`s in a fixed order, such as a single-transaction capping key, a customer's daily capping key, and a customer's monthly capping key. The available points for the current transaction are calculated by taking the minimum remaining amount across all keys, and the same `reserve_id` is written to each key in the same script to detail the allocation. If any key's limit is insufficient, resulting in truncation, the system returns the `cap_key` that triggered the capping first and the before / after states of all participating keys. This design avoids over-issuance caused by separate checks for multiple capping levels under concurrent conditions.

[0108] The technical advantage of the above solution lies in transforming the capped amount from a post-event statistical value into a concurrently controllable atomic resource: Lua scripts eliminate read-condition-write race conditions, freezing the amount resolves the issue of points being used during the review process, pre-occupied timeout release prevents amount leakage, a compensation state machine handles accounting failures, version event streams ensure that Redis and the database can recover and maintain consistency, and cascading multiple capped keys ensure that composite caps such as daily caps, monthly caps, and primary / supplementary card aggregation are executed under the same concurrency control framework. This mechanism can simultaneously solve the problem of exceeding the cap caused by concurrent real-time transactions, batch tasks, and review and crediting. For example, if a customer's monthly cap is 100,000 points, 60,000 points have been credited through real-time transactions, 30,000 points are under review, and a batch recalculation request calculates another 20,000 points, the system will only allow the use of 10,000 points in this instance and record a 10,000-point truncation to prevent exceeding the monthly cap after approval.

[0109] S9: Generate a three-tiered accounting flow based on the accounting strategy, including calculated flow, pending flow, and account flow. The three-tiered accounting flow are associated through the same calculation identifier. S9 specifically includes: The system first writes calc_flow (calculation identifier), saves fact_key, snapshot_hash, candidate points, arbitration result, capping cutoff, frequency sequence number, dedup_key, cap_key, and final points; if the rules require review or delayed crediting, it writes to pending_ledger and associates reserve_id or pending review status; if the rules allow direct crediting or approval, it writes to account_ledger, generating positive, negative, or reverse flow statements, which truly affect the customer's available points balance.

[0110] Furthermore, the generation of the three-tiered accounting records includes: First, write the computational pipeline to record the integration calculation process and results; According to the rules and accounting policies, when the accounting policy is real-time accounting, the points are directly written into the account transaction record. When the accounting policy is audited accounting, the points are first written into the pending accounting record, and then written into the account transaction record after the audit is approved. Calculated transaction records, pending transaction records, and account transaction records are linked through the same calculation identifier, allowing you to trace the corresponding calculation process and audit status from any record in the account transaction records.

[0111] Specifically, real-time crediting rules directly write the calculation results to the customer's points account after passing the cap verification; approved crediting rules first write the results to the points details to be reviewed, and then push them to authorized users for approval according to the approval workflow configured in the rules. Crediting only occurs after approval, and the reason for rejection and calculation details are retained when the approval is rejected. Points validity period policies support N days, N months, N years, the end of the calendar year, and a specified expiration date after points are acquired. The rule engine calculates the expiration date according to the corresponding policy when the results are generated.

[0112] The accounting domain adopts a three-tier structure: "Calculated Transaction History, Pending Transaction History, and Account Transaction History." Calculated transaction history stores rule hits and calculation results; pending transaction history stores results requiring approval or awaiting payment; and account transaction history stores the final lending / borrowing direction affecting customer points balances. These three layers of transaction history are linked by the same idempotent key, supporting both approved payments and the identification of the original calculation basis for returns, reversals, cross-year invalidations, and recalculation deductions.

[0113] The validity period of points is not a static field, but rather the result generated by the validity period operator. The validity period operator supports generating expiration dates by the acquisition date offset, by the end of the calendar year, by a specified date, by the end date of the rule cycle, and by the expiration batch spanning multiple years. For value points that expire across multiple years, the system can declare the expiration date and deduction date in the rules, automatically generate the pending expiration transaction record, and form the account deduction transaction record on the deduction date.

[0114] Furthermore, it also includes a difference compensation step: Using facts as the dimension, the new rule snapshot is used to re-execute the points calculation pipeline on historical fact data. The points calculation pipeline is a complete processing flow of candidate rule recall, condition matching, points calculation, conflict arbitration, frequency deduplication, quota occupancy, account transaction generation and interpretation chain record. The new calculation results are compared with the historical calculation results according to the three-state model: no processing is done when the comparison result is unchanged, a positive reissue record is generated when the comparison result is under-issued, and a negative deduction record is generated when the comparison result is over-issued. In the case of multiple issuances, the points consumption binding relationship is queried along the calculation identifier traceability chain. The points are deducted from the original incorrectly issued points using the source points apportionment method. Any shortfall is generated as a record to be recycled and associated with a customer service work order.

[0115] like Figure 11 As shown, points prediction is used to estimate points budgets when the upstream system provides basic data but it has not yet been officially credited. The rules engine reuses the official rule version and calculation process in prediction mode, but writes the output results to the prediction details table, without affecting customer points accounts. Points recalculation is used to handle scenarios where upstream basic data is incorrect or rule data needs to be supplemented. The system generates an idempotent key using the customer number, a unique key for factual data, the rule number, the rule version number, and the calculation batch number. During recalculation, the system compares historical calculation results with the new calculation results. For data where points were not sent, the system generates a supplementary payment result; for data where points were sent but under-sent, only a difference supplementary payment result is generated; for data where points were sent but over-sent, a deduction result can be generated or the data can be submitted for manual review. This method eliminates the need to clear all historical data and rerun the process, reducing recalculation costs and minimizing account disruption.

[0116] A shadow ledger is used because it shares the same data structure, rule version selection, conflict arbitration, and capping calculation method as the official account ledger. However, its accounting results are marked as predicted batches and do not affect the actual customer balance. Approving personnel can view the total expected disbursement amount, distribution by institution, distribution by customer level, capped amount, number of hit customers, and budget peak before the rules take effect, thereby assessing activity costs.

[0117] The system employs a difference algorithm based on "fact idempotent keys + rule snapshot hashes + accounting direction". During the initial calculation, the system saves the original facts, rule snapshot hashes, original points, truncated points, and accounting status. Upon recalculation, the new points are recalculated and compared with the original result. If the original result does not exist, it is reissued; if the new points are greater than the original points, the difference is reissued; if the new points are less than the original points, a deduction is generated; if the original result is under review, the pending difference is updated; if the original result is invalid or has been reversed, it enters manual review. This algorithm limits the impact of recalculation to the difference range, avoiding duplicate cleanup and duplicate accounting.

[0118] The difference recalculation adopts a three-state model. The system compares the historical calculation results with the calculation results under the new rule snapshot, using the business transaction number or fact unique key as the dimension: when the final scores and accounting status of both are the same, it is marked as UNCHANGED, and no accounting action is generated; when the new result is greater than the historical result, it is marked as UNDERPAID, the difference is the new result minus the historical result, and a positive reissue record is generated; when the new result is less than the historical result, it is marked as OVERPAID, the difference is the historical result minus the new result, and a negative deduction or pending recovery record is generated. The compensation record saves the original snapshot hash, the new snapshot hash, the difference status, the difference score, and the processing strategy.

[0119] For OVERPAID status, the system first checks the available balance and spending relationship of the points in the account transaction history. If the points have not yet been spent or redeemed, a negative credit record is directly generated to deduct the corresponding difference; if they have been partially spent, only the unspent balance is deducted, and the remaining difference is generated as a pending redemption record and linked to a customer service ticket or the next credit deduction process; if the original result is under review or pending credit, only the pending review difference is adjusted, without directly affecting the customer's available balance. This strategy avoids the customer's points balance being directly reduced to a negative number due to recalculation and deduction.

[0120] The recalculation process uses `recalc_batch` as the execution boundary. First, the system generates `recalc_batch_id` and stores the following parameters for this recalculation: `fact_scope`, `old_snapshot_hash`, `new_snapshot_hash`, `operator`, `reason_code`, and `dry_run_flag`. Then, it retrieves historical `calc_flow` tables based on the business transaction number and `fact_key`, forming `old_result_set`. Next, it uses the new rule snapshot to perform a complete calculation pipeline on the same batch of `CanonicalFact` data, forming `new_result_set`. The comparison process does not directly modify the account balance; instead, it first writes the results to `recalc_compare_result` for approval or sampling verification.

[0121] The three-state comparison algorithm uses a full outer join with fact_key (idempotent fact key) as the primary key. If both old_result and new_result exist and final_point, ledger_direction, expire_policy, and ledger_status are all consistent, then diff_state = UNCHANGED (the difference is unchanged). If old_result does not exist but new_result does exist, or new_final_point is greater than old_final_point, then diff_state = UND. For UNERPAID (discrepancy status is low), diff_point = new_final_point - old_final_point (discrepancy integral value = new final integral value - old final integral value). If old_result (old calculation result) exists but new_result (new calculation result) does not exist, or old_final_point (old final integral value) is greater than new_final_point (new final integral value), then diff_state = OVERPAID (discrepancy status is high), diff_point = old_final_point - new_final_point (discrepancy integral value = old final integral value - new final integral value). Only UNERPAID (low occurrence) and OVERPAID (high occurrence) are entered into the compensation_ledger.

[0122] The compensation record uses an idempotent primary key: `compensate_key = SHA-256(recalc_batch_id + fact_key + old_snapshot_hash + new_snapshot_hash + diff_state)`. The `compensation_ledger` must include at least `compensate_id`, `compensate_key`, `fact_key`, `origin_calc_id`, `new_calc_id`, `old_point`, `new_point`, `diff_point`, `diff_state`, `process_status`, `ledger_action`, `recovery_status`, and `audit_trace_id`. When the same recalculation batch is executed repeatedly, the system first queries for an existing record using `compensate_key`. If the record exists, the original processing result is returned, and no duplicate recalculation or deduction is performed.

[0123] The handling strategy for the UNDERPAID status is positive difference reimbursement. The system generates a positive account_ledger or pending_ledger associated with the original fact, with ledger_action=COMPENSATE_CREDIT, and the validity period of the points is calculated according to the new rule accounting domain. If the original result is still in the pending review state, only the difference in the pending_ledger is updated, and it is not directly credited. If the reimbursement amount triggers a new cap, the quota occupancy module still needs to be called to perform atomic occupancy according to the cap_key (cap key) of the current recalculation batch to avoid the recalculation reimbursement exceeding the rule cap.

[0124] The handling strategy for the OVERPAID (multiple occurrences) status first executes a consumption binding query. The system queries the point_consumption_binding (points consumption binding table) by origin_calc_id (original calculation identifier) ​​to see if the points have been redeemed, deducted, transferred, or expired, and calculates remaining_origin_point = old_point - consumed_point - expired_point - already recovered_point (original remaining recoverable points = original points value - consumed points - expired points - recovered points). If remaining_origin_point (original remaining recoverable points) is greater than or equal to diff_point (difference points), a negative account_ledger (account transaction record) is generated, with ledger_action = COMPENSATE_DEBIT (accounting action is compensation deduction), directly deducting diff_point (difference points); if remaining_origin_point (original remaining recoverable points) is less than diff_point (difference points), only remaining_origin_point (original remaining recoverable points) is deducted, and the remaining unrecovered_point = diff_point - remaining_origin_point (unrecovered points = difference points - original remaining recoverable points) is written to recovery_receivable (recovery record table).

[0125] The `recovery_receivable` table, containing records to be recovered, includes `recovery_id` (recovery record number), `customer_id` (customer number), `fact_key` (fact idempotent key), `origin_calc_id` (original calculation identifier), `compensate_id` (compensation transaction number), `unrecovered_point` (unrecovered points), `recovery_reason` (recovery reason), `recovery_status` (recovery status), `work_order_id` (work order number), and `next_offset_policy` (subsequent offsetting policy). `recovery_status` includes `PENDING_WORK_ORDER` (work order pending), `CUSTOMER_CONFIRMED` (customer confirmed), `OFFSET_PENDING` (pending offsetting), `OFFSET_DONE` (offset completed), and `WAIVED` (waived). The system does not allow directly deducting a customer's available points to a negative number; instead, it submits the insufficient amount to customer service for work order confirmation or automatically offsets it according to `next_offset_policy` when the customer subsequently earns points.

[0126] For partially consumed OVERPAIDs, the system uses "source points allocation" instead of deducting from the total account balance. Account transactions are recorded as point_lot_id upon posting, and consumption transactions are bound to a specific point_lot_id via point_consumption_binding. During recalculation, deductions are only performed on the point_lot corresponding to the origin_calc_id. This ensures that even if the customer's total account balance is sufficient, points generated from other activities or rules will not be incorrectly deducted, guaranteeing that the compensation action is consistent with the original source of the erroneous payment.

[0127] For transactions whose original results are under review or pending payment, the recalculation does not generate negative transaction records for the account, but instead updates pending_ledger_diff. If UNDERPAID, the pending reimbursement difference is increased; if OVERPAID, the pending review points are decreased or the corresponding frozen amount is released. If the pending review result is being processed by the approval thread simultaneously, the system uses a pending_version optimistic lock to detect conflicts. In case of a conflict, the latest status is reread and the difference is recalculated to avoid duplicate deductions or missed reimbursements due to concurrent approval and recalculation.

[0128] The recalculation batch supports two phases: trial calculation and formal execution. When dry_run_flag=true (trial run flag is true), only recalc_compare_result (recalculation comparison result table) and budget impact summary are generated, and account_ledger (account transaction table) is not written. After approval, the same recalc_batch_id (recalculation batch number) is switched to EXECUTING (in execution), and formal compensation is executed according to compensation_key (compensation idempotency key). After formal execution is completed, recalc_batch_summary (recalculation batch summary table) is written, including unchanged_count (unchanged quantity), underpaid_count (underpaid quantity), overpaid_count (overpaid quantity), credit_total (total amount of credits repaid), debit_total (total amount of credits deducted), receiveable_total (total amount of credits to be recovered), manual_review_count (manual review quantity), and failed_count (failed quantity), for operation approval and audit archiving.

[0129] Anomaly handling employs a recoverable state machine. The `process_status` of the `compensation_ledger` includes `INIT` (initialization), `LEDGER_WRITING` (writing transactions), `LEDGER_DONE` (writing transactions completed), `RECOVERY_CREATED` (recovery records generated), `MANUAL_REVIEW` (manual review), `FAILED_RETRYABLE` (retryable failure), and `FAILED_FINAL` (final failure). When an account core times out or a database write fails, the task checks whether the transaction has been written based on the `compensate_key` (compensation idempotent key) and `ledger_id` (transaction number). If it has, the status is advanced; otherwise, a retry is performed. For cases such as incomplete consumption binding, reversed original transactions, or frozen customer accounts, the process enters `MANUAL_REVIEW` (manual review) and automatic deduction is not performed.

[0130] The audit explanation chain for the recalculation of the difference records old_snapshot_hash (old rule snapshot hash), new_snapshot_hash (new rule snapshot hash), old_calc_trace (old calculation trace), new_calc_trace (new calculation trace), diff_state (difference state), diff_formula (difference calculation formula), ledger_action (accounting action), and recovery_action (recovery action). When customer service inquires, it can display "The original rule calculated 520 points, the new rule calculated 400 points, the difference is 120 points; of which 90 points have been deducted before consumption, and 30 points have been redeemed and a pending recovery work order has been generated," thus explaining the source, amount, and processing path of the overpayment refund.

[0131] The technical advantage of the above scheme lies in transforming recalculation from incremental updates to ordinary databases into an auditable difference algorithm based on factual flow: the three-state model clarifies the source of the difference, compensate_key ensures idempotency, point_lot and consumption_binding ensure that only the original error is rolled back and points are awarded, recovery_receivable avoids negative balances, pending_version handles concurrent auditing, and the two-stage dry-run / formal execution reduces the risk of batch recalculation.

[0132] S10: Generate an interpretation chain record, which contains candidate rule information, reasons for misses, conditional branches, arbitration paths, capped cutoff values, and accounting paths.

[0133] S10 specifically includes: AuditTraceService appends candidate rules, reasons for misses, conditional branches, operator inputs and outputs, arbitration paths, frequency windows, deduplication keys, capping truncation, billing paths, and compensation records to the audit_trace table; customer service, operations, or audit systems can query the explanation chain through GET / points / explain / {calcId} to reconstruct why customers scored, scored less, scored no, or were penalized.

[0134] This solution generates an explanation chain for each points result. The explanation chain includes factual data identifiers, candidate rule sets, hit rule sets, missed rules and reasons, rule version used, hit condition branches, executed calculation operators, conflict arbitration results, points before capping, capped points, final points, validity period, accounting path, and approval status. Operations personnel can use the explanation chain to pinpoint the reasons why customers did not receive points, received fewer points, or had points deducted. Because each result can be replayed, the system significantly reduces the costs of manual investigation, customer complaint handling, and regulatory auditing. Furthermore, since conflicts can be verified before rule release and results can be explained during operation, complex points activities can be launched faster and with less reliance on development personnel.

[0135] This invention uses the fact idempotency key (fact_key), snapshot hash (snapshot_hash), calculation identifier (calc_id), deduplication key (dedup_key), frequency key (freq_key), cap key (cap_key), and audit trace identifier (audit_trace_id) as connecting keys to link rule configuration, compilation and approval, runtime calculation, concurrency control, accounting entries, recalculation compensation, and audit interpretation into an end-to-end processing chain. This method does not simply parameterize the integration rules; instead, it breaks down an integration rule into seven domain metadata fields: fact domain, condition domain, calculation domain, control domain, accounting domain, version domain, and audit domain. These are compiled into an executable rule snapshot when the rule is published. During runtime, the rule engine performs candidate rule filtering, condition matching, calculation execution, conflict arbitration, quota occupancy, validity period generation, accounting path selection, and audit detail recording on the input fact data.

[0136] The following section will explain each step of the entire method in detail, using a bank points processing scenario as an example: Step 1: Configure basic points parameters, rule drafts, and external fact access scope.

[0137] The system first maintains basic parameter tables such as the points type configuration table, points account policy table, and validity period policy table. The points type configuration table determines the points type identifier, affiliated institution code, points-to-currency exchange rate, default validity period, and account subject information. Taking retail banking as an example, points types include, but are not limited to, debit card spending points, credit card spending points, asset enhancement points, contract signing points, birthday benefit points, payroll points, loan disbursement points, and value points. Each points type has a unique type code in the system; different points types can belong to the same institution or different institutions.

[0138] The points account strategy table defines the account structure for each points type, including positive credit accounts, negative credit accounts, and frozen accounts. Positive credit accounts record points actually earned and available to the customer; negative credit accounts record points deducted or reversed; and frozen accounts record points in the review process that have not yet officially taken effect. The validity period strategy table defines the validity period types for points, such as fixed-term validity, calendar year validity, and specified date validity.

[0139] In addition, the system configures the scope of external fact access, that is, it declares which external systems this rules engine can receive what types of fact data from. External systems include core banking systems, credit card systems, customer relationship management systems, wealth management systems, loan systems, etc. The adaptation layer uniformly converts the raw messages from each external system into a standardized format of unified fact specifications, and retains three fields: source system identifier, source event identifier, and collection timestamp. The source system identifier and source event identifier are used together for fact idempotency verification to ensure that the same external event is not processed repeatedly; the collection timestamp is used to determine the arrival time of fact data during audit tracing and anomaly replay.

[0140] Step 2: Receive the operation configuration and generate a seven-domain rule meta-model.

[0141] Operations personnel can visually configure the points activity rules through the rules configuration console. The rules configuration console provides a unified configuration interface where operations personnel can maintain configuration items such as customer scope, card type scope, merchant scope, transaction amount range, date attribute, calculation formula type, capped amount, points scoring frequency, posting method, and audit level. The system saves the operations personnel's page configuration as a rule draft in the background and parses the structured data of the rule draft into a seven-domain rule meta-model. The specific structure is as follows: The fact domain declaration rules can accept the following fact object types. Fact object types are represented by a structured set of fields. For example, a POS transaction fact object includes fields such as transaction amount, transaction time, merchant type, card number, and terminal number; a contract signing behavior fact object includes fields such as contract product code, contract channel, and contract signing time. Each field has a name, data type, and a requirement flag. Once a fact domain declaration is finalized, subsequent domains can only reference the fields declared in the fact domain and cannot define new fact fields.

[0142] The conditional judgment logic of a rule declared in a conditional domain includes four elements: field reference, operators, threshold, and time window. A conditional domain can only reference fields declared in the fact domain. Operators include equal to, not equal to, greater than, less than, greater than or equal to, less than or equal to, included in the enumeration set, and not included in the enumeration set. The threshold defines the matching range for each field. The time window limits the valid interval of time when the fact occurs. For each input fact, the conditional domain outputs a matching result, which is a triple containing whether a match was found, the branch number of the match, and the reason for the match. A rule can contain multiple conditional branches, each corresponding to a combination of conditional domains, and the conditional branches are logically ORed.

[0143] The computation domain declares the calculation logic for the integral and contains one or more integrator sub-operators. These sub-operators include: a fixed-value operator (directly returns a preset fixed integral value for the matched facts), a scaling operator (multiplies the numerical field of the fact domain by a preset scaling factor and then rounds it down), a tiered operator (returns the corresponding integral value based on the tier range of the numerical field of the fact domain), a tiered scaling operator (applies the corresponding scaling factor based on the tier range of the numerical field of the fact domain), an integer multiple operator (rounds the integral value up or down to a preset integer multiple), a rounding operator (performs rounding or up / down rounding on the integral value), a maximum value operator (takes the maximum value from the calculation results of multiple operators), an aggregation operator (sums the calculation results of multiple operators), and a deduction operator (generates a negative integral value for deduction). The input to the computation domain strictly comes from the matching results of the condition domain or the numerical field of the fact domain. The output of the computation domain is a precisiond integral value.

[0144] The control domain declares the control constraint parameters of the rules, including priority, exclusive group, capping dimension, scoring frequency, and conflict handling strategy. Priority is an integer; a higher value indicates higher priority. Exclusive group is used to group mutually exclusive rules into the same exclusive group; only one rule within the same exclusive group can be effective. Capping dimension defines the granularity of the points cap, supporting capping by single transaction, capping by customer per day, capping by customer per month, capping by card type per day, and capping by total activity budget. Scoring frequency defines the maximum number of times a customer can earn points for this rule within a specified time window. Conflict handling strategy defines how to handle situations where this rule coincides with other rules, including taking the higher value, stacking, and truncating.

[0145] The accounting domain declares the points crediting policy, including crediting methods, points validity calculation rules, and deduction policies. Crediting methods are divided into real-time crediting and approved crediting. Real-time crediting means that points are immediately written to the customer's points account and made available immediately after calculation. Approved crediting means that points are first written to the pending crediting record after calculation, and then written to the customer's points account after approval by a designated approver. Points validity calculation rules are based on the policies in the validity policy table, combined with the business effective time of the rules to calculate the specific expiration date. Deduction policies define the points deduction methods in return or reversal scenarios, including full deduction, proportional deduction, and deduction of a specified amount.

[0146] The version domain provides unified version management for the aforementioned fact domain, condition domain, calculation domain, control domain, and accounting domain, and includes three core attributes: snapshot hash value, business activation time, and system release time. The snapshot hash value is calculated based on the deterministic serialization results of the metadata of each domain and the binding relationships between domains. In this embodiment, a Merkle tree structure is used to calculate the root hash value, ensuring that any change to any field in any domain will cause a change in the snapshot hash value, thereby achieving immutability verification.

[0147] The audit domain subscribes to the output events of the aforementioned domains and generates standardized trace events. The audit domain does not participate in business calculation logic; instead, it listens to the output of each domain in an observer pattern, recording the inputs, intermediate results, and outputs of key nodes in the audit trace table. The types of events recorded by the audit domain include: rule matching events (recording the candidate rule list and matching status), calculation events (recording the input and output of operators), arbitration events (recording the arbitration path of candidate scores), capping events (recording the credit limit status before and after credit limit occupancy), posting events (recording the status of accounting transactions), and compensation events (recording the type and amount of difference compensation).

[0148] The data binding relationships between the seven domains are fixed: the output of the fact domain flows to the condition and computation domains; the output of the condition domain flows to the computation domain; the output of the computation domain flows to the control domain; the output of the control domain flows to the accounting domain; the output of the accounting domain is the final posting instruction; the version domain provides version information for the above five domains; and the audit domain subscribes to the output of all domains. Any backreference, cross-level jump reference, or undeclared output symbol is considered a compilation error.

[0149] Step 3: Compile and verify the rule draft and create an immutable snapshot.

[0150] After reading the seven-domain metadata, the rule compilation service first performs type safety verification, and then performs business constraint verification. Type safety verification includes the following four stages: The first stage involves generating a symbol table. All fields declared in the fact domain are iterated through, and a symbol entry is registered in the symbol table for each field. Each symbol entry includes the field name, data type, source domain, and whether it is nullable. The symbol type of fact domain fields is marked as "fact symbol"; fields referenced in the condition domain are marked as "condition reference symbols" in the symbol table, and a reference link is established from the condition reference symbol to the fact symbol; similarly, fields referenced in the computed domain are marked as "compute reference symbols" in the symbol table, and a reference link is established.

[0151] The second stage involves parsing the conditional field expressions and checking the operators. The expression tree for each conditional branch in the conditional field is parsed to verify operator compatibility with the field types. For example, numeric fields can only use numeric comparison operators such as greater than, less than, and equal to; enumerated fields can only use operators that are included in or excluded from the enumeration set; and date fields are checked for the chronological order of the start and end dates of the time window. If type incompatibility is found, the compiler returns an error code specifying the exact conditional branch and field name.

[0152] The third stage involves parsing the operator signatures in the computational domain and verifying their types. This includes verifying the input parameter types and output types of each integrator operator in the computational domain. For example, the scaling operator requires that the input parameters be numeric and the scaling factor be positive; the grading operator requires that the upper and lower bounds of the grading intervals do not overlap and cover all possible input values; and the grading scaling operator requires that the number of grading intervals and the scaling factor be consistent.

[0153] The fourth stage involves constructing an inter-domain dependency graph and performing a topological sort. Using "domain.symbol" as nodes and the data flow directions between domains as directed edges, an inter-domain dependency graph is constructed. This graph is then topologically sorted to detect dangling references (references to symbols not present in the symbol table) and circular dependencies (cycles within the dependency graph). The error codes for dangling references are "DANGLING_REFERENCE", circular dependencies are "CYCLE_DEPENDENCY", and type mismatches are "TYPE_MISMATCH".

[0154] Furthermore, business constraint verification is implemented by specialized checkers for intervals, tiers, caps, frequencies, exclusive groups, priorities, and budgets. The compilation and verification phase also includes the step of constructing a condition space coverage matrix. The condition space coverage matrix is ​​used to discover condition overlap relationships between different rules under the same integral type, the same institution, and the same fact type before rule release. Its construction process is as follows: extract all atomic conditions (i.e., indivisible single condition expressions) in the condition domain of each rule, and map each atomic condition to the corresponding condition dimension axis; construct a multi-dimensional condition space using customer level, card type, transaction amount range, merchant type, transaction date attribute, etc. as condition dimension axes; mark the coverage area of ​​each rule in the condition space in the matrix; perform spatial intersection detection on the matrix, and when the condition coverage areas of two rules have an intersection and are not covered by an exclusive group, they are marked as overlapping rule pairs. The detection results of overlapping rule pairs are displayed in the compilation report for operations personnel to confirm whether it is necessary to adjust the condition range or add exclusive group constraints. Conditional space intersection detection is implemented using a fast filtering algorithm based on interval trees. First, interval tree indexes are built for the condition intervals in each dimension. Then, interval tree queries are used to quickly exclude non-intersecting condition pairs. Precise multi-dimensional intersection determination is performed only among candidate pairs that may intersect, thereby improving detection efficiency.

[0155] After all compilation and verification passes, the system serializes the seven-domain metadata and inter-domain binding graph in a deterministic order. In this embodiment, Protocol Buffers is used as the serialization format. The metadata of each domain is written to the serialization buffer in a fixed order: first the fact domain, then the condition domain, then the calculation domain, then the control domain, then the accounting domain, then the versioning domain, and finally the audit domain. A Merkle root hash value is calculated on the serialization result. This hash value is used as the immutable snapshot hash value and written to the rule snapshot table along with the complete seven-domain metadata. The rule snapshot table uses an append-only writing method; any modification to a published rule must generate a new rule snapshot, while the original snapshot remains unchanged, thus ensuring the immutability of the snapshot.

[0156] Step 4: Submit the rule snapshot for approval and publish it on a dual timeline.

[0157] The approval object for the approval form is the snapshot hash value, not the visual field seen by operations personnel on the page. This means that the approver is approving an immutable object containing complete compilation verification results and metadata. The approval form is associated with a compilation report, which includes the condition space coverage matrix detection results, budget impact assessment results, and conflict analysis with other effective rules. The specific method for budget impact assessment is as follows: when a rule is submitted for approval, the system uses historical factual data and the snapshot hash value to be approved, based on a shadow ledger mechanism, to perform simulation calculations. The simulation calculation results are summarized daily to generate a budget occupancy curve, which is compared with the activity budget ceiling, outputting the peak budget date, peak amount, and budget occupancy rate. The approver can use this to determine whether the activity cost is within the budget before the rule takes effect.

[0158] After approval, the system will write the release information to the rule version table and the rule effectiveness index table. The rule version table records the approval number, approver, and approval time corresponding to each snapshot hash value. The rule effectiveness index table is an index structure that supports dual-axis queries based on business time and system time. Each index record contains the following fields: snapshot hash value, points type, organization code, fact type, business effectiveness start time, business effectiveness end time, system release time, and status flag.

[0159] The dual-timeline mechanism works as follows: During runtime, when a business event occurs, the system extracts the business time from the event data and uses that business time as a query condition to search the rule effective index table for rule snapshots whose effective time interval covers that business time and whose status is "effective". In audit or recalculation scenarios, the system uses the system time as a query condition to search the rule effective index table for rule snapshots whose system release time is earlier than or equal to that system time and whose status is "effective" or "invalid". This dual-timeline design ensures that a business event can be recalculated at any time to trace back to the rule version actually used by the system at the time the event occurred, and it can also restore the set of rules released by the system at any historical moment.

[0160] Step 5: Receive business facts and recall candidate rules.

[0161] The fact collection interface receives raw business messages from external systems. Taking a debit card POS transaction as an example, the raw message includes fields such as card number, transaction amount, transaction time, merchant ID, terminal ID, transaction serial number, and issuing bank code. The adaptation layer converts this raw message into a standardized format for unified facts. The unified facts include the following standard fields: fact idempotent key, points type, institution code, fact type code, transaction time, customer ID, card number, associated fact field set, and collection timestamp.

[0162] The generation rule for the fact idempotency key (fact_key) is as follows: the source system identifier, source event identifier, and integral type code are concatenated in a fixed order with colons, and then a hash operation is performed. The first 16 hexadecimal characters of the hash value are taken as the fact_key. This fact_key is used as the primary key for fact idempotency verification throughout the entire integral processing chain.

[0163] After receiving the standardized facts, the rule runtime service extracts three fields: the points type, the organization code, and the fact type code. These three fields are used as joint query conditions to recall all rule snapshots from the rule effective index table or the cached rule index that meet the following conditions: points type matching, organization code matching, fact type matching, and the business effective time interval covering the fact's business time and its status being "effective". The recall result is a list of rule snapshots, where each element contains a snapshot hash value and corresponding seven-domain metadata. To improve recall performance, the rule effective index is maintained in the cache as a Redis sorted set, using the Unix timestamp of the business effective start time as a score, supporting fast filtering by time range.

[0164] Step 6: Perform condition matching and compute the operator graph.

[0165] The condition evaluator performs condition matching on each rule snapshot in the recalled rule snapshot list, one by one. The condition matching process is as follows: Each condition branch of the condition domain in the rule snapshot is read; for each atomic condition in the condition branch, the value of the corresponding field is retrieved from the uniformly defined facts, and judged according to the operator and threshold declared in the atomic condition; when all atomic conditions in a condition branch are true, the condition branch is marked as a hit; when all condition branches of any rule are not hit, the rule is marked as a miss, and the reason for the miss is recorded in the condition matching result set, including which field does not meet which condition. The condition matching result set is a structure containing a list of hit rules and a list of miss rules (including the reason for the miss).

[0166] For each rule that matches the condition, the operator executor reads the operator graph of the computation domain and performs operator computations. The execution order of the operator graph is determined by its directed acyclic graph topology: first, basic operators that depend on the numerical fields of the fact domain (such as fixed-value operators, scaling operators, and grading operators) are executed; then, composite operators that depend on the output of the basic operators (such as height operators, superposition operators, and deduction operators) are executed; and finally, post-processing operators (such as integer multiple operators and rounding operators) are executed. The input and output of each operator are recorded in the operator trajectory for use by the subsequent audit domain.

[0167] Taking a specific rule in a debit card reward points scenario as an example: the condition domain contains a conditional branch requiring the customer to be a Gold or Platinum cardholder, the transaction amount to be greater than 100 yuan, the merchant type to be a restaurant, and the transaction date to be a weekend; the calculation domain contains a proportional operator (multiplying the transaction amount by 0.01) and an overlay operator (overlaying 20 fixed reward points onto the output of the proportional operator), and finally, a rounding operator to round down to the integer. The operator executor first executes the proportional operator to obtain the base reward points value, then executes the overlay operator to obtain the overlaid reward points value, and finally executes the rounding operator to obtain the final candidate reward points value. The entire process generates an operator trajectory record, including the input transaction amount and output base reward points value for the proportional operator, the input base reward points value and output overlay value for the overlay operator, and the input overlay value and output final reward points value for the rounding operator.

[0168] The output of the operator executor is a list of candidate integral objects, each containing at least six fields: rule identifier, branch identifier, snapshot hash value, integral value, condition vector, and operator trajectory.

[0169] Step 7: Perform deterministic conflict arbitration on multiple candidate results.

[0170] When multiple rules matching the same fact simultaneously, the final result needs to be determined from multiple candidate integral results. The arbitration service executes the following levels of arbitration in a fixed order: The first layer involves handling exclusive groups. First, the exclusive group configuration of candidate rules is checked. Multiple candidate rules with the same exclusive group enter the same group to compete and are not allowed to be directly superimposed. Candidate rules without an exclusive group configuration can coexist with other non-exclusive rules. When different exclusive groups are matched simultaneously, the superposition of rules across groups is further determined based on the accounting domain's superposition range.

[0171] The second layer is priority filtering. For candidate integral results that still participate in the competition after processing the exclusive group, they are sorted from highest to lowest priority according to the priority declared in the control domain. Priority is an integer, with a larger value indicating higher priority. If a rule in the same competition set has a strictly higher priority than other rules, that rule is retained and lower-priority candidates are eliminated; if multiple candidates have the highest priority, they are then sorted according to the accuracy of the applicable scope.

[0172] The third layer involves ranking by the precision of applicability. If multiple candidate rules with the same priority exist in the second layer, an applicability precision index is introduced for ranking. Applicability precision is a metric calculated based on the tightness of constraints in the condition domain. The specific calculation method is as follows: For each rule's condition domain, all atomic conditions of all condition branches are traversed, and these atomic conditions are categorized into four types: equality constraints, enumeration constraints, interval constraints, and time window constraints. Each type of constraint is assigned a different initial weight, with equality constraints having the highest weight, followed by enumeration constraints, then interval constraints, and finally time window constraints. For interval constraints, the weights are further adjusted based on the interval span; the smaller the interval span, the tighter the constraint, and the higher its weight. The weights of all atomic conditions are then normalized and summed to obtain the applicability precision score for the rule. A higher applicability precision score indicates more specific condition constraints and a narrower applicability scope. In cases of equal priority, rules with higher applicability precision scores are retained first.

[0173] The fourth layer is the result comparison layer. Based on the result processing strategy declared in the control domain, candidate result decisions are executed: the "highest value" strategy selects the candidate rule with the largest integral value as the final result; the "lowest value" strategy selects the candidate rule with the smallest integral value as the final result; the "overlay" strategy, when overlay is allowed in the accounting domain, sums the integral values ​​of the candidate rules as the final result; and the "truncation" strategy truncates the summation result to a preset upper limit. If the result processing strategy still cannot uniquely determine the candidate result, the stable fallback rule is entered, and the final decision is made using a deterministic key composed of the rule snapshot hash, rule number, and branch number.

[0174] Through the above-mentioned hierarchical arbitration, the system can ensure that the same fact yields a consistent final integral result in real-time calculation, batch calculation, recalculation, and prediction scenarios, and generate a tree-like elimination path for auditing and interpretation chain queries.

[0175] Step 8: Perform frequency deduplication and quota usage concurrency control.

[0176] Before the points results are finalized and ready to be credited, two concurrency controls need to be implemented: frequency deduplication and quota usage. Both controls are implemented through Redis caching.

[0177] Frequency-based deduplication is performed collaboratively by the deduplication service and the frequency service. First, the deduplication service generates deduplication keys based on a deduplication strategy. There are three strategies: First-launch generation strategy, which generates a deduplication key using a combination of customer ID and rule identifier, ensuring that the same customer triggers score calculation only for the first time under the same rule; Periodic generation strategy, which generates a deduplication key using a combination of customer ID, rule identifier, and period identifier (e.g., a date string), ensuring that the same customer triggers score calculation only once per period under the same rule; and Composite generation strategy, which generates a deduplication key using a combination of customer ID, rule identifier, period identifier, and fact type identifier. The deduplication service uses Redis's atomic placeholder command (SET key value NX EX) to place the deduplication key. If the placeholder is successful (i.e., the key did not previously exist), it returns success and continues the subsequent process; if the placeholder fails (i.e., the key already exists), the current fact is determined to be a duplicate fact, the score calculation process is terminated, and a deduplication hit log is recorded.

[0178] After successful deduplication placeholder generation, the frequency service generates a frequency key. The frequency key consists of a client number, a rule identifier, and a frequency window identifier. The frequency window identifier is calculated based on the scoring frequency declared in the control domain. For example, if the scoring frequency is once a day, the frequency window identifier is the current date string. The frequency service performs atomic counting operations in Redis using Lua scripts: the script first increments the frequency key to obtain the current count value; then it compares the current count value with the preset frequency upper limit; if the current count value does not exceed the upper limit, the script returns success; if the current count value exceeds the upper limit, the script decrements the frequency key (rollback counting) within the same atomic operation, deletes the deduplication key previously written by the deduplication service (releases the deduplication placeholder), and then returns a frequency exceedance error. Because the Lua script executes atomically in Redis, the four steps of counting, upper limit judgment, rollback, and deduplication key release will not be interrupted by other requests in a concurrent environment, thus ensuring the consistency of frequency control.

[0179] Credit limit capping is implemented by a capping service. Instead of post-event aggregation and truncation, the capping service uses a real-time credit limit ledger for control. The capping service generates capping keys based on customer, rule, card number, and period dimensions. The format of the capping key is: a combination of points type prefix, institution code, rule identifier, customer number or card number, and period identifier. The capping service performs the following atomic operations in Redis using Lua scripts: First, read the used quota value and total capped quota value corresponding to the capping key; second, calculate the remaining available quota (total capped quota minus used quota); third, compare the current points value with the remaining available quota. If the current points value does not exceed the remaining available quota, add the current points value to the used quota and return success and the actual points value obtained; if the current points value exceeds the remaining available quota, truncate the points value to the remaining available quota, add the remaining available quota to the used quota and return success and the truncated points value; if the remaining available quota is zero, return a cap exhausted error.

[0180] For rules involving approved crediting, points are not immediately written to the customer's points account after calculation; they require an approval process. In this scenario, the capping service still needs to reserve a quota for points under review to prevent other rules from occupying the same quota during the review period, which could lead to exceeding the cap after approval. To address this, the capping service introduces a frozen quota mechanism: points generated by rules under review are written to the frozen quota field, rather than directly to the used quota field. In the Lua script, the frozen quota and the used quota both participate in the calculation of the remaining available quota. After approval, the system converts the frozen quota into the used quota; after a rejection, the system subtracts the corresponding points value from the frozen quota to release the quota.

[0181] To address potential timeouts during the review process, the system is configured with a scheduled task to periodically scan frozen credit limit records. For records that remain frozen beyond a preset timeout threshold (e.g., determined based on the average processing cycle of bank points business reviews), the frozen credit limit is automatically released, a timeout release log is recorded, and a timeout reminder notification is sent to operations personnel.

[0182] Furthermore, in the event that the transaction writing step may fail, the capping service maintains a compensation state machine to handle exceptions. The compensation state machine includes the following states: "Initial State," "Quota Occupied," "Transaction Writing in Progress," "Transaction Writing Successful," and "Transaction Writing Failed." When the Lua script successfully occupies the quota, the state machine enters the "Quota Occupied" state; when the system begins writing the transaction log, the state machine enters the "Transaction Writing in Progress" state; if the transaction writing is successful, the state machine enters the "Transaction Writing Successful" final state; if the transaction writing fails due to a temporary fault, the state machine enters the "Transaction Writing Failed" state and generates a compensation task record. The compensation task record includes the capping key, the occupied quota value, the failure timestamp, and the number of retries. The asynchronous compensation task periodically retrieves compensation task records in the "account write failed" state and handles them according to the following strategy: If the number of retries does not exceed the preset limit (e.g., 3 times, which is based on the average recovery time of temporary faults: database connection timeouts, network jitter, and other faults can usually recover on their own within a 3-retry window, and is determined in conjunction with the design principle of avoiding infinite retries that occupy system resources), the account write operation is re-executed; if the number of retries exceeds the limit, a quota rollback operation is performed and the compensation task is marked as "rollbacked," while an alarm log is recorded for manual intervention. This compensation state machine design ensures that an inconsistent state of "quota occupied but account not recorded" will not occur when the account write fails.

[0183] Step 9: Generate a three-tiered accounting record based on the accounting strategy.

[0184] The accounting domain adopts a three-tiered pipeline structure: calculation pipeline, pending entry pipeline, and account pipeline. The three pipelines are linked through the same calculation identifier, forming a complete lifecycle traceability link for points.

[0185] The calculation log is the lowest level of the three-tiered log, recording the complete process and result of integral calculation. The core fields of the calculation log table include: calculation identifier (calc_id, globally unique), fact idempotent key, snapshot hash value, rule identifier, branch identifier, integral value, operator trajectory, condition vector, arbitration details, capped truncation value, and creation time. Regardless of whether subsequent accounting entries are successful, the calculation log is permanently saved and cannot be modified once generated. The calculation log is a complete record of the integral calculation facts; even if an accounting reversal or compensation occurs, the original record of the calculation log remains unchanged.

[0186] The pending payment record is the middle layer of the three-tiered payment record system, used to manage points in the review process. When the payment strategy of the rule is "reviewed payment," the system writes a pending payment record to the pending payment record table after the calculated payment record is generated. The core fields of the pending payment record table include: pending payment identifier, associated calculation identifier, customer number, points value, review status (pending review, approved, rejected), reviewer, review time, and review comments. The points value of the pending payment record does not yet affect the customer's points account balance. Only after the review status changes to "approved" will the system convert the pending payment record into an account payment record. If the review status changes to "rejected," the system releases the previously frozen credit limit, but both the calculated payment record and the pending payment record are retained for easy tracing of the review decision process.

[0187] Account transaction history is the top layer of the three-tiered transaction history, recording actual changes in a customer's points account. When the rule's posting policy is real-time posting, the system directly generates account transaction history from the calculated transaction history; when the rule's posting policy is approved posting, the system generates account transaction history from the pending posting transaction history after approval. The core fields of the account transaction history table include: account transaction history identifier, associated calculation identifier, customer number, points type, change amount (positive for issuance, negative for deduction), balance after change, posting type (positive posting, negative deduction, reversal), transaction time, and posting time. Account transaction history directly affects a customer's available points balance.

[0188] The relationship between the three transaction records is as follows: each account transaction uniquely corresponds to one calculated transaction through a related calculation identifier; each pending transaction also uniquely corresponds to one calculated transaction through a related calculation identifier. The calculation identifier allows tracing any account transaction back to its corresponding pending transaction (if any) and calculated transaction, thus reconstructing the complete chain from points rule configuration to customer account changes. When a customer has questions about their points results, customer service personnel can retrieve the entire calculation and review process for that point transaction by entering the related calculation identifier from the account transaction record.

[0189] Step 10: Generate the interpretation chain and make it available for querying.

[0190] The audit trail service subscribes to events at each key node in the entire points calculation process and aggregates them into an explanation chain record. The aggregation process of the explanation chain record is as follows: In the condition matching stage, it subscribes to condition matching events, records the list of all candidate rules, the hit or miss status of each candidate rule, and the reason for the miss; in the operator calculation stage, it subscribes to calculation events, records the input parameters and output results of the operator, forming the operator input-output trajectory; in the conflict arbitration stage, it subscribes to arbitration events, records the scores of candidate rules at each level of arbitration and the reasons for elimination; in the capping control stage, it subscribes to capping events, records the credit limit status before and after the credit limit is used, and whether truncation occurs and the truncation value; in the billing stage, it subscribes to billing events, records the billing path (real-time billing or audit billing path), the billing amount, and the billing time; in the difference compensation stage, it subscribes to compensation events, records the compensation type and compensation amount.

[0191] All the above events are aggregated into a complete explanatory chain record using the calculated identifier as the primary key and written to the audit trail table. The explanatory chain record also contains the following supplementary information: snapshot hash value (used to trace rule version), approval batch identifier (used to trace the approval process), deduplication key (used to trace deduplication status), and frequency window information (used to trace frequency control status).

[0192] The system provides a unified explanation chain query interface with the path format " / points / explain / {calc_id}". After the caller passes in a calculation identifier, the interface returns the complete explanation chain record corresponding to that identifier. The returned explanation chain record is organized in chronological order: the first segment, "Rule Matching Segment," displays the list of candidate rules matched in this calculation and the matching result of each rule; the second segment, "Calculation Process Segment," displays the input and output trajectories of each operator; the third segment, "Arbitration Process Segment," displays the hierarchical path of arbitration and the final winning rule; the fourth segment, "Capping Process Segment," displays the credit limit value before and after the limit is used and whether truncation occurred; and the fifth segment, "Billing Process Segment," displays the billing path and the billed amount. Operations and customer service personnel can directly answer common customer questions such as "Why did I receive these points?", "Why didn't I receive points?", and "Why did I receive fewer points than expected?" through the explanation chain query interface, without needing to consult scattered logs from multiple systems.

[0193] Furthermore, this scheme also includes forecasting, recalculation, and difference compensation steps.

[0194] The forecasting function employs a shadow ledger mechanism. The shadow ledger uses the exact same rule snapshots, conflict arbitration logic, and capping control logic as the official ledger. However, the calculation results of the shadow ledger are written to a separate shadow batch table, without affecting the customer's official points account balance. During the rule approval phase, the system uses historical factual data from the shadow ledger to perform simulation calculations on the snapshot of the rule to be approved, outputting a budget forecast report. During activity operation, operations personnel can also use the shadow ledger to preview the effects of rule parameter adjustments, confirming the effects before submitting the modified rule snapshot for official approval. The snapshot hash values ​​of the shadow ledger and the official ledger remain consistent, ensuring complete consistency between the forecast and the official disbursement standards.

[0195] Recalculation and difference compensation are driven by a timed difference recalculation task. This task, based on facts, extracts the factual data requiring recalculation one by one, and re-executes the complete integral calculation pipeline (including candidate rule recall, condition matching, operator execution, conflict arbitration, and capping control) on the factual data using a new rule snapshot, obtaining new calculation results. Then, the new calculation results are compared with historical calculation results using a three-state model: The first state, unchanged state: The integral value of the new calculation result is the same as that of the historical calculation result, and the corresponding rule identifier and branch identifier are consistent. In this case, no compensation operation is performed, and the comparison result is only recorded in the difference comparison log.

[0196] The second state, under-issued status: The newly calculated points value is greater than the historical points value, meaning the customer has historically earned fewer points. In this case, the system generates a positive reissue record, with the difference being the new calculation result minus the historical calculation result. After the positive reissue record is generated, it follows the normal posting process (selecting real-time posting or audit posting according to the posting strategy), ultimately replenishing the difference to the customer's points account.

[0197] The third state is the over-issue state: the newly calculated score is less than the historical score, meaning the customer has historically received more points than they should have. In this case, the system needs to perform a deduction operation. In the over-issue state, the system's deduction strategy uses a source-based score allocation method. The specific processing flow is as follows: First, the system traces the original points distribution records along the calculation identifier chain to pinpoint the specific points distribution record that caused the over-distribution issue. Then, it checks the consumption binding relationship of this points distribution record, i.e., whether the customer has already used the points (e.g., redeemed gifts or used to offset consumption). If the points have not been used, the system directly deducts the full amount from the corresponding source points, generating a negative account statement. If the points have been partially used, only the unused portion is deducted, and the remaining amount is recorded as pending recovery. The pending recovery record includes the customer number, the points to be recovered, the original calculation identifier, and the associated customer service ticket number. Customer service personnel will then follow up with a manual recovery process or automatically deduct the points when the customer earns new points later. This source points-based deduction method avoids directly deducting negative balances from the customer's account, ensuring that each deduction has a clear source and a traceable deduction chain, protecting customer experience while guaranteeing the rigor of accounting processing.

[0198] All operations related to difference compensation generate corresponding compensation transaction records, which are written to the compensation transaction table. The core fields of the compensation transaction table include: compensation identifier, original calculation identifier, new calculation identifier, compensation type, compensation amount, compensation status, and creation time.

[0199] To implement all the above steps, this embodiment defines the following core data objects and interfaces: At the database table level, it includes: a points type configuration table (point_type_config), which stores basic parameters for points types; a rule draft table (rule_draft), which stores rule drafts configured by operations personnel; a rule domain metadata table (rule_domain_meta), which stores a structured representation of the seven domain metadata; a rule snapshot table (rule_snapshot), which stores immutable rule snapshots and their Merkle root hash values; a rule effective index table (rule_effective_index), which supports rule indexes for dual time-axis queries; a calculation flow table (calc_flow), which stores the complete process and results of points calculation; a pending ledger table (pending_ledger), which stores points records in the review process; an account ledger table (account_ledger), which stores actual changes to customer points accounts; a compensation ledger table (compensation_ledger), which stores difference compensation records; and an audit trace table (audit_trace), which stores the explanation chain records.

[0200] At the caching level (based on Redis), it includes: rule index cache (key prefix RULE_IDX), which stores cached copies of the indexes for which the rule is effective in the form of an ordered set; deduplication cache (key prefix DEDUP), which stores atomic placeholder records for deduplication keys; frequency cache (key prefix FREQ), which stores the count value of the frequency window; and capping cache (key prefix CAP), which stores the occupied and frozen quotas of the capped dimension.

[0201] At the interface level, it includes: a rule compilation interface (POST / rules / compile), which receives rule drafts, performs compilation verification, and returns a compilation report and snapshot hash value; an integral calculation interface (POST / points / calculate), which receives business fact data, performs a complete calculation pipeline, and returns a calculation identifier and integral result; and an explanation chain query interface (GET / points / explain / {calcId}), which returns an explanation chain record based on the calculation identifier.

[0202] At the scheduled task level, it includes: frozen quota release task, which periodically scans for frozen quota records that have expired and have not been reviewed and releases the quota; difference recalculation task, which performs difference recalculation based on facts and generates compensation records; and compensation retry task, which periodically scans for compensation tasks in abnormal states in the compensation state machine and performs retry or rollback operations.

[0203] Secondly, this application proposes an integral calculation device based on an executable rule meta-model, such as... Figure 12 As shown, it includes: The basic parameter configuration module is used to configure basic points parameters and rule drafts, and to determine the points type, affiliated institution, exchange rate, validity period, and account category. The rule metamodel generation module is used to parse the rule draft into structured metadata and generate a seven-domain rule metamodel containing the fact domain, condition domain, calculation domain, control domain, accounting domain, version domain and audit domain according to the heterogeneous domain model. The data binding relationship between the domains in the seven-domain rule metamodel is fixed. The compilation and verification module is used to perform compilation and verification on the seven-domain rule meta-model. After the verification is passed, the seven-domain metadata and inter-domain binding relationships are serialized and an immutable rule snapshot is generated. The approval and release module is used to submit rule snapshots for approval. Once approved, the rule snapshots are released using a dual timeline mechanism, and an effective rule index is generated simultaneously. The fact receiving and rule recall module is used to receive business fact data, standardize the business fact data into unified standard facts, and recall effective candidate rule snapshots based on points type, organization, and fact type. The condition matching and calculation module is used to perform condition matching on each of the recalled candidate rule snapshots. After the condition matching is successful, it performs integral calculation according to the operator graph defined in the computation domain to generate at least one candidate integral result. The conflict arbitration module is used to perform deterministic conflict arbitration on multiple candidate integration results and output the final integration result; The frequency deduplication and quota control module is used to perform frequency deduplication and quota occupancy concurrency control on the final integration result; The accounting transaction generation module is used to generate a three-tiered accounting transaction record that includes calculated transaction record, pending transaction record, and account transaction record based on the accounting strategy. The three-tiered accounting transaction record are associated through the same calculation identifier. The Explanation Chain Generation Module is used to generate explanation chain records. The explanation chain record contains candidate rule information, reasons for misses, conditional branches, arbitration paths, capped cutoff values, and accounting paths.

[0204] The above are merely preferred embodiments of the present invention. It should be noted that any modifications and improvements made by those skilled in the art without departing from the present technical solution should also be considered to fall within the scope of protection claimed by the present solution.< / decimal> < / decimal> < / t> < / t>

Claims

1. An integral calculation method based on an executable rule meta-model, characterized in that, Includes the following steps: Configure basic points parameters and draft rules, and determine points type, affiliated institution, exchange rate, validity period and account category; The rule draft is parsed into structured metadata, and a seven-domain rule meta-model is generated according to the heterogeneous domain model, which includes the fact domain, condition domain, calculation domain, control domain, accounting domain, version domain and audit domain. The data binding relationship between the domains in the seven-domain rule meta-model is fixed. Perform compilation verification on the seven-domain rule metamodel. After the verification passes, serialize the seven-domain metadata and inter-domain binding relationships and generate an immutable rule snapshot. Submit the rule snapshot for approval. Once approved, publish the rule snapshot using a dual timeline mechanism and simultaneously generate a rule effective index. Receive business fact data, standardize the business fact data into unified standard facts, and recall snapshots of effective candidate rules based on points type, organization, and fact type; Perform condition matching on each recalled candidate rule snapshot, and perform integral calculation according to the operator graph defined in the computational domain after the condition matching is successful, generating at least one candidate integral result; Perform deterministic conflict arbitration on multiple candidate integration results and output the final integration result.

2. The method according to claim 1, characterized in that, The seven-domain rule meta-model includes: The fact object types that the fact domain declaration rule can accept; Conditional fields declare fields, operators, thresholds, and time windows; conditional fields can only reference fields that have been declared in fact fields. The computation domain declares the integral operator, and the input to the computation domain comes from the matching result of the condition domain or the numerical field of the fact domain; The control domain declares priority, exclusive group, and capped dimension; The accounting domain declares real-time billing policies, audit billing policies, and points validity periods; The version field provides snapshot hashes, effective times, and system time for the fact field, condition field, computed field, control field, and accounting field; The audit domain subscribes to the output of each domain and generates trace events.

3. The method according to claim 2, characterized in that, The compilation verification performed on the seven-domain rule meta-model includes type safety verification and business constraint verification; The type security verification includes constructing an inter-domain dependency graph, verifying the validity of field references, type compatibility, operator input and output types, topological sorting, dangling references, and circular dependencies; The business constraint verification includes verifying interval mutual exclusion, gear continuity, capping dimension validity, frequency window validity, exclusive group integrity, priority conflict, budget impact, and constructing a condition space coverage matrix to discover overlapping rules.

4. The method according to claim 3, characterized in that, The determination of conflict arbitration for multiple candidate integral results includes: An applicability scope accuracy index is introduced, which is calculated based on the equality constraint weight, enumeration constraint weight, interval constraint weight, and time window constraint weight of the condition domain. Arbitration is performed in a hierarchical order of exclusive group rules, priority descending order, scope of application and accuracy descending order, comparison of calculation results, superposition rules and stable fallback rules, forming a tree-like elimination path; Output arbitration details, which include the score, reason for elimination, and final winning rule for each candidate rule.

5. The method according to claim 4, characterized in that, It also includes performing concurrent control of credit limit usage on the final points result. The concurrent control of credit limit usage is implemented through a credit limit usage ledger, including: generating a capping key based on customer dimension, rule dimension, card number dimension and period dimension; The atomic script completes the entire process of reading the credit limit, calculating the remaining credit limit, truncating points, and writing the frozen credit limit in one go, ensuring the atomicity of querying, truncating, and occupying the credit limit. Points under review are managed in a pre-reserved mode. Points under review are written into the frozen amount field, and a scheduled task is configured to release the frozen amount after the timeout. When an accounting entry fails, the current state is recorded through a compensation state machine, and either the amount is rolled back or the accounting entry is retried.

6. The method according to claim 5, characterized in that, It also includes generating a three-tiered accounting flow chart based on the accounting strategy, comprising calculated flow chart, pending flow chart, and account flow chart. These three tiers of accounting flow charts are linked through the same calculation identifier. The generation of the three tiers of accounting flow charts includes: First, write the computational pipeline to record the integration calculation process and results; According to the rules and accounting policies, when the accounting policy is real-time accounting, the points are directly written into the account transaction record. When the accounting policy is audited accounting, the points are first written into the pending accounting record, and then written into the account transaction record after the audit is approved. Calculated transaction records, pending transaction records, and account transaction records are linked through the same calculation identifier, allowing you to trace back to the corresponding calculation process and audit status from any record in the account transaction records.

7. The method according to claim 6, characterized in that, It also includes the difference compensation step: Using facts as the dimension, the new rule snapshot is used to re-execute the integral calculation pipeline on historical fact data; The new calculation results are compared with the historical calculation results according to the three-state model: no processing is done when the comparison result is unchanged, a positive reissue record is generated when the comparison result is under-issued, and a negative deduction record is generated when the comparison result is over-issued. In the case of multiple issuances, the points consumption binding relationship is queried along the calculation identifier traceability chain. The points are deducted from the original incorrectly issued points using the source points apportionment method. Any shortfall is generated as a record to be recycled and associated with a customer service work order.

8. The method according to claim 7, characterized in that, The dual time axis mechanism includes: The rule snapshot simultaneously records the business activation time and the system release time; At runtime, the rule snapshot that should be applied to the business is selected from the rule effective index based on the business time carried by the factual data; During auditing or recalculation, the system restores a snapshot of the rules actually published and used at the historical moment from the rule effective index based on the system time.

9. The method according to claim 8, characterized in that, It also includes performing frequency deduplication on the final integration result, wherein frequency deduplication includes: Deduplication keys are generated based on deduplication strategies, which include first-time generation strategy, periodic generation strategy, and composite generation strategy. The deduplication bond is placed by atomic occupancy operation. If the occupancy is successful, the integration calculation process continues. If the occupancy fails, it is determined to be a duplicate fact. Generate frequency bonds and count them using an atomic counting script. If the frequency limit is exceeded, backtrack the count and release the deduplicated bonds within the same atomic operation.

10. An integral calculation device based on an executable rule meta-model, characterized in that, include: The basic parameter configuration module is used to configure basic points parameters and rule drafts, and to determine the points type, affiliated institution, exchange rate, validity period, and account category. The rule metamodel generation module is used to parse the rule draft into structured metadata and generate a seven-domain rule metamodel containing the fact domain, condition domain, calculation domain, control domain, accounting domain, version domain and audit domain according to the heterogeneous domain model. The data binding relationship between the domains in the seven-domain rule metamodel is fixed. The compilation and verification module is used to perform compilation and verification on the seven-domain rule meta-model. After the verification is passed, the seven-domain metadata and inter-domain binding relationships are serialized and an immutable rule snapshot is generated. The approval and release module is used to submit rule snapshots for approval. Once approved, the rule snapshots are released using a dual timeline mechanism, and an effective rule index is generated simultaneously. The fact receiving and rule recall module is used to receive business fact data, standardize the business fact data into unified standard facts, and recall effective candidate rule snapshots based on points type, organization, and fact type. The condition matching and calculation module is used to perform condition matching on each of the recalled candidate rule snapshots. After the condition matching is successful, it performs integral calculation according to the operator graph defined in the computation domain to generate at least one candidate integral result. The conflict arbitration module is used to perform deterministic conflict arbitration on multiple candidate integration results and output the final integration result; The frequency deduplication and quota control module is used to perform frequency deduplication and quota occupancy concurrency control on the final integration result; The accounting transaction generation module is used to generate a three-tiered accounting transaction record that includes calculated transaction record, pending transaction record, and account transaction record, based on the accounting strategy. The three-tiered accounting transaction record are associated through the same calculation identifier. The Explanation Chain Generation Module is used to generate explanation chain records. The explanation chain record contains candidate rule information, reasons for misses, conditional branches, arbitration paths, capped cutoff values, and accounting paths.