Nothing Special   »   [go: up one dir, main page]

CN114327759A - Processing method and device of block chain data - Google Patents

Processing method and device of block chain data Download PDF

Info

Publication number
CN114327759A
CN114327759A CN202111590915.9A CN202111590915A CN114327759A CN 114327759 A CN114327759 A CN 114327759A CN 202111590915 A CN202111590915 A CN 202111590915A CN 114327759 A CN114327759 A CN 114327759A
Authority
CN
China
Prior art keywords
transaction
block
data
historical
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.)
Granted
Application number
CN202111590915.9A
Other languages
Chinese (zh)
Other versions
CN114327759B (en
Inventor
陈锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Alipay Hangzhou Information Technology 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202111590915.9A priority Critical patent/CN114327759B/en
Publication of CN114327759A publication Critical patent/CN114327759A/en
Application granted granted Critical
Publication of CN114327759B publication Critical patent/CN114327759B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/24Querying
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

An embodiment of the present specification provides a method and an apparatus for processing block chain data, where the method includes: receiving an instruction to execute a target transaction at a block link point; calling corresponding intelligent contracts deployed on the block chain link points through the virtual machines of the block chain nodes according to the target transaction; and triggering and executing a data acquisition instruction deployed on the virtual machine according to an interface code used for acquiring historical transaction data related to the target transaction in the called intelligent contract, and inquiring the historical transaction data related to the target transaction from a historical block of the block chain by using an operation logic corresponding to the data acquisition instruction. The execution of the target transaction involves historical transaction data stored in a historical block of the blockchain, the instruction set of the virtual machine of the blockchain link point includes a data acquisition instruction of the historical block data, and the virtual machine is provided with operation logic of a data acquisition operation corresponding to the data acquisition instruction.

Description

Processing method and device of block chain data
This patent application is application number: 202110763101.4, filing date: the invention relates to a divisional application of the chinese patent application entitled "processing method and apparatus for blockchain data" at # 07/06 in 2021.
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a method and an apparatus for processing block chain data.
Background
The block chain technology is a brand new distributed infrastructure and computing paradigm which is constructed on a point-to-point network, utilizes a chain data structure to verify and store data, utilizes a distributed node consensus algorithm to generate and update data, utilizes a cryptographic mode to ensure the safety of data transmission and access, and utilizes an intelligent contract composed of automatic scripts to program and operate data.
An intelligent contract is a computer program running on a blockchain that can be used to perform transactions on the blockchain. In some cases, when certain transactions are executed by smart contracts, it may be desirable to refer to certain historical transaction data stored in historical blocks of the blockchain. Therefore, it is necessary to provide a technical solution to obtain historical transaction data required for executing a transaction from the historical block.
Disclosure of Invention
The embodiment of the specification provides a processing method of block chain data. The method includes receiving an instruction to execute a target transaction at a block link point. And calling a corresponding intelligent contract deployed on the block chain link point through the virtual machine of the block chain link point according to the target transaction. The intelligent contract comprises an interface code for acquiring historical transaction data related to the target transaction. And acquiring a transaction hash value of the historical transaction to which the historical transaction data belongs and key field information of the historical transaction data to be inquired from the interface code. And querying data contents corresponding to the transaction hash value and the key field information from the historical blocks of the block chain according to operation logic deployed in the virtual machine.
The embodiment of the specification also provides a processing device of the block chain data. The device comprises a receiving module for receiving an instruction for executing target transaction at a block link point. The device also comprises a calling module which calls the corresponding intelligent contracts deployed on the block chain link points through the virtual machines of the block chain link points according to the target transaction. The intelligent contract comprises an interface code for acquiring historical transaction data related to the target transaction. The device also comprises an execution module which comprises an acquisition unit and a query unit. The acquisition unit acquires the transaction hash value of the historical transaction to which the historical transaction data belongs and the key field information of the historical transaction data which needs to be inquired from the interface code. And the query unit is used for querying the transaction hash value and the data content corresponding to the key field information from the historical block of the block chain according to the operation logic deployed in the virtual machine.
The embodiment of the specification also provides a processing device of the block chain data. The apparatus comprises: a processor and a memory arranged to store computer executable instructions that, when executed, cause the processor to receive instructions to perform a target transaction at a block link point. And calling a corresponding intelligent contract deployed on the block chain link point through the virtual machine of the block chain link point according to the target transaction. The intelligent contract comprises an interface code for acquiring historical transaction data related to the target transaction. And acquiring a transaction hash value of the historical transaction to which the historical transaction data belongs and key field information of the historical transaction data to be inquired from the interface code. And querying data contents corresponding to the transaction hash value and the key field information from the historical blocks of the block chain according to operation logic deployed in the virtual machine.
The embodiment of the specification also provides a storage medium. The storage medium is used for storing computer executable instructions, and the executable instructions realize the following processes when executed: an instruction to execute a target transaction at a block link point is received. And calling a corresponding intelligent contract deployed on the block chain link point through the virtual machine of the block chain link point according to the target transaction. The intelligent contract comprises an interface code for acquiring historical transaction data related to the target transaction. And acquiring a transaction hash value of the historical transaction to which the historical transaction data belongs and key field information of the historical transaction data to be inquired from the interface code. And querying data contents corresponding to the transaction hash value and the key field information from the historical blocks of the block chain according to operation logic deployed in the virtual machine.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure 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 described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of code within an intelligent contract to obtain data from historical blocks of a blockchain provided by an embodiment of the present description;
fig. 2 is a first flowchart of a method for processing blockchain data according to an embodiment of the present disclosure;
fig. 3 is a second flowchart of a method for processing blockchain data according to an embodiment of the present disclosure;
fig. 4 is a third flowchart illustrating a processing method of blockchain data according to an embodiment of the present disclosure;
fig. 5 is a schematic block diagram of a device for processing blockchain data according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a device for processing blockchain data according to an embodiment of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, 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 idea of the embodiment of the present specification is to incorporate, in an intelligent contract for executing a transaction, an interface code for acquiring historical transaction data stored in a historical block related to the transaction, add a data acquisition instruction of the historical block data in an instruction set of a virtual machine of a block link point, and an operation logic of an acquisition operation corresponding to the data acquisition instruction; in this way, when corresponding transaction is executed through the intelligent contract, when the content related to the interface code in the intelligent contract is executed, the execution of the data acquisition instruction deployed on the virtual machine is triggered, so that the historical transaction data related to the transaction is inquired from the historical block of the block chain link point by using the operation logic corresponding to the data acquisition instruction, and the internal code of the intelligent contract can acquire the historical transaction data related to the transaction from the historical block of the block chain. Based on this, the embodiments of the present specification provide a method, an apparatus, a device, and a storage medium for processing block chain data.
Data in the blockchain is stored in each block in the blockchain, so when a transaction is executed by using the intelligent contract, if the transaction relates to certain data of historical transactions related to the transaction, corresponding historical transaction data needs to be acquired from the historical blocks of the blockchain. In one specific implementation manner of the embodiments of the present specification, a schematic diagram of obtaining historical transaction data from a historical block of a blockchain by code inside an intelligent contract is shown in fig. 1.
The method for processing blockchain data provided by the embodiments of the present specification is applied to a blockchain node, that is, the main execution body of the method is a blockchain node, and specifically, the main execution body of the method is a device for processing blockchain data at a blockchain link point.
Fig. 2 is a first flowchart of a method for processing blockchain data according to an embodiment of the present disclosure, where the method shown in fig. 2 at least includes the following steps:
step 202, receiving an instruction for executing a target transaction at a block link point; the execution of the target transaction relates to historical transaction data stored in a historical block of the block chain, the instruction set of the virtual machine of the block chain link point contains a data acquisition instruction of the historical block data, and operation logic of a data acquisition operation corresponding to the data acquisition instruction is deployed in the virtual machine.
Step 204, calling corresponding intelligent contracts deployed on the block chain link points through the virtual machines of the block chain link points according to the target transaction; the intelligent contract comprises an interface code for acquiring historical transaction data related to target transactions.
And step 206, triggering and executing a data acquisition instruction deployed on the virtual machine according to the interface code in the intelligent contract, and querying historical transaction data related to the target transaction from a historical block of the block chain by using an operation logic corresponding to the data acquisition instruction.
It should be noted that, in this embodiment of the present specification, the intelligent contract corresponding to the target transaction is used for executing the target transaction, and the intelligent contract is executed by the virtual machine. Generally, when a virtual machine is required to perform some operations, corresponding instructions need to be added to the virtual machine in advance to enable the virtual machine to have corresponding functions. Therefore, an instruction set is provided on the virtual machine, the instruction set includes operation instructions corresponding to a plurality of operations, and operation logic for implementing each operation instruction is also deployed in the virtual machine. One possible form of the mapping relationship between the operation instructions and the operation logic maintained in the virtual machine is shown in table 1.
TABLE 1
Instruction 1 Operation logic 1
Instruction 2 Operation logic 2
Instruction 3 Operation logic 3
Instruction N Operating logic N
In table 1, the operation logic corresponding to instruction 1 is operation logic 1, the operation logic corresponding to instruction 2 is operation logic 2, and the operation logic corresponding to instruction N is operation logic N. That is, the instruction content corresponding to instruction 1 can be realized by executing operation logic 1, the instruction content corresponding to instruction 2 can be realized by executing operation logic 2, and the instruction content corresponding to instruction N can be realized by executing operation logic N. That is, in the embodiments of the present specification, the operation logic is actually a concrete implementation means of the instruction corresponding to the operation logic. Where N in table 1 is any positive integer, table 1 is only one possible storage form exemplarily listing instructions and corresponding operation logic in a virtual machine, and does not constitute a limitation to the embodiments of this specification.
In the embodiment of the present specification, in order to make the internal code of the intelligent contract obtain the historical transaction data from the historical blockchain of the blockchain when executing, therefore, the virtual machine executing the intelligent contract needs to be made to have the function of obtaining the data from the historical blockchain. In particular implementation, in order to enable the virtual machine to have a function of acquiring data from historical blocks of a block chain, a data acquisition instruction of historical block data is added in an instruction set of the virtual machine, and operation logic of a data acquisition operation corresponding to the data acquisition instruction is deployed in the virtual machine, so that when an intelligent contract is executed through the virtual machine, internal code of the intelligent contract can acquire the historical block data of the block chain, and therefore some transactions of data related to historical transactions in the historical block chain of the block chain can be executed through the block chain.
In addition, in addition to the data acquisition instruction for adding historical block data in the instruction set of the virtual machine and the operation logic for deploying the data acquisition operation corresponding to the data acquisition instruction in the virtual machine, that is, in addition to the function of giving the virtual machine to acquire the historical block data, an interface code for defining the historical transaction data related to the target transaction in the intelligent contract corresponding to the target transaction needs to be defined, where the interface code includes related parameters for querying the historical transaction data related to the target transaction, for example, the interface code includes a transaction hash value of the historical transaction data related to the target transaction and key field information of the related historical transaction data. For example, in one embodiment, the execution of the target transaction needs to rely on the previous time information of the transaction with correlation, and when the target transaction is executed through the intelligent contract, the intelligent contract needs to obtain the previous time information of the transaction with correlation from the historical block of the block chain; accordingly, the intelligent contract includes an interface code that carries a transaction hash value and a time field for the last transaction with the associated transaction.
It should be noted that the method provided by the embodiment of the present disclosure may be applied to any type of intelligent contracts, such as an ethernet intelligent contract, a WASM intelligent contract, a Native intelligent contract, and the like.
In the processing method of blockchain data provided in the embodiment of the present specification, an interface code for acquiring historical transaction data stored in a historical block related to a transaction is previously programmed in an intelligent contract for executing the transaction, and a data acquisition instruction of the historical blockchain data and an operation logic of an acquisition operation corresponding to the data acquisition instruction are added in an instruction set of a virtual machine of a blockchain node; therefore, when corresponding transaction is executed through the intelligent contract, when the content related to the interface code in the intelligent contract is executed, the data acquisition instruction deployed on the virtual machine is triggered to be executed, so that the operation logic corresponding to the data acquisition instruction is used, the historical transaction data related to the transaction is inquired from the historical block of the block chain link point, the historical transaction data related to the transaction can be acquired from the historical block of the block chain by the internal code of the intelligent contract, namely the historical transaction data can be acquired from the historical block chain by the intelligent contract, and the problem that the related transaction cannot be executed through the block chain due to the fact that the data in the historical block cannot be acquired under the limitation of the intelligent contract is solved.
Therefore, in the embodiment of the present specification, in order to enable the intelligent contract to obtain the historical transaction data related to the target transaction from the historical blocks of the blockchain, before executing the method provided by the embodiment of the present specification, the corresponding interface code needs to be coded into the intelligent contract. That is, before the step 202 is executed and an instruction for executing the target transaction at the block link point is received, the method provided by the embodiment of the present specification further includes the following steps:
and when the intelligent contract corresponding to the target trading exchange is compiled, the interface code is compiled into the intelligent contract.
Optionally, after the intelligent contract obtains the historical transaction data related to the target transaction by using the method provided in the embodiment of the present specification, the block chain node executes the interface code, so as to perform execution processing of the target transaction, such as consensus processing, and thus, transparent transmission of the historical transaction data stored in the historical block of the block chain is realized.
The foregoing aspects and many of the details are presented to provide an understanding of the manner in which the embodiments of the disclosure may be practiced.
Optionally, in a specific embodiment, in step 206, the data obtaining instruction deployed on the virtual machine is triggered and executed according to an interface code in the smart contract, and the historical transaction data related to the target transaction is queried from the historical block of the blockchain by using an operation logic corresponding to the data obtaining instruction, where the method specifically includes the following processes:
acquiring a transaction hash value of historical transaction to which historical transaction data belongs and key field information of the historical transaction data to be inquired from the interface code; and based on the transaction hash value and the key field information, inquiring data contents corresponding to the transaction hash value and the key field information from historical blocks of a block chain according to the operation logic.
It should be noted that, when a target transaction is executed, it may only relate to one or some parameter data in the historical transaction data associated with the target transaction, rather than all historical transaction data of the historical transaction, for example, when the target transaction is executed, it may only relate to information such as a transaction party, a transaction time stamp, etc. in the historical transaction data associated with the target transaction; therefore, in order to enable the internal code of the intelligent contract to accurately obtain the data required by the target transaction when the target transaction is executed through the intelligent contract, the interface code defined in the intelligent contract needs to include the transaction hash value corresponding to the historical transaction data related to the target transaction and the key field information specifically required to be queried. In this way, based on the transaction hash value and the key field information included in the interface code, according to the operation logic corresponding to the data acquisition instruction triggered and deployed on the virtual machine, the corresponding data content is queried from the historical block of the block chain.
Optionally, in some specific embodiments, the querying, based on the transaction hash value and the key field information, data content corresponding to the transaction hash value and the key field information from the historical block of the block chain according to the operation logic may specifically be implemented by the following steps:
searching whether a target block number corresponding to the transaction hash value exists in a mapping relation between each hash value and the block number established in advance; if yes, checking whether the target block number is within a preset queryable block range; if yes, searching the data content corresponding to the transaction hash value and the key field information from the block data corresponding to the target block number.
The block number may be a block number, a block identifier, or the like.
Optionally, in this embodiment of the present specification, a mapping relationship between a hash value corresponding to each historical transaction and a block in which the historical transaction data corresponding to the hash value is located may be pre-established, and one possible form is shown in table 2.
TABLE 2
Hash value Block number
Hash1 Block 2
Hash2 Block 3
Hash3 Block 1
Hash 4 Block 2
The mapping relationship between each hash value and the corresponding block number is stored in the mapping relationship, and it can be actually understood that the transaction data of the transaction corresponding to the hash value is stored in the corresponding block. As shown in Table 2, it indicates that transaction data for the transaction corresponding to Hash1 is stored in Block 2, that transaction data for the transaction corresponding to Hash2 is stored in Block 3, and so on. For example, in a specific implementation of the solution provided in the embodiment of the present specification, after a transaction hash value corresponding to a target transaction is obtained from an interface code included in an intelligent contract corresponding to the target transaction, the obtained transaction hash value is matched with the table 2, first, whether a transaction hash value consistent with the transaction hash value exists in the table 2 is checked, if yes, a block number corresponding to the transaction hash value is determined, whether the block number is located within a queriable block number range is determined, and if yes, to-be-queried transaction content is searched for from a block corresponding to the block number based on the transaction hash value and key field information.
Optionally, in an embodiment, the execution of the target transaction involves historical transaction data of the historical transaction, which is stored in a historical block of the blockchain and is of the same transaction type as the target transaction;
correspondingly, in this case, the querying, based on the transaction hash value and the key field information, of the data content corresponding to the transaction hash value and the key field information from the historical block of the block chain according to the operation logic may specifically be implemented by the following steps:
searching whether a target block number corresponding to the transaction hash value exists in a mapping relation between each hash value and the block number established in advance; if yes, checking whether the target block number is within a preset queryable block range; if yes, searching historical transaction data of historical transaction matched with the transaction type of the target transaction from the block data of the block corresponding to the target block number; and determining the data content corresponding to the transaction hash value and the key field information from the matched historical transaction data.
In the embodiment of the present disclosure, historical transaction data corresponding to a plurality of historical transactions may be stored in a block corresponding to a target block number, and therefore, in order to further narrow a data query range based on a transaction hash value and key field information and reduce a data query workload, after determining that the target block number is within a preset queriable block range, historical transaction data in the block corresponding to the target block number may be filtered based on a transaction type. Specifically, historical transaction data corresponding to the historical transaction in accordance with the transaction type of the target transaction may be searched from the block data of the block corresponding to the target block number, so that when the queried data content is determined based on the transaction hash value and the key field information, only data query needs to be performed from the historical transaction data in accordance with the transaction type of the target transaction in the block corresponding to the target block number.
Optionally, in a specific embodiment, the transaction types may be divided based on an object of the transaction, or may be divided based on a service type involved in the transaction, for example, a transaction executed on a block chain generated by processing a service, and if the services corresponding to two transactions have the same service type, for example, both are an article buying and selling service, or both are a product renting service, the transaction types of the two transactions may be considered to be the same. Of course, the division of transaction types may also be made based on the attributes of the transaction, such as transactions involving resource transfer in the blockchain may be considered to have the same transaction type. The examples in this specification do not limit this.
Typically, the associated personnel will archive data stored in the blockchain on a regular or irregular basis, but not queriable for data that has already been archived. Therefore, the above-mentioned predetermined range of searchable blocks may be understood as blocks without data archiving. Therefore, in an embodiment, the checking whether the target block number is within the predetermined queryable block range may be implemented as follows:
checking whether the block corresponding to the target block number is a block subjected to block data archiving; if yes, determining that the target block number exceeds the range of the inquired block; otherwise, the target block number is determined to be within the queryable block range.
Optionally, when the implementation is performed, the block number of the block subjected to data archiving is recorded in advance, the target block number is matched with the block number subjected to data archiving, whether the target block number exists in the block number subjected to data archiving is checked, if the target block number exists in the block number subjected to data archiving, the block corresponding to the target block number is determined to be the block subjected to block data archiving, and at this time, it may be determined that the target block number exceeds the queriable block range; if the check result indicates that the target block number does not exist in the block numbers subjected to data archiving, determining that the block corresponding to the target block number is a block subjected to data archiving, and if so, determining that the target block number is located in the queriable block range.
Of course, in addition to the above verification manner, in the embodiment of the present specification, the queryable transaction time range may be divided based on the transaction time, and whether the target block number is located within the queryable block range may be verified based on the queryable transaction time range. Therefore, in one embodiment, it can also be checked whether the target block number is within the predetermined queryable block range by the following process:
checking whether the timestamp of the block data of the block corresponding to the target block number is within the timestamp range corresponding to the inquired historical transaction; if yes, determining that the target block number is located in the range of the inquired block.
That is, in one embodiment, the extent of the queryable blocks may be defined based on timestamps corresponding to historical transactions. For example, a timestamp range corresponding to a historical transaction that has completed consensus in the blockchain and has not archived data may be determined as a queryable timestamp range; if the time stamp of the block data in the block corresponding to the target block number is within the queryable time stamp range, determining that the target block number is within the queryable block range; otherwise, determining that the target block number exceeds the queryable block range.
In addition, in the embodiment of the present specification, a data query state corresponding to each historical transaction may also be set, and then historical transaction data related to a target transaction is queried according to the data query state corresponding to each historical transaction; therefore, in a specific implementation manner, the method provided in the embodiments of the present specification further includes the following steps:
determining the historical transaction which is executed in the block link point and has been completed and the transaction state is the effective state, and setting the data query state information corresponding to the historical transaction as the queriable state;
correspondingly, in this case, the searching for the data content corresponding to the transaction hash value and the key field information from the block data of the block corresponding to the target block number specifically includes the following steps:
searching historical transaction data of historical transactions corresponding to the transaction hash value from block data of a block corresponding to a target block number; checking whether the data query state information corresponding to the historical transaction is in a query state; and if so, inquiring the data content corresponding to the key field information from the historical transaction data.
It should be noted that, in this embodiment of the present specification, the data query state information corresponding to the historical transaction may be represented in the form of a state value. For example, when the state value is 1, the historical transaction data corresponding to the historical transaction is represented to be in a queriable state, and when the state value is 0, the historical transaction data corresponding to the historical transaction is represented to be in a non-queriable state.
Optionally, because the blockchain has an attribute that data cannot be tampered, in a specific implementation manner, when data query state information corresponding to the historical transaction needs to be changed, new data query state information and change time corresponding to the historical transaction may be directly recorded in the blockchain, so that, when data query is performed, a data query state corresponding to the latest change time of the historical transaction is used as the data query state corresponding to the historical transaction. If so, the data query state corresponding to the historical transaction a is as follows: in 2020, 11, 3 and 18 hours, 06 minutes and 25 seconds, the data query state value is 0; 08 minutes and 27 seconds at 11, 3 and 19 months in 2020, and the data query state value is 1; therefore, when data query is performed, the data query state 1 is used as the data query state information corresponding to the historical transaction a.
In addition, in the embodiment of the present specification, the key field information includes one or more of the following field information:
a transaction sender, a transaction receiver, a transaction timestamp, transaction data, and storage location information.
Optionally, in a specific implementation, the transaction data may be understood as transaction contents of the transaction, such as a transaction amount, a transaction location, a transaction object, and the like.
To facilitate understanding of the methods provided by the embodiments of the present specification, the following will describe the methods provided by the embodiments of the present specification by taking historical transaction data related to a target transaction as an example of a transaction sender. Fig. 3 is a second flowchart of a block chain data processing method according to an embodiment of the present disclosure, where the method shown in fig. 3 at least includes the following steps:
step 302, receive an instruction to execute a target transaction at a block link point.
And step 304, calling corresponding intelligent contracts deployed on the link points of the blocks through the virtual machines of the link nodes of the blocks.
Step 306, executing the intelligent contract through the virtual machine, and obtaining the transaction hash value and the key field information of the historical transaction to which the historical transaction data related to the target transaction belongs from the interface code included in the intelligent contract.
Step 308, inquiring whether a target block number corresponding to the transaction hash value exists based on a mapping relation between the pre-established hash value and the block number; if yes, go to step 310; otherwise, ending.
Step 310, checking whether the target block number is within a preset queryable block range; if so, go to step 312, otherwise, end.
In step 312, the corresponding data content is searched in the block corresponding to the block number based on the transaction hash value and the key field information.
In step 314, the execution of the target transaction is achieved based on the queried data content.
Fig. 4 is a third flowchart of the blockchain data processing method provided by the embodiment of the present specification, and in the flowchart shown in fig. 4, the method provided by the embodiment of the present specification is described by taking historical transaction data related to a target transaction as an example for a transaction recipient. The method as shown in fig. 4, at least comprises the following steps:
at step 402, an instruction to execute a target transaction at a block link point is received.
And step 404, calling corresponding intelligent contracts deployed on the link points of the blocks through the virtual machines of the link nodes of the blocks.
And step 406, executing the intelligent contract through the virtual machine, and acquiring a transaction hash value and key field information of the historical transaction to which the historical transaction data related to the target transaction belongs from the interface code included in the intelligent contract.
Step 408, inquiring whether a target block number corresponding to the transaction hash value exists based on a mapping relation between the pre-established hash value and the block number; if so, go to step 410; otherwise, ending.
Step 410, checking whether the block corresponding to the target block number is a block subjected to data archiving; if yes, ending; otherwise, step 412 is performed.
In step 412, historical transaction data corresponding to the historical transaction matching the transaction type of the target transaction is searched from the block data of the block corresponding to the target block number.
And step 414, inquiring corresponding data content in the matched historical transaction data based on the transaction hash value and the key field information.
Execution of the targeted transaction is effected based on the queried data content, step 416.
In the processing method of blockchain data provided in the embodiment of the present specification, an interface code for acquiring historical transaction data related to the transaction is programmed in an intelligent contract, and a data acquisition instruction of the historical blockchain data and an operation logic of an acquisition operation corresponding to the data acquisition instruction are added in an instruction set of a virtual machine of a blockchain link point; in this way, when the transaction is executed through the block chain node, the intelligent contract corresponding to the target transaction is called, and when the relevant content of the interface code in the intelligent contract is executed, the data acquisition instruction deployed on the virtual machine is triggered to be executed, so that the historical transaction data related to the transaction is inquired from the historical block of the block chain node by using the operation logic corresponding to the data acquisition instruction, that is, the historical transaction data can be acquired from the historical block chain by the intelligent contract, and the problem that the relevant transaction cannot be executed through the block chain because the intelligent contract cannot acquire the data in the historical block due to the limitation of the intelligent contract is solved.
Based on the same idea, a processing apparatus for blockchain data is provided in an embodiment of the present specification, which is used to execute the processing method for blockchain data provided in the embodiment of the present specification. Fig. 5 is a schematic block composition diagram of an apparatus for processing blockchain data according to an embodiment of the present disclosure, where the apparatus shown in fig. 5 includes:
a receiving module 502, receiving an instruction to execute a target transaction at a block link point; wherein the execution of the target transaction involves historical transaction data stored in historical tiles of a blockchain; the instruction set of the virtual machine of the block chain node comprises a data acquisition instruction of historical block data, and operation logic of data acquisition operation corresponding to the data acquisition instruction is deployed in the virtual machine;
a calling module 504, which calls, according to the target transaction, a corresponding intelligent contract deployed on the block chain link point through the virtual machine of the block chain link point; the intelligent contract comprises an interface code for acquiring the historical transaction data related to the target transaction;
an executing module 506, configured to trigger execution of the data obtaining instruction deployed on the virtual machine according to an interface code in the intelligent contract, and query, using an operation logic corresponding to the data obtaining instruction, the historical transaction data related to the target transaction from a historical block of the block chain.
The processing apparatus for blockchain data provided in the embodiments of the present specification can implement all the method steps of the processing method for blockchain data provided in the embodiments shown in fig. 1 to 4, and is not described herein again.
In the processing apparatus for blockchain data provided in the embodiment of the present specification, an interface code for acquiring historical transaction data related to the transaction is programmed in an intelligent contract, and a data acquisition instruction for historical blockchain data and an operation logic for an acquisition operation corresponding to the data acquisition instruction are added in an instruction set of a virtual machine at a blockchain link point; in this way, when the transaction is executed through the block chain node, the intelligent contract corresponding to the target transaction is called, and when the relevant content of the interface code in the intelligent contract is executed, the data acquisition instruction deployed on the virtual machine is triggered to be executed, so that the historical transaction data related to the transaction is inquired from the historical block of the block chain node by using the operation logic corresponding to the data acquisition instruction, that is, the historical transaction data can be acquired from the historical block chain by the intelligent contract, and the problem that the relevant transaction cannot be executed through the block chain because the intelligent contract cannot acquire the data in the historical block due to the limitation of the intelligent contract is solved.
Further, based on the methods shown in fig. 1 to fig. 4, an embodiment of the present specification further provides a device for processing blockchain data, as shown in fig. 6.
The processing device of blockchain data may have a large difference due to different configurations or performances, and may include one or more processors 601 and a memory 602, and one or more stored applications or data may be stored in the memory 602. Wherein the memory 602 may be transient or persistent storage. The application program stored in memory 602 may include one or more modules (not shown), each of which may include a sequence of computer-executable instruction information in a processing device for blockchain data. Still further, the processor 601 may be configured to communicate with the memory 602 to execute a series of computer-executable instruction information in the memory 602 on a processing device for blockchain data. The processing apparatus of the blockchain data may also include one or more power supplies 603, one or more wired or wireless network interfaces 604, one or more input-output interfaces 605, one or more keyboards 606, and the like.
In one embodiment, the apparatus for processing blockchain data comprises a memory, and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may comprise one or more modules, and each module may comprise a sequence of computer-executable instruction information for the apparatus for processing blockchain data, and the one or more programs configured to be executed by the one or more processors comprise computer-executable instruction information for:
receiving an instruction to execute a target transaction at a block link point; wherein the execution of the target transaction involves historical transaction data stored in historical tiles of a blockchain; the instruction set of the virtual machine of the block chain node comprises a data acquisition instruction of historical block data, and operation logic of data acquisition operation corresponding to the data acquisition instruction is deployed in the virtual machine;
calling a corresponding intelligent contract deployed on the block chain link point through a virtual machine of the block chain link point according to the target transaction; the intelligent contract comprises an interface code for acquiring the historical transaction data related to the target transaction;
and triggering and executing the data acquisition instruction deployed on the virtual machine according to an interface code in the intelligent contract, and inquiring the historical transaction data related to the target transaction from a historical block of the block chain by using an operation logic corresponding to the data acquisition instruction.
The device for processing blockchain data provided in the embodiments of the present specification can implement all the method steps of the method for processing blockchain data provided in the embodiments shown in fig. 1 to 4, and are not described herein again.
In the block chain data processing device provided in the embodiment of the present specification, an interface code for acquiring historical transaction data related to the transaction is programmed in an intelligent contract, and a data acquisition instruction of the historical block data and an operation logic of an acquisition operation corresponding to the data acquisition instruction are added in an instruction set of a virtual machine of a block chain link point; in this way, when the transaction is executed through the block chain node, the intelligent contract corresponding to the target transaction is called, and when the relevant content of the interface code in the intelligent contract is executed, the data acquisition instruction deployed on the virtual machine is triggered to be executed, so that the historical transaction data related to the transaction is inquired from the historical block of the block chain node by using the operation logic corresponding to the data acquisition instruction, that is, the historical transaction data can be acquired from the historical block chain by the intelligent contract, and the problem that the relevant transaction cannot be executed through the block chain because the intelligent contract cannot acquire the data in the historical block due to the limitation of the intelligent contract is solved.
Further, based on the methods shown in fig. 1 to fig. 4, in a specific embodiment, the storage medium may be a usb disk, an optical disk, a hard disk, or the like, and when executed by a processor, the storage medium stores computer-executable instruction information that implements the following processes:
receiving an instruction to execute a target transaction at a block link point; wherein the execution of the target transaction involves historical transaction data stored in historical tiles of a blockchain; the instruction set of the virtual machine of the block chain node comprises a data acquisition instruction of historical block data, and operation logic of data acquisition operation corresponding to the data acquisition instruction is deployed in the virtual machine;
calling a corresponding intelligent contract deployed on the block chain link point through a virtual machine of the block chain link point according to the target transaction; the intelligent contract comprises an interface code for acquiring the historical transaction data related to the target transaction;
and triggering and executing the data acquisition instruction deployed on the virtual machine according to an interface code in the intelligent contract, and inquiring the historical transaction data related to the target transaction from a historical block of the block chain by using an operation logic corresponding to the data acquisition instruction.
In addition, the computer-executable instruction information stored in the storage medium provided in the embodiments of the present specification may implement all the method steps of the embodiments shown in fig. 1 to fig. 4 when being executed by the processor, and details are not repeated here.
When the computer-executable instruction information stored in the storage medium provided in the embodiment of the present specification is executed by a processor, an interface code for acquiring historical transaction data related to the transaction is programmed into an intelligent contract, a data acquisition instruction of historical block data is added to an instruction set of a virtual machine of a block link point, and an operation logic of an acquisition operation corresponding to the data acquisition instruction; in this way, when the transaction is executed through the block chain node, the intelligent contract corresponding to the target transaction is called, and when the relevant content of the interface code in the intelligent contract is executed, the data acquisition instruction deployed on the virtual machine is triggered to be executed, so that the historical transaction data related to the transaction is inquired from the historical block of the block chain node by using the operation logic corresponding to the data acquisition instruction, that is, the historical transaction data can be acquired from the historical block chain by the intelligent contract, and the problem that the relevant transaction cannot be executed through the block chain because the intelligent contract cannot acquire the data in the historical block due to the limitation of the intelligent contract is solved.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instruction information. These computer program instruction information may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instruction information executed by the processor of the computer or other programmable data processing apparatus produce means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instruction information may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instruction information stored in the computer-readable memory produce an article of manufacture including instruction information means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instruction information may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instruction information executed on the computer or other programmable apparatus provides steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instruction information, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instruction information, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (18)

1. A method for processing block chain data comprises the following steps:
receiving an instruction to execute a target transaction at a block link point;
calling a corresponding intelligent contract deployed on the block chain link point through a virtual machine of the block chain link point according to the target transaction; the intelligent contract comprises an interface code for acquiring historical transaction data related to the target transaction;
acquiring a transaction hash value of the historical transaction to which the historical transaction data belongs and key field information of the historical transaction data to be inquired from the interface code;
and querying data contents corresponding to the transaction hash value and the key field information from the historical blocks of the block chain according to operation logic deployed in the virtual machine.
2. The method of claim 1, wherein the querying, according to operation logic deployed in the virtual machine, data contents corresponding to the transaction hash value and the key field information from historical blocks of the block chain comprises:
searching whether a target block number corresponding to the transaction hash value exists in a mapping relation between each hash value and a block number which is established in advance;
if yes, checking whether the target block number is within a preset queryable block range;
and if so, searching the transaction hash value and the data content corresponding to the key field information from the block data of the block corresponding to the target block number.
3. The method of claim 1, the execution of the target transaction involving historical transaction data for a historical transaction stored in a historical block of a blockchain and of the same transaction type as the target transaction;
correspondingly, the querying the transaction hash value and the data content corresponding to the key field information from the historical block of the block chain according to the operation logic deployed in the virtual machine includes:
searching whether a target block number corresponding to the transaction hash value exists in a mapping relation between each hash value and a block number which is established in advance;
if yes, checking whether the target block number is within a preset queryable block range;
if yes, searching historical transaction data of historical transaction matched with the transaction type of the target transaction from the block data of the block corresponding to the target block number;
and determining the transaction hash value and the data content corresponding to the key field information from the matched historical transaction data.
4. The method as claimed in claim 2 or 3, wherein said checking whether the target block number is within a predetermined queryable block range comprises:
checking whether the block corresponding to the target block number is a block subjected to block data archiving or not;
if yes, determining that the target block number exceeds the range of the queryable blocks; otherwise, determining that the target block number is located in the queryable block range.
5. The method of claim 2 or 3, further comprising:
determining the historical transaction which is executed in the block chain node and has a valid transaction state, and setting data query state information corresponding to the historical transaction as a queriable state;
the searching the transaction hash value and the data content corresponding to the key field information from the block data of the block corresponding to the target block number includes:
searching historical transaction data of historical transactions corresponding to the transaction hash value from block data of a block corresponding to the target block number;
checking whether the data query state information corresponding to the historical transaction is in a query state;
and if so, inquiring data content corresponding to the key field information from the historical transaction data.
6. The method as claimed in claim 2 or 3, wherein said checking whether the target block number is within a predetermined queryable block range comprises:
checking whether the timestamp of the block data of the block corresponding to the target block number is within the timestamp range corresponding to the inquired historical transaction;
if yes, determining that the target block number is located in the queryable block range.
7. The method of claim 1, the key field information comprising one or more of the following field information:
a transaction sender, a transaction receiver, a transaction timestamp, transaction data, and storage location information.
8. The method of claim 1, prior to receiving an instruction to execute a target transaction at a block link point, the method further comprising:
and when the intelligent contract corresponding to the target transaction is compiled, the interface code is coded into the intelligent contract.
9. An apparatus for processing blockchain data, comprising:
the receiving module is used for receiving an instruction for executing the target transaction at the block link point;
the calling module is used for calling corresponding intelligent contracts deployed on the block chain link points through the virtual machine of the block chain link points according to the target transaction; the intelligent contract comprises an interface code for acquiring historical transaction data related to the target transaction;
the execution module comprises an acquisition unit and a query unit; the acquisition unit acquires the transaction hash value of the historical transaction to which the historical transaction data belongs and the key field information of the historical transaction data to be inquired from the interface code; and the query unit is used for querying the transaction hash value and the data content corresponding to the key field information from the historical block of the block chain according to the operation logic deployed in the virtual machine.
10. The apparatus according to claim 9, wherein the query unit is specifically configured to:
searching whether a target block number corresponding to the transaction hash value exists in a mapping relation between each hash value and a block number which is established in advance; if yes, checking whether the target block number is within a preset queryable block range; and if so, searching the transaction hash value and the data content corresponding to the key field information from the block data of the block corresponding to the target block number.
11. The apparatus of claim 9, the execution of the target transaction involving historical transaction data for a historical transaction stored in a historical block of a blockchain and of a same transaction type as the target transaction;
correspondingly, the query unit is further specifically configured to:
searching whether a target block number corresponding to the transaction hash value exists in a mapping relation between each hash value and a block number which is established in advance; if yes, checking whether the target block number is within a preset queryable block range; if yes, searching historical transaction data of historical transaction matched with the transaction type of the target transaction from the block data of the block corresponding to the target block number; and determining the transaction hash value and the data content corresponding to the key field information from the matched historical transaction data.
12. The apparatus according to claim 10 or 11, wherein the querying element is further specifically configured to:
checking whether the block corresponding to the target block number is a block subjected to block data archiving or not;
if yes, determining that the target block number exceeds the range of the queryable blocks; otherwise, determining that the target block number is located in the queryable block range.
13. The apparatus of claim 10 or 11, further comprising:
the setting module is used for determining the historical transaction which is executed in the block chain node and has a valid transaction state, and setting the data query state information corresponding to the historical transaction as a queriable state;
correspondingly, the query unit is further specifically configured to:
searching historical transaction data of historical transactions corresponding to the transaction hash value from block data of a block corresponding to the target block number; checking whether the data query state information corresponding to the historical transaction is in a query state; and if so, inquiring data content corresponding to the key field information from the historical transaction data.
14. The apparatus according to claim 10 or 11, wherein the querying element is further specifically configured to:
checking whether a timestamp corresponding to the block data of the block corresponding to the target block number is within a timestamp range corresponding to the inquired historical transaction; if yes, determining that the target block number is located in the queryable block range.
15. The apparatus of claim 9, the key field information comprising one or more of the following field information:
a transaction sender, a transaction receiver, a transaction timestamp, transaction data, and storage location information.
16. The apparatus of claim 9, the apparatus further comprising:
and the compiling module is used for compiling the interface code into the intelligent contract when compiling the intelligent contract corresponding to the target transaction.
17. An apparatus for processing blockchain data, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
receiving an instruction to execute a target transaction at a block link point;
calling a corresponding intelligent contract deployed on the block chain link point through a virtual machine of the block chain link point according to the target transaction; the intelligent contract comprises an interface code for acquiring historical transaction data related to the target transaction;
acquiring a transaction hash value of the historical transaction to which the historical transaction data belongs and key field information of the historical transaction data to be inquired from the interface code;
and querying data contents corresponding to the transaction hash value and the key field information from the historical blocks of the block chain according to operation logic deployed in the virtual machine.
18. A storage medium storing computer-executable instructions that, when executed, implement the following:
receiving an instruction to execute a target transaction at a block link point;
calling a corresponding intelligent contract deployed on the block chain link point through a virtual machine of the block chain link point according to the target transaction; the intelligent contract comprises an interface code for acquiring historical transaction data related to the target transaction;
acquiring a transaction hash value of the historical transaction to which the historical transaction data belongs and key field information of the historical transaction data to be inquired from the interface code;
and querying data contents corresponding to the transaction hash value and the key field information from the historical blocks of the block chain according to operation logic deployed in the virtual machine.
CN202111590915.9A 2021-07-06 2021-07-06 Method and device for processing block chain data Active CN114327759B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111590915.9A CN114327759B (en) 2021-07-06 2021-07-06 Method and device for processing block chain data

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110763101.4A CN113254163B (en) 2021-07-06 2021-07-06 Processing method and device of block chain data
CN202111590915.9A CN114327759B (en) 2021-07-06 2021-07-06 Method and device for processing block chain data

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202110763101.4A Division CN113254163B (en) 2021-07-06 2021-07-06 Processing method and device of block chain data

Publications (2)

Publication Number Publication Date
CN114327759A true CN114327759A (en) 2022-04-12
CN114327759B CN114327759B (en) 2024-09-13

Family

ID=77190717

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202111590915.9A Active CN114327759B (en) 2021-07-06 2021-07-06 Method and device for processing block chain data
CN202110763101.4A Active CN113254163B (en) 2021-07-06 2021-07-06 Processing method and device of block chain data

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202110763101.4A Active CN113254163B (en) 2021-07-06 2021-07-06 Processing method and device of block chain data

Country Status (1)

Country Link
CN (2) CN114327759B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115062079A (en) * 2022-06-21 2022-09-16 平安银行股份有限公司 Transaction flow processing method, device, equipment and storage medium
WO2024104047A1 (en) * 2022-11-18 2024-05-23 中国银联股份有限公司 Blockchain transaction allocation method and apparatus

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468224A (en) * 2021-09-03 2021-10-01 支付宝(杭州)信息技术有限公司 Method and device for storing and inquiring state data and executing transaction in block chain

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190236559A1 (en) * 2018-01-31 2019-08-01 Salesforce.Com, Inc. Systems, methods, and apparatuses for implementing smart flow contracts using distributed ledger technologies in a cloud based computing environment
CN110134668A (en) * 2019-04-28 2019-08-16 阿里巴巴集团控股有限公司 Data migration method, device and equipment applied to block chain
CN110580262A (en) * 2019-11-08 2019-12-17 支付宝(杭州)信息技术有限公司 Private data query method and device based on intelligent contract
US20200219096A1 (en) * 2017-07-27 2020-07-09 Siemens Aktiengesellschaft Apparatus and method for the cryptographically protected operation of a virtual machine
CN111723102A (en) * 2020-08-21 2020-09-29 支付宝(杭州)信息技术有限公司 Intelligent contract updating method and device
US20200412526A1 (en) * 2018-09-20 2020-12-31 Baidu Online Network Technology (Beijing) Co., Ltd. Method and apparatus for verifying smart contracts in blockchain, and storage medium
CN112560114A (en) * 2021-02-22 2021-03-26 支付宝(杭州)信息技术有限公司 Method and device for calling intelligent contract
WO2021082664A1 (en) * 2019-10-30 2021-05-06 支付宝(杭州)信息技术有限公司 Blockchain privacy data query method and apparatus

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111782338B (en) * 2018-12-12 2024-05-03 创新先进技术有限公司 Data processing method and system based on blockchain intelligent contract
CN110046992A (en) * 2018-12-12 2019-07-23 阿里巴巴集团控股有限公司 A kind of transaction Hash acquisition methods and system based on block chain intelligence contract
SG11202002775RA (en) * 2019-09-12 2020-04-29 Alibaba Group Holding Ltd Log-structured storage systems
CN110580412B (en) * 2019-11-08 2020-03-06 支付宝(杭州)信息技术有限公司 Permission query configuration method and device based on chain codes
CN110580418B (en) * 2019-11-08 2020-04-07 支付宝(杭州)信息技术有限公司 Private data query method and device based on block chain account

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200219096A1 (en) * 2017-07-27 2020-07-09 Siemens Aktiengesellschaft Apparatus and method for the cryptographically protected operation of a virtual machine
US20190236559A1 (en) * 2018-01-31 2019-08-01 Salesforce.Com, Inc. Systems, methods, and apparatuses for implementing smart flow contracts using distributed ledger technologies in a cloud based computing environment
US20200412526A1 (en) * 2018-09-20 2020-12-31 Baidu Online Network Technology (Beijing) Co., Ltd. Method and apparatus for verifying smart contracts in blockchain, and storage medium
CN110134668A (en) * 2019-04-28 2019-08-16 阿里巴巴集团控股有限公司 Data migration method, device and equipment applied to block chain
WO2021082664A1 (en) * 2019-10-30 2021-05-06 支付宝(杭州)信息技术有限公司 Blockchain privacy data query method and apparatus
CN110580262A (en) * 2019-11-08 2019-12-17 支付宝(杭州)信息技术有限公司 Private data query method and device based on intelligent contract
CN111723102A (en) * 2020-08-21 2020-09-29 支付宝(杭州)信息技术有限公司 Intelligent contract updating method and device
CN112560114A (en) * 2021-02-22 2021-03-26 支付宝(杭州)信息技术有限公司 Method and device for calling intelligent contract

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115062079A (en) * 2022-06-21 2022-09-16 平安银行股份有限公司 Transaction flow processing method, device, equipment and storage medium
WO2024104047A1 (en) * 2022-11-18 2024-05-23 中国银联股份有限公司 Blockchain transaction allocation method and apparatus

Also Published As

Publication number Publication date
CN113254163B (en) 2021-11-09
CN113254163A (en) 2021-08-13
CN114327759B (en) 2024-09-13

Similar Documents

Publication Publication Date Title
CN113254163B (en) Processing method and device of block chain data
CN108959341B (en) Data synchronization method, device and equipment
CN107391101B (en) Information processing method and device
CN110134668B (en) Data migration method, device and equipment applied to blockchain
CN108599973B (en) Log association method, device and equipment
CN109104327B (en) Service log generation method, device and equipment
CN113434910A (en) Business data chaining method and device
CN109241026B (en) Data management method, device and system
CN110503435B (en) Transaction early warning method, device and equipment based on blockchain
CN109033127B (en) Synchronous data verification method, device and equipment
CN110633096B (en) Node control method and device, version control method and device and distributed system
CN108733546A (en) A kind of log collection method, device and equipment
CN110781192B (en) Verification method, device and equipment of block chain data
CN107578338B (en) Service publishing method, device and equipment
CN109597678A (en) Task processing method and device
CN111930343A (en) Method, device and medium for acquiring random number and generating random number
CN114529417A (en) Method for executing transaction, block chain, main node and slave node
CN108616361B (en) Method and device for identifying uniqueness of equipment
CN115934161A (en) Code change influence analysis method, device and equipment
CN106156050B (en) Data processing method and device
CN114648303A (en) Service execution method and device
CN110083602B (en) Method and device for data storage and data processing based on hive table
CN110502551A (en) Data read-write method, system and infrastructure component
CN110633321B (en) Data synchronization method, device and equipment
CN115098483A (en) Pre-execution cache data cleaning method and block link point

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240920

Address after: Room 803, floor 8, No. 618 Wai Road, Huangpu District, Shanghai 200010

Patentee after: Ant blockchain Technology (Shanghai) Co.,Ltd.

Country or region after: China

Address before: 310000 801-11 section B, 8th floor, 556 Xixi Road, Xihu District, Hangzhou City, Zhejiang Province

Patentee before: Alipay (Hangzhou) Information Technology Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right