CN110457353B - Contract data processing method and device, computer readable storage medium and computer equipment - Google Patents

Contract data processing method and device, computer readable storage medium and computer equipment Download PDF

Info

Publication number
CN110457353B
CN110457353B CN201910735459.9A CN201910735459A CN110457353B CN 110457353 B CN110457353 B CN 110457353B CN 201910735459 A CN201910735459 A CN 201910735459A CN 110457353 B CN110457353 B CN 110457353B
Authority
CN
China
Prior art keywords
transaction
cache
block
current
merged
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910735459.9A
Other languages
Chinese (zh)
Other versions
CN110457353A (en
Inventor
李茂材
刘区城
王宗友
孔利
蓝虎
杨常青
时一防
周开班
朱耿良
陈秋平
张劲松
刘攀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910735459.9A priority Critical patent/CN110457353B/en
Priority to CN201910853888.6A priority patent/CN110569264B/en
Publication of CN110457353A publication Critical patent/CN110457353A/en
Application granted granted Critical
Publication of CN110457353B publication Critical patent/CN110457353B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • 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
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The application relates to a contract data processing method, a contract data processing device, a computer readable storage medium and computer equipment, wherein the contract data processing method comprises the following steps: receiving a transaction request which comprises at least one transaction to be processed, acquiring an intelligent contract method corresponding to each transaction to be processed according to the transaction request, creating a block cache corresponding to a target block, creating an initial transaction cache corresponding to each transaction to be processed, executing the corresponding intelligent contract method in parallel in each initial transaction cache to obtain a corresponding updated transaction cache, sequentially merging the updated transaction caches into the block caches according to a transaction sequence, merging the current updated transaction caches to be merged into the block caches when the current updated transaction caches to be merged and history merged transaction cache data in the block caches have no resource conflict, merging the current updated transaction caches to be merged into the block caches until the updated transaction caches corresponding to each transaction to be processed are merged into the block caches to obtain the target block cache, and generating an updated block according to the target block cache. The scheme provided by the application can improve the execution efficiency of the intelligent contract method.

Description

Contract data processing method and device, computer readable storage medium and computer equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a contract data processing method and apparatus, a computer-readable storage medium, and a computer device.
Background
As computer technology has evolved, intelligent contracts are closely related to blockchains, an intelligent contract being a computer protocol intended to propagate, validate or execute contracts in an informational manner. Smart contracts allow trusted transactions to be conducted without third parties, which transactions are traceable and irreversible. However, currently, the corresponding intelligent contract methods can only be executed in sequence according to the transaction sequence of the transaction to be processed, and if a service scene with a large request amount occurs in a short time, the execution efficiency of the intelligent contract method is low easily caused by the serial method of the current intelligent contract method.
Disclosure of Invention
In view of the above, it is necessary to provide a contract data processing method, an apparatus, a computer-readable storage medium, and a computer device capable of improving the execution efficiency of an intelligent contract method, in view of the above technical problems.
A method of contract data processing, the method comprising:
receiving a transaction request, the transaction request including at least one pending transaction;
acquiring an intelligent contract method corresponding to each transaction to be processed according to the transaction request;
creating a block cache corresponding to a target block, and creating an initial transaction cache corresponding to each transaction to be processed;
executing corresponding intelligent contract methods in parallel in each initial transaction cache to obtain updated transaction caches corresponding to the transactions to be processed;
merging each updating transaction cache to a block cache in sequence according to the transaction sequence;
when the transaction cache to be merged and updated currently has no resource conflict with the historical merged transaction cache data in the block cache, merging the transaction cache to be merged and updated currently into the block cache;
when resource conflict exists between the current transaction cache to be merged and updated and historical merged transaction cache data in the block cache, re-creating a corresponding intermediate transaction cache based on the block cache, executing an intelligent contract method corresponding to the current transaction cache to be merged and updated in the intermediate transaction cache, and merging the transaction cache corresponding to an execution result into the block cache;
until the updated transaction caches corresponding to the transactions to be processed are merged into the block cache to obtain a target block cache;
and generating an updating block according to the target block cache.
A contract data processing apparatus, the apparatus comprising:
the transaction request receiving module is used for receiving a transaction request, and the transaction request comprises at least one transaction to be processed;
the intelligent contract method acquisition module is used for acquiring the intelligent contract methods corresponding to the transactions to be processed according to the transaction requests;
the cache space creating module is used for creating a block cache corresponding to the target block and creating an initial transaction cache corresponding to each transaction to be processed;
the initial transaction cache updating module is used for executing the corresponding intelligent contract method in parallel in each initial transaction cache to obtain the updated transaction cache corresponding to each transaction to be processed;
the updating transaction cache merging module is used for sequentially merging each updating transaction cache to the block cache according to the transaction sequence;
the resource conflict detection module is used for merging the current transaction cache to be merged and updated into the block cache when no resource conflict exists between the current transaction cache to be merged and updated and the historical merged transaction cache data in the block cache;
the resource conflict detection module is also used for recreating a corresponding intermediate transaction cache based on the block cache when the resource conflict exists between the current transaction cache to be merged and updated and the historical merged transaction cache data in the block cache, executing an intelligent contract method corresponding to the current transaction cache to be merged and updated in the intermediate transaction cache, and merging the transaction cache corresponding to an execution result into the block cache;
the resource conflict detection module is also used for obtaining a target block cache until the updated transaction caches corresponding to the transactions to be processed are merged into the block cache;
and the target block cache merging module is used for generating an updating block according to the target block cache.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps when executing the program of:
receiving a transaction request, the transaction request including at least one pending transaction;
acquiring an intelligent contract method corresponding to each transaction to be processed according to the transaction request;
creating a block cache corresponding to a target block, and creating an initial transaction cache corresponding to each transaction to be processed;
executing corresponding intelligent contract methods in parallel in each initial transaction cache to obtain updated transaction caches corresponding to the transactions to be processed;
merging each updating transaction cache to a block cache in sequence according to the transaction sequence;
when the transaction cache to be merged and updated currently has no resource conflict with the historical merged transaction cache data in the block cache, merging the transaction cache to be merged and updated currently into the block cache;
when resource conflict exists between the current transaction cache to be merged and updated and historical merged transaction cache data in the block cache, re-creating a corresponding intermediate transaction cache based on the block cache, executing an intelligent contract method corresponding to the current transaction cache to be merged and updated in the intermediate transaction cache, and merging the transaction cache corresponding to an execution result into the block cache;
until the updated transaction caches corresponding to the transactions to be processed are merged into the block cache to obtain a target block cache;
and generating an updating block according to the target block cache.
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, causes the processor to perform the steps of:
receiving a transaction request, the transaction request including at least one pending transaction;
acquiring an intelligent contract method corresponding to each transaction to be processed according to the transaction request;
creating a block cache corresponding to a target block, and creating an initial transaction cache corresponding to each transaction to be processed;
executing corresponding intelligent contract methods in parallel in each initial transaction cache to obtain updated transaction caches corresponding to the transactions to be processed;
merging each updating transaction cache to a block cache in sequence according to the transaction sequence;
when the transaction cache to be merged and updated currently has no resource conflict with the historical merged transaction cache data in the block cache, merging the transaction cache to be merged and updated currently into the block cache;
when resource conflict exists between the current transaction cache to be merged and updated and historical merged transaction cache data in the block cache, re-creating a corresponding intermediate transaction cache based on the block cache, executing an intelligent contract method corresponding to the current transaction cache to be merged and updated in the intermediate transaction cache, and merging the transaction cache corresponding to an execution result into the block cache;
until the updated transaction caches corresponding to the transactions to be processed are merged into the block cache to obtain a target block cache;
and generating an updating block according to the target block cache.
The contract data processing method, the contract data processing device, the computer readable storage medium and the computer equipment acquire at least one to-be-processed transaction through a transaction request corresponding intelligent contract method, obtain an updated transaction cache corresponding to each to-be-processed transaction by creating a block cache corresponding to a target block, then creating initial transaction caches corresponding to the to-be-processed transactions, and executing corresponding intelligent contract methods in parallel in the initial transaction caches to obtain updated transaction caches corresponding to the to-be-processed transactions, sequentially merging the updated transaction caches into the block caches according to a transaction sequence, merging the current to-be-merged updated transaction caches into the block caches when the current to-be-merged updated transaction caches have no resource conflict with history merged transaction cache data in the block caches, and re-creating corresponding intermediate transaction caches based on the block caches when the current to-be-merged updated transaction caches have resource conflict with the history merged transaction cache data in the block caches, and executing the intelligent contract method corresponding to the current to-be-merged updated transaction cache in the intermediate transaction cache, merging the transaction caches corresponding to the execution results into the block cache until the updated transaction caches corresponding to the to-be-processed transactions are merged into the block cache to obtain a target block cache, and generating an updated block according to the target block cache.
Therefore, by creating the initial transaction cache corresponding to each transaction to be processed, executing the corresponding intelligent contract method in the initial transaction cache in parallel, ignoring the transaction sequence of each transaction to be processed, executing the corresponding intelligent contract method in the respective initial transaction cache in parallel, and improving the execution efficiency of the intelligent contract method. Furthermore, corresponding updated transaction caches are obtained by executing corresponding intelligent contract methods in parallel in respective initial transactions, then the updated transaction caches are combined into the block cache in sequence according to transaction sequences, in the combining process, whether resource conflicts exist between the current to-be-combined updated transaction cache corresponding to the current to-be-processed transaction and historical combined transaction cache data in the block cache is detected, when the resource conflicts do not exist, the updated transaction caches corresponding to the to-be-processed transactions are combined into the block cache to obtain a target block cache, finally, an update block is generated according to the target block cache, whether the resource conflicts exist in the combining process can be detected without analyzing byte codes of the intelligent contract methods, and the comprehensiveness and accuracy of contract conflict detection are improved.
Drawings
FIG. 1 is a diagram of an application environment of a contract data processing method in one embodiment;
FIG. 2 is a schematic flow chart diagram illustrating a method for contract data processing in one embodiment;
FIG. 3 is a schematic diagram of a block cache and an initial transaction cache, in one embodiment;
FIG. 4 is a flowchart illustrating steps performed by the intelligent contract method in one embodiment;
FIG. 5 is a flow diagram illustrating the merge step of updating the transaction cache into the block cache in one embodiment;
FIG. 5A is a diagram illustrating merging of transaction results from updating a transaction cache into a block cache, according to an embodiment;
FIG. 6 is a flowchart illustrating the resource conflict detection step in one embodiment;
FIG. 6A is a diagram that illustrates intelligent contract method conflict detection, in one embodiment;
FIG. 7 is a flowchart illustrating the steps of determining whether there is an intersection between the current update write cache and the historical merged transaction cache data in one embodiment;
FIG. 8 is a flowchart illustrating the resource conflict detection step in another embodiment;
FIG. 9 is a flowchart illustrating the steps of determining whether there is an intersection between the current update read cache and the historical merged transaction cache data in one embodiment;
FIG. 9A is a schematic diagram illustrating an embodiment of a step of determining whether there is an intersection between a current update read cache and historical merged transaction cache data;
FIG. 10 is a schematic diagram of a contract data processing method in one embodiment;
FIG. 11 is a block diagram of a contract data processing apparatus according to one embodiment;
FIG. 12 is a block diagram that illustrates the structure of a cache space creation module in one embodiment;
FIG. 13 is a block diagram that illustrates the structure of an initial transaction cache update module in one embodiment;
FIG. 14 is a block diagram of the structure of an update transaction cache merge module in one embodiment;
FIG. 15 is a block diagram showing a configuration of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
FIG. 1 is a diagram of an application environment for a contract data processing method in one embodiment. Referring to fig. 1, the contract data processing method is applied to a contract data processing system. The contract data processing system includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected through a network. The terminal 110 may specifically be a desktop terminal or a mobile terminal, and the mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a notebook computer, and the like. The server 120 may be implemented as a stand-alone server or as a server cluster of at least one server. The server 120 is a node, and a complete block chain is stored in the node, where the block chain includes at least one block.
Specifically, the terminal 110 sends at least one pending transaction to the server 120 via a transaction request. The server 120 receives the transaction request, acquires the intelligent contract method corresponding to each transaction to be processed according to the transaction request, creates a block cache corresponding to a target block, creates an initial transaction cache corresponding to each transaction to be processed, executes the corresponding intelligent contract method in parallel in each initial transaction cache to obtain an updated transaction cache corresponding to each transaction to be processed, sequentially merges each updated transaction cache to the block caches according to the transaction sequence, merges the current updated transaction cache to be merged into the block caches when the current updated transaction cache to be merged has no resource conflict with the history merged transaction cache data in the block caches, re-creates a corresponding intermediate transaction cache based on the block cache when the current updated transaction cache to be merged has resource conflict with the history merged transaction cache data in the block caches, and executes the intelligent contract corresponding to the current updated transaction cache to be merged in the intermediate transaction cache, and merging the transaction caches corresponding to the execution results into the block cache until the updated transaction caches corresponding to the to-be-processed transactions are merged into the block cache to obtain a target block cache, and generating an updated block according to the target block cache.
As shown in FIG. 2, in one embodiment, a contract data processing method is provided. The contract data processing method may be executed by a computer device, and the computer device may be at least one of a server or a terminal. The embodiment is mainly illustrated by applying the method to the server 120 in fig. 1. Referring to fig. 2, the contract data processing method specifically includes the following steps:
at step 202, a transaction request is received, the transaction request including at least one pending transaction.
The transaction request is used for requesting to process the transaction to be processed, the transaction request is usually sent to the server by the terminal, and the server can process the corresponding transaction to be processed according to the transaction request after receiving the transaction request. The transaction request comprises at least one transaction to be processed, and the transaction to be processed is a transaction waiting to be processed. The to-be-processed transaction has the corresponding intelligent contract method, the to-be-processed transaction with the corresponding intelligent contract method can create the corresponding initial transaction cache, and the to-be-processed transaction without the corresponding intelligent contract method does not need to create the corresponding initial transaction cache.
Specifically, the terminal can trigger and generate a transaction request through a related application or control, carry transaction information corresponding to at least one transaction to be processed into the transaction request, and send the transaction information to the server through the network.
And 204, acquiring the intelligent contract method corresponding to each transaction to be processed according to the transaction request.
The intelligent contract is closely related to a block chain, the block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like, the block chain is essentially a decentralized database, the block chain is used as a bottom layer technology of the bitcoin, the blockchain is a series of data blocks which are produced by being related by a cryptography method, and each data block contains information of a batch of bitcoin network transactions and is used for verifying the validity (anti-counterfeiting) of the information and generating the next block. While smart contracts are a significant reason why blockchains are referred to as "decentralized," they allow for the execution of traceable, irreversible, and secure transactions without the need for third parties.
The intelligent contract is a computer protocol used in the block chain technology, contains all information of at least one transaction to be processed, and executes result operation only after meeting the requirement. The intelligent contract comprises at least one variable and a corresponding contract method, wherein the intelligent contract method refers to a contract method in the intelligent contract.
Specifically, after receiving the transaction request, the server obtains the intelligent contract method corresponding to each transaction to be processed according to the transaction request. Specifically, the corresponding variable is determined according to each transaction to be processed, the corresponding contract method is determined according to the variable, and the contract method corresponding to the variable is used as the intelligent contract method corresponding to the corresponding transaction to be processed.
And step 206, creating a block cache corresponding to the target block, and creating an initial transaction cache corresponding to each transaction to be processed.
The target block is used to create a block cache, and the target block may be determined from the chunks, for example, the target block may be a latest chunk, where the latest chunk refers to a highest-level chunk of the chunks stored by the server. The block cache is used for caching the transaction results corresponding to all the to-be-processed transactions, and the initial transaction cache is used for caching the transaction results generated by executing the corresponding intelligent contract method on each to-be-processed transaction. When each transaction to be processed executes the corresponding intelligent contract method, the changes brought by the intelligent contract method are cached in the corresponding initial transaction cache, and the transaction results generated by the intelligent contract method corresponding to the execution of each transaction to be processed can be merged into the block cache. That is, the block cache temporarily stores the transaction results corresponding to all the transactions to be processed.
Specifically, the block cache may be created for a latest block based on the contract cache, where the latest block refers to a block with a highest degree among blocks stored by the server, and after the block cache is created, a corresponding initial transaction cache may be created for each to-be-processed transaction based on the block cache. The contract cache is used for storing the intelligent contract methods corresponding to the to-be-processed transactions, and after the to-be-processed transactions acquire the corresponding intelligent contract methods from the database, the acquired intelligent contract methods are uniformly put into the contract cache for storage. The contract cache comprises a contract read cache and a contract write cache, wherein the contract read cache is used for recording the read access condition of the intelligent contract method, and the contract write cache is used for recording the write access condition of the intelligent contract method.
In one embodiment, a read cache and a write cache corresponding to a block cache are created for the latest block based on the contract cache, and then a read cache and a write cache corresponding to an initial transaction cache are created for each transaction to be processed based on the read cache and the write cache of the block cache. The method comprises the steps that corresponding intelligent contract methods are respectively executed on a read cache and a write cache corresponding to an initial transaction cache of a transaction to be processed, a transaction result corresponding to the read cache of the initial transaction cache and a transaction result corresponding to the write cache of the initial transaction cache are respectively obtained, finally, the transaction results corresponding to the read cache of the initial transaction cache are merged into the read cache corresponding to a block cache, and the transaction results corresponding to the write cache of the initial transaction cache are merged into the write cache corresponding to the block cache.
And step 208, executing the corresponding intelligent contract methods in parallel in each initial transaction cache to obtain the updated transaction caches corresponding to the transactions to be processed.
Specifically, after the block cache and the initial transaction caches corresponding to the respective transactions to be processed are created, the initial transaction caches are used for recording transaction information generated in the process of executing the intelligent contract method for the transactions to be processed, so that the corresponding intelligent contract method is executed in the initial transaction caches corresponding to the respective transactions to be processed, and the updated transaction caches corresponding to the respective transactions to be processed are obtained. That is, the intelligent contract is a set of commitments defined in a digital form, and after the intelligent contract method corresponding to each transaction to be processed is obtained, each transaction to be processed needs to be executed according to a protocol specified by the corresponding intelligent contract method, so that a transaction result corresponding to each transaction to be processed is obtained, the initial transaction cache is updated according to the transaction result, that is, the transaction result is stored in the updated transaction cache. The transaction result is that each transaction to be processed executes the corresponding intelligent contract method in the corresponding transaction cache, and the change result brought by the intelligent contract method can be used as the corresponding transaction result.
The intelligent contract method is executed in parallel, namely, the intelligent contract method is directly executed in parallel in the corresponding initial transaction cache by each transaction to be processed regardless of the transaction sequence of each transaction to be processed.
And step 210, merging the updated transaction caches into the block cache in sequence according to the transaction sequence.
The transactions to be processed are arranged in sequence when being packed into the target block, and the transaction sequence corresponding to each transaction to be processed can be directly obtained without arranging the sequence. And when the to-be-processed transactions are not packed to the target block, determining the transaction sequence according to the transaction time of each to-be-processed transaction time, wherein the transaction time refers to the transaction time point corresponding to each to-be-processed transaction. The transaction sequence refers to a transaction sequence among the transactions to be processed, and the transaction sequence corresponding to each transaction to be processed can be determined according to the transaction time corresponding to each transaction to be processed. Specifically, the transaction sequence corresponding to each transaction to be processed can be directly obtained according to the transaction request.
Further, the updated transaction caches corresponding to the respective transactions to be processed are sequentially merged into the block cache according to the transaction sequence corresponding to the respective transactions to be processed, that is, after completion of the merging, the block cache includes the transaction results corresponding to all the transactions to be processed, that is, the block cache includes the transaction results corresponding to the respective transactions to be processed in the updated transaction cache.
In one embodiment, the block cache comprises a corresponding read cache and a corresponding write cache, the initial transaction cache corresponding to each transaction to be processed comprises a read cache and a write cache, and each transaction to be processed executes a corresponding intelligent contract method in the read cache and the write cache corresponding to the corresponding initial transaction cache to respectively obtain a transaction result corresponding to the read cache of the initial transaction cache and a transaction result corresponding to the write cache of the initial transaction cache, and then the initial transaction cache is updated according to the transaction result to obtain an updated transaction cache.
And finally, acquiring a transaction sequence among the transactions to be processed, sequentially merging the transaction results corresponding to the read cache of the initial transaction cache corresponding to the transactions to be processed into the read cache corresponding to the block cache according to the transaction sequence, merging the transaction results corresponding to the write cache of the initial transaction cache into the write cache corresponding to the block cache, namely sequentially merging the updated transaction caches corresponding to the transactions to be processed into the block caches according to the transaction sequence.
And step 212, merging the current transaction cache to be merged and updated into the block cache when the current transaction cache to be merged and updated has no resource conflict with the historical merged transaction cache data in the block cache.
In the merging process of sequentially merging the updated transaction caches corresponding to the to-be-processed transactions into the block caches according to the transaction sequence, a resource conflict between intelligent contract methods may exist, the resource conflict is that the current to-be-processed transaction and merged transaction cache data in the block caches have a competitive relationship, and the current to-be-merged updated transaction caches are merged into the block caches only when the current to-be-processed transaction and the merged transaction cache data in the block caches have no competitive relationship.
Wherein, the transaction cache to be merged and updated temporarily stores the current transaction result corresponding to the current transaction to be processed, the current pending transaction refers to the current pending transaction being processed, and the pending merged updated transaction cache where the current transaction result corresponding to the current pending transaction is obtained may be specifically the updated transaction cache corresponding to the current pending transaction is used as the pending merged updated transaction cache, since the updated transaction cache corresponding to each pending transaction temporarily holds the corresponding transaction result, the merging of the updated transaction cache into the block cache means that the transaction results corresponding to the transactions to be processed are merged into the block cache, the transactions to be processed successfully merged into the block cache are updated into processed transactions, that is, all transaction results of the processed transactions are temporarily stored in the block cache, that is, the historical merged transaction cache data. The processed transaction refers to a processed transaction in which the update transaction cache corresponding to the transaction to be processed is successfully merged into the block cache after updating, that is, the corresponding update transaction cache is successfully merged into the block cache.
Specifically, a current updated transaction cache corresponding to the current transaction to be processed is obtained, the current updated transaction cache is used as a to-be-merged updated transaction cache, historical merged transaction cache data temporarily stored in a block cache is obtained, and when the to-be-merged updated transaction cache and the historical merged transaction cache data in the block cache have no resource conflict, the current to-be-merged updated transaction cache is merged into the block cache, namely in the merging process, a conflict exists between an intelligent contract method corresponding to the current transaction to be processed and an intelligent contract method corresponding to the processed transaction, namely a resource competition relationship exists between the current transaction to be processed and the processed transaction.
On the contrary, when resource conflict exists between the transaction cache to be merged and updated and the historical merged transaction cache data in the block cache, it is determined that resource conflict exists between the intelligent contract method corresponding to the current transaction to be processed and the intelligent contract method corresponding to the processed transaction, the current transaction cache to be merged and updated cannot be merged into the block cache, a corresponding intermediate transaction cache needs to be created again based on the block cache, the intelligent contract method corresponding to the current transaction cache to be merged and updated is executed in the intermediate transaction cache, and the transaction caches corresponding to the execution results are merged into the block cache until the updated transaction caches corresponding to the transactions to be processed are merged into the block cache to obtain the target block cache.
And 214, when resource conflict exists between the current transaction cache to be merged and updated and historical merged transaction cache data in the block cache, recreating a corresponding intermediate transaction cache based on the block cache, executing the intelligent contract method corresponding to the current transaction cache to be merged and updated in the intermediate transaction cache, and merging the transaction cache corresponding to the execution result into the block cache.
And step 216, merging the updated transaction caches corresponding to the transactions to be processed into the block cache to obtain the target block cache.
At step 218, update blocks are generated from the target block cache.
Specifically, when resource conflict exists between the current transaction cache to be merged and updated and the historical merged transaction cache data in the block cache, it is indicated that a competitive relationship exists between the intelligent contract method corresponding to the current transaction to be processed and the intelligent contract method corresponding to the processed transaction in the block cache, and therefore, the current transaction cache to be merged and updated cannot be merged and updated into the block cache at present. In order to solve the problem, a corresponding intermediate transaction cache needs to be created again based on the block cache, an intelligent contract method corresponding to the current transaction cache to be merged and updated is executed in the intermediate transaction cache, and the transaction cache corresponding to the execution result is merged to the block cache.
However, if the corresponding intermediate transaction cache is created again based on the block cache, and an execution result obtained by executing the intelligent contract method corresponding to the current to-be-merged updated transaction cache in the intermediate transaction cache still has a competitive relationship with the historical merged transaction cache data, the corresponding intermediate transaction cache may be created again based on the block cache, and the intelligent contract method corresponding to the current to-be-merged updated transaction cache is executed in the intermediate transaction cache until the execution result does not have a resource conflict with the historical merged transaction cache data, and the transaction cache corresponding to the execution result is merged into the block cache. The preset times can be set according to actual application, and when the preset times are reached, if the execution result cannot have resource conflict with the history merged transaction cache data, the current transaction to be processed can be discarded.
And further, according to the transaction sequence corresponding to each transaction to be processed, sequentially merging the updated transaction caches corresponding to the transactions to be processed into the block cache, in the merging process, if the resource conflict exists between the current transaction to be processed and the historical merged transaction cache in the block cache, re-creating a corresponding intermediate transaction cache based on the block cache, executing the intelligent contract method corresponding to the current transaction to be merged and the updated transaction cache in the intermediate transaction cache until the resource conflict does not exist between the current transaction to be processed and the historical merged transaction cache in the block cache, and merging the transaction cache corresponding to the execution result into the block cache. In this way, the updated transaction caches corresponding to the respective transactions to be processed are merged into the target block cache in the block cache, that is, all the historical merged transaction cache data in the target block cache have no competition relationship or no resource conflict.
And finally, a complete block chain is stored in the server, the block chain comprises at least one block, and after the target block cache is obtained, an update block needs to be generated according to the target block cache.
The contract data processing method comprises the steps of obtaining a corresponding intelligent contract method for at least one transaction to be processed through a transaction request, obtaining an updated transaction cache corresponding to each transaction to be processed through creating a block cache corresponding to a target block, then creating initial transaction caches corresponding to the transactions to be processed, executing the corresponding intelligent contract method in parallel in the initial transaction caches to obtain the updated transaction caches corresponding to the transactions to be processed, sequentially merging the updated transaction caches into the block caches according to a transaction sequence, merging the current updated transaction caches to be merged into the block caches when the current updated transaction caches to be merged have no resource conflict with history merged transaction cache data in the block caches, recreating corresponding intermediate transaction caches based on the block caches when the current updated transaction caches to be merged have resource conflict with the history merged transaction cache data in the block caches, and executing the intelligent contract method corresponding to the current updated transaction caches to be merged in the intermediate transaction caches, and merging the transaction caches corresponding to the execution results into the block cache until the updated transaction caches corresponding to the to-be-processed transactions are merged into the block cache to obtain a target block cache, and generating an updated block according to the target block cache.
Therefore, by creating the initial transaction cache corresponding to each transaction to be processed, executing the corresponding intelligent contract method in the initial transaction cache in parallel, ignoring the transaction sequence of each transaction to be processed, executing the corresponding intelligent contract method in the respective initial transaction cache in parallel, and improving the execution efficiency of the intelligent contract method. Furthermore, corresponding updated transaction caches are obtained by executing corresponding intelligent contract methods in parallel in respective initial transactions, then the updated transaction caches are combined into the block cache in sequence according to transaction sequences, in the combining process, whether resource conflicts exist between the current to-be-combined updated transaction cache corresponding to the current to-be-processed transaction and historical combined transaction cache data in the block cache is detected, when the resource conflicts do not exist, the updated transaction caches corresponding to the to-be-processed transactions are combined into the block cache to obtain a target block cache, finally, an update block is generated according to the target block cache, whether the resource conflicts exist in the combining process can be detected without analyzing byte codes of the intelligent contract methods, and the comprehensiveness and accuracy of contract conflict detection are improved.
In one embodiment, creating a block cache corresponding to the target block, and creating an initial transaction cache corresponding to each transaction to be processed includes: and acquiring a target block, establishing a corresponding block read cache and a corresponding block write cache for the target block based on the contract cache, and establishing a corresponding initial transaction read cache and an initial transaction write cache for each transaction to be processed based on the block read cache and the block write cache.
The contract cache is used for storing the intelligent contract methods corresponding to the to-be-processed transactions, and after the to-be-processed transactions acquire the corresponding intelligent contract methods from the database, the acquired intelligent contract methods are uniformly placed into the contract cache for storage. The block cache is used for caching the transaction results corresponding to all the to-be-processed transactions, and the initial transaction cache is used for caching the transaction information generated by executing the corresponding intelligent contract method for each to-be-processed transaction. When each transaction to be processed executes the corresponding intelligent contract method, the changes brought by the intelligent contract method are cached in the corresponding initial transaction cache, so that the updated transaction cache is obtained, and the transaction results generated when each transaction to be processed executes the corresponding intelligent contract method can be merged into the block cache. That is, the block cache temporarily stores the transaction results corresponding to all the transactions to be processed.
Specifically, a block read cache and a block write cache corresponding to the block cache are created for the latest block based on the contract cache, and then an initial transaction read cache and an initial transaction write cache corresponding to the initial transaction cache are created for each transaction to be processed based on the block read cache and the block write cache. The method comprises the steps that corresponding intelligent contract methods are respectively executed on an initial transaction read cache and an initial transaction write cache corresponding to an initial transaction cache of a transaction to be processed, a transaction result corresponding to the initial transaction read cache of the initial transaction cache and a transaction result corresponding to the initial transaction write cache of the initial transaction cache are respectively obtained, the initial transaction read cache is updated according to the transaction result corresponding to the initial transaction read cache, an updated transaction read cache is obtained, and the initial transaction write cache is updated according to the transaction result corresponding to the initial transaction write cache to obtain an updated transaction write cache.
And finally, merging the transaction results corresponding to the updated transaction read cache of the updated transaction cache into the block read cache corresponding to the block cache, and merging the transaction results corresponding to the updated transaction write cache of the updated transaction cache into the block write cache corresponding to the block cache.
In an embodiment, as shown in fig. 3, fig. 3 is a schematic diagram of a block cache and an initial transaction cache in an embodiment, specifically, the server obtains a latest block, and creates a block read cache and a block write cache corresponding to the block cache for the latest block based on a contract cache, that is, the block cache includes the block read cache and the block write cache. Further, a corresponding initial transaction read cache and an initial transaction write cache are created for each transaction to be processed based on the block read cache and the block write cache, that is, each transaction to be processed has a corresponding initial transaction read cache and an initial transaction write cache.
In an embodiment, as shown in fig. 4, executing a corresponding intelligent contract method in parallel in each initial transaction cache to obtain an updated transaction cache corresponding to each transaction to be processed includes:
step 402, executing the corresponding intelligent contract method in parallel in the initial transaction read cache corresponding to each transaction to be processed, and obtaining the updated transaction read cache corresponding to each transaction to be processed.
And step 404, executing corresponding intelligent contract methods in parallel in the initial transaction write cache corresponding to each transaction to be processed to obtain an updated transaction write cache corresponding to each transaction to be processed.
The updating transaction cache corresponding to each transaction to be processed comprises an updating transaction read cache and an updating transaction write cache, the updating transaction read cache is used for recording the read access condition of the transaction to be processed, the updating transaction write cache is used for recording the write access condition of the transaction to be processed, and each transaction to be processed can execute a corresponding intelligent contract method in the initial transaction cache so as to obtain the updating transaction cache.
Specifically, the corresponding intelligent contract method is executed in parallel in the transaction read cache corresponding to each transaction to be processed, changes caused by the intelligent contract method are all stored in the transaction read cache, a transaction read cache result corresponding to each transaction to be processed is obtained, and the transaction read cache result is stored in the updated transaction read cache. Similarly, executing the corresponding intelligent contract method in parallel in the transaction write cache corresponding to each transaction to be processed to obtain the transaction write cache result corresponding to each transaction to be processed, and storing the transaction write cache result in the updated transaction write cache. That is, both the transaction read cache and the transaction write cache are used to execute the corresponding execution contract and temporarily store the corresponding execution result.
In one embodiment, as shown in fig. 5, merging the updated transaction caches into the block cache in sequence in the transaction order includes:
step 502, obtaining a transaction sequence corresponding to each transaction to be processed.
The transactions to be processed are arranged in sequence when being packed into the target block, and the transaction sequence corresponding to each transaction to be processed can be directly obtained without arranging the sequence. And when the to-be-processed transactions are not packed to the target block, determining the transaction sequence according to the transaction time of each to-be-processed transaction time, wherein the transaction time refers to the transaction time point corresponding to each to-be-processed transaction. Specifically, the server (node) directly obtains the transaction sequence corresponding to each transaction to be processed.
And step 504, sequentially merging the updated transaction write cache corresponding to each transaction to be processed into the block write cache according to the transaction sequence.
Specifically, after the transaction sequence corresponding to each transaction to be processed is obtained, the updated transaction write cache corresponding to each transaction to be processed is sequentially merged into the block write cache. Namely, the transaction write cache result of the transaction write cache is submitted to the block write cache, namely the block write cache is the union of the transaction write cache results corresponding to all the transactions to be processed.
Whether conflicts exist among the intelligent contract methods corresponding to the transactions to be processed or not is identified by submitting the updated transaction write cache to the block write cache, and the explanations can be specifically given through the following embodiments, which are not repeated herein.
In the execution process of the intelligent contract method corresponding to each transaction to be processed, the data read from the database or the contract cache is stored in the block read cache.
In one embodiment, as shown in FIG. 5A, FIG. 5A illustrates a schematic diagram of updating the transaction results in a transaction cache to merge into a block cache in one embodiment. FIG. 5A shows a transaction 1 read cache, a transaction 1 write cache, and a transaction 2 read cache, a transaction 2 write cache. Specifically, transaction 1 read cache is submitted to block read cache and transaction 1 write cache is submitted to block write cache according to transaction sequence. And then submitting the transaction 2 read cache to the block read cache and submitting the transaction 2 write cache to the block write cache.
In one embodiment, as shown in fig. 6, the current to-be-merged update transaction cache is a current update transaction write cache or a current update transaction read cache, where the initial transaction cache includes an initial transaction read cache and an initial transaction write cache, the current update transaction write cache is obtained by executing a corresponding intelligent contract method on a current to-be-processed transaction in the current initial transaction write cache, the current update transaction read cache is obtained by executing a corresponding intelligent contract method on a current to-be-processed transaction in the current initial transaction read cache, the block cache includes a block read cache and a block write cache, and when there is a resource conflict between the current to-be-merged update transaction cache and historical merged transaction cache data in the block cache, the method includes:
step 602, when the transaction cache to be merged is the current update transaction write cache, obtaining historical merged transaction cache data in the block write cache, where the historical merged transaction cache data is the update transaction write cache corresponding to the processed transaction, and the update transaction cache corresponding to the transaction to be processed is merged into the block cache and then updated to the processed transaction.
The transaction cache to be merged and updated may be a current transaction write cache result or a current transaction read cache result, the transaction cache to be updated includes a transaction read cache to be updated and a transaction write cache to be updated, the current transaction write cache result is obtained by executing a corresponding intelligent contract method in the current transaction write cache to be processed, the current transaction read cache is obtained by executing a corresponding intelligent contract method in the current transaction read cache to be processed, the block cache includes a block read cache and a block write cache, the transaction read cache corresponding to each transaction to be processed is merged into the block read cache, and the transaction write cache corresponding to each transaction to be processed is merged into the block write cache.
Here, the update transaction cache to be merged may be a write cache of the current update transaction, or may be a read cache of the current update transaction. Specifically, when the transaction cache to be merged is the current update transaction write cache, it is described that the current update transaction write cache obtained by executing the corresponding intelligent contract method on the update transaction write cache for the current transaction to be processed is used as the transaction cache to be merged. And acquiring historical merged transaction cache data in the block write cache, wherein the historical merged transaction cache data is an updated transaction write cache corresponding to the processed transaction, and the updated transaction cache corresponding to the transaction to be processed is merged into the block cache and then updated into the processed transaction.
The processed transaction means a transaction processed after the pending transaction is successfully merged with the corresponding updated transaction cache to the block cache. There is no conflict between pending transactions corresponding to historical merged transaction cache data in the block cache. That is, if there is a conflict for the pending transaction, the transaction write cache result will not be committed to the block write cache, and thus there is no conflict between the processed transactions in the block write cache.
Step 604, when the intersection exists between the current updated transaction write cache and at least one historical merged transaction cache data, it is determined that a resource conflict exists between the current transaction write cache to be merged and updated and the historical merged transaction cache data in the block cache.
Specifically, when the intersection exists between the current updated transaction write cache and at least one history merged transaction cache data, it is indicated that the current to-be-processed transaction and the processed transaction are both changed in the same storage slot, so that in the execution process of the actual intelligent contract method, the current to-be-processed transaction must wait for the completion of the transactions corresponding to all the processed transactions before starting, that is, the current to-be-processed transaction and the processed transaction cannot be parallel, and it is determined that the intelligent contract method corresponding to the current to-be-processed transaction and the intelligent contract method corresponding to the processed transaction conflict.
In one embodiment, as shown in FIG. 6A, FIG. 6A illustrates a schematic diagram of intelligent contract method conflict detection in one embodiment. Fig. 6A shows a block write cache and a current transaction write cache result corresponding to a current transaction to be processed, where the current transaction to be processed is transaction 4, and the block write cache includes transaction write cache results corresponding to transactions 1, 2, and 3, and forms a historical transaction write cache result set in the block write cache. As shown in fig. 6A, if there is an intersection between the current transaction write cache result corresponding to the current transaction to be processed and at least one historical transaction write cache result in the block write cache, it is determined that there is a conflict between the intelligent contract method corresponding to the current transaction to be processed and the intelligent contract method corresponding to the processed transaction, that is, the current transaction to be processed must wait for the completion of all transactions corresponding to the processed transaction before the transaction can be started.
In one embodiment, as shown in FIG. 7, when there is an intersection between the current updated transaction write cache and at least one historical merged transaction cache data, the method includes:
step 702, obtaining a current transaction write key value pair corresponding to a current updated transaction write cache, where the current transaction write key value pair includes a current key and a corresponding current value.
Step 704, obtaining historical transaction write key value pairs corresponding to historical merged transaction cache data, where the historical transaction write key value pairs include historical keys and corresponding historical values.
The current updated transaction write cache temporarily stores the current transaction write cache result, which may be a key-value pair (key-value) string, which is often used in development, and each key is followed by a corresponding value, and when the corresponding key is pressed, the corresponding result is output. Therefore, whether conflicts exist between intelligent contract methods can be detected by updating the key-value pairs corresponding to the transaction write cache.
Specifically, a current transaction write key value pair corresponding to a current transaction write cache result in a current updated transaction write cache is obtained, the current transaction write key value pair comprises a current key and a corresponding current value, and a historical transaction write key value pair corresponding to historical merged transaction cache data is obtained at the same time, and the historical transaction write key value pair comprises a historical key and a corresponding historical value.
Step 706, when at least one target history key identical to the current key exists in each history key, it is determined that an intersection exists between the current updated transaction write cache and at least one history merged transaction cache data.
Specifically, a target history key which is the same as the current key is obtained from each history key, and when the current value corresponding to the current key is different from the target history value corresponding to the target history key, the current transaction to be processed and the processed transaction are changed by the same storage slot, so that in the execution process of the actual intelligent contract method, the current transaction to be processed can be started only after the transactions corresponding to all the processed transactions are completed, namely the current transaction to be processed and the processed transactions can not be parallel, and the intersection of the current updated transaction write cache and at least one history merged transaction cache data is determined.
In one embodiment, as shown in fig. 6A, the block write cache in fig. 6A includes a historical transaction write cache result corresponding to the processed transaction, such as the transaction write cache result of transaction 1: 1 is 1, the 1 on the left of the equal sign represents key, the 1 on the right of the equal sign represents value, and the transaction write cache result of transaction 2: 2 is equal to 2 and the transaction writing cache result 3 of the transaction 3 is equal to 3, and the current transaction to be processed is the transaction writing cache result corresponding to the transaction 4: if the key in the transaction write cache result of transaction 4 is 3 and the key in the historical transaction write cache result in the block cache is 3, it is determined that there is a conflict between the current transaction to be processed and the previous processed transaction, and the transaction can be started after the completion of all the transactions corresponding to the previous processed transaction.
In one embodiment, as shown in fig. 8, on the basis of fig. 6, when there is a resource conflict between the current to-be-merged updated transaction cache and the historical merged transaction cache data in the block cache, the method includes:
step 802, obtaining a current update transaction read cache corresponding to the current transaction to be processed, and using the current update transaction read cache as a to-be-merged update transaction cache.
Step 804, when the intersection exists between the current updated transaction read cache and at least one history merged transaction cache data, determining that resource conflict exists between the current transaction read cache to be merged and updated and the history merged transaction cache data in the block cache.
The current updating transaction read cache comprises a result obtained by executing a corresponding intelligent contract method on the current transaction to be processed in the corresponding updating transaction read cache, historical merged transaction cache data is an updating transaction write cache result corresponding to all processed transactions in the block cache, and the updating transaction write cache result is obtained by executing the corresponding intelligent contract on the corresponding updating transaction write cache on the processed transactions.
The processed transaction means a transaction processed after the pending transaction is successfully merged with the corresponding updated transaction cache to the block cache. There is no conflict between pending transactions corresponding to historical merged transaction cache data in the block cache. That is, if there is a conflict in the pending transaction, the transaction write cache result will not be committed to the block write cache, so there is no conflict between the forward pending transactions in the block write cache.
Specifically, a current update transaction read cache corresponding to the current transaction to be processed is obtained, the current update transaction read cache comprises a cache obtained by executing a corresponding intelligent contract method in the corresponding update transaction read cache for the current transaction to be processed, the current update transaction read cache is used as a to-be-merged update transaction cache, and when an intersection exists between the current update transaction read cache and at least one historical merged transaction cache data, it is determined that the intelligent contract method corresponding to the current transaction to be processed conflicts with the intelligent contract method corresponding to the processed transaction.
In one embodiment, as shown in FIG. 9, when there is an intersection between the current updated transaction read cache and at least one historical merged transaction cache data, it includes:
step 902, obtaining a current transaction key-reading value pair corresponding to a current updated transaction read cache, where the current transaction key-reading value pair includes a current key and a corresponding current value.
Step 904, obtaining historical transaction write key value pairs corresponding to historical merged transaction cache data, the historical transaction write key value pairs including historical keys and corresponding historical values.
The current updated transaction read cache temporarily stores the current transaction read cache result, where the transaction read cache result may be a key value pair, where a key value pair (value) character string is frequently used in development, each key is followed by a corresponding value, and when the corresponding key is pressed, the corresponding result is output. Therefore, whether conflicts exist between intelligent contract methods can be detected by updating the corresponding key-value pairs of the transaction read cache.
Specifically, a current transaction key-reading value pair corresponding to a current transaction read cache result in a current updated transaction read cache is obtained, the current transaction key-reading value pair comprises a current key and a corresponding current value, and a historical transaction key-writing value pair corresponding to historical merged transaction cache data is obtained at the same time, and the historical transaction key-writing value pair comprises a historical key and a corresponding historical value.
Step 906, when at least one target history key identical to the current key exists in each history key, determining that an intersection exists between the current updated transaction read cache and at least one history merged transaction cache data.
Specifically, when at least one target history key identical to the current key exists in each history key, it is indicated that under the parallel condition of the intelligent contract method corresponding to each transaction to be processed, values of the target history keys in different servers may have different conditions, and in order to maintain consistency among the servers, it is considered that the current transaction to be processed reads old data in a unified and pessimistic manner, that is, the current transaction to be processed must start after the transactions corresponding to all the processed transactions are completed, so that the current transaction to be processed and the processed transactions cannot be parallel, and it is determined that an intersection exists between the current updated transaction read cache and at least one history merged transaction cache data.
In one embodiment, as shown in fig. 9A, the block write cache in fig. 9A includes a historical transaction write cache result corresponding to the processed transaction, such as the transaction write cache result of transaction 1: 1 is 1, the 1 on the left of the equal sign represents key, the 1 on the right of the equal sign represents value, and the transaction write cache result of transaction 2: 2-2 and transaction write cache result 3-3 of transaction 3, and the transaction read cache result corresponding to the current transaction 3 to be processed: 3 is 0,4 is 4, so it can be seen that there is a target history key which is the same as the history key in the block cache in the transaction read cache result of transaction 4, i.e. key is 3, so whether the value corresponding to key is 3 is the same or not, it can be determined that the current transaction to be processed conflicts with the previous processed transaction, and it is necessary to wait for the completion of the transactions corresponding to all the previous processed transactions before starting.
In a specific embodiment, a contract data processing method is provided, which specifically includes the following steps:
1. a transaction request is received, the transaction request including at least one pending transaction.
2. And acquiring the intelligent contract method corresponding to each transaction to be processed according to the transaction request.
3. And creating a block cache corresponding to the target block, and creating an initial transaction cache corresponding to each transaction to be processed.
And 3-1, acquiring a target block, and establishing a corresponding block read cache and a corresponding block write cache for the target block based on contract cache.
And 3-2, establishing corresponding initial transaction read cache and initial transaction write cache for each transaction to be processed based on the block read cache and the block write cache.
4. And executing corresponding intelligent contract methods in each initial transaction cache in parallel to obtain updated transaction caches corresponding to the transactions to be processed.
4-1, executing the corresponding intelligent contract method in parallel in the initial transaction read cache corresponding to each transaction to be processed to obtain the updated transaction read cache corresponding to each transaction to be processed.
And 4-2, executing the corresponding intelligent contract method in parallel in the initial transaction write cache corresponding to each transaction to be processed to obtain the updated transaction write cache corresponding to each transaction to be processed.
5. And merging the updated transaction caches into the block cache in sequence according to the transaction sequence.
And 5-1, acquiring a transaction sequence corresponding to each transaction to be processed.
And 5-2, sequentially merging the updated transaction write cache corresponding to each transaction to be processed into the block write cache according to the transaction sequence.
6. And when the current transaction cache to be merged and updated has no resource conflict with the historical merged transaction cache data in the block cache, merging the current transaction cache to be merged and updated into the block cache.
7. And when resource conflict exists between the current transaction cache to be merged and updated and historical merged transaction cache data in the block cache, re-creating a corresponding intermediate transaction cache based on the block cache, executing an intelligent contract method corresponding to the current transaction cache to be merged and updated in the intermediate transaction cache, and merging the transaction cache corresponding to an execution result into the block cache.
7-1, wherein the current to-be-merged update transaction cache is a current update transaction write cache or a current update transaction read cache, the initial transaction cache comprises an initial transaction read cache and an initial transaction write cache, the current update transaction write cache is obtained by executing a corresponding intelligent contract method in the current initial transaction write cache by the current to-be-processed transaction, the current update transaction read cache is obtained by executing a corresponding intelligent contract method in the current initial transaction read cache by the current to-be-processed transaction, and the block cache comprises a block read cache and a block write cache,
when the transaction cache to be merged is the current update transaction write cache, historical merged transaction cache data in the block write cache is obtained, the historical merged transaction cache data is the update transaction write cache corresponding to the processed transaction, and the update transaction cache corresponding to the transaction to be processed is merged into the block cache and then updated into the processed transaction.
And when the intersection exists between the current updated transaction write cache and at least one history merged transaction cache data, determining that resource conflict exists between the current to-be-merged updated transaction cache and the history merged transaction cache data in the block cache.
And 7-1-1, acquiring a current transaction write key value pair corresponding to the current updated transaction write cache, wherein the current transaction write key value pair comprises a current key and a corresponding current value.
And 7-1-2, acquiring historical transaction write key value pairs corresponding to historical merged transaction cache data, wherein the historical transaction write key value pairs comprise historical keys and corresponding historical values.
7-1-3, when at least one target history key which is the same as the current key exists in each history key, determining that the intersection exists between the current updated transaction write cache and at least one history merged transaction cache data.
And 7-2, acquiring a current updating transaction read cache corresponding to the current transaction to be processed, taking the current updating transaction read cache as a transaction cache to be merged and updated, and determining that resource conflict exists between the current updating transaction read cache and historical merged transaction cache data in the block cache when intersection exists between the current updating transaction read cache and at least one historical merged transaction cache data.
And 7-2-1, acquiring a current transaction key reading value pair corresponding to the current updated transaction read cache, wherein the current transaction key reading value pair comprises a current key and a corresponding current value.
And 7-2-2, acquiring historical transaction write key value pairs corresponding to the historical merged transaction cache data, wherein the historical transaction write key value pairs comprise historical keys and corresponding historical values.
7-2-3, when at least one target history key which is the same as the current key exists in each history key, determining that the intersection exists between the current updated transaction read cache and at least one history merged transaction cache data.
8. Until the updated transaction caches corresponding to the transactions to be processed are merged into the block cache to obtain the target block cache.
9. And generating an updating block according to the target block cache.
In one embodiment, as shown in FIG. 10, FIG. 10 illustrates a schematic diagram of a contract data processing method in one embodiment. The method specifically comprises the following steps:
step 1001, the contract virtual machine acquires a target block.
Step 1002, create a corresponding block cache for the target block based on the contract cache.
Step 1003, establishing a corresponding initial transaction cache for each transaction to be processed based on the block cache.
And 1004, executing corresponding intelligent contract methods in parallel in the thread pool based on the respective initial transaction caches to obtain corresponding updated transaction caches.
Step 1005, merging the first updated transaction cache into the block cache according to the transaction sequence corresponding to each transaction to be processed, if a resource conflict is found in the merging process (the modified data in the merged transaction is modified, and the old data is read), re-executing the contract based on the merged block cache (new data), and then merging.
And step 1006, merging the updated transaction caches corresponding to the successfully executed intelligent contract methods into the block cache according to the transaction sequence. Wherein the conflict handling in the merging process is consistent with the previous step 5.
Step 1007, finally, a new block is formed according to the merged block cache.
It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in the above-described flowcharts may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or the stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in FIG. 11, there is provided a contract data processing apparatus 1100, including:
a transaction request receiving module 1102 configured to receive a transaction request, where the transaction request includes at least one pending transaction.
And the intelligent contract method acquisition module 1104 is used for acquiring the intelligent contract methods corresponding to the to-be-processed transactions according to the transaction requests.
A cache space creating module 1106, configured to create a block cache corresponding to the target block, and create an initial transaction cache corresponding to each to-be-processed transaction.
The initial transaction cache updating module 1108 is configured to execute a corresponding intelligent contract method in parallel in each initial transaction cache to obtain an updated transaction cache corresponding to each to-be-processed transaction.
The update transaction cache merging module 1110 is configured to sequentially merge the update transaction caches into the block cache according to the transaction sequence.
A resource conflict detecting module 1112, configured to merge the current to-be-merged update transaction cache into the block cache when there is no resource conflict between the current to-be-merged update transaction cache and the historical merged transaction cache data in the block cache.
The resource conflict detection module 1112 is further configured to, when a resource conflict exists between the current to-be-merged transaction cache and the historical merged transaction cache data in the block cache, re-create a corresponding intermediate transaction cache based on the block cache, execute the intelligent contract method corresponding to the current to-be-merged transaction cache in the intermediate transaction cache, and merge the transaction cache corresponding to the execution result into the block cache.
The resource conflict detection module 1112 is further configured to obtain the target block cache until the updated transaction caches corresponding to the to-be-processed transactions are merged into the block cache.
And a target block cache merging module 1114, configured to generate an update block according to the target block cache.
In one embodiment, as shown in FIG. 12, the cache space creation module 1106 includes:
the block sub-cache creating unit 1106a is configured to obtain a target block, and create a corresponding block read cache and a corresponding block write cache for the target block based on the contract cache.
The transaction sub-cache creating unit 1106b is configured to create a corresponding initial transaction read cache and an initial transaction write cache for each to-be-processed transaction based on the block read cache and the block write cache.
In one embodiment, as shown in FIG. 13, the initial transaction cache update module 1108 includes:
the initial transaction read cache execution unit 1108a is configured to execute the corresponding intelligent contract method in parallel in the initial transaction read cache corresponding to each to-be-processed transaction, so as to obtain an updated transaction read cache corresponding to each to-be-processed transaction.
The initial transaction write cache execution unit 1108b is configured to execute the corresponding intelligent contract method in parallel in the initial transaction write cache corresponding to each to-be-processed transaction, so as to obtain an updated transaction write cache corresponding to each to-be-processed transaction.
In one embodiment, as shown in FIG. 14, the update transaction cache merge module 1110 includes:
the transaction sequence determining unit 1110a is configured to obtain a transaction sequence corresponding to each transaction to be processed.
The update transaction write cache merging unit 1110b is configured to sequentially merge the update transaction write caches corresponding to the to-be-processed transactions into the block write cache according to the transaction sequence.
In one embodiment, the current to-be-merged updated transaction cache is a current updated transaction write cache or a current updated transaction read cache, the initial transaction cache includes an initial transaction read cache and an initial transaction write cache, the current updated transaction write cache is obtained by executing a corresponding intelligent contract method on the current to-be-processed transaction in the current initial transaction write cache, the current updated transaction read cache is obtained by executing a corresponding intelligent contract method on the current to-be-processed transaction in the current initial transaction read cache, the block cache includes a block read cache and a block write cache, the contract data processing apparatus 1100 is further configured to obtain historical merged transaction cache data in the block write cache when the to-be-merged updated transaction cache is the current updated transaction write cache, the historical merged transaction cache data is an updated transaction write cache corresponding to a processed transaction, and the updated transaction cache corresponding to the processed transaction is merged into the block cache and then updated into the processed transaction, and when the intersection exists between the current updated transaction write cache and at least one history merged transaction cache data, determining that resource conflict exists between the current to-be-merged updated transaction cache and the history merged transaction cache data in the block cache.
In one embodiment, the contract data processing apparatus 1100 is further configured to obtain a current transaction write key-value pair corresponding to the current updated transaction write cache, the current transaction write key-value pair including a current key and a corresponding current value, obtain a historical transaction write key-value pair corresponding to the historical merged transaction cache data, the historical transaction write key-value pair including a historical key and a corresponding historical value, and determine that the current updated transaction write cache intersects with at least one historical merged transaction cache data when at least one target historical key identical to the current key exists in each historical key.
In one embodiment, the contract data processing apparatus 1100 is further configured to obtain a current updated transaction read cache corresponding to a current pending transaction, use the current updated transaction read cache as a pending merged updated transaction cache, and determine that a resource conflict exists between the current pending merged updated transaction cache and historical merged transaction cache data in the block cache when an intersection exists between the current updated transaction read cache and at least one historical merged transaction cache data.
In one embodiment, the contract data processing apparatus 1100 is further configured to obtain a current transaction read key value pair corresponding to the current updated transaction read cache, where the current transaction read key value pair includes a current key and a corresponding current value, obtain a historical transaction write key value pair corresponding to the historical merged transaction cache data, where the historical transaction write key value pair includes a historical key and a corresponding historical value, and determine that the current updated transaction read cache intersects with at least one historical merged transaction cache data when at least one target historical key identical to the current key exists in each historical key.
FIG. 15 is a diagram showing an internal structure of a computer device in one embodiment. The computer device may specifically be the server 120 in fig. 1. As shown in fig. 15, the computer apparatus includes a processor, a memory, a network interface, and an input device connected via a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may further store a computer program that, when executed by the processor, causes the processor to implement a contract data processing method. The internal memory may also have stored therein a computer program that, when executed by the processor, causes the processor to perform the contract data processing method. The input device of the computer equipment can be a touch layer covered on a display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 15 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the contract data processing apparatus provided herein may be implemented in the form of a computer program that is executable on a computer device such as that shown in fig. 15. The memory of the computer device may store various program modules constituting the contract data processing apparatus, such as a transaction request receiving module, an intelligent contract method obtaining module, a cache space creating module, an initial transaction cache updating module, an updated transaction cache merging module, a resource conflict detection module, and a target block cache merging module shown in fig. 11. The respective program modules constitute computer programs that cause processors to execute the steps in the contract data processing method of the embodiments of the present application described in the present specification.
For example, the computer device shown in FIG. 15 may perform receiving a transaction request including at least one pending transaction via a transaction request receiving module in a contract data processing apparatus as shown in FIG. 11. The computer equipment can execute the intelligent contract method corresponding to each transaction to be processed according to the transaction request through the intelligent contract method acquisition module. The computer equipment can execute the block cache corresponding to the created target block through the cache space creating module, and create initial transaction caches corresponding to the various to-be-processed transactions. The computer equipment can execute the corresponding intelligent contract method in each initial transaction cache in parallel through the initial transaction cache updating module to obtain the updated transaction cache corresponding to each transaction to be processed. The computer equipment can execute the sequential merging of the updated transaction caches to the block cache according to the transaction sequence through the updated transaction cache merging module. The computer equipment can execute the resource conflict detection module to merge the current transaction cache to be merged and updated into the block cache when the resource conflict does not exist between the current transaction cache to be merged and updated and the historical merged transaction cache data in the block cache. The computer equipment can execute resource conflict between the current transaction cache to be merged and updated and historical merged transaction cache data in the block cache through the resource conflict detection module, then re-create a corresponding intermediate transaction cache based on the block cache, execute an intelligent contract method corresponding to the current transaction cache to be merged and updated in the intermediate transaction cache, and merge the transaction cache corresponding to an execution result into the block cache. The computer equipment can execute the processing through the resource conflict detection module until the updated transaction caches corresponding to the transactions to be processed are merged into the block cache to obtain the target block cache. The computer device may execute generating an update block from the target block cache via the target block cache merge module.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the contract data processing method described above. Here, the steps of the contract data processing method may be steps in the contract data processing method of each of the above embodiments.
In one embodiment, a computer-readable storage medium is provided, in which a computer program is stored, which, when executed by a processor, causes the processor to carry out the steps of the above-mentioned contract data processing method. Here, the steps of the contract data processing method may be steps in the contract data processing method of each of the above embodiments.
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 non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (15)

1. A contract data processing method, comprising:
receiving a transaction request, the transaction request including at least one pending transaction;
acquiring an intelligent contract method corresponding to each transaction to be processed according to the transaction request;
creating a block cache corresponding to a target block, and creating an initial transaction cache corresponding to each transaction to be processed based on the block cache; the block cache is used for caching transaction results corresponding to all transactions to be processed, and the initial transaction cache corresponding to each transaction to be processed is used for caching transaction results generated by executing a corresponding intelligent contract method;
executing corresponding intelligent contract methods in parallel in each initial transaction cache to obtain transaction results corresponding to each transaction to be processed, and updating the initial transaction cache corresponding to each transaction to be processed according to the transaction results corresponding to each transaction to be processed to obtain updated transaction caches corresponding to each transaction to be processed;
merging the updated transaction caches to the block cache in sequence according to the transaction sequence;
when the current transaction cache to be merged and updated has no resource conflict with the historical merged transaction cache data in the block cache, merging the current transaction cache to be merged and updated into the block cache;
when resource conflict exists between the current transaction cache to be merged and updated and historical merged transaction cache data in the block cache, re-creating a corresponding intermediate transaction cache based on the block cache, executing an intelligent contract method corresponding to the current transaction cache to be merged and updated in the intermediate transaction cache, and merging the transaction cache corresponding to an execution result into the block cache; when the intersection exists between the current transaction cache to be merged and updated and the historical merged transaction cache data in the block cache, judging that resource conflict exists between the current transaction cache to be merged and updated and the historical merged transaction cache data in the block cache;
until the updated transaction caches corresponding to the transactions to be processed are merged into the block cache to obtain a target block cache;
and generating an updating block according to the target block cache.
2. The method of claim 1, wherein creating a block cache corresponding to the target block, creating an initial transaction cache corresponding to each of the pending transactions, comprises:
acquiring a target block, and establishing a corresponding block read cache and a corresponding block write cache for the target block based on contract cache;
and establishing a corresponding initial transaction read cache and an initial transaction write cache for each transaction to be processed based on the block read cache and the block write cache.
3. The method of claim 2, wherein executing the corresponding intelligent contract method in parallel in each of the initial transaction caches to obtain an updated transaction cache corresponding to each of the pending transactions comprises:
executing corresponding intelligent contract methods in parallel in the initial transaction read cache corresponding to each transaction to be processed to obtain updated transaction read caches corresponding to each transaction to be processed;
and executing corresponding intelligent contract methods in parallel in the initial transaction write cache corresponding to each transaction to be processed to obtain the updated transaction write cache corresponding to each transaction to be processed.
4. The method of claim 3, wherein said sequentially merging each of said updated transaction caches into said block cache in transaction order comprises:
acquiring a transaction sequence corresponding to each transaction to be processed;
and sequentially merging the updated transaction write cache corresponding to each transaction to be processed into the block write cache according to the transaction sequence.
5. The method according to claim 1, wherein the current pending merged update transaction cache is a current update transaction write cache or a current update transaction read cache, the initial transaction cache includes an initial transaction read cache and an initial transaction write cache, the current update transaction write cache is obtained by executing a corresponding smart contract method in the current initial transaction write cache for the current pending transaction, the current update transaction read cache is obtained by executing a corresponding smart contract method in the current initial transaction read cache for the current pending transaction, and the block cache includes a block read cache and a block write cache;
when resource conflict exists between the current transaction cache to be merged and updated and historical merged transaction cache data in the block cache, the method comprises the following steps:
when the to-be-merged updated transaction cache is the current updated transaction write cache, obtaining historical merged transaction cache data in the block write cache, wherein the historical merged transaction cache data is an updated transaction write cache corresponding to a processed transaction, and the updated transaction cache corresponding to the to-be-processed transaction is merged into the block cache and then updated into the processed transaction;
and when the intersection exists between the current updating transaction write cache and at least one history merged transaction cache data, determining that resource conflict exists between the current transaction write cache to be merged and updated and the history merged transaction cache data in the block cache.
6. The method of claim 5, wherein when the current updated transaction write cache intersects at least one of the historical merged transaction cache data, comprising:
acquiring a current transaction write key value pair corresponding to the current updated transaction write cache, wherein the current transaction write key value pair comprises a current key and a corresponding current value;
acquiring historical transaction write key value pairs corresponding to the historical merged transaction cache data, wherein the historical transaction write key value pairs comprise historical keys and corresponding historical values;
and when at least one target history key which is the same as the current key exists in each history key, determining that the intersection exists between the current updated transaction write cache and at least one history merged transaction cache data.
7. The method of claim 5, further comprising:
acquiring a current update transaction read cache corresponding to the current transaction to be processed, and taking the current update transaction read cache as the update transaction cache to be merged;
and when the intersection exists between the current updating transaction read cache and at least one history merged transaction cache data, determining that resource conflict exists between the current transaction cache to be merged and updated and the history merged transaction cache data in the block cache.
8. The method of claim 7, wherein when the current updated transactional read cache intersects at least one of the historical merged transactional cache data, comprising:
acquiring a current transaction key reading value pair corresponding to the current updated transaction read cache, wherein the current transaction key reading value pair comprises a current key and a corresponding current value;
acquiring historical transaction write key value pairs corresponding to the historical merged transaction cache data, wherein the historical transaction write key value pairs comprise historical keys and corresponding historical values;
and when at least one target history key which is the same as the current key exists in each history key, determining that the intersection exists between the current updated transaction read cache and at least one history merged transaction cache data.
9. A contract data processing apparatus, characterized in that the apparatus comprises:
a transaction request receiving module for receiving a transaction request, the transaction request including at least one transaction to be processed;
the intelligent contract method acquisition module is used for acquiring the intelligent contract methods corresponding to the transactions to be processed according to the transaction requests;
the cache space creating module is used for creating a block cache corresponding to a target block and creating initial transaction caches corresponding to the to-be-processed transactions based on the block cache; the block cache is used for caching transaction results corresponding to all transactions to be processed, and the initial transaction cache corresponding to each transaction to be processed is used for caching transaction results generated by executing a corresponding intelligent contract method;
the initial transaction cache updating module is used for executing the corresponding intelligent contract method in parallel in each initial transaction cache to obtain a transaction result corresponding to each transaction to be processed, and updating the initial transaction cache corresponding to each transaction to be processed according to the transaction result corresponding to each transaction to be processed to obtain an updated transaction cache corresponding to each transaction to be processed;
the update transaction cache merging module is used for sequentially merging each update transaction cache to the block cache according to a transaction sequence;
a resource conflict detection module, configured to merge the current to-be-merged updated transaction cache into the block cache when there is no resource conflict between the current to-be-merged updated transaction cache and the historical merged transaction cache data in the block cache;
the resource conflict detection module is further used for recreating a corresponding intermediate transaction cache based on the block cache when a resource conflict exists between the current transaction cache to be merged and updated and historical merged transaction cache data in the block cache, executing an intelligent contract method corresponding to the current transaction cache to be merged and updated in the intermediate transaction cache, and merging the transaction cache corresponding to an execution result into the block cache; when the intersection exists between the current transaction cache to be merged and updated and the historical merged transaction cache data in the block cache, judging that resource conflict exists between the current transaction cache to be merged and updated and the historical merged transaction cache data in the block cache;
the resource conflict detection module is also used for obtaining a target block cache until the updated transaction caches corresponding to the transactions to be processed are merged into the block cache;
and the target block cache merging module is used for generating an updating block according to the target block cache.
10. The apparatus of claim 9, wherein the cache space creation module comprises:
the block sub-cache creating unit is used for acquiring a target block and creating a corresponding block read cache and a corresponding block write cache for the target block based on contract cache;
and the transaction sub-cache creating unit is used for creating corresponding initial transaction read cache and initial transaction write cache for each transaction to be processed based on the block read cache and the block write cache.
11. The apparatus of claim 10, wherein the initial transaction cache update module comprises:
the initial transaction read cache execution unit is used for executing the corresponding intelligent contract method in parallel in the initial transaction read cache corresponding to each transaction to be processed to obtain the updated transaction read cache corresponding to each transaction to be processed;
and the initial transaction write cache execution unit is used for executing the corresponding intelligent contract method in parallel in the initial transaction write cache corresponding to each transaction to be processed to obtain the updated transaction write cache corresponding to each transaction to be processed.
12. The apparatus of claim 11, wherein the update transaction cache merge module comprises:
the transaction sequence determining unit is used for acquiring the transaction sequence corresponding to each transaction to be processed;
and the updating transaction write cache merging unit is used for sequentially merging the updating transaction write caches corresponding to the to-be-processed transactions into the block write cache according to the transaction sequence.
13. The apparatus according to claim 9, wherein the current pending merged update transaction cache is a current update transaction write cache or a current update transaction read cache, the initial transaction cache includes an initial transaction read cache and an initial transaction write cache, the current update transaction write cache is obtained by the current pending transaction executing a corresponding smart contract method in the current initial transaction write cache, the current update transaction read cache is obtained by the current pending transaction executing a corresponding smart contract method in the current initial transaction read cache, and the block cache includes a block read cache and a block write cache;
the apparatus is further configured to:
when the to-be-merged updated transaction cache is the current updated transaction write cache, obtaining historical merged transaction cache data in the block write cache, wherein the historical merged transaction cache data is an updated transaction write cache corresponding to a processed transaction, and the updated transaction cache corresponding to the to-be-processed transaction is merged into the block cache and then updated into the processed transaction;
and when the intersection exists between the current updating transaction write cache and at least one history merged transaction cache data, determining that resource conflict exists between the current transaction write cache to be merged and updated and the history merged transaction cache data in the block cache.
14. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 8.
15. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 8.
CN201910735459.9A 2019-08-09 2019-08-09 Contract data processing method and device, computer readable storage medium and computer equipment Active CN110457353B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910735459.9A CN110457353B (en) 2019-08-09 2019-08-09 Contract data processing method and device, computer readable storage medium and computer equipment
CN201910853888.6A CN110569264B (en) 2019-08-09 2019-08-09 Contract data processing method and device, computer readable storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910735459.9A CN110457353B (en) 2019-08-09 2019-08-09 Contract data processing method and device, computer readable storage medium and computer equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN201910853888.6A Division CN110569264B (en) 2019-08-09 2019-08-09 Contract data processing method and device, computer readable storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN110457353A CN110457353A (en) 2019-11-15
CN110457353B true CN110457353B (en) 2021-03-16

Family

ID=68485724

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201910853888.6A Active CN110569264B (en) 2019-08-09 2019-08-09 Contract data processing method and device, computer readable storage medium and computer equipment
CN201910735459.9A Active CN110457353B (en) 2019-08-09 2019-08-09 Contract data processing method and device, computer readable storage medium and computer equipment

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201910853888.6A Active CN110569264B (en) 2019-08-09 2019-08-09 Contract data processing method and device, computer readable storage medium and computer equipment

Country Status (1)

Country Link
CN (2) CN110569264B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111383031B (en) * 2020-05-29 2020-09-22 支付宝(杭州)信息技术有限公司 Intelligent contract execution method and system in block chain and electronic equipment
CN112380149B (en) * 2021-01-18 2021-04-06 腾讯科技(深圳)有限公司 Data processing method, device, equipment and medium based on node memory
CN112395300B (en) * 2021-01-20 2021-05-25 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on block chain and readable storage medium
CN112559637B (en) * 2021-02-19 2021-06-18 腾讯科技(深圳)有限公司 Data processing method, device, equipment and medium based on distributed storage

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6711654B2 (en) * 2001-06-28 2004-03-23 Intel Corporation Mechanism for bank conflict resolution for an out-of-order cache
US10083126B2 (en) * 2016-12-06 2018-09-25 Arm Limited Apparatus and method for avoiding conflicting entries in a storage structure
US10452776B2 (en) * 2017-07-28 2019-10-22 International Business Machines Corporation Cognitive mediator for generating blockchain smart contracts
CN109284625A (en) * 2018-09-03 2019-01-29 佛山科学技术学院 A kind of Data Access Security method and device based on block chain
CN109377362B (en) * 2018-09-19 2022-05-13 联动优势科技有限公司 Transaction data processing method and device
CN109508337A (en) * 2018-11-12 2019-03-22 杭州秘猿科技有限公司 A kind of transaction is parallel to execute method, apparatus, electronic equipment and system
CN109784930B (en) * 2019-02-18 2023-07-18 深圳市迅雷网络技术有限公司 Block chain transaction data processing method and device, electronic equipment and medium

Also Published As

Publication number Publication date
CN110569264B (en) 2021-04-09
CN110569264A (en) 2019-12-13
CN110457353A (en) 2019-11-15

Similar Documents

Publication Publication Date Title
CN110457353B (en) Contract data processing method and device, computer readable storage medium and computer equipment
CN110443712B (en) Contract conflict detection method and device, readable storage medium and computer equipment
US11537659B2 (en) Method for reading and writing data and distributed storage system
CN111241061B (en) Writing method of state database, data processing device and storage medium
WO2021036253A1 (en) Method and device for executing transactions in parallel in blockchain
CN111274252B (en) Block chain data uplink method and device, storage medium and server
CN112579602B (en) Multi-version data storage method, device, computer equipment and storage medium
CN107665219B (en) Log management method and device
US20200026427A1 (en) System and method for handling data storage on storage devices
CN112559529B (en) Data storage method, device, computer equipment and storage medium
CN113505024B (en) Data processing method and device of alliance chain, electronic equipment and storage medium
CN111125040A (en) Method, apparatus and storage medium for managing redo log
EP4038497A1 (en) Customized root processes for groups of applications
CN113743950A (en) Method for performing transactions in a blockchain, blockchain node and blockchain
CN110795171A (en) Service data processing method and device, computer equipment and storage medium
CN113094296A (en) SSD read acceleration implementation method and device, computer equipment and storage medium
CN110689344B (en) Method and apparatus for concurrently executing transactions in a blockchain
CN111083221B (en) Transaction verification method and device
CN112783866A (en) Data reading method and device, computer equipment and storage medium
CN113934362A (en) Data storage method and device, computer equipment and storage medium
CN111737260A (en) Method and system for checking data copying consistency
CN116821250B (en) Distributed graph data processing method and system
CN114756239A (en) Code deployment method and device, computer equipment and storage medium
CN111680004A (en) Method and device for checking migration accuracy of unstructured image file
CN115470196A (en) Data reading and writing method and device and electronic equipment

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40015763

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant