Skip to content
Real-Time Non-Tax Fund Tracking via Composite Keys & 3D Cross-Reconciliation

Real-Time Non-Tax Fund Tracking via Composite Keys & 3D Cross-Reconciliation

China Postal Savings Bank details a composite-key-driven graph system with a six-state machine for end-to-end non-tax revenue fund tracking, enabling real-time monitoring, automated unmatched-fund matching via weighted scoring and LLM assistance, and three-dimensional cross-reconciliation across transaction, fund, and account dimensions.

BanTech Think Tank
BanTech Think Tank
BanTech Think Tank

Challenges in Non-Tax Fund Reconciliation and Tracking

Government non-tax revenue is a major component of fiscal income. With the nationwide promotion of unified payment QR codes and the generalization of fiscal electronic payment interfaces, non-tax collection has become fully electronic: payers scan to pay, acquiring institutions confirm transactions, funds transfer across banks, and fiscal special accounts confirm receipt. A single payment flows among four parties — payer, fiscal non-tax system, acquiring institution, and receiving bank — and passes through more than ten types of messages (acquiring confirmation, interbank transfer, clearing allocation instructions, clearing results, fund arrival, etc.) processed by multiple systems in separate stages. While electronic processing improves efficiency, it introduces governance challenges: asynchronous message interaction between systems, data stored separately, inability for any single system to determine the current stage of a fund, and anomaly investigation relying on multi-party joint reconciliation.

As banking digital transformation deepens, fiscal-financial collaboration demands higher standards for fund security, deposit timeliness, and fund transparency. Addressing the industry pain points of "invisible fund flow, reconciliation blind spots, manual aggregation, experience-based handling", this article uses a composite key of "batch number + payment code" to build a full-process fund linkage tracking and three-dimensional cross-reconciliation system covering acquiring, transfer, clearing, arrival, and reconciliation. It breaks the limitations of traditional "end-of-day single-dimension comparison, manual anomaly investigation" and forms a replicable new paradigm for full-chain non-tax fund governance, achieving full observability, traceability, and verifiability.

End-to-End Tracking and Three-Dimensional Cross-Reconciliation: Method and Implementation

The system is designed as a flexible reconciliation framework with a composite key as the link, a linkage graph as the base, and a state machine as the engine, transforming non-tax fund governance from post-hoc verification into a fine-grained engineering process that is fully observable, computable for discrepancies, and closed-loop for handling. The overall architecture is shown in Figure 1.

Figure 1: Overall architecture of non-tax fund full-linkage tracking and three-dimensional cross-reconciliation system
Figure 1: Overall architecture of non-tax fund full-linkage tracking and three-dimensional cross-reconciliation system

1. Composite-Key-Driven Fund Linkage Graph

The nationally unified payment identification code (payment code) and an 18-digit business batch number form a composite key, serving as the minimum association unit linking messages across all stages. Each message is treated as a vertex and the flow relationship between messages as an edge, written incrementally into a directed fund linkage graph using an inverted index and stored partitioned by date. End-of-day reconciliation only scans the current day's partition; historical linkage queries can be precisely located. Linkage attribution follows a three-level progressive judgment: "exact association → payment code association → fuzzy association". Funds that fail judgment are automatically moved to an unmatched fund staging pool for intelligent matching processing.

2. Six-State Machine for Real-Time Fund Stage Determination

The system defines six linkage states for each fund: Initial, Pending Transfer, Transferring, Fund Arrived, Fiscal Confirmed, and Stagnant. State advances only when a message matching the next node is received. Each state has an independent timeout threshold; timeout without transition marks the fund as "Stagnant" and triggers an alert for the corresponding stage. Four anomaly types — linkage interruption, amount inconsistency, duplicate clearing, incomplete linkage — are identified in real time by a detection engine. A full-linkage state dashboard displays real-time counts of total linkages, in-transit, anomalies, stagnant, and unmatched funds, and supports drill-down to specific messages per transaction. Thus, the current stage of a fund can be determined directly from a single system's data without multi-party joint investigation. The state transition relationships are shown in Figure 2.

Figure 2: Six-state machine for fund linkage with timeout stagnation and compensation recovery
Figure 2: Six-state machine for fund linkage with timeout stagnation and compensation recovery

3. Multi-Dimensional Feature Scoring with Penalty Factors for Automated Unmatched Fund Allocation

For arrival funds with missing or unparsable batch numbers, the system constructs a six-dimensional feature vector: amount (weight 0.35), time window (0.20), payer account (0.20), payee account (0.10), administrative division (0.10), channel (0.05). Weights can be derived from historical case regression or configured by business experts. A weighted scoring model with penalty factors computes a confidence score against candidate transaction records: confidence ≥ 0.85 → automatic posting; 0.60–0.85 → suggested match for manual confirmation; < 0.60 → routed to a large language model (LLM) assisted matching channel. Unmatched funds in the staging pool are retried in rounds — immediate on arrival, end-of-day, T+1, T+N — with progressively expanded time windows. Retry scheduling uses a min-heap; record identifiers ensure idempotence. The entire matching process is fully recomputable and traceable; consistency of results does not depend on operator experience.

4. Three-Dimensional Cross-Reconciliation to Eliminate Single-Dimension Blind Spots

At end-of-day, three heterogeneous message sets — transaction flow, arrival funds, account funds — are uniformly mapped under the composite key primary key. Set operations directly identify three discrepancy categories: "transaction without funds", "funds without transaction", "account-reality mismatch". Through the composite key inverted index, discrepancies are traced back to specific message nodes in the linkage graph, enabling not only detection but also precise localization to the exact message node and business stage. The three-dimensional cross-verification model is illustrated in Figure 3.

Figure 3: Three-dimensional cross-verification model
Figure 3: Three-dimensional cross-verification model

5. LLM Integration for Knowledge-Driven Discrepancy Attribution

Historical discrepancy cases, handling rules, and message prior information are structured into a knowledge base. Retrieval-augmented generation provides the LLM with similar case context to assist in generating attribution conclusions and handling suggestions. The model output serves only as candidate suggestions, which must pass rule-engine validation and manual confirmation before changing linkage state. If the model service is unavailable, the system automatically falls back to rule matching and edit-distance matching without blocking end-of-day processing. A three-level consistency assurance mechanism — "pre-warning, in-process monitoring, post-verification" — unifies alert thresholds with state machine timeouts; automatic compensation operations use idempotent keys to suppress duplicate execution, forming a closed loop from payment to reconciliation.

Core Innovations

From post-hoc manual audit to full-process real-time monitoring. The composite key linkage graph combined with the six-state machine makes the fund flow process fully stateful and visualizable; anomalies are identified and alerted at the onset of stagnation, not discovered only at end-of-day reconciliation.

From single-dimension reconciliation to three-dimensional cross-verification. Three reconciliation message sets are normalized to the same primary key and set operations directly yield the three discrepancy types that single-dimension comparison struggles to detect, with drill-down to specific message nodes.

From manual comparison to computable matching and model assistance. Unmatched fund allocation is handled by a six-dimensional scoring model; difficult scenarios use LLM to parse message semantics, combined with a tiered progressive multi-round retry, balancing automation level and matching accuracy.

From experience-driven to rule-and-case-driven closed-loop handling. Discrepancies are graded by severity: auto-handled ones are automatically compensated; those needing attribution receive knowledge-base suggestions with manual confirmation; major errors trigger joint investigation. Handling results are written back to the linkage graph and沉淀 as cases for reuse, continuously enhancing handling capability.

Application Results and Reusability

The solution underwent technical validation using message specifications and desensitized historical payment flows from a provincial non-tax revenue electronic collection project. Approximately 120,000 payment linkage samples were constructed covering all message types and four business modes: query-payment, push, transfer-payment, and clearing. Validation results: the linkage graph fully covered all fund flow paths under the four business modes; the state machine triggered corresponding alerts for all injected out-of-order and lost message samples; three-dimensional cross-verification detected all three injected anomaly types, with each discrepancy correctly traced to the specific message node; intelligent matching of unmatched funds achieved a first-match success rate above 85%, reaching above 95% after multi-round retries, with zero mis-posting during validation.

Fiscal-financial collaboration value: Fund in-transit, stagnant, and unmatched states are fully observable, shortening fiscal deposit latency, reducing manual investigation costs for unmatched funds, and providing a unified, trusted data view for reconciliation collaboration between fiscal departments and agent banks.

Cross-scenario reuse potential: The framework of "composite key linking linkage + state machine monitoring + multi-dimensional cross-reconciliation" is highly generic. With minor adjustments to composite key and state definitions, it can be reused for social security collection, medical insurance settlement, tuition collection, electronic toll collection (ETC) clearing, and other "multi-party, multi-message, asynchronous flow" fund scenarios, and can serve as a technical foundation for fiscal fund monitoring platforms.

Future Outlook

As non-tax revenue collection electronicization advances, full observability, traceability, and verifiability of non-tax fund linkages have become an important foundation for digital fiscal-financial collaboration. The full-linkage tracking and three-dimensional cross-reconciliation technology based on batch number and payment code provides a reusable technical path for solving cross-system fund governance challenges. Future work will continue iterating the linkage graph and state machine engine, deepening LLM application in message semantic parsing and discrepancy attribution, exploring extension of three-dimensional reconciliation to "transaction-fund-account-budget execution" multi-dimensional verification, and promoting the system's deployment in more fiscal fund scenarios to provide technical support for secure and efficient fiscal fund flow.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

reconciliationgraph databasestate machinelarge language modelbanking technologycomposite keycross-reconciliationfund trackingnon-tax revenueweighted scoring
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.