Offline transaction method and apparatus based on digital currency
By storing transaction information of encrypted digital currency strings in a tree structure and implementing dual control between the payer and payee, the problem of double-spending in offline transactions of encrypted digital currency strings is solved, thereby improving transaction security and success rate.
Patent Information
- Application Number
- CN202111421410.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2041-11-26
AI Technical Summary
Existing technologies cannot effectively prevent double-spending in offline transactions involving encrypted digital currency strings, leading to financial losses.
The transaction information of encrypted digital currency strings is stored in a tree structure. Before the transaction, the payer checks the available balance and generates transaction information. The payee verifies the transaction to ensure that the transaction amount does not exceed the available amount. After the transaction is successful, the available amount is updated, and abnormal transaction information is recorded for background arbitration.
This effectively avoids double payment, improves transaction security and success rate, and reduces the losses of all parties involved in the transaction.
Smart Images

Figure CN116187988B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to an offline transaction method and device based on digital currency. BACKGROUND
[0002] Double payment, also known as one coin multiple payment, refers to that a piece of money is spent twice or more times. With the gradual popularization of digital currency, in the encryption currency system, due to the replicability of data, the same piece of digital asset may be repeatedly used due to improper operation. Such a situation is obviously unreasonable and will cause property loss. At present, the following two technical means are mainly used to avoid the unreasonable transaction situation caused by double payment:
[0003] 1. Data integrity check based on a background system to prevent the occurrence of double payment in a transaction;
[0004] 2. Check and deduction of the balance of the payer terminal based on a special payment machine, so as to prevent overpayment of the payer terminal.
[0005] However, the two existing technical means do not achieve the expected control effect when applied to the offline transaction scene of the encryption string. Therefore, how to avoid the occurrence of double payment in the offline transaction scene of the digital currency encryption string is a technical problem to be solved at present. SUMMARY
[0006] Therefore, the embodiments of the present application provide an offline transaction method and device based on digital currency, which can control the transaction from both parties at the same time to avoid the occurrence of double payment, ensure the safety and success rate of the transaction, and save the transaction information of the digital currency encryption string through a tree structure, which can facilitate the tracing of the transaction record of the digital currency encryption string, thereby better avoiding the occurrence of double payment and greatly improving the safety and success rate of the transaction.
[0007] To achieve the above-mentioned purpose, according to an aspect of the embodiments of the present application, an offline transaction method based on digital currency is provided.
[0008] An offline transaction method based on digital currency comprises the following steps.
[0009] In response to performing an offline transaction operation, the transaction amount of the offline transaction and the available amount of the digital currency encryption string are obtained.
[0010] generate transaction information corresponding to the digital currency encryption string, the transaction information including the transaction amount, the digital currency encryption string and its available amount; wherein the transaction information corresponding to the digital currency encryption string is saved through a tree structure, the tree structure including a root node and branch nodes, the root node saving the available amount when the digital currency encryption string is generated for the first time, and the branch nodes saving the available amount after each transaction of the digital currency encryption string;
[0011] send the transaction information to a payee, so that the payee performs transaction verification according to the transaction amount and the available amount, and sets the available amount of the received digital currency encryption string according to the digital currency encryption string and the transaction amount after the transaction verification passes;
[0012] update the available amount of the digital currency encryption string according to the transaction amount and the available amount to complete the offline transaction.
[0013] Optionally, the method further includes:
[0014] when an abnormal situation occurs to cause a transaction failure, record abnormal transaction information, and send the abnormal transaction information to a background for arbitration to determine the ownership of the transaction amount.
[0015] Optionally, the payee performs transaction verification according to the transaction amount and the available amount includes:
[0016] the payee determines whether the transaction amount exceeds the available amount;
[0017] if the transaction amount does not exceed the available amount, the transaction verification passes.
[0018] Optionally, updating the available amount of the digital currency encryption string according to the transaction amount and the available amount includes:
[0019] updating the available amount of the digital currency encryption string according to the difference between the available amount and the transaction amount.
[0020] Optionally, when the digital currency encryption string is transacted each time, a child node is generated as a branch node with the node corresponding to the digital currency encryption string in a payer as a parent node, for saving transaction information of this transaction.
[0021] According to another aspect of the embodiment of the present application, there is provided an offline transaction device based on digital currency.
[0022] An offline transaction device based on digital currency includes:
[0023] a transaction data obtaining module, configured to obtain a transaction amount of an offline transaction and an available amount of a digital currency encryption string in response to performing an offline transaction operation;
[0024] a transaction information generating module, configured to generate transaction information corresponding to the digital currency encryption string, including the transaction amount, the digital currency encryption string and the available amount thereof, if the transaction amount does not exceed the available amount, wherein the transaction information corresponding to the digital currency encryption string is stored in a tree structure, the tree structure including a root node and branch nodes, the root node storing the available amount when the digital currency encryption string is generated for the first time, and the branch nodes storing the available amount after each transaction of the digital currency encryption string;
[0025] a transaction information sending module, configured to send the transaction information to a payee, so that the payee performs transaction verification according to the transaction amount and the available amount, and sets the available amount of the received digital currency encryption string according to the digital currency encryption string and the transaction amount after the transaction verification is passed;
[0026] an available amount updating module, configured to update the available amount of the digital currency encryption string according to the transaction amount and the available amount to complete the offline transaction.
[0027] Optionally, the apparatus further comprises an abnormal situation processing module, configured to:
[0028] record abnormal transaction information when an abnormal situation occurs to cause a transaction failure, and send the abnormal transaction information to a back-end for arbitration to determine the ownership of the transaction amount.
[0029] Optionally, the payee performs transaction verification according to the transaction amount and the available amount, including:
[0030] the payee determines whether the transaction amount exceeds the available amount;
[0031] if the transaction amount does not exceed the available amount, the transaction verification is passed.
[0032] Optionally, the available amount updating module is further configured to:
[0033] update the available amount of the digital currency encryption string according to the difference between the available amount and the transaction amount.
[0034] Optionally, a sub-node is generated as a branch node with the node corresponding to the digital currency encryption string in the payer as a parent node each time the digital currency encryption string performs a transaction, for saving transaction information of this transaction.
[0035] According to still another aspect of the embodiments of the present application, an offline transaction electronic device based on digital currency is provided.
[0036] An offline transaction electronic device based on digital currency, comprising: 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 offline transaction method based on digital currency provided by the embodiments of the present application.
[0037] According to still another aspect of the embodiments of the present application, a computer readable medium is provided.
[0038] A computer readable medium, having stored thereon a computer program, the program being executed by a processor to implement the offline transaction method based on digital currency provided by the embodiments of the present application.
[0039] The above-mentioned embodiment of the present application has the following advantages or beneficial effects: by responding to performing an offline transaction operation, the transaction amount of the offline transaction and the available amount of the digital currency encryption string are obtained; in the case that the transaction amount does not exceed the available amount, transaction information is generated, the transaction information corresponding to the digital currency encryption string is saved by a tree structure; the transaction information is sent to the payee, so that the payee performs transaction verification according to the transaction amount and the available amount, and sets the available amount of the received digital currency encryption string after the transaction verification is passed; the available amount of the digital currency encryption string is updated according to the transaction amount and the available amount to complete the offline transaction; by recording the available amount of the digital currency encryption string, and checking the available balance by the payer during the transaction, the available balance of the corresponding encryption string is deducted at the same time of generating the transaction information, so as to prevent exceeding the available balance of the encryption string; the payee mobile terminal verifies whether the transaction amount exceeds the available amount of the original encryption string when receiving the encryption string of the transaction, and rejects the transaction if it exceeds. Thus, the control can be performed from both parties of the offline transaction at the same time to avoid the situation of "double payment", and the transaction security and success rate are ensured. At the same time, the transaction information of the digital currency encryption string is saved by a tree structure, which can facilitate tracing the transaction record of the digital currency encryption string, so as to better avoid the situation of "double payment", reduce the interest loss of the parties involved in the transaction, and greatly improve the transaction security and success rate.
[0040] The further effects of the above-mentioned non-conventional optional mode will be described in the following in combination with the specific embodiments. Attached Figure Description
[0041] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0042] Figure 1 This is a schematic diagram illustrating the main steps of an offline transaction method based on digital currency according to an embodiment of the present invention;
[0043] Figure 2 This is a schematic diagram of a tree structure according to an embodiment of the present invention;
[0044] Figure 3 This is a schematic diagram of the main modules of an offline transaction device based on digital currency according to an embodiment of the present invention;
[0045] Figure 4 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0046] Figure 5 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
[0047] 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.
[0048] To address the technical challenge of preventing double-spending in offline cryptocurrency transactions using encrypted strings, this invention provides a cryptocurrency-based offline transaction method. For each received encrypted string (which can be redeemed from a backend system or received through an offline transaction), the mobile terminal sets an available balance. During offline transactions, the mobile terminal processes the encrypted strings sequentially, checking the available balance before the transaction and deducting the corresponding string's available balance simultaneously with transaction information generation, thus preventing the available balance from being exceeded. The receiving mobile terminal checks whether the transaction amount exceeds the face value of the original encrypted string upon receiving it; if so, the transaction is rejected. This allows for simultaneous control from both parties in the offline transaction, preventing double-spending. Furthermore, storing cryptocurrency encrypted string transaction information using a tree structure facilitates tracing transaction records, further mitigating double-spending, reducing losses for all parties involved, and significantly improving transaction security and success rate.
[0049] Figure 1 is a schematic diagram of main steps of the digital currency-based offline transaction method according to an embodiment of the present application. As shown in the figure, the digital currency-based offline transaction method according to an embodiment of the present application is executed by a payer, and mainly includes the following steps S101 to S104. Figure 1
[0050] Step S101: In response to executing an offline transaction operation, obtaining a transaction amount of the offline transaction and an available amount of a digital currency encryption string.
[0051] Step S102: Generating transaction information corresponding to the digital currency encryption string in a case where the transaction amount does not exceed the available amount, the transaction information including the transaction amount, the digital currency encryption string and the available amount thereof; wherein the transaction information corresponding to the digital currency encryption string is saved through a tree structure, the tree structure including a root node and a branch node, the root node saving the available amount when the digital currency encryption string is generated for the first time, and the branch node saving the available amount after each transaction of the digital currency encryption string.
[0052] Step S103: Sending the transaction information to a payee, so that the payee performs transaction verification according to the transaction amount and the available amount, and sets the available amount of the received digital currency encryption string according to the digital currency encryption string and the transaction amount after the transaction verification is passed.
[0053] Step S104: Updating the available amount of the digital currency encryption string according to the transaction amount and the available amount to complete the offline transaction.
[0054] According to the above steps S101 to S104, the available amount of the digital currency encryption string is recorded, and the available balance is checked by the payer during the transaction, the available balance of the corresponding encryption string is deducted when the transaction information is generated, so as to prevent exceeding the available balance of the encryption string; the payee mobile terminal verifies whether the transaction amount exceeds the available amount of the original encryption string when receiving the transaction encryption string, and rejects the transaction if it exceeds. Thus, the control can be performed from both parties of the offline transaction at the same time to avoid the situation of "double payment", and the transaction safety and success rate are ensured. At the same time, the transaction information of the digital currency encryption string is saved through the tree structure, which can facilitate the tracing of the transaction record of the digital currency encryption string, thereby better avoiding the situation of "double payment", reducing the interest loss of the transaction participants, and greatly improving the transaction safety and success rate.
[0055] According to one embodiment of the present application, when an abnormal situation occurs to cause a transaction failure during an offline transaction, abnormal transaction information is recorded and sent to the background for arbitration to determine the ownership of the transaction amount.
[0056] According to another embodiment of the present application, the transaction information further includes the digital currency encryption string, and the payee performs transaction verification according to the transaction amount and the available amount, which can specifically include: the payee determines whether the transaction amount exceeds the available amount; if the transaction amount does not exceed the available amount, the transaction verification is passed.
[0057] According to still another embodiment of the present application, the payee sets the available amount of the payee digital currency encryption string according to the digital currency encryption string and the transaction amount after the transaction verification is passed. Specifically, it can include: the payee takes the digital currency encryption string as the payee digital currency encryption string and sets the transaction amount as the available amount of the payee digital currency encryption string after the verification is passed.
[0058] According to still another embodiment of the present application, the available amount of the digital currency encryption string is updated according to the transaction amount and the available amount, specifically according to the difference between the available amount and the transaction amount.
[0059] According to still another embodiment of the present application, when the digital currency encryption string performs a transaction each time, a child node is generated as a branch node with the node corresponding to the digital currency encryption string in the payer as a parent node, for saving the transaction information of this transaction.
[0060] The implementation process of the offline transaction method based on digital currency of the present application will be introduced below in combination with a specific embodiment.
[0061] 1. When a user requests to perform digital currency exchange in a mobile terminal A, the background system generates a unique digital currency encryption string, which represents a trusted value certificate, and the original value is Y r , which is issued to the mobile terminal A of the user for saving, hereinafter referred to as root node A, and the amount of the root node A is recorded as Y r , and the available amount is Y a1 , at this time Y a1 =Y r . As shown in Table 1 below:
[0062] Table 1
[0063] Root node amount Available amount Y r ]]> <![CDATA[Y a1 ]]>
[0064] 2、In the scenario of offline transaction between the payer mobile terminal A and the payee mobile terminal B, the payer mobile terminal A judges whether the transaction amount T a1 of this time is greater than the available amount Y a1 of the encryption string, if greater, the transaction is rejected, otherwise, the transaction is continued, a child node, transaction node A1, is generated with the root node as the parent node, and the transaction information of this offline transaction is saved in the transaction node A1, for example, the transaction amount T a1 , the available amount Y a1 of the encryption string, etc., and is passed to the payee mobile terminal B;
[0065] 3、The mobile terminal A updates the available amount of the root node as Y a2 , at this time, Y a2 =Y a1 -T a1 . As shown in Table 2:
[0066] Table 2
[0067] Root node amount Available amount Y r ]]> Y a2 ]]>
[0068] 4、The payee mobile terminal B compares whether the transaction amount T a1 in the transaction information corresponding to the transaction node A1 is greater than the available amount Y a1 =Y r of its root node, if greater, the transaction is rejected, otherwise, the transaction is performed, the transaction node A1 is saved as a branch node, and the available amount Y b1 of the branch node A1 is equal to the transaction amount T a1 of this time. As shown in Table 3:
[0069] Table 3
[0070] Branch A1 amount Available amount [CAT a1 ]]> Y b1 ]]>
[0071] 5、When the payee mobile terminal B in the last offline transaction uses the branch node A1 to perform offline transaction with the payee mobile terminal C, it first judges whether the transaction amount T b1 of this time is greater than the available amount Y b1 of the branch node A1, if greater, the transaction is rejected, otherwise, the transaction is continued, a child node, transaction node B1, is generated with the branch node A1 as the parent node, and the transaction information of this offline transaction is saved in the transaction node B1, for example, the transaction amount T b1 , the available amount Y b1 of the branch node A1, etc., and is passed to the payee mobile terminal C;
[0072] 6、The mobile terminal B updates the available amount of the branch node A1 as Y b2 , at this time, Yb2 = Y b1 -T b1 As shown in Table 4 below:
[0073] Table 4
[0074] Branch A1 amount Available amount [TECHNICAL FIELD] a1 ]] Y b2 ]]>
[0075] 7. After receiving the transaction node B1, the payee mobile terminal C compares the transaction amount T in the transaction information corresponding to the transaction node B1 with the available amount T of the parent node, i.e., the branch node A1. If the transaction amount T is greater than the available amount T of the branch node A1, the transaction is rejected. Otherwise, the transaction is saved as a branch node, and the available amount Y of the branch node B1 is equal to the transaction amount T. As shown in Table 5 below: b1 a1 c1 b1 As shown in Table 5 below:
[0076] Table 5
[0077] Branch B1 amount Available amount [TECHNICAL FIELD] b1 ]]
[0001] Y c1 ]]
[0078] In the embodiment of the present application, when an abnormal situation occurs and the transaction fails, the original payer does not increase the available amount, but records the abnormal transaction information, and the subsequent arbitration by the background server determines the ownership of the fund, thereby strengthening the control of avoiding double payment.
[0079] Taking the mobile terminal A as an example, in the offline transaction scenario, the payer mobile terminal A is the root node A, and the amount of the root node A is Y. It is determined whether the transaction amount T is greater than the available amount Y. If yes, the transaction is rejected. Otherwise, the transaction is continued, a transaction node A is generated, and is transmitted to the payee mobile terminal X. Then, the payer mobile terminal A updates the available amount of the root node, and Y is equal to Y-T. As shown in Table 6 below: r a(n-1) am n-1 an am -T a(n-1) As shown in Table 6 below:
[0080] Table 6
[0081] Root node amount Available amount Y r ]]> Y an ]]>
[0082] When an abnormal situation occurs and the transaction fails, the payee may or may not receive the transaction amount. At this time, the payer mobile terminal does not receive a response, does not back up the transaction amount deducted in the previous step, but records the abnormal node, so as to perform arbitration by the background server subsequently. The recorded abnormal transaction information is shown in Table 7 below:
[0083] Table 7
[0084] Root node amount transaction node A n-1 amount Y r ]]> [TECHNICAL FIELD] a(n-1) ]]
[0085] Based on the above flow and transaction model, increasing the check and deduction of the available amount by the payer and the verification of the transaction amount by the payee can form a tree structure, supplemented by secure encryption means to ensure the authenticity and effectiveness of the transaction node in the delivery, thereby controlling the "double payment" situation in the offline transaction of the encryption string. Figure 2 is a schematic diagram of a tree structure of an embodiment of the present application. In Figure 2 , Y an = Yr-T a1 -T a2 -…-T am -T a(n-1) ; Y b3 = T a1 -T b1 -T b2 ; Y c1 = T b1 ; Y d1 = T a2 ; Y m1 = T am ; Y x1 = T b2 .
[0086] As can be seen from Figure 2 , based on the tree structure, the transaction information of each transaction of the digital currency encryption string can be recorded, and the transaction information includes the encryption string information, the transaction amount of each transaction (such as the upper part of the horizontal line of each node) and the available amount of the encryption string at each transaction (such as the lower part of the horizontal line of each node). Each branch node is generated according to the node corresponding to the digital currency encryption string in the payer as the parent node, and saves the transaction information of this transaction. The tree structure can be located at the issuing agency end or the management agency end of the digital currency encryption string, or a third-party platform independent of the payee and the payer and called by any transaction service end, etc. Each time the digital currency encryption string is transacted, the transaction information of the transaction parties will be uploaded, and the tree structure is updated according to the transaction information.
[0087] Figure 3 is a schematic diagram of the main modules of the digital currency-based offline transaction device according to an embodiment of the present application. As Figure 3 shown, the digital currency-based offline transaction device 300 of the embodiment of the present application mainly includes a transaction data acquisition module 301, a transaction information generation module 302, a transaction information sending module 303 and an available amount updating module 304.
[0088] The transaction data acquisition module 301 is configured to acquire a transaction amount of an offline transaction and an available amount of a digital currency encryption string in response to performing an offline transaction operation.
[0089] The transaction information generation module 302 is configured to generate transaction information corresponding to the digital currency encryption string in a case where the transaction amount does not exceed the available amount, the transaction information including the transaction amount, the digital currency encryption string and the available amount thereof.
[0090] The transaction information sending module 303 is configured to send the transaction information to a payee, so that the payee performs transaction verification according to the transaction amount and the available amount, and sets the available amount of a digital currency encryption string received by the payee according to the digital currency encryption string and the transaction amount after the transaction verification passes.
[0091] The available amount updating module 304 is configured to update the available amount of the digital currency encryption string according to the transaction amount and the available amount to complete the offline transaction.
[0092] According to an embodiment of the present application, the offline transaction device based on digital currency further comprises an abnormal situation processing module (not shown in the figure), which is configured to:
[0093] When an abnormal situation occurs and causes a transaction failure, record abnormal transaction information and send the abnormal transaction information to a background for arbitration to determine the ownership of the transaction amount.
[0094] According to another embodiment of the present application, the transaction verification performed by the payee according to the transaction amount and the available amount comprises:
[0095] The payee determines whether the transaction amount exceeds the available amount.
[0096] If the transaction amount does not exceed the available amount, the transaction verification passes.
[0097] According to another embodiment of the present application, the transaction information further comprises the digital currency encryption string, and the payee sets the available amount of the payee digital currency encryption string according to the digital currency encryption string and the transaction amount after the transaction verification passes. Specifically, the payee can set the digital currency encryption string as the payee digital currency encryption string and set the transaction amount as the available amount of the payee digital currency encryption string after the verification passes.
[0098] According to another embodiment of the present application, the available amount updating module 304 can be further configured to:
[0099] update the available amount of the digital currency encryption string according to the difference between the available amount and the transaction amount.
[0100] According to another embodiment of the present application, each time the digital currency encryption string performs a transaction, a child node is generated as a branch node with the node corresponding to the digital currency encryption string in the payer as the parent node, for saving the transaction information of this transaction.
[0101] According to the technical solution of the embodiments of the present application, the transaction amount and the available amount of the digital currency encryption string are obtained in response to performing an offline transaction; the transaction information is generated when the transaction amount does not exceed the available amount, and the transaction information corresponding to the digital currency encryption string is saved in a tree structure; the transaction information is sent to the payee, so that the payee performs transaction verification according to the transaction amount and the available amount, and sets the available amount of the received digital currency encryption string after the transaction verification passes; and the available amount of the digital currency encryption string is updated according to the transaction amount and the available amount to complete the offline transaction. The technical solution records the available amount of the digital currency encryption string, checks the available balance during the transaction, deducts the available balance of the corresponding encryption string when the transaction information is generated, thereby preventing the available balance of the encryption string from being exceeded; and the payee mobile terminal verifies whether the transaction amount exceeds the available amount of the original encryption string when receiving the encryption string of the transaction, and rejects the transaction if the transaction amount exceeds the available amount. Therefore, the offline transaction can be controlled from both parties at the same time to avoid the situation of "double payment", and the transaction security and success rate are guaranteed. Meanwhile, the transaction information of the digital currency encryption string is saved in a tree structure, which can facilitate the tracing of the transaction record of the digital currency encryption string, thereby better avoiding the situation of "double payment", reducing the interest loss of the parties involved in the transaction, and greatly improving the transaction security and success rate.
[0102] Figure 4An exemplary system architecture 400 of a digital currency-based offline transaction method or a digital currency-based offline transaction apparatus to which embodiments of the present application can be applied is shown.
[0103] As shown in Figure 4 The system architecture 400 can include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 is a medium for providing a communication link between the terminal devices 401, 402, 403 and the server 405. The network 404 can include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0104] A user can use the terminal devices 401, 402, 403 to interact with the server 405 through the network 404 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 401, 402, 403, such as bank applications, digital currency applications, digital currency wallet applications, etc. (only as examples).
[0105] The terminal devices 401, 402, 403 can be various electronic devices with display screens and support for web browsing, including but not limited to smartphones, tablet computers, laptop computers, desktop computers, etc.
[0106] The server 405 can be a server that provides various services, such as a background management server that supports offline transaction requests sent by users using the terminal devices 401, 402, 403 (only as an example). The background management server can obtain the transaction amount of the offline transaction, the available amount of the digital currency encryption string from the data received, such as offline transaction operation requests; generate transaction information corresponding to the digital currency encryption string in the case where the transaction amount does not exceed the available amount, the transaction information including the transaction amount, the digital currency encryption string and its available amount; wherein the transaction information corresponding to the digital currency encryption string is saved through a tree structure, the tree structure including a root node and a branch node, the root node saving the available amount when the digital currency encryption string is first generated, and the branch node saving the available amount after each transaction of the digital currency encryption string; send the transaction information to the payee to make the payee perform transaction verification according to the transaction amount and the available amount, and set the available amount of the received digital currency encryption string according to the digital currency encryption string and the transaction amount after the transaction verification passes; update the available amount of the digital currency encryption string according to the transaction amount and the available amount, etc., and feed back the processing result (such as offline transaction processing result - only as an example) to the terminal device.
[0107] It should be noted that the off-line transaction method based on digital currency provided by the embodiment of the present application is generally executed by the server 405, and accordingly, the off-line transaction device based on digital currency is generally arranged in the server 405.
[0108] It should be understood that Figure 4 The number of terminal devices, networks and servers in the above-mentioned system is merely illustrative. Any number of terminal devices, networks and servers can be provided according to the implementation needs.
[0109] Reference is made below to Figure 5 which shows a structural schematic diagram of a computer system 500 suitable for implementing a terminal device or a server of the embodiment of the present application. Figure 5 The terminal device or server shown is merely an example and should not bring any limitation to the function and use range of the embodiment of the present application.
[0110] As shown in Figure 5 , the computer system 500 includes a central processing unit (CPU) 501 which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 502 or programs loaded from a storage portion 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the system 500 are also stored in the RAM 503. The CPU 501, the ROM 502 and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0111] The following components are connected to the I / O interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable recording medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 510 as needed, so that a computer program read therefrom is installed in the storage portion 508 as needed.
[0112] In particular, the processes described above with reference to the flow charts can be implemented as a computer software program in accordance with the embodiments disclosed herein. For example, embodiments disclosed herein include a computer program product which includes a computer program tangibly embodied on a computer readable medium, the computer program containing program code for executing the methods illustrated by the flow charts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 509 and / or installed from the removable media 511. When the computer program is executed by the central processing unit (CPU) 501, the above-described functions defined in the system of the present application are executed.
[0113] It should be noted that the computer readable medium shown in the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the 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, device or apparatus. In the present application, the computer readable signal medium can include a data signal carried in a baseband or as a carrier wave in a propagated data signal, in which the computer readable program code is carried. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium that can send, propagate or transfer a program for use by or in connection with an instruction execution system, device or apparatus. The program code contained on the computer readable medium can be transmitted using any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0114] The computer program product of the present application can be a computer program embodied on a non-transitory computer readable medium. When the program is executed by a computer, it can achieve the objectives of the present application. The non-transitory computer readable medium can be a disk, CD, ROM, or the like. The computer program can be downloaded from the network and stored on the above-mentioned non-transitory computer readable medium, or stored on the above-mentioned non-transitory computer readable medium in advance.
[0115] The units or modules described in the embodiments of the present application can be implemented by software or hardware. The described units or modules can also be arranged in a processor, for example, a processor can be described as: a processor includes a transaction data acquisition module, a transaction information generation module, a transaction information sending module, and an available amount updating module. Among them, the name of these units or modules does not constitute a limitation to the units or modules themselves in some cases, for example, the transaction data acquisition module can also be described as: "a module for acquiring the transaction amount, the available amount of the digital currency encryption string of the offline transaction in response to the execution of the offline transaction operation".
[0116] As another aspect, the application also provides a computer readable medium, which can be included in the device described in the above embodiments, or can exist independently without being assembled into the device. The computer readable medium carries one or more programs, which, when executed by the device, cause the device to include: in response to performing an offline transaction operation, obtaining a transaction amount of the offline transaction and an available amount of a digital currency encryption string; in the case that the transaction amount does not exceed the available amount, generating transaction information corresponding to the digital currency encryption string, the transaction information including the transaction amount, the digital currency encryption string and the available amount thereof; wherein the transaction information corresponding to the digital currency encryption string is saved through a tree structure, the tree structure including a root node and a branch node, the root node saving the available amount when the digital currency encryption string is generated for the first time, and the branch node saving the available amount after each transaction of the digital currency encryption string; sending the transaction information to a payee to enable the payee to perform transaction verification according to the transaction amount and the available amount, and to set the available amount of the received digital currency encryption string according to the digital currency encryption string and the transaction amount after the transaction verification passes; and updating the available amount of the digital currency encryption string according to the transaction amount and the available amount to complete the offline transaction.
[0117] According to the technical scheme of the embodiment of the application, by responding to performing an offline transaction operation, obtaining a transaction amount of the offline transaction and an available amount of a digital currency encryption string; in the case that the transaction amount does not exceed the available amount, generating transaction information, the transaction information corresponding to the digital currency encryption string is saved through a tree structure; sending the transaction information to a payee to enable the payee to perform transaction verification according to the transaction amount and the available amount, and to set the available amount of the received digital currency encryption string after the transaction verification passes; and updating the available amount of the digital currency encryption string according to the transaction amount and the available amount to complete the offline transaction, the technical scheme records the available amount of the digital currency encryption string, and the payer checks the available balance during the transaction, deducts the available balance of the corresponding encryption string when generating the transaction information, thereby preventing exceeding the available balance of the encryption string; the payee mobile terminal verifies whether the transaction amount exceeds the available amount of the original encryption string when receiving the encryption string of the transaction, and rejects the transaction if it exceeds. Thus, both parties of the offline transaction can be controlled at the same time to avoid the situation of "double payment", and the transaction security and success rate are guaranteed. Meanwhile, the transaction information of the digital currency encryption string is saved through a tree structure, which can facilitate tracing the transaction record of the digital currency encryption string, thereby better avoiding the situation of "double payment", reducing the interest loss of the parties involved in the transaction, and greatly improving the transaction security and success rate.
[0118] The foregoing detailed description has set forth various embodiments of the devices and / or processes via the use of specific terminology. However, embodiments thereof can be practiced with the exact description not being set forth but with the same essence; the principles set forth herein can be practiced with plasticity in a manner leading to structurally equivalent devices and / or processes. Therefore, this description is not to be construed as limiting; the scope of the claims will be construed in the broadest context allowed by law.
Claims
1. An offline transaction method based on digital currency, characterized in that, The method is performed by the payer, and the method includes: In response to an offline transaction, obtain the transaction amount and the available amount of the encrypted digital currency string. If the transaction amount does not exceed the available amount, transaction information corresponding to the encrypted digital currency string is generated. The transaction information includes the transaction amount, the encrypted digital currency string, and its available amount. The transaction information corresponding to the encrypted digital currency string is stored in a tree structure, which includes a root node and branch nodes. The branch nodes are child nodes generated based on the node corresponding to the encrypted digital currency string in the payer's field at the time of the transaction, with the root node storing the available amount when the encrypted digital currency string is first generated. The branch nodes store the available amount after each transaction of the encrypted digital currency string and the transaction amount of each transaction of the encrypted digital currency string. The transaction information is sent to the payee so that the payee can verify the transaction based on the transaction amount and the available amount, and after the transaction verification is successful, set the available amount of the received encrypted digital currency string based on the encrypted digital currency string and the transaction amount; The available amount of the cryptocurrency encrypted string is updated based on the transaction amount and the available amount to complete the offline transaction.
2. The method according to claim 1, characterized in that, The method further includes: When an abnormal situation causes a transaction to fail, the abnormal transaction information is recorded and sent to the backend for arbitration to determine the owner of the transaction amount.
3. The method according to claim 1, characterized in that, The transaction verification performed by the payee based on the transaction amount and the available funds includes: The recipient determines whether the transaction amount exceeds the available amount; If the transaction amount does not exceed the available amount, the transaction verification is successful.
4. The method according to claim 1, characterized in that, Updating the available amount of the cryptocurrency encrypted string based on the transaction amount and the available amount includes: The available amount of the cryptocurrency encrypted string is updated based on the difference between the available amount and the transaction amount.
5. An offline transaction device based on digital currency, characterized in that, The device is executed by the payer, and the device includes: The transaction data acquisition module is used to obtain the transaction amount and the available amount of the encrypted digital currency string in response to the execution of offline transaction operations. A transaction information generation module is used to generate transaction information corresponding to the encrypted digital currency string when the transaction amount does not exceed the available amount. The transaction information includes the transaction amount, the encrypted digital currency string, and its available amount. The transaction information corresponding to the encrypted digital currency string is stored in a tree structure, which includes a root node and branch nodes. The branch nodes are child nodes generated based on the node corresponding to the encrypted digital currency string in the payer's field during the transaction, with the root node storing the available amount when the encrypted digital currency string is first generated. The branch nodes store the available amount after each transaction of the encrypted digital currency string and the transaction amount of each transaction of the encrypted digital currency string. The transaction information sending module is used to send the transaction information to the payee so that the payee can perform transaction verification based on the transaction amount and the available amount, and after the transaction verification is passed, set the available amount of the received digital currency encrypted string based on the digital currency encrypted string and the transaction amount; The available amount update module is used to update the available amount of the digital currency encrypted string according to the transaction amount and the available amount to complete the offline transaction.
6. The apparatus according to claim 5, characterized in that, The device also includes an abnormal situation handling module, used for: When an abnormal situation causes a transaction to fail, the abnormal transaction information is recorded and sent to the backend for arbitration to determine the owner of the transaction amount.
7. The apparatus according to claim 5, characterized in that, The transaction verification performed by the payee based on the transaction amount and the available funds includes: The recipient determines whether the transaction amount exceeds the available amount; If the transaction amount does not exceed the available amount, the transaction verification is successful.
8. The apparatus according to claim 5, characterized in that, The available amount update module is also used for: The available amount of the cryptocurrency encrypted string is updated based on the difference between the available amount and the transaction amount.
9. An offline transaction electronic device based on digital currency, characterized in that, include: One or more processors; 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 as described in any one of claims 1-4.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-4.
Citation Information
Patent Citations
Amount tree construction method and device and amount occupation path checking method and device
CN107679983A
Digital currency double offline payment realization method, device and apparatus and storage medium
CN111144862A
Secure offline transaction system using digital tokens and a secure ledger database
US20190095907A1