CN111507839B - Block chain-based data processing method, device, storage medium and equipment - Google Patents
Block chain-based data processing method, device, storage medium and equipment Download PDFInfo
- Publication number
- CN111507839B CN111507839B CN202010294769.4A CN202010294769A CN111507839B CN 111507839 B CN111507839 B CN 111507839B CN 202010294769 A CN202010294769 A CN 202010294769A CN 111507839 B CN111507839 B CN 111507839B
- Authority
- CN
- China
- Prior art keywords
- terminal
- electronic resource
- asset
- target
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3821—Electronic credentials
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3829—Payment protocols; Details thereof insuring higher security of transaction involving key management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/40—Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
- G06Q20/401—Transaction verification
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Physics & Mathematics (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Technology Law (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The embodiment of the application discloses a method, a device, a storage medium and equipment for processing data based on a blockchain, wherein the method comprises the following steps: the first terminal generates transaction data according to the business transaction executed between the first terminal and the second terminal, the first terminal and the second terminal are both in an offline state, and a target digital credential asset corresponding to the electronic resource with the first value is acquired; transmitting the target digital voucher asset and the transaction data to the second terminal in an off-line manner, so that when the second terminal is restored to be on-line, the transaction data and the target digital voucher asset are transmitted to node equipment of the blockchain network; the transaction data and the target digital voucher asset are used for indicating the node equipment to transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal; and when the first terminal is restored to the online state, acquiring the target digital credential asset returned by the node equipment. The application can improve the success rate of electronic resource transfer.
Description
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a blockchain-based data processing method, device, storage medium, and apparatus.
Background
With the development of computer networks, more and more users choose to use the internet for electronic resource transfer (which may be referred to as online electronic resource transfer). The online electronic resource transfer mode is generally provided by a transfer type application installed in terminal devices of both transaction parties, and specifically, the online electronic resource transfer mode is realized by transferring electronic resources of both transaction parties in the transfer type application respectively.
Currently, when the user a performs an electronic resource transfer service to the user B, the user a may transfer a corresponding amount of electronic resources to the terminal device of the user B through the held terminal device in an internet manner, so as to complete the electronic resource transfer service with the user B. However, in the process of transferring electronic resources, if the network quality is poor, the electronic resource transfer is failed. Therefore, the current electronic resource transfer method is difficult to ensure the transfer success rate of the electronic resource.
Disclosure of Invention
The technical problem to be solved by the embodiment of the application is to provide a data processing method, a device, a storage medium and equipment based on a block chain, which can improve the success rate of electronic resource transfer.
An aspect of an embodiment of the present application provides a data processing method based on a blockchain, including:
The method comprises the steps that a first terminal generates transaction data according to business transaction executed between the first terminal and a second terminal, wherein the first terminal and the second terminal are both in an offline state, and the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal;
Acquiring a target digital voucher asset corresponding to the electronic resource of the first value;
transmitting the target digital voucher asset and the transaction data offline to the second terminal, so that the transaction data and the target digital voucher asset are transmitted to node equipment of a blockchain network when the second terminal is restored to be on-line; the transaction data and the target digital voucher asset are used for instructing the node device to transfer the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal;
and when the first terminal is restored to the online state, acquiring the target digital credential asset returned by the node equipment.
An aspect of an embodiment of the present application provides a data processing method based on a blockchain, including:
When the second terminal is restored to the on-line state, transaction data and a target digital voucher asset are acquired from the second terminal; the transaction data are generated according to business transactions executed by the first terminal and the second terminal when the first terminal and the second terminal are both in an offline state; the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal, and the target digital voucher asset corresponds to the electronic resource of the first value;
transferring the first value of the electronic resource from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital voucher asset;
And returning the target digital certificate asset to the first terminal.
An aspect of an embodiment of the present application provides a data processing apparatus based on a blockchain, including:
the generation module is used for generating transaction data according to the business transaction executed between the first terminal and the second terminal, wherein the first terminal and the second terminal are both in an offline state, and the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal;
The acquisition module is used for acquiring a target digital credential asset corresponding to the electronic resource with the first value;
The transmission module is used for transmitting the target digital voucher asset and the transaction data to the second terminal in an off-line mode, so that the transaction data and the target digital voucher asset are sent to node equipment of a blockchain network when the second terminal is restored to be on-line; the transaction data and the target digital voucher asset are used for instructing the node device to transfer the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal;
And the acquisition module is further used for acquiring the target digital credential asset returned by the node equipment when the first terminal is restored to the online state.
Optionally, the generating module is configured to obtain a service transaction executed between the generating module and the second terminal, where the service transaction includes a first value of an electronic resource to be transferred from the first terminal to the second terminal; generating a key pair of the first terminal, wherein the key pair of the first terminal comprises a public key and a private key; signing the business transaction by adopting the private key of the first terminal to obtain the business transaction carrying the signature of the first terminal; and determining the business transaction carrying the signature of the first terminal as the transaction data, wherein the signature of the first terminal is used for indicating the node equipment to verify the transaction data, and the verified transaction data and the target digital certificate asset are used for indicating the node equipment to transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal.
An aspect of an embodiment of the present application provides a data processing apparatus based on a blockchain, including:
the acquisition module is used for acquiring transaction data and target digital credential assets from the second terminal when the second terminal is restored to the on-line state; the transaction data are generated according to business transactions executed by the first terminal and the second terminal when the first terminal and the second terminal are both in an offline state; the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal, and the target digital voucher asset corresponds to the electronic resource of the first value;
A transfer module for transferring the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital voucher asset;
and the return module is used for returning the target digital certificate asset to the first terminal.
Optionally, the transaction data carries a signature of the first terminal;
the acquisition module is further configured to acquire a public key of the first terminal;
optionally, the apparatus further includes:
the signature verification module is used for verifying the signature of the first terminal by adopting the public key of the first terminal; and if the signature of the first terminal passes the verification, executing the step of transferring the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital certificate asset.
Optionally, the transferring module is configured to defrost the electronic resource in the frozen state in the account address of the first terminal to obtain a target electronic resource, where the target electronic resource has an association relationship with the target digital credential asset; and transferring the electronic resource with the first value from the target electronic resource to the account address of the second terminal.
Optionally, the transferring module is configured to obtain an electronic resource associated with the freeze indication information in the account address of the first terminal, as the electronic resource in the frozen state; the freeze indication information carries the signature of node equipment in the blockchain network; the freeze indication information is used for indicating that the electronic resource in the frozen state is refused to be transferred when the digital credential asset sent by the first terminal is not received and the signature of the node equipment is not checked and signed; acquiring a public key of the node equipment, and checking a signature of the node equipment by adopting the public key of the node equipment; if the signature of the node equipment passes the signature verification, the defrosting instruction information is recorded in the block chain network, the electronic resource in the frozen state is determined to be successfully defrosted, and the electronic resource which is successfully defrosted is determined to be the target electronic resource; the defrosting instruction information is used for instructing the node device to have a transfer authority to the target electronic resource.
Optionally, the acquiring module is further configured to acquire attribute information of the first terminal;
Optionally, the apparatus further includes: the freezing module is used for freezing the target electronic resource in the account address of the first terminal according to the attribute information of the first terminal; generating at least two parts of digital voucher assets according to the target electronic resource, wherein the at least two parts of digital voucher assets comprise the target digital voucher asset; and sending the at least two digital assets to the first terminal so that the first terminal stores the at least two digital assets.
Optionally, the freezing module is specifically configured to determine, as the second value, an upper limit value for freezing the electronic resource belonging to the first terminal according to attribute information of the first terminal, where the attribute information of the first terminal includes a credit level of a terminal user corresponding to the first terminal or a transaction type of a historical service transaction executed by the first terminal; and determining the electronic resource with the second value in the account address of the first terminal as a target electronic resource, and freezing the target electronic resource.
Optionally, the freezing module is specifically configured to generate the freezing indication information, and establish an association relationship between the freezing indication information and the target electronic resource; acquiring a private key of the node equipment, and signing the freeze indication information by adopting the private key of the node equipment to obtain the freeze indication information carrying the signature of the node equipment; and uploading the freezing indication information carrying the signature of the node equipment to the blockchain network according to the association relation.
The return module is specifically configured to freeze an electronic resource corresponding to the target digital voucher asset in the account address of the first terminal, and return the target digital voucher asset to the first terminal; or alternatively
Setting the state of the target digital voucher asset to be invalid, and returning the target digital voucher asset with the invalid state to the first terminal.
Optionally, the device may further comprise
A pre-transferring module, configured to pre-transfer, from the account address of the node device, the electronic resource of the first value to the account address of the second terminal if the value of the electronic resource in the account address of the first terminal is smaller than the first value; generating pre-transfer information, and recording the pre-transfer information into the blockchain network, wherein the pre-transfer information is used for indicating the first terminal to transfer the electronic resource with the first value to the node equipment.
In one aspect, the application provides a computer device comprising: a processor, a memory, a network interface;
the processor is connected with a memory and a network interface, wherein the network interface is used for providing a data communication function, the memory is used for storing a computer program, and the processor is used for calling the computer program to execute the following steps:
generating transaction data according to the business transaction executed between the first terminal and the second terminal, wherein the first terminal and the second terminal are both in an offline state, and the transaction data comprises a first numerical value of an electronic resource to be transferred from the first terminal to the second terminal;
Acquiring a target digital voucher asset corresponding to the electronic resource of the first value;
transmitting the target digital voucher asset and the transaction data offline to the second terminal, so that the transaction data and the target digital voucher asset are transmitted to node equipment of a blockchain network when the second terminal is restored to be on-line; the transaction data and the target digital voucher asset are used for instructing the node device to transfer the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal;
and when the first terminal is restored to the online state, acquiring the target digital credential asset returned by the node equipment.
Optionally, the memory is configured to store a computer program, and the processor is configured to call the computer program to perform the following steps:
When the second terminal is restored to the on-line state, transaction data and a target digital voucher asset are acquired from the second terminal; the transaction data are generated according to business transactions executed by the first terminal and the second terminal when the first terminal and the second terminal are both in an offline state; the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal, and the target digital voucher asset corresponds to the electronic resource of the first value;
transferring the first value of the electronic resource from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital voucher asset;
And returning the target digital certificate asset to the first terminal.
An aspect of an embodiment of the present application provides a computer-readable storage medium storing a computer program comprising program instructions which, when executed by a processor, perform the steps of:
generating transaction data according to the business transaction executed between the first terminal and the second terminal, wherein the first terminal and the second terminal are both in an offline state, and the transaction data comprises a first numerical value of an electronic resource to be transferred from the first terminal to the second terminal;
Acquiring a target digital voucher asset corresponding to the electronic resource of the first value;
transmitting the target digital voucher asset and the transaction data offline to the second terminal, so that the transaction data and the target digital voucher asset are transmitted to node equipment of a blockchain network when the second terminal is restored to be on-line; the transaction data and the target digital voucher asset are used for instructing the node device to transfer the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal;
and when the first terminal is restored to the online state, acquiring the target digital credential asset returned by the node equipment.
Optionally, the program instructions, when executed by the processor, perform the steps of:
When the second terminal is restored to the on-line state, transaction data and a target digital voucher asset are acquired from the second terminal; the transaction data are generated according to business transactions executed by the first terminal and the second terminal when the first terminal and the second terminal are both in an offline state; the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal, and the target digital voucher asset corresponds to the electronic resource of the first value;
transferring the first value of the electronic resource from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital voucher asset;
And returning the target digital certificate asset to the first terminal.
In the application, when the first terminal and the second terminal are both in an offline state, the first terminal can generate transaction data according to the business transaction executed between the first terminal and the second terminal, the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal, and a target digital credential asset corresponding to the electronic resource of the first value is acquired. The first terminal transmits the target digital certificate asset and the transaction data to the second terminal in an offline manner; when the second terminal resumes the online state, node devices in the blockchain network may obtain the target digital asset credential and transaction data from the second terminal. The node device can transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal according to the target digital asset certificate and the transaction data; the target digital asset credential is returned to the first terminal. When the first terminal and the second terminal are in an offline state, the first terminal sends the target digital certificate asset and transaction data to the second terminal in an offline transmission mode, and after the second terminal is in an online state, the second terminal can finish the transfer of electronic resources through node equipment in the blockchain network; the problem of electronic resource transfer failure caused by poor network quality can be effectively avoided, and the transfer success rate of the electronic resource can be improved. In addition, the electronic resource transfer is realized through the node equipment of the blockchain network, the participation of a third party mechanism is not needed, and the safety and the transparency of the electronic resource transfer can be improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a block diagram of a data processing system according to an embodiment of the present application;
FIG. 2a is a schematic diagram of an application scenario of a data processing method based on a blockchain according to an embodiment of the present application;
FIG. 2b is a schematic diagram of an application scenario of a data processing method based on a blockchain according to an embodiment of the present application;
FIG. 2c is a schematic diagram of an application scenario of a data processing method based on a blockchain according to an embodiment of the present application;
FIG. 3 is a flowchart of a block chain based data processing method according to an embodiment of the present application;
FIG. 4 is a schematic illustration of an application scenario for generating digital voucher assets according to an embodiment of the present application;
fig. 5 is a schematic diagram of an application scenario for freezing a target electronic resource according to an embodiment of the present application;
Fig. 6 is a schematic diagram of an application scenario for thawing a target electronic resource according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a block chain based data processing apparatus according to an embodiment of the present application;
FIG. 8 is a block chain based data processing apparatus according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a computer device according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
(1) The electronic resource means: resources existing in account addresses, relying on electronic commerce and capable of circulation over the internet, or on-chain transactions for purchasing digital assets, which may include at least French coins, such as game coins, and the like; the legal banknote is a banknote that is given a forced circulation by law. An on-chain transaction refers to a transaction of a digital asset in a blockchain network, where the digital asset may include, but is not limited to: electronic tickets, game resources (e.g., game themes, game gear, etc.), and the like. The account addresses herein may include, but are not limited to: electronic bank cards, internet banking, internet payment accounts, and the like.
(2) Asymmetric encryption: is a secret method of the secret key. The algorithm requires two keys: public keys (publickey, public keys for short) and private keys (private keys for short). The public key and the private key are a pair of keys, and if the data is encrypted by the public key, the data can be decrypted only by the corresponding private key. Because two different keys are used for encryption and decryption, this algorithm is called an asymmetric encryption algorithm.
(3) Digital signature: is a common physical signature similar to writing on paper, and is a method for authenticating digital information using a technique in the field of asymmetric encryption. A set of digital signatures typically defines two complementary operations, one for signing and the other for verification. A digital signature is a digital string that cannot be forged by others only by the sender of the information, and is also a valid indicator of the authenticity of the information sent by the sender of the information.
(4) Blockchain: the method is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission (P2P transmission), consensus mechanism, encryption algorithm and the like, and is essentially a decentralised and highly transparent database; the blockchain may be composed of a plurality of serial transaction records (also known as blocks) that are cryptographically concatenated and protected from content, and the distributed ledgers concatenated by the blockchain enable multiple parties to effectively record transactions and permanently verify the transactions (non-tamperable). The consensus mechanism is a mathematical algorithm for realizing trust establishment and rights acquisition among different nodes in the blockchain network; that is, the consensus mechanism is a mathematical algorithm commonly recognized by the network nodes of the blockchain.
(5) Digital voucher asset: and the digital asset can be used for carrying a signature, and the signature carried by the digital asset is used for indicating that the electronic account of the user has the electronic resource corresponding to the digital asset.
Based on the problem that the success rate of the current electronic resource transfer mode is lower, the embodiment of the application provides a data processing method based on a blockchain, in the method, when both transaction parties are in an offline state due to poor network quality and the like, a terminal held by a buyer transmits a target digital credential asset corresponding to an electronic resource to be transferred and transaction data to the terminal held by the seller through offline transmission; when the terminal held by the seller is restored to the on state, the terminal can be sent to node equipment in the blockchain network according to the target digital certificate asset and transaction data; a node device in the blockchain network may transfer the electronic resource to be transferred from the account address of the buyer to the account address of the seller based on the target digital credential asset and the transaction data. The electronic resource transfer can be realized, the problem of electronic resource transfer failure caused by poor network quality can be avoided, and the transfer success rate of the electronic resource can be improved. First, a data processing system according to an embodiment of the present application is described, and as shown in fig. 1, the data processing system may include a blockchain network 10 and at least two terminals, and in fig. 1, the data processing system includes two terminals, for example, a first terminal 20 and a second terminal 21.
The blockchain network is an end-to-end decentralization network composed of a plurality of node devices, and in fig. 1, the blockchain network includes a plurality of node devices 101. Each node device may receive transaction data while operating normally and maintain blockchains based on the received transaction data. In order to ensure the information intercommunication in the blockchain network, communication connection can exist between every node equipment in the blockchain network, and data transmission can be carried out between the node equipment through the communication connection. For example, when any node device in the blockchain network receives transaction data, other node devices in the blockchain network acquire the transaction data according to a consensus algorithm, and store the transaction data as data in the blockchain, so that the data stored on all the node devices in the blockchain network are consistent.
Each node device in the blockchain network has a node identifier corresponding to the node device, and each node device in the blockchain network can store the node identifiers of other node devices in the blockchain network, so that the generated blocks can be broadcasted to other node devices in the blockchain network according to the node identifiers of the other node devices. Each node device may maintain a node identifier list as shown in the following table, and store the node device name and the node identifier in the node identifier list correspondingly. The node identifier may be an IP (Internet Protocol, protocol of interconnection between networks) address and any other information that can be used to identify the node device, and the IP address is only illustrated in table 1.
Table 1:
In the present application, the node device may refer to a background service device for performing operations related to electronic resources, such as performing operations of electronic resource transfer, freezing electronic resources, thawing electronic resources, user authentication, and so on; specifically, the node device may refer to a background service device of an application program having an electronic resource transfer function, where the application program may refer to a payment application program, a social application program, a web service application program, and so on. The node device may be a computer device, specifically may be an independent server, or a server cluster formed by a plurality of servers, or a cloud computing center, a tablet computer, a notebook computer, a palm computer, a smart sound, a mobile internet device (MID, mobile INTERNET DEVICE), or the like.
The terminal is a user-oriented terminal, and the terminal may refer to a front-end service device for performing an electronic resource transfer-related operation, for example, the first terminal 20 may be a terminal oriented to a user (referred to as a transferor) performing the electronic resource transfer operation, that is, the first terminal 20 specifically refers to a terminal used by a buyer for performing the electronic resource transfer operation. Alternatively, the first terminal 20 may also be a terminal facing the user performing the electronic resource retrieving operation, i.e. the first terminal 20 specifically refers to a terminal used by the vendor for performing the electronic resource retrieving operation. Similarly, the second terminal 21 may be a terminal oriented to a user (referred to as a transferor) who performs the electronic resource transfer operation, that is, the second terminal 21 specifically refers to a terminal used by the buyer for performing the electronic resource transfer operation. Alternatively, the second terminal 21 may also be a terminal facing the user performing the electronic resource retrieving operation, i.e. the second terminal 21 specifically refers to a terminal used by the vendor for performing the electronic resource retrieving operation. That is, each terminal may be used to perform both a transfer operation of an electronic resource and a pickup operation of an electronic resource. For convenience of description, the description will be given below taking an example in which the first terminal 20 refers to a terminal used by a buyer to perform an electronic resource transfer operation, and the terminal 21 refers to a terminal used by a seller to perform an electronic resource pickup operation. The first terminal 20 and the second terminal 21 may be computer devices, including mobile phones, tablet computers, notebook computers, palm computers, smart phones, POS (Point of sale) devices, mobile internet devices (MID, mobile INTERNET DEVICE), wearable devices (e.g., smart watches, smart bracelets, etc.), etc.; it may also refer to a stand-alone server, or a server cluster composed of several servers, or a cloud computing center.
In order for a terminal to be able to perform electronic resource transfer in an offline state, a node device in a blockchain network may issue digital credential assets to each terminal, specifically, in fig. 2a, taking issuing a data credential asset to a first terminal as an example, the node device may acquire attribute information of the first terminal, where the attribute information of the first terminal may include a transaction type of a historical transaction service executed by the first terminal, a credit level of a terminal user corresponding to the first terminal, a value of a remaining electronic resource in an account address of the first terminal, and so on; the historical transaction service may refer to a transaction service that is performed for a week, a month, or a year, wherein the transaction service may refer to a purchase commodity transaction or a subscription service transaction, etc., the commodity may refer to a physical commodity or a virtual commodity, the physical commodity may include clothing, daily necessities, cosmetics, office consumables, etc., and the virtual commodity may include funds, stocks, web page skin, theme, game equipment, etc.; services may refer to video lectures, electronic articles, online tutorials, online consultations, and the like. After the node device obtains the attribute information of the first terminal, an upper limit value for freezing the electronic resource belonging to the account address of the first terminal can be determined according to the attribute information of the first terminal, the upper limit value is used as a second value, the electronic resource with the account address of the first terminal being less than or equal to the second value is used as a target electronic resource, and the target electronic resource is frozen. Freezing the target electronic resource may refer herein to: the first terminal does not have the transfer authority of the electronic resource, and the node equipment has the transfer authority of the target electronic resource; the upper limit value may be used to indicate a maximum amount of electronic resources that can be paid out when the first terminal is in an offline state. Further, the node device may generate at least two digital voucher assets according to the target electronic resource, and send the at least two digital voucher assets to the first terminal. The at least two-part digital voucher asset is used for indicating that a target electronic resource in an account address of the first terminal is in a frozen state, that is, the at least two-part digital voucher asset is used for indicating that the value of the electronic resource remaining in the account address of the first terminal is larger than or equal to a second value, and the total value of the at least two-part digital voucher asset has a peer-to-peer relationship with the value of the target electronic resource.
For example, as shown in fig. 2a, the current account address of the first terminal includes 20 electronic resources, and the account address of the second terminal includes 15 electronic resources. The node device obtains attribute information of the first terminal, determines a value for freezing electronic resources belonging to the first terminal according to the attribute information, and if the value is 5 electronic resources, the node device can freeze the 5 electronic resources in the account address of the first terminal, that is, the account address of the first terminal includes 5 electronic resources in a frozen state, and 15 electronic resources are in a non-frozen state. Namely, when the first terminal is in an offline state, 5 electronic resources in a frozen state can be paid out; that is, when the terminal is in the on-line state, 15 electronic resources in the non-frozen state can be paid out. Further, a digital voucher asset is generated from the electronic resource in a frozen state and sent to the first terminal. Assume that 1 part of a digital voucher asset is generated, referred to as a target digital voucher asset, for indicating that there are at least 5 electronic resources in the account address of the first terminal.
As shown in fig. 2b, if the first terminal and the second terminal are both in an offline state, the first terminal may generate transaction data according to a service transaction executed with the second terminal, where the transaction data may include a first value (i.e. a transaction amount) of an electronic resource to be transferred from the first terminal to the second terminal, a transaction time, a transaction number, a transaction name, a transaction content, an identifier of both parties of the transaction, and the like; the identification of the transaction parties may refer to account addresses of the transaction parties, terminal names, numbers of the terminals, and so on. The first terminal may obtain a target digital credential asset corresponding to a first number of electronic resources, where the first number of electronic resources is 5 electronic resources. After the first terminal obtains the target digital voucher asset, the target digital voucher asset and the transaction data can be transmitted to the second terminal in an off-line mode through Bluetooth, sound waves, graphic codes and the like. When the second terminal resumes the online state, the node device may obtain the target digital credential asset and transaction data from the second terminal. As shown in fig. 2c, after the node device obtains the transaction data and the target digital certificate asset, thawing the electronic resource in the frozen state in the account address of the first terminal according to the target digital certificate asset and the transaction data to obtain a target electronic resource; transferring the electronic resource of the first value from the target electronic resource to the account address of the second terminal, completing the transfer of the electronic resource, and transmitting the target digital certificate asset to the first terminal. Thawing 5 electronic resources in a frozen state in an account address of a first terminal to obtain 5 electronic resources, and transferring the 5 electronic resources to an account address of a second terminal; at this time, 15 electronic resources remain in the account address of the first terminal: 20 electronic resources-5 electronic resources = 15 electronic resources; the account address of the second terminal has 20 electronic resources left: 15 electronic resources+5 electronic resources=20 electronic resources. Therefore, in the application, the first terminal can realize electronic resource transfer by transmitting the target digital certificate asset and the transaction data to the second terminal in an off-line manner, and the problem of electronic resource transfer failure caused by poor network quality can be avoided.
Based on the above data processing system, the blockchain-based data processing method provided by the embodiment of the present application can be implemented, as shown in fig. 3, and the method may include:
S101, a first terminal generates transaction data according to business transaction executed between the first terminal and a second terminal, wherein the first terminal and the second terminal are both in an offline state, and the transaction data comprises a first numerical value of an electronic resource to be transferred from the first terminal to the second terminal.
The business of the first terminal purchasing goods, subscribing services and the like from the second terminal may be called business transaction, and transaction data may be generated according to the generation time of the business transaction, the generation address of the business transaction, the first value of the electronic resource to be transferred from the first terminal to the second terminal and the like. The first value of the electronic resource may refer to a fee that the first terminal needs to pay for the purchased goods, subscription services. At this time, the first terminal and the second terminal are both in an offline state, which may specifically refer to: the network quality between the first terminal and the second terminal and the node equipment in the block chain network is poor, or the network is interrupted, or the node equipment in the block chain network is in fault, such as downtime problem, and the like.
S102, the first terminal acquires a target digital credential asset corresponding to the electronic resource of the first value.
When the first terminal and the second terminal are in an offline state, the first terminal cannot directly transfer the electronic resource with the first value to the second terminal; thus, to ensure that the business transaction can be performed normally, the first terminal may acquire a target digital voucher asset corresponding to the electronic resource of the first value. The target digital voucher asset is used for indicating that the value of the electronic resource remaining in the account address of the first terminal is greater than or equal to the first value, and can be used for transferring the electronic resource of the first value from the account address of the first terminal; the target digital credential asset may carry a signature of a node device in the blockchain network, the signature of the node device being used to indicate that an event in an account address of the first terminal having an electronic resource greater than or equal to a first value was verified by the node device; that is, the event with the electronic resource greater than or equal to the first value in the account address of the first terminal is verified by the authority, that is, has high authenticity and reliability. The node device may refer to a background service device for providing an electronic resource transfer service for the first terminal and the second terminal, for example, the node device may refer to a background service device of a payment application, or a background service device of a social application having an electronic resource transfer function, or the like.
Optionally, the first terminal may include at least two digital certificate assets, where the values of the electronic resources corresponding to the two digital certificate assets respectively may be different and, of course, may be the same. At this time, the first terminal may select a digital voucher asset having a value corresponding to the electronic resource from the at least two digital voucher assets that is greater than or equal to the second value. As shown in table 2, the first terminal includes three-fraction digital voucher asset, namely digital voucher asset 1, digital voucher asset 2 and digital voucher asset 3, wherein the numerical value of the electronic resource corresponding to digital voucher asset 1 is 5, the numerical value of the electronic resource corresponding to digital voucher asset 2 is 3, and the numerical value of the electronic resource corresponding to digital voucher asset 3 is 3. That is, the digital voucher asset 1, the digital voucher asset 2 and the digital voucher asset 3 are respectively used for indicating that the value of the electronic resource in the account address of the first terminal is 5, 3 and 3, that is, the three digital voucher assets are used for indicating that the value of the electronic resource in the account address of the first terminal is 11. If the electronic resource is a game coin, the three digital voucher assets are used for indicating that 11 game coins are in the account address of the first terminal; if the electronic resource is Renminbi, the three digital voucher assets are used to indicate that there is 11 RMB in the account address of the first terminal. If the first value is 2, the first terminal can select any one of the digital voucher asset 1, the digital voucher asset 2 and the digital voucher asset 3 as a target digital voucher asset; if the first value is 5, the first terminal may select digital voucher asset 1 as the target digital voucher asset.
Table 2:
S103, the first terminal transmits the target digital certificate asset and the transaction data to the second terminal in an offline mode.
After the first terminal acquires the target digital voucher, the target digital voucher and the transaction data can be transmitted to the second terminal in an off-line mode; specifically, the target digital voucher asset and the transaction data can be transferred offline to the second terminal via sound waves, bluetooth, graphics code, or the like. For example, the first terminal may perform packaging processing on the target digital certificate asset and the transaction data to obtain a data packet, encode the data packet to obtain a graphic code, display the graphic code by the first terminal, and obtain the data packet by scanning the graphic code by the second terminal; the second terminal can analyze the data packet to obtain the target digital certificate asset and the transaction data. Or the first terminal can encrypt the target digital certificate asset and the transaction data to obtain encrypted data, and the encrypted data is sent to the second terminal in a sound wave and Bluetooth mode; the second terminal may decrypt the encrypted data to obtain the target digital voucher asset and transaction data. Or a point-to-point communication connection may be established between the first terminal and the second terminal over which the target digital credential asset and transaction data are transmitted to the second terminal.
Accordingly, after the second terminal obtains the target digital asset and the transaction data, it can verify whether the transaction data is accurate, and verify whether the signature carried by the target digital credential asset has authenticity, if the transaction data is accurate, and the signature carried by the target digital credential asset has authenticity, it can achieve the transaction, and execute step S104; if the transaction data has errors or the signature carried by the target digital voucher asset does not have authenticity, the transaction can be refused, and the process can be ended. Optionally, the second terminal may verify whether the value of the electronic resource corresponding to the target digital certificate asset is greater than or equal to the electronic resource of the first value; if the electronic resource is greater than or equal to the account address of the first terminal, the remaining electronic resource in the account address of the first terminal is enough to complete the business transaction, the transaction can be achieved, and step S104 is executed; otherwise, the balance of the account address of the first terminal is insufficient, the transaction can be refused, and the process can be ended.
And S104, when the second terminal is restored to the online state, the node equipment acquires transaction data and the target digital credential asset from the second terminal.
S105, the node equipment can transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital certificate asset.
S106, returning the target digital certificate asset to the first terminal.
In steps S104 to S106, when the network between the second terminal and the node device is recovered to be normal or the failure of the node device is recovered, the second terminal may be recovered to an on state, which may specifically be: and the second terminal and the node equipment establish communication connection. At this time, the second terminal may upload the transaction data and the target digital voucher asset to the blockchain network, and correspondingly, the node device may acquire the transaction data and the target digital voucher asset from the second terminal; the electronic resource of the first value may be transferred from the account address of the first terminal to the account address of the second terminal based on the transaction data and the target digital credential asset. The node device may return the target digital voucher asset to the first terminal after the first terminal resumes online; or the node device can return the target digital credential asset to the first terminal, when the first terminal resumes the online state, the target digital credential asset returned by the node device can be picked up, and similarly, the first terminal resumes the online state, which may refer to that the network quality between the first terminal and the node device in the blockchain network is better, or the failure of the node device in the blockchain network is recovered, and a communication connection is established between the first terminal and the node device. The node equipment in the block chain network can transfer the electronic resource of the first value to the second terminal, so that the problem of electronic resource transfer failure caused by poor network quality can be avoided, and the transfer success rate of the electronic resource can be improved; in addition, the transfer process of the electronic resource does not need the participation of a third party, and the transfer operation of the electronic resource is executed through the node equipment in the blockchain network, so that the safety and the credibility of the electronic resource transfer can be improved, and the fairness of business transaction is improved.
Optionally, the first terminal may include a local account address, where the local account may refer to an account address that does not need to be connected to a node device in the blockchain network, and may enable offline transfer of an electronic resource, where the local account address includes an electronic resource, where the electronic resource may be transferred from the first terminal to an account address on a chain in the blockchain network. When the first terminal and the second terminal are in an offline state, the electronic resource of the first value can be transferred to the account address of the second terminal from the local account address of the first terminal in an offline manner, and the target digital credential asset and the transaction data are transferred to the second terminal in an offline manner; the target digital credential asset is used for indicating that the electronic resource in the local account address of the first terminal is transferred from the first terminal to the on-chain account address in the blockchain network, and has authenticity and validity. The offline transfer can refer to transfer in the modes of Bluetooth, sound waves, graphic codes and the like; in the application, the account address of the first terminal and the account address of the second terminal are the on-chain account addresses in the blockchain network.
In the application, when the first terminal and the second terminal are both in an offline state, the first terminal can generate transaction data according to the business transaction executed between the first terminal and the second terminal, the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal, and a target digital credential asset corresponding to the electronic resource of the first value is acquired. The first terminal transmits the target digital certificate asset and the transaction data to the second terminal in an offline manner; when the second terminal resumes the online state, node devices in the blockchain network may obtain the target digital asset credential and transaction data from the second terminal. The node device can transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal according to the target digital asset certificate and the transaction data; the target digital asset credential is returned to the first terminal. When the first terminal and the second terminal are in an offline state, the first terminal sends the target digital certificate asset and transaction data to the second terminal in an offline transmission mode, and after the second terminal is in an online state, the second terminal can finish the transfer of electronic resources through node equipment in the blockchain network; the problem of electronic resource transfer failure caused by poor network quality can be effectively avoided, and the transfer success rate of the electronic resource can be improved. In addition, the electronic resource transfer is realized through the node equipment of the blockchain network, the participation of a third party mechanism is not needed, and the safety and the transparency of the electronic resource transfer can be improved.
Optionally, before step S101, the method may further include the following steps S11 to S14.
And s11, acquiring attribute information of the first terminal.
And s12, freezing the target electronic resource in the account address of the first terminal according to the attribute information of the first terminal.
And s13, generating at least two parts of digital voucher assets according to the target electronic resource, wherein the at least two parts of digital voucher assets comprise the target digital voucher asset.
And s14, sending the at least two digital assets to the first terminal so that the first terminal stores the at least two digital assets.
In steps s11 to s14, as shown in fig. 4, the node device may acquire attribute information of the first terminal; the attribute information may include, but is not limited to: the type of historical transaction service executed by the first terminal, the credit rating of the terminal user corresponding to the first terminal, the value of the residual electronic resource in the first terminal and the like; the credit rating of the end user may be determined by the information of the end user about the overdue times, overdue amount, etc. Determining an upper limit value for freezing the electronic resource in the account address of the first terminal according to the attribute information, wherein the upper limit value is used as a second numerical value, the node equipment can check whether the account address of the first terminal has the electronic resource with the second numerical value, and if the account address of the first terminal does not have the electronic resource with the second numerical value, the node equipment can refuse to issue a digital credential asset to the first terminal; and if the electronic resource with the second value is the electronic resource with the second value, taking the electronic resource with the second value as the target electronic resource. After the node device obtains the attribute information of the first terminal, the node device can freeze the target electronic resource in the account address of the first terminal according to the attribute information of the first terminal, and specifically, the node device can encrypt the target electronic resource by adopting the public key of the node device to obtain the encrypted target electronic resource; or the private key of the node equipment can be adopted to sign the target electronic resource, so as to obtain the electronic resource carrying the signature of the node equipment; or writing a piece of freezing indication information into the blockchain network, wherein the freezing indication information is used for indicating that the target electronic resource is frozen, i.e. the first terminal does not have the transfer authority of the target electronic resource. Further, the node device may generate at least two digital voucher assets according to the target electronic resource; the total value of the electronic resources corresponding to the at least two digital certificate assets is equal to the second value of the target electronic resource, namely the at least two digital certificate assets and the target electronic resource have a peer-to-peer relationship; the at least two digital voucher assets are used for indicating electronic resources having a second value in the first terminal account address. By pre-freezing a certain amount of electronic resources in the account address of the first terminal, the problems that the first terminal refuses to pay the electronic resources to be transferred to the second terminal after finishing the business transaction in an off-line state, huge electronic resource loss is brought to the second terminal, and fairness of the business transaction is reduced can be avoided; the electronic resource loss of the second terminal can be reduced, and the fairness of service transaction can be improved. In addition, by generating the target digital credential asset from the electronic resource in the frozen state, it is advantageous to increase the trustworthiness of the second terminal to the event of the electronic resource having the first value in the account address of the first terminal.
In this embodiment, the step s12 may include the following steps s21 to s22.
And s21, determining an upper limit value for freezing the electronic resource belonging to the first terminal according to the attribute information of the first terminal, wherein the attribute information of the first terminal comprises the credit grade of the terminal user corresponding to the first terminal or the transaction type of the historical business transaction executed by the first terminal as a second value.
And S22, determining the electronic resource with the second value in the account address of the first terminal as a target electronic resource, and freezing the target electronic resource.
In steps s21 to s22, the node device may determine, according to the attribute information of the first terminal, an upper limit value for freezing the electronic resource belonging to the first terminal, as a second value; the upper limit value is the maximum limit value of the electronic resource which can be paid out when the first terminal is in an offline state. Here, the upper limit value may be dynamically changed according to the attribute information of the first terminal; of course, the upper limit value may be a fixed value set by the node device or set by the first terminal. Further, the electronic resource with the second value in the account address of the first terminal is determined to be the target electronic resource, and the target electronic resource is frozen.
Optionally, the attribute information of the first terminal includes a credit rating of a terminal user corresponding to the first terminal; the credit rating of the terminal user corresponding to the first terminal has a positive correlation with the second value. If the credit rating of the terminal user of the first terminal is higher, the reliability of the terminal user of the first terminal is higher, and after the first terminal finishes the business transaction in an offline state, the probability of refusing to pay the electronic resource to be transferred to the second terminal is lower, and the second value can be set to be a larger value; if the credit rating of the terminal user of the first terminal is lower, indicating that the credibility of the terminal user of the first terminal is lower; after the first terminal finishes business transaction in an offline state, the probability of refusing to pay the electronic resource to be transferred to the second terminal is higher; the second value can be set to be a smaller value, so that even if the first terminal refuses to pay the electronic resource to be transferred to the second terminal, the loss of the electronic resource brought to the second terminal is lower, the electronic resource loss of the second terminal can be reduced, and the security of business transaction is improved.
Optionally, the attribute information of the first terminal includes a transaction type of the historical service transaction executed by the first terminal; the electronic resources that need to be paid for performing different types of business transactions are different in value; therefore, the first terminal can determine the upper limit value for freezing the electronic resource belonging to the first terminal as the second value according to the transaction type of the historical business transaction executed by the first terminal. Specifically, as shown in Table 3, the second values associated with each transaction type are recorded in Table 3. As can be seen from table 3, the second values corresponding to transaction type 1, transaction type 2 and transaction type 3 are 20, 10 and 23, respectively, that is, the value of the electronic resource required to be paid out for executing the business transaction of transaction type 3 is the largest; the value of the electronic resource that needs to be paid out to perform the business transaction of transaction type 2 is the smallest; the value of the electronic resource that needs to be paid for performing the transaction of transaction type 1 is located between the value of the electronic resource that needs to be paid for performing the transaction of transaction type 3 and the value of the electronic resource that needs to be paid for performing the transaction of transaction type 2. The node device may query the table 3 for a transaction type of the historical service transaction executed by the first terminal, and the transaction type corresponds to a value of the electronic resource to be paid out as a second value; if the transaction type of the service transaction executed by the first terminal is transaction type 1, the second value corresponding to the transaction type is 20, and the upper limit value of freezing the electronic resource in the first account address of the first terminal is 20.
Table 3:
Optionally, the attribute information of the first terminal includes a value of a remaining electronic resource in an account address of the first terminal; in order that the first terminal can execute business transaction in an online state or an offline state; the node equipment can determine an upper limit value for freezing the electronic resource belonging to the first terminal as a second value according to the value of the residual electronic resource in the account address of the first terminal; that is, the electronic resource with the second value is used for the scenario of the business transaction executed by the first terminal in the offline state; the electronic resources which are not in the frozen state in the first terminal are used for the scene of the business transaction executed by the first terminal in the online state. Therefore, the second value is smaller than the value of the remaining electronic resources in the account address of the first terminal, which is beneficial to ensuring that the business transaction can be executed when the first terminal is in the online state or the offline state.
Optionally, the step of freezing the target electronic resource in the step s22 may include the following steps s31 to s33.
And s31, generating the freezing indication information, and establishing the association relation between the freezing indication information and the target electronic resource.
And s32, acquiring the private key of the node equipment, and signing the freezing indication information by adopting the private key of the node equipment to obtain the freezing indication information carrying the signature of the node equipment.
And s33, uploading the freezing indication information carrying the signature of the node equipment to the blockchain network according to the association relation.
In steps s31 to s33, as shown in fig. 5, the node device may generate freeze indication information according to the target electronic resource, and establish an association relationship between the freeze indication information and the target electronic resource; generating a key pair of the node equipment by adopting an asymmetric encryption algorithm, wherein the key pair of the node equipment comprises a public key and a private key 23, the private key 23 is used for signing data information, the public key is used for signing, the public key and the private key are both saved by the node equipment, or the public key and the private key of the node equipment can be disclosed to the node equipment in the blockchain network and not disclosed to equipment except the node equipment; the asymmetric encryption algorithm herein may include, but is not limited to: elgamal algorithm (an asymmetric encryption algorithm), rabin algorithm (an asymmetric encryption algorithm), diffie-Hellman algorithm (an asymmetric encryption algorithm), ECC algorithm (elliptic curve encryption algorithm). The node device may sign the freeze indication information by using a private key of the node device to obtain freeze indication information carrying the signature of the node device. Specifically, the node device may perform hash operation on the freeze indication information to obtain a hash value of the freeze indication information, and sign (i.e. encrypt) the hash value of the freeze indication information by using a private key of the node device to obtain the freeze indication information carrying the signature of the node device. According to the association relation, freezing indication information carrying the signature of the node equipment and freezing indication information (original text) can be uploaded to a blockchain network, and freezing of target electronic resources is completed. As shown in fig. 5, the node device stores freeze indication information carrying a signature of the node device in a block 10002 of the blockchain network, where the block 10002 includes a block header and a block body, and the block header includes 10001H, 10002T, and so on. Wherein 10001H represents the block header hash value of block 10001 in the blockchain, 10002H represents the hash value corresponding to the transaction data of 10002, 10002T represents the block generation timestamp of block 10002. The block body comprises freezing indication information carrying the signature of the node equipment, and can also comprise the original text of the freezing indication information, or the original text of the freezing indication information is stored in other blocks.
The freezing indication information is used for indicating that the electronic resource in the frozen state is refused to be transferred when the digital credential asset sent by the first terminal is not received and the signature of the node equipment is not checked to pass; therefore, other devices can be prevented from transferring the electronic resource in the frozen state in advance, and the safety of the electronic resource and the fairness of business transaction can be improved. The purpose of signing the freeze indication information by using the node device is to: before the target electronic resource is frozen, the target electronic resource belongs to node equipment, and the first terminal equipment or other equipment has transfer permission for the target electronic resource.
Optionally, the step S105 includes the following steps S41 to S42.
And S41, thawing the electronic resource in the frozen state in the account address of the first terminal to obtain a target electronic resource, wherein the target electronic resource has an association relationship with the target digital credential asset.
S42, transferring the electronic resource with the first value from the target electronic resource to the account address of the second terminal.
In steps s 41-s 42, after the node device obtains the target digital credential asset and the transaction data, the node device may transfer the electronic resource of the first value to the account address of the second terminal. Specifically, the node device may defrost the electronic resource in the frozen state in the account address of the first terminal according to a freezing manner of the electronic resource in the account address of the first terminal in advance, to obtain a target electronic resource; for example, if the target electronic resource of the account address of the first terminal is encrypted by adopting the public key of the node device in advance to freeze the target electronic resource, the electronic resource in the encrypted transition is used as the electronic resource in the frozen state; and decrypting the electronic resource in the frozen state by adopting a private key of the node equipment, and taking the decrypted electronic resource as a target electronic resource.
Optionally, if the target electronic resource of the account address of the first terminal is signed by the private key of the node device in advance, so as to freeze the target electronic resource, it may be determined that the electronic resource carrying the signature of the node device is the electronic resource in the frozen state, the signature carrying the node device is checked, if the signature passes, the electronic resource carrying the signature of the node device is determined as the target electronic resource, and it is determined that the target electronic resource is successfully thawed.
Optionally, if the manner of recording the freeze indication information in the blockchain network is adopted in advance to freeze the target electronic resource, the electronic resource associated with the freeze indication information in the account address of the first terminal can be used as the electronic resource in the frozen state; the thawing indication information can be recorded in the blockchain network to defrost the electronic resource in the frozen state, and the electronic resource successfully thawed is used as a target electronic resource; the defrosting indication information is used for indicating that the node equipment has transfer permission on the target electronic resource.
After the node equipment acquires the target electronic resource, the electronic resource of the first value can be transferred from the target electronic resource to the account address of the second terminal, so that the electronic resource transfer can be completed, and the electronic resource transfer failure can be avoided when the first terminal and the second terminal are both in offline transfer; the transition probability of the electronic resource can be improved.
In one embodiment, the step s41 includes the following steps s51 to s53.
S51, acquiring an electronic resource associated with the freezing indication information in the account address of the first terminal as the electronic resource in the frozen state; the freeze indication information carries a signature of a node device in the blockchain network; the freeze indication information is used for indicating that the electronic resource in the frozen state is refused to be transferred when the digital credential asset sent by the first terminal is not received and the signature of the node equipment is not checked and passed.
S52, obtaining the public key of the node equipment, and adopting the public key of the node equipment to check the signature of the node equipment.
S53, if the signature of the node equipment passes the signature verification, thawing indication information is recorded in the blockchain network, the electronic resource in a frozen state is determined to be successfully thawed, and the electronic resource which is successfully thawed is determined to be the target electronic resource; the defrosting instruction information is used for indicating that the node equipment has the transfer authority to the target electronic resource.
In steps s51 to s53, the node device may defrost the electronic resource in the frozen state. Specifically, as shown in fig. 6, the node device may read the freeze indication information carrying the signature of the node device from the blockchain network, that is, read the freeze indication information carrying the signature of the node device from the block 10002 in the blockchain network. And acquiring the electronic resource associated with the freezing instruction information in the account address of the first terminal, wherein the electronic resource is used as the electronic resource in the frozen state, and the electronic resource is used as the electronic resource in the frozen state. The node device may perform a hash operation on the freeze indication information to obtain a first hash value, and perform signing (i.e., decryption) on the signature of the node device by using the public key 24 of the node device to obtain a second hash value. If the first hash value is different from the second hash value, determining that the signature of the node equipment is not passed by the verification signature; and at the moment, the node equipment does not have the transfer authority for the electronic resource, and unfreezing the electronic resource in the frozen state is refused. If the first hash value is the same as the second hash value, determining that the signature of the node equipment is checked to pass; the node equipment has the transfer authority to the electronic resource, defreezing indication information is recorded in the blockchain network, the electronic resource in a frozen state is determined to be defreezed successfully, and the electronic resource which is defreezed successfully is determined to be the target electronic resource; the defrosting instruction information is used for indicating that the node equipment has the transfer authority to the target electronic resource. As in fig. 6, the node device may record the thawing indication information into a block 10003 in the blockchain network, where the block 10003 includes a block header and a block body, and the block header includes 10002H, 10003T, and so on. Wherein 10001H represents the block header hash value of block 10002 in the blockchain, 10003H represents the hash value corresponding to the transaction data of 10003, 10003T represents the block generation timestamp of block 10003. The zone block includes thawing indication information and can also include other transaction data.
In one embodiment, the step S101 includes the following steps S61-S64.
S61, acquiring a business transaction executed between the first terminal and the second terminal, wherein the business transaction comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal.
S62, generating a key pair of the first terminal, where the key pair of the first terminal includes a public key and a private key.
And s63, signing the business transaction by adopting the private key of the first terminal to obtain the business transaction carrying the signature of the first terminal.
S64, determining the business transaction carrying the signature of the first terminal as the transaction data, wherein the signature of the first terminal is used for indicating the node device to verify the transaction data, and the verified transaction data and the target digital certificate asset are used for indicating the node device to transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal.
In steps s 61-s 64, the first terminal may acquire a service transaction executed with the second terminal, and generate a key pair of the first terminal by using the asymmetric encryption algorithm; and carrying out hash operation on the business transaction to obtain a hash value of the business transaction, and signing (encrypting) the hash value of the business transaction by adopting a private key in a key pair of the first terminal to obtain the business transaction carrying the signature of the first terminal. Further, the first terminal may determine a business transaction carrying a signature of the first terminal as the transaction data.
Correspondingly, the method can comprise the following steps s 71-s 73.
S71, obtaining the public key of the first terminal.
And s72, checking the signature of the first terminal by adopting the public key of the first terminal.
And s73, if the signature of the first terminal passes the verification, executing the step of transferring the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital certificate asset.
In steps s 71-s 73, the node device may verify the transaction data. Specifically, a public key of the first terminal can be obtained, and hash operation can be performed by using transaction data to obtain a third hash value; decrypting (signing releasing) the signature of the first terminal by adopting the public key of the first terminal to obtain a fourth hash value; if the third hash value is the same as the fourth hash value, it is determined that the signature of the first terminal is checked, i.e. the transaction data is not tampered with, and the transaction data is transmitted by the first terminal, step S105 may be performed. If the third hash value is different from the fourth hash value, it is determined that the signature of the first terminal is not checked to pass, i.e., the transaction data is tampered with, or the transaction data is not sent by the first terminal, the transfer of the electronic resource to the second terminal may be refused.
In one embodiment, the step S106 may include: freezing an electronic resource corresponding to the target digital voucher asset in the account address of the first terminal, and returning the target digital voucher asset to the first terminal; or setting the state of the target digital voucher asset to be in an invalid state, and returning the target digital voucher asset with the state in the invalid state to the first terminal.
The node device may refrigerate the electronic resource corresponding to the target digital voucher asset in the account address of the first terminal again, and return the target digital voucher asset to the first terminal so that the target digital voucher asset can be reused. Optionally, the node device may set the state of the target digital credential asset to an invalid state, and return the target digital credential asset whose state is in the invalid state to the first terminal, so as to avoid the target digital credential asset from being reused when the account address of the first terminal does not have the electronic resource corresponding to the target digital credential asset, reduce electronic resource loss, and improve security of the electronic resource.
Optionally, the method may include the following steps s81 to s82.
S81, if the value of the electronic resource in the account address of the first terminal is smaller than the first value, pre-transferring the electronic resource with the first value from the account address of the node device to the account address of the second terminal.
S82, generating pre-transfer information, and recording the pre-transfer information into the blockchain network, where the pre-transfer information is used to instruct the first terminal to transfer the electronic resource with the first value to the node device.
In steps s 81-s 82, if the value of the electronic resource in the account address of the first terminal is smaller than the first value, which indicates that the electronic resource in the account address of the first terminal is insufficient, the electronic resource of the first value is pre-transferred from the account address of the node device to the account address of the second terminal. The node equipment can generate pre-transfer information, the pre-transfer information is recorded in the blockchain network, and the pre-transfer information is used for indicating the first terminal to transfer the electronic resource of the first value to the node equipment; that is, after the first terminal has the electronic resource with the first value, the node device may automatically transfer the electronic resource with the first value from the account address of the first terminal to the account address of the node device.
For example, the first number of electronic resources is 5 electronic resources, and the account address of the first terminal includes 3 electronic resources. The node equipment can determine that the value of the electronic resource in the account address of the first terminal is smaller than the first value, and can pre-transfer 5 electronic resources from the account address of the node equipment to the account address of the second terminal; generating pre-transfer information, wherein the pre-transfer information is used for indicating that the first terminal is to transfer 5 electronic resources to the node equipment. Optionally, the node device may transfer 3 electronic resources from the account address of the first terminal to the account address of the second terminal, and pre-transfer 2 electronic resources from the account address of the node device to the account address of the second terminal, where pre-transfer information is generated, where the pre-transfer information is used to instruct the first terminal to transfer 2 electronic resources to the node device. After the node device generates the pre-transfer information, the pre-transfer instruction information may be stored in the blockchain network.
Further, if the value of the electronic resource in the account address of the first terminal is smaller than the first value, the upper limit value for freezing the electronic resource of the first terminal may be reduced, or the credit rating of the terminal user of the first terminal may be reduced. Conversely, if the value of the electronic resource in the account address of the first terminal is greater than or equal to the first value, an upper limit value for freezing the electronic resource of the first terminal may be increased, or the credit rating of the terminal user of the first terminal may be increased.
Fig. 7 is a schematic structural diagram of a data processing apparatus based on a blockchain according to an embodiment of the present application. The blockchain-based data processing device may be a computer program (including program code) running in a computer device, for example, the blockchain-based data processing device is an application software; the device can be used for executing corresponding steps in the method provided by the embodiment of the application. As shown in fig. 7, the data processing apparatus 1 may include:
A generating module 701, configured to generate transaction data according to a service transaction executed with a second terminal, where the first terminal and the second terminal are both in an offline state, and the transaction data includes a first value of an electronic resource to be transferred from the first terminal to the second terminal;
An obtaining module 702, configured to obtain a target digital credential asset corresponding to the electronic resource of the first value;
and a transmission module 703, configured to offline transmit the target digital credential asset and the transaction data to the second terminal, so that when the second terminal is restored to the on-line state, the transaction data and the target digital credential asset are sent to a node device of a blockchain network.
The transaction data and the target digital certificate asset are used for instructing the node equipment to transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal;
the obtaining module 702 is further configured to obtain, when the first terminal is restored to an online state, the target digital credential asset returned by the node device.
Optionally, the generating module 701 is configured to obtain a service transaction executed with the second terminal, where the service transaction includes a first value of an electronic resource to be transferred from the first terminal to the second terminal; generating a key pair of the first terminal, wherein the key pair of the first terminal comprises a public key and a private key; signing the business transaction by adopting the private key of the first terminal to obtain the business transaction carrying the signature of the first terminal; and determining the business transaction carrying the signature of the first terminal as the transaction data.
The signature of the first terminal is used for instructing the node device to verify the transaction data, and the transaction data passing the verification and the target digital certificate asset are used for instructing the node device to transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal.
According to one embodiment of the application, the steps involved in the blockchain-based data processing method shown in fig. 3 may be performed by various modules in the data processing device shown in fig. 7. For example, step S101 shown in fig. 3 may be performed by the generation module 701 in fig. 7, and step S102 shown in fig. 3 may be performed by the acquisition module 702 in fig. 7; step S103 shown in fig. 3 may be performed by the transmission module 703 in fig. 7.
According to an embodiment of the present application, each module in the data processing apparatus shown in fig. 7 may be separately or completely combined into one or several units to form a structure, or some (some) of the units may be further split into a plurality of sub-units with smaller functions, so that the same operation may be implemented without affecting the implementation of the technical effects of the embodiment of the present application. The above modules are divided based on logic functions, and in practical applications, the functions of one module may be implemented by a plurality of units, or the functions of a plurality of modules may be implemented by one unit. In other embodiments of the application, the blockchain-based data processing device may also include other units, and in actual practice, these functions may be facilitated by other units and may be cooperatively implemented by multiple units.
According to one embodiment of the present application, a data processing apparatus as shown in fig. 7 may be constructed by running a computer program (including program code) capable of executing the steps involved in the corresponding method as shown in fig. 3 on a general-purpose computer device such as a computer including a processing element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read only storage medium (ROM), and the like, and a storage element, and implementing the blockchain-based data processing method of the embodiment of the present application. The computer program may be recorded on, for example, a computer-readable recording medium, and loaded into and executed by the computing device via the computer-readable recording medium.
In the application, when the first terminal and the second terminal are both in an offline state, the first terminal can generate transaction data according to the business transaction executed between the first terminal and the second terminal, the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal, and a target digital credential asset corresponding to the electronic resource of the first value is acquired. The first terminal transmits the target digital certificate asset and the transaction data to the second terminal in an offline manner; when the second terminal resumes the online state, node devices in the blockchain network may obtain the target digital asset credential and transaction data from the second terminal. The node device can transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal according to the target digital asset certificate and the transaction data; the target digital asset credential is returned to the first terminal. When the first terminal and the second terminal are in an offline state, the first terminal sends the target digital certificate asset and transaction data to the second terminal in an offline transmission mode, and after the second terminal is in an online state, the second terminal can finish the transfer of electronic resources through node equipment in the blockchain network; the problem of electronic resource transfer failure caused by poor network quality can be effectively avoided, and the transfer success rate of the electronic resource can be improved. In addition, the electronic resource transfer is realized through the node equipment of the blockchain network, the participation of a third party mechanism is not needed, and the safety and the transparency of the electronic resource transfer can be improved.
Fig. 8 is a schematic structural diagram of a data processing apparatus based on a blockchain according to an embodiment of the present application. The blockchain-based data processing device may be a computer program (including program code) running in a computer device, for example, the blockchain-based data processing device is an application software; the device can be used for executing corresponding steps in the method provided by the embodiment of the application. As shown in fig. 8, the data processing apparatus 2 may include:
An obtaining module 801, configured to obtain transaction data and a target digital credential asset from a second terminal when the second terminal is restored to an on state; the transaction data are generated according to business transactions executed by the first terminal and the second terminal when the first terminal and the second terminal are both in an offline state; the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal, and the target digital voucher asset corresponds to the electronic resource of the first value;
A transferring module 802, configured to transfer the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital certificate asset;
a return module 803 for returning the target digital voucher asset to the first terminal.
Optionally, the transaction data carries a signature of the first terminal;
the obtaining module 801 is further configured to obtain a public key of the first terminal;
optionally, the apparatus further includes:
The signature verification module 804 is configured to verify a signature of the first terminal by using a public key of the first terminal; and if the signature of the first terminal passes the verification, executing the step of transferring the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital certificate asset.
Optionally, a transferring module 802, configured to defrost an electronic resource in a frozen state in the account address of the first terminal to obtain a target electronic resource, where the target electronic resource has an association relationship with the target digital credential asset; and transferring the electronic resource with the first value from the target electronic resource to the account address of the second terminal.
Optionally, the transferring module 802 is configured to obtain, as the electronic resource in the frozen state, the electronic resource associated with the freeze indication information in the account address of the first terminal. Acquiring a public key of the node equipment, and checking a signature of the node equipment by adopting the public key of the node equipment; if the signature of the node device passes the signature verification, the defrosting instruction information is recorded in the block chain network, the electronic resource in the frozen state is determined to be successfully defrosted, and the electronic resource which is successfully defrosted is determined to be the target electronic resource.
Wherein the freeze indication information carries a signature of a node device in the blockchain network; and the freeze indication information is used for indicating that the electronic resource in the frozen state is refused to be transferred when the digital credential asset sent by the first terminal is not received and the signature of the node equipment is not checked and signed.
The defrosting instruction information is used for indicating that the node equipment has transfer authority to the target electronic resource
Optionally, the acquiring module 801 is further configured to acquire attribute information of the first terminal;
Optionally, the apparatus further includes: a freezing module 805, configured to freeze, according to the attribute information of the first terminal, a target electronic resource in an account address of the first terminal; generating at least two parts of digital voucher assets according to the target electronic resource, wherein the at least two parts of digital voucher assets comprise the target digital voucher asset; and sending the at least two digital assets to the first terminal so that the first terminal stores the at least two digital assets.
Optionally, the freezing module 805 is specifically configured to determine, as the second value, an upper limit value for freezing the electronic resource belonging to the first terminal according to the attribute information of the first terminal, where the attribute information of the first terminal includes a credit level of the terminal user corresponding to the first terminal or a transaction type of the historical service transaction executed by the first terminal; and determining the electronic resource with the second value in the account address of the first terminal as a target electronic resource, and freezing the target electronic resource.
Optionally, the freezing module 805 is specifically configured to generate the freezing indication information, and establish an association relationship between the freezing indication information and the target electronic resource; acquiring a private key of the node equipment, and signing the freeze indication information by adopting the private key of the node equipment to obtain the freeze indication information carrying the signature of the node equipment; and uploading the freezing indication information carrying the signature of the node equipment to the blockchain network according to the association relation.
A return module 803, configured to freeze an electronic resource corresponding to the target digital voucher asset in the account address of the first terminal, and return the target digital voucher asset to the first terminal; or alternatively
Setting the state of the target digital voucher asset to be invalid, and returning the target digital voucher asset with the invalid state to the first terminal.
Optionally, the device may further comprise
A pre-transferring module 806, configured to pre-transfer, if the value of the electronic resource in the account address of the first terminal is smaller than the first value, the electronic resource of the first value from the account address of the node device to the account address of the second terminal; generating pre-transfer information, and recording the pre-transfer information into the blockchain network, wherein the pre-transfer information is used for indicating the first terminal to transfer the electronic resource with the first value to the node equipment.
According to one embodiment of the application, the steps involved in the blockchain-based data processing method shown in fig. 3 may be performed by various modules in the data processing device shown in fig. 8. For example, step S104 shown in fig. 3 may be performed by the acquisition module 801 in fig. 8, and step S105 shown in fig. 3 may be performed by the transfer module 802 in fig. 8; step S106 shown in fig. 3 may be performed by the retract module 803 in fig. 8.
According to an embodiment of the present application, each module in the data processing apparatus shown in fig. 8 may be separately or completely combined into one or several units to form a structure, or some (some) of the units may be further split into a plurality of sub-units with smaller functions, so that the same operation may be implemented without affecting the implementation of the technical effects of the embodiment of the present application. The above modules are divided based on logic functions, and in practical applications, the functions of one module may be implemented by a plurality of units, or the functions of a plurality of modules may be implemented by one unit. In other embodiments of the application, the blockchain-based data processing device may also include other units, and in actual practice, these functions may be facilitated by other units and may be cooperatively implemented by multiple units.
According to one embodiment of the present application, a data processing apparatus as shown in fig. 10 may be constructed by running a computer program (including program code) capable of executing the steps involved in the corresponding method as shown in fig. 3 on a general-purpose computer device such as a computer including a processing element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read only storage medium (ROM), and the like, and a storage element, and implementing the blockchain-based data processing method of the embodiment of the present application. The computer program may be recorded on, for example, a computer-readable recording medium, and loaded into and executed by the computing device via the computer-readable recording medium.
In the application, when the first terminal and the second terminal are both in an offline state, the first terminal can generate transaction data according to the business transaction executed between the first terminal and the second terminal, the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal, and a target digital credential asset corresponding to the electronic resource of the first value is acquired. The first terminal transmits the target digital certificate asset and the transaction data to the second terminal in an offline manner; when the second terminal resumes the online state, node devices in the blockchain network may obtain the target digital asset credential and transaction data from the second terminal. The node device can transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal according to the target digital asset certificate and the transaction data; the target digital asset credential is returned to the first terminal. When the first terminal and the second terminal are in an offline state, the first terminal sends the target digital certificate asset and transaction data to the second terminal in an offline transmission mode, and after the second terminal is in an online state, the second terminal can finish the transfer of electronic resources through node equipment in the blockchain network; the problem of electronic resource transfer failure caused by poor network quality can be effectively avoided, and the transfer success rate of the electronic resource can be improved. In addition, the electronic resource transfer is realized through the node equipment of the blockchain network, the participation of a third party mechanism is not needed, and the safety and the transparency of the electronic resource transfer can be improved.
Fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 9, the above-mentioned computer device 1000 may include: processor 1001, network interface 1004, and memory 1005, and in addition, the above-described computer device 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display (Display), a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a nonvolatile memory (non-volatile memory), such as at least one magnetic disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 9, an operating system, a network communication module, a user interface module, and a device control application may be included in a memory 1005, which is one type of computer-readable storage medium.
In the computer device 1000 shown in fig. 9, the network interface 1004 may provide network communication functions; while user interface 1003 is primarily used as an interface for providing input to a user; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
The method comprises the steps that a first terminal generates transaction data according to business transaction executed between the first terminal and a second terminal, wherein the first terminal and the second terminal are both in an offline state, and the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal;
Acquiring a target digital voucher asset corresponding to the electronic resource of the first value;
transmitting the target digital voucher asset and the transaction data offline to the second terminal, so that the transaction data and the target digital voucher asset are transmitted to node equipment of a blockchain network when the second terminal is restored to be on-line; the transaction data and the target digital voucher asset are used for instructing the node device to transfer the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal;
and when the first terminal is restored to the online state, acquiring the target digital credential asset returned by the node equipment.
Alternatively, the processor 1001 may be configured to invoke a device control application program stored in the memory 1005 to implement:
Acquiring a business transaction executed between the first terminal and the second terminal, wherein the business transaction comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal;
generating a key pair of the first terminal, wherein the key pair of the first terminal comprises a public key and a private key;
Signing the business transaction by adopting the private key of the first terminal to obtain the business transaction carrying the signature of the first terminal;
And determining the business transaction carrying the signature of the first terminal as the transaction data, wherein the signature of the first terminal is used for indicating the node equipment to verify the transaction data, and the verified transaction data and the target digital certificate asset are used for indicating the node equipment to transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal.
It should be understood that the computer device 1000 described in the embodiment of the present application may perform the description of the above-mentioned blockchain-based data processing method in the embodiment corresponding to fig. 3, and may also perform the description of the above-mentioned blockchain-based data processing apparatus in the embodiment corresponding to fig. 7, which is not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
In the application, when the first terminal and the second terminal are both in an offline state, the first terminal can generate transaction data according to the business transaction executed between the first terminal and the second terminal, the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal, and a target digital credential asset corresponding to the electronic resource of the first value is acquired. The first terminal transmits the target digital certificate asset and the transaction data to the second terminal in an offline manner; when the second terminal resumes the online state, node devices in the blockchain network may obtain the target digital asset credential and transaction data from the second terminal. The node device can transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal according to the target digital asset certificate and the transaction data; the target digital asset credential is returned to the first terminal. When the first terminal and the second terminal are in an offline state, the first terminal sends the target digital certificate asset and transaction data to the second terminal in an offline transmission mode, and after the second terminal is in an online state, the second terminal can finish the transfer of electronic resources through node equipment in the blockchain network; the problem of electronic resource transfer failure caused by poor network quality can be effectively avoided, and the transfer success rate of the electronic resource can be improved. In addition, the electronic resource transfer is realized through the node equipment of the blockchain network, the participation of a third party mechanism is not needed, and the safety and the transparency of the electronic resource transfer can be improved.
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 10, the computer device 2000 may include: processor 2001, network interface 2004 and memory 2005, in addition, the above-described computer device 2000 may further include: a user interface 2003, and at least one communication bus 2002. Wherein a communication bus 2002 is used to enable connected communications between these components. The user interface 2003 may include a Display screen (Display), a Keyboard (Keyboard), and the optional user interface 2003 may further include a standard wired interface, a wireless interface, among others. The network interface 2004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 2005 may be a high-speed RAM memory or a nonvolatile memory (non-volatile memory), such as at least one magnetic disk memory. The memory 2005 may also optionally be at least one storage device located remotely from the aforementioned processor 2001. As shown in fig. 10, an operating system, a network communication module, a user interface module, and a device control application program may be included in the memory 2005 as one type of computer-readable storage medium.
In the computer device 2000 illustrated in fig. 10, the network interface 2004 may provide network communication functions; while user interface 2003 is primarily an interface for providing input to a user; and processor 2001 may be used to invoke device control applications stored in memory 2005 to implement:
When the second terminal is restored to the on-line state, transaction data and a target digital voucher asset are acquired from the second terminal; the transaction data are generated according to business transactions executed by the first terminal and the second terminal when the first terminal and the second terminal are both in an offline state; the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal, and the target digital voucher asset corresponds to the electronic resource of the first value;
transferring the first value of the electronic resource from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital voucher asset;
And returning the target digital certificate asset to the first terminal.
Optionally, the processor 2001 may be used to invoke a device control application stored in the memory 2005 to implement:
Acquiring a public key of the first terminal;
checking the signature of the first terminal by adopting the public key of the first terminal;
And if the signature of the first terminal passes the verification, executing the step of transferring the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital certificate asset.
Optionally, the processor 2001 may be used to invoke a device control application stored in the memory 2005 to implement:
Thawing the electronic resource in the frozen state in the account address of the first terminal to obtain a target electronic resource, wherein the target electronic resource has an association relationship with the target digital credential asset;
and transferring the electronic resource with the first value from the target electronic resource to the account address of the second terminal.
Optionally, the processor 2001 may be used to invoke a device control application stored in the memory 2005 to implement:
Acquiring an electronic resource associated with the freezing indication information in the account address of the first terminal as the electronic resource in a frozen state; the freeze indication information carries the signature of node equipment in the blockchain network; the freeze indication information is used for indicating that the electronic resource in the frozen state is refused to be transferred when the digital credential asset sent by the first terminal is not received and the signature of the node equipment is not checked and signed;
acquiring a public key of the node equipment, and checking a signature of the node equipment by adopting the public key of the node equipment;
if the signature of the node equipment passes the signature verification, the defrosting instruction information is recorded in the block chain network, the electronic resource in the frozen state is determined to be successfully defrosted, and the electronic resource which is successfully defrosted is determined to be the target electronic resource; the defrosting instruction information is used for instructing the node device to have a transfer authority to the target electronic resource.
Optionally, the processor 2001 may be used to invoke a device control application stored in the memory 2005 to implement:
acquiring attribute information of the first terminal;
Freezing target electronic resources in the account address of the first terminal according to the attribute information of the first terminal;
Generating at least two parts of digital voucher assets according to the target electronic resource, wherein the at least two parts of digital voucher assets comprise the target digital voucher asset;
And sending the at least two digital assets to the first terminal so that the first terminal stores the at least two digital assets.
Optionally, the processor 2001 may be used to invoke a device control application stored in the memory 2005 to implement:
Determining an upper limit value for freezing the electronic resource belonging to the first terminal according to the attribute information of the first terminal, wherein the attribute information of the first terminal comprises a credit grade of a terminal user corresponding to the first terminal or a transaction type of a historical business transaction executed by the first terminal as a second value;
and determining the electronic resource with the second value in the account address of the first terminal as a target electronic resource, and freezing the target electronic resource.
Optionally, the processor 2001 may be used to invoke a device control application stored in the memory 2005 to implement:
generating the freezing indication information and establishing an association relation between the freezing indication information and the target electronic resource;
Acquiring a private key of the node equipment, and signing the freeze indication information by adopting the private key of the node equipment to obtain the freeze indication information carrying the signature of the node equipment;
and uploading the freezing indication information carrying the signature of the node equipment to the blockchain network according to the association relation.
Optionally, the processor 2001 may be used to invoke a device control application stored in the memory 2005 to implement:
Freezing the electronic resource corresponding to the target digital voucher asset in the account address of the first terminal, and returning the target digital voucher asset to the first terminal; or alternatively
Setting the state of the target digital voucher asset to be invalid, and returning the target digital voucher asset with the invalid state to the first terminal.
Optionally, the processor 2001 may be used to invoke a device control application stored in the memory 2005 to implement:
If the value of the electronic resource in the account address of the first terminal is smaller than the first value, pre-transferring the electronic resource with the first value from the account address of the node equipment to the account address of the second terminal;
Generating pre-transfer information, and recording the pre-transfer information into the blockchain network, wherein the pre-transfer information is used for indicating the first terminal to transfer the electronic resource with the first value to the node equipment.
In the application, when the first terminal and the second terminal are both in an offline state, the first terminal can generate transaction data according to the business transaction executed between the first terminal and the second terminal, the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal, and a target digital credential asset corresponding to the electronic resource of the first value is acquired. The first terminal transmits the target digital certificate asset and the transaction data to the second terminal in an offline manner; when the second terminal resumes the online state, node devices in the blockchain network may obtain the target digital asset credential and transaction data from the second terminal. The node device can transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal according to the target digital asset certificate and the transaction data; the target digital asset credential is returned to the first terminal. When the first terminal and the second terminal are in an offline state, the first terminal sends the target digital certificate asset and transaction data to the second terminal in an offline transmission mode, and after the second terminal is in an online state, the second terminal can finish the transfer of electronic resources through node equipment in the blockchain network; the problem of electronic resource transfer failure caused by poor network quality can be effectively avoided, and the transfer success rate of the electronic resource can be improved. In addition, the electronic resource transfer is realized through the node equipment of the blockchain network, the participation of a third party mechanism is not needed, and the safety and the transparency of the electronic resource transfer can be improved.
It should be understood that the computer device 2000 in the embodiment of the present application may perform the description of the above-mentioned blockchain-based data processing method in the embodiment corresponding to fig. 3, and may also perform the description of the above-mentioned blockchain-based data processing apparatus in the embodiment corresponding to fig. 8, which is not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present application further provides a computer readable storage medium, in which the aforementioned computer programs executed by the blockchain-based data processing device 1 and the blockchain-based data processing device 2 are stored, and the computer programs include program instructions, when the processor executes the program instructions, the description of the blockchain-based data processing method in the embodiment corresponding to fig. 3 can be executed, and therefore, will not be repeated herein.
In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application. As an example, the program instructions may be executed on one computer device or on multiple computer devices located at one site, or on multiple computer devices distributed across multiple sites and interconnected by a communication network, which may constitute a blockchain network.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of computer programs, which may be stored on a computer-readable storage medium, and which, when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
The foregoing disclosure is illustrative of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.
Claims (14)
1. A blockchain-based data processing method, comprising:
generating transaction data by a first terminal according to business transaction executed between the first terminal and a second terminal, wherein the first terminal and the second terminal are both in an offline state, and the transaction data comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal;
Acquiring a target digital voucher asset corresponding to the electronic resource of the first value; the method comprises the steps that at least two parts of digital voucher assets are stored in a first terminal, the at least two parts of digital voucher assets comprise the target digital voucher assets, the at least two parts of digital voucher assets are generated by node equipment in a blockchain network according to target electronic resources and sent to the first terminal, the target electronic resources are electronic resources which have a second numerical value in account addresses of the first terminal and are frozen, and the second numerical value is an upper limit value for determining the electronic resources belonging to the first terminal according to attribute information of the first terminal;
Transmitting the target digital voucher asset and the transaction data offline to the second terminal, so that when the second terminal is restored to an online state, the transaction data and the target digital voucher asset are transmitted to node equipment of the blockchain network; the transaction data and the target digital voucher asset are used for instructing the node device to transfer the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal;
And when the first terminal is restored to the online state, acquiring the target digital credential asset returned by the node equipment.
2. The method of claim 1, wherein the first terminal generates transaction data based on a business transaction performed with the second terminal, comprising:
acquiring a business transaction executed between the first terminal and the second terminal, wherein the business transaction comprises a first value of an electronic resource to be transferred from the first terminal to the second terminal;
generating a key pair of the first terminal, wherein the key pair of the first terminal comprises a public key and a private key;
Signing the business transaction by adopting the private key of the first terminal to obtain the business transaction carrying the signature of the first terminal;
And determining the business transaction carrying the signature of the first terminal as the transaction data, wherein the signature of the first terminal is used for indicating the node equipment to verify the transaction data, and the verified transaction data and the target digital certificate asset are used for indicating the node equipment to transfer the electronic resource with the first value from the account address of the first terminal to the account address of the second terminal.
3. A blockchain-based data processing method, comprising:
Acquiring attribute information of a first terminal;
Determining an upper limit value for freezing the electronic resource belonging to the first terminal according to the attribute information of the first terminal as a second value;
Determining the electronic resource with the second value in the account address of the first terminal as a target electronic resource, and freezing the target electronic resource;
Generating at least two digital voucher assets according to the target electronic resource;
Sending the at least two digital assets to the first terminal so that the first terminal stores the at least two digital assets;
When the second terminal is restored to the online state, transaction data and a target digital credential asset are acquired from the second terminal; the transaction data are generated according to business transaction executed by the first terminal and the second terminal when the first terminal and the second terminal are in an offline state; the transaction data comprises a first numerical value of an electronic resource to be transferred from the first terminal to the second terminal, the target digital voucher asset corresponds to the electronic resource of the first numerical value, the target digital voucher asset is included in the at least two parts of digital voucher assets, and the target digital voucher asset and the transaction data are transmitted to the second terminal through offline by the first terminal;
Transferring the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital voucher asset;
And returning the target digital certificate asset to the first terminal.
4. A method according to claim 3, wherein the transaction data carries a signature of the first terminal, the method further comprising:
Acquiring a public key of the first terminal;
Signing the signature of the first terminal by adopting the public key of the first terminal;
And if the signature of the first terminal passes the verification, executing the step of transferring the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital certificate asset.
5. The method of claim 3, wherein transferring the first value of the electronic resource from the account address of the first terminal to the account address of the second terminal based on the transaction data and the target digital credential asset comprises:
Thawing the electronic resource in the frozen state in the account address of the first terminal to obtain a target electronic resource, wherein the target electronic resource has an association relationship with the target digital credential asset;
And transferring the electronic resource with the first value from the target electronic resource to the account address of the second terminal.
6. The method of claim 5, wherein thawing the frozen electronic resource in the account address of the first terminal to obtain the target electronic resource comprises:
Acquiring an electronic resource associated with the freezing indication information in the account address of the first terminal as the electronic resource in the frozen state; the freeze indication information carries a signature of a node device in a blockchain network; the freezing indication information is used for indicating that the electronic resource in the frozen state is refused to be transferred when the digital credential asset sent by the first terminal is not received and the signature of the node equipment is not checked and signed;
Acquiring a public key of the node equipment, and checking a signature of the node equipment by adopting the public key of the node equipment;
If the signature of the node equipment passes the signature verification, the defrosting indication information is recorded in the blockchain network, the electronic resource in the frozen state is determined to be successfully defrosted, and the electronic resource which is successfully defrosted is determined to be the target electronic resource; the defrosting indication information is used for indicating that the node equipment has the transfer authority to the target electronic resource.
7. The method of claim 6, wherein the attribute information of the first terminal includes a credit level of a corresponding end user of the first terminal or a transaction type of a historical business transaction performed by the first terminal.
8. The method of claim 6, wherein the freezing the target electronic resource comprises:
generating the freezing indication information and establishing an association relation between the freezing indication information and the target electronic resource;
The private key of the node equipment is obtained, the private key of the node equipment is adopted to sign the freezing indication information, and the freezing indication information carrying the signature of the node equipment is obtained;
and uploading freezing indication information carrying the signature of the node equipment to the blockchain network according to the association relation.
9. A method according to any of claims 3-8, wherein said returning the target digital voucher asset to the first terminal comprises:
Freezing an electronic resource corresponding to the target digital voucher asset in the account address of the first terminal, and returning the target digital voucher asset to the first terminal; or alternatively
And setting the state of the target digital voucher asset to be an invalid state, and returning the target digital voucher asset with the invalid state to the first terminal.
10. The method of claim 9, wherein the method further comprises:
If the value of the electronic resource in the account address of the first terminal is smaller than the first value, pre-transferring the electronic resource of the first value from the account address of the node equipment to the account address of the second terminal;
Generating pre-transfer information, and recording the pre-transfer information into the blockchain network, wherein the pre-transfer information is used for indicating the first terminal to transfer the electronic resource with the first value to the node equipment.
11. A blockchain-based data processing device, comprising:
The generation module is used for generating transaction data according to the business transaction executed between the first terminal and the second terminal, wherein the first terminal and the second terminal are both in an offline state, and the transaction data comprises a first numerical value of an electronic resource to be transferred from the first terminal to the second terminal;
The acquisition module is used for acquiring a target digital credential asset corresponding to the electronic resource of the first value; the method comprises the steps that at least two parts of digital voucher assets are stored in a first terminal, the at least two parts of digital voucher assets comprise the target digital voucher assets, the at least two parts of digital voucher assets are generated by node equipment in a blockchain network according to target electronic resources and sent to the first terminal, the target electronic resources are electronic resources which have a second numerical value in account addresses of the first terminal and are frozen, and the second numerical value is an upper limit value for determining the electronic resources belonging to the first terminal according to attribute information of the first terminal;
The transmission module is used for transmitting the target digital credential asset and the transaction data to the second terminal in an off-line mode, so that the transaction data and the target digital credential asset are transmitted to node equipment of the blockchain network when the second terminal is restored to an on-line state; the transaction data and the target digital voucher asset are used for instructing the node device to transfer the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal;
And the acquisition module is also used for acquiring the target digital credential asset returned by the node equipment when the first terminal is restored to the online state.
12. A blockchain-based data processing device, comprising:
the acquisition module is used for acquiring attribute information of the first terminal;
The freezing module is used for determining an upper limit value for freezing the electronic resource belonging to the first terminal according to the attribute information of the first terminal, and taking the upper limit value as a second value; determining the electronic resource with the second value in the account address of the first terminal as a target electronic resource, and freezing the target electronic resource; generating at least two digital voucher assets according to the target electronic resource; sending the at least two digital assets to the first terminal so that the first terminal stores the at least two digital assets;
The acquisition module is used for acquiring transaction data and target digital credential assets from the second terminal when the second terminal is restored to an online state; the transaction data are generated according to business transaction executed by the first terminal and the second terminal when the first terminal and the second terminal are in an offline state; the transaction data comprises a first numerical value of an electronic resource to be transferred from the first terminal to the second terminal, the target digital voucher asset corresponds to the electronic resource of the first numerical value, the target digital voucher asset is included in the at least two parts of digital voucher assets, and the target digital voucher asset and the transaction data are transmitted to the second terminal through offline by the first terminal;
A transfer module for transferring the electronic resource of the first value from the account address of the first terminal to the account address of the second terminal according to the transaction data and the target digital voucher asset;
And the return module is used for returning the target digital certificate asset to the first terminal.
13. A computer device, comprising: a processor, a memory, and a network interface;
The processor is connected with the memory and the network interface, wherein the network interface is used for providing a data communication function; the memory is for storing program code, the processor is for invoking the program code to perform the method of any of claims 1 to 10.
14. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the steps of the method according to any of claims 1 to 10.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010294769.4A CN111507839B (en) | 2020-04-15 | 2020-04-15 | Block chain-based data processing method, device, storage medium and equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010294769.4A CN111507839B (en) | 2020-04-15 | 2020-04-15 | Block chain-based data processing method, device, storage medium and equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111507839A CN111507839A (en) | 2020-08-07 |
| CN111507839B true CN111507839B (en) | 2024-07-19 |
Family
ID=71876142
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010294769.4A Active CN111507839B (en) | 2020-04-15 | 2020-04-15 | Block chain-based data processing method, device, storage medium and equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111507839B (en) |
Families Citing this family (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP4152161A4 (en) * | 2020-05-12 | 2023-07-12 | Fujitsu Limited | CONTROL METHOD, CONTROL PROGRAM AND INFORMATION PROCESSING DEVICE |
| CN114493871B (en) * | 2020-09-09 | 2025-11-07 | 腾讯科技(深圳)有限公司 | Data processing method, device, computer equipment and storage medium |
| CN112232790B (en) * | 2020-09-23 | 2023-10-20 | 中国银联股份有限公司 | Data transfer processing method, device, equipment and medium |
| CN112685185A (en) * | 2020-12-30 | 2021-04-20 | 南方电网数字电网研究院有限公司 | Resource transfer method, device, system, computer equipment and storage medium |
| CN113379549A (en) * | 2021-06-29 | 2021-09-10 | 杭州复杂美科技有限公司 | Asset extraction method, computer device, and storage medium |
| CN113592643B (en) * | 2021-06-29 | 2023-11-28 | 杭州复杂美科技有限公司 | Asset periodic thawing method, computer device and storage medium |
| CN116991936B (en) * | 2022-10-08 | 2025-08-26 | 腾讯科技(深圳)有限公司 | Blockchain-based equity certificate management method, device, electronic device, and medium |
| CN117032998B (en) * | 2023-10-09 | 2024-01-19 | 腾讯科技(深圳)有限公司 | Block chain-based data processing method and device and readable storage medium |
| CN117057807B (en) * | 2023-10-11 | 2024-02-09 | 腾讯科技(深圳)有限公司 | Resource processing method based on block chain architecture and related equipment |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110942300A (en) * | 2019-11-14 | 2020-03-31 | 杭州复杂美科技有限公司 | Transfer certificate submitting method, device and storage medium |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108805712B (en) * | 2018-05-29 | 2021-03-23 | 创新先进技术有限公司 | Fallback processing method and device for asset transfer, and electronic equipment |
| CN108898483A (en) * | 2018-05-29 | 2018-11-27 | 阿里巴巴集团控股有限公司 | Publication, exchanging method and its device, the electronic equipment of block chain assets |
| CN110659987A (en) * | 2018-06-28 | 2020-01-07 | 厦门本能管家科技有限公司 | Offline transaction method and system based on block chain |
| CN109472588A (en) * | 2018-10-29 | 2019-03-15 | 平安科技(深圳)有限公司 | A blockchain-based offline payment method, device, device and storage medium |
| CN110458542A (en) * | 2019-08-02 | 2019-11-15 | 中国工商银行股份有限公司 | Offline electronic payment system and method based on block chain |
-
2020
- 2020-04-15 CN CN202010294769.4A patent/CN111507839B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110942300A (en) * | 2019-11-14 | 2020-03-31 | 杭州复杂美科技有限公司 | Transfer certificate submitting method, device and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111507839A (en) | 2020-08-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111507839B (en) | Block chain-based data processing method, device, storage medium and equipment | |
| US20240296429A1 (en) | Information transaction infrastructure | |
| CN110892434B (en) | Transfer digital tickets based on blockchain network | |
| EP3509006B1 (en) | Information sharing system | |
| CN111476572B (en) | Block chain-based data processing method, device, storage medium and equipment | |
| KR101984254B1 (en) | Node device constituting a block-chain network and an operation method of the node device | |
| CN112381542B (en) | Transaction payment method, device, equipment and storage medium based on blockchain | |
| CN107545414B (en) | Anonymous transaction method, device and computer readable storage medium | |
| CN111444273B (en) | Data authorization method and device based on block chain | |
| CN111062717B (en) | Data transfer processing method, device and computer readable storage medium | |
| CN112613956B (en) | Bidding processing method and device | |
| US20220067717A1 (en) | Blockchain system that includes bank nodes each having separate ledgers for identity, digital currency and other functions, and operation method thereof | |
| US12450615B2 (en) | Method, terminal, and coin register for transmitting electronic coin data sets | |
| GB2572135A (en) | Data transaction system and method | |
| CN113269649A (en) | System and method for tracking digital currency | |
| CN106033571A (en) | Trading method of electronic signature devices, electronic signature devices and trading system | |
| KR20260006553A (en) | Chaining transactions to prevent fraud | |
| Muftic | Overview and analysis of the concept and applications of virtual currencies | |
| US20230237476A1 (en) | Electronic wallet, server for executing the same, and method for atomic exchange of blockchain tokens using the server | |
| CN113628050A (en) | Digital RMB delivery method, system, program product and storage medium | |
| CN113570369B (en) | Block chain privacy transaction method, device, equipment and readable storage medium | |
| CN115375316A (en) | Offline payment method, device and storage medium | |
| HK40027967A (en) | Data processing method and device based on block chain, storage medium and apparatus | |
| CN113159940A (en) | Transaction method, system and computer equipment for enhanced bit currency wallet | |
| EP4485324A1 (en) | Secure onboarding unit, electronic token transaction system, method of securely managing transactions and non-transitory computer readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40027967 Country of ref document: HK |
|
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| TG01 | Patent term adjustment | ||
| TG01 | Patent term adjustment |