Blockchain-based order prepayment transaction settlement method and system
By constructing order transaction packages on the blockchain and setting slots according to stage sequence numbers, combined with the sequential constraints of predecessor state proofs and state version numbers, the problems of state breakpoints and suspended funds in the order payment system are solved, achieving efficient and accurate order payment transaction settlement, and reducing the risk of fund lock-up and storage overhead.
Patent Information
- Application Number
- CN202611710170.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-11-02
- Publication Date
- 2026-11-27
AI Technical Summary
The existing order payment system has risks such as status breakpoints, idle funds, and duplicate transfers. The sequence of stages cannot be self-verified, there is no linkage between custody and confirmation for unfreezing, and confirmation does not verify the sequence and version number monotonicity, resulting in low settlement accuracy and efficiency.
The blockchain-based order payment transaction settlement method is adopted. By constructing order transaction packages and setting slots according to stage sequence numbers, and combining the sequential constraints of predecessor status proof and status version number, the settlement status at the order transaction package level can be accurately determined. Furthermore, the risk of long-term fund lock-up is reduced by using timestamp-based deadline timestamps and quota verification-based quota verification, combined with an unfreezing and rollback module.
It enables precise settlement of order payment transactions, significantly reduces the risk of long-term fund lock-up, shortens the settlement cycle, improves settlement efficiency and accuracy, and reduces on-chain storage overhead.
Smart Images

Figure CN123180993A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of e-commerce and financial payment technology, specifically to a blockchain-based order payment transaction settlement method and system. Background Technology
[0002] Order payment on behalf refers to a method where the order initiator and the payer are not the same entity, and the payment is made on behalf of the order. Examples include payment on behalf of children, payment on behalf of corporate travel, payment on behalf of group purchases, and platform advance payment. This involves multiple parties, and the accuracy and timeliness of settlement are related to fund security and user experience.
[0003] Existing payment services are mostly processed sequentially by centralized payment platforms: request entry, fund freezing, and settlement after the payee confirms the transaction, which takes one or several days. Since the request, freezing, and confirmation records are scattered across different systems and there is no mandatory sequential dependency verification, when messages are lost or delayed, the system cannot determine whether the order is in a legitimate waiting state or the funds are in a suspended state. Only manual reconciliation is possible, which is time-consuming and prone to omissions.
[0004] To address the aforementioned issues, existing technologies have introduced blockchain technology into payment processing services. A search of relevant patent documents and their shortcomings is as follows: CN116823267A uses smart contracts to execute bank payments, but the request, freezing, and confirmation are independent on-chain transactions with no cryptographic order dependency. Failure in any stage does not result in the return of frozen funds, leaving funds in an intermediate, suspended state with no verifiable status. CN120047138A manages the authorized payment provider and its permissions, but does not establish verifiable sequential constraints for the four stages of request, escrow, transfer, and confirmation. It cannot determine whether credentials are forged, replaced, or submitted at a skipped stage, and it is difficult to release escrow resources when they are missing. CN122714023A constructs the intent of a payment transaction and executes it through a contract, but it does not differentiate between stages or have a timeout unfreezing mechanism; funds may be locked indefinitely when receipts are missing. CN108256843B processes payment orders concurrently, but relies on centralized asynchronous returns, lacks on-chain sequential credentials and version constraints, and on-chain and offline records cannot be mutually verified, so the risks of duplicate transfers and out-of-order status remain.
[0005] It is evident that existing technologies suffer from risks such as state breakpoints, idle funds, and duplicate transfers: the sequence of stages cannot be self-verified, there is no linkage between escrow and confirmation for unfreezing, and confirmation does not verify the sequence and version number monotonicity. Therefore, it is necessary to provide a blockchain-based order payment transaction settlement method and system. Summary of the Invention
[0006] To address the technical problems in the existing technology, this application provides a blockchain-based method and system for order payment transaction settlement.
[0007] Firstly, the blockchain-based order payment transaction settlement method provided in this application adopts the following technical solution, including the following steps:
[0008] Step S1. Construct the order transaction package;
[0009] In the order transaction package, a first-stage slot, a second-stage slot, a third-stage slot, and a fourth-stage slot are set according to the stage sequence number, and the first-stage slot to the fourth-stage slot constitute an ordered slot sequence;
[0010] Assign a transaction package identifier to the order transaction package;
[0011] The payment request certificate generated by the order initiation terminal is submitted to the candidate area of the first stage slot, and the payment request certificate contains a configuration version summary;
[0012] After the write is confirmed by the consortium blockchain network, the payment request certificate is placed into the first stage slot, and the status version number of the first stage slot is set to the initial value.
[0013] The slot for a stage without an inserted voucher is a null value placeholder.
[0014] Output a unified transaction data platform;
[0015] Step S2. Based on the unified transaction data base, establish a custodian sub-account corresponding to each payer using a composite key formed by the transaction package identifier and the payer identifier in the payment request certificate;
[0016] Verify whether the available balance in the payer's account covers the sum of the amount to be paid and the handling fee limit based on the credit limit verification relationship;
[0017] Upon coverage, the amount to be paid and the handling fee amount are locked, and a fund custody certificate is generated;
[0018] The fund custody certificate is submitted to the candidate area of the second stage slot, and after passing the judgment, it is placed into the second stage slot;
[0019] The preceding status proof of the fund custody certificate points to the first-stage certificate summary;
[0020] The status version number of the fund custody certificate is the value incremented from the initial value;
[0021] Step S3. Define the time limit for each stage from the first stage slot to the fourth stage slot, and generate the end time stamp for each stage based on the time reference stamp and the time limit.
[0022] The state root storage module registers the credential digests of the effective phase as the effective state root;
[0023] When a credential is submitted to the candidate area at any stage, the credential summary and the deadline timestamp of that stage are aggregated into a candidate state root and attached to the credential, but not written to the state root storage module.
[0024] Generate a precursor state proof for each stage of the credential, wherein the precursor state proof is associated with the previous stage credential summary, the state version number of the current stage credential declaration, and the configuration version summary;
[0025] Step S4. Construct a state transition guard system based on the predecessor state proof of each stage slot, the deadline timestamp, and the threshold signature;
[0026] The transition determination result is output according to the guard determination relationship. The guard determination relationship includes the predecessor state proof being consistent with the effective state root, the state version number being the value of the registered state version number incremented, the current block timestamp not exceeding the deadline timestamp, signature verification being successful, and amount consistency verification being successful.
[0027] Step S5. Adopt the state transition atomic execution model. When the transition determination result is that the transition is allowed, the atomic settlement contract atomically executes the fund transfer, state version number increment, effective state root update and settlement event output in the same on-chain transaction.
[0028] If any of the following situations occur: the jump determination result is that jump is prohibited and the time window expires, the cumulative number of retry attempts initiated by the submitter registered in this stage reaches the retry threshold corresponding to this stage, the deadline time stamp expires, or the amount consistency verification fails, the amount locked in the escrow sub-account will be returned along the transfer path according to the apportionment amount.
[0029] Output the order settlement and scheduling plan.
[0030] Secondly, the blockchain-based order payment transaction settlement system provided in this application adopts the following technical solution: including:
[0031] The order transaction package construction module is used to construct order transaction packages; four stage slots are set in the order transaction package according to the stage sequence number; the payment request voucher, fund custody voucher, fund transfer voucher and settlement confirmation voucher are respectively encapsulated into the four stage slots; a predecessor status certificate and status version number are generated for each stage voucher; a transaction package identifier is assigned to the order transaction package; and a unified transaction data base is output to the custody sub-account module.
[0032] The escrow sub-account module is used to establish an escrow sub-account corresponding to the transaction package identifier based on the unified transaction data platform; and to verify and lock the amount to be paid and the handling fee limit according to the limit verification relationship.
[0033] It also outputs the fund custody certificate to the time window registration module and the state machine verification module;
[0034] The time window registration module is used to mark the stage time limit of the four stage slots and generate the end time stamp of each stage; compare the current block timestamp when each block is generated; and output the end time stamp of each stage to the state machine verification module.
[0035] The state root storage module is used to store the effective state root and the candidate state root respectively using the hash tree root value. The effective state root only covers the credential digest of the effective stage, and the candidate state root is attached with the credential and does not enter the effective state root. The module also outputs the effective state root to the state machine verification module.
[0036] The state machine verification module is used to perform state transition guard determination based on the candidate state and effective state of each stage slot according to the guard determination relationship; and output the transition determination result to the condition transfer module and the unfreeze rollback module.
[0037] The conditional transfer module is used to execute fund transfer when the transition determination result is that the transition is allowed, and bind the fund transfer, the status version number auto-increment, the effective status root update and the settlement event output into the same on-chain transaction; and output the settlement event to the settlement event output module;
[0038] The unfreezing and rollback module is used to return the locked amount in the escrow sub-account along the transfer path according to the apportionment amount and generate an abnormal closed loop record when any of the following situations occur: the jump determination result is a prohibited jump and the time window fails, the number of retry attempts reaches the retry number threshold, the deadline timestamp expires, or the amount consistency verification fails; and outputs the abnormal closed loop record to the settlement event output module.
[0039] The settlement event output module is used to output settlement events and record the settlement quality ledger according to the settlement cycle; and output the settlement events and settlement quality ledger to the business side subscription terminal.
[0040] In summary, this application includes at least one of the following beneficial technical effects:
[0041] 1. This invention relies on a unified transaction data base and four-stage slot encapsulation, combined with the sequential constraints of predecessor state proof and state version number, to enable atomic settlement contracts to advance their state only in the predetermined order of request, custody, allocation, and confirmation. This achieves accurate determination of the settlement status of order payment transactions at the package level, avoiding the defects of traditional solutions where payment requests, fund freezes, and settlement confirmations belong to different data tables and require manual reconciliation intervention.
[0042] 2. This invention significantly reduces the risk of long-term fund lock-up caused by no receipt after custody by combining the stage end time stamp obtained by the time stamp calibration formula with the quota verification result obtained by the quota verification formula and the original return path of the unfreezing and rollback module, thus significantly reducing the proportion of pending orders compared with the industry common level; at the same time, it uses a fixed-length structure to store the voucher summary and the voucher original text off-chain, reducing on-chain storage overhead.
[0043] 3. This invention binds the execution of each guard condition and each sub-step based on the guard judgment method, and combines the settlement cycle statistics and time limit configuration dynamic adjustment of the periodic statistics method to realize the on-demand atomic effect of settlement actions. In high-concurrency peak scenarios, the settlement cycle is shortened from the traditional batch clearing cycle to the second level, changing the traditional one-size-fits-all mode of batch clearing. Attached Figure Description
[0044] Figure 1 This is a schematic diagram of the overall process of the method of the present invention;
[0045] Figure 2 This is a schematic diagram of the four-stage slot, predecessor state proof, and state root storage structure of the order transaction package of the present invention;
[0046] Figure 3 This is a schematic diagram of the state transition guard determination process of the present invention;
[0047] Figure 4 This is a schematic diagram of the overall flowchart of the system of the present invention. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0049] like Figure 1 The diagram shown is a flowchart of a blockchain-based order payment transaction settlement method provided in an embodiment of the present invention. Figure 1The execution entity of the method shown can be a software and / or hardware device. The execution entity of this application can include, but is not limited to, at least one of the following: user equipment, network equipment, etc. User equipment can include, but is not limited to, smartphones, tablets, POS machines, and the aforementioned electronic devices that have order initiation applications and payment agent applications installed; network equipment can include, but is not limited to, transaction gateway servers, consensus nodes and ordering nodes in a consortium blockchain network, a single network server, a server group composed of multiple network servers, or a cloud based on cloud computing consisting of a large number of computers or network servers. Cloud computing is a type of distributed computing, consisting of a super virtual computer composed of a group of loosely coupled computers. This embodiment does not limit this. Detailed steps are as follows:
[0050] S1. Construct the order transaction package, such as Figure 2 As shown, in the same order transaction package, four slots are established according to the stage number: the first stage slot, the second stage slot, the third stage slot, and the fourth stage slot, which are used to carry payment request vouchers, fund custody vouchers, fund transfer vouchers, and settlement confirmation vouchers, respectively. The four stage slots form an ordered slot sequence. The payment request voucher generated by the order initiating terminal is submitted to the candidate area of the first stage slot. After the consortium blockchain network confirms the writing, it is placed into the first stage slot and the state version number is set to the initial value. The stage slot position without voucher is empty and occupied. Each stage slot has two states: candidate state and effective state. The candidate state indicates that the voucher has been submitted but has not yet passed the state transition guard judgment. The effective state indicates that the judgment has passed and the state version number and the effective state root have been updated. The writing slot mentioned below refers to the placement of the effective state. A unified transaction data base is output.
[0051] In this process, after the user selects a payer, the order initiating terminal generates a payment request certificate. This certificate includes an order element hash, the amount to be paid, a set of payer identifiers, an amount tier identifier, a configuration version summary, and a first certificate signature consisting of the order initiating terminal's signature and the transaction gateway server's endorsement. The configuration version summary is a concatenated hash of the time limit configuration table content summary and the fee rate table content summary. Each payer identifier in the payer identifier set is associated with its share in the amount to be paid and an authorization signature. The amount to be paid is equal to the sum of all shares. When there is only one sharer, the set contains only one identifier. After receiving the payment request certificate, the transaction gateway server assigns a globally unique transaction package identifier to the order transaction package. The transaction package identifier is composed of a summary of the consortium blockchain network identifier and an on-chain sequence number. The server then submits the payment request certificate to the candidate area of the first-stage slot and places it in the slot after confirmation of writing.
[0052] It is understandable that the construction of a unified transaction data foundation is based on a unified time base and a unified monetary unit: In the formulas used in this embodiment, the monetary amount is always measured in the smallest monetary unit and stored as an integer, and the time amount is always measured in Unix seconds and stored as an integer, and the quantity is determined by logical true or logical false values; the business fields such as order product name, quantity, and delivery address are first compressed into a fixed-length digest by hash operation before entering the order transaction package, and the original voucher and order details are written to off-chain object storage, thereby ensuring that all types of data are consistent in data structure and unit, and that the amount of a single on-chain write does not increase with the size of the order detail field.
[0053] S2. Based on the unified transaction data platform, a custodian sub-account corresponding to each payer is established using a composite key composed of the unique identifier of the order transaction package and the payer identifier. A limit verification is performed according to the limit verification formula to lock the amount to be paid, generating a fund custody certificate. The fund custody certificate is submitted to the candidate area of the second-stage slot. After passing the verification, it is placed in the second-stage slot. Its predecessor status proof points to the first-stage certificate summary, and its status version number is equal to the sum of the initial value and one. The fund custody certificate must contain the authorized signature share held by the payer's terminal to prove that the payer acknowledges locking funds from its account, rather than the deduction being initiated unilaterally by the order initiating terminal. The limit verification formula is as follows:
[0054] ;
[0055] When the above formula is true, the atomic settlement contract will... and The sum is transferred from the payer's account to the escrow sub-account and recorded as the locked amount to obtain the fund custody certificate; when the above formula is not true, the atomic settlement contract refuses to create the escrow sub-account and returns an insufficient balance flag to the transaction gateway server.
[0056] in, The value is derived from the internal ledger of the atomic settlement contract, rather than from the asynchronous receipts of external bank accounts. It is written when the funds in the payer's account are credited through the payment channel and confirmed by the consensus node. This makes the verification process of the quota verification method completely repeatable on the chain, avoiding the verification uncertainty caused by relying on trusted external data sources.
[0057] in, The transaction gateway server combines the payment channel fee rate table and the custody service fee rate table registered on the chain and converts them into integer scores, which are then written into the order transaction package. The contents of the two tables are fixed on the chain with the configuration version summary and updated monthly by the governance transaction. Each payment agent's custody sub-account corresponds one-to-one with its identifier and is not reused, so that the locked amount, unfreezing path and settlement result of any order at each payment agent are isolated from each other on the chain, preventing cross-order and cross-payment agent cross-transactions.
[0058] Specifically, the order transaction package stores fields such as voucher summary, status version number, and deadline timestamp at each stage on the blockchain in a fixed-length structure, while the original voucher text and order details are stored in off-chain object storage, so that the amount of on-chain writing for a single transaction does not increase with the size of the order detail fields. In the implementation method that retains historical transaction package records, the on-chain storage overhead of the order transaction package itself increases approximately linearly with the number of order payments, but does not increase with the size of the business fields.
[0059] S3. Define the time limits for the four stage slots and generate the deadline timestamps for each stage according to the timestamp calibration formula; the state root storage module is used to register the credential digests of the effective stages as effective state roots; when a credential for any stage is submitted to the candidate area, the credential digest of that stage along with its deadline timestamp is aggregated into a candidate state root and attached to the credential without being written to the state root storage module, and a transition candidate credential set is output; the timestamp calibration formula is as follows:
[0060] ;
[0061] In the formula, For the first The end timestamp of the phase, in seconds; For the first The time base stamp of the stage is in seconds. When taking 1 The timestamp of the block where the first-phase certificate is confirmed and written by the consortium blockchain network, when When taking 2, 3, 4 in sequence For the first The block timestamp of the phase certificate being confirmed and written by the consortium blockchain network; For the first The preset time limit for each stage, in seconds; and Both are integers of seconds; the sum of the two is... It will still be expressed in Unix seconds to maintain consistency in units.
[0062] Among them, when When setting 1, the time base is the confirmation and writing timestamp of the first-stage certificate itself, rather than the local time of the order initiating terminal. The purpose is to ensure that the time base for the timestamp calibration is uniformly taken from the block timestamp confirmed by the consensus node, thus avoiding issues caused by terminal clock drift. The actual effective duration deviates from the set value, thereby avoiding accidental return via the original payment method for normal orders.
[0063] The state root storage module records the credential digests of the effective phases using a hash tree. At any given time, the root value registered in the tree only covers the currently effective phase. The phase credential digest is not entered into the hash tree before the transition takes effect;
[0064] The generation method of the predecessor state proof is as follows: [The text abruptly ends here, likely due to an incomplete sentence or a formatting error.] Phase Voucher Payload, First Phase voucher summary, number The value obtained by hashing the concatenation of the status version number of the phase certificate declaration, the configuration version digest, and the consortium blockchain network identifier in sequence is used as the first... Stage voucher summary; when When the value is 1, since there is no previous stage certificate, the transaction package identifier, consortium blockchain network identifier, configuration version digest, and first stage certificate payload of the order transaction package are concatenated in sequence and hashed to obtain the value, which is used as the first stage certificate digest. This first stage certificate digest is written to the state root storage module by the transaction gateway server as the initial root when the payment request certificate is confirmed and written, serving as the initial effective state root of the order transaction package. It has a comparison benchmark; contract determination At that time, the first one carried with the voucher The stage certificate summary and its path proof in the effective state root are recalculated to the root value and compared with the registered effective state root. Therefore, when any stage certificate is tampered with, replaced, or submitted with a skipped level, its recalculated root value will inevitably deviate from the registered effective state root. The configuration version summary is input into the hash, and for on-chain order transaction packages, the configuration version summary in the calculation of the stage certificate summary from the 2nd to the 4th stages must be the configuration version summary fixed by the first stage certificate of the order transaction package, and cannot be the configuration version summary updated thereafter. Configuration changes only take effect on newly generated order transaction packages. The preset time limit and fee amount of each stage are uniquely determined by the on-chain configuration table corresponding to the fixed configuration version summary. Any participant that separately rewrites the deadline timestamp or fee rate outside the certificate will cause the default time to be affected. This is not valid, therefore there is no need to include the deadline timestamps of each stage into the hash input; the consortium blockchain network identifier is included in the hash input, so that the digests of the same credential are different on the two chains, thus blocking cross-chain replay from a mechanistic perspective.
[0065] in, The transaction gateway server reads and writes the order transaction package from the time limit configuration table according to the amount tier of the amount to be paid; the amount tier is... Judgment, and Since the unit of measurement is cents, the threshold values in the time limit configuration table are stored as integers in cents, with the zero to two hundred yuan thresholds corresponding to... No more than 20,000 points, corresponding to the price range of 200 to 2,000 yuan. A score greater than 20,000 and not greater than 200,000 corresponds to a price range greater than 2,000 yuan. For amounts exceeding 200,000 points, the determination of the tier and the storage of the amount should not involve mixing yuan and fen; for tiers from zero to 200 yuan... The values are selected sequentially as follows: 300 seconds, 300 seconds, 86,400 seconds, and 259,200 seconds; for the 200-2,000 yuan price range, the values are selected sequentially as follows: 600 seconds, 300 seconds, 172,800 seconds, and 345,600 seconds; for the price range above 2,000 yuan, the values are selected sequentially as follows: 900 seconds, 600 seconds, 172,800 seconds, and 604,800 seconds. The above values are based on the following: It needs to cover the time from when the payment notification arrives to when the payment agent completes the authorization on their terminal. It needs to cover the time from when funds are received to when consensus is confirmed. It needs to cover the duration of the recipient's shipment or service completion. It needs to cover the time it takes for the user to confirm receipt; among which The prerequisite for receiving 300 seconds is that the payer's account has a usable balance in the atomic settlement contract. The locking operation only requires one on-chain accounting confirmation. When the funds to be paid need to be deposited through a payment channel, the time limit configuration table will be set according to the deposit method identifier in the payment request voucher. The timeframe is set at 86,400 seconds to avoid applying on-chain confirmation time to cross-system deposits; for instant orders where payment receipts and confirmations are automatically generated by the platform, such as mobile phone top-ups, utility bill payments, and virtual goods deliveries, and Thirty seconds and sixty seconds are taken sequentially, and this set of values is not included in the aforementioned tier table set according to the actual delivery time. Time limits expressed in days or hours are all converted to seconds and written. The contents of the time limit configuration table and fee rate table are fixed on the chain by the configuration version summary. Changes to these tables must be completed by governance transactions signed by no less than four signature shares and left on the chain. Moreover, changes only take effect on newly generated order transaction packages. Once the deadline timestamps of each stage obtained by the timestamp calibration formula in the order transaction packages that have been uploaded to the chain are written, they are fixed and cannot be rewritten by any participant. This ensures that the basis for determining the time window is tamper-proof while eliminating the unilateral centralized adjustment authority.
[0066] The process of determining the set of candidate transition vouchers includes: after confirming that the payment conditions are met, the payee terminal or transaction gateway server submits a fund transfer voucher containing a payment receipt commitment, the transfer amount, and a threshold signature; the payer terminal provides the authorized signature share required for the fund transfer voucher; the atomic settlement contract first verifies that the transfer amount is equal to the amount to be paid. And the transfer amount and the handling fee amount The sum of these amounts equals the locked amount. The fund transfer voucher is then submitted to the candidate area of the third stage slot. After passing the judgment, it is placed into the slot. The receiving terminal or transaction gateway server submits a settlement confirmation voucher containing the order element hash, the actual amount received, the payment channel receipt summary, and the receipt timestamp to the candidate area of the fourth stage slot. After passing the judgment, it is placed into the slot. The summaries of the four stage slots are aggregated into the candidate state root in the form of a hash tree and attached to their respective vouchers. Only the summaries of the effective stage enter the effective state root, so that each voucher in the transition candidate voucher set can be independently located and verified, and the coverage of the effective state root at any time is strictly equal to the number of effective stages of the order transaction package.
[0067] like Figure 3 As shown, S4. Based on the predecessor state proof and the deadline timestamp of each stage slot, combined with the corresponding threshold signature, a state transition guard system is constructed, and the transition judgment result is output according to the guard judgment formula; the guard judgment formula is as follows:
[0068] ;
[0069] In the formula, This is a Boolean variable; a value of true indicates that a transition is allowed, and a value of false indicates that a transition is prohibited; the symbol " " indicates a logical AND operation; Indicates the first The preceding state proof of the stage certificate is consistent with the effective state root that has been registered in the state root storage module; Indicates the first The status version number declared in the phase certificate is equal to the sum of the registered current status version number and one; This indicates that the current block timestamp has not exceeded the number obtained according to the timestamp calibration formula. The end timestamp of the phase; Indicates the first The signature verification of the stage voucher is successful: When choosing 1 or 2, the verification is performed using a combination of ordinary multisignature consisting of the order initiation terminal signature, the transaction gateway server endorsement, and the required signature share for that stage, without using the threshold public key corresponding to the amount level. When choosing 3 or 4, select the corresponding threshold public key to verify the threshold signature according to the amount level identifier declared in the voucher, and satisfy the preset signature threshold for that amount level; Indicates the first When the consistency check of the amount on the stage voucher is successful, When taking 1 or 2 Eternity is true, when Take 3 This means the transferred amount equals the amount to be paid. ,when When taking 4 This indicates that the actual amount received is not greater than the transferred amount, and the difference between the transferred amount and the actual amount received is... Not exceeding tolerance ; It is measured in cents and stored as an integer. The amount is determined by combining the additional deducted fees from the channel in the fee schedule and their rounding errors; if the actual amount received is greater than the transferred amount, If the condition is not met, it will be handled as an abnormal closed loop; the consistency of the amount is checked independently of the predecessor status proof check, and the two are not used interchangeably.
[0070] in, The determination is implemented as follows: the atomic settlement contract reads the registered summary in the state root storage module and reassembles and calculates it, and compares it with the summary carried by the submitted voucher. The comparison operation is a fixed-length byte string equality determination, which does not involve the original order text. Therefore, the calculation cost of a single determination is unrelated to the order detail size. The determination is implemented as follows: the current state version number maintained by the atomic settlement contract increments by one with each transition. When the same stage certificate is submitted repeatedly, its declared version number is equal to the registered value. When the submission is out of order, its declared version number is less than the registered value. Neither of these two situations satisfies "equal to the registered value plus one", so the determination is not valid. The contract rolls back the submission and adds the submitter's address to the suspicious list.
[0071] in, The determination is performed by the time window registration module when each block is generated: the transaction gateway server submits a batch inspection transaction once per block cycle. This transaction takes the current block timestamp as input, traverses the order transaction packages in the non-final state, and outputs a set of package identifiers whose current timestamp is greater than the deadline timestamp. The transaction gateway server submits the set of package identifiers to the atomic settlement contract with the unfreezing trigger transaction. If the transaction gateway server fails to submit within one block cycle after the deadline timestamp, any registered payment agent or consortium blockchain consensus node can submit a timeout proof to the atomic settlement contract. After verifying that the current block timestamp is greater than the deadline timestamp of the corresponding stage of the order transaction package, the atomic settlement contract directly performs unfreezing rollback on the order transaction package. The atomic settlement contract calls unfreezing rollback for each order transaction package in the set. The module returns the locked amount in the package to the respective payment party's account along the original transfer path, sets its status token to the unfrozen final state and writes it into the abnormal closed-loop record, so that the timeout judgment and unfreezing execution are connected in the same on-chain transaction, without relying on off-chain instructions; each batch of batch inspection transactions contains 500 package identifiers. Under an exemplary scale, based on an average of 500,000 daily order payments and an average order transit time and transit rate of about 3%, there are about 15,000 order transaction packages in the non-final state. Each round of traversal requires about 30 inspection transactions. The 30 inspection transactions are submitted at once within a 3-second block cycle, which is equivalent to about 30 transactions every 3 seconds on average. In the example with a preset peak throughput of 300 transactions per second, it occupies about 3.3% of the capacity, which is acceptable in engineering, and this method does not rely on off-chain timers and off-chain trusted clocks.
[0072] In stages 3 and 4, threshold signatures generate threshold keys according to the amount tier: for the 0-200 yuan tier, three five-threshold keys are generated from five signature share commitments: two from the payment terminal, two from the transaction gateway server, and one from the receiving terminal. The participating subset of the signature session is the aforementioned five shares. For the 200-2000 yuan tier and the tier greater than 2000 yuan tier, four six-threshold keys are generated from six signature share commitments: two from the payment terminal, two from the transaction gateway server, one from the receiving terminal, and one from the risk control node. The participating subset of the signature session is the aforementioned six shares. Furthermore, the signature session for the tier greater than 2000 yuan must include the share held by the risk control node and be accompanied by a risk control review identifier. The threshold public key, its total share, and the threshold number are registered together in the on-chain threshold configuration table. The contents of the threshold configuration table are entered into the configuration version digest. The atomic settlement contract only selects the corresponding threshold public key to verify the threshold signature in stages 3 and 4 according to the amount tier identifier declared in the certificate, so that the threshold number of each tier strictly corresponds to the share commitment at the time of key generation. Under any amount tier, the number of signature shares held by a single entity is lower than the threshold number of that tier, so a single entity cannot independently facilitate the transition. The risk control review identifier is the signature share made by the risk control node for its risk control conclusion digest, as well as the conclusion value, conclusion timestamp, and model version number of the conclusion. The conclusion value, conclusion timestamp, and model version number are entered into the configuration version digest. Phased voucher payload and participate in the first When the concatenation and calculation of the stage voucher summary yields a negative result... This is not true.
[0073] in, The required share is: A minimum requirement is that the order initiating terminal's signature and the transaction gateway server's endorsement must be both satisfied. When taking 2, the authorized signature share held by the payment agent's terminal must be included; Take 3 and When taking 4, the threshold number of the corresponding amount level must be met, and this threshold number is only verified by the threshold public key of the 3rd and 4th stages. The threshold public key of the amount level is not applicable to the 1st and 2nd stages.
[0074] S5. The state transition atomic execution model is used to convert the transition decision result of the guard decision into a settlement action. Combined with the transaction package concurrency conflict scheduling rules and the timeout unfreezing rollback mechanism, an order settlement scheduling scheme is output. The settlement cycle is calculated according to a periodic statistical formula, which is as follows:
[0075] ;
[0076] In the formula, For the first The settlement cycle for each order, in seconds; For the first The block timestamp in seconds at which the fourth-stage voucher for this order is confirmed and written; For the first The block timestamp in seconds at which the first-stage voucher for an order is confirmed and written. and Since they are taken from the same consortium blockchain network and use the same time base, It is a non-negative integer value in seconds.
[0077] Specifically, when the transition determination result of the guard decision is true, the atomic settlement contract sequentially executes four sub-steps in the same on-chain transaction: fund transfer, state version number auto-increment, state root update, and settlement event output. If any sub-step fails, the entire transaction is rolled back, ensuring that the stage state of the order transaction package and the balance of the escrow sub-account remain unchanged. When the transition determination result of the guard decision is false, the atomic settlement contract calls the unfreezing rollback module: if the failed item is... The locked amount will be immediately returned to the payer's account along the original transfer path, i.e., returned to the source address recorded in the fund custody certificate, without passing through any intermediary account; if the item fails... , or If any of the following conditions are met, the submission will only be rolled back and the balance of the escrow sub-account will not be changed. Furthermore, if the submission is initiated by a legitimate submitter address registered in that stage, it will only be counted once in the retry count for that stage. The maximum number of retry counts is set by the time limit configuration table according to the amount tier. Submissions initiated by illegitimate submitters will not be counted in the retry count, nor will they trigger unfreezing; they will only be rolled back and the submitter address will be added to the suspicious list. Failure items are... Submissions that are considered duplicates or out of order will not be counted in the number of retry attempts, so as to avoid exhausting the quota with invalid submissions and forcing normal orders to be unfrozen; once the number of retry attempts for a legitimate submitter in this stage reaches the upper limit, or the deadline timestamp of this stage is determined to have expired according to the timestamp marking formula, the same original return path will be triggered, so that the escrow sub-account will not be in a terminated state that cannot be skipped or unfrozen.
[0078] When the transition determination result is true and the fund transfer is executed, the atomic settlement contract completes three processes in a fixed order: deducting the amount allocated to each payer from their respective escrow sub-accounts, consolidating the deductions, and transferring the funds to the payee's account. The amount transferred to the payee's account is... ,in Phase 4 The tolerance range between the amount transferred at the time of establishment and the actual amount received; if there is no difference... The handling fee limit will be adjusted to... Subsequently, the allocated amount is deducted from each custodian sub-account and transferred to the consolidated clearing account registered on the transaction gateway server. This account then distributes the funds to the channel settlement account and custodian service account respectively, according to the payment channel fee rate table and custodian service fee rate table registered on-chain. The refunded amount is then returned from each custodian sub-account along its respective transfer path to the corresponding payer account. The refund amount for each payer is the difference between the locked amount in the payer's custodian sub-account, the amount allocated to that sub-account, and the adjusted handling fee amount allocated to that sub-account, expressed as an integer fraction. The sum of the amounts transferred from each of the three actions in each custodian sub-account is always equal to the locked amount in that sub-account. The sum of the total amounts transferred from all custodian sub-accounts is always equal to the total locked amount. After the actions are completed, the balance of each custodian sub-account is zero, therefore the handling fee is not refunded repeatedly. The three actions, along with the auto-incrementing status version number, the update of the effective status root, and the settlement event output, are bound to the same indivisible on-chain transaction. If any sub-step fails, the entire transaction is rolled back.
[0079] The actual amount received in the settlement confirmation voucher must match the transferred amount within the tolerance range. Internal consistency, exceeding tolerance shall be handled according to If the condition is not met, the submission will be rolled back and will not proceed to the fund transfer step. The actual amount received, the amount transferred, the difference between the two, and the payment channel receipt summary will all be written into the abnormal closed-loop record. The order transaction package will remain in a non-final state. The transaction gateway server will initiate a review within the remaining window of this stage based on the channel receipt registered on the chain, and the review will confirm the difference. The channel charges an additional fee and Yes, the atomic settlement contract will adjust the transaction fee limit to and will If the transaction is registered as a verified channel, an additional fee will be deducted; the transaction gateway server will then resubmit the settlement confirmation voucher accordingly. By "Actual Amount Received + "Compare with the transferred amount (this review scenario is S4 general)" (Exceptions to the rules); when the transition takes effect, the fee payment and settlement described in S5 will be executed according to the adjusted fee amount, and according to "locked amount - - The adjusted handling fee amount will be refunded to ensure that the sum of the three transferred amounts is always equal to the locked amount. If the review fails or the deadline of this stage expires, the locked amount in the package will be refunded to the accounts of the respective payers along the same original refund path, so that there are no cases of funds being left idle due to discrepancies in the amounts. The actual amount received is not declared unilaterally by the receiving terminal, but is based on the payment channel receipt. The transaction gateway server stores the original receipt in off-chain object storage, writes the receipt summary and receipt amount into the settlement confirmation document payload and participates in the document summary concatenation. The atomic settlement contract compares the receipt amount in the payload to ensure that it matches the actual amount received before proceeding. Judgment: Refunds and reversals are handled separately using an independent certificate chain and do not change the effective status of this order transaction package.
[0080] Concurrent transition conflicts within the same order transaction package are handled according to the transaction package concurrent conflict scheduling rules: The transaction gateway server sets a distributed lock using the package identifier as the key. The lock's validity period is the smaller of sixty seconds and one-tenth of the corresponding stage time limit. The lock's holding period is capped at the round-trip time from submission to consensus confirmation, ensuring the lock duration matches the concurrent operation duration and is not affected by other factors. If a value of one hour or day is used to block the submission of other stages of the same order transaction package for an extended period; in the event of lock failure or message retransmission, the guard decision formula shall apply. As a last line of defense, later commits are rolled back if the version number does not meet the strict increment requirement, thus preventing the separation of records where the status has been updated but the balance has not changed, or the balance has changed but the status has not been updated.
[0081] The settlement cycle obtained according to the aforementioned periodic statistical formula is written into the settlement quality ledger: Assuming a block interval of three seconds, the actual test sample consisted of one thousand orders using the aforementioned instant payment time limit configuration. The payment receipts and confirmations were automatically generated by the platform. The test results showed that all orders migrated to the settlement completion status, with an average settlement cycle of 5.2 seconds and a 99th percentile of 12.4 seconds. For physical delivery orders, the settlement cycle was affected by… and Constraints are based on the completion time of the transaction packet state transition, not on on-chain second-level cycles; the actual transition time is calculated separately for each stage, and the actual transition time is the difference in seconds between the timestamp of the block where the certificate is confirmed and written in the next effective stage and the timestamp of the block where the certificate is confirmed and written in the current effective stage; the first... The 95th percentile of the actual transition time in the stage and the corresponding Comparison, when it exceeds When the threshold is 80%, the transaction gateway server generates an upward adjustment proposal monthly, which, after being processed through on-chain governance transactions or multi-signature authorization, lowers the amount to the corresponding level for that phase. Increase the value by one level; when the value does not exceed the limit for two consecutive statistical periods. When the value reaches 50%, the transaction gateway server generates a downward proposal, which, after on-chain governance transactions or multi-signature authorization, lowers the value by one level. Adjustments are based solely on the time consumed in each of its own stages, and are not mixed with the overall order settlement cycle. The settlement cycle is only used for external service statistics. When the value of a stage is already at the highest level of the time limit configuration table, it will not be adjusted upwards; when it is already at the lowest level, it will not be adjusted downwards, thus defining the adjustment actions at the boundary levels. For physical delivery orders, and The adjustment will be based on the arrival time of the delivery receipt and confirmation receipt, and will not use the on-chain second-level cycle as the assessment criterion.
[0082] In practical applications, the order transaction package's amount tier is first associated with the time limit configuration table and signature threshold to ensure that high-amount orders have stronger signature constraints and longer confirmation windows during state transitions. When handling concurrent conflicts, the transition judgment result of the guard judgment method is used as the core basis. Packages judged as genuine are prioritized for fund transfer; packages judged as false only undergo guard judgment in the contract and are rolled back without entering the fund transfer, state version number auto-increment, and state root update sub-steps. Their subsequent computational overhead is lower than that of packages judged as genuine, and the transaction gateway server will not queue them again in the same round of inspection. An example of a dynamically adjusted scenario is as follows: When the platform enters a major promotional event and the peak throughput reaches a preset high peak, the transaction gateway server can extend the third phase of newly created orders after the governance transaction takes effect, after on-chain governance transaction or multi-signature authorization. Furthermore, the system increases the batch size of inspected transactions to prevent delayed receipts from triggering mass unfreezing. The deadline timestamps of existing orders already on the blockchain cannot be unilaterally modified by the transaction gateway server. If an extension is necessary, the configuration version summary must be updated through on-chain governance, and the corresponding stage certificate must be regenerated and re-signed; otherwise, the original deadline timestamp will apply. When the total order amount in a certain segment exceeds 2,000 yuan, the system immediately raises the signature threshold for that segment and adds a risk control review flag to ensure that capital constraints take effect before status updates. When all sorting nodes become disconnected and stop producing blocks, the transaction gateway server enters a degraded mode. New orders are only written to the local message table for queuing. The stage status of existing on-chain order transaction packages and the balance of escrow sub-accounts remain unaffected. After block production resumes, orders are replayed in order of status version number to avoid reverse transitions. After the dynamic order settlement scheduling scheme is output, it is synchronized to all terminals and business sides, and the scheme is adjusted in real time to ensure that settlement resources and capital constraints are tilted towards high-risk, high-amount orders.
[0083] like Figure 4 The diagram shown is a system block diagram of a blockchain-based order payment transaction settlement system provided in an embodiment of the present invention. The system includes:
[0084] The order transaction package construction module is used to construct order transaction packages. It encapsulates the payment request voucher, fund custody voucher, fund transfer voucher and settlement confirmation voucher into the four stage slots of the same order transaction package according to the stage sequence number, and generates a predecessor status certificate and status version number for each stage voucher, and outputs a unified transaction data base.
[0085] The escrow sub-account module is used to establish an escrow sub-account corresponding to the unique identifier of the order transaction package based on the unified transaction data base, verify and lock the amount to be paid according to the limit verification method, and output the limit verification result and fund custody certificate.
[0086] The time window registration module is used to mark the time limit of the four stage slots, generate and register the end time stamp of each stage according to the timestamp marking formula, and compare the current block timestamp when each block is generated.
[0087] The state root storage module is used to store the effective state root and the candidate state root respectively using the hash tree root value. At any given time, the effective state root only covers the credential digest of the effective stage, and the candidate state root is attached with the credential and does not enter the effective state root.
[0088] The state machine verification module is used to perform state transition guard determination according to the guard determination formula based on the candidate state and effective state of each stage slot. and Perform the predecessor state proof verification and the amount consistency verification respectively, and output the transition determination result;
[0089] The conditional transfer module is used to execute fund transfers when the transition determination result indicates that a transition is allowed, and to bind the fund transfer, state version number auto-increment, state root update, and settlement event output into a single indivisible on-chain transaction; it is also used to verify and confirm discrepancies in the amount consistency check as channel-specific deductions. At that time, the handling fee will be transferred and cleared according to the adjusted handling fee amount, and the settlement confirmation voucher will be resubmitted.
[0090] The unfreezing and rollback module is used to return the locked amount in the escrow sub-account along the transfer path according to the apportionment of each payer and generate an abnormal closed loop record when the jump determination result is a prohibited jump and the failure item is that the time window validity condition is not met, or when one of the following three situations occurs: the number of retry attempts of the legitimate submitter reaches the upper limit, the deadline timestamp of this stage expires, or the amount consistency verification review fails.
[0091] The settlement event output module is used to output settlement events and statistically analyze the settlement cycle according to the stated cycle formula, so that the business side can subscribe to and record the settlement quality ledger. The business side uses the on-chain query results of the status root storage module as the source of facts for the order settlement status.
[0092] It should be understood that, Figure 4 The system of the illustrated embodiment can be used to perform corresponding operations. Figure 1 The steps in the method embodiments shown are implemented in a similar manner and have similar technical effects, and will not be repeated here.
[0093] Through the above embodiments, this invention constructs an order transaction package and encapsulates the payment request voucher, fund custody voucher, fund transfer voucher, and settlement confirmation voucher into four stage slots according to stage sequence numbers, outputting a unified transaction data base; establishes a custody sub-account and locks the amount to be paid according to the quota verification method, outputting the quota verification result; marks the stage time limit and generates the end time stamp of each stage according to the timestamp marking method, and writes the voucher digest into the state root storage module using a hash tree; performs state transition guard judgment according to the guard judgment method based on the predecessor state proof, state version number, end time stamp, and threshold signature; atomically executes fund transfer, version number auto-increment, state root update, and event output in the same on-chain transaction according to the transition judgment result, and unfreezes the locked amount along the original transfer path when the time window expires, outputting an order settlement scheduling scheme. Thus, it can dynamically determine the settlement action according to the voucher completeness and time constraints of each stage of the order payment, eliminate the intermediate state of suspended funds, and shorten the payment settlement cycle.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A blockchain-based order payment transaction settlement method, characterized in that, Includes the following steps: Step S1. Construct the order transaction package; In the order transaction package, a first-stage slot, a second-stage slot, a third-stage slot, and a fourth-stage slot are set according to the stage sequence number, and the first-stage slot to the fourth-stage slot constitute an ordered slot sequence; Assign a transaction package identifier to the order transaction package; The payment request certificate generated by the order initiation terminal is submitted to the candidate area of the first stage slot, and the payment request certificate contains a configuration version summary; After the write is confirmed by the consortium blockchain network, the payment request certificate is placed into the first stage slot, and the status version number of the first stage slot is set to the initial value. The slot for a stage without an inserted voucher is a null value placeholder. Output a unified transaction data platform; Step S2. Based on the unified transaction data base, establish a custodian sub-account corresponding to each payer using a composite key formed by the transaction package identifier and the payer identifier in the payment request certificate; Verify whether the available balance in the payer's account covers the sum of the amount to be paid and the handling fee limit based on the credit limit verification relationship; Upon coverage, the amount to be paid and the handling fee amount are locked, and a fund custody certificate is generated; The fund custody certificate is submitted to the candidate area of the second stage slot, and after passing the judgment, it is placed into the second stage slot; The preceding status proof of the fund custody certificate points to the first-stage certificate summary; The status version number of the fund custody certificate is the value incremented from the initial value; Step S3. Define the time limit for each stage from the first stage slot to the fourth stage slot, and generate the end time stamp for each stage based on the time reference stamp and the time limit. The state root storage module registers the credential digests of the effective phase as the effective state root; When a stage credential is submitted to the candidate area, the stage credential summary and the deadline timestamp are aggregated into a candidate state root and attached to the stage credential submitted to the candidate area, without being written to the state root storage module. Generate a precursor state proof for each stage of the credential, wherein the precursor state proof is associated with the previous stage credential summary, the state version number of the current stage credential declaration, and the configuration version summary; Step S4. Construct a state transition guard system based on the predecessor state proof of each stage slot, the deadline timestamp, and the threshold signature; The transition determination result is output according to the guard determination relationship. The guard determination relationship includes the predecessor state proof being consistent with the effective state root, the state version number being the value of the registered state version number incremented, the current block timestamp not exceeding the deadline timestamp, signature verification being successful, and amount consistency verification being successful. Step S5. Adopt the state transition atomic execution model. When the transition determination result is that the transition is allowed, the atomic settlement contract atomically executes the fund transfer, state version number increment, effective state root update and settlement event output in the same on-chain transaction. If any of the following situations occur: the jump determination result is that jump is prohibited and the time window expires, the cumulative number of retry attempts initiated by the submitter registered in this stage reaches the retry threshold corresponding to this stage, the deadline time stamp expires, or the amount consistency verification fails, the amount locked in the escrow sub-account will be returned along the transfer path according to the apportionment amount. Output the order settlement and scheduling plan.
2. The blockchain-based order payment transaction settlement method according to claim 1, characterized in that, In step S1, the payment request certificate includes the order element hash, the amount to be paid, the set of payer identifiers, the amount tier identifier, the configuration version summary, the order initiating terminal signature, and the transaction gateway server endorsement. Each payer identifier in the set of payer identifiers is associated with an apportionment amount and an authorized signature, and the amount to be paid is equal to the sum of each apportionment amount; Each stage slot has a candidate state and an effective state. The candidate state indicates that the credential has been submitted but has not passed the state transition guard judgment. The effective state indicates that the judgment has passed and the state version number and the effective state root have been updated.
3. The blockchain-based order payment transaction settlement method according to claim 2, characterized in that, In step S2, the credit limit verification relationship is that the available balance of the payer's account in the atomic settlement contract is not less than the sum of the amount to be paid and the handling fee limit; When the set of payer identifiers contains multiple payer identifiers, the available balance of each payer account is not less than the sum of its share and the share of handling fees, the sum of each share equals the amount to be paid, and the sum of each share of handling fees equals the handling fee limit. The fund custody certificate contains the authorized signature share held by the payment agent's terminal.
4. The blockchain-based order payment transaction settlement method according to claim 3, characterized in that, In step S3, the deadline timestamps of each stage are based on the block timestamp when the payment request certificate is confirmed and written by the consortium blockchain network. The deadline timestamps of subsequent stages are based on the block timestamp when the certificate of the previous stage is confirmed and written by the consortium blockchain network. The effective state root registers the credential digest of the effective stage with the hash tree root value, and the candidate state root is only attached to the credential and does not enter the effective state root; For order transaction packages that have been uploaded to the blockchain, the configuration version summary in the subsequent stage of certificate summary calculation is taken from the configuration version summary of the payment request certificate in the first stage slot.
5. The blockchain-based order payment transaction settlement method according to claim 4, characterized in that, In step S4, the signature verification includes: the first-stage certificate is signed by the order initiating terminal and endorsed by the transaction gateway server for verification; the second-stage certificate must also contain the authorized signature share; the third-stage certificate and the fourth-stage certificate select the threshold public key corresponding to the amount level identifier to verify the threshold signature and satisfy the signature threshold corresponding to the amount level identifier. The consistency verification of the amount includes: the transfer amount of the third-stage voucher is equal to the amount to be paid, and the actual amount received by the fourth-stage voucher is not greater than the transfer amount and the difference between the transfer amount and the actual amount received does not exceed the tolerance threshold.
6. The blockchain-based order payment transaction settlement method according to claim 5, characterized in that, In step S5, when the transition determination result is that the transition is allowed, the atomic settlement contract deducts the amount from the corresponding escrow sub-account according to the share of each payer and transfers it to the payee's account. The handling fee is deducted from each escrow sub-account to the consolidated clearing account according to the handling fee amount after the channel receipt is verified. The refund amount is returned to the corresponding payer's account along each transfer path. The sum of the three amounts transferred out of each escrow sub-account is equal to the amount locked in the escrow sub-account. If the reason for prohibiting jump is that the time window has expired, immediately execute the original rollback; When the reason for prohibiting the jump is any of the following: inconsistent predecessor state proof, signature verification failure, or amount consistency verification failure, only rollback is performed, and the number of retry attempts is accumulated when the submitter registered in this stage initiates the submission. When the number of retry attempts reaches the retry attempt threshold corresponding to this stage or the deadline timestamp expires, the original path is reversed. Concurrent submissions of the same order transaction package are subject to concurrent locks set by the transaction package identifier and ordered constraints by the status version number.
7. The blockchain-based order payment transaction settlement method according to claim 6, characterized in that, In step S1, the order transaction package stores the voucher summary, status version number, and deadline timestamp of each stage on the chain in a fixed-length structure, while the original voucher text and order details are stored in off-chain object storage. The transaction gateway server submits batch inspection transactions according to the block cycle, traverses non-final state order transaction packets, and outputs a set of timeout packet identifiers. If any registered payment agent or consortium blockchain consensus node fails to submit a timeout proof to the transaction gateway server on time, it will trigger an unfreezing rollback.
8. The blockchain-based order payment transaction settlement method according to claim 7, characterized in that, In step S5, a stage time limit adjustment proposal is generated based on the comparison results between the actual transition time of the stage and the corresponding stage time limit. The settlement period is the difference between the block timestamp when the fourth-stage voucher is confirmed and written and the block timestamp when the first-stage voucher is confirmed and written. The business side uses the on-chain query results of the state root storage module as the source of the order settlement status facts.
9. A blockchain-based order payment transaction settlement system, characterized in that, include: The order transaction package construction module is used to construct order transaction packages; four stage slots are set in the order transaction package according to the stage sequence number; the payment request voucher, fund custody voucher, fund transfer voucher and settlement confirmation voucher are respectively encapsulated into the four stage slots; a predecessor status certificate and status version number are generated for each stage voucher; a transaction package identifier is assigned to the order transaction package; and a unified transaction data base is output to the custody sub-account module. The escrow sub-account module is used to establish an escrow sub-account corresponding to the transaction package identifier based on the unified transaction data platform; and to verify and lock the amount to be paid and the handling fee limit according to the limit verification relationship. It also outputs the fund custody certificate to the time window registration module and the state machine verification module; The time window registration module is used to mark the stage time limit of the four stage slots and generate the end time stamp of each stage; and compare the current block timestamp when each block is generated. It also outputs the deadline timestamps for each stage to the state machine verification module; The state root storage module is used to store the effective state root and the candidate state root respectively using the hash tree root value. The effective state root only covers the credential digest of the effective stage, and the candidate state root is attached with the credential and does not enter the effective state root. The module also outputs the effective state root to the state machine verification module. The state machine verification module is used to perform state transition guard determination based on the candidate state and effective state of each stage slot according to the guard determination relationship; The transition determination result is output to the conditional transfer module and the unfreeze rollback module; The conditional transfer module is used to execute fund transfer when the transition determination result is that the transition is allowed, and bind the fund transfer, the status version number auto-increment, the effective status root update and the settlement event output into the same on-chain transaction; and output the settlement event to the settlement event output module; The unfreezing and rollback module is used to return the locked amount in the escrow sub-account along the transfer path according to the apportionment amount and generate an abnormal closed loop record when any of the following situations occur: the jump determination result is a prohibited jump and the time window fails, the number of retry attempts reaches the retry number threshold, the deadline timestamp expires, or the amount consistency verification fails; and outputs the abnormal closed loop record to the settlement event output module. The settlement event output module is used to output settlement events and record the settlement quality ledger according to the settlement cycle. It also outputs settlement events and settlement quality ledgers to the business-side subscription end.
10. The blockchain-based order payment transaction settlement system according to claim 9, characterized in that, The conditional transfer module is also used to deduct and transfer the amount from the corresponding escrow sub-account to the payee's account according to the payer's share. The handling fee will be deducted from the consolidated clearing account according to the handling fee amount verified by the channel receipt; The refund amount will be returned to the corresponding payer's account along each of the transfer paths; The unfreeze rollback module is also used to immediately perform a rollback to the original path when the reason for prohibiting jump is that the time window has failed. If the reason for prohibiting the jump is any of the following: inconsistent proof of the predecessor state, failure of signature verification, or failure of amount consistency verification, only rollback will be performed, and the number of retry attempts will be accumulated when the submitter registered at this stage initiates the submission. The settlement event output module is also used to generate a stage time limit adjustment proposal based on the comparison results between the actual transition time of a stage and the corresponding stage time limit.
Citation Information
Patent Citations
A method and system for making payments on behalf of others
CN108256843B
Block chain-based bank payment method and related device
CN116823267A
Method and system for block chain transaction fee payment-for-another management
CN120047138A
Business processing method and device, storage medium, equipment and program product
CN122714023A
