CN110942301B - Data processing method and device based on block chain, computer and storage medium - Google Patents

Data processing method and device based on block chain, computer and storage medium Download PDF

Info

Publication number
CN110942301B
CN110942301B CN201911155823.0A CN201911155823A CN110942301B CN 110942301 B CN110942301 B CN 110942301B CN 201911155823 A CN201911155823 A CN 201911155823A CN 110942301 B CN110942301 B CN 110942301B
Authority
CN
China
Prior art keywords
data
transaction
transfer
node
receiving node
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
Application number
CN201911155823.0A
Other languages
Chinese (zh)
Other versions
CN110942301A (en
Inventor
李茂材
蓝虎
王宗友
时一防
朱耿良
周开班
刘区城
杨常青
黄焕坤
张劲松
刘攀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911155823.0A priority Critical patent/CN110942301B/en
Publication of CN110942301A publication Critical patent/CN110942301A/en
Application granted granted Critical
Publication of CN110942301B publication Critical patent/CN110942301B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3823Payment protocols; Details thereof insuring higher security of transaction combining multiple encryption tools for a transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

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 data processing method based on a block chain, which comprises the following steps: the receiving node packages the order information into an order identification code and displays the order identification code; the transfer node obtains order information by scanning the order identification code, and determines and displays the transaction identification code based on the order information; the receiving node scans the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext, decrypts the transaction information ciphertext by adopting a private key of the receiving node to obtain transaction data, and performs data transfer processing on the transaction data; if the transaction behavior data is successful, the receiving node generates transaction behavior data between the receiving node and the transfer node, and the transaction behavior data is added to the block chain. By adopting the method and the device, the transaction data of both transaction parties can be converted, so that the economic loss caused by directly displaying the transaction data is reduced, and the safety of electronic asset transaction is improved.

Description

Data processing method and device based on block chain, computer and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method and apparatus based on a block chain, a computer, and a storage medium.
Background
With the advent of electronic assets, since electronic assets are convenient and fast to use, expenses, benefits and the like are easy to count and view, and most stores can be operated through electronic assets (such as supermarkets, restaurants, clothing stores and the like), more and more people start to use the electronic assets in life. For different electronic asset use channels, each user has at least one electronic account of the use channel to store and manage own electronic assets, and when the user needs to consume, the electronic assets can be paid to a shop owner through the electronic accounts. At present, different use channels all have a payment interface, electronic asset transfer between a user and a shop owner can be realized between the user's electronic account and the shop owner's electronic account based on the payment interface, however, when the user displays the payment interface for the shop owner, and the electronic asset is not transferred to the shop owner, the payment interface is in a display state, so that the payment interface is easily acquired by other people, and part of the electronic asset of the user is acquired based on the payment interface, thereby causing asset loss of the user, and reducing the security of electronic asset transaction through the payment interface.
Disclosure of Invention
The embodiment of the application provides a data processing method and device based on a block chain, which can improve the safety of electronic asset transaction.
A first aspect of the embodiments of the present application provides a data processing method based on a block chain, including:
the receiving node packages the order information into an order identification code, and the order identification code is displayed in a screen, so that the transfer node obtains the order information by scanning the order identification code; the order information comprises a public key of the receiving node and the data volume to be transferred;
scanning the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext; the transaction information ciphertext is a ciphertext generated by the transfer node based on the data amount to be transferred and a public key of the receiving node;
decrypting the transaction information ciphertext by adopting the private key of the receiving node to obtain transaction data, and performing data transfer processing on the transaction data to obtain a data transfer result;
and generating transaction behavior data between the receiving node and the transfer node according to the data transfer result, and adding the transaction behavior data into a block chain.
Wherein, the receiving node encapsulates the order information into an order identification code, including:
the receiving node generates a first digital signature of the order information through a private key of the receiving node;
and encapsulating the order information and the first digital signature into the order identification code, wherein the first digital signature is used for the transfer node to carry out identity verification on the receiving node.
The transaction data is generated by the transfer node based on a data transfer identification code and a transfer signature, the data transfer identification code is an identification code called by the transfer node from an account address of the transfer node based on the data volume to be transferred, the transfer signature is obtained by the transfer node by signing the data transfer identification code based on a private key of the transfer node, and the data transfer result comprises a data transfer success result and a data transfer failure result;
the data transfer processing of the transaction data to obtain a data transfer result includes:
acquiring the data transfer identification code and the transfer signature in the transaction data, checking the transfer signature according to a public key of the transfer node, and if the data transfer identification code passes the verification, performing data transfer processing on the data volume to be transferred based on the data transfer identification code;
and if the data transfer processing is successfully executed, determining that the data transfer result is a data transfer success result.
The transaction data are obtained by packaging initial transaction data and a transfer signature by the transfer node, the transfer signature is obtained by the transfer node signing the initial transaction data based on a private key of the transfer node, the initial transaction data comprise the data volume to be transferred, an asset source account address corresponding to the data volume to be transferred and an account address of the receiving node, and the data transfer result comprises a data transfer success result and a data transfer failure result;
the data transfer processing of the transaction data to obtain a data transfer result includes:
acquiring the initial transaction data and the transfer signature in the transaction data, and verifying the transfer signature according to the public key of the transfer node;
if the verification is passed, the transaction data are sent to a consensus node in the block chain, so that the consensus node generates a transfer block according to the transaction data, the transfer block is broadcasted to other consensus nodes, the transfer block is added to the block chain after the other consensus nodes verify the transfer block, and the data volume to be transferred in the transfer block is determined as the transferred data volume; the receiving node has data transfer use authority for the transferred data volume;
and if the transfer block is successfully added into the block chain, determining that the data transfer result is a data transfer success result.
Generating transaction behavior data between the receiving node and the transfer node according to the data transfer result, and adding the transaction behavior data into a block chain, wherein the generating of the transaction behavior data between the receiving node and the transfer node according to the data transfer result comprises:
if the data transfer result is the data transfer success result, determining the data volume to be transferred after data transfer processing as the transferred data volume, and acquiring the transferred data volume and the transaction behavior number corresponding to the data transfer identification code;
determining the transferred data volume, the transaction behavior number, a transaction business object matched with the transferred data volume in the order information, the account address of the receiving node and the account address of the transfer node as the transaction behavior data;
and generating a transaction block according to the transaction behavior data, broadcasting the transaction block to a consensus node in the block chain, and adding the transaction block to the block chain after the consensus node passes consensus verification.
Generating transaction behavior data between the receiving node and the transfer node according to the data transfer result, and adding the transaction behavior data into a block chain, wherein the generating of the transaction behavior data between the receiving node and the transfer node according to the data transfer result comprises:
if the data transfer result is the data transfer success result, acquiring a block identifier of the transfer block;
determining the transferred data volume, the block identifier and a transaction business object matched with the transferred data volume in the order information as the transaction behavior data;
and generating a transaction block according to the transaction behavior data, broadcasting the transaction block to a consensus node in the block chain, and adding the transaction block to the block chain after the consensus node passes consensus verification.
A second aspect of the present application provides a data processing method based on a block chain, including:
the transfer node scans the order identification code in the screen of the receiving node to obtain order information; the order information comprises a public key of a receiving node and a data volume to be transferred, and the order identification code is obtained by packaging the order information by the receiving node;
generating transaction data based on the data volume to be transferred and the public key of the receiving node, and encrypting the transaction data by adopting the public key of the receiving node to obtain a transaction information ciphertext, wherein the transaction data is used for data transfer processing of the receiving node;
packaging the transaction information ciphertext into a transaction identification code, displaying the transaction identification code on a screen so that the receiving node obtains the transaction information ciphertext by scanning the transaction identification code, decrypting the transaction information ciphertext by adopting a private key of the receiving node to obtain transaction data, and performing data transfer processing on the transaction data to obtain a data transfer result;
and checking transaction behavior data corresponding to the data transfer result in the block chain.
The order identification code carries a first digital signature;
the method further comprises the following steps:
and scanning the order identification code to obtain the first digital signature, verifying the first digital signature based on the public key of the receiving node, and if the first digital signature passes verification, executing the process of generating transaction data based on the data volume to be transferred and the public key of the receiving node.
Wherein the generating transaction data based on the amount of data to be transferred and the public key of the receiving node comprises:
calling the account address of the transfer node based on the data volume to be transferred to obtain a data transfer identification code;
signing the data transfer identification code based on a private key of the transfer node to obtain a transfer signature;
and encapsulating the data transfer identification code and the transfer signature into the transaction data.
Wherein the generating transaction data based on the amount of data to be transferred and the public key of the receiving node comprises:
acquiring the data volume to be transferred, an asset source account address corresponding to the data volume to be transferred and an account address of the receiving node;
generating initial transaction data according to the data volume to be transferred, the asset source account address corresponding to the data volume to be transferred and the account address of the receiving node, and signing the initial transaction data by adopting a private key of the transferring node to obtain a transfer signature, wherein the asset source account address and the account address of the receiving node are used for realizing data transfer processing between the transferring node and the receiving node;
encapsulating the initial transaction data and the transfer signature into the transaction data.
Wherein, the obtaining the data volume to be transferred includes:
and acquiring an asset source account ciphertext to be transferred from the asset source account pointed by the asset source account address, and decrypting the asset ciphertext to be transferred based on the private key of the transfer node to obtain the data volume to be transferred.
A third aspect of the embodiments of the present application provides a data processing apparatus based on a block chain, where the apparatus includes:
the packaging module is used for packaging the order information into an order identification code by the receiving node; the order information comprises a public key of the receiving node and the data volume to be transferred;
the display module is used for displaying the order identification code in a screen so that the transfer node can obtain the order information by scanning the order identification code;
the scanning module is used for scanning the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext; the transaction information ciphertext is a ciphertext generated by the transfer node based on the data volume to be transferred and a public key of the receiving node;
the decryption module is used for decrypting the transaction information ciphertext by adopting the private key of the receiving node to obtain transaction data;
the transfer module is used for carrying out data transfer processing on the transaction data to obtain a data transfer result;
and the generating module is used for generating transaction behavior data between the receiving node and the transfer node according to the data transfer result and adding the transaction behavior data to the block chain.
Wherein, the encapsulation module includes:
the first generation unit is used for generating a first digital signature of the order information by the receiving node through a private key of the receiving node;
and the packaging unit is used for packaging the order information and the first digital signature into the order identification code, and the first digital signature is used for the transfer node to carry out identity verification on the receiving node.
The transaction data is generated by the transfer node based on a data transfer identification code and a transfer signature, the data transfer identification code is an identification code called by the transfer node from an account address of the transfer node based on the data volume to be transferred, the transfer signature is obtained by the transfer node by signing the data transfer identification code based on a private key of the transfer node, and the data transfer result comprises a data transfer success result and a data transfer failure result;
the transfer module includes:
the signature verification unit is used for acquiring the data transfer identification code and the transfer signature in the transaction data and verifying the signature of the transfer signature according to the public key of the transfer node;
the transfer unit is used for carrying out data transfer processing on the data volume to be transferred based on the data transfer identification code if the verification is passed;
and the determining unit is used for determining that the data transfer result is a data transfer success result if the data transfer processing is successfully executed.
The transaction data are obtained by packaging initial transaction data and a transfer signature by the transfer node, the transfer signature is obtained by the transfer node signing the initial transaction data based on a private key of the transfer node, the initial transaction data comprise the data volume to be transferred, an asset source account address corresponding to the data volume to be transferred and an account address of the receiving node, and the data transfer result comprises a data transfer success result and a data transfer failure result;
the transfer module includes:
the signature verification unit is further configured to acquire the initial transaction data and the transfer signature in the transaction data, and verify the signature of the transfer signature according to the public key of the transfer node;
a second generation unit, configured to send the transaction data to a consensus node in the block chain if the verification passes, so that the consensus node generates a transfer block according to the transaction data, broadcasts the transfer block to other consensus nodes, adds the transfer block to the block chain after the other consensus nodes verify that the transfer block passes the consensus verification, and determines the amount of data to be transferred in the transfer block as the amount of transferred data; the receiving node has data transfer use authority for the transferred data volume;
the determining unit is further configured to determine that the data transfer result is a data transfer success result if the transfer block is successfully added to the block chain.
Wherein the generating module comprises:
the first acquisition unit is used for determining the data volume to be transferred after data transfer processing as the transferred data volume if the data transfer result is the data transfer success result, and acquiring the transferred data volume and the transaction behavior number corresponding to the data transfer identification code;
a determining unit, configured to determine the transferred data volume, the transaction behavior number, a transaction service object in the order information, the account address of the receiving node, and the account address of the transfer node, which are matched with the transferred data volume, as the transaction behavior data;
and the third generating unit is used for generating a transaction block according to the transaction behavior data, broadcasting the transaction block to a consensus node in the block chain, and adding the transaction block to the block chain after the consensus node passes consensus verification.
Wherein the generating module further comprises:
a second obtaining unit, configured to obtain a block identifier of the transfer block if the data transfer result is the data transfer success result;
the determining unit is further configured to determine the transferred data volume, the block identifier, and a transaction service object in the order information, which matches the transferred data volume, as the transaction behavior data;
and the third generating unit is used for generating a transaction block according to the transaction behavior data, broadcasting the transaction block to a consensus node in the block chain, and adding the transaction block to the block chain after the consensus node passes consensus verification.
A fourth aspect of the present embodiment provides a data processing apparatus based on a block chain, where the apparatus includes:
the scanning module is used for scanning the order identification code in the screen of the receiving node by the transfer node to obtain order information; the order information comprises a public key of a receiving node and data volume to be transferred, and the order identification code is obtained by packaging the order information by the receiving node;
the generating module is used for generating transaction data based on the data volume to be transferred and the public key of the receiving node, and the transaction data is used for data transfer processing of the receiving node;
the encryption module is used for encrypting the transaction data by adopting the public key of the receiving node to obtain a transaction information ciphertext;
the packaging module is used for packaging the transaction information ciphertext into a transaction identification code, displaying the transaction identification code on a screen, enabling the receiving node to obtain the transaction information ciphertext by scanning the transaction identification code, decrypting the transaction information ciphertext by adopting a private key of the receiving node to obtain transaction data, and performing data transfer processing on the transaction data to obtain a data transfer result;
and the checking module is used for checking the transaction behavior data corresponding to the data transfer result in the blockchain.
The order identification code carries a first digital signature;
the device further comprises:
the scanning module is further used for scanning the order identification code to obtain the first digital signature;
and the signature verification module is used for verifying the signature of the first digital signature based on the public key of the receiving node, and if the signature passes the verification, executing the process of generating transaction data based on the data volume to be transferred and the public key of the receiving node.
Wherein the generating module comprises:
the first acquisition unit is used for calling and obtaining a data transfer identification code from the account address of the transfer node based on the data volume to be transferred;
the signature unit is used for signing the data transfer identification code based on the private key of the transfer node to obtain a transfer signature;
and the packaging unit is used for packaging the data transfer identification code and the transfer signature into the transaction data.
Wherein the generating module further comprises:
a second obtaining unit, configured to obtain the data volume to be transferred, an asset source account address corresponding to the data volume to be transferred, and an account address of the receiving node;
a generating unit, configured to generate initial transaction data according to the data volume to be transferred, an asset source account address corresponding to the data volume to be transferred, and an account address of the receiving node, and sign the initial transaction data with a private key of the transferring node to obtain the transfer signature, where the asset source account address and the account address of the receiving node are used to implement data transfer processing between the transferring node and the receiving node;
the packaging unit is further configured to package the initial transaction data and the transfer signature into the transaction data.
In the aspect of acquiring the amount of the data to be transferred, the second acquiring unit is specifically configured to:
and acquiring an asset source account ciphertext to be transferred from the asset source account pointed by the asset source account address, and decrypting the asset ciphertext to be transferred based on the private key of the transfer node to obtain the data volume to be transferred.
A fifth aspect of an embodiment of the present application provides a computer device, including a processor, a memory, and an input/output interface;
the processor is connected to the memory and the input/output interface, respectively, where the input/output interface is used for inputting data and outputting data, the memory is used for storing program codes, and the processor is used for calling the program codes to execute the block chain-based data processing method as described in the first aspect of the embodiment of the present application or the second aspect of the embodiment of the present application.
A sixth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program, where the computer program includes program instructions, and the program instructions, when executed by a processor, perform a method for processing data based on a blockchain as described in the first aspect of embodiments of the present application or the second aspect of embodiments of the present application.
The embodiment of the application has the following beneficial effects:
the method comprises the steps that order information is packaged into an order identification code through a receiving node, and the order identification code is displayed in a screen, wherein the order information comprises a public key of the receiving node and the data volume to be transferred; the transfer node scans the order identification code to obtain order information; the transfer node determines transaction data based on the order information, encrypts the transaction data through a public key of the receiving node to obtain a transaction information ciphertext, and encapsulates the transaction information ciphertext into a transaction identification code; the receiving node scans the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext, decrypts the transaction information ciphertext based on a private key of the receiving node to obtain transaction data, performs data transfer processing on the transaction data, generates transaction behavior data between the receiving node and the transfer node if the data transfer processing is successfully performed, and adds the transaction behavior data to the block chain. According to the method and the device, the data generated in the transaction between the two transaction parties are encrypted or signed, so that the data transmitted between the two transaction parties are processed, the original data cannot be directly displayed, the situation that other people illegally acquire transaction assets from the two transaction parties by acquiring the original data is avoided, the economic loss caused by directly displaying the transaction data is reduced, and the security of electronic asset transaction is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a block chain-based data processing architecture diagram provided in an embodiment of the present application;
fig. 2 is a flowchart of a data processing method based on a block chain according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an order identifier generation process provided by an embodiment of the present application;
fig. 4 is a flowchart of another block chain-based data processing method provided in an embodiment of the present application;
fig. 5 is a schematic diagram illustrating a block chain-based data processing interaction flow according to an embodiment of the present application;
fig. 6 is a schematic diagram of an order information generating and processing process according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of an order information identification process provided in an embodiment of the present application;
fig. 8 is a schematic diagram of an order verification of order information provided in an embodiment of the present application;
FIG. 9a is a schematic diagram of a first transaction data generation process provided by an embodiment of the present application;
FIG. 9b is a schematic diagram of a second transaction data generation process provided by an embodiment of the present application;
FIG. 10 is a diagram illustrating an existing data transfer method provided by an embodiment of the present application;
fig. 11 is a schematic diagram of a data processing apparatus based on a block chain according to an embodiment of the present application;
fig. 12 is a schematic diagram of another block chain-based data processing apparatus according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Specifically, referring to fig. 1, fig. 1 is a block chain-based data processing architecture diagram provided in an embodiment of the present application, and as shown in fig. 1, a transaction occurs between a receiving node 101 and a transfer node 102, and data transfer needs to be performed between the two nodes, that is, the receiving node 101 needs to acquire data related to the transaction from the transfer node 102, then the receiving node 101 packages order information into an order identification code, and the order identification code is displayed in a screen of the receiving node 101. The transfer node 102 scans the order identification code to obtain order information, so as to determine that the order information is an order for transaction between the transfer node 102 and the receiving node 101, determines transaction data based on the order information and/or a payment interface of the transfer node 102, encrypts the transaction data by using a public key of the receiving node 101 to obtain a transaction information ciphertext, packages the transaction information ciphertext into the transaction identification code, and displays the transaction identification code on a screen. The receiving node 101 scans the transaction identification code to obtain a transaction information ciphertext, decrypts the transaction information ciphertext by using a private key of the receiving node 101 to obtain transaction data, and performs data transfer processing on the transaction data, that is, obtains a data volume corresponding to the order information from an account of the transferring node 102, and stores the data volume into the account of the receiving node 101. If the receiving node 101 successfully executes the data transfer process, transaction behavior data between the receiving node 101 and the transfer node 102 is generated, and the transaction behavior data is added to the block chain. In the application, the order identification code displayed by the receiving node 101 and the transaction identification code displayed by the transfer node 102 are generated by conversion based on data generated in the transaction process between the receiving node 101 and the transfer node 102, instead of directly displaying and interacting the original data, so that other users cannot obtain the original data, namely after the data displayed by the receiving node 101 or the transfer node 102 is obtained, the obtained data cannot be analyzed, which is equivalent to that the obtained data is useless data, thereby avoiding the situation that other users illegally obtain the electronic asset of the transfer node 102 by obtaining the displayed original data, and further reducing economic loss possibly caused in the electronic transaction process to a certain extent, and further improving the security of electronic asset transaction.
The display device of the receiving node 101 and the display device of the transferring node 102 are both electronic devices, including but not limited to a mobile phone, a tablet computer, a desktop computer, a notebook computer, a palm computer, a Mobile Internet Device (MID), a wearable device (e.g., a smart watch, a smart band, etc.), and the like.
Further, please refer to fig. 2, where fig. 2 is a flowchart of a data processing method based on a block chain according to an embodiment of the present application. As shown in fig. 2, the receiving node is mainly used for description, and the data processing procedure based on the block chain includes the following steps:
step S201, the receiving node packages the order information into an order identification code, and the order identification code is displayed in a screen.
Specifically, the receiving node packages the order information into an order identification code, and the order identification code is displayed in a screen, so that the transfer node obtains the order information by scanning the order identification code; the order information includes the public key of the receiving node and the amount of data to be transferred. Specifically, when order transaction is to be performed between the receiving node and the transfer node, order information is obtained by counting orders transacted between the receiving node and the transfer node, and the order information is encapsulated to obtain an order identification code, so that other people cannot directly obtain order data transacted between the receiving node and the transfer node. Optionally, the order information may include specific order data in addition to the public key of the receiving node and the data size to be transferred.
Specifically, when a transaction occurs between the receiving node and the transfer node, the receiving node obtains each order obtained by the transfer node from a transaction party to which the receiving node belongs, and counts each order to obtain order information, wherein the transaction party may be a store (such as a clothing store, a supermarket, a restaurant, a bookstore and the like) or a personal user (such as a moving booth boss or a payee). Optionally, when the transaction party and the transfer party perform a history negotiation transaction, that is, no transaction order appears between the receiving node and the transfer node in the current data transfer process, the receiving node obtains order information according to the history negotiation transaction, including obtaining the data amount to be transferred negotiated in the history negotiation transaction and the public key of the receiving node, without counting the order. And after the receiving node obtains the order information, packaging the order information to obtain an order identification code, and displaying the order identification code in a screen.
Specifically, referring to fig. 3, fig. 3 is a schematic diagram of an order identification code generation process provided in an embodiment of the present application. As shown in fig. 3, taking an order transaction between a receiving node and a transfer receiving node as an example, assuming that a transaction party is a clothing store, the transfer node goes to the clothing store for consumption, and finally selects 4 order commodities, including "order 1, order 2, order 3, and order 4", the receiving node 301 scans each order commodity 303 through an external identification device 302 to count each order commodity 303 until the last order commodity 303 is scanned, and the receiving node 301 obtains related information of each order commodity 303, optionally, the related information of each order commodity 303 may be displayed in an order counting page 304, where the order counting page 304 may display an order number, an order name, an order unit price, an order quantity, an order transaction amount, and the like of each order commodity 303. After the receiving node 301 obtains the four order commodities selected by the transfer node, the order statistics page 304 displays the relevant information of each order commodity 303, including "order number 1245 × 456, order name 1, order unit price 69.8, order quantity of transaction 1, and order transaction amount 69.8; order number 2646 × 412, order name 2, order unit price 102, number of orders traded 2, order trade amount 204; order number 1658 x 159, order name 3, order unit price 39.9, number of orders traded 1, amount of orders traded 39.9; the order number 4658 is 562, the order name is order 4, the order unit price is 89, the number of orders traded is 3, the order trade amount is 267 ", and statistics on the relevant information of each order commodity 303 is performed, so that the total commodity price of all order commodities is 580.7.
The receiving node 301 collates all data displayed in the order statistics page 304, determines the total commodity price of the order commodity as the data volume to be transferred, where the data volume to be transferred is 580.7, acquires the public key 305 of the receiving node 301, determines the order information 306 according to the data volume to be transferred and the public key 305 of the receiving node 301, and encapsulates the order information 306 into the order identification code 3071, optionally, the order information 306 may further include related information of each order commodity 303, that is, determines the order information 306 according to all data displayed in the order statistics page 304 and the public key 305 of the receiving node 301, where all data displayed in the order statistics page 304 includes the data volume to be transferred, and the data volume to be transferred is the total commodity price of the order displayed in the order statistics page 304. The order identification code 3071 may be a two-dimensional code as shown in fig. 3, or may be other identification codes such as a barcode that can carry data, the order identification code 3071 is displayed on the screen 307 of the receiving node 301, and the screen 307 of the receiving node 301 may be an external display device of the receiving node 301, or a display screen of the receiving node 301 itself.
Step S202, the transaction identification code in the screen of the transfer node is scanned to obtain a transaction information ciphertext.
Specifically, the receiving node scans the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext; the transaction information ciphertext is a ciphertext generated by the transfer node based on the amount of data to be transferred and the public key of the receiving node. Specifically, the receiving node scans the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext packaged by the transaction identification code, wherein the transaction information ciphertext is obtained by encrypting transaction data by the transfer node by using the public key of the receiving node. The transaction information ciphertext is obtained by encrypting the transaction data by using the public key of the receiving node, so that the transaction data can be obtained by analyzing only the receiving node after the transaction data ciphertext is obtained, and other users can only obtain the transaction information ciphertext but cannot obtain the transaction data packaged by the transaction information ciphertext even if scanning the transaction identification code.
And step S203, decrypting the transaction information ciphertext by using the private key of the receiving node to obtain transaction data, and performing data transfer processing on the transaction data to obtain a data transfer result.
Specifically, the receiving node decrypts the transaction information ciphertext by using a private key of the receiving node to obtain transaction data, and performs data transfer processing on the transaction data. Specifically, after the receiving node decrypts the transaction information ciphertext, transaction data corresponding to the transaction information ciphertext is obtained, each data included in the transaction data is obtained, data transfer processing is performed according to the data included in the transaction data, and a data transfer result of the data transfer processing is obtained, wherein the data transfer result includes a data transfer success result and a data transfer failure result. In one case, the transaction data is generated according to a data transfer identification code, when a receiving node acquires the data transfer identification code in the transaction data, the data transfer identification code is identified, according to the data volume to be transferred in the determined order information, an electronic asset with the same data volume as the data volume to be transferred is acquired from an electronic account of the transferring node, and the electronic asset is added into the electronic account of the receiving node to realize data transfer processing; in another case, the transaction data is determined according to the account address of the receiving node, the account address of the transfer node, and the amount of data to be transferred, after the receiving node acquires the transaction data, the account address of the receiving node, the account address of the transfer node, and the amount of data to be transferred are uplink-linked, the amount of data to be transferred is determined as the transferred amount of data in the block chain, that is, the affiliation of the amount of data of the part where the data transfer occurs is changed, the owner of the transferred amount of data is changed to the receiving node, so that the data transfer process based on the transaction data is realized, and the data transfer process is a chain forwarding account process. If the data transfer process is successfully executed, determining that the data transfer result is a data transfer success result, and executing step S204; and if the data transfer processing fails, determining that the data transfer result is a data transfer failure result, displaying a data transfer failure prompt, and sending a data transfer failure message to the transfer node.
Step S204, transaction behavior data is generated according to the data transfer result, and the transaction behavior data between the receiving node and the transfer node is added into the block chain.
Specifically, if the data transfer result is a successful data transfer result, that is, the data transfer process is successfully executed, transaction behavior data between the receiving node and the transfer node is generated, and the transaction behavior data is added to the block chain. Specifically, after the data transfer processing process is successful, it is proved that the transaction occurring between the transfer node and the receiving node is successfully realized, transaction behavior data generated when the transaction is performed between the transfer node and the receiving node is arranged, the transaction behavior data at least includes related information of both parties of the transaction (i.e., related information of the receiving node and the transfer node) and order data of the transaction (e.g., data volume to be transferred included in the order information, i.e., data volume of the transfer occurring between the transfer node and the receiving node, etc.), the transaction behavior data is added to the block chain, and after the transaction is completed, specific data generated in the transaction process can be acquired from the block chain.
Further, please refer to fig. 4, wherein fig. 4 is a flowchart of another data processing method based on a block chain according to an embodiment of the present application. As shown in fig. 4, the data processing process based on the blockchain is described by taking the transfer node as a main body, and includes the following steps:
step S401, the transfer node scans the order identification code in the screen of the receiving node to obtain order information.
The step is an optional step, and the transfer node may perform the step, identify the order identification code displayed in the screen of the receiving node, or directly perform step S402. Specifically, the transfer node scans an order identification code in a screen of the receiving node to obtain order information; the order information comprises a public key of the receiving node and the data volume to be transferred, and the order identification code is obtained by packaging the order information by the receiving node. Specifically, the transfer node scans an order identification code displayed in a screen of the receiving node to obtain order information packaged in the order identification code, and obtains a data volume to be transferred in the order information, so that the transfer node can check the order information based on the data volume to be transferred in the order information to ensure that the order information is correct. Optionally, if the obtained order information includes related information of each order commodity in a transaction relationship between the receiving node and the transfer node, the transfer node may further check a specific order commodity included in the order information to determine that what is counted by the order information is really related consumption information of an object consumed by the transfer node at the receiving node.
Step S402, transaction data are generated based on the data volume to be transferred and the public key of the receiving node, and the transaction data are encrypted to obtain a transaction information ciphertext.
Specifically, the transfer node generates transaction data based on the data volume to be transferred and the public key of the receiving node, encrypts the transaction data by using the public key of the receiving node to obtain a transaction information ciphertext, and the transaction data is used for data transfer processing of the receiving node. In one case, the transfer node acquires a data transfer identification code based on the data volume to be transferred, generates transaction data according to the data transfer identification code, and encrypts the transaction data through the public key of the receiving node to obtain a transaction information ciphertext; and under the other condition, acquiring an asset source account address of the data volume to be transferred according to the data volume to be transferred, wherein the asset source account address is an account address of the transfer node, acquiring an account address of the receiving node, generating transaction data according to the account address of the transfer node, the account address of the receiving node and the data volume to be transferred, and encrypting the transaction data according to a public key of the receiving node to obtain a transaction information ciphertext.
And step S403, packaging the transaction information ciphertext into a transaction identification code, and displaying the transaction identification code on a screen.
Specifically, the transfer node encapsulates the transaction information ciphertext into a transaction identification code, the transaction identification code is displayed on a screen of the transfer node, so that the receiving node obtains the transaction information ciphertext by scanning the transaction identification code, decrypts the transaction information ciphertext by adopting a private key of the receiving node to obtain transaction data, and performs data transfer processing on the transaction data to obtain a data transfer result. The transaction identification code can be a two-dimensional code or a bar code or other coding modes capable of storing data. For example, when the transaction identification code is a two-dimensional code, the transaction information ciphertext is packaged to obtain the transaction two-dimensional code, the transaction two-dimensional code records the transaction information ciphertext through black and white alternate graphs distributed on a plane by a specific geometric graph, after the transaction identification code is scanned by a receiving node, the distribution condition and the coding condition of the geometric graph in the transaction identification code can be directly identified to obtain the transaction information ciphertext carried in the transaction identification code, the transaction information ciphertext is decrypted by a private key of the receiving node to obtain transaction data, and the transaction data is subjected to data transfer processing to obtain a data transfer result.
Step S404, the transaction behavior data corresponding to the data transfer result is checked in the block chain.
Specifically, when the data transfer result is a data transfer success result, the receiving node adds the transaction behavior data between the receiving node and the transfer node into the block chain, and when the transfer node needs to check the data of the transaction, the transfer node can search a block related to the transaction from the block chain, and acquire the transaction behavior data generated between the receiving node and the transfer node in the transaction process from the block related to the transaction.
In the embodiment of the present application, a data processing process based on a blockchain is described by using fig. 2 and fig. 4, specifically, steps performed by a receiving node in the data processing process based on the blockchain are described by using fig. 2, and steps performed by a transferring node in the data processing process based on the blockchain are described by using fig. 4. The steps implemented in fig. 2 and 4 constitute a complete blockchain-based data processing process that encapsulates order information, including the public key of the receiving node and the amount of data to be transferred, into an order identification code by the receiving node, and displays the order identification code in a screen; the transfer node scans the order identification code to obtain order information; the transfer node determines transaction data based on the order information, encrypts the transaction data through a public key of the receiving node to obtain a transaction information ciphertext, and encapsulates the transaction information ciphertext into a transaction identification code; the receiving node scans the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext, decrypts the transaction information ciphertext based on a private key of the receiving node to obtain transaction data, performs data transfer processing on the transaction data, generates transaction behavior data between the receiving node and the transfer node if the data transfer processing is successfully performed, and adds the transaction behavior data to the block chain. According to the method and the device, the data generated in the transaction between the two transaction parties are encrypted or signed, so that the data transmitted between the two transaction parties are processed, the original data cannot be directly displayed, the situation that other people illegally acquire transaction assets from the two transaction parties by acquiring the original data is avoided, the economic loss caused by directly displaying the transaction data is reduced, and the security of electronic asset transaction is improved.
Further, referring to fig. 5, fig. 5 is a schematic diagram of a data processing interaction flow based on a blockchain according to an embodiment of the present application. As shown in fig. 5, the method comprises the following steps:
step S501, the receiving node packages the order information into an order identification code and displays the order identification code.
Specifically, the receiving node acquires order information of an order that is transacted with the transfer node, encapsulates the order information into an order identification code, and displays the order identification code in a screen of the receiving node, which may refer to the specific description of step S201 in fig. 2, and is not described herein again. Further, when the receiving node encapsulates the order information into the order identification code, a first digital signature of the order information is generated through a private key of the receiving node, the order information and the first digital signature are encapsulated into the order identification code, and the first digital signature can be used for the transfer node to perform identity verification on the receiving node. Optionally, the order block may be generated according to the order information, and the order block is uploaded to the block chain, so that the order information may be searched from the block chain in the following.
Further, referring to fig. 6, fig. 6 is a schematic diagram of an order information generating and processing process provided in the present application. As shown in fig. 6, the receiving node obtains an order commodity and a data volume to be transferred corresponding to the order commodity, generates order information according to the order commodity, a public key 601 of the receiving node and the data volume to be transferred, signs the order information through a private key 602 of the receiving node to obtain a first digital signature, packages the order information and the first digital signature to obtain an order identification code 603, and displays the order identification code 603 on a screen, so that the transferring node can scan the order identification code 603 to obtain the order information. Meanwhile, the receiving node may also generate an order block 604 according to the order information, and add the order block 604 to the block chain 605 after consensus. Each process indicated by a dotted line in the process shown in fig. 6 is an optional process, and the receiving node may also obtain order information directly according to the data volume to be transferred and the public key 601 of the receiving node, package the order information into an order identification code 603, and display the order identification code.
For example, referring to the example shown in fig. 3, the order information generated by the receiving node includes "data amount to be transferred 580.7, etc.," data amount to be transferred 580.7, etc., "determined as data in a block to obtain order block 604, and after the order block 604 is linked, the order block 604 may be obtained by obtaining the order block 604 from block chain 605 to obtain order information generated by a corresponding transaction of the block; if the order information generated by the receiving node includes "the data volume to be transferred 580.7 and the related information of each order commodity", after the chain is linked in the order block 604, the order block 604 is obtained from the block chain 605 to obtain the order information generated by the transaction corresponding to the block, such as the data volume corresponding to the object consumed by the transfer node and each object in the transaction.
Step S502, the transfer node scans the order identification code to obtain order information.
Specifically, the transfer node scans an order identification code displayed in a screen of the receiving node to obtain order information, wherein the order information at least comprises a public key of the receiving node and the data volume to be transferred. Optionally, if the order identification code further carries a first digital signature, the transfer node scans the order identification code to obtain order information and the first digital signature carried in the order identification code, performs signature verification on the first digital signature based on the public key of the receiving node, and if the first digital signature passes the verification, determines that the order information is not tampered, and executes step S503 to obtain the transaction data.
Specifically, referring to fig. 7, fig. 7 is a schematic diagram of an order information identification process provided in the embodiment of the present application. As shown in fig. 7, assuming that the order identification code is a two-dimensional code, the transfer node scans the order identification code based on the scanning page 701 to analyze the order identification code to obtain order information and a first digital signature carried in the order identification code, checks the first digital signature based on the public key 702 of the receiving node included in the order information, and displays the order information in the order display page 703 if the first digital signature passes the check, so that a user corresponding to the transfer node can determine the accuracy of the order information by checking the order information displayed in the order display page 703. Here, it is assumed that the order information further includes the data amount to be transferred and the related information of each order product, and the order information displayed in the order display page 703 can be shown by referring to the order information 704 in fig. 7. When the transfer node monitors the confirmation message for the order information 704, step S503 is executed.
The signature verification process of the first digital signature can directly decrypt the first digital signature based on the public key of the receiving node, the decrypted result is compared with the order information, if the decrypted result is the same as the order information, the signature verification is considered to be passed, and at the moment, the first digital signature is generated aiming at the order information according to the private key of the receiving node; or, the first digital signature is decrypted based on the public key of the receiving node to obtain a signature hash value, the order hash value of the order information is obtained, if the two hash values are the same, the signature verification is considered to be passed, and at this time, the first digital signature is generated according to the hash value of the private key of the receiving node for the order information. Specifically, reference may be made to fig. 8 for a process of performing signature verification based on a hash value, which is a schematic diagram of signature verification of order information provided in the embodiment of the present application. As shown in fig. 8, after the transfer node 801 obtains the data 802 carried by the order identification code by scanning the order identification code, the data 802 carried by the order identification code includes order information and a first digital signature generated by the receiving node based on a private key of the receiving node, extracts the first digital signature 803, decrypts the first digital signature 803 by using a public key 804 of the receiving node to obtain a signature hash value, and then the transfer node may perform hash operation on the order information by using a hash algorithm 805 (the hash algorithm 805 is a hash algorithm used by the transfer node 801 to generate the first digital signature) to obtain an order hash value corresponding to the order information, and if the order hash value is equal to the signature hash value, it indicates that the order information is not tampered in the transmission process, and the signature passes the verification; and if the order hash value is not equal to the signature hash value, the fact that the actual data in the order information is possibly tampered in the transmission process is shown, the signature is not verified to pass, the order information is deleted, and an order information tampering prompt is sent to the receiving node.
Step S503, the transfer node determines the transaction data, obtains a transaction information ciphertext according to the transaction data, and encapsulates the transaction information ciphertext into a transaction identification code.
Specifically, the transfer node generates transaction data based on the data volume to be transferred and a public key of the receiving node, encrypts the transaction data by using the public key of the receiving node to obtain a transaction information ciphertext, packages the transaction information ciphertext into a transaction identification code, and displays the transaction identification code on a screen, so that the receiving node can obtain the transaction information ciphertext by scanning the transaction identification code, and the transaction data is used for data transfer processing of the receiving node.
Specifically, under the condition of generating first transaction data, the transfer node calls a data transfer identification code from an account address of the transfer node based on the data volume to be transferred to obtain the data transfer identification code, the data transfer identification code is packaged into transaction data, and the public key of the receiving node is adopted to encrypt the transaction data to obtain a transaction information ciphertext; optionally, the data transfer identification code may be signed based on a private key of the transfer node to obtain a transfer signature, the data transfer identification code and the transfer signature are packaged into transaction data, the transaction data is encrypted by using a public key of the receiving node to obtain a transaction information ciphertext, and the transaction information ciphertext is packaged into the transaction identification code. Specifically, referring to fig. 9a, fig. 9a is a schematic diagram of a first transaction identification code generation process provided by the present application, as shown in fig. 9a, taking a case that transaction data includes a transfer signature as an example, when a transfer node determines that the order information is accurate, a data transfer identification code 901 corresponding to the transfer node is obtained, the data transfer identification code 901 is signed based on a private key 902 of the transfer node to obtain the transfer signature, the transfer signature and the data transfer identification code 901 are packaged into transaction data, the transaction data is encrypted based on a public key 903 of a receiving node to obtain a transaction information ciphertext, the transaction information ciphertext is packaged into a transaction identification code 904, the transaction identification code 904 is displayed in a data transfer page 905, so that the receiving node can obtain the transaction ciphertext carried by the transaction identification code 904 by scanning the transaction identification code 904 in a data transfer page 905 on a screen of the transfer node, and the transaction information ciphertext can be decrypted based on the private key of the receiving node to obtain transaction data, and the transaction data is subjected to data transfer processing to obtain a data transfer result.
For example, when the transfer node acquires the clothing from the receiving node, the transfer node needs to transfer 580.7 yuan to the receiving node after statistics, that is, the amount of data to be transferred is 580.7. The transfer node acquires its own data transfer identification code 901, after the data transfer identification code 901 is scanned and identified, the electronic device scanning and identifying the data transfer identification code 901 can acquire the data in the account corresponding to the transfer node to which the data transfer identification code 901 belongs, that is, the amount of money in the account of the transfer node, so that the data transfer identification code is encrypted by using the public key of the receiving node to obtain a transaction information ciphertext, the transaction data at this time is the data transfer identification code, because the transaction information ciphertext is obtained by encrypting the data transfer identification code based on the public key of the receiving node, only the private key of the receiving node can decrypt the transaction information ciphertext to obtain the data transfer identification code of the transfer node, when the transfer node displays the transaction identification code obtained by packaging according to the transaction information ciphertext on a screen, even if the users except the receiving node can scan the transaction identification code, the users cannot decrypt the transaction information ciphertext because the transaction information ciphertext is obtained after the transaction identification code is scanned, and the users cannot illegally obtain the data of the transfer node.
Under the second transaction data generation condition, the transfer node acquires the data volume to be transferred, the asset source account address corresponding to the data volume to be transferred (namely, the account address of the transfer node) and the account address of the receiving node, generates initial transaction data according to the data volume to be transferred, the asset source account address corresponding to the data volume to be transferred and the account address of the receiving node, signs the initial transaction data by adopting a private key of the transfer node to obtain a transfer signature, and encapsulates the initial transaction data and the transfer signature into transaction data, wherein the asset source account address and the account address of the receiving node are used for realizing data transfer processing between the transfer node and the receiving node. Optionally, the transfer node obtains the asset ciphertext to be transferred from the asset source account pointed by the asset source account address, and decrypts the asset ciphertext to be transferred based on the private key of the transfer node to obtain the data volume to be transferred. Specifically, referring to fig. 9b, fig. 9b is a schematic diagram of a second transaction identification code generation process provided in this embodiment, as shown in fig. 9b, taking a case that the transaction data includes a transfer signature as an example, when the transfer node determines that the order information is accurate, obtaining a to-be-transferred data value 9061 in the order display page 906, obtaining a corresponding asset source account address 907 and an account address 908 of the receiving node according to the to-be-transferred data value 9061, obtaining an asset ciphertext 909 to be transferred from the asset source account address 907 based on the to-be-transferred data value 9061, decrypting the asset ciphertext 909 to be transferred based on the private key 910 of the transfer node to obtain a to-be-transferred data amount 911, generating initial transaction data 912 according to the asset source account address 907, the account address 908 of the receiving node, and the to-be-transferred data amount 911, signing the initial transaction data 912 by using the private key of the transfer node, obtaining a transfer signature, packaging the initial transaction data and the transfer signature into transaction data 913, encrypting the transaction data 913 according to a public key 914 of a receiving node to obtain a transaction information ciphertext, packaging the transaction information ciphertext into a transaction identification code 915, displaying the transaction identification code 915 in a data transfer page 916, so that the receiving node can obtain the transaction information ciphertext carried by the transaction identification code 915 by scanning the transaction identification code 915 in the data transfer page 916 of the transfer node screen, and can decrypt the transaction information ciphertext based on a private key of the receiving node to obtain the transaction data, and perform data transfer processing on the transaction data to obtain a data transfer result.
Step S504, the receiving node scans the transaction identification code to obtain transaction data.
Specifically, the receiving node scans the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext, and the transaction information ciphertext is decrypted by using a private key of the receiving node to obtain transaction data, wherein the transaction information ciphertext is a ciphertext generated by the transfer node based on the data volume to be transferred and a public key of the receiving node.
Specifically, under the condition of generating the first transaction data, the transaction data is obtained by packaging a data transfer identification code, or the transaction data is obtained by packaging a data transfer identification code and a transfer signature, the receiving node scans the transaction identification code to obtain a transaction information ciphertext, decrypts the transaction information ciphertext by using a private key of the receiving node to obtain the transaction data, and extracts and obtains the data transfer identification code in the transaction data or the data transfer identification code and the transfer signature, wherein the data transfer identification code is an identification code obtained by calling the transfer node from an account address of the transfer node based on the amount of data to be transferred.
Under the second transaction data generation condition, the transaction data is obtained by packaging initial transaction data or the initial transaction data and a transfer signature, the transfer signature is obtained by a transfer node by signing the initial transaction data based on a private key of the transfer node, the initial transaction data comprises the data volume to be transferred, an asset source account address corresponding to the data volume to be transferred and an account address of a receiving node, and after the transfer node obtains the transaction data, the data volume to be transferred, the asset source account address corresponding to the data volume to be transferred and the account address of the receiving node are obtained.
Specifically, referring to fig. 10, fig. 10 is a schematic diagram of a process for a receiving node to identify a transaction identification code according to an embodiment of the present disclosure. As shown in fig. 10, the transaction data is described based on that the transfer signature is not included in the transaction data, after the transfer node generates a transaction identification code and displays the transaction identification code in the data transfer page 1001, the receiving node scans the transaction identification code in the screen of the transfer node through the scanning page 1002 to obtain a transaction information ciphertext, and decrypts the transaction information ciphertext by using the private key 1003 of the receiving node to obtain the transaction data. Under the condition of the first transaction data, the receiving node can obtain a data transfer identification code 1004 corresponding to the transfer node according to the transaction data; in the case of the second transaction data, the receiving node may obtain the account address 1005 of the transfer node, the account address 1006 of the receiving node, and the amount 1007 of data to be transferred according to the transaction data. Optionally, if the transaction data further includes a transfer signature, the receiving node may further obtain the transfer signature in the transaction data under the two types of transaction data.
In step S505, the receiving node performs data transfer processing according to the transaction data.
Specifically, the receiving node performs data transfer processing according to the transaction data. Under the condition of first transaction data, acquiring a data transfer identification code in the transaction data, and performing data transfer processing on the data volume to be transferred based on the data transfer identification code, namely directly identifying the data transfer identification code to obtain an electronic asset in an account of a transfer node, wherein the total amount of the electronic asset is equal to the data volume to be transferred; or acquiring a data transfer identification code and a transfer signature in the transaction data, verifying the transfer signature according to a public key of a transfer node, and if the verification is passed, performing data transfer processing on the data volume to be transferred based on the data transfer identification code. Under the condition of the second transaction data, acquiring initial transaction data and a transfer signature in the transaction data, verifying and signing the transfer signature according to a public key of a transfer node, if the transaction data including the initial transaction data and the transfer signature passes verification, acquiring the transaction data including the initial transaction data and the transfer signature, broadcasting the transaction data to common nodes in a block chain, after any common node verifies the transaction data, generating a transfer block according to the transaction data by the common nodes, broadcasting the transfer block to other common nodes in the block chain system by the common nodes so that the other common nodes can commonly identify the transfer block, if the other common nodes can commonly identify the transfer block, adding the transfer block into the block chain by the common nodes, determining the data volume to be transferred in the transfer block as transferred data volume so as to realize chain transfer between a receiving node and the transfer node, the receiving node has data transfer usage rights for the transferred data amount.
Optionally, under the second transaction data condition, the receiving node may further encrypt the obtained data volume to be transferred according to the public key of the receiving node, to determine the amount of data to be transferred as the amount of transferred data, after adding to the block chain a transfer block generated from the initial transaction data (including the asset source account address, the account address of the receiving node, and the amount of transferred data determined by the amount of data to be transferred), the transfer block is used to indicate that the usage right of the amount of data in the transfer block belongs to the receiving node, in the case where the data amount in the transfer block is a transferred data amount obtained by encrypting the data amount to be transferred using the public key of the receiving node, the decryption and the use of the transferred data volume can be realized only by the private key of the receiving node, so that the transferred data volume can be obtained and used only by the receiving node.
Specifically, under the first transaction data condition, after the receiving node obtains the data transfer identification code, because the data transfer identification code is an interface for transferring data, the receiving node can directly obtain the electronic asset in the account of the transferring node according to the data transfer identification code, wherein the data transfer identification code is a payment interface for transferring money, such as a payment two-dimensional code in WeChat. For example, if the amount of the data to be transferred is 580.7, after the receiving node acquires the data transfer identification code, the receiving node may identify the data transfer identification code, acquire 580.7 yuan from the account of the transfer node corresponding to the data transfer identification code based on the amount of the data to be transferred, and store the acquired 580.7 yuan in the account of the receiving node, thereby implementing data transfer processing for the transaction data.
In the case of the second transaction data, after the receiving node obtains the initial transaction data in the transaction data, a transfer block is generated according to the initial transaction data, the transfer block is uploaded to a block chain, and if the transfer block is successfully linked, it indicates that the receiving node can use the data contained in the transfer block to implement chain forwarding. Optionally, after the receiving node obtains the initial transaction data, the electronic asset may also be obtained from the account of the transfer node based on the amount of data to be transferred according to the account address of the transfer node obtained in the initial transaction data, and the electronic asset is added to the account corresponding to the account address of the receiving node in the initial transaction data. For example, if the amount of data to be transferred is 580.7, a transfer block is generated according to the "account address of the receiving node, the account address of the transfer node, and 580.7", and the transfer block is added to a block chain, and after the transfer block is successfully linked, the transfer block indicates that the receiving node has the use right of the asset of 580.7 yuan contained in the transfer block, so as to realize data transfer processing according to transaction data; optionally, the receiving node may further obtain 580.7 yuan from the account pointed by the account address of the transfer node based on the amount of data to be transferred, and store 580.7 yuan into the account pointed by the account address of the receiving node, so as to implement data transfer processing according to the transaction data.
Step S506, if the receiving node successfully executes the data transfer process, the transaction behavior data is generated, and the transaction behavior data is added to the block chain.
Specifically, if the receiving node successfully executes the data transfer process, transaction behavior data is generated, and the transaction behavior data is added to the block chain. Determining the data volume to be transferred after data transfer processing as transferred data volume under the first transaction data, and acquiring transaction behavior numbers corresponding to the transferred data volume and the data transfer identification code; determining the transferred data volume, the transaction behavior number, the transaction business object matched with the transferred data volume in the order information, the account address of the receiving node and the account address of the transfer node as transaction behavior data; and generating a transaction block according to the transaction behavior data, broadcasting the transaction block to a consensus node in the block chain, and adding the transaction block to the block chain after the consensus node passes consensus verification. Under the condition of second transaction data, acquiring a block identifier of the transfer block; determining the transferred data volume, the block identifier and a transaction business object matched with the transferred data volume in the order information as transaction behavior data; and generating a transaction block according to the transaction behavior data, broadcasting the transaction block to a consensus node in the block chain, and adding the transaction block into the block chain after the consensus node passes consensus verification. Optionally, if the receiving node performs data transfer processing for the amount of data to be transferred based on the account address of the transfer node and the account address of the receiving node under the second transaction data condition, that is, under the condition that the transfer block is not generated, the generation process of the transaction behavior data may refer to the generation process of the transaction behavior data under the first transaction data condition, and generate a transaction block according to the transaction behavior data, broadcast the transaction block to the consensus node in the block chain for consensus, and add the transaction block to the block chain after the consensus verification passes.
In the case of the first transaction data, since the transaction data is generated by the data transfer identification code, it is optional that the process of generating the transaction identification code by the transfer node implemented in step S503 and the confirmation process of the order information between the receiving node and the transfer node implemented in steps S501 and S502 are implemented, and the order of implementation is not limited.
Optionally, under the second transaction data condition, the process of data transfer processing according to the transaction data may also be implemented by the transfer node. Specifically, in this implementation, after executing step S501 and step S502, the transfer node confirms the order information, the transfer node determines the transaction data, and the process of determining the transaction data may refer to the second transaction data generation process shown in step S503 in fig. 5. When a transfer node generates transaction data according to initial transaction data and a transfer signature, the transaction data is broadcasted to consensus nodes in a block chain, after any consensus node verifies the transaction data, the consensus nodes generate a transfer block according to the transaction data, the consensus nodes broadcast the transfer block to other consensus nodes in the block chain system so that the other consensus nodes perform consensus on the transfer block, if the other consensus nodes agree on the transfer block, the consensus nodes add the transfer block to the block chain, the data volume to be transferred in the transfer block is determined to be transferred data volume, and therefore the transfer on the chain between a receiving node and the transfer node is achieved, and the receiving node has a data transfer use authority for the transferred data volume. The process of determining the data volume to be transferred in the transfer block as the transferred data volume is to change the relationship of the data volume to be transferred, and change the data volume to be transferred with the transfer node as the receiving party into the transferred data volume with the receiving party as the receiving node, in other words, the receiving party corresponding to the data volume to be transferred is the transfer node and is changed into the transferred data volume with the transfer node as the transferring party and the receiving party as the receiving node.
The method comprises the steps that order information is packaged into an order identification code through a receiving node, the order identification code is displayed in a screen, and the order information comprises a public key of the receiving node and the data volume to be transferred; the transfer node scans the order identification code to obtain order information; the transfer node determines transaction data based on the order information, encrypts the transaction data through a public key of the receiving node to obtain a transaction information ciphertext, and encapsulates the transaction information ciphertext into a transaction identification code; the receiving node scans the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext, decrypts the transaction information ciphertext based on a private key of the receiving node to obtain transaction data, performs data transfer processing on the transaction data, generates transaction behavior data between the receiving node and the transfer node if the data transfer processing is successfully performed, and adds the transaction behavior data to the block chain. According to the method and the device, the data generated in the transaction between the two transaction parties are encrypted or signed, so that the data transmitted between the two transaction parties are processed, the original data cannot be directly displayed, the situation that other people illegally acquire transaction assets from the two transaction parties by acquiring the original data is avoided, the economic loss caused by directly displaying the transaction data is reduced, and the security of electronic asset transaction is improved. Meanwhile, the data generated in the transaction process between the transfer node and the receiving node can be linked up, so that the transfer node can trace back the transaction situation between the transfer node and the receiving node based on the digital signature generated by the private key of the receiving node, or the receiving node can trace back the transaction situation between the transfer node and the digital signature generated by the private key of the transfer node, and each transaction can be inquired in a block chain, and the possible subsequent transaction conflict is avoided.
Further, when a user performs consumption settlement after consuming, a data transfer page is generally opened in advance, and a data transfer identification code is called out, so that data transfer processing can be quickly realized, at the moment, if only a consumption object of the user scans the data transfer identification code based on a scanning page so as to obtain the number of assets consumed by the user from an account of the user, the user can smoothly realize transaction with the consumption object, if the user is waiting for payment, the data transfer identification code of the user is scanned by a third party based on the scanning page, and the data transfer identification code has no encryption measure, so that the assets can be illegally obtained from the account of the user after the third party scans the data transfer identification code, and the economic loss of the user is caused. After the method provided by the application is adopted, no matter the consumption object or the third party scans the data transfer identification code based on the scanning page 1002, the transaction information cryptograph is obtained, the transaction information ciphertext is obtained by encrypting the transaction data by using the public key of the receiving node (at this moment, the consumption object is the receiving node), so that only the receiving node can decrypt the transaction information ciphertext by using the private key of the receiving node, so as to obtain the transaction data, at the moment, even if the third party obtains the transaction information ciphertext, the third party cannot analyze the transaction information ciphertext and cannot obtain the assets of the user, thereby avoiding the situation that the third party illegally obtains the assets of other people, the economic loss of the user in transaction based on the electronic assets is reduced to a certain extent, and the security of the electronic asset transaction is further improved.
Referring to fig. 11, fig. 11 is a schematic diagram of a data processing apparatus based on a blockchain according to an embodiment of the present disclosure, and as shown in fig. 11, the data processing apparatus 110 based on a blockchain may be used in the computer device in the embodiment corresponding to fig. 2, specifically, the apparatus may include: the device comprises a packaging module 11a, a display module 12a, a scanning module 13a, a decryption module 14a, a transfer module 15a and a generation module 16 a.
The packaging module 11a is used for the receiving node to package the order information into an order identification code; the order information comprises a public key of the receiving node and the data volume to be transferred;
the display module 12a is configured to display the order identification code on a screen, so that the transfer node obtains the order information by scanning the order identification code;
the scanning module 13a is used for scanning the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext; the transaction information ciphertext is a ciphertext generated by the transfer node based on the data volume to be transferred and a public key of the receiving node;
the decryption module 14a is configured to decrypt the transaction information ciphertext by using the private key of the receiving node to obtain transaction data;
the transfer module 15a is configured to perform data transfer processing on the transaction data to obtain a data transfer result;
and the generating module 16a is configured to generate transaction behavior data between the receiving node and the transfer node according to the data transfer result, and add the transaction behavior data to the blockchain.
Wherein, the encapsulation module 11a includes:
a first generating unit 111a, configured to generate, by the receiving node, a first digital signature of the order information through a private key of the receiving node;
an encapsulating unit 112a, configured to encapsulate the order information and the first digital signature into the order identifier, where the first digital signature is used for the transfer node to authenticate the receiving node.
The transaction data is generated by the transfer node based on a data transfer identification code and a transfer signature, the data transfer identification code is an identification code called by the transfer node from an account address of the transfer node based on the data volume to be transferred, the transfer signature is obtained by the transfer node by signing the data transfer identification code based on a private key of the transfer node, and the data transfer result comprises a data transfer success result and a data transfer failure result;
the transfer module 15a includes:
the signature verification unit 151a is configured to acquire the data transfer identification code and the transfer signature in the transaction data, and verify the signature of the transfer signature according to the public key of the transfer node;
a transferring unit 152a, configured to perform data transfer processing on the data volume to be transferred based on the data transfer identification code if the verification passes;
the determining unit 153a is configured to determine that the data transfer result is a data transfer success result if the data transfer process is successfully executed.
The transaction data are obtained by packaging initial transaction data and a transfer signature by the transfer node, the transfer signature is obtained by the transfer node signing the initial transaction data based on a private key of the transfer node, the initial transaction data comprise the data volume to be transferred, an asset source account address corresponding to the data volume to be transferred and an account address of the receiving node, and the data transfer result comprises a data transfer success result and a data transfer failure result;
the transfer module 15a includes:
the signature verification unit 151a is further configured to obtain the initial transaction data and the transfer signature in the transaction data, and verify the signature of the transfer signature according to the public key of the transfer node;
a second generating unit 154a, configured to send the transaction data to a consensus node in the block chain if the verification is passed, so that the consensus node generates a transfer block according to the transaction data, broadcasts the transfer block to other consensus nodes in the block chain, adds the transfer block to the block chain after the other consensus nodes verify the transfer block, and determines the amount of data to be transferred in the transfer block as the amount of transferred data; the receiving node has data transfer use authority for the transferred data volume;
the determining unit 153a is further configured to determine that the data transfer result is a data transfer success result if the transfer block is successfully added to the block chain.
Wherein, the generating module 16a includes:
a first obtaining unit 161a, configured to determine, if the data transfer result is the data transfer success result, the data volume to be transferred after the data transfer process is the transferred data volume, and obtain a transaction behavior number corresponding to the transferred data volume and the data transfer identification code;
a determining unit 162a, configured to determine the transferred data volume, the transaction behavior number, a transaction service object in the order information, which matches the transferred data volume, an account address of the receiving node, and an account address of the transfer node as the transaction behavior data;
a third generating unit 163a, configured to generate a transaction block according to the transaction behavior data, broadcast the transaction block to a consensus node in the block chain, and add the transaction block to the block chain after the consensus node passes consensus verification.
Wherein, the generating module 16a further includes:
a second obtaining unit 164a, configured to obtain a block identifier of the transfer block if the data transfer result is the data transfer success result;
the determining unit 162a is further configured to determine, as the transaction behavior data, the transferred data amount, the block identifier, and a transaction service object in the order information, which matches the transferred data amount;
a third generating unit 163a, configured to generate a transaction block according to the transaction behavior data, broadcast the transaction block to a consensus node in the block chain, and add the transaction block to the block chain after the consensus node passes consensus verification.
Referring to fig. 12, fig. 12 is a schematic diagram of another block chain-based data processing apparatus provided in this embodiment of the present application, and as shown in fig. 12, the block chain-based data processing apparatus 120 may be used in the computer device in the embodiment corresponding to fig. 4, specifically, the apparatus may include: a scanning module 11b, a generating module 12b, an encrypting module 13b and a packaging module 14 b.
The scanning module 11b is used for scanning the order identification code in the screen of the receiving node by the transfer node to obtain order information; the order information comprises a public key of a receiving node and a data volume to be transferred, and the order identification code is obtained by packaging the order information by the receiving node;
a generating module 12b, configured to generate transaction data based on the data amount to be transferred and the public key of the receiving node, where the transaction data is used for the receiving node to perform data transfer processing;
the encryption module 13b is configured to encrypt the transaction data by using the public key of the receiving node to obtain a transaction information ciphertext;
the packaging module 14b is configured to package the transaction information ciphertext into a transaction identification code, display the transaction identification code on a screen, so that the receiving node obtains the transaction information ciphertext by scanning the transaction identification code, decrypt the transaction information ciphertext by using a private key of the receiving node to obtain transaction data, and perform data transfer processing on the transaction data to obtain a data transfer result;
and the viewing module 15b is configured to view transaction behavior data corresponding to the data transfer result in the blockchain.
The order identification code carries a first digital signature;
the apparatus 120 further comprises:
the scanning module 11b is further configured to scan the order identification code to obtain the first digital signature;
and the signature verification module 16b is configured to verify the signature of the first digital signature based on the public key of the receiving node, and if the signature passes the verification, execute the process of generating transaction data based on the data volume to be transferred and the public key of the receiving node.
Wherein, the generating module 12b includes:
the first obtaining unit 121b is configured to call a data transfer identification code from an account address of the transfer node based on the amount of the data to be transferred;
the signature unit 122b is configured to sign the data transfer identification code based on a private key of the transfer node to obtain a transfer signature;
and the packaging unit 123b is configured to package the data transfer identification code and the transfer signature into the transaction data.
Wherein, the generating module 12b further includes:
a second obtaining unit 124b, configured to obtain the data volume to be transferred, an asset source account address corresponding to the data volume to be transferred, and an account address of the receiving node;
a generating unit 125b, configured to generate initial transaction data according to the data volume to be transferred, the asset source account address corresponding to the data volume to be transferred, and the account address of the receiving node, and sign the initial transaction data with a private key of the transferring node to obtain the transfer signature, where the asset source account address and the account address of the receiving node are used to implement data transfer processing between the transferring node and the receiving node;
the encapsulating unit 123b is further configured to encapsulate the initial transaction data and the transfer signature into the transaction data.
In the aspect of acquiring the amount of the data to be transferred, the second acquiring unit 124b is specifically configured to:
and acquiring an asset source account ciphertext to be transferred from the asset source account pointed by the asset source account address, and decrypting the asset ciphertext to be transferred based on the private key of the transfer node to obtain the data volume to be transferred.
In the embodiment of the present application, a data processing apparatus based on a block chain is described with reference to fig. 11 and 12, where fig. 11 is the data processing apparatus based on the block chain corresponding to the receiving node, and fig. 12 is the data processing apparatus based on the block chain corresponding to the transferring node. Fig. 11 and fig. 12 constitute a complete blockchain-based data processing apparatus, which encapsulates order information into an order identification code through a receiving node, and displays the order identification code in a screen, where the order information includes a public key of the receiving node and a data volume to be transferred; the transfer node scans the order identification code to obtain order information; the transfer node determines transaction data based on the order information, encrypts the transaction data through a public key of the receiving node to obtain a transaction information ciphertext, and encapsulates the transaction information ciphertext into a transaction identification code; the receiving node scans the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext, decrypts the transaction information ciphertext based on a private key of the receiving node to obtain transaction data, performs data transfer processing on the transaction data, generates transaction behavior data between the receiving node and the transfer node if the data transfer processing is successfully performed, and adds the transaction behavior data to the block chain. According to the method and the device, the data generated in the transaction between the two transaction parties are encrypted or signed, so that the data transmitted between the two transaction parties are processed, the original data cannot be directly displayed, the situation that other people illegally acquire transaction assets from the two transaction parties by acquiring the original data is avoided, the economic loss caused by directly displaying the transaction data is reduced, and the security of electronic asset transaction is improved.
Referring to fig. 13, fig. 13 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 13, the computer device in the embodiment of the present application may include: one or more processors 1301, memory 1302, and input-output interface 1303. The processor 1301, the memory 1302, and the input/output interface 1303 are connected by a bus 1304. The memory 1302 is used for storing a computer program including program instructions, and the input/output interface 1303 is used for inputting and outputting data, including data interaction between the receiving node and the transferring node, and data interaction between the receiving node and the transferring node, the blockchain and each consensus node; the processor 1301 is configured to execute the program instructions stored in the memory 1302 to perform the following operations:
the receiving node packages the order information into an order identification code, and the order identification code is displayed in a screen, so that the transfer node obtains the order information by scanning the order identification code; the order information comprises a public key of the receiving node and the data volume to be transferred;
scanning the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext; the transaction information ciphertext is a ciphertext generated by the transfer node based on the data volume to be transferred and the public key of the receiving node;
decrypting the transaction information ciphertext by using the private key of the receiving node to obtain transaction data, and performing data transfer processing on the transaction data to obtain a data transfer result;
and generating transaction behavior data between the receiving node and the transfer node according to the data transfer result, and adding the transaction behavior data into the block chain.
Wherein, the receiving node encapsulates the order information into an order identification code, and comprises:
the receiving node generates a first digital signature of the order information through a private key of the receiving node;
and encapsulating the order information and the first digital signature into the order identification code, wherein the first digital signature is used for the transfer node to carry out identity verification on the receiving node.
The transaction data is generated by the transfer node based on a data transfer identification code and a transfer signature, the data transfer identification code is an identification code called by the transfer node from an account address of the transfer node based on the data volume to be transferred, the transfer signature is obtained by the transfer node signing the data transfer identification code based on a private key of the transfer node, and the data transfer result comprises a data transfer success result and a data transfer failure result;
the data transfer processing of the transaction data to obtain a data transfer result includes:
acquiring the data transfer identification code and the transfer signature in the transaction data, verifying the transfer signature according to the public key of the transfer node, and if the verification is passed, performing data transfer processing on the data volume to be transferred based on the data transfer identification code;
and if the data transfer processing is successfully executed, determining that the data transfer result is a data transfer success result.
The transaction data is obtained by packaging initial transaction data and a transfer signature by the transfer node, the transfer signature is obtained by the transfer node signing the initial transaction data based on a private key of the transfer node, the initial transaction data comprises the data volume to be transferred, an asset source account address corresponding to the data volume to be transferred and an account address of the receiving node, and the data transfer result comprises a data transfer success result and a data transfer failure result;
the data transfer processing of the transaction data to obtain a data transfer result includes:
acquiring the initial transaction data and the transfer signature in the transaction data, verifying the transfer signature according to a public key of the transfer node, and if the verification is passed, generating a transfer block according to the initial transaction data and the transfer signature;
broadcasting the transfer block to a consensus node in the block chain, adding the transfer block to the block chain after the consensus node passes consensus verification, and determining the data volume to be transferred in the transfer block as transferred data volume; the receiving node has a data transfer permission for the transferred data volume;
and if the transfer block is successfully added into the block chain, determining that the data transfer result is a data transfer success result.
Wherein, the generating transaction behavior data between the receiving node and the transfer node according to the data transfer result, and adding the transaction behavior data to the block chain includes:
if the data transfer result is the data transfer success result, determining the data volume to be transferred after data transfer processing as transferred data volume, and acquiring the transferred data volume and a transaction behavior number corresponding to the data transfer identification code;
determining the transferred data volume, the transaction behavior number, a transaction service object matched with the transferred data volume in the order information, the account address of the receiving node and the account address of the transfer node as the transaction behavior data;
and generating a transaction block according to the transaction behavior data, broadcasting the transaction block to a consensus node in the block chain, and adding the transaction block to the block chain after the consensus node passes consensus verification.
Wherein, the generating transaction behavior data between the receiving node and the transfer node according to the data transfer result, and adding the transaction behavior data to the block chain includes:
if the data transfer result is the data transfer success result, acquiring a block identifier of the transfer block;
determining the transferred data volume, the block identifier and a transaction business object matched with the transferred data volume in the order information as the transaction behavior data;
and generating a transaction block according to the transaction behavior data, broadcasting the transaction block to a consensus node in the block chain, and adding the transaction block to the block chain after the consensus node passes consensus verification.
And the following operations:
the transfer node scans the order identification code in the screen of the receiving node to obtain order information; the order information comprises a public key of a receiving node and a data volume to be transferred, and the order identification code is obtained by packaging the order information by the receiving node;
generating transaction data based on the data volume to be transferred and the public key of the receiving node, encrypting the transaction data by adopting the public key of the receiving node to obtain a transaction information ciphertext, wherein the transaction data is used for data transfer processing of the receiving node;
packaging the transaction information ciphertext into a transaction identification code, displaying the transaction identification code on a screen so that the receiving node can obtain the transaction information ciphertext by scanning the transaction identification code, decrypting the transaction information ciphertext by adopting a private key of the receiving node to obtain transaction data, and performing data transfer processing on the transaction data to obtain a data transfer result;
and checking transaction behavior data corresponding to the data transfer result in the block chain.
Wherein, the order identification code carries a first digital signature;
the method further comprises the following steps:
and scanning the order identification code to obtain the first digital signature, verifying the first digital signature based on the public key of the receiving node, and if the first digital signature passes verification, executing the process of generating transaction data based on the data volume to be transferred and the public key of the receiving node.
Wherein, the generating transaction data based on the data volume to be transferred and the public key of the receiving node includes:
calling the account address of the transfer node based on the data volume to be transferred to obtain a data transfer identification code;
signing the data transfer identification code based on the private key of the transfer node to obtain a transfer signature;
and packaging the data transfer identification code and the transfer signature into the transaction data.
Wherein, the generating transaction data based on the data volume to be transferred and the public key of the receiving node includes:
acquiring the data volume to be transferred, an asset source account address corresponding to the data volume to be transferred and an account address of the receiving node;
generating initial transaction data according to the data volume to be transferred, the asset source account address corresponding to the data volume to be transferred and the account address of the receiving node, and signing the initial transaction data by adopting a private key of the transferring node to obtain the transfer signature, wherein the asset source account address and the account address of the receiving node are used for realizing data transfer processing between the transferring node and the receiving node;
and encapsulating the initial transaction data and the transfer signature into the transaction data.
Wherein, the obtaining the data volume to be transferred includes:
and acquiring an asset source account ciphertext to be transferred from the asset source account pointed by the asset source account address, and decrypting the asset ciphertext to be transferred based on the private key of the transfer node to obtain the data volume to be transferred.
In some possible embodiments, the processor 1301 may be a Central Processing Unit (CPU), which may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 1302 may include both read-only memory and random-access memory, and provides instructions and data to the processor 1301 and the input/output interface 1303. A portion of the memory 1302 may also include non-volatile random access memory. For example, memory 1302 may also store information of the device type.
In a specific implementation, the computer device may execute, through each built-in functional module thereof, the implementation manners provided in the steps in fig. 2 to fig. 5, which may be specifically referred to the implementation manners provided in the steps in fig. 2 to fig. 5, and are not described herein again.
The embodiment of the present application provides a computer device, including: the system comprises a processor, an input/output interface and a memory, wherein the processor acquires computer instructions in the memory, and executes the steps of the method shown in the figures 2 to 5 to perform data processing operation based on the block chain. With computer instructions in the memory, the processor performs the steps of: the receiving node packages the order information into an order identification code, and displays the order identification code in a screen, wherein the order information comprises a public key of the receiving node and the data volume to be transferred; the transfer node scans the order identification code to obtain order information; the transfer node determines transaction data based on the order information, encrypts the transaction data through a public key of the receiving node to obtain a transaction information ciphertext, and encapsulates the transaction information ciphertext into a transaction identification code; the receiving node scans the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext, decrypts the transaction information ciphertext based on a private key of the receiving node to obtain transaction data, performs data transfer processing on the transaction data, generates transaction behavior data between the receiving node and the transfer node if the data transfer processing is successfully performed, and adds the transaction behavior data to the block chain. According to the method and the device, the data generated in the transaction between the two transaction parties are encrypted or signed, so that the data transmitted between the two transaction parties are processed, the original data cannot be directly displayed, the situation that other people illegally acquire transaction assets from the two transaction parties by acquiring the original data is avoided, the economic loss caused by directly displaying the transaction data is reduced, and the security of electronic asset transaction is improved.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, where the computer program includes program instructions, and when the program instructions are executed by a processor, the method for processing data based on a block chain provided in each step in fig. 2 to 5 is implemented, which may specifically refer to the implementation manners provided in each step in fig. 2 to 5, and is not described herein again.
The computer-readable storage medium may be the data processing apparatus based on the block chain provided in any of the foregoing embodiments or an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) card, a flash card (flash card), and the like, provided on the computer device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the computer device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the computer device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
The terms "first," "second," and the like in the description and in the claims and drawings of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprises" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or apparatus that comprises a list of steps or elements is not limited to the listed steps or modules, but may alternatively include other steps or modules not listed or inherent to such process, method, apparatus, product, or apparatus.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The method and the related apparatus provided by the embodiments of the present application are described with reference to the flowchart and/or the structural diagram of the method provided by the embodiments of the present application, and each flow and/or block of the flowchart and/or the structural diagram of the method, and the combination of the flow and/or block in the flowchart and/or the block diagram can be specifically implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block or blocks.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (15)

1. A method for processing data based on a blockchain, the method comprising:
the receiving node packages the order information into an order identification code, and the order identification code is displayed in a screen, so that the transfer node obtains the order information by scanning the order identification code; the order information comprises a public key of the receiving node and the data volume to be transferred;
scanning the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext; the transaction information ciphertext is a ciphertext generated by the transfer node based on the data volume to be transferred and a public key of the receiving node; the transaction identification code is obtained by packaging the transaction information ciphertext and is an identification code which can be scanned and identified and carries the transaction information ciphertext;
decrypting the transaction information ciphertext by adopting the private key of the receiving node to obtain transaction data, and performing data transfer processing on the transaction data to obtain a data transfer result; the transaction data are generated according to the data volume to be transferred in the order information and the public key of the receiving node, wherein the data volume to be transferred refers to the data volume transferred by the data transfer processing;
and generating transaction behavior data between the receiving node and the transfer node according to the data transfer result, and adding the transaction behavior data into a block chain.
2. The method of claim 1, wherein the receiving node encapsulates order information into an order identification code, comprising:
the receiving node generates a first digital signature of the order information through a private key of the receiving node;
and encapsulating the order information and the first digital signature into the order identification code, wherein the first digital signature is used for the transfer node to carry out identity verification on the receiving node.
3. The method of claim 1, wherein the transaction data is generated by the transfer node based on a data transfer identification code and a transfer signature, the data transfer identification code being an identification code recalled by the transfer node from an account address of the transfer node based on the amount of data to be transferred, the transfer signature being a signature of the data transfer identification code by the transfer node based on a private key of the transfer node, the data transfer result comprising a data transfer success result and a data transfer failure result;
the data transfer processing of the transaction data to obtain a data transfer result includes:
acquiring the data transfer identification code and the transfer signature in the transaction data, checking the transfer signature according to a public key of the transfer node, and if the data transfer identification code passes the verification, performing data transfer processing on the data volume to be transferred based on the data transfer identification code;
and if the data transfer processing is successfully executed, determining that the data transfer result is a data transfer success result.
4. The method of claim 1, wherein the transaction data is obtained by encapsulating, by the transfer node, initial transaction data and a transfer signature, the transfer signature is obtained by the transfer node signing the initial transaction data based on a private key of the transfer node, the initial transaction data includes the data volume to be transferred, an asset source account address corresponding to the data volume to be transferred, and an account address of the receiving node, and the data transfer result includes a data transfer success result and a data transfer failure result;
the data transfer processing of the transaction data to obtain a data transfer result includes:
acquiring the initial transaction data and the transfer signature in the transaction data, and verifying the transfer signature according to the public key of the transfer node;
if the verification is passed, the transaction data are sent to a consensus node in the block chain, so that the consensus node generates a transfer block according to the transaction data, the transfer block is broadcasted to other consensus nodes, the transfer block is added to the block chain after the other consensus nodes verify the transfer block, and the data volume to be transferred in the transfer block is determined as the transferred data volume; the receiving node has data transfer use authority for the transferred data volume;
and if the transfer block is successfully added into the block chain, determining that the data transfer result is a data transfer success result.
5. The method of claim 3, wherein generating transaction behavior data between the receiving node and the transferring node according to the data transfer result, adding the transaction behavior data to a blockchain, comprises:
if the data transfer result is the data transfer success result, determining the data volume to be transferred after data transfer processing as the transferred data volume, and acquiring the transferred data volume and the transaction behavior number corresponding to the data transfer identification code;
determining the transferred data volume, the transaction action number, a transaction business object matched with the transferred data volume in the order information, the account address of the receiving node and the account address of the transfer node as the transaction action data;
and generating a transaction block according to the transaction behavior data, broadcasting the transaction block to a consensus node in the block chain, and adding the transaction block to the block chain after the consensus node passes consensus verification.
6. The method of claim 4, wherein generating transaction behavior data between the receiving node and the transfer node according to the data transfer result, adding the transaction behavior data to a blockchain, comprises:
if the data transfer result is the data transfer success result, acquiring a block identifier of the transfer block;
determining the transferred data volume, the block identifier and a transaction business object matched with the transferred data volume in the order information as the transaction behavior data;
and generating a transaction block according to the transaction behavior data, broadcasting the transaction block to a consensus node in the block chain, and adding the transaction block into the block chain after the consensus node passes consensus verification.
7. A method for processing data based on a blockchain, the method comprising:
the transfer node scans the order identification code in the screen of the receiving node to obtain order information; the order information comprises a public key of a receiving node and a data volume to be transferred, and the order identification code is obtained by packaging the order information by the receiving node;
generating transaction data based on the data volume to be transferred and the public key of the receiving node, and encrypting the transaction data by adopting the public key of the receiving node to obtain a transaction information ciphertext, wherein the transaction data is used for data transfer processing of the receiving node;
packaging the transaction information ciphertext into a transaction identification code, displaying the transaction identification code on a screen of the transfer node so that the receiving node obtains the transaction information ciphertext by scanning the transaction identification code, decrypting the transaction information ciphertext by adopting a private key of the receiving node to obtain transaction data, and performing data transfer processing on the transaction data to obtain a data transfer result;
and checking transaction behavior data corresponding to the data transfer result in the block chain.
8. The method of claim 7, wherein the order identification code carries a first digital signature; the first digital signature is generated by the receiving node for the order information through a private key of the receiving node;
the method further comprises the following steps:
and scanning the order identification code to obtain the first digital signature, verifying the first digital signature based on the public key of the receiving node, and if the first digital signature passes verification, executing the process of generating transaction data based on the data volume to be transferred and the public key of the receiving node.
9. The method of claim 7, wherein generating transaction data based on the amount of data to be transferred and a public key of the receiving node comprises:
calling the account address of the transfer node based on the data volume to be transferred to obtain a data transfer identification code;
signing the data transfer identification code based on a private key of the transfer node to obtain a transfer signature;
and encapsulating the data transfer identification code and the transfer signature into the transaction data.
10. The method of claim 7, wherein generating transaction data based on the amount of data to be transferred and a public key of the receiving node comprises:
acquiring the data volume to be transferred, an asset source account address corresponding to the data volume to be transferred and an account address of the receiving node;
generating initial transaction data according to the data volume to be transferred, the asset source account address corresponding to the data volume to be transferred and the account address of the receiving node, and signing the initial transaction data by adopting a private key of the transferring node to obtain a transfer signature, wherein the asset source account address and the account address of the receiving node are used for realizing data transfer processing between the transferring node and the receiving node;
encapsulating the initial transaction data and the transfer signature into the transaction data.
11. The method of claim 10, wherein the obtaining the amount of data to be transferred comprises:
and acquiring an asset source account ciphertext to be transferred from the asset source account pointed by the asset source account address, and decrypting the asset ciphertext to be transferred based on the private key of the transfer node to obtain the data volume to be transferred.
12. An apparatus for processing block chain based data, the apparatus comprising:
the packaging module is used for packaging the order information into an order identification code by the receiving node; the order information comprises a public key of the receiving node and the data volume to be transferred;
the display module is used for displaying the order identification code in a screen so that the transfer node can obtain the order information by scanning the order identification code;
the scanning module is used for scanning the transaction identification code in the screen of the transfer node to obtain a transaction information ciphertext; the transaction information ciphertext is a ciphertext generated by the transfer node based on the data amount to be transferred and a public key of the receiving node; the transaction identification code is obtained by packaging the transaction information ciphertext and is an identification code which can be scanned and identified and carries the transaction information ciphertext;
the decryption module is used for decrypting the transaction information ciphertext by adopting the private key of the receiving node to obtain transaction data; the transaction data are generated according to the data volume to be transferred in the order information and the public key of the receiving node;
the transfer module is used for carrying out data transfer processing on the transaction data to obtain a data transfer result; the data volume to be transferred refers to the data volume transferred by the data transfer processing;
and the generating module is used for generating transaction behavior data between the receiving node and the transfer node according to the data transfer result and adding the transaction behavior data to the block chain.
13. An apparatus for data processing based on a blockchain, the apparatus comprising:
the scanning module is used for scanning the order identification code in the screen of the receiving node by the transfer node to obtain order information; the order information comprises a public key of a receiving node and a data volume to be transferred, and the order identification code is obtained by packaging the order information by the receiving node;
the generating module is used for generating transaction data based on the data volume to be transferred and the public key of the receiving node, and the transaction data is used for data transfer processing of the receiving node;
the encryption module is used for encrypting the transaction data by adopting the public key of the receiving node to obtain a transaction information ciphertext;
the packaging module is used for packaging the transaction information ciphertext into a transaction identification code, displaying the transaction identification code on a screen of the transfer node so that the receiving node obtains the transaction information ciphertext by scanning the transaction identification code, decrypting the transaction information ciphertext by adopting a private key of the receiving node to obtain transaction data, and performing data transfer processing on the transaction data to obtain a data transfer result;
and the checking module is used for checking the transaction behavior data corresponding to the data transfer result in the blockchain.
14. A computer device comprising a processor, a memory, an input output interface;
the processor is connected to the memory and the input/output interface, respectively, wherein the input/output interface is used for inputting and outputting data, the memory is used for storing program codes, and the processor is used for calling the program codes to execute the method according to any one of claims 1-6 or claims 7-11.
15. 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 method according to any of claims 1-6 or claims 7-11.
CN201911155823.0A 2019-11-22 2019-11-22 Data processing method and device based on block chain, computer and storage medium Active CN110942301B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911155823.0A CN110942301B (en) 2019-11-22 2019-11-22 Data processing method and device based on block chain, computer and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911155823.0A CN110942301B (en) 2019-11-22 2019-11-22 Data processing method and device based on block chain, computer and storage medium

Publications (2)

Publication Number Publication Date
CN110942301A CN110942301A (en) 2020-03-31
CN110942301B true CN110942301B (en) 2022-07-12

Family

ID=69907344

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911155823.0A Active CN110942301B (en) 2019-11-22 2019-11-22 Data processing method and device based on block chain, computer and storage medium

Country Status (1)

Country Link
CN (1) CN110942301B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111985912A (en) * 2020-08-14 2020-11-24 上海云从企业发展有限公司 Payment method, device, system, equipment and machine readable medium
CN112184229A (en) * 2020-10-14 2021-01-05 深圳壹账通智能科技有限公司 Block chain-based sub-account transaction processing method, system and equipment
CN115936822A (en) * 2023-03-10 2023-04-07 中国信息通信研究院 Block chain-based order processing method, device, system, equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104202301A (en) * 2014-08-08 2014-12-10 腾讯科技(深圳)有限公司 Numerical value transferring method and device
CN104484114A (en) * 2014-11-24 2015-04-01 腾讯科技(深圳)有限公司 Data transfer method, mobile terminal and data transfer system
CN105407079A (en) * 2015-09-25 2016-03-16 中城智慧科技有限公司 Novel terminal safety soft secret key management method
CN106296148A (en) * 2016-08-05 2017-01-04 深圳市淘淘谷信息技术有限公司 A kind of data processing method and relevant device, system
CN109102299A (en) * 2018-08-01 2018-12-28 腾讯科技(深圳)有限公司 Resource transfers data managing method, device and storage medium
CN109829789A (en) * 2019-01-31 2019-05-31 海南指间易购电子商务有限公司 A kind of supermarket's order management system
CN110335040A (en) * 2019-05-28 2019-10-15 平安科技(深圳)有限公司 Resource transfers method, apparatus, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8521649B2 (en) * 2011-06-06 2013-08-27 Cng3 Holdings, Inc. System, method, and apparatus for funds transfer

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104202301A (en) * 2014-08-08 2014-12-10 腾讯科技(深圳)有限公司 Numerical value transferring method and device
CN104484114A (en) * 2014-11-24 2015-04-01 腾讯科技(深圳)有限公司 Data transfer method, mobile terminal and data transfer system
CN105407079A (en) * 2015-09-25 2016-03-16 中城智慧科技有限公司 Novel terminal safety soft secret key management method
CN106296148A (en) * 2016-08-05 2017-01-04 深圳市淘淘谷信息技术有限公司 A kind of data processing method and relevant device, system
CN109102299A (en) * 2018-08-01 2018-12-28 腾讯科技(深圳)有限公司 Resource transfers data managing method, device and storage medium
CN109829789A (en) * 2019-01-31 2019-05-31 海南指间易购电子商务有限公司 A kind of supermarket's order management system
CN110335040A (en) * 2019-05-28 2019-10-15 平安科技(深圳)有限公司 Resource transfers method, apparatus, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110942301A (en) 2020-03-31

Similar Documents

Publication Publication Date Title
US9530126B2 (en) Secure mobile payment processing
CN107077670B (en) Method and apparatus for transmitting and processing transaction message, computer readable storage medium
US20200051144A1 (en) Encrypted payment image
CN110942301B (en) Data processing method and device based on block chain, computer and storage medium
US11301865B2 (en) Secure card data entry system and method
CN105027153A (en) Methods, devices, and systems for secure provisioning, transmission, and authentication of payment data
US9842332B2 (en) Systems and methods for processing a financial transaction
CN110290102A (en) Service security system and method based on application
CN102790767B (en) Information safety control method, information safety display equipment and electronic trading system
CN111222178B (en) Data signature method and device
CN103116851A (en) Electronic contract on-line signing method and system
CN108763937B (en) Distribution document generation, distribution and popularization information processing method and device
NZ720450A (en) Cryptographic watermarking of content in fuel dispensing environments
CN110232021A (en) The method and device of page test
EP3151180A1 (en) Identification method and system
JP2014011762A (en) Information processing apparatus, terminal device, information processing system, method for information processing, and computer program
CN110677261B (en) Trusted two-dimensional code generation method and device, electronic equipment and storage medium
KR20130002147A (en) Method and apparatus for determining genuine goods using nfc tag
EP1227450A2 (en) Method and arrangement for offering a service via information network
TWI490799B (en) Mobile communication device and two - dimensional bar code for financial certificate trading system and method
US20190164201A1 (en) Trustworthy review system and method for legitimizing a review
TWI770279B (en) Voucher verification auxiliary device, system and method thereof
US20210390546A1 (en) Systems and Methods for Secure Transaction Processing
US20220300943A1 (en) Information processing apparatus, payment processing system, method, and program
CN114817890A (en) Electronic signature method and device of document, terminal equipment and 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: 40023016

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