CN111488626A - Data processing method, device, equipment and medium based on block chain - Google Patents

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

Info

Publication number
CN111488626A
CN111488626A CN202010273718.3A CN202010273718A CN111488626A CN 111488626 A CN111488626 A CN 111488626A CN 202010273718 A CN202010273718 A CN 202010273718A CN 111488626 A CN111488626 A CN 111488626A
Authority
CN
China
Prior art keywords
transaction data
target transaction
validity
target
block
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
CN202010273718.3A
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 CN202010273718.3A priority Critical patent/CN111488626A/en
Publication of CN111488626A publication Critical patent/CN111488626A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a data processing method, a device, equipment and a readable storage medium based on a block chain, wherein the method comprises the following steps: reading target transaction data from a first cache region, and acquiring attribute information of the target transaction data; verifying the validity of the target transaction data according to the attribute information of the target transaction data; if the target transaction data has validity, storing the target transaction data into a block of the block chain network, wherein the block is located in a second cache region; and if the target transaction data does not have validity, rolling back the target transaction data. By adopting the method and the device, invalid data can be effectively prevented from being added into the block chain, and the storage space of the block can be saved.

Description

Data processing method, device, equipment and medium based on block chain
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a device, and a medium for processing data based on a blockchain.
Background
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. In a distributed node system, nodes compete to obtain the right of current processing data to serve as block generation nodes; and the generated block is verified and confirmed by other nodes and then stored. The operation mechanism makes the data recorded in the block chain almost impossible to be tampered; if the source data is erroneous before being added to the blockchain, adding the erroneous source data to the block can cause the authenticity of the subsequent data to be questioned, and the storage space of the block is wasted, resulting in a large number of meaningless blocks.
Disclosure of Invention
The embodiment of the application provides a data processing method, a device, equipment and a medium based on a block chain, which effectively avoid invalid data from being added into the block chain and are beneficial to saving the storage space of a block.
The embodiment of the application provides a data processing method based on a block chain, which comprises the following steps:
reading target transaction data from a first cache region, and acquiring attribute information of the target transaction data;
verifying the validity of the target transaction data according to the attribute information of the target transaction data;
if the target transaction data has validity, storing the target transaction data into a block of the block chain network, wherein the block is located in a second cache region;
and if the target transaction data does not have validity, rolling back the target transaction data.
Wherein the rolling back the target transaction data comprises:
inquiring an execution result corresponding to the target transaction data in the first cache region;
and removing the execution result corresponding to the target transaction data and the target transaction data from the first cache region.
Wherein the attribute information includes a first amount of electronic resources required to predict execution of the target transaction data;
the verifying the validity of the target transaction data according to the attribute information of the target transaction data includes:
obtaining a second amount of electronic resources required to actually execute the target transaction data;
comparing the first quantity to the second quantity;
if the first quantity is greater than the second quantity, determining that the target transaction data is valid;
if the first quantity is less than or equal to the second quantity, determining that the target transaction data is not valid.
Wherein the attribute information includes a size of the target transaction data;
the verifying the validity of the target transaction data according to the attribute information of the target transaction data includes:
comparing the size of the target transaction data with a threshold corresponding to the size of the transaction data;
if the size of the target transaction data is larger than a threshold value corresponding to the size of the transaction data, determining that the target transaction data does not have validity;
and if the size of the target transaction data is smaller than or equal to the threshold corresponding to the size of the transaction data, determining that the target transaction data has validity.
Wherein the attribute information includes signature information;
the verifying the validity of the target transaction data according to the attribute information of the target transaction data includes:
acquiring a public key corresponding to the target transaction data;
verifying the signature information according to a public key corresponding to the target transaction data;
if the verification is passed, determining that the target transaction data has validity;
and if the verification fails, determining that the target transaction data does not have validity.
Wherein the method further comprises:
acquiring the number of node devices in the blockchain network, wherein the node devices determine that the target transaction data has effectiveness;
if the obtained quantity is larger than a quantity threshold value, determining that the target transaction data is legal;
if the obtained quantity is less than or equal to the quantity threshold value, determining that the target transaction data is not legal.
The reading of the target transaction data from the first cache region and the obtaining of the attribute information of the target transaction data includes:
receiving transaction data to be linked up, and storing the transaction data to be linked up in the first cache region;
acquiring characteristic information of each transaction data in the first cache region, wherein the characteristic information comprises at least one of transaction type, received time and importance priority;
and reading transaction data from the first cache block in sequence according to the characteristic information, and determining the read transaction data as the target transaction data.
The block chain network comprises intelligent contracts, and the intelligent contracts declare storage rules of transaction data in the block chain network;
the intelligent contract is used for verifying the validity of the target transaction data according to the attribute information of the target transaction data, and storing the target transaction data into a block of the block chain network when the target transaction data has the validity;
rolling back the target transaction data when the target transaction data is not valid.
An embodiment of the present application provides a data processing apparatus based on a block chain, including:
the first acquisition module is used for reading target transaction data from a first cache region and acquiring attribute information of the target transaction data;
the verification module is used for verifying the validity of the target transaction data according to the attribute information of the target transaction data;
the storage module is used for storing the target transaction data into a block of the block chain network if the target transaction data has validity, and the block is located in a second cache region;
and the rollback module is used for rolling back the target transaction data if the target transaction data does not have validity.
Wherein the rollback module comprises:
the query unit is used for querying an execution result corresponding to the target transaction data in the first cache region;
a removing unit, configured to remove, from the first cache region, an execution result corresponding to the target transaction data and the target transaction data.
Wherein the attribute information includes a first amount of electronic resources required to predict execution of the target transaction data;
wherein the verification module comprises:
a first obtaining unit configured to obtain a second amount of electronic resources required to actually execute the target transaction data;
a first comparing unit for comparing the first number with the second number;
a first determining unit, configured to determine that the target transaction data has validity if the first amount is greater than the second amount;
a second determining unit, configured to determine that the target transaction data is not valid if the first amount is less than or equal to the second amount.
Wherein the attribute information includes a size of the target transaction data;
wherein the verification module further comprises:
the second comparison unit is used for comparing the size of the target transaction data with a threshold value corresponding to the size of the transaction data;
a third determining unit, configured to determine that the target transaction data does not have validity if the size of the target transaction data is larger than a threshold corresponding to the size of the transaction data;
and the fourth determining unit is used for determining that the target transaction data has validity if the size of the target transaction data is smaller than or equal to the threshold corresponding to the size of the transaction data.
Wherein the attribute information includes signature information;
wherein the verification module further comprises:
the second acquisition unit is used for acquiring a public key corresponding to the target transaction data;
the verification unit is used for verifying the signature information according to a public key corresponding to the target transaction data;
a fifth determining unit, configured to determine that the target transaction data has validity if the verification passes;
a sixth determining unit, configured to determine that the target transaction data does not have validity if the verification fails.
Wherein the apparatus further comprises:
a second obtaining module, configured to obtain the number of node devices in the blockchain network that determine that the target transaction data has validity;
a first determining module, configured to determine that the target transaction data is valid if the obtained number is greater than a number threshold;
a second determining module, configured to determine that the target transaction data is not valid if the obtained quantity is less than or equal to the quantity threshold.
Wherein, first acquisition module includes:
the storage unit is used for receiving the transaction data to be linked and storing the transaction data to be linked to the first cache region;
a third obtaining unit, configured to obtain feature information of each transaction data in the first cache region, where the feature information includes at least one of a transaction type, a received time, and an importance priority;
a seventh determining unit, configured to read transaction data from the first cache block in sequence according to the feature information, and determine the read transaction data as the target transaction data.
The block chain network comprises intelligent contracts, and the intelligent contracts declare storage rules of transaction data in the block chain network;
the intelligent contract is used for verifying the validity of the target transaction data according to the attribute information of the target transaction data, and storing the target transaction data into a block of the block chain network when the target transaction data has the validity;
rolling back the target transaction data when the target transaction data is not valid.
An embodiment of the present application provides a computer device, including: a processor, a memory, a network interface;
the processor is connected with a memory and a network interface, wherein the network interface is used for providing a data communication function, the memory is used for storing a computer program, and the processor is used for calling the computer program to execute the method in the embodiment of the application.
Embodiments of the present application provide a computer-readable storage medium storing a computer program comprising program instructions that, when executed by a processor, perform a method as in embodiments of the present application.
In the embodiment of the application, the attribute information of the target transaction data is acquired by reading the target transaction data from the first cache region, and the validity of the target transaction data is verified according to the attribute information of the target transaction data. If the target transaction data has validity, the target transaction data is accurate, or the target transaction data is not tampered and the like, the target transaction data is stored in a block of a block chain network, and the block is located in a second cache area; and if the target transaction data does not have validity, indicating that the target transaction data has error data, or the target transaction data is tampered and the like, rolling back the target transaction data. By adopting the method and the device, the validity of the target transaction data is verified according to the attribute information of the target transaction data, invalid data can be effectively prevented from being added into the block chain, the storage space of the block can be saved, and the validity of the data in the block chain is guaranteed. In addition, by caching the target transaction data in the first cache region, when the target transaction data passes the verification, the target transaction data is recorded in a block of the second cache region; that is to say, the target transaction data is cached in a double-layer mode, so that the effectiveness of the target transaction data can be verified orderly, and the verification accuracy 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. 1a is a block diagram of a data processing system according to an embodiment of the present invention;
FIG. 1b is a schematic diagram of a data sharing system according to an embodiment of the present application;
FIG. 1c is a schematic structural diagram of a block chain according to an embodiment of the present disclosure;
FIG. 1d is a diagram of a new block generation process provided by an embodiment of the present application;
fig. 2 is a schematic diagram of an application scenario of data processing based on a block chain according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a data processing method based on a block chain according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a data processing method based on a block chain according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data processing apparatus based on a block chain according to an embodiment of the present application;
fig. 6 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 clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the 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.
The block chain related to the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission (P2P transmission), consensus mechanism, encryption algorithm and the like, is essentially a decentralized database, and is a series of data blocks which are generated in a correlation mode by using a cryptography method, wherein each data block contains information of a batch of network transactions and is used for verifying the validity (anti-counterfeiting) of the information and generating the next block. The blockchain can comprise a blockchain bottom platform, a platform product service layer and an application service layer; the blockchain can be composed of a plurality of serial transaction records (also called blocks) which are connected in series by cryptography and protect the contents, and the distributed accounts connected in series by the blockchain can effectively record the transactions by multiple parties and can permanently check the transactions (can not be tampered). The consensus mechanism is a mathematical algorithm for establishing trust and obtaining rights and interests among different nodes in the block chain network; that is, the consensus mechanism is a mathematical algorithm commonly recognized by network nodes in the blockchain.
First, the architecture of the data processing system applied in the present application is described, as shown in fig. 1 a. The system architecture diagram includes a block chain network and a plurality of terminals, and fig. 1a illustrates three terminals, which are a first terminal, a second terminal and a third terminal. The first terminal, the second terminal and the third terminal can be used for acquiring transaction data from the blockchain network or uploading the transaction data to the blockchain network.
The blockchain network may be the blockchain network 100 shown in fig. 1b, where the blockchain network 100 refers to a system for performing data sharing between node devices, the blockchain network may include a plurality of node devices 101, and the plurality of node devices 101 may refer to each client in the blockchain network. Each node device 101 may receive transaction data while operating normally and maintain shared data within the blockchain network based on the received transaction data. In order to ensure information intercommunication in the blockchain network, information connection may exist between each node device in the blockchain network, and information transmission may be performed between the node devices through the information connection. For example, when any node device in the blockchain network receives transaction data, other node devices in the blockchain network acquire the transaction data according to a consensus algorithm, and store the transaction data as data in shared data, so that the data stored in all the node devices in the blockchain network are consistent.
Each node device in the blockchain network has a node device identifier corresponding thereto, and each node device in the blockchain network can store node device identifiers of other node devices in the blockchain network, so that the generated block is broadcast to other node devices in the blockchain network according to the node device identifiers of other node devices in the blockchain network. Each node device may maintain a node device identifier list as shown in the following table, and store the node device name and the node device identifier in the node device identifier list correspondingly. The node device identifier may be an IP (internet protocol) address and any other information that can be used to identify the node device, and table 1 only illustrates the IP address as an example.
Table 1:
node device name Node device identification
Node device 1 117.114.151.174
Node device 2 117.116.189.145
Node device N 119.123.789.258
Each node device in the blockchain network stores one identical blockchain. The block chain is composed of a plurality of blocks, referring to fig. 1c, the block chain is composed of a plurality of blocks, the starting block comprises a block head and a block main body, the block head stores transaction data characteristic values, version numbers, timestamps and difficulty values, and the block main body stores transaction data; the next block of the starting block takes the starting block as a parent block, the next block also comprises a block head and a block main body, the block head stores the transaction data characteristic value of the current block, the block head characteristic value of the parent block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, and the security of the transaction data in the blocks is ensured.
When each block in the block chain is generated, referring to fig. 1d, when the node device where the block chain is located receives transaction data, verifying the transaction data, after the verification is completed, storing the transaction data in a memory pool, and updating a hash tree used for recording the transaction data; and then, updating the updating time stamp to the time when the transaction data is received, trying different random numbers, and calculating the characteristic value for multiple times, so that the calculated characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
wherein, SHA256 is a characteristic value algorithm used for calculating a characteristic value; version is version information of the relevant block protocol in the block chain; prev _ hash is a block head characteristic value of a parent block of the current block; merkle _ root is a characteristic value of the transaction data; ntime is the update time of the update timestamp; nbits is the current difficulty, is a fixed value within a period of time, and is determined again after exceeding a fixed time period; x is a random number; TARGET is a feature threshold, which can be determined from nbits.
Therefore, when the random number meeting the formula is obtained through calculation, the information can be correspondingly stored, and the block head and the block main body are generated to obtain the current block. And then, the node equipment where the block chain is located respectively sends the newly generated blocks to other node equipment in the block chain network where the newly generated blocks are located according to the node equipment identifications of the other node equipment in the block chain network, the newly generated blocks are verified by the other node equipment, and the newly generated blocks are added to the block chain stored in the newly generated blocks after the verification is completed.
Further, as shown in fig. 2, in the process of implementing the data processing method based on the blockchain, as shown in fig. 2, each terminal device may upload transaction data to the blockchain network, and for example, the first terminal uploads the transaction data to the blockchain network. The first terminal may upload target transaction data to the blockchain network, and accordingly, the node device 101 may receive the target transaction data sent by the first terminal, cache the target transaction data in the first cache region, and acquire attribute information of the target transaction data; and verifying the validity of the target transaction data according to the attribute information of the target transaction data. When node device 101 verifies that the target transaction data is valid, the target transaction data may be recorded into a tile in the blockchain network. As shown in fig. 2, node apparatus 101 may store target transaction data into block 10001, where block 10001 includes a block header and a block body, and the block header includes 10000H, 10001T, and so on, where 10000H represents a hash value of the block header of block 10000 in the block chain, 10001H represents a hash value corresponding to the transaction data in the block body, and 10001T represents a block generation timestamp of block 10001. The block includes target transaction data, although other transaction data may be included. And if the target transaction data does not have validity, rolling back the target transaction data in the first cache region.
The node device, the first terminal, the second terminal and the third terminal in the block chain network may be computer devices, including mobile phones, tablet computers, notebook computers, palmtop computers, smart audio devices, mobile internet devices (MID, mobile internet devices), POS (Point Of Sales) machines, wearable devices (e.g., smart watches, smart bracelets, etc.), and the like; the method can also refer to an independent server, a server cluster consisting of a plurality of servers, or a cloud computing center.
Further, please refer to fig. 3, which is a flowchart illustrating a data processing method based on a blockchain according to an embodiment of the present application, where the method may be executed by a computer device, and the computer device may be the node device 101 in fig. 1 b. As shown in fig. 3, the method may include:
s101, reading target transaction data from the first cache region, and obtaining attribute information of the target transaction data.
The computer equipment can receive transaction data sent by the terminal, determine the received transaction data as transaction data to be linked, store a plurality of transaction data to be linked in a first cache region, and read target transaction data from the first cache region according to a certain sequence. The target transaction data may refer to any one of the transaction data. The order here may include the time order in which the transaction data is buffered in the first buffer, the priority of importance of the transaction data, and the like; the target transaction data includes, but is not limited to, transaction data of electronic resource transfer, equity transaction data, digital currency transaction data, and fund transaction data, etc. Upon reading the target transaction data, attribute information of the target transaction data may be obtained, where the attribute information includes a first amount of electronic resources required to predict execution of the target transaction data, a size of the target transaction data, signature information of the target transaction data, a generation time of the target transaction data, and so on. I.e., the first amount may refer to the amount of electronic resources that the user is willing to pay to execute the target transaction data. The electronic resource refers to a fund for purchasing the digital assets, and may include at least french currency, electronic money, and the like. Digital assets herein may include, but are not limited to: electronic tickets, digital currency (an unregulated, digitized currency), gaming resources (e.g., gaming chips, gaming equipment, etc.), and so forth.
Optionally, step S101 may include: receiving transaction data to be linked up, and storing the transaction data to be linked up in the first cache region; acquiring characteristic information of each transaction data in the first cache region, wherein the characteristic information comprises at least one of transaction type, received time and importance priority; and reading transaction data in sequence from the first cache block according to the characteristic information, and determining the read transaction data as the target transaction data.
The node equipment may read the transaction data in the first buffer in sequence, and specifically, the node equipment may receive the transaction data to be uplink sent by each terminal, and store the transaction data to be uplink into the first buffer; the method comprises the steps of obtaining characteristic information of each transaction data in a first cache region, reading the transaction data from the first cache region in sequence according to the characteristic information, and determining the read transaction data as the target transaction data. Therefore, the transaction data can be verified orderly, and the flexibility and the accuracy of verification are improved.
Optionally, the characteristic information includes transaction types, the transaction types may include real-time transaction types and non-real-time transaction types, and the real-time transaction types may include electronic resource transfer (real-time account), uplink electronic certificates, and the like; the non-real-time transaction types may include uplink news data, user registration data, and the like. Thus, the computer device may preferentially read transaction data of a real-time transaction type and then read transaction data of a non-real-time transaction type; this ensures that real-time transaction-type transaction data can be processed in real-time.
Optionally, the feature information may include an importance priority, and the importance priority may be determined according to an organization to which the transaction data belongs, for example, if the transaction data belongs to the ministry of public security and the ministry of civil affairs, the importance priority of the transaction data is higher; conversely, if the transaction data belongs to a business or individual, the transaction data may be of lower priority of importance. The importance priority is used for indicating the importance, privacy and the like of the transaction data, namely the higher the importance priority is, the higher the importance, privacy and the like of the transaction data are; the lower the importance priority, the lower the importance, privacy of the transaction data. Therefore, the computer equipment can read the transaction data with high importance priority preferentially and then read the transaction data with low importance priority; therefore, the transaction data with high importance priority can be processed in real time, the safety of the transaction data can be effectively improved, and the transaction data with high importance priority is prevented from being leaked.
Optionally, the characteristic information may include a received time, and the computer device may sequentially read the transaction data according to a sequence of the received time of the transaction data in the first buffer from first to last, so as to improve fairness of processing the transaction data.
And S102, verifying the validity of the target transaction data according to the attribute information of the target transaction data.
The computer device may verify the validity of the target transaction data according to the attribute information of the target transaction data, and specifically, verifying the validity of the target transaction data may refer to: verifying whether the target transaction data can be successfully executed; if the target transaction data can be successfully executed, determining that the target transaction data has validity; if the transaction cannot be successfully executed, determining that the target transaction data is not valid; optionally, verifying whether the target transaction data is valid may refer to: verifying the authenticity, integrity (i.e., whether tampered) of the target transaction data, and determining that the target transaction data is valid if the target transaction data is authentic, intact (i.e., not tampered); if the target transaction data is not authentic, incomplete (i.e., tampered with), the target transaction data is determined to be not valid.
The first quantity of electronic resources required for predicting the execution of the target transaction data and the generation time of the target transaction data in the attribute information can be used for verifying whether the target transaction data can be successfully executed or not; the size of the target transaction data in the attribute information and the signature information of the target transaction data are used for verifying the authenticity and integrity (i.e. whether the target transaction data is tampered or not).
And S103, if the target transaction data has validity, storing the target transaction data into a block of the block chain network, wherein the block is located in a second cache region.
If the target transaction data is valid, indicating that the target transaction data is complete, authentic, or can be successfully executed, the computer device may store the target transaction data in a block of the blockchain network, the block located in the second cache. The validity of the target transaction data is verified in the first cache region, the transaction data with the validity is sent to the second cache region, information connection exists between the first cache region and the second cache region, and information transmission is carried out through the information connection. Therefore, the first cache region can immediately verify the target transaction data, and store the target transaction data into the second cache region according to the verification result, so as to obtain the target transaction number without validity for rollback. Therefore, the storage space of the first cache region is smaller, and the storage space of the second cache region is larger.
It should be noted that, if the transaction data in the first cache is read, the read transaction data may be deleted from the first cache region, so as to save the storage space and effectively store more new transaction data; that is, the transaction data in the first cache only needs to be stored temporarily, and therefore, the first cache region may be located in a solid state disk of the computer device. Similarly, the transaction data in the blockchain network needs to be stored for a long time and can be inquired and read by the terminal for many times, so that the second cache region can be located in a mechanical hard disk of the computer device; it can be ensured that the transaction data is securely cached.
And S104, rolling back the target transaction data if the target transaction data does not have validity.
If the target transaction data does not have validity, indicating that the target transaction data does not have integrity, authenticity, or cannot be successfully executed, the computer device may rollback the target transaction data; invalid transaction data can be prevented from being stored in the block, and the storage space of the block is saved.
In the embodiment of the application, the attribute information of the target transaction data is acquired by reading the target transaction data from the first cache region, and the validity of the target transaction data is verified according to the attribute information of the target transaction data. If the target transaction data has validity, the target transaction data is accurate, or the target transaction data is not tampered and the like, the target transaction data is stored in a block of a block chain network, and the block is located in a second cache area; and if the target transaction data does not have validity, indicating that the target transaction data has error data, or the target transaction data is tampered and the like, rolling back the target transaction data. By adopting the method and the device, the validity of the target transaction data is verified according to the attribute information of the target transaction data, invalid data can be effectively prevented from being added into the block chain, the storage space of the block can be saved, and the validity of the data in the block chain is guaranteed. In addition, by caching the target transaction data in the first cache region, when the target transaction data passes the verification, the target transaction data is recorded in a block of the second cache region; that is to say, the target transaction data is cached in a double-layer mode, so that the effectiveness of the target transaction data can be verified orderly, and the verification accuracy is improved.
Referring to fig. 4, it is a flowchart illustrating a method for processing data based on a blockchain according to an embodiment of the present application, where the method may be executed by a computer device, and the computer device may be the node device 101 in fig. 1 b. As shown in fig. 4, the method may include:
s201, reading target transaction data from a first cache region, and acquiring attribute information of the target transaction data;
s202, verifying the validity of the target transaction data according to the attribute information of the target transaction data;
optionally, the attribute information includes a first amount of electronic resources required to predict execution of the target transaction data; step S202 may include: obtaining a second quantity of electronic resources required for actually executing the target transaction data, comparing the first quantity with the second quantity, if the first quantity is greater than the second quantity, determining that the target transaction data has validity, and if the first quantity is less than or equal to the second quantity, determining that the target transaction data does not have validity.
After the target transaction data are read from the first cache region, a first quantity of electronic resources required by a user for predicting the execution of the target transaction data is obtained, a second quantity of the electronic resources required by the user for actually executing the target transaction data, which is stored in advance, is obtained, and the first quantity and the second quantity are compared. And if the first amount is larger than the second amount, determining that the target transaction data has validity, namely, indicating that the currency required by the user for predicting to execute the target transaction data is larger than the currency required by actually executing the target transaction data, and then the transaction execution can be successful. If the first amount is less than or equal to the second amount, it is determined that the target transaction data is not valid, that is, if the currency predicted by the user to be required for executing the target transaction data is less than or equal to the currency actually required for executing the target transaction data, the currency required for executing the transaction is insufficient, and the transaction cannot be successful. For example, if the first amount of electronic resources required by the user to predict execution of the target transaction data is 100rmb and the second amount of electronic resources required to actually execute the target transaction data is 190rmb, the first amount is less than the second amount, which indicates that the user is not enough electronic resources required to actually execute the target transaction data to predict execution of the target transaction data and that the transaction will be executed with failure, and the target transaction data is determined to be not valid.
Optionally, the attribute information includes a size of the target transaction data, and the step S202 includes: comparing the size of the target transaction data with a threshold corresponding to the size of the transaction data; if the size of the target transaction data is larger than the threshold value corresponding to the size of the transaction data, determining that the target transaction data does not have validity; and if the size of the target transaction data is smaller than or equal to the threshold corresponding to the size of the transaction data, determining that the target transaction data has validity.
Wherein the attribute information further includes a size of the target transaction data. Similarly, after the target transaction data are read from the first cache region, the size of the target transaction data is obtained and compared with the size of the preset transaction data, if the size of the target transaction data is larger than a threshold corresponding to the size of the preset transaction data, it is indicated that redundant data exist in the target transaction data, and if the size of the target transaction data does not meet the condition, it is determined that the target transaction data do not have validity; and if the size of the target transaction data is smaller than or equal to a threshold corresponding to the size of the preset transaction data, indicating that redundant data does not exist in the target transaction data, determining that the target transaction data has validity. For example, if the size of the target transaction data read from the first buffer is 50mb and the preset threshold corresponding to the size of the transaction data is 30mb, the size of the target transaction data is larger than the threshold corresponding to the size of the transaction data, which indicates that the size of the target transaction data is too large, and therefore the target transaction data is not valid.
Optionally, the attribute information includes signature information, and the step S202 includes: acquiring a public key corresponding to the target transaction data; verifying the signature information according to a public key corresponding to the target transaction data; if the verification is passed, determining that the target transaction data has validity; and if the verification fails, determining that the target transaction data is not valid.
The attribute information also comprises signature information, and the computer equipment can acquire a public key corresponding to the target transaction data; the public key corresponding to the target transaction data may refer to a public key of a terminal that uploads the target transaction data. The signature information can be verified according to the public key corresponding to the target transaction data, if the verification is passed, the target transaction data is not tampered and has integrity, and the target transaction data is determined to have validity; if the verification fails, the target transaction is indicated to be tampered and not to have integrity, and the target transaction data is determined not to have validity.
Specifically, when the target transaction data is not uploaded to the node device, the terminal can perform hash operation on the target transaction data to obtain a hash value of the target transaction data, encrypt the hash value of the target transaction data by using a private key to obtain signed target transaction data carrying the terminal, and send the target transaction data and the signed target transaction data carrying the terminal to the node device of the block chain network.
Accordingly, the node device (i.e., the computer device) may receive the target transaction data sent by the terminal and the target transaction data carrying the signature of the terminal, and the node device may obtain the public key of the terminal device and use the public key as the public key corresponding to the target transaction data. And carrying out Hash operation on the target transaction data to obtain a first Hash value, and decrypting the signed target transaction data of the terminal by adopting a public key to obtain a second Hash value. Comparing the first hash value with the second hash value, if the first hash value is different from the second hash value, indicating that the target transaction data does not have integrity, namely the target transaction data is tampered, and determining that the target transaction data is not verified; if the first hash value is the same as the second hash value, it is indicated that the target transaction data does not have integrity, or the target transaction data is tampered, and the target transaction data is determined to be verified and passed. For example, when a user submits a transaction, the first cache region reads target transaction data submitted by the user and immediately obtains signature information of the target transaction data, the node device may obtain a public key in a terminal corresponding to the target transaction data, use the public key as a public key corresponding to the target transaction data, verify the target transaction data according to the public key corresponding to the target transaction data, and if the verification is passed, the transaction submitted by the user may be successfully executed, and then determine that the target transaction data corresponding to the transaction submitted by the user has validity. And if the verification fails, the transaction execution submitted by the user fails, and the target transaction data corresponding to the transaction submitted by the user is determined to have no validity.
Wherein, the number of node devices in the blockchain network that determine that the target transaction data has validity may be obtained; if the obtained quantity is larger than the quantity threshold value, determining that the target transaction data has legality; if the obtained quantity is less than or equal to the quantity threshold, the target transaction data is determined not to be legitimate.
Each terminal device can upload transaction data to the blockchain network, and correspondingly, each node device receives target transaction data sent by each terminal device, caches the target transaction data in a first cache region, and acquires attribute information of the target transaction data; and verifying the validity of the target transaction data according to the attribute information of the target transaction data. When each node device verifies that the target transaction data is valid, the target transaction data may be recorded into a tile in the blockchain network. Therefore, the number of node devices in the blockchain network, which determine that the target transaction data has validity, can be acquired, if the acquired number is greater than the number threshold, the target transaction data is determined to have validity, and if the acquired number is less than or equal to the number threshold, the target transaction data is determined not to have validity.
S203, if the target transaction data has validity, storing the target transaction data into a block of the block chain network, wherein the block is located in a second cache region;
s204, if the target transaction data does not have validity, inquiring an execution result corresponding to the target transaction data in the first cache region;
s205, removing the execution result corresponding to the target transaction data and the target transaction data from the first buffer.
After the validity of the target transaction data is verified through the above steps, if the target transaction data has validity, it indicates that the target transaction data has integrity, authenticity, or can be successfully executed, so that the computer device can store the target transaction data in a block of the blockchain network, where the block is located in the second cache area. The validity of the target transaction data is verified in the first cache region, the transaction data with the validity is sent to the second cache region, information connection exists between the first cache region and the second cache region, and information transmission is carried out through the information connection. If the target transaction data does not have validity, it indicates that the target transaction data does not have integrity, authenticity, or cannot be successfully executed, therefore, the computer device may query the execution result corresponding to the target transaction data in the first cache region, and remove the execution result corresponding to the target transaction data and the target transaction data from the first cache region, which may avoid storing invalid transaction data into a block, and is beneficial to saving the storage space of the block, and store the target transaction data into a block of the block chain network, where the block is located in the second cache region. At least one transaction data in the first cache region is verified by the method, and the transaction data with validity is stored in the second cache region. The target transaction data with validity in the at least one transaction data can be submitted again after the at least one transaction data is verified in the first cache region, because some transaction data may be submitted in a postponed manner, so that the operation of submitting the transaction data is reduced.
Wherein the blockchain network includes intelligent contracts. An intelligent contract, which is a computerized agreement, can execute the terms of a certain contract, is realized by codes which are deployed on a shared account and are used for executing when certain conditions are met, and is 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. The intelligent contract declares a storage rule of transaction data in the blockchain network, and is used for verifying the validity of the target transaction data according to the attribute information of the target transaction data, storing the target transaction data into a block of the blockchain network when the target transaction data has validity, and rolling back the target transaction data when the target transaction data does not have validity.
In the embodiment of the application, the attribute information of the target transaction data is acquired by reading the target transaction data from the first cache region, and the validity of the target transaction data is verified according to the attribute information of the target transaction data. If the target transaction data has validity, the target transaction data is accurate, or the target transaction data is not tampered and the like, the target transaction data is stored in a block of a block chain network, and the block is located in a second cache area; and if the target transaction data does not have validity, indicating that the target transaction data has error data, or the target transaction data is tampered and the like, rolling back the target transaction data. By adopting the method and the device, the validity of the target transaction data is verified according to the attribute information of the target transaction data, invalid data can be effectively prevented from being added into the block chain, the storage space of the block can be saved, and the validity of the data in the block chain is guaranteed. In addition, by caching the target transaction data in the first cache region, when the target transaction data passes the verification, the target transaction data is recorded in a block of the second cache region; that is to say, the target transaction data is cached in a double-layer mode, so that the effectiveness of the target transaction data can be verified orderly, and the verification accuracy is improved.
An embodiment of the present invention further provides a data processing apparatus based on a block chain, and as shown in fig. 5, the data processing apparatus based on a block chain according to the embodiment of the present application is schematically configured. The data processing means of the blockchain may be a computer program (comprising program code) running in a computer device, e.g. the data processing means of the blockchain is an application software; the apparatus may be used to perform the corresponding steps in the methods provided by the embodiments of the present application. As shown in fig. 5, the data processing apparatus may include: the system comprises a first obtaining module 11, a verifying module 12, a storing module 13, a rollback module 14, a second obtaining module 15, a first determining module 16 and a second determining module 17.
The first obtaining module 11 is configured to read target transaction data from the first cache region, and obtain attribute information of the target transaction data;
the verification module 12 is used for verifying the validity of the target transaction data according to the attribute information of the target transaction data;
the storage module 13 is configured to store the target transaction data into a block of the blockchain network if the target transaction data is valid, where the block is located in the second cache region;
and the rollback module 14 is configured to rollback the target transaction data if the target transaction data does not have validity.
For specific functional implementation manners of the obtaining request module 11, the generating and adding module 12, the parameter obtaining module 13, and the verifying module 14, reference may be made to steps S101 to S104 in the embodiment corresponding to fig. 3, which is not described herein again.
The first obtaining module may include a storage unit, a third obtaining unit, and a seventh determining unit.
The storage unit is used for receiving the transaction data to be linked and storing the transaction data to be linked to the first cache region;
a third obtaining unit, configured to obtain feature information of each transaction data in the first cache area, where the feature information includes at least one of a transaction type, a received time, and an importance priority;
and the seventh determining unit is used for reading the transaction data from the first cache block in sequence according to the characteristic information and determining the read transaction data as target transaction data.
Referring to fig. 5 again, the verification module 12 may include a first obtaining unit 1201, a first comparing unit 1202, a first determining unit 1203, a second determining unit 1204, a second comparing unit 1205, a third determining unit 1206, a fourth determining unit 1207, a second obtaining unit 1208, a verifying unit 1209, a fifth determining unit 1210, and a sixth determining unit 1211.
A first obtaining unit 1201, configured to obtain a second amount of electronic resources required to actually execute the target transaction data;
a first comparison unit 1202 for comparing the first number with the second number;
a first determining unit 1203, configured to determine that the target transaction data has validity if the first amount is greater than the second amount;
a second determining unit 1204, configured to determine that the target transaction data is not valid if the first amount is less than or equal to the second amount;
a second comparing unit 1205, configured to compare the size of the target transaction data with a threshold corresponding to the size of the transaction data;
a third determining unit 1206, configured to determine that the target transaction data is not valid if the size of the target transaction data is greater than a threshold corresponding to the size of the transaction data;
a fourth determining unit 1207, configured to determine that the target transaction data has validity if the size of the target transaction data is smaller than or equal to the threshold corresponding to the size of the transaction data;
a second obtaining unit 1208, configured to obtain a public key corresponding to the target transaction data;
a verifying unit 1209, configured to verify the signature information according to a public key corresponding to the target transaction data;
a fifth determining unit 1210, configured to determine that the target transaction data has validity if the verification passes;
a sixth determining unit 1211, configured to determine that the target transaction data is not valid if the verification fails.
Referring again to fig. 5, the rollback module 14 may include a query unit 1401, a remove unit 1402.
A query unit 1401, configured to query, in the first cache area, an execution result corresponding to the target transaction data;
a removing unit 142, configured to remove the execution result and the target transaction data corresponding to the target transaction data from the first cache region;
a second obtaining module 15, configured to obtain the number of node devices in the blockchain network, where the target transaction data is determined to have validity;
a first determining module 16, configured to determine that the target transaction data is valid if the obtained number is greater than a number threshold;
and a second determining module 17, configured to determine that the target transaction data is not legal if the acquired quantity is less than or equal to the quantity threshold.
For specific functional implementation manners of the second obtaining module 15, the first determining module 16, and the second determining module 17, reference may be made to the content in the embodiment corresponding to fig. 4, which is not described herein again.
The block chain network comprises intelligent contracts, and the intelligent contracts declare storage rules of transaction data in the block chain network;
the intelligent contract is used for verifying the validity of the target transaction data according to the attribute information of the target transaction data, and storing the target transaction data into a block of the block chain network when the target transaction data has the validity;
rolling back the target transaction data when the target transaction data is not valid.
In the embodiment of the application, the attribute information of the target transaction data is acquired by reading the target transaction data from the first cache region, and the validity of the target transaction data is verified according to the attribute information of the target transaction data. If the target transaction data has validity, the target transaction data is accurate, or the target transaction data is not tampered and the like, the target transaction data is stored in a block of a block chain network, and the block is located in a second cache area; and if the target transaction data does not have validity, indicating that the target transaction data has error data, or the target transaction data is tampered and the like, rolling back the target transaction data. By adopting the method and the device, the validity of the target transaction data is verified according to the attribute information of the target transaction data, invalid data can be effectively prevented from being added into the block chain, the storage space of the block can be saved, and the validity of the data in the block chain is guaranteed. In addition, by caching the target transaction data in the first cache region, when the target transaction data passes the verification, the target transaction data is recorded in a block of the second cache region; that is to say, the target transaction data is cached in a double-layer mode, so that the effectiveness of the target transaction data can be verified orderly, and the verification accuracy is improved.
Fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 6, the computer apparatus 1000 may include: the processor 1001, the network interface 1004, and the memory 1005, and the computer apparatus 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 6, a memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the computer device 1000 shown in fig. 6, the network interface 1004 may provide a network communication function; the user interface 1003 is an interface for providing a user with input; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
reading target transaction data from a first cache region, and acquiring attribute information of the target transaction data;
verifying the validity of the target transaction data according to the attribute information of the target transaction data;
if the target transaction data has validity, storing the target transaction data into a block, wherein the block is positioned in a second cache region;
and if the target transaction data does not have validity, rolling back the target transaction data.
Wherein the rolling back the target transaction data comprises:
inquiring an execution result corresponding to the target transaction data in the first cache region;
and removing the execution result corresponding to the target transaction data and the target transaction data from the first cache region.
Wherein the attribute information includes a first amount of electronic resources required to predict execution of the target transaction data;
the verifying the validity of the target transaction data according to the attribute information of the target transaction data includes:
obtaining a second amount of electronic resources required to actually execute the target transaction data;
comparing the first quantity to the second quantity;
if the first quantity is greater than the second quantity, determining that the target transaction data is valid;
if the first quantity is less than or equal to the second quantity, determining that the target transaction data is not valid.
Wherein the attribute information includes a size of the target transaction data;
the verifying the validity of the target transaction data according to the attribute information of the target transaction data includes:
comparing the size of the target transaction data with a threshold corresponding to the size of the transaction data;
if the size of the target transaction data is larger than a threshold value corresponding to the size of the transaction data, determining that the target transaction data does not have validity;
and if the size of the target transaction data is smaller than or equal to the threshold corresponding to the size of the transaction data, determining that the target transaction data has validity.
Wherein the attribute information includes signature information;
the verifying the validity of the target transaction data according to the attribute information of the target transaction data includes:
acquiring a public key corresponding to the target transaction data;
verifying the signature information according to a public key corresponding to the target transaction data;
if the verification is passed, determining that the target transaction data has validity;
and if the verification fails, determining that the target transaction data does not have validity.
Wherein the method further comprises:
acquiring the number of node devices in the blockchain network, wherein the node devices determine that the target transaction data has effectiveness;
if the obtained quantity is larger than a quantity threshold value, determining that the target transaction data is legal;
if the obtained quantity is less than or equal to the quantity threshold value, determining that the target transaction data is not legal.
The reading of the target transaction data from the first cache region and the obtaining of the attribute information of the target transaction data includes:
receiving transaction data to be linked up, and storing the transaction data to be linked up in the first cache region;
acquiring characteristic information of each transaction data in the first cache region, wherein the characteristic information comprises at least one of transaction type, received time and importance priority;
and reading transaction data from the first cache block in sequence according to the characteristic information, and determining the read transaction data as the target transaction data.
The block chain network comprises intelligent contracts, and the intelligent contracts declare storage rules of transaction data in the block chain network;
the intelligent contract is used for verifying the validity of the target transaction data according to the attribute information of the target transaction data, and storing the target transaction data into a block when the target transaction data has validity;
rolling back the target transaction data when the target transaction data is not valid.
In the embodiment of the application, the attribute information of the target transaction data is acquired by reading the target transaction data from the first cache region, and the validity of the target transaction data is verified according to the attribute information of the target transaction data. If the target transaction data has validity, the target transaction data is accurate, or the target transaction data is not tampered and the like, the target transaction data is stored in a block of a block chain network, and the block is located in a second cache area; and if the target transaction data does not have validity, indicating that the target transaction data has error data, or the target transaction data is tampered and the like, rolling back the target transaction data. By adopting the method and the device, the validity of the target transaction data is verified according to the attribute information of the target transaction data, invalid data can be effectively prevented from being added into the block chain, the storage space of the block can be saved, and the validity of the data in the block chain is guaranteed. In addition, by caching the target transaction data in the first cache region, when the target transaction data passes the verification, the target transaction data is recorded in a block of the second cache region; that is to say, the target transaction data is cached in a double-layer mode, so that the effectiveness of the target transaction data can be verified orderly, and the verification accuracy is improved.
Further, here, it is to be noted that: an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program executed by the data processing apparatus 1 based on a block chain, where the computer program includes program instructions, and when the processor executes the program instructions, the description of the data processing method based on the block chain in the embodiment corresponding to fig. 3 or fig. 4 can be executed, and therefore, details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in embodiments of the computer-readable storage medium referred to in the present application, reference is made to the description of embodiments of the method of the present application. By way of example, the program instructions may be executed on one computer device, or on multiple computer devices located at one site, or distributed across multiple sites and interconnected by a communication network, which may comprise a blockchain network.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
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 (10)

1. A data processing method based on a block chain is applied to node equipment in a block chain network, and is characterized by comprising the following steps:
reading target transaction data from a first cache region, and acquiring attribute information of the target transaction data;
verifying the validity of the target transaction data according to the attribute information of the target transaction data;
if the target transaction data has validity, storing the target transaction data into a block of the block chain network, wherein the block is located in a second cache region;
and if the target transaction data does not have validity, rolling back the target transaction data.
2. The method of claim 1, wherein said rolling back the target transaction data comprises:
inquiring an execution result corresponding to the target transaction data in the first cache region;
and removing the execution result corresponding to the target transaction data and the target transaction data from the first cache region.
3. The method of claim 1 or 2, wherein the attribute information includes a first amount of electronic resources required to predict execution of the target transaction data;
the verifying the validity of the target transaction data according to the attribute information of the target transaction data includes:
obtaining a second amount of electronic resources required to actually execute the target transaction data;
comparing the first quantity to the second quantity;
if the first quantity is greater than the second quantity, determining that the target transaction data is valid;
if the first quantity is less than or equal to the second quantity, determining that the target transaction data is not valid.
4. The method of claim 1 or 2, wherein the attribute information includes a size of the target transaction data;
the verifying the validity of the target transaction data according to the attribute information of the target transaction data includes:
comparing the size of the target transaction data with a threshold corresponding to the size of the transaction data;
if the size of the target transaction data is larger than a threshold value corresponding to the size of the transaction data, determining that the target transaction data does not have validity;
and if the size of the target transaction data is smaller than or equal to the threshold corresponding to the size of the transaction data, determining that the target transaction data has validity.
5. The method of claim 1, wherein the method further comprises:
acquiring the number of node devices in the blockchain network, wherein the node devices determine that the target transaction data has effectiveness;
if the obtained quantity is larger than a quantity threshold value, determining that the target transaction data is legal;
if the obtained quantity is less than or equal to the quantity threshold value, determining that the target transaction data is not legal.
6. The method of claim 1, wherein the reading the target transaction data from the first cache to obtain the attribute information of the target transaction data comprises:
receiving transaction data to be linked up, and storing the transaction data to be linked up in the first cache region;
acquiring characteristic information of each transaction data in the first cache region, wherein the characteristic information comprises at least one of transaction type, received time and importance priority;
and reading transaction data from the first cache block in sequence according to the characteristic information, and determining the read transaction data as the target transaction data.
7. The method of claim 1, wherein the blockchain network includes intelligent contracts that declare storage rules for transactional data in the blockchain network;
the intelligent contract is used for verifying the validity of the target transaction data according to the attribute information of the target transaction data, and storing the target transaction data into a block of the block chain network when the target transaction data has the validity;
rolling back the target transaction data when the target transaction data is not valid.
8. A data processing device based on a block chain is applied to a node device in a block chain network, and is characterized by comprising:
the first acquisition module is used for reading target transaction data from a first cache region and acquiring attribute information of the target transaction data;
the verification module is used for verifying the validity of the target transaction data according to the attribute information of the target transaction data;
the storage module is used for storing the target transaction data into a block of the block chain network if the target transaction data has validity, and the block is located in a second cache region;
and the rollback module is used for rolling back the target transaction data if the target transaction data does not have validity.
9. A computer device, comprising: a processor, a memory, and a network interface;
the processor is connected to a memory for providing data communication functions, a network interface for storing program code, and a processor for calling the program code to perform the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the steps of the method according to any one of claims 1 to 7.
CN202010273718.3A 2020-04-09 2020-04-09 Data processing method, device, equipment and medium based on block chain Pending CN111488626A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010273718.3A CN111488626A (en) 2020-04-09 2020-04-09 Data processing method, device, equipment and medium based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010273718.3A CN111488626A (en) 2020-04-09 2020-04-09 Data processing method, device, equipment and medium based on block chain

Publications (1)

Publication Number Publication Date
CN111488626A true CN111488626A (en) 2020-08-04

Family

ID=71792506

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010273718.3A Pending CN111488626A (en) 2020-04-09 2020-04-09 Data processing method, device, equipment and medium based on block chain

Country Status (1)

Country Link
CN (1) CN111488626A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112488688A (en) * 2020-12-17 2021-03-12 广州智链未来科技有限公司 Transaction processing method, device, equipment and storage medium based on block chain
CN112685780A (en) * 2020-12-31 2021-04-20 杭州链化洞察科技有限公司 Data encryption and decryption method based on block chain
CN112926981A (en) * 2021-03-18 2021-06-08 腾讯科技(深圳)有限公司 Transaction information processing method, device and medium for block chain and electronic equipment
CN113852598A (en) * 2021-08-06 2021-12-28 中标慧安信息技术股份有限公司 Internet of things data transaction process recording method based on block chain

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9166999B1 (en) * 2014-07-25 2015-10-20 Fmr Llc Security risk aggregation, analysis, and adaptive control
US20160140137A1 (en) * 2014-11-18 2016-05-19 International Business Machines Corporation Read and delete input/output operation for database management
CN107273051A (en) * 2017-05-15 2017-10-20 北京华云网际科技有限公司 The reading/writing method and device of I/O data
CN107632779A (en) * 2017-08-24 2018-01-26 阿里巴巴集团控股有限公司 Data processing method and device, server
US20180096386A1 (en) * 2016-10-05 2018-04-05 The Toronto-Dominion Bank System and Method for Facilitating Access to Electronic Data
CN108009008A (en) * 2016-10-28 2018-05-08 北京市商汤科技开发有限公司 Data processing method and system, electronic equipment
CN108269072A (en) * 2016-12-30 2018-07-10 深圳瀚德创客金融投资有限公司 For the transaction processing method and network node of block chain
CN109343797A (en) * 2018-09-25 2019-02-15 郑州云海信息技术有限公司 A kind of data cached transmission method, system and associated component
US20190121416A1 (en) * 2017-10-23 2019-04-25 Paypal, Inc. Electronic Device Battery Monitoring for Transactions
WO2019090344A1 (en) * 2017-11-06 2019-05-09 Velo Holdings Limited Limited scope blockchain system
CN110597839A (en) * 2019-09-20 2019-12-20 腾讯科技(深圳)有限公司 Transaction data processing method, device, equipment and storage medium
CN110599177A (en) * 2019-09-23 2019-12-20 腾讯科技(深圳)有限公司 Transaction verification method and related equipment
CN110597825A (en) * 2019-09-24 2019-12-20 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and node equipment
CN110716689A (en) * 2018-07-11 2020-01-21 阿里巴巴集团控股有限公司 Data processing method and device and computing equipment
CN110851535A (en) * 2019-11-18 2020-02-28 腾讯科技(深圳)有限公司 Data processing method and device based on block chain, storage medium and terminal
CN110910249A (en) * 2019-11-22 2020-03-24 腾讯科技(深圳)有限公司 Data processing method and device, node equipment and storage medium

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9166999B1 (en) * 2014-07-25 2015-10-20 Fmr Llc Security risk aggregation, analysis, and adaptive control
US20160140137A1 (en) * 2014-11-18 2016-05-19 International Business Machines Corporation Read and delete input/output operation for database management
US20180096386A1 (en) * 2016-10-05 2018-04-05 The Toronto-Dominion Bank System and Method for Facilitating Access to Electronic Data
CN108009008A (en) * 2016-10-28 2018-05-08 北京市商汤科技开发有限公司 Data processing method and system, electronic equipment
CN108269072A (en) * 2016-12-30 2018-07-10 深圳瀚德创客金融投资有限公司 For the transaction processing method and network node of block chain
CN107273051A (en) * 2017-05-15 2017-10-20 北京华云网际科技有限公司 The reading/writing method and device of I/O data
CN107632779A (en) * 2017-08-24 2018-01-26 阿里巴巴集团控股有限公司 Data processing method and device, server
US20190121416A1 (en) * 2017-10-23 2019-04-25 Paypal, Inc. Electronic Device Battery Monitoring for Transactions
WO2019090344A1 (en) * 2017-11-06 2019-05-09 Velo Holdings Limited Limited scope blockchain system
CN110716689A (en) * 2018-07-11 2020-01-21 阿里巴巴集团控股有限公司 Data processing method and device and computing equipment
CN109343797A (en) * 2018-09-25 2019-02-15 郑州云海信息技术有限公司 A kind of data cached transmission method, system and associated component
CN110597839A (en) * 2019-09-20 2019-12-20 腾讯科技(深圳)有限公司 Transaction data processing method, device, equipment and storage medium
CN110599177A (en) * 2019-09-23 2019-12-20 腾讯科技(深圳)有限公司 Transaction verification method and related equipment
CN110597825A (en) * 2019-09-24 2019-12-20 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and node equipment
CN110851535A (en) * 2019-11-18 2020-02-28 腾讯科技(深圳)有限公司 Data processing method and device based on block chain, storage medium and terminal
CN110910249A (en) * 2019-11-22 2020-03-24 腾讯科技(深圳)有限公司 Data processing method and device, node equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112488688A (en) * 2020-12-17 2021-03-12 广州智链未来科技有限公司 Transaction processing method, device, equipment and storage medium based on block chain
CN112488688B (en) * 2020-12-17 2024-03-26 广州智链未来科技有限公司 Transaction processing method, device, equipment and storage medium based on blockchain
CN112685780A (en) * 2020-12-31 2021-04-20 杭州链化洞察科技有限公司 Data encryption and decryption method based on block chain
CN112926981A (en) * 2021-03-18 2021-06-08 腾讯科技(深圳)有限公司 Transaction information processing method, device and medium for block chain and electronic equipment
CN113852598A (en) * 2021-08-06 2021-12-28 中标慧安信息技术股份有限公司 Internet of things data transaction process recording method based on block chain
CN113852598B (en) * 2021-08-06 2022-10-21 中标慧安信息技术股份有限公司 Internet of things data transaction process recording method based on block chain

Similar Documents

Publication Publication Date Title
JP6882474B2 (en) Systems and methods for detecting replay attacks
CN111523890B (en) Block chain-based data processing method, device, storage medium and equipment
WO2020001105A1 (en) Blockchain-based data verification method and apparatus, and electronic device
CN111488626A (en) Data processing method, device, equipment and medium based on block chain
CN110633963B (en) Electronic bill processing method, electronic bill processing device, computer readable storage medium and computer readable storage device
CN110597837B (en) Service data processing method, device, storage medium and computer equipment
CN111460458B (en) Data processing method, related device and computer storage medium
CN110599331B (en) Liability collection system, method, equipment and storage medium based on blockchain
CN111698315B (en) Data processing method and device for block and computer equipment
CN111488372A (en) Data processing method, device and storage medium
CN111416709B (en) Voting method, device, equipment and storage medium based on block chain system
CN110599275A (en) Data processing method and device based on block chain network and storage medium
CN110866289A (en) Data processing method and device based on block chain, server and storage medium
CN111314172A (en) Data processing method, device and equipment based on block chain and storage medium
CN112613877A (en) Intelligent contract triggering method and device applied to block chain network and related equipment
CN110601896A (en) Data processing method and equipment based on block chain nodes
CN110852648A (en) Data processing method and device and computer storage medium
CN111367923A (en) Data processing method, data processing device, node equipment and storage medium
CN110955724A (en) Data processing method and device based on block chain, node equipment and storage medium
CN113255014A (en) Data processing method based on block chain and related equipment
CN110941840B (en) Data processing method, system and terminal
CN111447068A (en) Time service evidence storing method based on block chain
CN111260475A (en) Data processing method, block chain node point equipment and storage medium
CN111222963A (en) Bidding information processing method and device based on block chain
CN110941672A (en) Household registration management method, device, equipment and storage medium

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