A method and system for triggering a release of escrow funds based on order state machine node
By using a fund custody release method based on order state machine nodes, an immutable snapshot is created and fund flow is atomically written as the order state machine progresses. This solves the problem of mismatch between the fund release time and the fulfillment node in B2B transactions, realizes the automation and consistency of the fund custody release process, and improves the efficiency and accuracy of reconciliation.
Patent Information
- Application Number
- CN202611313590.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-11-20
AI Technical Summary
In B2B transactions, the existing fund escrow release mechanism is prone to mismatch between the timing of fund release and the performance node, and the escrow payment records are inconsistent with the fund flow. Moreover, the reliance on manual reconciliation leads to a large workload and is prone to errors.
The method of triggering fund escrow release based on order state machine nodes creates multiple escrow payment records according to the payment milestones of the order contract and stores an immutable snapshot at the time of creation. When the order state machine advances to the associated node, it atomically writes the state change and fund flow and performs accounting invariant verification to maintain consistency.
It achieves automatic alignment between the timing of fund release and the performance milestones, avoiding mismatches, ensuring that subsequent account changes do not affect audit traceability, and maintaining consistency between records and transaction logs, thereby improving reconciliation efficiency and accuracy.
Smart Images

Figure CN123140952A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method and system for triggering the release of escrow funds based on order state machine nodes. Background Technology
[0002] In B2B transactions, buyer payments are often made in stages, such as an initial deposit, a final payment after production, and a warranty deposit upon acceptance. To ensure transaction security, funds at each stage are typically held in escrow by a third-party account and released only after the corresponding fulfillment milestones are reached. However, in existing escrow release mechanisms, the release time and fulfillment milestones are manually compared, which can easily lead to mismatches; escrow payment records only reference the receiving account without keeping a snapshot, making it difficult to trace the original payment destination when the account is changed later; changes in the status of escrow payment records and fund flows are not atomically written, making inconsistencies likely, and the same escrow payment may be recorded multiple times; the consistency between escrow records and fund flows relies on manual reconciliation, which is labor-intensive and prone to errors. Summary of the Invention
[0003] In view of this, the purpose of this invention is to propose a method and system for triggering the release of escrow funds based on order state machine nodes.
[0004] To achieve the above-mentioned technical objectives, the technical solution adopted by this invention is as follows: In a first aspect, the present invention provides a method for triggering the release of escrow funds based on an order state machine node, comprising: Based on the payment milestones of the order contract, multiple escrow payment records are created for the order corresponding to each payment milestone. Each escrow payment record is associated with the order state machine node on which its release is triggered. When creating an escrow payment record, the receiving account information is stored with the escrow payment record as an immutable snapshot. When the order state machine advances to the node associated with a certain escrow payment record, it triggers the release of the escrow payment. The state change written atomically to the escrow payment record within the same database transaction is released along with an immutable cash flow, and the cash flow is associated with the escrow payment record with a unique cash flow identifier. Perform accounting invariant checks on escrow payment records and immutable cash flow to ensure consistency between the two.
[0005] In some embodiments, multiple escrow payment records are created for an order based on payment milestones in the order contract, corresponding to each payment milestone, including: Create separate escrow payment records for the deposit, final payment, and warranty deposit in the payment milestones. Each escrow payment record is associated with the order state machine node on which its release is triggered. The deposit is associated with the order placement node, the final payment with the shipment node, and the warranty deposit with the receipt node or a node that has elapsed for a preset period since receipt. When creating an escrow payment record, the receiving account information is copied as an immutable snapshot at creation time, and the immutable snapshot is persistently stored with the escrow payment record.
[0006] In some embodiments, when creating an escrow payment record, the receiving account information is copied as an immutable snapshot at creation time, and the immutable snapshot is persistently stored with the escrow payment record, including: While creating the escrow payment record in the database transaction, the account name, account number and account opening institution in the payee account information are copied as an immutable snapshot. The immutable snapshot is persistently stored in the same data row as an auxiliary field of the escrow payment record. Once the escrow payment record is created, any modifications to the receiving account information will not alter the stored immutable snapshot, allowing for audit traceability by restoring the destination of the payment at the time the escrow payment record was created based on the immutable snapshot.
[0007] In some embodiments, after the escrow payment record is created, any modification to the receiving account information does not alter the stored immutable snapshot, enabling audit traceability to reconstruct the destination of the payment at the time of the escrow payment record creation based on the immutable snapshot, including: Immutable snapshots are independent of real-time data storage of receiving account information. Once the escrow payment record is created, the immutable snapshot is marked as read-only. Any update operation on the receiving account information will affect the real-time data and will not touch the immutable snapshot. During audit tracing, the audit system retrieves an immutable snapshot based on the unique identifier of the escrow payment record, extracts the account name, account number, and account opening institution from the immutable snapshot, and restores the destination of the payment at the time the escrow payment record was created. Audit tracing does not depend on the current state of the receiving account information.
[0008] In some embodiments, when the order state machine progresses to the node associated with an escrow payment record, the release of that escrow payment is triggered, including: Apply concurrent locking to the release processing of the same escrow payment record, ensuring that the release of the escrow payment is processed at most once, to prevent duplicate releases caused by concurrent triggering; The writing of fund flow records is protected by uniqueness constraints, which use the unique constraint of the business reference number in the incomplete state to prevent the same fund flow record from being submitted repeatedly.
[0009] In some embodiments, the method further includes: The release conditions associated with the escrow payment record are stored in a programmable predicate expression. The programmable predicate expression takes at least one of the following as input: the current state of the order state machine, the quality inspection result, and the external document. It is evaluated when the order state machine advances to the associated node. If the programmable predicate expression is true, the release of the escrow payment is triggered. Programmable predicate expressions are stored in the release condition field of the escrow payment record in a configurable form. Programmable predicate expressions support the combination of multiple input conditions by logical operators. Input conditions include the node status value of the order state machine, the pass flag of the quality inspection result, and the receipt confirmation flag of the external document. The programmable predicate expression is invoked when the order state machine advances to the associated node. The evaluation engine of the programmable predicate expression reads the current value of the input condition, performs Boolean operations on the programmable predicate expression, and outputs a true or false value. When the output of the programmable predicate expression is true, the release process of the escrow payment is triggered, and the release process calls the concurrent locking and fund flow writing steps; When the output of the programmable predicate expression is false, the escrow payment record remains unreleased, waiting to be re-evaluated when the order state machine advances to the associated node next time.
[0010] In some embodiments, performing accounting invariant verification on escrow payment records and immutable cash flow includes: The status of each escrow payment record is verified to match the amount and direction of the associated fund flow. Each escrow payment record is in the released state if and only if there is a unique associated fund flow and the amount of the fund flow is equal to the amount of the escrow payment record and the direction of the fund flow matches the direction of the escrow payment record. Perform uniqueness verification on the relationship between each fund flow to ensure that each fund flow is associated with only one escrow payment record. Perform a total amount verification on all escrow payment records for the same order, ensuring that the sum of the amounts in all escrow payment records equals the total contract amount for that order. The accounting invariant verification is performed periodically by an independent task on all escrow payment records and all cash flow. If any verification fails, a reconciliation discrepancy alarm is generated.
[0011] In some embodiments, each escrow payment record is associated with the order state machine node upon which its release is triggered, including: The production node, quality inspection node, shipping node, and receiving node in the order state machine are respectively used as associated nodes for the managed payment record; The release conditions associated with the escrow payment record are stored in a programmable predicate expression. The programmable predicate expression takes at least one of the following as input: the current state of the order state machine, the quality inspection result, and the external document. It is evaluated when the order state machine advances to the associated node. If the programmable predicate expression is true, the release of the escrow payment is triggered.
[0012] In some embodiments, performing accounting invariant verification on escrow payment records and immutable cash flow includes: The status of each escrow payment record is verified to match the amount and direction of the associated fund flow. Each escrow payment record is in the released state if and only if there is a unique associated fund flow and the amount of the fund flow is equal to the amount of the escrow payment record and the direction of the fund flow matches the direction of the escrow payment record. Perform uniqueness verification on the relationship between each fund flow to ensure that each fund flow is associated with only one escrow payment record. Perform a total amount verification on all escrow payment records for the same order, ensuring that the sum of the amounts in all escrow payment records equals the total contract amount for that order. The accounting invariant verification is performed periodically by an independent task on all escrow payment records and all cash flow. If any verification fails, a reconciliation discrepancy alarm is generated.
[0013] In a second aspect, the present invention also provides a system for triggering the release of escrow funds based on an order state machine node, used in the method described in the first aspect, the system comprising: The escrow payment creation unit is used to create multiple escrow payment records for an order based on the payment milestones of the order contract. Each escrow payment record is associated with the order state machine node on which its release is triggered. When creating an escrow payment record, the receiving account information is stored with the escrow payment record as an immutable snapshot. The node-triggered release unit is used to trigger the release of an escrow payment when the order state machine advances to the node associated with a certain escrow payment record; An atomic pipeline unit is used to atomically write the state change of the escrow payment record and an immutable fund flow within the same database transaction, and associate the fund flow with the escrow payment record with a unique flow identifier; The reconciliation and verification unit is used to perform accounting invariant verification on escrow payment records and immutable cash flow records to ensure consistency between the two.
[0014] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art: This invention provides a method for triggering escrow fund release based on order state machine nodes. According to the payment milestones of the order contract, multiple escrow payment records are created for each payment milestone of the order. Each escrow payment record is associated with the order state machine node upon which its release is triggered. When creating an escrow payment record, the receiving account information is stored as an immutable snapshot along with the escrow payment record. When the order state machine advances to the node associated with a certain escrow payment record, the release of that escrow payment is triggered. The release atomically writes the state change of the escrow payment record and an immutable fund flow within the same database transaction, and associates the fund flow with the escrow payment record using a unique flow identifier. Accounting invariant verification is performed on the escrow payment record and the immutable fund flow to ensure consistency between them. By using the order state machine node as the sole trigger for fund release, the timing of fund release automatically aligns with the fulfillment node, avoiding mismatches. By storing the receiving account information in an immutable snapshot, subsequent account changes do not affect the audit traceability of the funds' destination at that time. By atomically writing state changes and fund flows within the same database transaction and associating them with a unique flow identifier, records remain consistent with flows and prevent duplicate entries. By using accounting invariant verification to replace manual reconciliation with programmatic verification, the efficiency and accuracy of reconciliation are improved. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the overall process of the method described in the specific implementation method; Figure 2 This is a schematic diagram illustrating multiple escrow payment records created based on the contractual payment milestone in the specific implementation method. Figure 3 This is a schematic diagram illustrating how, during the creation process, the receiving account is stored as an immutable snapshot along with the record, as described in the specific implementation method. Figure 4 This is a schematic diagram illustrating how the order state machine node advancement triggers the release of corresponding escrow payments, as described in the specific implementation method. Figure 5 This is a schematic diagram illustrating the atomic write state change and immutable fund flow unique association and accounting invariant verification within the same transaction as described in the specific implementation method. Figure 6 This is a schematic diagram of the system described in the specific implementation.
[0017] Figure label: 100. Escrow Payment Creation Unit; 200. Node-triggered release unit; 300, Atomic Flow Unit; 400. Reconciliation and Verification Unit. Detailed Implementation
[0018] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the invention. Similarly, the following embodiments are only some, not all, embodiments of the present invention, and all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Please see Figures 1 to 5 In a first aspect, the present invention provides a method for triggering the release of escrow funds based on an order state machine node, comprising: Based on the payment milestones of the order contract, multiple escrow payment records are created for the order corresponding to each payment milestone. Each escrow payment record is associated with the order state machine node on which its release is triggered. When creating an escrow payment record, the receiving account information is stored with the escrow payment record as an immutable snapshot. When the order state machine advances to the node associated with a certain escrow payment record, it triggers the release of the escrow payment. The state change written atomically to the escrow payment record within the same database transaction is released along with an immutable cash flow, and the cash flow is associated with the escrow payment record with a unique cash flow identifier. Perform accounting invariant checks on escrow payment records and immutable cash flow to ensure consistency between the two.
[0020] In this embodiment, the order contract is established upon agreement between the two parties, clearly defining the various stages of payment, which are known as payment milestones. Based on the payment milestones and their corresponding fund disbursement points, an independent escrow payment record is created for each order. Each escrow payment record is mapped to a predefined node in the order state machine. Nodes in the order state machine represent key states in the transaction fulfillment process, such as production completion, quality inspection passing, goods being shipped, or the buyer receiving the goods. Simultaneously, at the moment the escrow payment record is created, the system stores the payee's account information as an immutable snapshot. This snapshot is independent of any subsequent updates to the payee's account, ensuring that the destination of funds at the time of record creation can be reconstructed during auditing and tracing.
[0021] In this embodiment, the order state machine progresses to various nodes as the transaction fulfillment process unfolds. When the order state machine reaches the node mapped to a certain escrow payment record, the system automatically determines that the release conditions for that escrow payment have been met and then initiates the release process. The core operations of the release process are encapsulated in a single database transaction, which simultaneously performs two tasks: first, updates the status of the escrow payment record from pending release to released; and second, generates an immutable fund flow record. This fund flow record establishes a connection with the corresponding escrow payment record through a unique flow identifier, thereby ensuring that each escrow payment corresponds to at most one fund flow, eliminating the possibility of duplicate entries at the data level.
[0022] In this embodiment, to ensure consistency between escrow payment records and generated fund flows, the system introduces an accounting invariant verification mechanism. This mechanism performs multiple binding checks on all escrow payment records and their associated fund flows. For example, it checks whether each released escrow payment record is indeed associated with a fund flow of the same amount and direction, and whether each fund flow uniquely corresponds to one escrow payment record. Through these checks, the system can automatically detect and alert to any inconsistencies between records and fund flows, thus replacing traditional manual reconciliation methods.
[0023] This embodiment uses the order state machine node as the trigger source for fund release, automatically aligning the fund release time with the transaction fulfillment node in time, avoiding mismatches caused by manual intervention; by storing the receiving account information in the form of an immutable snapshot, subsequent account changes do not affect the audit traceability of the fund's destination at that time; by encapsulating state changes and fund flows in the same database transaction and establishing a connection with a unique flow identifier, atomic consistency between records and flows is guaranteed and duplicate entries are prevented; by automatically verifying all records and flows in a programmatic manner through accounting invariant verification, the auditability and reconciliation efficiency of the fund custody and release process are improved.
[0024] In some embodiments, multiple escrow payment records are created for an order based on payment milestones in the order contract, corresponding to each payment milestone, including: Create separate escrow payment records for the deposit, final payment, and warranty deposit in the payment milestones. Each escrow payment record is associated with the order state machine node on which its release is triggered. The deposit is associated with the order placement node, the final payment with the shipment node, and the warranty deposit with the receipt node or a node that has elapsed for a preset period since receipt. When creating an escrow payment record, the receiving account information is copied as an immutable snapshot at creation time, and the immutable snapshot is persistently stored with the escrow payment record.
[0025] In this embodiment, payment milestones are specifically represented by three typical fund payment nodes in the transaction process: deposit, final payment, and warranty deposit. For each type of payment milestone, the system creates an independent escrow payment record, and each record is bound to a node in the order state machine representing the corresponding fulfillment progress. The escrow payment record corresponding to the deposit is bound to the order placement node, the escrow payment record corresponding to the final payment is bound to the shipment node, and the escrow payment record corresponding to the warranty deposit is bound to the receipt node, or to a node after a preset period of time from the receipt time, thus adapting to the business requirement of delayed release of warranty deposits after acceptance.
[0026] In this embodiment, when an escrow payment record is created, the system copies the payee's account information to generate an immutable snapshot. This immutable snapshot is persistently stored in the database along with the escrow payment record, and its content is fixed after creation. Subsequently, even if the payee's account information is modified due to business changes, the stored immutable snapshot will not be affected. Through this mechanism, auditors can obtain the original payee account information at the time of record creation from the immutable snapshot when tracing the flow of funds, thereby avoiding audit distortion caused by subsequent account changes.
[0027] This embodiment binds the deposit, final payment, and warranty deposit to order state machine nodes such as order placement, shipment, and receipt, respectively, so that the timing of fund release at each stage is automatically aligned with the transaction fulfillment progress, eliminating the need for manual judgment of the release time. By persistently storing the receiving account information in the form of an immutable snapshot along with the escrow payment record, the traceability of fund destination is ensured to be unaffected by subsequent changes in account information, thereby improving the audit reliability of the fund custody process.
[0028] In some embodiments, when creating an escrow payment record, the receiving account information is copied as an immutable snapshot at creation time, and the immutable snapshot is persistently stored with the escrow payment record, including: While creating the escrow payment record in the database transaction, the account name, account number and account opening institution in the payee account information are copied as an immutable snapshot. The immutable snapshot is persistently stored in the same data row as an auxiliary field of the escrow payment record. Once the escrow payment record is created, any modifications to the receiving account information will not alter the stored immutable snapshot, allowing for audit traceability by restoring the destination of the payment at the time the escrow payment record was created based on the immutable snapshot.
[0029] In this embodiment, the generation of the immutable snapshot and the creation of the escrow payment record are encapsulated within the same database transaction. During the execution of this transaction, the system extracts three fields—account name, account number, and account opening institution—from the receiving account information and copies the current values of these fields into an immutable snapshot. This immutable snapshot is set as a subsidiary field of the escrow payment record and is stored in the same data row as the main data of the escrow payment record, thereby ensuring a close association between the two at the physical storage level.
[0030] In this embodiment, once the escrow payment record is created, the immutable snapshot enters a read-only state. Thereafter, any update operations on the receiving account information, such as changes to the account name, account number, or account opening institution, only affect the real-time data storage area of the receiving account information and will not touch the stored immutable snapshot. When auditors need to trace the destination of a payment received at the time of creation of an escrow payment record, they can directly read the immutable snapshot from the record's supplementary fields to obtain the account name, account number, and account opening institution at the time of creation, without relying on the current state of the receiving account information, thereby ensuring the accuracy and reliability of audit traceability.
[0031] By storing the account name, account number, and account opening institution as supplementary fields of the escrow payment record in the same data row as immutable snapshots, a physical-level association between the snapshot and the record is achieved, avoiding tracing failures caused by broken associations. By ensuring that the immutable snapshot is not affected by subsequent modifications after its creation, it ensures that the true destination of the payment can be restored at the time of record creation during audit tracing, thus solving the audit distortion problem caused by subsequent changes to account information.
[0032] In some embodiments, after the escrow payment record is created, any modification to the receiving account information does not alter the stored immutable snapshot, enabling audit traceability to reconstruct the destination of the payment at the time of the escrow payment record creation based on the immutable snapshot, including: Immutable snapshots are independent of real-time data storage of receiving account information. Once the escrow payment record is created, the immutable snapshot is marked as read-only. Any update operation on the receiving account information will affect the real-time data and will not touch the immutable snapshot. During audit tracing, the audit system retrieves an immutable snapshot based on the unique identifier of the escrow payment record, extracts the account name, account number, and account opening institution from the immutable snapshot, and restores the destination of the payment at the time the escrow payment record was created. Audit tracing does not depend on the current state of the receiving account information.
[0033] In this embodiment, when an escrow payment record is created, the system copies the account name, account number, and account opening institution from the receiving account information into an immutable snapshot in the database transaction. This immutable snapshot is persistently stored in the same data row as an auxiliary field of the escrow payment record.
[0034] Once the escrow payment record is created, this immutable snapshot is marked as read-only, independent of the real-time data storage of the receiving account information. Thereafter, any updates to the receiving account information (such as changes to the merchant's receiving account or bank account) will only affect the real-time data and will not touch the stored immutable snapshot.
[0035] When audit traceability is required, the audit system retrieves the corresponding immutable snapshot based on the unique identifier of the escrow payment record. From the snapshot, it extracts the account name, account number, and issuing institution to reconstruct the destination of the funds received at the time the escrow payment record was created. Because the immutable snapshot is unaffected by subsequent changes to account information, the audit traceability results do not depend on the current state of the receiving account information, thus ensuring the accuracy and traceability of historical fund flows.
[0036] In some embodiments, when the order state machine progresses to the node associated with an escrow payment record, the release of that escrow payment is triggered, including: Apply concurrent locking to the release processing of the same escrow payment record, ensuring that the release of the escrow payment is processed at most once, to prevent duplicate releases caused by concurrent triggering; The writing of fund flow records is protected by uniqueness constraints, which use the unique constraint of the business reference number in the incomplete state to prevent the same fund flow record from being submitted repeatedly.
[0037] In this embodiment, to prevent the order state machine from repeatedly triggering the release of the same escrow payment record in concurrent scenarios, the system applies a concurrent lock to the release process of the escrow payment record. When the order state machine advances to the node associated with a certain escrow payment record, the system first attempts to acquire the release lock of the escrow payment record. At any given time, only one thread or process is allowed to hold the lock and execute the release process. Other concurrent requests will be blocked or rejected, thereby ensuring that the release of the escrow payment is processed at most once, eliminating the possibility of repeated release at the execution level.
[0038] At the data level, the writing of fund flow records is protected by uniqueness constraints. The system uses the unique constraint of the business reference number in the incomplete state as a fallback mechanism at the database layer. Even if concurrent locking fails due to abnormal conditions or duplicate submissions occur, the database will refuse to write duplicate fund flow records, preventing the same fund flow record from being recorded twice. Through the dual protection mechanism of concurrent locking and uniqueness constraints, the idempotency of fund custody release and data consistency are jointly guaranteed at both the execution and data levels.
[0039] This embodiment uses a dual protection mechanism of concurrent locking and uniqueness constraints to prevent duplicate releases and duplicate entries from both the execution and data levels, ensuring the idempotency and data consistency of the fund custody release process, and improving the system's reliability and fund security in concurrent triggering scenarios.
[0040] In some embodiments, the method further includes: The release conditions associated with the escrow payment record are stored in a programmable predicate expression. The programmable predicate expression takes at least one of the following as input: the current state of the order state machine, the quality inspection result, and the external document. It is evaluated when the order state machine advances to the associated node. If the programmable predicate expression is true, the release of the escrow payment is triggered. Programmable predicate expressions are stored in the release condition field of the escrow payment record in a configurable form. Programmable predicate expressions support the combination of multiple input conditions by logical operators. Input conditions include the node status value of the order state machine, the pass flag of the quality inspection result, and the receipt confirmation flag of the external document. The programmable predicate expression is invoked when the order state machine advances to the associated node. The evaluation engine of the programmable predicate expression reads the current value of the input condition, performs Boolean operations on the programmable predicate expression, and outputs a true or false value. When the output of the programmable predicate expression is true, the release process of the escrow payment is triggered, and the release process calls the concurrent locking and fund flow writing steps; When the output of the programmable predicate expression is false, the escrow payment record remains unreleased, waiting to be re-evaluated when the order state machine advances to the associated node next time.
[0041] In this embodiment, the release condition of the escrow payment record is not hard-coded into the program logic, but is stored in the release condition field of the escrow payment record in the form of a programmable predicate expression. This programmable predicate expression can receive the current node status of the order state machine, the pass or failure result returned by the quality inspection process, and the receipt or acceptance report provided by the external system as input parameters, and supports combining multiple input conditions through logical operators (such as AND, OR, NOT) to form a compound release condition.
[0042] When the order state machine advances to the node associated with the escrow payment record, the system calls the evaluation engine, reads the current values of each input condition, performs Boolean operations on the programmable predicate expression, and outputs a true or false value. When the output is true, the system determines that the release condition has been met and immediately initiates the release process for the escrow payment, which calls the concurrent locking and fund flow writing steps; when the output is false, the escrow payment record remains in an unreleased state, waiting for the order state machine to advance to the associated node again for re-evaluation.
[0043] This embodiment stores release conditions using programmable predicate expressions, enabling flexible configuration and dynamic evaluation of composite release conditions without requiring additional code branches for each condition combination, thus reducing system maintenance costs. By incorporating order state machine node states, quality inspection results, and external vouchers into the evaluation input, the timing of fund release is precisely aligned with the performance progress. Through a mechanism of truth value triggering and false value waiting, the safe custody of funds before the release conditions are met is ensured, enhancing the flexibility and reliability of the fund custody and release process.
[0044] In some embodiments, performing accounting invariant verification on escrow payment records and immutable cash flow includes: The status of each escrow payment record is verified to match the amount and direction of the associated fund flow. Each escrow payment record is in the released state if and only if there is a unique associated fund flow and the amount of the fund flow is equal to the amount of the escrow payment record and the direction of the fund flow matches the direction of the escrow payment record. Perform uniqueness verification on the relationship between each fund flow to ensure that each fund flow is associated with only one escrow payment record. Perform a total amount verification on all escrow payment records for the same order, ensuring that the sum of the amounts in all escrow payment records equals the total contract amount for that order. The accounting invariant verification is performed periodically by an independent task on all escrow payment records and all cash flow. If any verification fails, a reconciliation discrepancy alarm is generated.
[0045] In this embodiment, the system performs accounting invariant verification on the escrow payment records and the immutable fund flow to ensure that the two remain consistent in terms of status, amount and relationship.
[0046] The system verifies the consistency between the status of each escrow payment record and the amount and direction of its associated fund flows, ensuring that each escrow payment record is in a released state only if there is a unique associated fund flow, and the amount of that fund flow is equal to the amount of the escrow payment record and the direction is consistent. The system also verifies the uniqueness of the association between each fund flow, ensuring that each fund flow is associated with exactly one escrow payment record, preventing erroneous one-to-many or many-to-one associations. Finally, the system performs an amount aggregation verification on all escrow payment records for the same order, ensuring that the sum of the amounts of all escrow payment records equals the total contract amount of the order, thus ensuring the integrity of fund splitting and release.
[0047] The aforementioned accounting invariant verification is performed periodically by an independent task on all escrow payment records and all fund flows. If any verification fails, a reconciliation discrepancy alarm is generated for timely investigation and correction. This embodiment, through multi-dimensional invariant verification and periodic reconciliation mechanisms, ensures consistency between escrow payment records and fund flows from three levels: status consistency, association uniqueness, and amount integrity. It promptly detects and alarms data anomalies, improving the accounting accuracy and auditability of the fund escrow system.
[0048] In some embodiments, each escrow payment record is associated with the order state machine node upon which its release is triggered, including: The production node, quality inspection node, shipping node, and receiving node in the order state machine are respectively used as associated nodes for the managed payment record; The release conditions associated with the escrow payment record are stored in a programmable predicate expression. The programmable predicate expression takes at least one of the following as input: the current state of the order state machine, the quality inspection result, and the external document. It is evaluated when the order state machine advances to the associated node. If the programmable predicate expression is true, the release of the escrow payment is triggered.
[0049] In this embodiment, the order state machine is defined as a fulfillment progress model composed of multiple ordered nodes, where the production node, quality inspection node, shipping node, and receiving node represent four key fulfillment stages in the transaction process. The system assigns one node as the associated node for each escrow payment record, binding the release time of the escrow payment record to the completion time of the corresponding fulfillment stage.
[0050] The release conditions associated with the escrow payment record are stored in a programmable predicate expression. The programmable predicate expression takes at least one of the following as input: the current state of the order state machine, the quality inspection result, and the external document. It is evaluated when the order state machine advances to the associated node. If the programmable predicate expression is true, the release of the escrow payment is triggered.
[0051] This embodiment uses order state machine nodes such as production, quality inspection, shipment, and receipt as associated nodes for escrow payment records, ensuring precise alignment between fund release timing and performance progress. By storing release conditions using programmable predicate expressions, it achieves flexible configuration of composite release conditions without requiring additional code branches for each condition combination, thus improving the flexibility and reliability of the fund escrow release process.
[0052] In some embodiments, performing accounting invariant verification on escrow payment records and immutable cash flow includes: The status of each escrow payment record is verified to match the amount and direction of the associated fund flow. Each escrow payment record is in the released state if and only if there is a unique associated fund flow and the amount of the fund flow is equal to the amount of the escrow payment record and the direction of the fund flow matches the direction of the escrow payment record. Perform uniqueness verification on the relationship between each fund flow to ensure that each fund flow is associated with only one escrow payment record. Perform a total amount verification on all escrow payment records for the same order, ensuring that the sum of the amounts in all escrow payment records equals the total contract amount for that order. The accounting invariant verification is performed periodically by an independent task on all escrow payment records and all cash flow. If any verification fails, a reconciliation discrepancy alarm is generated.
[0053] In this embodiment, the accounting invariant verification includes three independent verification rules, each ensuring consistency between escrow payment records and fund flows from different dimensions. The first rule is a consistency verification: for each released escrow payment record, it checks whether it is associated with a unique fund flow, and that the amount of the fund flow is exactly equal to the amount of the escrow payment record, and the direction of the fund flow is exactly the same as the direction of the fund flow in the escrow payment record. The second rule is a uniqueness verification: for each generated fund flow, it checks whether it is associated with exactly one escrow payment record, preventing a single fund flow from corresponding to multiple escrow payment records. The third rule is an amount aggregation verification: for all escrow payment records under the same order, the sum of the amounts of each record is compared with the total order contract amount to ensure that the sum of the escrow amounts at each stage matches the total contract amount.
[0054] In this embodiment, the verification of accounting invariants is performed periodically by a reconciliation task independent of the business system. This reconciliation task traverses all escrow payment records and all fund flows, executing the three verification rules mentioned above on each record and flow. If any verification fails, the system automatically generates a reconciliation discrepancy alarm, recording the specific type of discrepancy, the data records involved, and discrepancy details for maintenance or auditing personnel to locate and handle. The reconciliation task is independent of the release process of the business system and will not block or delay normal fund release operations.
[0055] By performing procedural verification of escrow payment records and fund flows from three dimensions—matching of amount direction, uniqueness of association, and summarization of amounts—the reconciliation process has been automated and comprehensive. By having an independent task perform verification on the full amount of data periodically and generate alarms when discrepancies occur, the traditional manual reconciliation method has been replaced, reducing reconciliation costs and improving the timeliness of discrepancy detection.
[0056] Please see Figure 6In a second aspect, this embodiment also provides a system for triggering fund escrow release based on order state machine nodes, used in the method described in the first aspect, the system comprising: The escrow payment creation unit 100 is used to create multiple escrow payment records for an order based on the payment milestones of the order contract. Each escrow payment record is associated with the order state machine node on which its release is triggered. When creating an escrow payment record, the receiving account information is stored with the escrow payment record as an immutable snapshot. The node-triggered release unit 200 is used to trigger the release of an escrow payment when the order state machine advances to the node associated with a certain escrow payment record. Atomic pipeline unit 300 is used to atomically write the state change of the escrow payment record and an immutable fund flow within the same database transaction, and associate the fund flow with the escrow payment record with a unique flow identifier. The reconciliation verification unit 400 is used to perform accounting invariant verification on the escrow payment records and the immutable cash flow to ensure that the two are consistent.
[0057] In this embodiment, the system provided by the second aspect corresponds to the method described in the first aspect, and each unit of the system is used to execute each step in the method. The escrow payment creation unit 100 is used to implement the step of creating an escrow payment record based on a payment milestone and storing an immutable snapshot; the node-triggered release unit 200 is used to implement the step of triggering release when the order state machine advances to the associated node; the atomic pipeline unit 300 is used to implement the step of atomically writing state changes and fund flows within the same database transaction and associating them with a unique pipeline identifier; and the reconciliation verification unit 400 is used to implement the step of performing accounting invariant verification on the escrow payment record and fund flows. By mapping the method steps to system units, the method can be deployed and run on a computing device in the form of a computer program product, and the data transfer and calling relationships between the units are consistent with the flow order of the steps in the method.
[0058] This invention provides a method for triggering escrow fund release based on order state machine nodes. According to the payment milestones of the order contract, multiple escrow payment records are created for each payment milestone of the order. Each escrow payment record is associated with the order state machine node upon which its release is triggered. When creating an escrow payment record, the receiving account information is stored as an immutable snapshot along with the escrow payment record. When the order state machine advances to the node associated with a certain escrow payment record, the release of that escrow payment is triggered. The release atomically writes the state change of the escrow payment record and an immutable fund flow within the same database transaction, and associates the fund flow with the escrow payment record using a unique flow identifier. Accounting invariant verification is performed on the escrow payment record and the immutable fund flow to ensure consistency between them. By using the order state machine node as the sole trigger for fund release, the timing of fund release automatically aligns with the fulfillment node, avoiding mismatches. By storing the receiving account information in an immutable snapshot, subsequent account changes do not affect the audit traceability of the funds' destination at that time. By atomically writing state changes and fund flows within the same database transaction and associating them with a unique flow identifier, records remain consistent with flows and prevent duplicate entries. By using accounting invariant verification to replace manual reconciliation with programmatic verification, the efficiency and accuracy of reconciliation are improved.
[0059] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0060] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0061] The above description is only a part of the embodiments of the present invention and does not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made based on the content of the present invention specification and drawings, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for triggering fund escrow release based on order state machine nodes, characterized in that, include: Based on the payment milestones of the order contract, multiple escrow payment records corresponding to each payment milestone are created for the order. Each escrow payment record is associated with the order state machine node on which its release is triggered. When the escrow payment record is created, the receiving account information is stored with the escrow payment record as an immutable snapshot. When the order state machine advances to the node associated with a certain escrow payment record, the release of the escrow payment is triggered. The release atomically writes the state change of the escrow payment record and an immutable cash flow within the same database transaction, and associates the cash flow with the escrow payment record with a unique cash flow identifier. Perform accounting invariant verification on the escrow payment records and the immutable cash flow to ensure consistency between the two.
2. The method for triggering fund escrow release based on order state machine nodes according to claim 1, characterized in that, Based on the payment milestones in the order contract, create multiple escrow payment records for the order corresponding to each payment milestone, including: The deposit, final payment, and warranty deposit in the payment milestones are each created as an independent escrow payment record. Each escrow payment record is associated with the order state machine node on which its release is triggered. The deposit is associated with the order placement node, the final payment is associated with the shipment node, and the warranty deposit is associated with the receipt node or a node that has elapsed for a preset period since receipt. When the escrow payment record is created, the receiving account information is copied as an immutable snapshot at creation time, and the immutable snapshot is persistently stored with the escrow payment record.
3. The method for triggering fund custody release based on order state machine nodes according to claim 2, characterized in that, When creating the escrow payment record, the receiving account information is copied as an immutable snapshot at creation time. This immutable snapshot is persistently stored with the escrow payment record, including: While creating the escrow payment record in the database transaction, the account name, account number and account opening institution in the receiving account information are copied as an immutable snapshot, and the immutable snapshot is persistently stored in the same data row as an auxiliary field of the escrow payment record; Once the escrow payment record is created, any modification to the receiving account information will not alter the stored immutable snapshot, allowing for auditing and tracing to reconstruct the destination of the payment at the time the escrow payment record was created based on the immutable snapshot.
4. The method for triggering fund custody release based on order state machine nodes according to claim 3, characterized in that, After the escrow payment record is created, any modification to the receiving account information will not alter the stored immutable snapshot, allowing for audit traceability by reconstructing the destination of the payment at the time of the escrow payment record creation based on the immutable snapshot, including: The immutable snapshot is independent of the real-time data storage of the receiving account information. The immutable snapshot is marked as read-only after the escrow payment record is created. Any update operation on the receiving account information will be applied to the real-time data and will not affect the immutable snapshot. During audit tracing, the audit system retrieves the immutable snapshot based on the unique identifier of the escrow payment record, and extracts the account name, account number and account opening institution from the immutable snapshot to restore the destination of the payment at the time the escrow payment record was created. The audit tracing does not depend on the current state of the receiving account information.
5. The method for triggering fund custody release based on order state machine nodes according to claim 1, characterized in that, When the order state machine progresses to the node associated with a certain escrow payment record, the release of that escrow payment is triggered, including: Apply concurrent locking to the release processing of the same escrow payment record, ensuring that the release of the escrow payment is processed at most once, to prevent duplicate releases caused by concurrent triggering; The writing of the fund flow record is protected by a unique constraint, which uses the unique constraint of the business reference number in the incomplete state to prevent the same fund flow record from being submitted repeatedly.
6. The method for triggering fund custody release based on order state machine nodes according to claim 5, characterized in that, The method further includes: The release condition associated with the escrow payment record is stored in a programmable predicate expression. The programmable predicate expression takes at least one of the current state of the order state machine, the quality inspection result, and the external voucher as input. It is evaluated when the order state machine advances to the associated node. If the programmable predicate expression is true, the release of the escrow payment is triggered. The programmable predicate expression is stored in the release condition field of the escrow payment record in a configurable form. The programmable predicate expression supports the combination of multiple input conditions by logical operators. The input conditions include the node status value of the order state machine, the pass identifier of the quality inspection result, and the signature confirmation identifier of the external voucher. The programmable predicate expression is invoked when the order state machine advances to the associated node. The evaluation engine of the programmable predicate expression reads the current value of the input condition, performs Boolean operations on the programmable predicate expression, and outputs a true or false value. When the output of the programmable predicate expression is true, the release process of the escrow payment is triggered, and the release process calls the concurrent locking and the fund flow writing steps. When the output of the programmable predicate expression is false, the escrow payment record remains unreleased, waiting for the order state machine to re-evaluate when it advances to the associated node next time.
7. The method for triggering fund custody release based on order state machine nodes according to claim 1, characterized in that, Performing accounting invariant verification on the escrow payment records and the immutable cash flow includes: The status of each escrow payment record is verified to match the amount and direction of the associated fund flow. Each escrow payment record is in a released state if and only if there is a unique associated fund flow and the amount of the fund flow is equal to the amount of the escrow payment record and the direction of the fund flow matches the direction of the escrow payment record. Perform uniqueness verification on the relationship between each fund flow to ensure that each fund flow is associated with only one escrow payment record. Perform a total amount verification on all escrow payment records for the same order, ensuring that the sum of the amounts in all escrow payment records equals the total contract amount for that order. The accounting invariant verification is performed periodically by an independent task on all escrow payment records and all fund flows. If any verification fails, a reconciliation discrepancy alarm is generated.
8. The method for triggering fund custody release based on order state machine nodes according to claim 7, characterized in that, Each escrow payment record is associated with the order state machine node upon which its release is triggered, including: The production node, quality inspection node, shipping node, and receiving node in the order state machine are respectively used as the associated nodes of the escrow payment record; The release condition associated with the escrow payment record is stored in a programmable predicate expression. The programmable predicate expression takes at least one of the current state of the order state machine, the quality inspection result, and the external voucher as input. It is evaluated when the order state machine advances to the associated node. If the programmable predicate expression is true, the release of the escrow payment is triggered.
9. The method for triggering fund escrow release based on order state machine nodes according to claim 1, characterized in that, Performing accounting invariant verification on the escrow payment records and the immutable cash flow includes: The status of each escrow payment record is verified to match the amount and direction of the associated fund flow. Each escrow payment record is in a released state if and only if there is a unique associated fund flow and the amount of the fund flow is equal to the amount of the escrow payment record and the direction of the fund flow matches the direction of the escrow payment record. Perform uniqueness verification on the relationship between each fund flow to ensure that each fund flow is associated with only one escrow payment record. Perform a total amount verification on all escrow payment records for the same order, ensuring that the sum of the amounts in all escrow payment records equals the total contract amount for that order. The accounting invariant verification is performed periodically by an independent task on all escrow payment records and all fund flows. If any verification fails, a reconciliation discrepancy alarm is generated.
10. A system for triggering fund escrow release based on order state machine nodes, characterized in that, The system for performing the method according to any one of claims 1 to 9, the system comprising: The escrow payment creation unit is used to create multiple escrow payment records for the order corresponding to each payment milestone based on the payment milestone of the order contract. Each escrow payment record is associated with the order state machine node on which its release is triggered. When creating the escrow payment record, the receiving account information is stored with the escrow payment record as an immutable snapshot. The node-triggered release unit is used to trigger the release of an escrow payment when the order state machine advances to the node associated with a certain escrow payment record; An atomic pipeline unit is used to atomically write the state change of the escrow payment record and an immutable fund flow within the same database transaction, and associate the fund flow with the escrow payment record with a unique flow identifier; The reconciliation and verification unit is used to perform accounting invariant verification on the escrow payment record and the immutable cash flow to ensure that the two are consistent.
