Policy settlement dual-track review and discrepancy tracking methods, devices and media

By reverse-engineering candidate nodes from the output nodes of the rule execution graph in the policy settlement system, and performing constrained replacement and replay calculations, the problem of locating the change range when the system's calculated value and the actual confirmed value are inconsistent is solved. This achieves efficient difference location and record encapsulation, and improves the system's data consistency and efficiency.

CN123118285APending Publication Date: 2026-11-17SHANGHAI YUHENG CLOUD INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611375716.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

When the calculated value and the actual confirmed value are inconsistent, the existing policy settlement system cannot effectively locate the minimum scope of change, which leads to an increase in the number of rule engine executions and data reading.

Method used

Candidate nodes are determined by reversely following the data dependencies from the output nodes of the preset rule execution graph. Constrained replacement and replay calculations are performed to obtain the replay residuals. The minimum set of changed nodes is determined based on the replay residuals and encapsulated as a difference attribution credential.

Benefits of technology

This reduces the amount of replay execution required by the rule engine, improves the accuracy and data consistency of difference localization results, reduces the repeated reading of irrelevant rule nodes and input records, and enhances the reliability of difference records.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118285A_ABST
    Figure CN123118285A_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, and medium for dual-track review and difference tracking of policy settlement, relating to the field of settlement processing technology. It addresses the problem of increased rule engine execution times and data reading volume caused by data replay in existing technologies. When the system's calculated value differs from the actual confirmed value, this application first limits the candidate range in reverse along the data dependency relationship of the current execution from the output node of the rule execution graph. Then, it performs constrained replacement and replay calculation on the candidate nodes based on the actual confirmed value, and filters the set of smallest changed nodes based on the replay residual. Since the replay range is limited to the dependency subgraph that can affect the current output, and the intermediate results of unreplaced nodes can be reused, it reduces the repeated reading of irrelevant rule nodes and irrelevant input records, lowers the replay execution volume of the rule engine, and allows the difference location result to correspond to a specific rule node or input node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of settlement processing technology, specifically to a method, apparatus, and medium for dual-track review and discrepancy tracking of policy settlement. Background Technology

[0002] Policy settlement systems typically generate settlement results based on effective business policies and rules, as well as business data such as sales, collections, and gifts. They also save the corresponding rule versions, condition judgments, and intermediate calculation results. A single settlement result may be affected by multiple rule nodes, input records, and aggregation nodes simultaneously. Data dependencies are formed between these nodes, from input to output. When there is a difference between the system's calculated value and the actual confirmed value, it is necessary to determine the source of the difference by combining the original rule version and business input.

[0003] The existing rule execution records can reflect the triggered rules and calculation paths, but for the output differences caused by the combined action of multiple nodes, it is impossible to directly determine the minimum range of changes that can explain the differences. If all rule nodes and historical business data are replayed item by item, it will increase the number of rule engine executions and data reading volume. Summary of the Invention

[0004] The purpose of this invention is to provide a method, apparatus and medium for dual-track review and discrepancy tracking of policy settlement.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a method, apparatus, and medium for dual-track review and discrepancy tracking of policy settlement, the method comprising: Obtain the system-calculated value and the actual confirmed value; When the system-calculated value is inconsistent with the actual confirmed value, candidate nodes are determined in reverse from the output node of the preset rule execution graph along the data dependency relationship. The candidate nodes are subjected to constrained replacement and replay calculations based on the actual confirmed values ​​to obtain the replay residuals, and the minimum set of changed nodes is determined based on the replay residuals. Encapsulate the minimum set of changed nodes and the replay residuals into a difference attribution certificate; Constrained replacement is based on the data type constraints of candidate nodes, and test replacement values ​​are configured for candidate nodes. The minimum change node set is the set of candidate nodes contained in the candidate change scheme that minimizes the objective function value among multiple candidate change schemes where the replay residual meets the preset tolerance conditions.

[0006] More preferably, determining candidate nodes by reverse-engineering the data dependencies from the output nodes of the preset rule execution graph includes: Traverse the executed dependency edges corresponding to the current system calculation value from the output node in reverse order, remove branches that were not triggered by this calculation, and form an output dependency subgraph; Based on the direction of the difference between the system-calculated value and the actual confirmed value, determine the changeable direction and allowable change range of each upstream node; Delete nodes whose changeable direction does not match the difference direction, and identify the remaining upstream nodes as candidate nodes.

[0007] More preferably, the candidate nodes are subjected to constrained replacement and replay calculations using actual confirmed values ​​to obtain replay residuals, including: Candidate replacement values ​​are generated based on the differences and the allowable change ranges for each candidate node; Propagate node data types, value ranges, rule versions, and upstream and downstream consistency constraints along the output dependency subgraph, and delete candidate replacement values ​​that do not meet the constraints; Write the remaining candidate replacement values ​​into an independent replay copy, re-execute the replaced node and its downstream nodes according to the original rule version, and reuse the intermediate calculation results of the unaffected nodes to obtain the replay calculation values. The difference between the calculated replay value and the actual confirmed value is defined as the replay residual.

[0008] More preferably, determining the minimum set of changed nodes based on the replay residual includes: Multiple candidate change schemes are generated based on the combination of change nodes, and candidate change schemes whose absolute value of replay residual is not greater than the preset tolerance threshold are retained. The objective function value is determined based on the number of change nodes included in each candidate change scheme and the preset change cost corresponding to each change node. The candidate change scheme with the smallest objective function value is then identified as the smallest set of change nodes.

[0009] More preferably, after determining the minimum set of change nodes, the method further includes: Restore each node in the set of smallest changed nodes to its original value before replacement, and then perform a verification replay. If the absolute value of the restored replay residual is still not greater than the preset tolerance threshold, the node is removed from the minimum change node set and the verification replay continues until the absolute value of the replay residual is greater than the preset tolerance threshold when any remaining node is restored.

[0010] More preferably, the preset rule execution graph includes input record nodes, condition judgment nodes, rule parameter nodes, intermediate calculation nodes, and output nodes; during the process of generating system calculation values, the data reading relationship, condition triggering relationship, and calculation transmission relationship between each node are recorded, and the executed nodes corresponding to this calculation and the relationship between the nodes are bound to the rule version identifier used in this settlement.

[0011] More preferably, the replay calculation is performed in an isolated replay container corresponding to the rule version identifier; the isolated replay container loads the input record snapshot used when generating the system calculation value, and generates a replay request identifier based on the settlement object identifier, rule version identifier and candidate change scheme, so that repeated replay requests with the same replay request identifier can reuse the generated replay results.

[0012] More preferably, the difference attribution voucher is serialized and a summary is calculated according to a preset field order to obtain a voucher summary used to verify the integrity of the difference attribution voucher.

[0013] More preferably, the difference attribution certificate also includes the system calculated value, the actual confirmed value, the node identifier of the smallest changed node, the node value before replacement, the node value after replacement, the data dependency path, the rule version fingerprint, and the input record hash.

[0014] More preferably, after generating the difference attribution voucher, the method further includes: In response to the settlement confirmation operation for the actual confirmed value, a settlement release record is generated, and the settlement release record is associated with and stored with the difference attribution voucher. The system calculated value, the original rule version identifier, and the original input record snapshot are kept in read-only state, so that the settlement result corresponding to the new rule version and the original difference record are saved separately.

[0015] The technical effects and advantages provided by the present invention in the above technical solution are as follows: 1. Compared to the processing method of retrieving complete rule records based solely on settlement differences, this application, when the system's calculated value and the actual confirmed value are inconsistent, first limits the candidate range in reverse along the data dependency relationship of the current execution from the output node of the rule execution graph. Then, it performs constrained replacement and replay calculation on the candidate nodes based on the actual confirmed value, and filters the set of smallest changed nodes based on the replay residual. Since the replay range is limited to the dependency subgraph that can affect the current output, and the intermediate results of unreplaced nodes can be reused, it can reduce the repeated reading of irrelevant rule nodes and irrelevant input records, reduce the replay execution load of the rule engine, and make the difference location result correspond to a specific rule node or input node.

[0016] 2. Compared to simply saving the difference value and processing status, this application encapsulates the minimum set of change nodes and the corresponding replay residuals into a difference attribution certificate. Since the difference attribution result retains the minimum change range, replay proximity, and verification information of the original calculation environment, when the rule version is updated or the business data status changes, the replay process can still be reviewed according to the original rule version and input snapshot. This reduces the situation where historical calculation basis cannot be verified after being overwritten, and improves the data consistency between difference records, settlement release records, and the original system calculation evidence. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0018] Figure 1 This is a schematic diagram of the process for the dual-track verification and discrepancy tracking method, apparatus and medium for policy settlement of the present invention.

[0019] Figure 2 This is a schematic diagram illustrating the reverse determination of candidate nodes in this invention.

[0020] Figure 3 This is a schematic diagram illustrating the constrained replacement, replay calculation, and difference attribution certificate generation of the present invention. Detailed Implementation

[0021] To facilitate understanding of the technical solutions of this application, the following description is provided in conjunction with specific data processing procedures. The steps described in each embodiment can be executed by a settlement server, or by a rule engine server, a data storage server, and a review terminal working together. Unless otherwise stated, a settlement server refers to a computer device with a processor, memory, and a network interface, capable of calling the rule engine and accessing business data.

[0022] This application provides a virtual device, including a memory, a processor, and a program stored in the memory, wherein the processor executes the program to implement a processing method.

[0023] This application also provides a storage medium on which a program is stored, and when the program is executed, it implements the processing method.

[0024] The preset rule execution graph in this application includes a pre-configured rule graph template and execution instances formed based on the current calculation process. The rule graph template specifies the node types, operational relationships, and connection methods between nodes; the execution instances record the node values ​​actually read, the branches actually triggered, and the dependency edges actually executed when generating the system's calculated values. Therefore, the rule execution graph is formed before the difference review begins, but it is not required to populate unexecuted branches with runtime data.

[0025] The system-calculated value is the settlement result generated by the settlement server based on effective operating policies and rules and corresponding business records, including at least one of the following: amount, quantity, proportion, level, or status. The actual confirmed value is the settlement result determined based on receipt records, outbound records, delivery records, audit vouchers, or authorization confirmation information. The system-calculated value and the actual confirmed value are stored in the system calculation track and the actual confirmation track, respectively. Writing the actual confirmed value does not overwrite the system-calculated value and its calculation basis.

[0026] Data dependency refers to the direct dependence of downstream nodes on the data, judgment results, or intermediate calculation results of upstream nodes. Constrained replacement refers to generating test replacement values ​​for candidate nodes that meet data type, value range, and upstream / downstream consistency conditions without modifying the original rule version or original business records, and using these test replacement values ​​in independent replay copies. The minimum set of changed nodes is the set of nodes retained after filtering according to the objective function and necessity verification among candidate change schemes where the replay residuals meet preset tolerance conditions.

[0027] To avoid ambiguity arising from different output types using the same direction of change, this application divides output nodes into numerical output nodes and discrete state output nodes. For numerical output nodes, the target change relationship is represented by the increase or decrease direction of the actual confirmed value relative to the system calculated value. For discrete state output nodes, the rule version pre-stores the state set, allowed state transition edges, and the triggering conditions corresponding to each transition edge. The target change relationship is represented by the allowed state transition path from the current state to the actual confirmed state. When no allowed state transition path exists, the attribution of this difference is marked as undetermined, and state-type candidate nodes are not selected based on the direction of increase or decrease in numerical values.

[0028] Example 1 like Figure 1 As shown in the illustration, this embodiment describes the complete execution process of the policy settlement dual-track review and difference tracking method, device, and medium. The settlement server connects to the rule base, business data storage area, historical version storage area, and review terminal. The rule base stores business policy rules, rule version identifiers, rule parameters, and rule diagram templates; the business data storage area stores sales, collection, delivery, gift distribution, and policy application records; the historical version storage area stores rule snapshots, input record snapshots, node intermediate values, and difference attribution vouchers; the review terminal is used to display the system's calculated values ​​and submit the actual confirmed values.

[0029] The node records in the rule graph template must include at least the node identifier, node type, operation type, output data type, upstream node reference, allowed value description, and rule version identifier. Node types include input record nodes, condition judgment nodes, rule parameter nodes, intermediate calculation nodes, aggregation nodes, and output nodes. Dependency edge records must include at least the upstream node identifier, downstream node identifier, and edge type. Edge types include data reading edges, condition triggering edges, and calculation propagation edges.

[0030] When generating system-calculated values, the rule engine reads business records and executes rule nodes according to the rule graph template. For each node executed, the settlement server records the node's input value, output value, and execution status. Whenever a downstream node reads a value from an upstream node or enters a corresponding branch based on the upstream node's judgment result, the corresponding dependent edge is recorded as executed. Branches that do not meet the triggering conditions are retained in the rule graph template, but their nodes and dependent edges are not written into the activity path of this execution instance.

[0031] Taking monetary settlement as an example, the input record node can record the valid sales quantity, the amount received, and the quantity of gifts issued; the condition judgment node can perform policy validity period judgment, applicable object judgment, and sales tier judgment; the rule parameter node can record the single-unit rebate amount, rebate ratio, deduction ratio, and tier threshold; the intermediate calculation node can record the basic rebate amount and the adjusted amount; and the output node records the final system calculated value. The directed connections between nodes reflect the process of data transmission from the input nodes to the output nodes.

[0032] When the verification terminal submits the actual confirmed value, it also submits the settlement object identifier, data type, unit of measurement, source record identifier, and confirmation account identifier. The settlement server verifies whether the data type and unit of measurement of the system-calculated value and the actual confirmed value are consistent, and verifies whether the confirmation account has the confirmation authority for the corresponding settlement object. For monetary data, the currency and decimal precision are also verified; for quantity data, the integer attribute is also verified; and for status data, it is also verified whether it belongs to a preset status set. If the verification fails, a field error message is returned, and the discrepancy attribution processing is not initiated.

[0033] When the system-calculated value matches the actual confirmed value, the settlement server generates a consistency status record and associates and saves the system-calculated track and the actual confirmed track. When they do not match, the settlement server uses the actual confirmed value as the target output, reverses the process from the output node of the rule execution graph to determine candidate nodes, then generates candidate replacement values ​​and performs replay calculations. Here, constrained replacement using the actual confirmed value means using the actual confirmed value to determine the target range and the direction of output change, rather than directly writing the actual confirmed value to any upstream node.

[0034] After each candidate change proposal is replayed, the settlement server obtains the replay calculation value. For numerical results, the replay residual is the difference between the replay calculation value and the actual confirmed value; the absolute value of this difference is used when determining whether the tolerance condition is met. For status-based results, the residual is recorded as 0 when the replay result matches the actual confirmed status, and as 1 when they do not. For results containing multiple components, the difference for each component is calculated separately, and the validity of the proposal is determined based on the tolerance condition of each component.

[0035] The settlement server determines the scheme with the minimum objective function value from the valid candidate change schemes and performs necessity verification on its node set to obtain the minimum change node set. The difference attribution certificate at least stores the minimum change node set and the corresponding replay residual; in the subordinate implementation, it also stores the rule version fingerprint, input record hash, node values ​​before and after replacement, and data dependency path. Figure 1 The processing sequence from dual-track numerical comparison, candidate node location, constrained replay to voucher generation is shown.

[0036] Example 2 like Figure 2 As shown, this embodiment illustrates the reverse determination process for candidate nodes. The settlement server establishes a queue of nodes to be visited and a set of visited nodes from the output nodes. Initially, the queue of nodes to be visited only includes output nodes. Each time, one node is taken from the queue, the dependency edges pointing to that node and in the executed state in this calculation are read, and the corresponding upstream nodes are added to the queue; nodes already existing in the set of visited nodes are not visited again. After reversing the access to the input record node or the rule parameter node that allows replacement, the expansion along that branch can be stopped.

[0037] For conditional decision nodes, the settlement server only performs reverse access along the active edges corresponding to the current decision result. Branches that do not meet the conditions are not included in the output dependency subgraph, even if they exist in the rule graph template. For aggregation nodes, the settlement server reads the identifiers of the explicit detail nodes that actually participate in the aggregation, and does not read other records in the same data table that did not participate in this aggregation. After completing the reverse access, the visited nodes and the executed dependency edges constitute the output dependency subgraph.

[0038] The settlement server determines the direction of target change based on the relationship between the system-calculated value and the actual confirmed value. When the actual confirmed value is less than the system-calculated value, the target change direction is to decrease the output; when the actual confirmed value is greater than the system-calculated value, the target change direction is to increase the output. The direction of a node's influence can be written into the node attribute when the rule is published, or it can be determined at runtime based on the node's operation type and upstream and downstream values. Additive terms are usually in the same direction as the output, deduction terms are usually in the opposite direction, the direction of multiplicative terms is determined by the sign of other multipliers, and the direction of conditional nodes is determined by the output range of different branches.

[0039] When the output node is a discrete state node, the settlement server does not perform size comparisons. Instead, it starts from the incoming edge conditions corresponding to the actual confirmed state and performs reverse traversal, retaining the input state nodes, condition judgment nodes, and rule parameter nodes that can switch the current activity path to the target state path. For hierarchical states with a clear hierarchical order, the hierarchical order relationship can be saved in the rule version and converted to an upward or downward direction only when the hierarchical order relationship passes the rule validation; states without a saved hierarchical order relationship are all treated as finite state transition relationships.

[0040] Before determining the direction of a node's influence, the settlement server marks nodes with a monotonicity state based on their operation type, rule expression, and allowed value range. These monotonicity states include monotonically increasing, monotonically decreasing, piecewise monotonic, finitely discrete, and unknown direction. Nodes with mismatched directions are deleted only if the operational relationships along the activity path from the node to the output node can be proven to remain monotonic within their corresponding value range, or if the verified monotonicity attribute has been saved when the rule was published. For nodes containing absolute values, modulo operations, integer operations, lookup tables, nonlinear functions, switchable conditional branches, or nodes whose monotonicity cannot be proven, they are marked as having an unknown direction and retained within the candidate range, without being directly deleted based on interval endpoints or a small number of trial values.

[0041] To determine whether a node could cause its output to enter the target range, the settlement server calculates the output impact range corresponding to the node's allowed change range. Specifically, candidate nodes are assigned lower and upper allowable limits, and propagated along their downstream activity paths to obtain the minimum and maximum output change that the node can cause. If the output impact range does not intersect with the target range formed by the actual confirmed value as the center and a preset tolerance threshold as the radius, the node is deleted.

[0042] For piecewise functions or conditional branch nodes, the allowed value range can be divided into multiple sub-ranges based on the branch threshold, and the output influence range corresponding to each sub-range can be calculated separately. For nodes whose direction cannot be determined by static computational relationships, the settlement server selects two test values ​​closest to the original value within the allowed range and performs a trial replay, determining the influence direction based on the two output changes. The trial replay is only used for candidate screening, and its results are not used as the final attribution evidence for differences.

[0043] For piecewise monotonic nodes, the server reads the branch critical values, rounding boundaries, lookup table boundaries, and known extreme points from the rule expression, divides the allowed value range into multiple monotonic sub-intervals, and calculates the output influence interval for each sub-interval. The union of the influence intervals of all sub-intervals is taken as the output influence range of the node. For finite discrete nodes, the allowed value set is replayed item by item. For numerical nodes with unknown direction and finite precision, the allowed interval is discretized according to the rule precision and then conservative enumeration is performed, or interval operations that can give the upper and lower bounds of the output envelope are used. The node is not deleted until a reliable envelope that can exclude the target interval is obtained. The two test values ​​close to the original value mentioned above are only used to estimate the priority search direction and the order of test values, and are not the sole basis for deleting nodes with unknown direction. For example, when the output relationship is y=(x-5)² and the allowed interval of x is 0 to 10, the output of both endpoints is 25, while the output of x=5 within the interval is 0. The server should segment or retain the node at the extreme point and enumerate it with finite precision, and should not delete it based solely on the endpoint results.

[0044] For example, the output dependency subgraph includes nodes N1 to N8: N1 is the effective sales quantity, N2 is the rebate amount per unit, N3 is the basic rebate amount, N4 is the quarterly coefficient, N5 is the adjusted amount, N6 is the deduction amount, N7 is the settlement amount, and N8 is the output node. The activity path is N1 and N2 pointing to N3, N3 and N4 pointing to N5, N5 and N6 pointing to N7, and N7 pointing to N8. Special model reward branches that have not been triggered are not within this subgraph.

[0045] If the system calculates a value of 5000 yuan and the actual confirmed value is 4800 yuan, the target change direction is to reduce the output. N4 is marked as a read-only parameter in the rule version and therefore is not a node allowed to be replaced; N1 is allowed to change from 10 to 9, with an output impact of a decrease of 500 yuan; N2 is allowed to change from 500 yuan to 480 yuan, with an output impact covering a decrease from 0 yuan to 200 yuan; N6 is allowed to increase from 0 yuan to 200 yuan, with an output impact covering a decrease from 0 yuan to 200 yuan. The settlement server retains N1, N2, and N6 as candidate nodes.

[0046] The candidate node selection results include node identifier, node type, original value, allowed change range, direction of influence, and output influence range. This information serves as input for the candidate replacement value generation stage. By processing only the activity path and deleting nodes whose influence range does not intersect with the target range, rule branches and business records irrelevant to the current difference can be excluded before replay.

[0047] The settlement server also establishes interaction relationships between candidate nodes based on common downstream condition nodes, shared multiplication nodes, proportional nodes, aggregation nodes, and the same upstream and downstream consistency expressions. Only when multiple nodes change together to trigger a branch or act together to bring the output into the target interval are the corresponding nodes identified as a coupled node group. Nodes in a coupled node group cannot be deleted one by one based solely on the output influence interval of a single node. The server generates joint replacement schemes on a node group basis and performs combined searches within the group according to the finite value range, discrete precision, and consistency constraints of each node. Single-node directional pruning is only allowed when it can be proven, based on the rule topology and expression, that a node is independent of other candidate nodes from the output.

[0048] Example 3 like Figure 3As shown, this embodiment illustrates the method for determining constrained replacement, replay calculation, and the minimum set of changed nodes. The settlement server reads the constraint description for each candidate node. The constraint description includes data type, lower allowable limit, upper allowable limit, discrete value set, numerical precision, whether replacement is allowed, source record requirements, time range, and upstream / downstream consistency conditions. Read-only nodes, nodes lacking necessary source records, or nodes that are not allowed to be tested for replacement in historical versions do not generate candidate replacement values.

[0049] For addition or deduction nodes, the settlement server calculates the priority test value in reverse based on the current difference and the transfer coefficient from that node to the output node; for multiplication nodes, while keeping other multipliers at their original values, the priority test value is calculated in reverse based on the product relationship between the actual confirmed value and other multipliers; for ratio, quantity, and amount nodes, the reverse calculation result is rounded to the node precision and restricted to the allowed change range; for enumeration nodes and condition nodes, test values ​​are generated item by item according to the allowed value set.

[0050] If the priority test value of a candidate node cannot make the replay residual meet the tolerance condition, the settlement server generates an adjacent test value along the allowed change direction. Amount nodes can increase in precision by the smallest currency unit or according to rules, quantity nodes by integers, and proportion nodes by the precision of rule parameters. To avoid traversing the entire interval, the subsequent search interval can be narrowed based on the sign and magnitude of the previous replay residual until the allowed boundary is reached or the tolerance condition is met.

[0051] To ensure the candidate replacement value search has a definite termination condition, each allowed replacement node stores a finite value range and discrete precision: amount nodes use the smallest monetary unit or rule precision as the step size, quantity nodes use integers or the smallest unit of measurement as the step size, proportion nodes use rule parameter precision as the step size, and enumeration nodes and state nodes use a finite set of values. Continuous numerical nodes with unknown directions are converted into a set of candidate values ​​with upper and lower bounds and finite precision before entering this method. The settlement server performs a full enumeration of the above finite candidate values, or uses a branch and bound search with verifiable pruning conditions, so that the search for each candidate node or coupled node group can be completed within a finite number of steps.

[0052] Consistency checks between upstream and downstream processes are performed before test values ​​are written to the replay copy. For example, the number of valid sales must not exceed the number of sales records that meet the activity path conditions; the number of gifts issued must not exceed the inventory or available quantity; the currency of the received amount should be consistent with the currency of the settlement rules; the business transaction time should be within the valid period of the original rule version; when switching a condition node to another branch, the input fields required by that branch must be complete. Test values ​​that fail the checks are deleted directly.

[0053] Candidate change schemes are generated incrementally based on the number of nodes. The settlement server first executes single-node schemes; if no scheme with residuals meeting the tolerance conditions is obtained, a two-node scheme is generated, and the number of nodes is increased in the same way thereafter. When generating multi-node schemes, node combinations that are determined not to cover the target interval are no longer expanded; expansion of a combination can also be stopped if the cumulative preset change cost of a certain combination is higher than the current effective scheme. This process is search space pruning and does not change the comparison rules of the objective function.

[0054] When using branch and bound search, branch expansion is terminated only when the lower bound of the number of nodes in the current branch, the lower bound of the preset change cost, or the output influence envelope has proven that the branch cannot satisfy the tolerance condition or is not superior to the current effective solution. The pruning criteria for determining the minimum set of changed nodes are not based on empirical maximum number of attempts, the results of two trial values, or unproven single-node directions. For solutions containing coupled node groups, the output influence envelope is calculated based on the joint value within the group, rather than simply adding the individual influence quantities of each node.

[0055] Each candidate change scheme corresponds to one independent replay copy. The replay copy saves the rule version identifier, input record snapshot reference, candidate node identifier, and test replacement value. The settlement server determines the dirty node set based on the replaced node. The dirty node set includes the replaced node and all its downstream nodes. During replay, only the nodes in the dirty node set are re-executed according to the topological order of the rule execution graph. Unaffected nodes directly read the intermediate values ​​saved in the original calculation process.

[0056] When a test replacement value for a condition node causes a change in the active branch, the settlement server cancels the active state of the downstream nodes of the original branch and adds the nodes in the new branch that meet the input conditions to the dirty node set. If the input record required by the new branch does not exist in the original input record snapshot, the candidate solution fails the verification and is not replayed. When an aggregation node is re-executed, only the detailed records associated with the dirty nodes and the aggregation results that remain unchanged in the original snapshot are read, avoiding a rescan of the entire historical record.

[0057] The replay process uses the original rule version and the original input record snapshot, and does not call external parameters that change over time. If the rule requires the use of exchange rates, rates, or regional configurations, the parameter values ​​used in this calculation are saved in the original input record snapshot, and these saved values ​​are read during replay. If the replay task times out, the rule expression is abnormal, or an input field is missing, the candidate solution is marked as a replay failure, and the objective function is not calculated based on the failure result.

[0058] The preset tolerance threshold is set according to the output type. Amount-type results can be set to 0.01 yuan, 1 yuan, or the same rounding precision as the original settlement rules; quantity-type results are usually set to 0, but can be set to 1 minimum unit of measurement when there are rounding operations; proportional-type results are set according to the precision of the rule parameters; status-type results only meet the tolerance condition when the status is completely consistent. The tolerance threshold is saved along with the settlement object type and rule version for future reproduction.

[0059] Node constraints, tolerances, and costs are stored in a versioned configuration table. Each configuration entry includes at least the output type, node type, allowed replacement flag, allowed lower and upper limits, discrete precision or enumeration set, tolerance threshold, preset change cost, read-only condition, and effective rule version. When the difference attribution task starts, the corresponding configuration copy is frozen; if any candidate node lacks the necessary allowed range, discrete precision, enumeration set, or state transition condition, the node is not considered minimal, but rather marked as an insufficiently constrained node, and the missing item is written into the termination reason.

[0060] The objective function can be compared using a hierarchical approach. The first level compares the number of nodes in each candidate change plan, prioritizing plans with fewer nodes. The second level compares the sum of the preset change costs for each node when the number of nodes is the same, prioritizing plans with a smaller sum. The third level compares the absolute values ​​of the replay residuals when the first two levels are identical, prioritizing plans with smaller residuals. Using this approach, the objective function value is composed of these three items in a fixed order, eliminating the need to forcibly add different units together.

[0061] The preset change cost is determined by the node type, data source, and modification risk. For example, input record nodes supported by original vouchers can be set to a lower cost, rule parameter nodes that require changes to formal policy parameters can be set to a higher cost, and nodes locked by the rule version are not included in the comparison. A weighted approach can also be used to calculate the objective function value, but all weights, node costs, and the order of processing parallel schemes should be determined before replay execution and saved in association with the rule version.

[0062] After obtaining the candidate change scheme with the minimum objective function value, the settlement server performs necessity verification. It sequentially restores one node in the set to its original value, and replays the process while maintaining the test replacement values ​​for the remaining nodes. If the residual after restoration still meets the tolerance condition, the node is deleted; if the residual after restoration exceeds the tolerance threshold, the node is retained. This process is repeated for the remaining nodes until restoring any node would cause the residual to fail to meet the tolerance condition.

[0063] When all allowed candidate values ​​and node combinations satisfying the constraints have been checked, or the branch and bound process has proven that it is impossible to obtain a better objective function value without checking the branches, the determined solution is the optimal objective function solution within the current rule version, input record snapshot, and allowed replacement domain. Subsequently, the necessity of each node in the set is confirmed by node-by-node recovery verification. If the task is terminated prematurely due to timeout, resource constraints, lack of necessary value boundaries or discrete precision, inability to complete non-monotonic interval analysis, or inability to complete coupled node combination checks, the attribution result is marked as undetermined, the checked range and termination reason are saved, and the currently obtained locally better solution is not recorded as the minimum change node set.

[0064] The minimum set of changed nodes referred to in this paper refers to the minimum set of interpretations obtained according to the predetermined objective function within the current rule version, the current input record snapshot, the recorded activity dependency subgraph, and the allowed replacement domains of each candidate node. It does not represent a global exhaustive search for unknown inputs outside the rule base, unsaved historical versions, or unauthorized replacement nodes. The difference attribution certificate synchronously records the above boundary conditions; when the boundary conditions are incomplete or the search terminates prematurely, the output is indeterminate and the current locally optimal solution is not used to replace the minimum set of changed nodes.

[0065] Taking the difference between 5000 yuan and 4800 yuan as an example, candidate solution A replaces N2 from 500 yuan to 480 yuan, and the replay calculation value is 4800 yuan; candidate solution B replaces N6 from 0 yuan to 200 yuan, and the replay calculation value is 4800 yuan; candidate solution C replaces N1 from 10 to 9, and the replay calculation value is 4500 yuan. Solution C does not meet the tolerance condition. If N2 is a formal rule parameter with a preset cost of 8, and N6 is the deduction amount with a preset cost of 2, then the objective function value of solution B is better than that of solution A, and the minimum set of changed nodes is {N6}.

[0066] If two nodes are required for the replay output to enter the target range (e.g., a quantity node can only reduce the price by 120 yuan, and a deduction node can only reduce the price by 80 yuan), the settlement server generates a candidate change plan that includes both nodes. During verification, restoring either node would cause the residual to exceed the tolerance threshold; therefore, both nodes are retained. The minimum set of change nodes represents the minimum interpretable range that satisfies the constraints and objective function, and does not directly assume that the original rule or business record is necessarily wrong.

[0067] The data structure of candidate change schemes includes scheme identifiers, a list of candidate nodes, test replacement values ​​for each node, constraint verification status, replay task status, replay calculated values, and replay residuals. When generating scheme identifiers, they are sorted according to the candidate node identifiers to avoid duplicate schemes due to different arrangement orders for the same node combination. The settlement server establishes a set of generated schemes. If the node combination and test replacement values ​​of a new scheme are the same as existing schemes in the set, a replay task is not created. For schemes with the same node combination but different test replacement values, their scheme identifiers and residuals are retained separately to compare the impact of different test values ​​on the output.

[0068] Rule execution graphs are typically executed as directed acyclic graphs. When business policy rules include loop accumulation, item-by-item traversal, or batch aggregation operations, the rule engine expands each iteration into nodes with iteration numbers in the current execution instance, or encapsulates the loop body into aggregate nodes with defined inputs and outputs. During replay, the iteration count and detailed record range from the original execution instance are read, and subsequent iteration nodes are redefined only when candidate replacement values ​​cause changes in the loop termination condition. This provides a definite topology execution order and prevents the replay process from failing to terminate due to ambiguous loop conditions.

[0069] For aggregation nodes involving multiple business records, the settlement server stores the contribution value of each detailed record to the aggregation result. When there is a difference between the actual confirmed value and the system calculated value, detailed candidate nodes can be generated based on the contribution value, record time, or record reliability level. For example, if the aggregated amount needs to be reduced by 200 yuan, first retrieve a single record with a contribution amount close to 200 yuan, then retrieve a combination of two or more records whose sum of contribution values ​​is close to 200 yuan. Candidate combinations still need to meet the constraints of activity path, source record, and time range; they cannot be considered valid solutions solely because the amounts are equal.

[0070] To ensure the repeatability of the objective function comparison process, the settlement server reads and freezes the node cost table, tolerance configuration, and parallel scheme priority when initiating the difference attribution task. Even if the above configurations are modified in the background during task execution, the frozen copy is still used in this task. The difference attribution voucher records the version identifier of the configuration used. The same configuration version is loaded during subsequent reproduction, so that the same rule version, the same input record snapshot, and the same actual confirmation value correspond to the same candidate scheme ranking results.

[0071] Example 4 This embodiment illustrates the binding method of rule versions, input records, and difference attribution vouchers. The settlement server normalizes the conditional expressions, calculation expressions, parameter sets, node topology, and version number in the rule version. Normalization includes standardizing field order, standardizing numerical precision, removing whitespace characters that do not affect execution, and fixing character encoding. A digest calculation is performed on the normalization result to obtain the rule version fingerprint. The digest algorithm can be SM3, SHA-256, or an algorithm with equivalent digest verification capabilities.

[0072] The input record snapshot saves the actual record identifier, record version, key field values, and read time read when the system calculates values. For databases that can save historical versions, the data version number and record identifier can be recorded in the snapshot; for storage systems that do not save complete historical records, the key field values ​​involved in the calculation should be saved during the first calculation. After sorting by record identifier and field name, a summary calculation is performed on the snapshot content to obtain the input record hash.

[0073] The isolated replay container loads rule version snapshots and input record snapshots in read-only mode, and writes test replacement values ​​to a temporary storage area. The isolated replay container can be a standalone process, a container instance, a sandbox environment, or a rule engine instance isolated from the online billing task. The replay task does not have write permissions to modify the official rule base and business data storage area. After the task ends, the temporary test values ​​are cleaned up, but the replay results and running status are retained.

[0074] The settlement server generates a replay request identifier based on the settlement object identifier, rule version identifier, input record hash, candidate node identifier, and test replacement value. Identical replay request identifiers indicate identical replay input conditions. Upon receiving a duplicate request, if a replay task has already been completed and the result verification passed, the result is returned directly; if a task is already in progress, the task status is returned or the server waits for the task to complete; if a task has failed, the server determines whether to re-execute based on the failure type.

[0075] The discrepancy attribution voucher should include at least the settlement object identifier, system-calculated value, actual confirmed value, minimum set of changed nodes, corresponding replay calculated value, and replay residual. To support complete review, it may also include the rule version identifier, rule version fingerprint, input record hash, node type, value before replacement, value after replacement, data dependency path, preset tolerance threshold, objective function comparison result, voucher generation time, and replay task status.

[0076] When generating a voucher, the settlement server serializes the field names, field types, and field values ​​according to a preset field order. Numerical values ​​use fixed precision, time uses a unified time zone and format, null values ​​use a fixed marker, and the node set is sorted according to the node identifier. A digest calculation is performed on the serialization result to obtain the voucher digest. When reading a voucher, the digest is recalculated according to the same rules and compared with the saved voucher digest; if the two are inconsistent, the voucher is marked as verification failed.

[0077] After authorized personnel confirm that the actual confirmed value is used for this settlement, the settlement server generates a settlement release record and associates it with the difference attribution voucher. The settlement release record saves the actual confirmed value, the confirming account identifier, the confirmation time, and the release status. The system-calculated value, the original rule version identifier, and the original input record snapshot remain read-only. The calculation results of the new rule version are recorded separately and do not overwrite the original difference voucher.

[0078] When historical discrepancies need to be reproduced, the settlement server first verifies the rule version fingerprint and input record hash, then loads the corresponding snapshot and minimum change node set, and performs replay according to the test replacement values ​​in the voucher. If the re-obtained replay calculation value and replay residual match the voucher record, the reproduction is successful; otherwise, the server outputs the verification results of the rule snapshot, input snapshot, replay program version, and voucher fields to pinpoint the reason for the reproduction failure.

[0079] Example 5 This example illustrates the processing methods for different output types, combining vehicle sales rebates and gift settlements. A settlement object has 10 vehicle sales records within one settlement cycle. Rule version V1 stipulates that: sales records are counted as valid sales quantity when the vehicle model, sales time, and payment status meet certain conditions; the basic rebate amount is obtained by multiplying the valid sales quantity by the rebate amount per vehicle; the adjusted amount is obtained by multiplying the basic rebate amount by a quarterly coefficient; the final settlement amount is the adjusted amount minus the deducted amount.

[0080] The settlement server reads 10 sales records and corresponding payment records, generating an input record node; it performs checks on policy validity period, vehicle model, and payment status, generating a condition judgment node; it reads the single-unit rebate amount, quarterly coefficient, and deduction amount, generating a rule parameter node; it generates nodes for valid sales quantity, basic rebate amount, and adjusted amount; finally, it outputs a system-calculated value of 5000 yuan. The verification terminal submits an actual confirmed value of 4800 yuan based on the receipt voucher.

[0081] The settlement server accesses the activity path in reverse from the output node, deleting any untriggered special vehicle reward branches and cross-regional reward branches. The quarterly coefficient node is read-only in V1 and is not listed as a candidate node. The effective sales quantity is allowed to vary between 9 and 10, the single-unit rebate amount is allowed to vary between 480 and 500 yuan, and the deduction amount is allowed to vary between 0 and 200 yuan. The output impact ranges of these three nodes all intersect with the target range.

[0082] Single-node replay yields three candidate schemes: setting the rebate amount per unit to 480 yuan results in a replay value of 4800 yuan; setting the deduction amount to 200 yuan also results in a replay value of 4800 yuan; and setting the effective sales quantity to 9 results in a replay value of 4500 yuan. With a tolerance threshold of 0.01 yuan, the first two schemes are valid. After comparing the number of nodes, preset change costs, and absolute residual values, the node with the lowest preset cost and supported by received deduction vouchers is selected.

[0083] The settlement server resets the deduction amount node to 0 yuan for necessity verification, replays the calculated value to 5000 yuan, and since the residual exceeds the tolerance threshold, this node is retained. The difference attribution voucher records the node identifier, the value before replacement (0 yuan), the value after replacement (200 yuan), the replay calculated value (4800 yuan), the replay residual (0 yuan), the rule version fingerprint of rule version V1, and the hash of this input record. After settlement is approved, the system retains the original system calculated value of 5000 yuan.

[0084] For the settlement of the number of free gifts, the system calculates 10 items, the actual confirmed number is 9 items, and the tolerance threshold is set to 0. The output dependency subgraph includes the effective sales quantity node, the free gift ratio node, the rounding node, and the free gift quantity output node. Candidate replacement values ​​must be values ​​that meet integer constraints or ratio precision. If adjusting the effective sales quantity from 100 to 90 yields 9 items, and adjusting the free gift ratio from 10% to 9% also yields 9 items, then the option with the smaller objective function value is selected based on the input record trust level, node permissions, and preset change cost.

[0085] For status-based settlement results, such as a system-calculated status of "Pending Settlement" and an actual confirmed status of "Release Acceptable," the settlement server accesses the condition judgment nodes and input status nodes that affect the status output. Candidate replacement values ​​are selected from a preset set of statuses, and the residual is 0 only when the replayed status matches the actual confirmed status. If any candidate change scheme that satisfies the constraints cannot obtain an actual confirmed status, the attribution result is marked as undetermined, no false minimum change node set is generated, and the checked candidate range and replay failure reasons are saved.

[0086] When an uncertain state occurs, authorized personnel can supplement the missing source records or add new rule versions that allow testing, and then re-initiate the difference attribution. When re-initiating, a new input record snapshot or rule version identifier is used, and a new replay request identifier is generated; the original replay task, the original difference state, and the original voucher verification information are retained. This process avoids forcibly obtaining a replay result consistent with the actual confirmed value by modifying historical records.

[0087] The above method can be deployed on a single server or executed collaboratively by a rule engine server, graph computation service, replay service, and credential storage service. The processor loads the rule execution graph construction program, reverse traversal program, constraint verification program, replay program, and credential generation program from memory to complete the steps described in the claims. The settlement object identifier, rule version identifier, and replay request identifier transmitted between the services are used to associate the same difference attribution task.

[0088] The above embodiments provide specific implementation methods for the data structure of the rule execution graph, reverse screening of candidate nodes, generation of candidate replacement values, constraint verification, partial replay, residual judgment, objective function comparison, minimum set verification, and difference attribution voucher verification. Those skilled in the art can configure corresponding nodes, value ranges, and tolerance conditions according to the data type of the settlement result and the operating policy rules, without changing the processing mechanism of this application that drives constrained replay to form a minimum set of changed nodes based on the output target.

[0089] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A method for dual-track review and discrepancy tracking of policy settlement, characterized in that, The method includes: Obtain the system-calculated value and the actual confirmed value; When the system-calculated value is inconsistent with the actual confirmed value, candidate nodes are determined in reverse from the output node of the preset rule execution graph along the data dependency relationship. The candidate nodes are subjected to constrained replacement and replay calculations based on the actual confirmed values ​​to obtain replay residuals, and the minimum set of changed nodes is determined based on the replay residuals. Encapsulate the minimum set of changed nodes and the replay residuals into a difference attribution certificate; The constrained replacement is configured with test replacement values ​​for candidate nodes based on the data type constraints of the candidate nodes. The minimum change node set is the set of candidate nodes included in the candidate change scheme that minimizes the objective function value among multiple candidate change schemes where the replay residuals meet the preset tolerance conditions.

2. The method for dual-track review and discrepancy tracking of policy settlement according to claim 1, characterized in that, The step of determining candidate nodes by reversely tracing data dependencies from the output nodes of the preset rule execution graph includes: Traverse the executed dependency edges corresponding to the current system calculation value from the output node in reverse order, remove branches that were not triggered by the current calculation, and form an output dependency subgraph; Based on the direction of the difference between the system-calculated value and the actual confirmed value, the changeable direction and allowable change range of each upstream node are determined; Nodes whose changeable direction does not match the difference direction are deleted, and the remaining upstream nodes are identified as candidate nodes.

3. The method for dual-track review and discrepancy tracking of policy settlement according to claim 2, characterized in that, The step of performing constrained replacement and replay calculations on the candidate nodes using the actual confirmed values ​​to obtain the replay residuals includes: Candidate replacement values ​​are generated based on the difference and the allowable change range of each candidate node; Propagate node data types, value ranges, rule versions, and upstream and downstream consistency constraints along the output dependency subgraph, and delete candidate replacement values ​​that do not satisfy the constraints; Write the remaining candidate replacement values ​​into an independent replay copy, re-execute the replaced node and its downstream nodes according to the original rule version, and reuse the intermediate calculation results of the unaffected nodes to obtain the replay calculation values. The difference between the calculated replay value and the actual confirmed value is determined as the replay residual.

4. The method for dual-track review and discrepancy tracking of policy settlement according to claim 3, characterized in that, The determination of the minimum set of changed nodes based on replay residuals includes: Multiple candidate change schemes are generated based on the combination of change nodes, and candidate change schemes whose absolute value of replay residual is not greater than the preset tolerance threshold are retained. The objective function value is determined based on the number of change nodes included in each candidate change scheme and the preset change cost corresponding to each change node. The candidate nodes included in the candidate change scheme with the smallest objective function value are determined as the minimum change node set.

5. The method for dual-track review and discrepancy tracking of policy settlement according to claim 4, characterized in that, After determining the minimum set of change nodes, the method further includes: One node in the minimum changed node set is restored to its original value before replacement, and verification replay is performed. When the absolute value of the restored replay residual is still not greater than the preset tolerance threshold, the node is deleted from the minimum change node set and the verification replay continues until the absolute value of the replay residual is greater than the preset tolerance threshold when any remaining node is restored.

6. The method for dual-track review and discrepancy tracking of policy settlement according to claim 1, characterized in that, The preset rule execution graph includes input record nodes, condition judgment nodes, rule parameter nodes, intermediate calculation nodes, and output nodes. During the generation of the system's calculated value, the data reading relationship, condition triggering relationship, and calculation transmission relationship between each node are recorded, and the executed nodes corresponding to this calculation and the relationship between the nodes are bound to the rule version identifier used in this settlement.

7. The method for dual-track review and discrepancy tracking of policy settlement according to claim 6, characterized in that, The replay calculation is performed in an isolated replay container corresponding to the rule version identifier; the isolated replay container loads the input record snapshot used when generating the system calculation value, and generates a replay request identifier based on the settlement object identifier, rule version identifier and candidate change scheme, so that repeated replay requests with the same replay request identifier can reuse the generated replay results.

8. The method for dual-track review and discrepancy tracking of policy settlement according to any one of claims 1 to 5, characterized in that, The difference attribution voucher is serialized and a summary is calculated according to a preset field order to obtain a voucher summary used to verify the integrity of the difference attribution voucher.

9. A dual-track verification and discrepancy tracking device for policy settlement, comprising a memory, a processor, and a program stored in the memory, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1-8.

10. A storage medium having a program stored thereon, characterized in that, When the program is executed, it implements the method as described in any one of claims 1-8.