A reversible voucher chain processing method for rebate invoice deduction in a network freight platform

CN123014843APending Publication Date: 2026-10-30BENGBU FULL CHAIN LOGISTICS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611204887.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本发明的目的是提供一种网络货运平台中返利发票核减的可逆凭证链处理方法,以解决现有技术中返利入账凭证与发票核减凭证之间实际缺少能反向追踪的链式关系,无法沿原始返利凭证进行可逆迁移和核查的技术问题

Benefits of technology

迁移后得到的补偿结果仍通过凭证链记录。本发明具有以下优点:本发明在网络货运平台中,将运单、返利入账、货主账单、发票明细、核减动作和撤销动作组织为可追溯的返利发票核减凭证链;同时将返利金额从简单状态字段转换为可核减、冻结占用、已核减、异常挂起和恢复释放等金额状态池,并通过状态池迁移表达发票生命周期变化。由此实现了单纯依赖阈值、字段顺序或多维数据一致性校验的技术方案,能够在真实网络货运结算场景中,以返利凭证链和金额状态池为核心处理载体,使返利金额在发票生命周期内可被占用、确认、释放、恢复和补偿,从而提升发票核减处理的可追溯性、幂等性和可逆性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123014843A_ABST
    Figure CN123014843A_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of network freight platform data processing, and discloses a reversible voucher chain processing method for rebate invoice deduction in a network freight platform, comprising the following steps: S1, rebate entry, generating a rebate source voucher; S2, amount state pool initialization, the amount state pool is initially the original rebate amount; S3, invoice detail generation, determining the current continuous deduction amount; S4, searching and sorting, obtaining a rebate source voucher set and sorting the rebate source vouchers; S5, sequential occupation, invoice pre-occupation and sequential distribution; S6, deduction confirmation, generating a deduction confirmation voucher. The present application enables the rebate amount to be occupied, confirmed, released, recovered and compensated within the life cycle of the invoice, thereby improving the traceability, idempotency and reversibility of invoice deduction processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data processing technology for online freight platforms, and specifically relates to a method for processing reversible voucher chains for deducting rebate invoices in online freight platforms. Background Technology

[0002] In the logistics transactions of online freight platforms, the platforms typically generate various types of expense data related to waybill fulfillment, oil and gas resource procurement, freight settlement, customer reconciliation, and invoice issuance. To enhance customer loyalty, encourage driver or carrier cooperation, and align with the platform's resource procurement policies, the platform generates different types of rebates or commissions from fuel cards, gas cards, freight, service fees, subsidies, or project settlements. These rebates may initially be credited to the account balance of the shipper, driver, carrier, or project entity, but the corresponding invoice issuance, invoice reversal, invoice cancellation, or reissue often occur in subsequent stages. Common practices on existing online freight platforms include: recording a balance transaction when rebates are credited; recalculating the deductible amount based on the waybill or bill amount when issuing invoices; and having finance personnel or programs perform field comparisons or manual adjustments based on the order, bill, and invoice status during invoice processing.

[0003] Existing technologies lack the ability to effectively track or reflect changes in the invoice lifecycle after the rebate amount is credited, such as subsequent invoicing, confirmation, cancellation, or deletion. This results in a lack of traceability, idempotency, and reversibility in invoice reduction processing, making it difficult to effectively track the intermediate states of invoices during this process. Systems often rely on re-querying waybills or billing data, and there is actually no reverse-tracking chain relationship between the rebate crediting voucher and the invoice reduction voucher, making it impossible to perform reversible migration and verification along the original rebate voucher. Summary of the Invention

[0004] The purpose of this invention is to provide a reversible voucher chain processing method for rebate invoice deduction in online freight platforms, so as to solve the technical problem that there is actually no chain relationship that can be traced back in the prior art between rebate accounting vouchers and invoice deduction vouchers, and it is impossible to perform reversible migration and verification along the original rebate vouchers.

[0005] The reversible voucher chain processing method for rebate invoice reduction in an online freight platform includes the following steps: Includes the following steps: S1. Rebate receipt, generate rebate source voucher; S2. Initialize the amount status pool. The amount status pool is initially set to the original rebate amount. S3. Invoice details are generated, and the amount that can still be deducted is determined. S4. Search and sort: Query and obtain the set of rebate source vouchers and sort the rebate source vouchers; S5. Sequential occupancy, invoice pre-occupancy and sequential allocation; S6. Confirm the reduction and generate a reduction confirmation voucher; The rebate source voucher must include at least: platform identifier, cargo owner identifier, waybill identifier, bill identifier, rebate type, rebate source, original rebate amount, balance entry record identifier, voucher version number, voucher status, previous voucher summary, and current voucher summary; set the rebate source voucher status to "deductible", and generate a new chain voucher node for each subsequent invoice action, starting from the rebate source voucher; the chain voucher node includes the rebate source voucher, the deduction voucher, and the deduction confirmation voucher.

[0006] Preferably, in step S2, the initial amount state pool is the original rebate amount A_i. For each rebate source voucher P_i, this step splits the original rebate amount into the following amount state pools: The deductible amount pool C_i represents the amount that has not yet been used by invoices and can be used for subsequent invoice deductions; The frozen amount pool F_i represents the amount that has been used by an invoice application or invoice details, but has not yet entered the final deduction confirmation state; The deducted amount pool R_i represents the amount that has been deducted from the invoice along with the invoice confirmation action; The abnormal suspended amount pool H_i represents the amount for which subsequent deduction processing is temporarily suspended due to abnormalities in the voucher chain or accounting data; The cumulative value of the released amount L_i represents the cumulative amount that was previously occupied or confirmed and then released back to a deductible state through cancellation, deletion or reopening actions; Furthermore, the amount status pool related to the rebate source voucher should satisfy the amount conservation relationship: A_i = C_i + F_i + R_i + H_. By utilizing the principle of monetary conservation, it is possible to verify whether the rebate amount has experienced abnormal drift after each migration.

[0007] Preferably, in step S3, when applying for an invoice, a corresponding invoice detail set I_A is generated, which includes several invoice details, denoted by I_j, representing the j-th invoice detail record; the invoiceable amount corresponding to invoice detail I_j is B_j, and the already used and deducted amount is N_j; thus, the current deductible amount D_j is determined, calculated as follows: D_j=max(B_j-N_j,0), which means that when the already used and deducted amount exceeds the invoiceable amount, the current deductible amount is recorded as zero; otherwise, the difference between the invoiceable amount and the already used and deducted amount is calculated.

[0008] Preferably, in step S4, the system queries the rebate source vouchers that are in the same deductible business domain as the invoice details I_j, and obtains the rebate source voucher set S_j, as shown in the following expression: S_j={P_i|C_i>0,H_i=0,P_i and I_j belong to the same cargo owner, the same waybill, or the same bill of exchange within the scope of deduction}; The set S_j is stably sorted according to the waybill completion time, rebate posting time, bill generation time, and voucher identifier. The specific sorting method includes: for each rebate source voucher P_i after sorting, the amount occupied X_ij in this instance is calculated as follows: X_ij=min(C_i,D_j-ΣX_kj), where ΣX_kj is the cumulative amount occupied from previous rebate source vouchers in the current invoice details, and k is the total number of times the amount has been occupied before this instance.

[0009] Preferably, in step S5, when X_ij>0, the amount state pool is migrated, expressed as: C_i=C_i-X_ij, F_i=F_i+X_ij, N_j=N_j+X_ij; at the same time, a deduction voucher O_ij is generated and connected to the rebate source voucher P_i; if the cumulative amount ΣX_ij occupied by the current invoice details from the rebate source voucher reaches the current deductible amount D_j, then the occupation of subsequent rebate source vouchers is stopped.

[0010] Preferably, in step S5, when the deductible amount in the rebate source voucher P_i is greater than the current deductible amount in the invoice detail I_j, the entire rebate voucher is not bound to the invoice, but is logically split; the splitting result includes the occupied sub-voucher P_i_use and the remaining sub-voucher P_i_left, and the splitting expression is as follows: P_i_use.amount=D_j-ΣX_kj, P_i_left.amount=C_i-(D_j-ΣX_kj), where P_i_use.amount represents the amount of the occupied sub-voucher, and P_i_left.amount represents the amount of the remaining sub-voucher; The corresponding amount migration is: F_i=F_i+(D_j-ΣX_kj), C_i=C_i-(D_j-ΣX_kj), which represents the migration that occurs in the amount status pool during the partial reduction and splitting process; among them, the occupying sub-voucher P_i_use is associated with the reduction occupying voucher O_ij, and the remaining sub-voucher P_i_left inherits the business domain, waybill, bill and balance flow information of the rebate source voucher and continues to be retained in the deductible amount pool.

[0011] Preferably, in step S6, when the invoice status enters the reduction confirmation state, the system reads the set of reduction occupancy vouchers O_j associated with the invoice; for each reduction occupancy voucher O_ij, its occupancy amount X_ij is obtained, and a confirmation migration is performed, with the following expression: F_i=F_i-X_ij, R_i=R_i+X_ij; at the same time, a reduction confirmation voucher Q_ij is generated; the prevHash of the reduction confirmation voucher Q_ij points to the hash of O_ij, and the hash of the reduction confirmation voucher Q_ij is calculated according to the invoice identifier, invoice detail identifier, confirmation action type, confirmation amount, batch number, and voucher version number; after the confirmation is completed, the system updates the reduced amount of the invoice details and changes the corresponding rebate amount from the frozen occupancy state to the reduced state.

[0012] Preferably, the method generates an action fingerprint FP for each amount migration. The expression for the action fingerprint generation method is as follows: FP = Hash(Platform Identifier + Shipper Identifier + Waybill Identifier + Rebate Source Voucher Identifier + Invoice Detail Identifier + Action Type + Batch Number + Amount Range + Current Voucher Version Number), where the action type includes: pre-occupancy, reduction confirmation, cancellation recovery, abnormal suspension, and compensation release. Before executing any amount migration, the system first queries the action fingerprint record: if the action fingerprint FP already exists, it is determined that the action has already been executed, and the current amount migration is skipped, only the existing processing result is returned; if the action fingerprint FP does not exist, the amount migration is executed, the corresponding voucher node is generated, and the action fingerprint FP is saved.

[0013] Preferably, the chained voucher node also includes a recovery voucher; when an invoice reverse lifecycle event occurs, the system reverses the voucher chain to locate the deduction occupancy voucher O_ij and deduction confirmation voucher Q_ij related to the invoice; the system performs recovery migration for different states based on the current state of the amount; after recovery, a recovery voucher U_ij is generated, and the prevHash of the recovery voucher U_ij points to the deduction confirmation voucher Q_ij or the deduction occupancy voucher O_ij based on the state of the amount before recovery, and the occupied or deducted amount is reversed along the voucher chain.

[0014] Preferably, the chained voucher node also includes an abnormal suspended voucher; directional detection is performed at control points that may change the amount status or voucher chain status; when an abnormal voucher or amount is detected, an abnormal suspended voucher is generated and abnormal suspension is executed; during abnormal suspension, the system migrates the amount Y_i involved in the abnormality from its current amount pool to the abnormal suspended amount pool H_i, and generates an abnormal suspended voucher G_ij; abnormal suspension compensation is performed: during compensation recovery, the system selects a compensation action according to the abnormality type and detection control point recorded in the abnormal suspended voucher G_ij; after compensation is completed, the abnormal suspended amount pool H_i is migrated to the corresponding state according to the compensation conclusion, including any one of the following migrations: H_i→C_i: Released as an amount that can be deducted again; H_i→R_i: Confirmed that the reduction has been made; H_i→F_i: Restore to frozen state; H_i → Settlement Closure: Confirmed manually or according to platform rules as no longer eligible for reduction. The compensation results obtained after migration are still recorded through the voucher chain. This invention has the following advantages: In a network freight platform, this invention organizes waybills, rebate receipts, shipper invoices, invoice details, reduction actions, and cancellation actions into a traceable rebate invoice reduction voucher chain; simultaneously, it transforms the rebate amount from simple status fields into a pool of amount statuses such as deductible, frozen, reduced, abnormally suspended, and restored, and expresses the changes in the invoice lifecycle through state pool migration. This achieves a technical solution that does not rely solely on thresholds, field order, or multi-dimensional data consistency verification. In real network freight settlement scenarios, with the rebate voucher chain and amount status pool as the core processing carrier, the rebate amount can be occupied, confirmed, released, restored, and compensated within the invoice lifecycle, thereby improving the traceability, idempotency, and reversibility of invoice reduction processing.

[0015] Building upon this foundation, the present invention also implements partial deduction splitting and sequential occupancy to prevent the same amount from being deducted repeatedly or missed. Furthermore, it enables idempotent migration through action fingerprints in situations where actions such as invoicing, confirmation, cancellation, deletion, and re-invoicing may be triggered repeatedly. Moreover, in cases of broken voucher chains, abnormal balance flows, missing invoice details, or non-conservative amounts, the present invention can suspend abnormal amounts and create a compensable and recoverable processing path. Attached Figure Description

[0016] Figure 1 This is a basic flowchart of a reversible voucher chain processing method for deducting rebate invoices in an online freight platform according to the present invention.

[0017] Figure 2 This is a schematic diagram of the monetary state pool transition relationship in this invention. Figure 3 This is a schematic diagram illustrating the apportionment of multiple rebates on a single invoice in Example 3 of this embodiment of the invention. Detailed Implementation

[0018] The following detailed description of the embodiments, with reference to the accompanying drawings, will further illustrate the specific implementation of the present invention, in order to help those skilled in the art to have a more complete, accurate, and in-depth understanding of the inventive concept and technical solution of the present invention.

[0019] In the following description of the specific implementation, the core parameter symbols and voucher types involved in the present invention are collectively defined as shown in Table 1.

[0020] Table 1. Meaning of core parameter symbols and voucher types in this invention.

[0021] like Figure 1 , Figure 2 As shown, this invention provides a method for processing reversible voucher chains for deducting rebate invoices in online freight platforms, including the following steps: S1. Rebate recorded, generating rebate source voucher.

[0022] In this step, after the rebate is credited, the rebate crediting record is read to determine the rebate recipient, rebate type, rebate source, original rebate amount A_i and its associated waybill or bill.

[0023] For each rebate eligible for invoice deduction, generate a rebate source voucher P_i. In this step, a unique rebate source voucher identifier PID_i is generated, and PID_i is mapped to the balance deposit record, waybill identifier, invoice identifier, and cargo owner identifier.

[0024] Calculate the rebate source voucher summary: Hash_i = Hash(Platform ID + Shipper ID + Waybill ID + Rebate Type + A_i + Transaction Flow ID + Creation Time + Version Number).

[0025] Optionally, the rebate source voucher summary can also be implemented through database version number, electronic signature, tamper-proof log or blockchain storage.

[0026] The rebate source voucher must include at least the following: platform identifier, cargo owner identifier, waybill identifier, bill identifier, rebate type, rebate source, original rebate amount A_i, balance deposit record identifier, voucher version number, voucher status, previous voucher summary, and current voucher summary.

[0027] Set the status of the rebate source voucher to "deductible" and wait for subsequent invoice actions to trigger the amount migration. Starting from the rebate source voucher P_i, each subsequent invoice action does not directly overwrite the original voucher, but instead generates a new chain of voucher nodes.

[0028] S2. Initialize the amount status pool. The amount status pool is initially set to the original rebate amount.

[0029] The expression for initializing the amount state pool is as follows: C_i=A_i, F_i=0, R_i=0, H_i=0, L_i=0.

[0030] For each rebate source voucher P_i, this step splits the original rebate amount A_i into multiple amount status pools. C_i is the deductible amount pool, representing the amount not yet occupied by an invoice and available for subsequent invoice deduction; F_i is the frozen amount pool, representing the amount occupied by an invoice application or invoice details but not yet in the final deduction confirmation state; R_i is the deducted amount pool, representing the amount that has been deducted along with the invoice confirmation action; H_i is the abnormal suspended amount pool, representing the amount whose subsequent deduction processing has been temporarily suspended due to voucher chain or accounting data anomalies; and L_i is the cumulative value of the restored and released amount, representing the cumulative amount that was previously occupied or confirmed and then released back to the deductible state through cancellation, deletion, or reopening actions.

[0031] At any given moment, the amount status pool related to the rebate source voucher should satisfy the amount conservation relationship: A_i = C_i + F_i + R_i + H_i.

[0032] The cumulative value of the recovered release amount L_i is used as the cumulative value of the process and is not repeatedly included in the current balance conservation formula. Instead, it is used to reflect the number of historical reversible migrations and the scale of recovery in the voucher chain.

[0033] Optionally, the amount status pool can be implemented through a single table with multiple fields, a transaction event table, an accounting entry table, or an event tracing model, as long as the status transition relationships of deductible, frozen, deducted, and abnormally suspended are retained.

[0034] The core migration rules between the amount state pools are summarized in Table 2.

[0035] Table 2 Core Transition Rules for the Amount State Pool

[0036] The aforementioned technological innovations enhance the verifiability of accounting status; through the amount conservation relationship of A_i=C_i+F_i+R_i+H_i, it is possible to verify whether the rebate amount has abnormally drifted after each migration.

[0037] S3. Invoice details are generated, and the amount that can be deducted continues to be determined.

[0038] When applying for an invoice, a corresponding invoice detail set I_A is generated, which includes several invoice details. I_j represents the j-th invoice detail record.

[0039] The invoice amount corresponding to invoice detail I_j is B_j, and the amount already used and deducted is N_j; thus, the current amount that can continue to be deducted, D_j, is determined by the following formula: D_j=max(B_j-N_j,0). This formula means that when the amount already used and deducted exceeds the invoice amount, the current amount that can continue to be deducted is recorded as zero; otherwise, the difference between the invoice amount and the amount already used and deducted is calculated.

[0040] S4. Search and sort: Query the collection of rebate source vouchers and sort the rebate source vouchers.

[0041] The system queries rebate source vouchers that are in the same deductible business domain as invoice details I_j, obtaining a rebate source voucher set S_j, expressed as follows: S_j={P_i|C_i>0,H_i=0,P_i and I_j belong to the same cargo owner, the same waybill, or the same bill of exchange for deduction}.

[0042] The set S_j is stably sorted according to the waybill completion time, rebate payment time, invoice generation time, and voucher identifier. Specific sorting methods include: For each rebate source voucher P_i after sorting, calculate the amount X_ij used in this transaction, using the following formula: X_ij=min(C_i,D_j-ΣX_kj), Where ΣX_kj is the cumulative amount that has been used from previous rebate source vouchers in the current invoice details, and k is the total number of times the amount has been used before this time.

[0043] S5. Sequential occupancy, invoice pre-occupancy and sequential allocation.

[0044] When X_ij > 0, the migration of the amount state pool is performed, expressed as: C_i = C_i - X_ij, F_i = F_i + X_ij, N_j = N_j + X_ij. Simultaneously, a deduction voucher O_ij is generated and linked to the rebate source voucher P_i. If the cumulative amount ΣX_ij occupied by the current invoice details from the rebate source voucher reaches the current deductible amount D_j, then the occupation of subsequent rebate source vouchers is stopped.

[0045] Optionally, this step can also partially reduce the split rebate source vouchers, forming occupied sub-vouchers and remaining sub-vouchers.

[0046] When the deductible amount in the rebate source voucher P_i is greater than the current deductible amount in the invoice detail I_j (i.e., C_i > D_j - ΣX_kj), this invention does not bind the entire rebate voucher to the invoice, but instead performs a logical split. The split result includes the occupied sub-voucher P_i_use and the remaining sub-voucher P_i_left. The split expressions are as follows: P_i_use.amount = D_j - ΣX_kj, P_i_left.amount = C_i - (D_j - ΣX_kj), where P_i_use.amount represents the amount of the occupied sub-voucher, and P_i_left.amount represents the amount of the remaining sub-voucher.

[0047] The corresponding amount migration is: F_i=F_i+(D_j-ΣX_kj), C_i=C_i-(D_j-ΣX_kj), which represents the migration that occurs in the amount state pool during the partial reduction and split process.

[0048] Among them, the sub-voucher P_i_use is associated with the deductible voucher O_ij, and the remaining sub-voucher P_i_left inherits the business domain, waybill, bill, and balance flow information of the rebate source voucher and continues to be retained in the deductible amount pool. If an invoice detail needs to allocate the deductible amount from multiple rebate source vouchers, multiple deductible vouchers are generated sequentially according to the aforementioned sorting rules, and the set of vouchers is recorded in the invoice detail.

[0049] The aforementioned technological innovations support partial deduction and multi-invoice apportionment; through the occupancy algorithm X_ij=min(C_i,D_j-ΣX_kj) and the sub-voucher splitting mechanism, a rebate can be segmented and occupied by multiple invoices, and a single invoice can also be sequentially occupied from multiple rebates.

[0050] Optionally, partial reductions can also be split using amount ranges, voucher version numbers, or entry line numbers.

[0051] S6. Verification and confirmation, generating a verification and confirmation voucher.

[0052] When the invoice status enters the stages of issued, sent, confirmed, or other deduction confirmation status set by the platform, the system reads the set of deduction vouchers O_j associated with the invoice.

[0053] For each deregistration voucher O_ij, obtain its deregistration amount X_ij and perform a confirmation migration, as shown in the following expressions: F_i = F_i - X_ij, R_i = R_i + X_ij; at the same time, generate a deregistration confirmation voucher Q_ij.

[0054] The prevHash of the reduction confirmation voucher Q_ij points to the hash of O_ij. The hash of the reduction confirmation voucher Q_ij is calculated based on the invoice identifier, invoice detail identifier, confirmation action type, confirmation amount, batch number, and voucher version number. After confirmation, the system updates the reduced amount in the invoice details and changes the corresponding rebate amount from frozen to reduced.

[0055] The above method enables the reversible migration of rebate amounts along the voucher chain throughout the invoice lifecycle through a continuous processing flow, including rebate source voucher generation, amount status pool initialization, invoice pre-occupancy, partial deduction and splitting, deduction confirmation, cancellation and restoration, action fingerprint idempotent control, and abnormal suspension compensation.

[0056] The invoice lifecycle status can be adjusted according to the electronic invoice service accessed by the platform, such as pending invoice, submitted, invoiced, sent, reversed with red ink, voided, cancelled, or reissued.

[0057] Based on the above method steps, the present invention also includes the following technologies: 1. Generate action fingerprints for monetary amount migration for idempotency determination.

[0058] To avoid duplicate amount migrations caused by different modules repeatedly triggering the same invoice action, this invention generates an action fingerprint (FP) for each amount migration. The expression for generating the action fingerprint is as follows: FP = Hash(Platform Identifier + Shipper Identifier + Waybill Identifier + Rebate Source Voucher Identifier + Invoice Detail Identifier + Action Type + Batch Number + Amount Range + Current Voucher Version Number).

[0059] The action types include, but are not limited to: pre-occupancy, reduction confirmation, cancellation and recovery, abnormal suspension, and compensation release. Before executing any amount migration, the system first queries the action fingerprint record: if the FP already exists, it is determined that the action has already been executed, and the current amount migration is skipped, only the existing processing result is returned; if the FP does not exist, the amount migration is executed, the corresponding voucher node is generated, and the FP is saved.

[0060] Optionally, action fingerprints can also be implemented using unique indexes, idempotent tokens, message deduplication keys, or distributed transaction identifiers.

[0061] The aforementioned technological innovations reduce the risks of duplicate deductions and duplicate recoverys; by controlling the same action to be executed only once for the same amount range through action fingerprinting, they adapt to asynchronous scenarios such as invoice status callbacks, scheduled task retries, and manual repetitive operations.

[0062] 2. When an invoice reverse lifecycle event occurs, a recovery voucher is generated to restore the invoice in reverse by extending the evidence chain.

[0063] Specifically, when an invoice reverse lifecycle event occurs, this invention reverses the voucher chain to locate the related deduction voucher O_ij and deduction confirmation voucher Q_ij; the system performs different state recovery migrations based on the current state of the amount. Invoice reverse lifecycle events can include invoice cancellation or reissue, or actions such as invoice deletion, return for issuance, or invoice voiding.

[0064] If the corresponding amount is still frozen when the migration is restored, the following expressions for restoring the migration are executed: F_i=F_i-X_ij; C_i=C_i+X_ij; N_j=N_j-X_ij; Li=L_i+X_ij, thereby completing the migration restoration.

[0065] If the amount has already been reduced when the migration is restored, then execute the following expressions for restoring the migration: R_i=R_i-X_ij; C_i=C_i+X_ij; N_j=N_j-X_ij; Li=L_i+X_ij, thereby completing the migration restoration.

[0066] After restoration, a restoration voucher U_ij is generated. The prevHash of the restoration voucher U_ij points to either the reduction confirmation voucher Q_ij or the reduction occupied voucher O_ij, depending on the state of the amount before restoration. This method allows invoice cancellation or reissue to avoid recalculating the original rebate, instead migrating the occupied or reduced amount in reverse along the voucher chain.

[0067] The aforementioned technological innovations enhance the reversible recovery capabilities of undoing, deleting, and reopening scenarios. Instead of recalculating historical rebates, the system performs reverse amount migration along the voucher chain, reducing inconsistencies caused by configuration changes, order price adjustments, or manual calculations.

[0068] 3. When it is determined that there is an abnormality in the voucher or amount, generate an abnormal suspended voucher and execute the abnormal suspension.

[0069] This method performs targeted detection at control points that may change the amount status or voucher chain status. If the system detects abnormal situations such as a broken voucher hash chain, missing invoice details, mismatch between invoice status and action type, missing balance deposit records, cancelled bills, amount status pool not satisfying conservation relationship, or action fingerprint conflict, it will trigger an abnormal suspension.

[0070] When an exception is suspended, the system migrates the amount Y_i involved in the exception from its current amount pool to the exception-suspended amount pool H_i, and generates an exception-suspended voucher G_ij. For example, if the exception amount comes from the deductible amount pool, then: C_i = C_i - Y_i; H_i = H_i + Y_i. If the exception amount comes from the frozen amount pool or the deducted amount pool, it is migrated out from F_i or R_i respectively.

[0071] The control points include at least the following: Before T0 rebate source voucher generation, check the balance deposit flow, waybill, bill, and cargo owner attribution; before T1 invoice application or invoice detail pre-occupancy, check the existence of invoice details, invoice status, deductible balance, action fingerprint, and concurrent version number; after T2 pre-occupancy, confirmation deduction, cancellation recovery, and other amount migration submissions, check the amount conservation relationship, chain tail hash, and state pool change results; at T3 invoice status callback, scheduled task retry, or manual operation entry, check whether the action type matches the invoice lifecycle status and whether it is repeatedly triggered; before T4 abnormal compensation recovery, check whether the original abnormal cause has been eliminated and whether the suspended amount is still in H_i.

[0072] By using the above control point detection, the system does not need to perform full verification at every business step, but only performs necessary verification at key steps that affect the amount pool and voucher chain.

[0073] The relationship between different anomaly types, detection methods, and corresponding steps is as follows: Anomaly 1: Broken credential hash chain: During T2 or T4 detection, the system reads the previous node based on prev_node_id, recalculates prevHash and the current hash, and if they are inconsistent with the stored value or the previous node does not exist, the chain is determined to be broken.

[0074] Anomaly 2: Invoice details do not exist: During T1 or T3 checks, the system queries the invoice details table by invoice_detail_id. If the record does not exist, has been logically deleted, or does not belong to the current owner or invoice, then the details are determined to be missing.

[0075] Anomaly 3: Invoice status and action type do not match. During T1 or T3 detection, the system determines whether the current status allows the execution of pre-occupancy, confirmation reduction, cancellation recovery, or reopening recovery based on the preset state machine table. If the status transition is not within the allowed set, the status is determined to be abnormal.

[0076] Anomaly 4: Missing balance deposit records: During T0 or T1 checks, the system queries the deposit record table according to the balance deposit record identifier. If the record does not exist, the amount is negative, it has been reversed, or it does not match the amount of the rebate source voucher, the record is determined to be abnormal.

[0077] Anomaly 5: Bill already cancelled: During T0, T1 or T3 checks, the system reads the bill status field. If the bill is already cancelled, voided, reversed, or closed and further deduction is not allowed, the migration is blocked and the relevant amount is suspended.

[0078] Anomaly 6: The amount state pool does not satisfy the conservation relationship: During the T2 check, the system calculates the difference between A_i and C_i+F_i+R_i+H_i before and after the transaction is committed. If the difference is not zero, or the amount of this migration is inconsistent with the change in the amount pool before and after the processing, then the amount is determined to be drifted.

[0079] Anomaly 7: Action fingerprint conflict: During T1 or T3 detection, the system queries the unique index of the FP. If the same FP already exists and the corresponding action parameters are consistent, then an idempotent return is performed. If the same FP corresponds to different amount ranges, invoice details, or action types, then it is determined to be a fingerprint conflict.

[0080] Exception 8: Concurrent version conflict: When the system updates the amount status pool during T1 or T2 checks, it verifies row_version. If the number of rows affected by the update is zero, it indicates that there is concurrent writing, and the current request enters the retry or exception suspension process.

[0081] Perform exception suspension compensation: After compensation is completed, H_i is migrated to the corresponding state according to the compensation conclusion, including any one of the following migrations: (1) H_i→C_i: Released as an amount that can be deducted again; (2) H_i→R_i: Confirm that the reduction has been made; (3) H_i→F_i: Restore to frozen state; (4) H_i → Settlement Closure: After manual or platform rule confirmation, it will no longer participate in the reduction.

[0082] Abnormal compensation can be triggered by automatic compensation tasks, manual review work orders, or financial review processes. The compensation results obtained after migration are still recorded through the voucher chain.

[0083] During compensation and recovery, the system selects the compensation action based on the anomaly type and detection control point recorded in the anomaly suspension voucher G_ij, instead of re-executing the entire business process. Specifically: For chain break anomalies, the system first uses the most recent verifiable node in the database as the trusted chain tail, reattaches or invalidates the anomaly node, and appends the compensation result node; for invoice detail missing or status mismatch anomalies, the system waits for the invoice details to be completed or the status to revert to an allowed state before migrating H_i back to C_i, F_i, or R_i; for balance flow, bill reversal, or amount conservation anomalies, the system adds a recovery voucher or clears and closes the record after confirming the actual amount through reconciliation tasks or manual review; for action fingerprint conflicts and concurrent version conflicts, the system prioritizes returning existing processing results based on existing action fingerprints, and only keeps the process suspended and awaits manual review if idempotent confirmation is not possible. Each compensation generates a new successor voucher node and compensation action fingerprint, ensuring that the anomaly detection, suspension, repair, and release processes are also included in the same voucher chain.

[0084] The aforementioned technological innovations reduce the impact of abnormal data on normal processes; abnormal amounts are placed in an abnormal suspension pool and then suspended from subsequent deductions until compensation is completed before being released or confirmed, thus reducing the scope of accounting pollution.

[0085] The rebates in this invention are not limited to fuel card rebates. Rebates for gas cards, freight rebates, service fee refunds, platform subsidies, project rewards, etc., as long as the rebate can be linked to waybills, bills, expense details, or project settlement objects in the online freight platform, and the rebate amount may affect subsequent invoice issuance, red-ink reversal, cancellation, reissue, or reconciliation amounts, can all be included in this method. Different rebate types only affect the business domain matching rules and sorting rules of the rebate source voucher, without changing the core processing mechanism combining four technologies: voucher chain, amount status pool, action fingerprint, and abnormal suspension compensation. The business domain matching rules for rebates can be configured according to cargo owner, project, waybill, bill, resource type, or expense category.

[0086] The above technical solution improves the traceability of rebate invoice reduction processing compared to existing technologies. By forming a chain structure with rebate source vouchers, reduction vouchers, reduction confirmation vouchers, and recovery vouchers, the reduction result of any invoice can be traced back to the original rebate entry record.

[0087] The following is a specific example of the practical application of this solution: Example 1: Basic rebate invoice deduction process.

[0088] In the example, the shipping cost is 1000 yuan, and the rebate amount is 100 yuan. This rebate is fully used and confirmed for deduction in one go by a single invoice, without involving partial splitting, cancellation, or exceptions. The symbol conventions are as follows: Waybill T_A, shipper S_A, freight amount 1000 yuan; Rebate source voucher P_A: corresponds to a shipping rebate, with an original rebate amount A_A = 100 yuan; Invoice Details I_A: An invoice applied for by the consignor based on Waybill T_A, with a deduction limit of 100 yuan; Reduction of occupancy voucher O_A1: indicates that I_A has used 100 yuan from P_A; Confirmation voucher Q_A1: indicates that the occupation has been converted into a formal reduction.

[0089] The following are the specific implementation steps of this embodiment in Example 1: Step 1: Record the rebate and generate the rebate source voucher P_A. Details are as follows: (1) After the cargo owner S_A completes the waybill T_A, the platform generates a freight rebate of 100 yuan and records it in the cargo owner's balance flow.

[0090] (2) The platform creates a rebate source voucher P_A, records the original rebate amount A_A=100 yuan, and maps P_A with waybill T_A, cargo owner S_A, balance flow and corresponding bill.

[0091] (3) Platform initialization of amount status pool: deductible amount C_A=100 yuan, frozen amount F_A=0 yuan, deducted amount R_A=0 yuan, abnormal suspended amount H_A=0 yuan.

[0092] (4) At this time, P_A is in the "can be deducted" state, waiting for subsequent invoice actions to trigger the amount migration.

[0093] Step 2: Apply for an invoice and generate the deduction voucher O_A1. Details are as follows: (1) The cargo owner applies for a freight invoice and generates invoice details I_A. The invoiceable amount of I_A is RMB 1,000, of which the limit for deductible rebates is RMB 100, and the currently used deductible amount is RMB 0.

[0094] (2) The system calculates the amount that can be deducted now: D_A = 100 - 0 = 100 yuan.

[0095] (3) The system retrieved the rebate source voucher P_A. The deductible amount of P_A is C_A=100 yuan, which meets the conditions of the same cargo owner, the same waybill or the same bill deduction range.

[0096] (4) The system calculates the amount occupied this time X_A1=min(100,100)=100 yuan.

[0097] (5) The system performs pre-occupancy migration: C_A changes from 100 yuan to 0 yuan, and F_A changes from 0 yuan to 100 yuan.

[0098] (6) The system generates a deduction voucher O_A1 and links it to P_A, indicating that the invoice details I_A has pre-occupied 100 yuan from the rebate source voucher P_A, and this amount has entered the frozen occupation state.

[0099] Step 3: Confirm the invoice and generate the reduction confirmation voucher Q_A1. Details are as follows: (1) The invoice details I_A has been issued and has entered the invoice confirmation status.

[0100] (2) The system reads the deduction voucher O_A1 and performs the confirmation migration: F_A changes from 100 yuan to 0 yuan, and R_A changes from 0 yuan to 100 yuan.

[0101] (3) The system generates a reduction confirmation voucher Q_A1, whose preceding voucher is O_A1, indicating that the 100 yuan rebate has been officially used for the reduction of invoice details I_A.

[0102] (4) The system performs an amount conservation check: C_A(0) + F_A(0) + R_A(100) + H_A(0) = 100, which equals the original rebate amount A_A = 100. The deduction process ends. Thus, a rebate is completely occupied and deducted by a single invoice. The entire voucher chain is P_A → O_A1 → Q_A1, which can be traced at any time. If an invoice is subsequently cancelled, a recovery voucher can be generated along this voucher chain. The reverse recovery method is consistent with the subsequent embodiments.

[0103] Example 2: Complex lifecycle scenario.

[0104] This example demonstrates the entire process of partial occupancy, undo and restore, action fingerprint anti-duplicate, and abnormal suspension compensation in this embodiment.

[0105] In the example, a fuel card rebate is 100 yuan, and an invoice only needs to deduct 80 yuan, and the invoice subsequently undergoes cancellation and exception handling. The symbol conventions are as follows: Waybill T_B, Shipper S_B; Rebate source voucher P_B: corresponds to a gas card rebate, with an original rebate amount A_B = 100 yuan; Invoice Details I_B: Details of an invoice for which only an 80 RMB rebate needs to be deducted; Reduction of occupancy voucher O_B1: This indicates that I_B has used 80 yuan from P_B; Confirmation voucher Q_B1 for reduction: indicates that the occupation has been converted into a formal reduction; Recovery voucher U_B1: Indicates the amount released in reverse upon cancellation; G_B1, the suspended certificate due to an anomaly, indicates the amount to be isolated in case of an anomaly.

[0106] The following are the specific implementation steps of this embodiment in Example 2: Step 1: Rebate posting and voucher initialization. Details are as follows: (1) After the waybill T_B is completed, the platform generates a rebate of 100 yuan for the fuel card, generates a balance flow, and creates a rebate source voucher P_B.

[0107] (2) Platform initialization of amount status pool: C_B=100 yuan, F_B=0 yuan, R_B=0 yuan, H_B=0 yuan, L_B=0 yuan.

[0108] (3) P_B enters the deductible state and waits for invoice application or invoice details to be generated.

[0109] Step 2, Invoice application and partial usage, details are as follows: (1) The cargo owner applies for an invoice and generates invoice details I_B, which can be deducted up to RMB 80.

[0110] (2) The system finds the rebate source voucher P_B, and the current deductible amount of P_B ​​is C_B=100 yuan.

[0111] (3) The system calculates the amount occupied this time X_B1=min(100,80)=80 yuan.

[0112] (4) The system performs pre-occupancy migration: C_B changes from 100 yuan to 20 yuan, and F_B changes from 0 yuan to 80 yuan.

[0113] (5) The system generates a deduction voucher O_B1, which records "80 yuan was taken from P_B and given to I_B". At this time, P_B still has a deduction balance of 20 yuan, which can be used by other invoices, thus realizing partial deduction and splitting.

[0114] Step 3, Invoice Confirmation and Formal Reduction, details are as follows: (1) When the invoice details I_B enters the invoice status, the system performs a confirmation migration based on O_B1.

[0115] (2) The system changes F_B from 80 yuan to 0 yuan and R_B from 0 yuan to 80 yuan.

[0116] (3) The system generates a reduction confirmation voucher Q_B1 and links it to O_B1. At this time, the voucher chain is P_B→O_B1→Q_B1.

[0117] (4) The system verifies the amount of conservation: C_B(20)+F_B(0)+R_B(80)+H_B(0)=100, which is consistent with the original rebate amount.

[0118] Step 4, Invoice Cancellation and Reverse Restore, details are as follows: (1) Due to business changes, invoice details I_B were cancelled.

[0119] (2) The system reverses the invoice details I_B to Q_B1 and O_B1. Since the amount is already in the reduced amount pool R_B, reverse migration is performed.

[0120] (3) The system changes R_B from 80 yuan to 0 yuan, restores C_B from 20 yuan to 100 yuan, and increases the cumulative value of the restored release amount L_B by 80 yuan.

[0121] (4) The system generates recovery certificate U_B1, whose preceding certificate is Q_B1. The certificate chain extends to P_B→O_B1→Q_B1→U_B1, which completely records the closed loop of occupancy, confirmation and release.

[0122] Step 5: Action fingerprint anti-duplicate processing, as detailed below: (1) If the invoice cancellation operation is triggered again due to interface retry, the system will generate an action fingerprint FP that is exactly the same as the first cancellation based on the cargo owner, waybill, rebate source voucher, invoice details, action type, batch number and amount range.

[0123] (2) If the system checks and finds that the action fingerprint already exists, it will skip the amount migration and return the existing recovery result.

[0124] (3) Therefore, the amount of P_B ​​remains C_B=100 yuan and will not become 180 yuan due to repeated cancellation of callback, thus avoiding the false increase of amount caused by repeated release.

[0125] Step 6, Abnormal Suspension and Compensation, as detailed below: (1) Assuming that the invoice details I_B are unexpectedly missing during the verification confirmation, but the verification voucher O_B1 still exists, the system determines that the voucher chain is broken or the basis for invoice verification is abnormal.

[0126] (2) The system migrates the 80 yuan frozen amount associated with O_B1 to the abnormal suspension pool: F_B changes from 80 yuan to 0 yuan, H_B changes from 0 yuan to 80 yuan, and generates abnormal suspension voucher G_B1.

[0127] (3) The suspended 80 yuan will be suspended from participating in any new invoice deduction to prevent misuse or duplicate occupation.

[0128] (4) After the background compensation task verifies that the invoice has been substantially cancelled, the 80 yuan is transferred from H_B back to C_B, and a compensation release voucher is generated, restoring the rebate amount to a deductible state. As can be seen from this embodiment, the present invention, through the "voucher chain + amount status pool + action fingerprint" mechanism, enables the rebate amount to remain traceable, reversible, and idempotent even in complex scenarios such as partial occupation, cancellation and restoration, repeated triggering, and abnormal suspension.

[0129] Example 3: Scenarios of distributing multiple rebates on a single invoice like Figure 3 As shown, this example illustrates the process of sequentially allocating and deducting amounts from multiple rebate source vouchers for a single invoice. It specifically demonstrates the capabilities of sequential allocation, partial occupancy, multi-voucher chain binding, and transaction-by-transaction reversal. The notation conventions are as follows: Invoice Details I_C: An invoice applied for by the cargo owner, with a current deductible limit D_C=180 yuan; Rebate voucher P_C1: Deductible amount C_C1 = 100 yuan; Rebate voucher P_C2: Deductible amount C_C2 = 60 yuan; Rebate voucher P_C3: Deductible amount C_C3 = 50 yuan.

[0130] After the system sorts the data according to rules such as rebate payment time and waybill completion time, the occupancy order is P_C1→P_C2→P_C3.

[0131] The following are the specific implementation steps of this embodiment in Example 3: Step 1: Retrieve and sort multiple rebate source vouchers, as detailed below: (1) After the invoice details I_C are generated, the platform determines that the amount that can be deducted is D_C=180 yuan.

[0132] (2) The platform retrieves a set of rebate source vouchers S_C within the same cargo owner, the same project, or the same bill deduction range, where the deduction amount is greater than 0 and there are no abnormal suspensions.

[0133] (3) The search results include P_C1, P_C2 and P_C3, with deductible amounts of 100 yuan, 60 yuan and 50 yuan respectively.

[0134] (4) The platform sorts the rebate source vouchers stably according to the rules of rebate payment time in ascending order, waybill completion time in ascending order, voucher identification in ascending order, and obtains the occupation order P_C1→P_C2→P_C3.

[0135] Step 2, generation of sequential allocation and reduction vouchers, is as follows: The system strictly follows the formula in step 4: X_ij=min(C_i,D_j-ΣX_kj) to execute the sequential occupation, where ΣX_kj is the amount already occupied from the previous rebate source voucher. (1) Process P_C1: Calculate X_C1=min(100,180-0)=100 yuan. After the pre-occupancy migration is executed, C_C1 becomes 0 yuan, F_C1 becomes 100 yuan; the remaining deductible amount of invoice I_C becomes 80 yuan. Generate the deduction occupation voucher O_C1.

[0136] (2) Process P_C2: Calculate X_C2=min(60,180-100)=60 yuan. After the migration is executed, C_C2 becomes 0 yuan, F_C2 becomes 60 yuan; the remaining deductible amount becomes 20 yuan. Generate the deduction voucher O_C2.

[0137] (3) Processing P_C3: At this point, the remaining deductible amount is 20 yuan, C_C3=50>20, triggering a partial deduction split. Calculate X_C3=min(50,20)=20 yuan. After the migration, C_C3 becomes 30 yuan, F_C3 becomes 20 yuan; the remaining deductible amount becomes 0 yuan. Generate a deduction voucher O_C3.

[0138] (4) Since the remaining deductible amount of invoice I_C is 0, the system stops searching or using subsequent rebate source vouchers.

[0139] Step 3: Reduction of the multi-document chain after invoice confirmation, as detailed below: (1) When the invoice detail I_C enters the invoice issued or other deduction confirmation status, the platform reads the set of deduction occupancy vouchers {O_C1,O_C2,O_C3} associated with I_C.

[0140] (2) Perform a confirmation migration on P_C1: F_C1 changes from 100 yuan to 0 yuan, R_C1 changes from 0 yuan to 100 yuan, and generate a reduction confirmation voucher Q_C1.

[0141] (3) Perform a confirmation migration on P_C2: F_C2 changes from 60 yuan to 0 yuan, R_C2 changes from 0 yuan to 60 yuan, and generate a reduction confirmation voucher Q_C2.

[0142] (4) Perform a confirmation migration on P_C3: F_C3 changes from 20 yuan to 0 yuan, R_C3 changes from 0 yuan to 20 yuan (C_C3 still retains 30 yuan of deductible balance), and generate a deduction confirmation voucher Q_C3.

[0143] (5) At this time, invoice I_C corresponds to three independent voucher chains: P_C1→O_C1→Q_C1, P_C2→O_C2→Q_C2, P_C3→O_C3→Q_C3. All rebate source vouchers satisfy the amount conservation.

[0144] Step 4: Reverse restoration of each invoice after cancellation, as detailed below: (1) If the invoice details I_C are subsequently revoked, deleted or reissued, the platform will not recalculate the allocation result, but will perform reverse recovery along the three voucher chains associated with I_C.

[0145] (2) For P_C1: Based on Q_C1 and O_C1, transfer 100 yuan from R_C1 back to C_C1. After restoration, C_C1 = 100 yuan and R_C1 = 0 yuan, and generate restoration voucher U_C1.

[0146] (3) For P_C2: Transfer 60 yuan from R_C2 back to C_C2. After restoration, C_C2 = 60 yuan and R_C2 = 0 yuan. Generate restoration voucher U_C2.

[0147] (4) For P_C3: Transfer 20 yuan from R_C3 back to C_C3. After restoration, C_C3 = 50 yuan and R_C3 = 0 yuan. Generate restoration voucher U_C3.

[0148] (5) After the recovery is completed, all three rebate source vouchers return to the deductible state before the invoice was used, and each recovery has an independent recovery voucher record, which supports subsequent audit traceability.

[0149] Step 5: Action fingerprint deduplication in distributed scenarios, as detailed below: (1) In the above-mentioned multiple rebate sharing scenarios, the platform generates action fingerprints for each deduction voucher O_C1, O_C2, O_C3 and subsequent confirmation voucher and recovery voucher.

[0150] (2) The action fingerprint includes at least the owner identifier, invoice details identifier, rebate source voucher identifier, action type, batch number and amount range. Therefore, even if the same invoice corresponds to multiple rebates, it can accurately distinguish the occupation, confirmation and recovery actions of each rebate.

[0151] (3) If the invoice confirmation or cancellation action is triggered repeatedly, the system checks the action fingerprint for each voucher chain: the processed amount range will not be migrated again, and the unprocessed amount range can continue to be compensated, thereby supporting local idempotency and local compensation under multiple voucher chains. As can be seen from this embodiment, when a single invoice is allocated to multiple rebates, this invention does not simply summarize the multiple rebate amounts and deduct them once, but generates an independent voucher node for each rebate, and ensures that the entire process of allocation, confirmation, and cancellation is traceable, recoverable, and prevents duplication through sequential allocation algorithm and action fingerprint.

[0152] The present invention has been described above by way of example with reference to the accompanying drawings. Obviously, the specific implementation of the present invention is not limited to the above-described manner. Any non-substantial improvements made using the inventive concept and technical solution of the present invention, or the direct application of the inventive concept and technical solution of the present invention to other occasions without modification, are all within the protection scope of the present invention.

Claims

1. A method for processing reversible voucher chains for deducting rebate invoices in an online freight platform, characterized in that: Includes the following steps: S1. Rebate receipt, generate rebate source voucher; S2. Initialize the amount status pool. The amount status pool is initially set to the original rebate amount. S3. Invoice details are generated, and the amount that can still be deducted is determined. S4. Search and sort: Query and obtain the set of rebate source vouchers and sort the rebate source vouchers; S5. Sequential occupancy, invoice pre-occupancy and sequential allocation; S6. Confirm the reduction and generate a reduction confirmation voucher; The rebate source voucher must include at least: platform identifier, cargo owner identifier, waybill identifier, bill identifier, rebate type, rebate source, original rebate amount, balance entry record identifier, voucher version number, voucher status, previous voucher summary, and current voucher summary; set the rebate source voucher status to "deductible", and generate a new chain voucher node for each subsequent invoice action, starting from the rebate source voucher; the chain voucher node includes the rebate source voucher, the deduction voucher, and the deduction confirmation voucher.

2. The method for processing reversible voucher chains for deducting rebate invoices in an online freight platform according to claim 1, characterized in that: In step S2, the initial amount state pool is the original rebate amount A_i. For each rebate source voucher P_i, this step splits the original rebate amount into the following amount state pools: The deductible amount pool C_i represents the amount that has not yet been used by invoices and can be used for subsequent invoice deductions; The frozen amount pool F_i represents the amount that has been used by an invoice application or invoice details, but has not yet entered the final deduction confirmation state; The deducted amount pool R_i represents the amount that has been deducted from the invoice along with the invoice confirmation action; The abnormal suspended amount pool H_i represents the amount for which subsequent deduction processing is temporarily suspended due to abnormalities in the voucher chain or accounting data; The cumulative value of the released amount L_i represents the cumulative amount that was previously occupied or confirmed and then released back to a deductible state through cancellation, deletion or reopening actions; Furthermore, the amount status pool related to the rebate source voucher should satisfy the amount conservation relationship: A_i = C_i + F_i + R_i + H_i. By utilizing the principle of monetary conservation, it is possible to verify whether the rebate amount has experienced abnormal drift after each migration.

3. The method for processing reversible voucher chains for deducting rebate invoices in an online freight platform according to claim 1, characterized in that: In step S3, when applying for an invoice, a corresponding invoice detail set I_A is generated, which includes several invoice details. I_j represents the j-th invoice detail record. The invoice amount corresponding to invoice detail I_j is B_j, and the amount already used and deducted is N_j. The amount that can be deducted further is determined from this, and the calculation formula is as follows: D_j=max(B_j-N_j,0). This formula means that when the amount already used and deducted exceeds the invoice amount, the amount that can be deducted further is recorded as zero. Otherwise, the difference between the invoice amount and the amount already used and deducted is calculated.

4. The method for processing reversible voucher chains for deducting rebate invoices in an online freight platform according to claim 1, characterized in that: In step S4, the system queries the rebate source vouchers that are in the same deductible business domain as the invoice details I_j, and obtains the rebate source voucher set S_j, as shown in the following expression: S_j={P_i|C_i>0,H_i=0,P_i and I_j belong to the same cargo owner, the same waybill, or the same bill of exchange within the scope of deduction}; The set S_j is stably sorted according to the waybill completion time, rebate posting time, bill generation time, and voucher identifier. The specific sorting method includes: for each rebate source voucher P_i after sorting, the amount occupied X_ij in this instance is calculated as follows: X_ij=min(C_i,D_j-ΣX_kj), where ΣX_kj is the cumulative amount occupied from previous rebate source vouchers in the current invoice details, and k is the total number of times the amount has been occupied before this instance.

5. The method for processing reversible voucher chains for deducting rebate invoices in an online freight platform according to claim 1, characterized in that: In step S5, when X_ij>0, the amount state pool is migrated, expressed as: C_i=C_i-X_ij, F_i=F_i+X_ij, N_j=N_j+X_ij; at the same time, a deduction voucher O_ij is generated and connected to the rebate source voucher P_i; if the cumulative amount ΣX_ij occupied by the current invoice details from the rebate source voucher reaches the current deductible amount D_j, then the occupation of subsequent rebate source vouchers is stopped.

6. The method for processing reversible voucher chains for deducting rebate invoices in an online freight platform according to claim 1, characterized in that: In step S5, when the deductible amount in the rebate source voucher P_i is greater than the current deductible amount in the invoice detail I_j, the entire rebate voucher is not bound to the invoice, but is logically split. The splitting result includes the occupied sub-voucher P_i_use and the remaining sub-voucher P_i_left. The splitting expression is as follows: P_i_use.amount=D_j-ΣX_kj, P_i_left.amount=C_i-(D_j-ΣX_kj), where P_i_use.amount represents the amount of the occupied sub-voucher, and P_i_left.amount represents the amount of the remaining sub-voucher. The corresponding amount migration is: F_i=F_i+(D_j-ΣX_kj), C_i=C_i-(D_j-ΣX_kj), which represents the migration that occurs in the amount status pool during the partial reduction and splitting process; among them, the occupying sub-voucher P_i_use is associated with the reduction occupying voucher O_ij, and the remaining sub-voucher P_i_left inherits the business domain, waybill, bill and balance flow information of the rebate source voucher and continues to be retained in the deductible amount pool.

7. The method for processing reversible voucher chains for deducting rebate invoices in an online freight platform according to claim 1, characterized in that: In step S6, when the invoice status enters the deduction confirmation state, the system reads the set of deduction occupancy vouchers O_j associated with the invoice; for each deduction occupancy voucher O_ij, its occupancy amount X_ij is obtained, and confirmation migration is performed, with the following expressions: F_i=F_i-X_ij, R_i=R_i+X_ij; at the same time, a deduction confirmation voucher Q_ij is generated; the prevHash of the deduction confirmation voucher Q_ij points to the hash of O_ij, and the hash of the deduction confirmation voucher Q_ij is calculated according to the invoice identifier, invoice detail identifier, confirmation action type, confirmation amount, batch number, and voucher version number; after confirmation, the system updates the deducted amount in the invoice details and changes the corresponding rebate amount from the frozen occupancy state to the deducted state.

8. The method for processing reversible voucher chains for deducting rebate invoices in an online freight platform according to claim 1, characterized in that: An action fingerprint (FP) is generated for each amount migration. The expression for generating the action fingerprint is as follows: FP = Hash(Platform Identifier + Shipper Identifier + Waybill Identifier + Rebate Source Voucher Identifier + Invoice Details Identifier + Action Type + Batch Number + Amount Range + Current Voucher Version Number). The action type includes: pre-occupancy, reduction confirmation, cancellation recovery, abnormal suspension, and compensation release. Before executing any amount migration, the system first queries the action fingerprint record: if the action fingerprint FP already exists, it is determined that the action has already been executed, and the amount migration is skipped, only the existing processing result is returned; if the action fingerprint FP does not exist, the amount migration is executed, the corresponding voucher node is generated, and the action fingerprint FP is saved.

9. The method for processing reversible voucher chains for deducting rebate invoices in an online freight platform according to claim 1, characterized in that: The chained voucher node also includes a recovery voucher; when an invoice reverse lifecycle event occurs, the system reverses the voucher chain to locate the deduction voucher O_ij and deduction confirmation voucher Q_ij related to the invoice; the system performs recovery migration for different states based on the current state of the amount; after recovery, a recovery voucher U_ij is generated, and the prevHash of the recovery voucher U_ij points to the deduction confirmation voucher Q_ij or the deduction voucher O_ij based on the state of the amount before recovery, and the system performs reverse migration for the occupied or deducted amount along the voucher chain.

10. A method for processing reversible voucher chains for deducting rebate invoices in an online freight platform according to claim 1, characterized in that: The chained voucher node also includes abnormal suspended vouchers; targeted detection is performed at control points that may change the amount status or voucher chain status. When an abnormal voucher or amount is detected, an abnormal suspended voucher is generated and abnormal suspension is executed; during abnormal suspension, the system migrates the amount Y_i involved in the abnormality from its current amount pool to the abnormal suspended amount pool H_i, and generates an abnormal suspended voucher G_ij; abnormal suspension compensation is performed: during compensation recovery, the system selects a compensation action according to the abnormality type and detection control point recorded in the abnormal suspended voucher G_ij; after compensation is completed, the abnormal suspended amount pool H_i is migrated to the corresponding state according to the compensation conclusion, including any one of the following migrations: H_i→C_i: Released as an amount that can be deducted again; H_i→R_i: Confirmed that the reduction has been made; H_i→F_i: Restore to frozen state; H_i → Settlement Closure: Confirmed manually or according to platform rules as no longer eligible for reduction. The compensation results obtained after the migration are still recorded through the credential chain.