A transaction verification method and device based on digital currency

By verifying the information in the digital currency transaction chain using a tree structure, the problem of multiple payments in digital currencies is solved, enabling timely identification and attribution of responsibility for multiple payments, thus ensuring the stability of the digital currency market and the protection of user interests.

CN116151813BActive Publication Date: 2026-03-31THE PEOPLES BANK OF CHINA DIGITAL CURRENCY INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-23
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Digital currencies are easily tampered with by hackers during offline payments, leading to multiple payment issues and affecting the economic stability of digital currency operators, actual owners, and counterparties.

Method used

A tree structure is used to verify the information of the digital currency transaction chain. By judging the parent-child relationship and balance of transaction nodes, multiple payments are identified and the tree structure is updated. The responsible party is recorded and blacklisted or compensated for the difference.

Benefits of technology

Effectively identify multiple payment issues, protect the stability of the digital currency market, reduce losses for all parties, and ensure user experience and accountability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116151813B_ABST
    Figure CN116151813B_ABST
Patent Text Reader

Abstract

The application discloses a transaction verification method and device based on digital currency, and relates to the technical field of computers. A specific implementation manner of the method comprises the following steps: receiving transaction chain information uploaded by a transaction requester; for each piece of transaction chain information, judging whether a transaction node corresponding to the transaction chain information exists in a tree structure; if yes, verifying the transaction chain information according to the tree structure; and if no, updating the tree structure according to the transaction chain information, and verifying the transaction chain information according to the updated tree structure. The implementation manner can solve the technical problem that multiple payment verifications cannot be performed on digital currency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a transaction verification method and apparatus based on digital currency. Background Technology

[0002] As a payment credential, digital currency is characterized by offline payment capabilities. This characteristic makes its data composition and encryption methods highly susceptible to being deciphered by hackers during offline data transmission. Hackers can then alter and forge the payment credential, creating "counterfeit currency" for repeated payments, leading to multiple payments and causing economic losses to the actual operators, owners, or counterparties of the digital currency, thus disrupting the stability of the entire digital currency payment market. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a transaction verification method and apparatus based on digital currency to solve the technical problem of the inability to perform multiple payment verifications on digital currency.

[0004] To achieve the above objectives, according to one aspect of the present invention, a transaction verification method based on digital currency is provided, comprising:

[0005] Receive transaction chain information uploaded by the transaction requester;

[0006] For each transaction chain information, determine whether the corresponding transaction node exists in the tree structure;

[0007] If so, then verify the transaction chain information according to the tree structure;

[0008] If not, the tree structure is updated according to the transaction chain information, and the transaction chain information is verified according to the updated tree structure.

[0009] Optionally, the first transaction chain of digital currency is taken as the root node of the tree structure, the last transaction chain is taken as the leaf node of the tree structure, the intermediate transaction chains are taken as the intermediate nodes of the tree structure, and the node balance of each transaction node is the balance of the recipient corresponding to the transaction node after each transaction occurs.

[0010] Optionally, for each transaction node, the payer of the transaction node is the same as the payee of the parent node of the transaction node, and the payee of the transaction node is the same as the payer of the child node of the transaction node.

[0011] Optionally, verifying the transaction chain information based on the tree structure includes:

[0012] Locate the parent node of the transaction node corresponding to the transaction chain information in the tree structure;

[0013] Determine whether the node balance of the parent node is greater than or equal to the transaction amount of the transaction chain information;

[0014] If so, then update the node balance of the parent node according to the transaction amount in the transaction chain information;

[0015] If not, then perform a multi-payment liability analysis on the transaction chain information.

[0016] Optionally, updating the tree structure based on the transaction chain information includes:

[0017] Transaction nodes are generated based on the transaction chain information;

[0018] The parent node of the transaction node is located in the tree structure based on the payer of the transaction node;

[0019] The transaction node is inserted into the tree structure as a child node of the parent node to update the tree structure.

[0020] Optionally, the transaction chain information is verified according to the updated tree structure, including:

[0021] Determine whether the node balance of the parent node of the transaction node is greater than or equal to the transaction amount of the transaction chain information;

[0022] If so, then update the node balance of the parent node according to the transaction amount in the transaction chain information;

[0023] If not, then perform a multi-payment liability analysis on the transaction chain information.

[0024] Optionally, the transaction chain information may be subjected to multi-payment liability analysis, including:

[0025] Determine whether the payer in the transaction chain information is the same as the transaction requester in the transaction chain information;

[0026] If so, the transaction requester of the aforementioned transaction chain information will be added to the blacklist;

[0027] If not, the payer of the transaction chain information will be added to the blacklist, and the payee of the transaction chain information will be made up for the difference.

[0028] Optionally, after adding the transaction requester or payer of the transaction chain information to the blacklist, the method further includes:

[0029] Return the difference amount to the transaction requester or the payer, and set the status of the transaction requester or the payer to "multiple payment status".

[0030] Furthermore, according to another aspect of the present invention, a transaction verification device based on digital currency is provided, comprising:

[0031] The receiving module is used to receive transaction chain information uploaded by the transaction requester;

[0032] The verification module is used to determine whether a transaction node corresponding to the transaction chain information exists in the tree structure for each transaction chain information; if so, the transaction chain information is verified according to the tree structure; if not, the tree structure is updated according to the transaction chain information, and the transaction chain information is verified according to the updated tree structure.

[0033] Optionally, the first transaction chain of digital currency is taken as the root node of the tree structure, the last transaction chain is taken as the leaf node of the tree structure, the intermediate transaction chains are taken as the intermediate nodes of the tree structure, and the node balance of each transaction node is the balance of the recipient corresponding to the transaction node after each transaction occurs.

[0034] Optionally, for each transaction node, the payer of the transaction node is the same as the payee of the parent node of the transaction node, and the payee of the transaction node is the same as the payer of the child node of the transaction node.

[0035] Optionally, the verification module is further configured to:

[0036] Locate the parent node of the transaction node corresponding to the transaction chain information in the tree structure;

[0037] Determine whether the node balance of the parent node is greater than or equal to the transaction amount of the transaction chain information;

[0038] If so, then update the node balance of the parent node according to the transaction amount in the transaction chain information;

[0039] If not, then perform a multi-payment liability analysis on the transaction chain information.

[0040] Optionally, the verification module is further configured to:

[0041] Transaction nodes are generated based on the transaction chain information;

[0042] The parent node of the transaction node is located in the tree structure based on the payer of the transaction node;

[0043] The transaction node is inserted into the tree structure as a child node of the parent node to update the tree structure.

[0044] Optionally, the verification module is further configured to:

[0045] Determine whether the node balance of the parent node of the transaction node is greater than or equal to the transaction amount of the transaction chain information;

[0046] If so, then update the node balance of the parent node according to the transaction amount in the transaction chain information;

[0047] If not, then perform a multi-payment liability analysis on the transaction chain information.

[0048] Optionally, the verification module is further configured to:

[0049] Determine whether the payer in the transaction chain information is the same as the transaction requester in the transaction chain information;

[0050] If so, the transaction requester of the aforementioned transaction chain information will be added to the blacklist;

[0051] If not, the payer of the transaction chain information will be added to the blacklist, and the payee of the transaction chain information will be made up for the difference.

[0052] Optionally, the verification module is further configured to:

[0053] After adding the transaction requester or the payer of the transaction chain information to the blacklist, a message to compensate for the difference is returned to the transaction requester or the payer, and the status of the transaction requester or the payer is set to the multiple payment status.

[0054] According to another aspect of the present invention, an electronic device is also provided, comprising:

[0055] One or more processors;

[0056] Storage device for storing one or more programs.

[0057] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.

[0058] According to another aspect of the present invention, a computer-readable medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the methods described in any of the above embodiments.

[0059] One embodiment of the above invention has the following advantages or beneficial effects: Because it employs a technical means that if a transaction node corresponding to the transaction chain information exists in the tree structure, the transaction chain information is verified according to the tree structure; if no transaction node corresponding to the transaction chain information exists in the tree structure, the tree structure is updated and the transaction chain information is verified according to the updated tree structure, thus overcoming the technical problem in the prior art that multiple payment verification of digital currency is impossible. This embodiment of the invention utilizes a tree structure to verify the transaction chain information of digital currency, promptly detecting potential multiple payment problems, identifying illegal transaction parties as early as possible, and reducing the losses of all parties caused by multiple payment problems during the circulation of digital currency.

[0060] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0061] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0062] Figure 1 This is a schematic diagram of the main process of a transaction verification method based on digital currency according to an embodiment of the present invention;

[0063] Figure 2 This is a schematic diagram of a tree structure according to an embodiment of the present invention;

[0064] Figure 3 This is a schematic diagram of a tree structure according to another embodiment of the present invention;

[0065] Figure 4 This is a schematic diagram of the main process of a digital currency-based transaction verification method according to a possible embodiment of the present invention;

[0066] Figure 5 This is a schematic diagram of the main process of a digital currency-based transaction verification method according to another applicable embodiment of the present invention;

[0067] Figure 6 This is a schematic diagram of the main modules of a digital currency-based transaction verification device according to an embodiment of the present invention;

[0068] Figure 7 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0069] Figure 8 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0070] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0071] Figure 1 This is a schematic diagram of the main process of a transaction verification method based on digital currency according to an embodiment of the present invention. As one embodiment of the present invention, such as... Figure 1 As shown, the transaction verification method based on digital currency may include:

[0072] Step 101: Receive the transaction chain information uploaded by the transaction requester.

[0073] The requesting party uploads the transaction chain information of the digital currency to the issuing institution. The issuing institution receives the transaction chain information of the digital currency uploaded by the requesting party. Based on the transaction request and the corresponding transaction certificate of the digital currency, the issuing institution decomposes the specific transaction chain information, such as the payer, payee, transaction time, and transaction amount of each transaction chain.

[0074] In embodiments of the present invention, the digital currency records transaction information (such as payer, payee, transaction time, transaction amount, etc.) for each transaction during the offline process, to be supplemented when online. This transaction information is recorded sequentially according to the order in which the transactions occurred. Therefore, embodiments of the present invention can trace back the changes to the digital currency caused by each transaction based on the recorded transaction sequence and transaction content, identifying the specific transaction that caused the "multiple payment" problem and the transaction requester that caused the "multiple payment".

[0075] Step 102: For each transaction chain information, determine whether there is a transaction node corresponding to the transaction chain information in the tree structure; if yes, proceed to step 103; if no, proceed to step 104.

[0076] A tree structure is a multi-level, non-linear, nested data structure that can be recursively represented. This structure represents a "one-to-many" data relationship through the correspondence between leaf nodes, intermediate nodes, and the root node. Each tree structure has one and only one root node, which has no predecessor node and can correspond to multiple subsequent intermediate or leaf nodes; intermediate nodes can also correspond to multiple subsequent intermediate or leaf nodes; leaf nodes do not correspond to any subsequent nodes.

[0077] Optionally, the first transaction chain of the digital currency is taken as the root node of the tree structure, the last transaction chain is taken as the leaf node of the tree structure, and the intermediate transaction chains are taken as the intermediate nodes of the tree structure. Therefore, the tree structure can be generated according to each transaction chain recorded in the digital currency.

[0078] For example, the transaction chain information is shown in the table below:

[0079]

[0080] In the above four transaction chains, the first transaction chain is from the issuing institution to wallet A, the last transaction chain is from wallet C to wallet D, and the intermediate transaction chains are from wallet A to wallet B and from wallet B to wallet C. Therefore, a structure like this can be constructed... Figure 2 The tree structure shown has the following nodes: issuing institution → wallet A as the root node, wallet C → wallet D as the leaf nodes, and wallet A → wallet B and wallet B → wallet C as intermediate nodes.

[0081] Similarly, if the issuing institution continues to receive information from other transaction chains, such as wallet B→wallet E, wallet A→wallet F, wallet F→wallet G, it can construct a chain like... Figure 3 The tree structure shown will not be described in detail again.

[0082] Furthermore, in embodiments of the present invention, the node balance of each transaction node is the balance of the payee corresponding to that transaction node after each transaction occurs. For example... Figure 3 As shown, the node balance of node A→B is the balance of the recipient's wallet B. Since wallet B paid 25 to wallet C and 20 to wallet E, the balance of wallet B = 60 - 25 - 20 = 15. The calculation method for the node balance of other nodes is similar and will not be repeated.

[0083] Optionally, such as Figure 3 As shown, for each transaction node, the payer of the transaction node is the same as the payee of the parent node of the transaction node, and the payee of the transaction node is the same as the payer of the child node of the transaction node.

[0084] When examining cryptocurrencies, it's necessary to collect transaction chain information to trace the chronological order of transactions and establish contextual relationships. As a recursively represented, multi-level, non-linear nested data structure, tree structures are well-suited for recording the sequential relationships between transactions and the changes in currency amounts caused by different transactions. The first transaction of the cryptocurrency is designated as the root node of the tree structure, the last transaction as a leaf node, and intermediate transactions as intermediate nodes. The node values ​​are assigned the balance after each transaction, such as... Figure 2-3 As shown, this enables multi-payment checks on digital currencies.

[0085] Step 103: Verify the transaction chain information according to the tree structure.

[0086] If the transaction node corresponding to the transaction chain information already exists in the tree structure, there is no need to update the tree structure. Instead, the tree structure is used to directly verify whether the transaction chain information has multiple payment issues. Specifically, the parent-child relationship between the two transaction chains is first determined, and the transaction content of each transaction chain is checked to see if multiple payment issues have occurred. The check result of each transaction chain is recorded. For transaction nodes that pass the check, the node balance is updated. For transaction nodes that fail the check, they are blacklisted and a compensation amount is recorded.

[0087] Multiple payment refers to the same amount of money being spent multiple times. For example, if a digital currency with a face value of 100 yuan is used to buy a piece of clothing worth 80 yuan and then used to top up a mobile phone with 50 yuan, the portion of the sum of the two transactions that exceeds 100 yuan (i.e., 30 yuan) is the amount of the digital currency that has been "multiple-paid". Therefore, the problem of the same digital currency being spent for a amount greater than its face value is called the "multiple payment" problem.

[0088] Optionally, step 103 may include: locating the parent node of the transaction node corresponding to the transaction chain information in the tree structure; determining whether the node balance of the parent node is greater than or equal to the transaction amount of the transaction chain information; if yes, updating the node balance of the parent node according to the transaction amount of the transaction chain information; if no, performing multiple payment liability analysis on the transaction chain information. For example, based on the transaction chain information that wallet F pays 15 yuan to wallet G, locating the parent node A→F of the F→G node; then determining whether the node balance 40 of the parent node A→F node (because wallet A paid 40 to wallet F) is greater than or equal to the transaction amount 15 of the transaction chain information; if yes, updating the node balance of the parent node A→F node according to the transaction amount of the transaction chain information, so that it is 40-15=25, therefore the node balance of the parent node A→F node is updated to 25. For example, based on the transaction chain information, if wallet C pays 20 yuan to wallet F, the parent node B→C of the C→F node can be located. Then, it is determined whether the node balance of the parent node B→C (15 yuan, since wallet B paid 25 yuan to wallet C, and wallet C then paid 10 yuan to wallet D) is greater than or equal to the transaction amount of 20 yuan in the transaction chain information. If not, it indicates that multiple payments have occurred, and multiple payment liability analysis needs to be performed on the transaction chain information.

[0089] Optionally, a multi-payment liability analysis is performed on the transaction chain information, including: determining whether the payer of the transaction chain information is the same as the transaction requester; if so, the transaction requester is added to a blacklist; if not, the payer is added to a blacklist, and the payee is required to make up the difference. If multi-payment is determined to have occurred, further liability analysis is needed on the transaction nodes involved. Upon detecting a multi-payment node, further analysis is performed. If the payer of the node is the same as the transaction requester, the party responsible for the multi-payment is the transaction requester who uploaded the transaction certificate, and should be added to a blacklist, rejecting this transaction and any subsequent transactions. If the payer of the node is different from the transaction requester, the party responsible for the multi-payment is the payer of the node, and should be added to a blacklist, allowing the transaction to proceed while the issuing institution makes up the difference. This embodiment of the invention can clearly identify the responsible party for multi-payment issues and take different follow-up measures based on the responsible party.

[0090] This invention, by recording and examining transaction chain information as a tree structure, can accurately identify the parties involved in a multiple payment issue and the transaction amount. Therefore, the party causing the multiple payment issue can be blacklisted, and subsequently, legal means can be used to compel them to make up the overpaid transaction amount. Simultaneously, the affected party can be temporarily compensated using funds from the issuing institution, making the victim unaware of the multiple payment issue, thus protecting their rights and user experience, and flexibly and reasonably recording the attribution of responsibility.

[0091] Optionally, after adding the transaction requester or payer of the transaction chain information to the blacklist, the method further includes: returning a message to the transaction requester or payer to make up the difference, and setting the status of the transaction requester or payer to a state of multiple payment. In an embodiment of the present invention, after adding the transaction requester or payer of the transaction chain information to the blacklist, returning a message to the transaction requester or payer to make up the difference, notifying the transaction requester or payer to make up the transaction amount for multiple payments, and setting the status of the transaction requester or payer to a state of multiple payment.

[0092] Step 104: Update the tree structure according to the transaction chain information, and verify the transaction chain information according to the updated tree structure.

[0093] If the transaction node corresponding to the transaction chain information does not exist in the tree structure, the tree structure needs to be updated first, and then the transaction chain information needs to be verified for multiple payments based on the updated tree structure.

[0094] Optionally, updating the tree structure based on the transaction chain information includes: generating a transaction node based on the transaction chain information; locating the parent node of the transaction node in the tree structure based on the payer of the transaction node; and inserting the transaction node as a child node of the parent node into the tree structure to update the tree structure. Since the payer of a transaction node is the same as the payee of its parent node, and the payee of a transaction node is the same as the payer of its child nodes, the parent node of the transaction node can be located through the parent-child relationship, and then the transaction node can be inserted into the tree structure to update the tree structure.

[0095] Optionally, the transaction chain information is verified according to the updated tree structure, including: determining whether the node balance of the parent node of the transaction node is greater than or equal to the transaction amount of the transaction chain information; if so, the node balance of the parent node is updated according to the transaction amount of the transaction chain information; if not, a multi-payment liability analysis is performed on the transaction chain information. Specifically, the parent-child relationship between the two transaction chains is first determined, and the transaction content of each transaction chain is checked to see if a multi-payment problem has occurred in each transaction chain. The check result of each transaction chain is recorded. For transaction nodes that pass the check, the node balance is updated. For transaction nodes that fail the check, a blacklist is created and a compensation amount is recorded. This process is similar to step 103 and will not be described in detail here.

[0096] In this embodiment of the invention, the transaction chain information is established into a tree structure according to the order of transactions, and each transaction chain is checked from bottom to top, that is, from the last transaction chain to the first transaction chain, to determine whether multiple payments have occurred.

[0097] The use of digital currencies as payment credentials has brought convenience to the financial market. However, at the same time, security issues related to digital currencies, such as multi-payment problems, are constantly emerging, threatening the financial security of various economic entities in the market. This invention employs a tree structure to examine multi-payment issues in digital currencies. The method is simple and efficient, effectively curbing the spread of multi-payment problems. It can quickly detect suspicious transactions after multi-payment issues occur, thereby protecting the interests of various economic entities in the digital currency market and ensuring the stability of the entire digital currency payment market.

[0098] Based on the various embodiments described above, it can be seen that the embodiments of the present invention solve the technical problem of the inability to perform multi-payment verification on digital currencies in the prior art by using a technical means that verifies the transaction chain information according to the tree structure if a transaction node corresponding to the transaction chain information exists in the tree structure, and updates the tree structure and verifies the transaction chain information according to the updated tree structure if no transaction node corresponding to the transaction chain information exists in the tree structure. The embodiments of the present invention utilize a tree structure to verify the transaction chain information of digital currencies, promptly detecting potential multi-payment problems, identifying illegal transaction parties as early as possible, and reducing the losses of all parties caused by multi-payment problems during the circulation of digital currencies.

[0099] Figure 4 This is a schematic diagram of the main flow of a digital currency-based transaction verification method according to a possible embodiment of the present invention. As another embodiment of the present invention, such as... Figure 4 As shown, the transaction verification method based on digital currency may include:

[0100] Step 401: Initialize the return information and set the issuer's compensation amount to zero.

[0101] First, the issuing institution initializes the returned information and sets the difference amount to zero.

[0102] Step 402: Receive the transaction chain information uploaded by the transaction requester.

[0103] When a transaction requester uploads transaction chain information, the issuing institution receives this information. When the issuing institution inspects the cryptocurrency, it needs to collect the transaction chain information to trace the chronological order of transactions and establish contextual relationships.

[0104] Step 403: For each transaction chain information, determine whether there is a transaction node corresponding to the transaction chain information in the tree structure; if yes, proceed to step 404; if no, proceed to step 410.

[0105] A tree structure is a multi-level, non-linear, nested data structure that can be recursively represented. This structure represents a "one-to-many" data relationship through the correspondence between leaf nodes, intermediate nodes, and the root node. Each tree structure has one and only one root node, which has no predecessor node and can correspond to multiple subsequent intermediate or leaf nodes; intermediate nodes can also correspond to multiple subsequent intermediate or leaf nodes; leaf nodes do not correspond to any subsequent nodes.

[0106] In an embodiment of the present invention, the first transaction chain of digital currency transactions is taken as the root node of the tree structure, the last transaction chain is taken as the leaf node of the tree structure, and the intermediate transaction chains are taken as the intermediate nodes of the tree structure. Therefore, a tree structure can be generated based on each transaction chain recorded in the digital currency. In an embodiment of the present invention, the node balance of each transaction node is the balance of the payee corresponding to the transaction node after each transaction occurs; moreover, for each transaction node, the payer of the transaction node is the same as the payee of the parent node of the transaction node, and the payee of the transaction node is the same as the payer of the child node of the transaction node.

[0107] As a multi-level, non-linear, nested data structure that can be recursively represented, tree structures are well-suited for recording the sequential relationships between transactions and the changes in currency amounts caused by different transactions. The first transaction of the digital currency is taken as the root node of the tree structure, the last transaction as the leaf node, and intermediate transactions as intermediate nodes. The node value is set to the balance after each transaction, thus enabling multi-payment checks on the digital currency.

[0108] In this embodiment of the invention, the transaction chain information is established into a tree structure according to the order of transactions, and each transaction chain is checked from bottom to top, that is, from the last transaction chain to the first transaction chain, to determine whether multiple payments have occurred.

[0109] Step 404: Locate the parent node of the transaction node corresponding to the transaction chain information in the tree structure.

[0110] If the transaction node corresponding to the transaction chain information already exists in the tree structure, there is no need to update the tree structure. Instead, the parent node of the transaction node corresponding to the transaction chain information is located in the tree structure so as to verify whether the transaction chain information has multiple payments in subsequent steps.

[0111] Step 405: Determine whether the node balance of the parent node of the transaction node is greater than or equal to the transaction amount of the transaction chain information; if yes, proceed to step 406; if no, proceed to step 407.

[0112] Since the node balance of each transaction node is the balance of the payee corresponding to that transaction node after each transaction occurs, it is possible to determine whether multiple payments have occurred by judging whether the node balance of the parent node of the transaction node is greater than or equal to the transaction amount of the transaction chain information.

[0113] Step 406: Update the node balance of the parent node according to the transaction amount in the transaction chain information.

[0114] If the node balance of the parent node of the transaction node is greater than or equal to the transaction amount of the transaction chain information, it indicates that no multi-payment problem has occurred, and the node balance of the parent node is updated according to the transaction amount of the transaction chain information.

[0115] Step 407: Determine whether the payer of the transaction chain information is the same as the transaction requester of the transaction chain information; if yes, proceed to step 408; if no, proceed to step 409.

[0116] If the node balance of the parent node of the transaction node is less than the transaction amount of the transaction chain information, it indicates that a multi-payment problem has occurred, and further responsibility analysis is needed for the transaction node where multi-payment occurred.

[0117] Step 408: Add the transaction requester of the transaction chain information to the blacklist.

[0118] Once a transaction node where multiple payments have occurred is detected, further analysis is performed on that node. If the payer of that node is the same as the party requesting the transaction, then the party responsible for the multiple payments is the same as the party who uploaded the transaction voucher. This party should be blacklisted, and their current transaction and any subsequent transactions should be rejected. Legal means should then be used to compel them to make up the amount of the multiple payments. Optionally, after step 408, the process further includes: returning a message to the party requesting the transaction to compensate for the difference, and setting the party requesting the transaction to a state of multiple payments.

[0119] Step 409: Add the payer of the transaction chain information to the blacklist and make up the difference for the payee of the transaction chain information.

[0120] If the payer of a node is different from the party requesting the transaction, the party responsible for multiple payments belongs to the payer of that node, is blacklisted, and the transaction is allowed to proceed, with the issuing institution making up the difference. This embodiment of the invention temporarily uses funds from the issuing institution to compensate the affected transaction requester, making the affected party unaware of the multiple payment issue, protecting the rights and user experience of the affected party, and thus flexibly and reasonably recording the attribution of responsibility. Optionally, after step 409, the method may further include: returning a message to the payer indicating the difference amount has been made, and setting the payer's status to "multiple payment status".

[0121] Step 410: Update the tree structure according to the transaction chain information.

[0122] If the transaction node corresponding to the transaction chain information does not exist in the tree structure, the tree structure needs to be updated first, and then the transaction chain information needs to be verified for multiple payments based on the updated tree structure.

[0123] Specifically, a transaction node is generated based on the transaction chain information; the parent node of the transaction node is located in the tree structure based on the payer of the transaction node; the transaction node is inserted into the tree structure as a child node of the parent node to update the tree structure. Since the payer of a transaction node is the same as the payee of its parent node, and the payee of a transaction node is the same as the payer of its child node, the parent node of the transaction node can be located through the parent-child relationship, and then the transaction node is inserted into the tree structure to update the tree structure.

[0124] Furthermore, the specific implementation details of the transaction verification method based on digital currency in one of the reference embodiments of the present invention have been described in detail in the above-described transaction verification method based on digital currency, so the details will not be repeated here.

[0125] Figure 5 This is a schematic diagram of the main flow of a digital currency-based transaction verification method according to another possible embodiment of the present invention. As another embodiment of the present invention, such as... Figure 5 As shown, the transaction verification method based on digital currency may include:

[0126] Step 501: Receive the transaction chain information uploaded by the transaction requester.

[0127] Step 502: For each transaction chain information, determine whether there is a transaction node corresponding to the transaction chain information in the tree structure; if yes, proceed to step 503; if no, proceed to step 507.

[0128] Step 503: Locate the parent node of the transaction node corresponding to the transaction chain information in the tree structure.

[0129] Step 504: Determine whether the node balance of the parent node of the transaction node is greater than or equal to the transaction amount of the transaction chain information; if yes, proceed to step 505; if no, proceed to step 506.

[0130] Step 505: Update the node balance of the parent node according to the transaction amount in the transaction chain information.

[0131] Step 506: Perform a multi-payment liability analysis on the transaction chain information.

[0132] Step 507: Generate a transaction node based on the transaction chain information.

[0133] Step 508: Locate the parent node of the transaction node in the tree structure based on the payer of the transaction node.

[0134] Step 509: Insert the transaction node as a child node of the parent node into the tree structure to update the tree structure.

[0135] In addition, the specific implementation details of the transaction verification method based on digital currency in another reference embodiment of the present invention have been described in detail in the above-described transaction verification method based on digital currency, so the details will not be repeated here.

[0136] Figure 6 This is a schematic diagram of the main modules of a digital currency-based transaction verification device according to an embodiment of the present invention, as shown below. Figure 6 As shown, the digital currency-based transaction verification device 600 includes a receiving module 601 and a verification module 602. The receiving module 601 receives transaction chain information uploaded by the transaction requester. The verification module 602, for each transaction chain information, determines whether a corresponding transaction node exists in the tree structure. If so, it verifies the transaction chain information according to the tree structure; if not, it updates the tree structure based on the transaction chain information and verifies the transaction chain information based on the updated tree structure.

[0137] Optionally, the first transaction chain of digital currency is taken as the root node of the tree structure, the last transaction chain is taken as the leaf node of the tree structure, the intermediate transaction chains are taken as the intermediate nodes of the tree structure, and the node balance of each transaction node is the balance of the recipient corresponding to the transaction node after each transaction occurs.

[0138] Optionally, for each transaction node, the payer of the transaction node is the same as the payee of the parent node of the transaction node, and the payee of the transaction node is the same as the payer of the child node of the transaction node.

[0139] Optionally, the verification module 602 is further configured to:

[0140] Locate the parent node of the transaction node corresponding to the transaction chain information in the tree structure;

[0141] Determine whether the node balance of the parent node is greater than or equal to the transaction amount of the transaction chain information;

[0142] If so, then update the node balance of the parent node according to the transaction amount in the transaction chain information;

[0143] If not, then perform a multi-payment liability analysis on the transaction chain information.

[0144] Optionally, the verification module 602 is further configured to:

[0145] Transaction nodes are generated based on the transaction chain information;

[0146] The parent node of the transaction node is located in the tree structure based on the payer of the transaction node;

[0147] The transaction node is inserted into the tree structure as a child node of the parent node to update the tree structure.

[0148] Optionally, the verification module 602 is further configured to:

[0149] Determine whether the node balance of the parent node of the transaction node is greater than or equal to the transaction amount of the transaction chain information;

[0150] If so, then update the node balance of the parent node according to the transaction amount in the transaction chain information;

[0151] If not, then perform a multi-payment liability analysis on the transaction chain information.

[0152] Optionally, the verification module 602 is further configured to:

[0153] Determine whether the payer in the transaction chain information is the same as the transaction requester in the transaction chain information;

[0154] If so, the transaction requester of the aforementioned transaction chain information will be added to the blacklist;

[0155] If not, the payer of the transaction chain information will be added to the blacklist, and the payee of the transaction chain information will be made up for the difference.

[0156] Optionally, the verification module 602 is further configured to:

[0157] After adding the transaction requester or the payer of the transaction chain information to the blacklist, a message to compensate for the difference is returned to the transaction requester or the payer, and the status of the transaction requester or the payer is set to the multiple payment status.

[0158] It should be noted that the specific implementation details of the transaction verification device based on digital currency described in this invention have been described in detail in the transaction verification method based on digital currency described above, so the details will not be repeated here.

[0159] Figure 7 An exemplary system architecture 700 is shown, to which the digital currency-based transaction verification method or digital currency-based transaction verification device of the present invention can be applied.

[0160] like Figure 7As shown, system architecture 700 may include terminal devices 701, 702, and 703, a network 704, and a server 705. Network 704 serves as the medium for providing communication links between terminal devices 701, 702, and 703 and server 705. Network 704 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0161] Users can use terminal devices 701, 702, and 703 to interact with server 705 via network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0162] Terminal devices 701, 702, and 703 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0163] Server 705 can be a server that provides various services, such as a backend management server that supports shopping websites browsed by users using terminal devices 701, 702, and 703 (this is just an example). The backend management server can analyze and process data such as received item information query requests, and then feed the processing results back to the terminal devices.

[0164] It should be noted that the transaction verification method based on digital currency provided in this embodiment of the invention is generally executed by server 705, and correspondingly, the transaction verification device based on digital currency is generally set in server 705.

[0165] It should be understood that Figure 7 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0166] The following is for reference. Figure 8 It shows a schematic diagram of the structure of a computer system 800 suitable for implementing a terminal device of the present invention. Figure 8 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0167] like Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage section 808 into random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the system 800. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0168] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.

[0169] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs the functions defined above in the system of this invention.

[0170] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0171] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer programs according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0172] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor may be described as including a receiving module and a verification module, wherein the names of these modules do not necessarily limit the module itself.

[0173] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device implements the following method: receiving transaction chain information uploaded by a transaction requester; for each transaction chain information, determining whether a transaction node corresponding to the transaction chain information exists in a tree structure; if so, verifying the transaction chain information according to the tree structure; if not, updating the tree structure according to the transaction chain information, and verifying the transaction chain information according to the updated tree structure.

[0174] According to the technical solution of this invention, by employing a method that verifies the transaction chain information based on the tree structure if a transaction node corresponding to the transaction chain information exists in the tree structure, and updates the tree structure and verifies the transaction chain information based on the updated tree structure if no transaction node corresponding to the transaction chain information exists in the tree structure, the technical problem of the inability to perform multi-payment verification on digital currencies in the prior art is overcome. This invention utilizes a tree structure to verify the transaction chain information of digital currencies, promptly detecting potential multi-payment issues, identifying illegal transaction parties as early as possible, and reducing the losses of all parties caused by multi-payment issues during the circulation of digital currencies.

[0175] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for verifying a transaction based on a digital currency, characterized by, The method comprises the following steps: receiving transaction chain information uploaded by a transaction requester; for each piece of transaction chain information, judging whether a transaction node corresponding to the transaction chain information exists in a tree structure; if yes, verifying the transaction chain information according to the tree structure; if no, updating the tree structure according to the transaction chain information, and verifying the transaction chain information according to the updated tree structure; taking a first transaction chain of a digital currency as a root node of the tree structure, taking a last transaction chain as a leaf node of the tree structure, taking intermediate transaction chains as intermediate nodes of the tree structure, and taking a balance of each transaction node as a balance of a payee corresponding to the transaction node after each transaction; 2. The method of claim 1, wherein, for each transaction node, a payer of the transaction node is the same as a payee of a parent node of the transaction node, and a payee of the transaction node is the same as a payer of a child node of the transaction node. The verifying the transaction chain information according to the tree structure comprises the following steps: locating a parent node of the transaction node corresponding to the transaction chain information in the tree structure; judging whether a balance of the parent node is greater than or equal to a transaction amount of the transaction chain information; if yes, updating the balance of the parent node according to the transaction amount of the transaction chain information; 3. The method of claim 1, wherein, if no, performing multiple payment liability analysis on the transaction chain information. The updating the tree structure according to the transaction chain information comprises the following steps: generating a transaction node according to the transaction chain information; locating a parent node of the transaction node in the tree structure according to a payer of the transaction node; 4. The method of claim 3, wherein, inserting the transaction node into the tree structure as a child node of the parent node to update the tree structure. The verifying the transaction chain information according to the updated tree structure comprises the following steps: judging whether a balance of the parent node of the transaction node is greater than or equal to a transaction amount of the transaction chain information; if yes, updating the balance of the parent node according to the transaction amount of the transaction chain information; 5. The method according to claim 2 or 4, characterized in that, if no, performing multiple payment liability analysis on the transaction chain information. The performing multiple payment liability analysis on the transaction chain information comprises the following steps: judging whether a payer of the transaction chain information is the same as a transaction requester of the transaction chain information; if yes, adding the transaction requester of the transaction chain information into a blacklist; 6. The method of claim 5, wherein, if no, adding the payer of the transaction chain information into the blacklist, and making up a difference for a payee of the transaction chain information. After adding the transaction requester of the transaction chain information into the blacklist or adding the payer of the transaction chain information into the blacklist, the method further comprises the following steps:

7. A digital currency based transaction verification apparatus, characterized by, returning a message of the made-up difference to the transaction requester or the payer, and setting a state of the transaction requester or the payer as a multiple payment state. The method comprises the following steps: a receiving module, configured to receive transaction chain information uploaded by a transaction requester; a verifying module, configured to, for each piece of transaction chain information, judge whether a transaction node corresponding to the transaction chain information exists in a tree structure; if yes, verify the transaction chain information according to the tree structure; if no, update the tree structure according to the transaction chain information, and verify the transaction chain information according to the updated tree structure. A first transaction chain of the digital currency is taken as a root node of the tree structure, a last transaction chain is taken as a leaf node of the tree structure, and intermediate transaction chains are taken as intermediate nodes of the tree structure, and a node balance of each transaction node is a balance of a payee corresponding to the transaction node after each transaction occurs; For each transaction node, a payer of the transaction node is the same as a payee of a parent node of the transaction node, and a payee of the transaction node is the same as a payer of a child node of the transaction node.

8. The apparatus of claim 7, wherein, The verification module is further configured to: locate a parent node of a transaction node corresponding to the transaction chain information in the tree structure; determine whether a node balance of the parent node is greater than or equal to a transaction amount of the transaction chain information; if yes, update the node balance of the parent node according to the transaction amount of the transaction chain information; if no, perform multiple payment liability analysis on the transaction chain information.

9. The apparatus of claim 7, wherein, The verification module is further configured to: generate a transaction node according to the transaction chain information; locate a parent node of the transaction node in the tree structure according to a payer of the transaction node; insert the transaction node into the tree structure as a child node of the parent node, to update the tree structure.

10. The apparatus of claim 9, wherein, The verification module is further configured to: determine whether a node balance of a parent node of the transaction node is greater than or equal to a transaction amount of the transaction chain information; if yes, update the node balance of the parent node according to the transaction amount of the transaction chain information; if no, perform multiple payment liability analysis on the transaction chain information.

11. The apparatus of claim 8 or 10, wherein, The verification module is further configured to: determine whether a payer of the transaction chain information is the same as a transaction requester of the transaction chain information; if yes, add the transaction requester of the transaction chain information to a blacklist; if no, add the payer of the transaction chain information to the blacklist, and make up a difference for a payee of the transaction chain information.

12. The apparatus of claim 11, wherein, The verification module is further configured to: after adding the transaction requester of the transaction chain information to the blacklist or adding the payer of the transaction chain information to the blacklist, return a message of a made-up amount to the transaction requester or the payer, and set a state of the transaction requester or the payer to a multiple payment state.

13. An electronic device, comprising: comprise: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-6.

14. A computer readable medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Transaction verification method, device, storage medium and electronic device

    CN109087101A

  • Digital currency double offline payment realization method, device and apparatus and storage medium

    CN111144862A