CN110955724A - Data processing method and device based on block chain, node equipment and storage medium - Google Patents

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

Info

Publication number
CN110955724A
CN110955724A CN201911148907.1A CN201911148907A CN110955724A CN 110955724 A CN110955724 A CN 110955724A CN 201911148907 A CN201911148907 A CN 201911148907A CN 110955724 A CN110955724 A CN 110955724A
Authority
CN
China
Prior art keywords
transaction
data
execution function
transaction request
target
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.)
Pending
Application number
CN201911148907.1A
Other languages
Chinese (zh)
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 CN201911148907.1A priority Critical patent/CN110955724A/en
Publication of CN110955724A publication Critical patent/CN110955724A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • 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/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • General Engineering & 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 invention provides a data processing method, a device, node equipment and a storage medium based on a block chain, wherein the method comprises the following steps: receiving a transaction request sent by a client, wherein the transaction request comprises transaction data; acquiring an execution function of the intelligent contract matched with the transaction request; adding the execution function into the transaction data to obtain target data; and issuing the target data to a block chain, and operating an execution function in the target data to process the transaction data in the issuing process. The embodiment of the invention can effectively improve the data processing efficiency and the block chain safety.

Description

Data processing method and device based on block chain, node equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing method based on a block chain, an apparatus, a node device, and a storage medium.
Background
Blockchains are a decentralized infrastructure that is widely used in emerging digital cryptocurrency and are receiving attention and research as bitcoins are gradually accepted. The blockchain technology has the characteristics of decentralization, basically untrustworthy and distrusted block data and the like, and is considered to be subversion of a computer mode after the Internet. But the block chain technology still has the problems of small expandability, insufficient maturity of open source projects, low data processing efficiency and the like. Therefore, how to improve the efficiency of data processing in the blockchain network is a problem that needs to be solved.
Disclosure of Invention
The embodiment of the invention provides a data processing method based on a block chain, a device, a node device and a storage medium, which can effectively improve the data processing efficiency and the block chain safety.
In one aspect, an embodiment of the present invention provides a data processing method based on a block chain, where the method includes:
receiving a transaction request sent by a client, wherein the transaction request comprises transaction data;
acquiring an execution function of the intelligent contract matched with the transaction request;
adding the execution function into the transaction data to obtain target data;
and issuing the target data to a block chain, and operating an execution function in the target data to process the transaction data in the issuing process.
In one embodiment, the obtaining an execution function of the smart contract matching the transaction request includes: detecting a transaction category to which the transaction data belongs; and acquiring an execution function of the intelligent contract matched with the transaction category.
In one embodiment, the obtaining an execution function of the smart contract matching the transaction category includes: determining a target identifier of an execution function matched with the transaction type to which the transaction data belongs according to a mapping relation between the stored transaction type and an execution function identifier of the intelligent contract; and acquiring the execution function matched with the target identification from various execution functions of the stored intelligent contract.
In one embodiment, before the obtaining the execution function of the smart contract matching the transaction request, the method further comprises: acquiring the data size of an execution function of the intelligent contract matched with the transaction request; detecting whether the data size is smaller than or equal to a preset value; and if the data size is smaller than or equal to the preset value, triggering and executing the step of obtaining the execution function of the intelligent contract matched with the transaction request.
In an embodiment, the method further comprises: if the data size is larger than the preset value, acquiring a target identifier of the execution function, and adding the target identifier into the transaction data; and issuing the transaction data added with the target identifier to a block chain, and calling and executing a matched execution function according to the target identifier in the issuing process to process the transaction data.
In one embodiment, the transaction request comprises a funding transaction request, the execution function comprises a funding transaction function, the transaction data comprises a payment blockchain account, a transaction amount, a checkout blockchain account; the issuing the target data to a blockchain and operating an execution function in the target data to process the transaction data in the issuing process includes: issuing the target data to a blockchain, acquiring a fund balance of the payment blockchain account in an issuing process, and detecting whether the fund balance is greater than or equal to the transaction amount; and when the fund balance is greater than or equal to the transaction amount, operating a fund transaction function in the target transaction data to transfer a value corresponding to the transaction amount from the payment blockchain account to the collection blockchain account.
In one embodiment, before the obtaining the execution function of the smart contract matching the transaction request, the method further comprises: detecting whether the client side has the authority to execute the transaction requested by the transaction request; and if the client has the right of executing the transaction requested by the transaction request, triggering and executing the step of obtaining the execution function of the intelligent contract matched with the transaction request.
In another aspect, an embodiment of the present invention provides a data processing apparatus based on a block chain, where the apparatus includes:
the system comprises a receiving and sending unit, a processing unit and a processing unit, wherein the receiving and sending unit is used for receiving a transaction request sent by a client, and the transaction request comprises transaction data;
the acquisition unit is used for acquiring an execution function of the intelligent contract matched with the transaction request;
the processing unit is used for adding the execution function into the transaction data to obtain target data;
the processing unit is further configured to issue the target data to a block chain, and run an execution function in the target data to process the transaction data in an issuing process.
In another aspect, an embodiment of the present invention provides a node device, including: the data processing system comprises a processor, a communication interface and a memory, wherein the processor, the communication interface and the memory are connected with each other, executable program codes are stored in the memory, and the processor is used for calling the executable program codes and executing the data processing method based on the block chain.
Accordingly, an embodiment of the present invention further provides a storage medium, where instructions are stored in the storage medium, and when the storage medium is run on a computer, the storage medium causes the computer to execute the above data processing method based on a block chain.
According to the embodiment of the invention, the execution function of the intelligent contract matched with the transaction request is obtained, the execution function is added into the transaction data included in the transaction request to obtain the target data, and the execution function is operated to process the transaction data in the process of issuing the target data to the block chain, so that on one hand, the time for obtaining the matched execution function in the uplink process can be saved, and the data processing efficiency is effectively improved; on the other hand, the intelligent contract does not need to be issued to the block chain network, so that the anonymous intelligent contract can be realized, and the safety of the block chain is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention 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 invention, 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 network according to an embodiment of the present invention;
FIG. 2 is a block diagram of a data processing system according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a block chain block according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a data processing method based on a block chain according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a data processing apparatus based on a block chain according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a node device according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
With the coming of the scientific and technological era and the development of the mobile internet, the pace of network revolution is getting faster and faster, the information fusion of the same field or multiple fields is realized, and the process of providing an all-dimensional informatization scheme for customers also faces new challenges of improving the system structure, supporting gravity center transfer and the like. Therefore, the blockchain technology, as a specific implementation of the distributed ledger, is gradually becoming the preferred way to store data and transaction data in various fields by virtue of its natural advantages of storing and managing data.
The block chain network shown in fig. 1 is described as an example. As shown in fig. 1, the node devices in the block chain network may include banks, insurance companies, government buildings, shops, schools, hospitals, and the like. Banks, insurance companies, government buildings, shops, schools and hospitals all participate in the management and processing of the same blockchain network, and can also participate in monitoring the legality of transactions so as to achieve the fairness of processing or storing transaction data by the blockchain network. Meanwhile, the bank, the insurance company, the government building, the shop, the school and the hospital belong to different fields, and the quality and the efficiency of social work can be better improved through information fusion and interaction in the different fields. Any node device in the blockchain network may check the acquired transaction data, and when the obtained check result is that the check is successful, a block (such as the block shown in fig. 1) may be generated based on the transaction data and issued to the blockchain, so that each other node device in the blockchain network may perform distributed storage on the block. For example, as shown in fig. 1, the node devices in the block chain network may include banks, insurance companies, government buildings, shops, schools, and hospitals, and the banks, insurance companies, government buildings, shops, schools, and hospitals may store the identity information of the same user a in a distributed manner, so that the user a may query the identity information of any organization.
As shown in fig. 2, a data processing system provided for the embodiment of the present invention may be a distributed system formed by a client, a plurality of node devices (any form of computing devices in an access network, such as servers and user terminals) connected through a network communication form. The client may also be a node device in the blockchain network. The distributed system may be a blockchain system, and referring to fig. 2, fig. 2 is an alternative architecture diagram of the data processing system applied to the blockchain system (or blockchain network) according to the embodiment of the present invention, and the data processing system is formed by a client and a plurality of node devices. A point-To-point (P2P, Peer To Peer) network is formed among the node devices, and the P2P Protocol is an application layer Protocol operating on a Transmission Control Protocol (TCP). In a distributed system, any machine, such as a server or a terminal, can join to become a node, and the node comprises a hardware layer, a middle layer, an operating system layer and an application layer.
Referring to the functions of each node in the blockchain system shown in fig. 2, the functions involved include:
1) routing, a basic function that a node has, is used to support communication between nodes.
Besides the routing function, the node may also have the following functions:
2) and the Block chain comprises a series of blocks (blocks) which are mutually connected according to the generated chronological order, new blocks cannot be removed once being added into the Block chain, and recorded data submitted by nodes in the Block chain system are recorded in the blocks.
Referring to fig. 3, fig. 3 is an optional schematic diagram of a Block Structure (Block Structure) according to an embodiment of the present invention, where each Block includes a hash value of a data record stored in the Block (hash value of the Block) and a hash value of a previous Block, and the blocks are connected by the hash values to form a Block chain. The block may include information such as a time stamp at the time of block generation. A block chain (Blockchain), which is essentially a decentralized database, is a string of data blocks associated by using cryptography, and each data block contains related information for verifying the validity (anti-counterfeiting) of the information and generating a next block.
3) The application is used for being deployed in a block chain, realizing specific services according to actual service requirements, recording data related to the realization functions to form recording data, carrying a digital signature in the recording data to represent a source of task data, and sending the recording data to other nodes in the block chain system, so that the other nodes add the recording data to a temporary block when the source and integrity of the recording data are verified successfully.
For example, the services implemented by the application include:
3.1) a wallet for providing functions of transaction of electronic money, which includes initiating transaction (i.e. sending the transaction record of the current transaction to other nodes in the blockchain system, and storing the record data of the transaction in a temporary block of the blockchain as a response for confirming that the transaction is valid after the other nodes are successfully verified; of course, the wallet also supports the querying of the remaining electronic money in the electronic money address;
and 3.2) sharing the account book, wherein the shared account book is used for providing functions of operations such as storage, inquiry and modification of account data, the recorded data of the operations on the account data are sent to other nodes in the block chain system, and after the other nodes verify the validity, the recorded data are stored in the temporary block as a response for acknowledging that the account data are valid, and confirmation can be sent to the node initiating the operations.
3.3) Intelligent contracts, computerized agreements, which can execute the terms of a certain contract, are realized by codes deployed on a shared book for execution when certain conditions are met, and are used for completing automated transactions according to actual business requirement codes, such as inquiring the logistics state of goods purchased by a buyer and transferring the electronic money of the buyer to the address of a merchant after the buyer signs the goods; of course, smart contracts are not limited to executing contracts for trading, but may also execute contracts that process received information.
In the current block chain architecture, a developer defines a contract logic through a certain programming language to generate an intelligent contract, wherein the intelligent contract comprises a plurality of execution functions, and each execution function is used for realizing a specific function; the intelligent contract encapsulates a plurality of predefined states, conversion rules, trigger conditions, corresponding operations and the like; and then, issuing the intelligent contract to a block chain (contract registration), after each party signs, attaching the intelligent contract to block chain data in the form of program codes, and after the intelligent contract is transmitted and verified by a block chain network, recording the intelligent contract into a distributed account book of each node, wherein the block chain can monitor the state of the whole intelligent contract in real time, and activate and execute the contract after the intelligent contract meets a specific trigger condition. It can be seen that, in the current mode, an intelligent contract needs to be issued to a block chain first, and then after a trigger condition is met, a matched execution function in the intelligent contract is called and run to process transaction data. On one hand, the intelligent contract is named, the safety of a block chain can be influenced to a certain extent, the issuing process of the intelligent contract is complicated, and a large amount of network resources can be consumed; on the other hand, the process of calling the execution function of the smart contract may consume a long time, and may reduce the processing efficiency of the transaction data.
Based on this, an embodiment of the present invention provides a data processing method based on a block chain, including the following steps: receiving a transaction request sent by a client, wherein the transaction request comprises transaction data; acquiring an execution function of the intelligent contract matched with the transaction request; adding the acquired execution function into the transaction data to obtain target data; and issuing the target data to a block chain, and operating an execution function in the target data to process the transaction data in the issuing process. By the mode, on one hand, the time for acquiring the matched execution function in the uplink process can be saved, and the data processing efficiency is effectively improved; on the other hand, it is not necessary to issue an intelligent contract to the blockchain network, so that an anonymous intelligent contract can be implemented, and the blockchain security can be improved, which will be described in detail below.
Referring to fig. 4, fig. 4 is a flowchart illustrating a data processing method based on a block chain according to an embodiment of the present invention. The data processing method based on the blockchain described in the embodiment of the present invention may be applied to a node device, where the node device may be any node device in the blockchain network in the data processing system shown in fig. 2. In other embodiments, the node device is an optimal node device determined according to a load condition, a response time, and a distance from a client of each node device in the block chain network. The data processing method based on the block chain described in the embodiment of the invention comprises the following steps:
s401, receiving a transaction request sent by a client, wherein the transaction request comprises transaction data.
In the embodiment of the invention, the transaction data is data required to be used in the transaction execution process requested by the transaction request; the transaction request may be a data modification request, a data read request, a data write request, and the like. In one embodiment, the transaction request may be a funding transaction request, the transaction data including a payment blockchain account, a transaction amount, a checkout blockchain account, and the like. After receiving a transaction request sent by a client, the node device acquires transaction data carried by the transaction request.
S402, obtaining an execution function of the intelligent contract matched with the transaction request.
In the embodiment of the invention, the node equipment stores a plurality of execution functions of the intelligent contract and stores the mapping relation between various transaction requests and the execution function identification of the intelligent contract; the node equipment determines the target identification of the execution function matched with the received transaction request according to the mapping relation, and acquires the execution function matched with the target identification from various execution functions of the intelligent contract stored in the node equipment. For example, the transaction request is a fund transaction request, and the execution function required for executing the fund transaction is a fund transaction function, which includes a fund data modification function, a fund data reading function, and the like; the node device obtains the fund data modification function, the fund data reading function and the like from various execution functions stored by the node device.
In other embodiments, the manner in which the node device obtains the execution function of the smart contract that matches the transaction request is: detecting the transaction type to which the transaction data belongs, and acquiring an execution function of the intelligent contract matched with the transaction type; and taking the acquired execution function as an execution function matched with the transaction request. In one embodiment, the node device stores a plurality of execution functions of the intelligent contract and stores mapping relations between various transaction categories and execution function identifications of the intelligent contract; and the node equipment determines the target identification of the execution function matched with the transaction type to which the transaction data belongs according to the mapping relation, and acquires the execution function matched with the target identification from a plurality of execution functions of the intelligent contract stored in the node equipment.
In one embodiment, before acquiring the intelligent contract execution function matched with the transaction request, the node device acquires the data size of the intelligent contract execution function matched with the transaction request, and detects whether the data size is smaller than or equal to a preset value; if the data size is smaller than or equal to the predetermined value, steps S402 to S404 are performed. If the data size is larger than the preset value, acquiring a target identifier of an intelligent contract execution function matched with the transaction request, and adding the target identifier into the transaction data; and then, the transaction data added with the target identifier is issued to the blockchain, and an execution function matched with the target identifier is called and executed in the issuing process to process the transaction data. By adopting the mode, when the size of the acquired execution function exceeds a certain numerical value, only the identification of the execution function is added into the transaction data, so that the data volume on the block chain can be reduced to a certain extent, and the storage resource is saved.
In another embodiment, before the node device acquires the intelligent contract execution function matched with the transaction request, whether the client has the right to execute the transaction requested by the transaction request is detected; if it is detected that the client has the right to execute the transaction requested by the transaction request, steps S402 to S404 are executed. If the client side is detected not to have the authority for executing the transaction requested by the transaction request, the node device issues the transaction request to the blockchain, broadcasts a message that the transaction request does not have the authority to the nodes in the blockchain network, and/or adds an identifier without the authority to the transaction request in the blockchain network. By the method, whether the transaction requested by the transaction request is executed or not can be quickly verified.
And S403, adding the execution function into the transaction data to obtain target data.
In the embodiment of the invention, the execution function of the intelligent contract matched with the transaction request is one or more. In one embodiment, when the number of the execution functions of the intelligent contract matched with the transaction request is multiple, the node device obtains the running sequence of the multiple execution functions in the process of processing the transaction data subsequently, and adds the multiple execution functions to the target data in sequence according to the running sequence, so that the multiple execution functions are also arranged in the target data according to the running sequence. By adopting the mode, the corresponding execution functions can be found quickly when the execution functions are operated subsequently, and the data processing efficiency of the block chain is further improved to a certain extent.
S404, issuing the target data to a block chain, and operating an execution function in the target data to process the transaction data in the issuing process.
In the embodiment of the invention, the node equipment generates a block according to the target data, issues the generated block to the block chain, and runs the execution function in the target data to process the transaction data in the process of issuing the block to the block chain. Through the mode, the node equipment can directly run the execution function in the target data to process the transaction data in the data chaining process, and compared with the method that the matched execution function is obtained from the underlying intelligent contract module only in the data chaining process at present, the method and the device can save the time for obtaining the matched execution function in the data chaining process, so that the processing efficiency of the transaction data is improved. In addition, the execution function of the intelligent contract in the scheme does not need to be issued to the blockchain network, so that not only can network resources consumed by issuing the intelligent contract be saved, but also anonymous intelligent contracts can be realized, and the safety of the blockchain is improved to a certain extent.
In one embodiment, the transaction request comprises a funding transaction request, the execution function comprises a funding transaction function, the transaction data comprises a payment blockchain account, a transaction amount, a checkout blockchain account; the node equipment issues the target data to the blockchain, acquires the fund balance of the payment blockchain account in the issuing process, and detects whether the fund balance is larger than or equal to the transaction amount; and when the fund balance is greater than or equal to the transaction amount, operating a fund transaction function in the target transaction data to transfer a value corresponding to the transaction amount from the payment blockchain account to the collection blockchain account. And when the fund balance is smaller than the transaction amount, the node equipment cancels the operation of issuing the target data to the block chain and sends prompt information of transaction failure to the client. In other embodiments, after the node device cancels the operation of publishing the target data to the blockchain, the node device publishes the transaction request to the blockchain, broadcasts a message that the transaction request is not responded to the node in the blockchain network, and/or adds an identification that the transaction request is not responded to in the blockchain network. By the method, whether the transaction requested by the transaction request is executed or not can be quickly verified.
In one embodiment, before acquiring the fund balance of the payment blockchain account, the node device may further detect whether the transaction amount exceeds a limit of the payment blockchain account, where the limit may be a limit of an amount of a single transaction, a limit of an amount of a single day transaction, or the like. And if the transaction amount is detected not to exceed the limit of the payment blockchain account, executing the step of acquiring the fund balance of the payment blockchain account. And if the transaction amount is detected to exceed the limit of the payment blockchain account, the node equipment cancels the operation of issuing the target data to the blockchain and sends prompt information of transaction failure to the client. In other embodiments, after the node device cancels the operation of publishing the target data to the blockchain, the node device publishes the transaction request to the blockchain, broadcasts a message that the transaction request is not responded to the node in the blockchain network, and/or adds an identification that the transaction request is not responded to in the blockchain network. By the method, whether the transaction requested by the transaction request is executed or not can be quickly verified.
In another embodiment, the transaction request comprises a data query request, the execution function comprises a data query function, and the transaction data comprises query keywords; the node equipment issues the target data to the block chain, and operates a data query function in the target transaction data to query the information matched with the keyword in the issuing process. For example, if the data query request is a logistics information query request, the data query function is a logistics information query function, and the query keyword is a logistics list number, the logistics information query function is operated to query the logistics information matched with the logistics list number in the process of issuing the target data to the block chain.
In yet another embodiment, the transaction request includes a temperature control request, the executive function includes a temperature control function, the transaction data includes a control object, a set value; and the node equipment adjusts the temperature set value of the control object to the set value by operating the temperature control function. It should be noted that, the above process is a mode in which a block chain is combined with the internet of things, and an execution function of an intelligent contract is utilized to implement intelligent automation in the field of smart home, and other modes, such as humidity, brightness, opening, closing, unlocking and other operations, are similar and are not described herein again.
According to the embodiment of the invention, the execution function of the intelligent contract matched with the transaction request is obtained, the execution function is added into the transaction data included in the transaction request to obtain the target data, and the execution function is operated to process the transaction data in the process of issuing the target data to the block chain, so that on one hand, the time for obtaining the matched execution function in the uplink process can be saved, and the data processing efficiency is effectively improved; on the other hand, the intelligent contract does not need to be issued to the block chain network, so that the anonymous intelligent contract can be realized, and the safety of the block chain is improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a data processing apparatus based on a block chain according to an embodiment of the present invention. The data processing apparatus based on a block chain described in the embodiment of the present invention is applied to the node device in the above method embodiment, and the apparatus includes:
a transceiving unit 501, configured to receive a transaction request sent by a client, where the transaction request includes transaction data;
an obtaining unit 502, configured to obtain an execution function of the intelligent contract matching the transaction request;
the processing unit 503 is configured to add the execution function to the transaction data to obtain target data;
the processing unit 503 is further configured to issue the target data to a blockchain, and run an execution function in the target data to process the transaction data in an issuing process.
In an embodiment, when the obtaining unit 502 obtains the execution function of the intelligent contract matched with the transaction request, it is specifically configured to: detecting a transaction category to which the transaction data belongs; and acquiring an execution function of the intelligent contract matched with the transaction category.
In an embodiment, when the obtaining unit 502 obtains the execution function of the intelligent contract matching the transaction category, it is specifically configured to: determining a target identifier of an execution function matched with the transaction type to which the transaction data belongs according to a mapping relation between the stored transaction type and an execution function identifier of the intelligent contract; and acquiring the execution function matched with the target identification from various execution functions of the stored intelligent contract.
In an embodiment, the obtaining unit 502 is further configured to obtain a data size of an execution function of the smart contract matching the transaction request;
the processing unit 503 is further configured to detect whether the data size is smaller than or equal to a preset value, and if the data size is smaller than or equal to the preset value, trigger the obtaining unit 502 to obtain an execution function of the intelligent contract matched with the transaction request.
In an embodiment, the processing unit 503 is further configured to: if the data size is larger than the preset value, triggering the obtaining unit 502 to obtain the target identifier of the execution function; adding the target identification to the transaction data; and issuing the transaction data added with the target identifier to a block chain, and calling and executing a matched execution function according to the target identifier in the issuing process to process the transaction data.
In one embodiment, the transaction request comprises a funding transaction request, the execution function comprises a funding transaction function, the transaction data comprises a payment blockchain account, a transaction amount, a checkout blockchain account;
the processing unit 503 is specifically configured to issue the target data to a blockchain, and when an execution function in the target data is run in the issuing process to process the transaction data, to:
issuing the target data to a blockchain, acquiring a fund balance of the payment blockchain account in an issuing process, and detecting whether the fund balance is greater than or equal to the transaction amount;
and when the fund balance is greater than or equal to the transaction amount, operating a fund transaction function in the target transaction data to transfer a value corresponding to the transaction amount from the payment blockchain account to the collection blockchain account.
In an embodiment, the processing unit 503 is further configured to: detecting whether the client side has the authority to execute the transaction requested by the transaction request; if the client has the right to execute the transaction requested by the transaction request, the obtaining unit 502 is triggered to obtain the execution function of the intelligent contract matched with the transaction request.
It can be understood that the functions of each functional unit of the data processing apparatus based on the block chain according to the embodiment of the present invention may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the related description of the foregoing method embodiment, which is not described herein again.
According to the embodiment of the invention, the execution function of the intelligent contract matched with the transaction request is obtained, the execution function is added into the transaction data included in the transaction request to obtain the target data, and the execution function is operated to process the transaction data in the process of issuing the target data to the block chain, so that on one hand, the time for obtaining the matched execution function in the uplink process can be saved, and the data processing efficiency is effectively improved; on the other hand, the intelligent contract does not need to be issued to the block chain network, so that the anonymous intelligent contract can be realized, and the safety of the block chain is improved.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a node device according to an embodiment of the present invention. The node device described in the embodiment of the present invention includes: a processor 601, a communication interface 602, and a memory 603. The processor 601, the communication interface 602, and the memory 603 may be connected by a bus or other means, and the embodiment of the present invention is exemplified by being connected by a bus.
The processor 601 (or referred to as a Central Processing Unit (CPU)) is a computing core and a control core of the node device, and can analyze various instructions in the node device and various data of the node device, for example: the CPU may transmit various types of interactive data between the internal structures of the node devices, and so on. The communication interface 602 may optionally include a standard wired interface, a wireless interface (e.g., Wi-Fi, mobile communication interface, etc.), controlled by the processor 601 for transceiving data. A Memory 603(Memory) is a Memory device in the node device for storing programs and data. It is understood that the memory 603 herein may include a built-in memory of the node device, and may also include an expansion memory supported by the node device. Memory 603 provides storage space that stores the operating system of the node device, which may include, but is not limited to: android system, iOS system, Windows Phone system, etc., which are not limited in this respect.
In the embodiment of the present invention, the processor 601 executes the executable program code in the memory 603 to perform the following operations:
receiving a transaction request sent by a client through a communication interface 602, wherein the transaction request comprises transaction data; acquiring an execution function of the intelligent contract matched with the transaction request; adding the execution function into the transaction data to obtain target data; and issuing the target data to a block chain, and operating an execution function in the target data to process the transaction data in the issuing process.
In an embodiment, when the processor 601 obtains the execution function of the intelligent contract matched with the transaction request, the processor is specifically configured to: detecting a transaction category to which the transaction data belongs; and acquiring an execution function of the intelligent contract matched with the transaction category.
In an embodiment, when the processor 601 obtains the execution function of the intelligent contract matching the transaction category, it is specifically configured to: determining a target identifier of an execution function matched with the transaction type to which the transaction data belongs according to a mapping relation between the stored transaction type and an execution function identifier of the intelligent contract; and acquiring the execution function matched with the target identification from various execution functions of the stored intelligent contract.
In one embodiment, before the processor 601 obtains the execution function of the smart contract matching the transaction request, it is further configured to: acquiring the data size of an execution function of the intelligent contract matched with the transaction request; detecting whether the data size is smaller than or equal to a preset value; and if the data size is smaller than or equal to the preset value, executing the step of acquiring the execution function of the intelligent contract matched with the transaction request and subsequent steps of the step.
In one embodiment, the processor 601 is further configured to: if the data size is larger than the preset value, acquiring a target identifier of the execution function, and adding the target identifier into the transaction data; and issuing the transaction data added with the target identifier to a block chain, and calling and executing a matched execution function according to the target identifier in the issuing process to process the transaction data.
In one embodiment, the transaction request comprises a funding transaction request, the execution function comprises a funding transaction function, the transaction data comprises a payment blockchain account, a transaction amount, a checkout blockchain account;
the processor 601 issues the target data to the blockchain, and when the execution function in the target data is run in the issuing process to process the transaction data, the processor is specifically configured to: issuing the target data to a blockchain, acquiring a fund balance of the payment blockchain account in an issuing process, and detecting whether the fund balance is greater than or equal to the transaction amount; and when the fund balance is greater than or equal to the transaction amount, operating a fund transaction function in the target transaction data to transfer a value corresponding to the transaction amount from the payment blockchain account to the collection blockchain account.
In one embodiment, before the processor 601 obtains the execution function of the smart contract matching the transaction request, it is further configured to: detecting whether the client side has the authority to execute the transaction requested by the transaction request; and if the client has the right to execute the transaction requested by the transaction request, executing the step of obtaining the execution function of the intelligent contract matched with the transaction request and the subsequent steps.
In specific implementation, the processor 601, the communication interface 602, and the memory 603 described in this embodiment of the present invention may execute an implementation manner of a node device described in a data processing method based on a block chain provided in this embodiment of the present invention, and may also execute an implementation manner described in a data processing apparatus based on a block chain provided in this embodiment of the present invention, which is not described herein again.
According to the embodiment of the invention, the execution function of the intelligent contract matched with the transaction request is obtained, the execution function is added into the transaction data included in the transaction request to obtain the target data, and the execution function is operated to process the transaction data in the process of issuing the target data to the block chain, so that on one hand, the time for obtaining the matched execution function in the uplink process can be saved, and the data processing efficiency is effectively improved; on the other hand, the intelligent contract does not need to be issued to the block chain network, so that the anonymous intelligent contract can be realized, and the safety of the block chain is improved.
An embodiment of the present invention further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer is caused to execute the data processing method based on the blockchain according to the embodiment of the present invention.
Embodiments of the present invention further provide a computer program product including instructions, which when run on a computer, cause the computer to execute the data processing method based on a block chain according to the embodiments of the present invention.
It should be noted that, for simplicity of description, the above-mentioned embodiments of the method are described as a series of acts or combinations, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above disclosure is intended to be illustrative of only some embodiments of the invention, and is not intended to limit the scope of the invention.

Claims (10)

1. A method for processing data based on a blockchain, the method comprising:
receiving a transaction request sent by a client, wherein the transaction request comprises transaction data;
acquiring an execution function of the intelligent contract matched with the transaction request;
adding the execution function into the transaction data to obtain target data;
and issuing the target data to a block chain, and operating an execution function in the target data to process the transaction data in the issuing process.
2. The method of claim 1, wherein obtaining an execution function of the smart contract that matches the transaction request comprises:
detecting a transaction category to which the transaction data belongs;
and acquiring an execution function of the intelligent contract matched with the transaction category.
3. The method of claim 2, wherein obtaining an execution function of the smart contract that matches the transaction category comprises:
determining a target identifier of an execution function matched with the transaction type to which the transaction data belongs according to a mapping relation between the stored transaction type and an execution function identifier of the intelligent contract;
and acquiring the execution function matched with the target identification from various execution functions of the stored intelligent contract.
4. A method according to any of claims 1-3, wherein prior to obtaining the execution function of the smart contract that matches the transaction request, the method further comprises:
acquiring the data size of an execution function of the intelligent contract matched with the transaction request;
detecting whether the data size is smaller than or equal to a preset value;
and if the data size is smaller than or equal to the preset value, triggering and executing the step of obtaining the execution function of the intelligent contract matched with the transaction request.
5. The method of claim 4, wherein the method further comprises:
if the data size is larger than the preset value, acquiring a target identifier of the execution function, and adding the target identifier into the transaction data;
and issuing the transaction data added with the target identifier to a block chain, and calling and executing a matched execution function according to the target identifier in the issuing process to process the transaction data.
6. The method of claim 1, wherein the transaction request comprises a funding transaction request, the execution function comprises a funding transaction function, the transaction data comprises a payment blockchain account, a transaction amount, a payee blockchain account;
the issuing the target data to a blockchain and operating an execution function in the target data to process the transaction data in the issuing process includes:
issuing the target data to a blockchain, acquiring a fund balance of the payment blockchain account in an issuing process, and detecting whether the fund balance is greater than or equal to the transaction amount;
and when the fund balance is greater than or equal to the transaction amount, operating a fund transaction function in the target transaction data to transfer a value corresponding to the transaction amount from the payment blockchain account to the collection blockchain account.
7. The method of claim 1, wherein prior to obtaining the execution function of the smart contract that matches the transaction request, the method further comprises:
detecting whether the client side has the authority to execute the transaction requested by the transaction request;
and if the client has the right of executing the transaction requested by the transaction request, triggering and executing the step of obtaining the execution function of the intelligent contract matched with the transaction request.
8. An apparatus for data processing based on a blockchain, the apparatus comprising:
the system comprises a receiving and sending unit, a processing unit and a processing unit, wherein the receiving and sending unit is used for receiving a transaction request sent by a client, and the transaction request comprises transaction data;
the acquisition unit is used for acquiring an execution function of the intelligent contract matched with the transaction request;
the processing unit is used for adding the execution function into the transaction data to obtain target data;
the processing unit is further configured to issue the target data to a block chain, and run an execution function in the target data to process the transaction data in an issuing process.
9. A node apparatus, comprising: a processor, a communication interface and a memory, which are connected to each other, wherein the memory stores executable program code, and the processor is configured to call the executable program code to execute the method for processing data based on a blockchain according to any one of claims 1 to 7.
10. A storage medium having stored therein instructions which, when run on a computer, cause the computer to execute the method of block chain based data processing according to any one of claims 1-7.
CN201911148907.1A 2019-11-21 2019-11-21 Data processing method and device based on block chain, node equipment and storage medium Pending CN110955724A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911148907.1A CN110955724A (en) 2019-11-21 2019-11-21 Data processing method and device based on block chain, node equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911148907.1A CN110955724A (en) 2019-11-21 2019-11-21 Data processing method and device based on block chain, node equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110955724A true CN110955724A (en) 2020-04-03

Family

ID=69977989

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911148907.1A Pending CN110955724A (en) 2019-11-21 2019-11-21 Data processing method and device based on block chain, node equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110955724A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112287033A (en) * 2020-12-24 2021-01-29 腾讯科技(深圳)有限公司 Data synchronization method, equipment and computer readable storage medium
CN112613877A (en) * 2020-12-17 2021-04-06 腾讯科技(深圳)有限公司 Intelligent contract triggering method and device applied to block chain network and related equipment
CN112883425A (en) * 2021-03-26 2021-06-01 重庆度小满优扬科技有限公司 Data processing method based on block chain and block chain link point
CN113327167A (en) * 2021-06-24 2021-08-31 深圳前海微众银行股份有限公司 Block chain data processing method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107025559A (en) * 2017-01-26 2017-08-08 阿里巴巴集团控股有限公司 A kind of method for processing business and device
CN109684408A (en) * 2018-12-07 2019-04-26 深圳市智税链科技有限公司 Data managing method, device, medium and the electronic equipment of block catenary system
JP6532930B1 (en) * 2017-11-17 2019-06-19 メタップス・プラス・インコーポレイテッドMetaps Plus Inc. Distributed ledger for block chain based user identification management, distributed ledger method
CN110060155A (en) * 2019-01-31 2019-07-26 阿里巴巴集团控股有限公司 The intelligent contract of block chain executes method and device and electronic equipment
CN110069345A (en) * 2019-04-23 2019-07-30 江苏大学 Crowdsourcing resource distribution formula anonymity dispensing method and its allocating system based on block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107025559A (en) * 2017-01-26 2017-08-08 阿里巴巴集团控股有限公司 A kind of method for processing business and device
JP6532930B1 (en) * 2017-11-17 2019-06-19 メタップス・プラス・インコーポレイテッドMetaps Plus Inc. Distributed ledger for block chain based user identification management, distributed ledger method
CN109684408A (en) * 2018-12-07 2019-04-26 深圳市智税链科技有限公司 Data managing method, device, medium and the electronic equipment of block catenary system
CN110060155A (en) * 2019-01-31 2019-07-26 阿里巴巴集团控股有限公司 The intelligent contract of block chain executes method and device and electronic equipment
CN110069345A (en) * 2019-04-23 2019-07-30 江苏大学 Crowdsourcing resource distribution formula anonymity dispensing method and its allocating system based on block chain

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112613877A (en) * 2020-12-17 2021-04-06 腾讯科技(深圳)有限公司 Intelligent contract triggering method and device applied to block chain network and related equipment
CN112287033A (en) * 2020-12-24 2021-01-29 腾讯科技(深圳)有限公司 Data synchronization method, equipment and computer readable storage medium
CN112883425A (en) * 2021-03-26 2021-06-01 重庆度小满优扬科技有限公司 Data processing method based on block chain and block chain link point
CN112883425B (en) * 2021-03-26 2023-05-16 重庆度小满优扬科技有限公司 Block chain-based data processing method and block chain link point
CN113327167A (en) * 2021-06-24 2021-08-31 深圳前海微众银行股份有限公司 Block chain data processing method
CN113327167B (en) * 2021-06-24 2024-03-22 深圳前海微众银行股份有限公司 Block chain data processing method

Similar Documents

Publication Publication Date Title
KR102201235B1 (en) Service process system, service data processing method and device
US20220263671A1 (en) Data processing method, apparatus, and device, blockchain system, and computer-readable storage medium
CN109218079B (en) Block chain network, deployment method and storage medium
CN109325854B (en) Block chain network, deployment method and storage medium
US9967334B2 (en) Computing device configuration and management using a secure decentralized transaction ledger
CN110503373B (en) Logistics method and device based on block chain network
CN110955724A (en) Data processing method and device based on block chain, node equipment and storage medium
CN111507717B (en) Data processing method, device, block node and computer readable storage medium
CN112435030B (en) Data processing method and device based on block chain and electronic equipment
CN112200571B (en) Resource distribution method and device based on block chain and electronic equipment
CN108701309A (en) A kind of distributed user profile authentication system for security of e-commerce transactions
CN112801658B (en) Cross-border resource transfer authenticity auditing method and device and electronic equipment
CN111464356B (en) Block consensus period switching method and device and computer equipment
CN112613877B (en) Intelligent contract triggering method and device applied to block chain network and related equipment
CN111597567B (en) Data processing method, data processing device, node equipment and storage medium
CN112101942A (en) Transaction request processing method, system, device and equipment based on block chain
CN112200568B (en) Block chain based account creation method and device and electronic equipment
CN111698315A (en) Data processing method and device for block and computer equipment
CN111506932A (en) Block chain calculation uplink implementation method
CN115374175A (en) Method and device for tracking task execution progress based on micro-service architecture
CN112991023B (en) Order data processing method and device, computer equipment and storage medium
CN110598479A (en) Data processing method and device and computer readable storage medium
CN112837043B (en) Block chain-based data processing method and device and electronic equipment
JP2024514858A (en) blockchain key generation
Islam et al. A blockchain-based crowdsourced task assessment framework using smart contract

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination