Account balance tamper-proofing method

By recording transaction information in online payments and using blockchain and on-chain record tables for dual verification, the problem of easily tampered electronic account balances is solved, thereby improving account balance security and user experience.

CN114139219BActive Publication Date: 2026-01-23HANGZHOU JINXIANLIAN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111498858.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-09
Publication Date
2026-01-23
Estimated Expiration
2041-12-09

AI Technical Summary

Technical Problem

In online payments, electronic account balances are easily tampered with by criminals, leading to the loss of supplier resource data and a decline in user experience.

Method used

By recording transaction information and using blockchain and on-chain record tables for double verification, account balances are checked, ensuring the consistency of transaction information, increasing the difficulty of tampering, and enabling correction and financial settlement when necessary.

Benefits of technology

It effectively prevents account balance tampering, improves transaction security and user experience, reduces verification time, and enhances account balance protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114139219B_ABST
    Figure CN114139219B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of online transaction, in particular to an account balance anti-tampering method. When a transaction is completed, the transaction process is recorded to store transaction information, the transaction information including transaction amount and transaction direction; when a transaction is generated again, the account balance is calibrated according to the transaction information, and the transaction is completed when the calibration result is consistent. In the prior art, the account balance is only a group of data, which is easy to be tampered with and utilized by lawbreakers. Compared with the prior art, the application records each transaction process, thereby being capable of tracing the account balance and increasing the tampering difficulty.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of online transaction technology, and in particular to a method for preventing account balance tampering. Background Technology

[0002] Online payment refers to a service where banks provide online fund settlement for transactions between sellers and buyers through e-commerce websites on the Internet. Due to its unique security, convenience, and speed, online payment has become an indispensable payment method in people's daily lives. With the widespread adoption of online payment, most online payment service providers offer an electronic account to store users' online assets and display the account balance. Users can also use the balance in their electronic account for purchases. However, the account balance is essentially a set of data stored on a server, which is easily exploited by criminals. They can modify the account balance of a specific account by tampering with the data, resulting in the loss of supplier data resources and consequently affecting the user experience of other users. Summary of the Invention

[0003] To address the technical problems of existing technologies, this invention provides a method for preventing account balance tampering.

[0004] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0005] A method for preventing account balance tampering includes: when a transaction is completed, recording the transaction process to store transaction information, the transaction information including transaction amount and transaction direction; when another transaction occurs, calibrating the account balance based on the transaction information; and when the calibration result is consistent, completing the transaction.

[0006] A user's transfer of funds into an electronic account can be considered a transaction between the user and the supplier. Once the transaction is completed, the process is recorded and transaction information, including the transaction amount and direction, is stored. When the user makes another transaction, the account balance is recalibrated based on the transaction information. If the calibration matches, the transaction is completed, and the process is recorded. Thus, through this cycle, online assets within the electronic account can be traced. On the one hand, this weakens the value of the numerical fields representing the account balance, as even if these fields are altered, the user's actual balance status remains unchanged. On the other hand, altering the user's balance requires simultaneous alteration of transaction information, significantly increasing the difficulty of tampering.

[0007] Furthermore, the process includes the following steps: when a transaction occurs, a balance verification thread is initiated; when the balance verification thread is initiated, the account balance is verified based on the transaction information in the on-chain record table; if the verification results are consistent, the transaction is completed; if the verification results are inconsistent, the account balance is corrected and the transaction is completed; when the transaction is completed, the transaction information is updated to the on-chain record table and uploaded to the blockchain; when another transaction occurs, the above process is repeated.

[0008] Furthermore, the process includes the following steps: When a transaction occurs, a balance verification thread is initiated; when the balance verification thread is initiated, the account balance is verified based on the transaction information in the on-chain record table; when the verification results are consistent, the transaction is completed; when the verification results are inconsistent, the account balance is corrected and the transaction is completed; when the transaction is completed, the transaction information is updated to the on-chain record table and uploaded to the blockchain; when another transaction occurs, the above process is repeated.

[0009] Furthermore, "start the balance verification thread when a transaction occurs" specifically includes the following steps: when a transaction occurs, increase or decrease the value of the account balance field according to the transaction amount and transaction direction to complete the payment; when the payment is completed, start the balance verification thread.

[0010] Furthermore, "when the balance verification thread is started, the account balance is verified based on the transaction information in the on-chain record table. When the verification results are consistent, the transaction is completed" specifically includes the following steps: summarizing the transaction information in the on-chain record table to obtain the actual balance; verifying the actual balance against the account balance; when the verification results are consistent, increasing or decreasing the account balance value based on the transaction amount and transaction direction to complete the transaction.

[0011] Furthermore, when the verification results are inconsistent, the account balance is corrected and the transaction is completed. This specifically includes the following steps: when the verification results are inconsistent, the transaction information in the blockchain is compared with the transaction information in the on-chain record table; when the comparison results are the same, the account balance is corrected based on the actual balance, and financial settlement is performed to complete the transaction; when the comparison results are different, the transaction information in the on-chain record table is modified based on the transaction information in the blockchain to modify the actual balance, the account balance is corrected based on the modified actual balance, and financial settlement is performed to complete the transaction.

[0012] Furthermore, "financial settlement" specifically includes the following steps: when the transaction direction is expenditure, compare the corrected account balance with the transaction amount. When the comparison result is greater than the transaction amount, reduce the corrected account balance value according to the transaction amount to complete the transaction.

[0013] Furthermore, when multiple transactions occur simultaneously, a balance verification task is generated each time a balance verification thread is started; the balance verification task is placed into the verification task queue; according to the verification task queue, the account balance is verified sequentially to complete all balance verification tasks in the verification task queue in sequence.

[0014] Compared with the prior art, the present invention has the following advantages:

[0015] By utilizing transaction information, online assets within electronic accounts can be traced. To tamper with the account balance, it would be necessary to simultaneously modify the transaction information in the on-chain record table and the blockchain. This significantly increases the difficulty of tampering.

[0016] During the verification process, verification is first performed through the on-chain record table. If any anomalies are detected, verification is then performed through the blockchain itself. On the one hand, this double verification effectively increases the accuracy of the verification. On the other hand, accessing the on-chain record table on the server takes less time; prioritizing the use of the on-chain record table can effectively shorten the time required for the balance verification thread.

[0017] The transaction information includes the transaction amount and the transaction direction, rather than directly recording the account balance at the time. This makes it necessary to tamper with two pieces of data simultaneously, further increasing the difficulty of tampering.

[0018] By tracing the origin of electronic assets, the numerical value of the account balance field is effectively weakened. Even if the account balance field is tampered with, the actual balance status cannot be changed.

[0019] In user transactions, payment is processed first, followed by balance verification. This makes the balance verification process seamless for the user. While protecting data resources from loss, it effectively prevents the verification process from becoming excessively lengthy, significantly improving the user experience. Attached Figure Description

[0020] Figure 1 Overall flowchart. Detailed Implementation

[0021] The following are specific embodiments of the present invention, which are described in conjunction with the accompanying drawings. However, the present invention is not limited to these embodiments.

[0022] A method for preventing account balance tampering includes: upon completion of a transaction, recording the transaction process to store transaction information, including the transaction amount and transaction direction; and upon subsequent transactions, verifying the account balance based on the transaction information, and completing the transaction if the verification results are consistent.

[0023] Specifically, the following steps are included:

[0024] Step 1: When a transaction occurs, start the balance verification thread.

[0025] Step 2: When the balance verification thread starts, it verifies the account balance based on the transaction information in the on-chain record table. If the verification results are consistent, the transaction is completed. If the verification results are inconsistent, the account balance is corrected and the transaction is completed.

[0026] Step 3: When the transaction is completed, update the transaction information to the on-chain record table and upload the transaction information to the blockchain.

[0027] Step 4: When another transaction occurs, repeat steps 1 through 3.

[0028] Step 1 includes the following steps:

[0029] Step 1-1: When a transaction occurs, increase or decrease the value in the account balance field according to the transaction amount and direction to complete the payment.

[0030] Steps 1-2: Once payment is complete, initiate the balance verification thread.

[0031] Step 2 includes the following steps:

[0032] Step 2-1: Summarize the transaction information in the on-chain record table to obtain the actual balance.

[0033] Step 2-2: Verify the actual balance against the account balance.

[0034] Steps 2-3: If the verification results match, adjust the account balance according to the transaction amount and direction to complete the transaction. At this point, proceed directly to Step 3. If the verification results do not match, compare the transaction information in the blockchain with the transaction information in the on-chain record table. Then proceed to Steps 2-4 below.

[0035] Steps 2-4: When the comparison results are the same, correct the account balance according to the actual balance and perform financial settlement to complete the transaction. At this point, you can directly proceed to step 3. When the comparison results are inconsistent, perform the following steps: modify the transaction information in the on-chain record table according to the transaction information in the blockchain to modify the actual balance, correct the account balance according to the modified actual balance, and perform financial settlement to complete the transaction.

[0036] In practice, a user's transfer of funds to an electronic account can be considered a transaction between the user and the supplier. In this case, the transaction amount is represented by the amount transferred, and the transaction direction is represented by "received funds." The transaction process is recorded to obtain transaction information including the transaction amount and direction. This transaction information is uploaded to a blockchain record table, which is then stored on the server. Simultaneously, the transaction information is compressed and uploaded to the blockchain. At this time, the account balance is also stored as a set of data on the server. When the user engages in another transaction, for example, when the user purchases goods using their account balance, the value of the account balance field (a field directly displayed to the user and easily queried by the user, such as the balance field in a mobile app) is reduced based on the transaction amount and direction. The reduced value is the difference between the currently displayed balance value and the transaction amount. At this point, the payment is completed, and the balance verification thread is initiated. From the user's perspective, the transaction is complete, and the user is not directly aware of the subsequent execution of the balance verification thread. This effectively avoids the payment process being prolonged due to the balance verification thread, thus significantly improving the user experience.

[0037] When the balance verification thread begins, it aggregates transaction information from the on-chain record table to obtain the actual balance. For example, if the transaction information in the on-chain record table is: First transaction: Income, 10 coins; Second transaction: Income, 15 coins; Third transaction: Expenditure, 5 coins, then the aggregated actual balance is 20 coins. The actual balance is then verified against the account balance on the server. If the verification result matches, it indicates that the account balance has not been tampered with. Based on the transaction amount and direction, the account balance is reduced to complete the transaction. If the verification result does not match, it indicates that the account balance data has been tampered with. The transaction information in the blockchain is then compared with the transaction information in the on-chain record table. If the comparison result is the same, it indicates that the transaction information in the on-chain record table is correct. At this point, the account balance is corrected based on the actual balance, and financial settlement is performed to complete the transaction. If the comparison result is different, it indicates that the transaction information in the on-chain record table has been tampered with. The transaction information in the on-chain record table is modified based on the transaction information in the blockchain to modify the actual balance. The account balance is then corrected based on the modified actual balance, and financial settlement is performed to complete the transaction. Therefore, in the actual verification process, the transaction information in the on-chain record table on the server is first used for verification. Only when there is an abnormal risk will the transaction information on the blockchain be used for verification. On the one hand, the information on the blockchain is public network content, and calling the blockchain takes a long time. Therefore, prioritizing the use of information on the server can shorten the verification time. When an abnormal risk occurs, the blockchain is then called to perform a second verification using the immutable characteristic of the blockchain, which effectively improves the accuracy of the verification. Furthermore, if the on-chain record table is tampered with, it can be effectively recovered. The "financial settlement" specifically includes the following: If the transaction direction is expenditure, the corrected account balance is compared with the transaction amount. If the comparison result is greater, the corrected account balance is reduced by the transaction amount to complete the transaction, and a corresponding prompt is issued to the user. If the comparison result is less, that is, the account balance is insufficient to pay for the transaction, the transaction is terminated. If the transaction direction is income, the corrected account balance is increased by the transaction amount to complete the transaction, and a corresponding prompt is issued to the user.

[0038] Once a transaction is completed, the transaction amount and direction are integrated into the transaction information and uploaded to the on-chain record table. This transaction information is then compressed and uploaded to the blockchain for future use. Additionally, if the account balance has been corrected during the balance verification process, the value in the account balance field will be updated to reflect the current account balance.

[0039] In summary, this invention utilizes transaction information to trace online assets in electronic accounts. On one hand, it weakens the numerical value of the account balance field, ensuring that even if the account balance field is tampered with, the actual account balance status cannot be altered. On the other hand, even if the account balance data on the server is tampered with, the transaction information in the on-chain record table and the transaction information on the blockchain must also be simultaneously modified, greatly increasing the difficulty of tampering. Furthermore, the transaction information records the transaction amount and direction rather than directly recording the account balance; that is, tampering requires simultaneous modification of both the transaction amount and direction, further increasing the difficulty of tampering.

[0040] If multiple transactions occur simultaneously within a short period, a balance verification task is generated each time a balance verification thread is initiated, and this task is placed in the verification task queue. Based on the verification task queue, the account balance is verified using the aforementioned verification process to complete all balance verification tasks within the queue. Specifically, the following process can be used: As described in the verification process above, the account balance value does not change before verification and transaction completion. Therefore, all balance verification tasks can be consolidated into one task. For example: Transaction 1: Expenditure, 10 coins. Transaction 2: Expenditure, 5 coins. Consolidated as: Expenditure, 15 coins. Thus, only one account balance verification is required. Alternatively, the following process can be used: Based on the order of the verification task queue, each balance verification task is verified once, thereby sequentially completing all tasks within the queue.

[0041] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.

Claims

1. A method for preventing account balance tampering, characterized in that: include: Each transaction process is recorded to store transaction information, which is uploaded to an on-chain record table. The on-chain record table is stored on a server, and the transaction information is compressed and uploaded to the blockchain. The transaction information includes the transaction amount and the transaction direction. When a transaction occurs, the account balance is verified based on the transaction information, specifically including the following steps: Step 1: When a transaction occurs, start the balance verification thread; Step 2: When the balance verification thread is started, the account balance is verified according to the transaction information in the on-chain record table. If the verification result is consistent, the transaction is completed. If the verification result is inconsistent, the account balance is corrected and the transaction is completed. Step 3: When the transaction is completed, update the transaction information to the on-chain record table and upload the transaction information to the blockchain; Step 4: When another transaction occurs, repeat steps 1 through 3; Step 2 includes the following steps: Summarize the transaction information in the on-chain record table to obtain the actual balance; Verify the actual balance against the account balance; When the verification results are consistent, the account balance is increased or decreased according to the transaction amount and the transaction direction to complete the transaction; at this time, step 3 is executed directly. When the verification results are inconsistent, the transaction information in the blockchain is compared with the transaction information in the on-chain record table; If the comparison results are the same, the account balance is corrected according to the actual balance, and financial settlement is carried out to complete the transaction; When the comparison results are different, the transaction information in the on-chain record table is modified according to the transaction information in the blockchain to modify the actual balance. The account balance is then corrected based on the modified actual balance, and financial settlement is performed to complete the transaction.

2. The method for preventing account balance tampering according to claim 1, characterized in that: The financial liquidation includes: When the transaction is for expenditure, the corrected account balance is compared with the transaction limit. If the comparison result is greater than the transaction limit, the corrected account balance is reduced to complete the transaction. If the comparison result is less than the transaction limit, the account balance is insufficient to pay for the transaction, and the transaction is terminated.

3. A method for preventing account balance tampering according to any one of claims 1 to 2, characterized in that: If multiple transactions occur simultaneously within a short period of time, a balance verification task will be generated each time the balance verification thread is started. Place the balance verification task into the verification task queue; Based on the verification task queue, the account balance is verified to complete all balance verification tasks within the verification task queue.

Citation Information

Patent Citations

  • A dual trading method and system based on centralization and decentralization

    CN109242483A