CN113590611B - Block execution method, computer device, and storage medium - Google Patents
Block execution method, computer device, and storage medium Download PDFInfo
- Publication number
- CN113590611B CN113590611B CN202110731136.XA CN202110731136A CN113590611B CN 113590611 B CN113590611 B CN 113590611B CN 202110731136 A CN202110731136 A CN 202110731136A CN 113590611 B CN113590611 B CN 113590611B
- Authority
- CN
- China
- Prior art keywords
- transaction
- chain
- transactions
- intelligent contract
- notification information
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 238000012216 screening Methods 0.000 claims abstract description 6
- 238000004590 computer program Methods 0.000 claims description 8
- 238000011161 development Methods 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database cache management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2471—Distributed queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Finance (AREA)
- Accounting & Taxation (AREA)
- Computational Linguistics (AREA)
- Probability & Statistics with Applications (AREA)
- Mathematical Physics (AREA)
- Fuzzy Systems (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides a block execution method, a computer device and a storage medium, wherein the method comprises the following steps: the block chain link point receives a first transaction, and when the first transaction is judged to be a first type transaction, first notification information is sent to a first out-of-chain intelligent contract; counting a first index set acquired by the first out-of-chain intelligent contract for executing the first transaction, and sending the first index set to the blockchain node; the blockchain node searches and caches a first data set according to the first index set; the blockchain node sequentially screens out second transactions which are first-class transactions from a first block to be executed, and sends second notification information to a plurality of second intelligent contracts corresponding to the second transactions; screening out executable second transactions by the second out-of-chain intelligent contracts, and executing the second transactions according to second data sets corresponding to the second transactions to obtain a first execution result set; the block chain node executes the first blocks according to each first execution result set. The application facilitates the development of the blockchain.
Description
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a block execution method, a computer device, and a storage medium.
Background
The intelligent contract language only supports part of languages, such as Solidity, WASM, and has the problems of learning thresholds and great entrance difficulty; if a blockchain developer wants to add a new intelligent contract language on the chain, the blockchain developer needs to develop corresponding interpretation execution, such as JVM, etc., which is difficult and high in cost.
Disclosure of Invention
In view of the above-mentioned drawbacks or shortcomings of the prior art, it would be advantageous to develop a block execution method, apparatus and storage medium for a blockchain.
In a first aspect, the present application provides a block execution method applicable to a blockchain node, each device running the blockchain node is configured with a plurality of identical off-chain intelligent contracts outside a blockchain program, the off-chain intelligent contracts are about intelligent contracts written in an off-chain language, and the method includes:
the block link point receives a first transaction, and when the first transaction is judged to be a first type of transaction which can be executed only by calling the intelligent contract outside the chain, the block link point sends first notification information to the intelligent contract outside the chain for executing the first transaction;
after the first out-of-chain intelligent contract receives the first notification information, counting a first index set required to be acquired for executing the first transaction, and sending the first index set to the blockchain node;
the blockchain node searches a first data set according to the first index set and caches the first data set;
the blockchain node sequentially screens out second transactions which are first-class transactions from a first block to be executed, and sends second notification information to a plurality of second intelligent contracts corresponding to the second transactions; wherein the second notification information includes second data sets respectively corresponding to the second transactions;
after the second out-of-chain intelligent contract receives the second notification information, screening out second transactions executable by the current out-of-chain intelligent contract, and executing the screened second transactions according to the second data set corresponding to the screened second transactions to obtain a first execution result set;
the block chain node executes the first blocks according to each first execution result set.
In a second aspect, the present application also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform the block execution method provided according to the embodiments of the present application.
In a third aspect, the present application also provides a storage medium storing a computer program for causing a computer to execute the block execution method provided according to the embodiments of the present application.
According to the block execution method, the computer equipment and the storage medium provided by the embodiments of the application, a first transaction is received through a block link point, and when the first transaction is judged to be a first type of transaction which can be executed only by calling the intelligent contract outside the chain, first notification information is sent to the intelligent contract outside the chain for executing the first transaction; after the first out-of-chain intelligent contract receives the first notification information, counting a first index set required to be acquired for executing the first transaction, and sending the first index set to the blockchain node; the blockchain node searches a first data set according to the first index set and caches the first data set; the blockchain node sequentially screens out second transactions which are first-class transactions from a first block to be executed, and sends second notification information to a plurality of second intelligent contracts corresponding to the second transactions; wherein the second notification information includes second data sets respectively corresponding to the second transactions; after the second out-of-chain intelligent contract receives the second notification information, screening out second transactions executable by the current out-of-chain intelligent contract, and executing the screened second transactions according to the second data set corresponding to the screened second transactions to obtain a first execution result set; the block chain node executes the method of the first block according to each first execution result set, so that the block chain development is more convenient.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a block execution method according to an embodiment of the present application.
Fig. 2 is a schematic structural diagram of an apparatus according to an embodiment of the present application.
Detailed Description
The application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be noted that, for convenience of description, only the portions related to the application are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
Fig. 1 is a flowchart of a block execution method according to an embodiment of the present application. As shown in fig. 1, in this embodiment, the present application provides a block execution method applicable to a blockchain node, each device running the blockchain node is configured with a plurality of identical off-chain smart contracts outside a blockchain program, and the off-chain smart contracts are about smart contracts written in an off-chain language, and the method includes:
s11: the block link point receives a first transaction, and when the first transaction is judged to be a first type of transaction which can be executed only by calling the intelligent contract outside the chain, the block link point sends first notification information to the intelligent contract outside the chain for executing the first transaction;
s12: after the first out-of-chain intelligent contract receives the first notification information, counting a first index set required to be acquired for executing the first transaction, and sending the first index set to the blockchain node;
s13: the blockchain node searches a first data set according to the first index set and caches the first data set;
s14: the blockchain node sequentially screens out second transactions which are first-class transactions from a first block to be executed, and sends second notification information to a plurality of second intelligent contracts corresponding to the second transactions; wherein the second notification information includes second data sets respectively corresponding to the second transactions;
s15: after the second out-of-chain intelligent contract receives the second notification information, screening out second transactions executable by the current out-of-chain intelligent contract, and executing the screened second transactions according to the second data set corresponding to the screened second transactions to obtain a first execution result set;
s16: the block chain node executes the first blocks according to each first execution result set.
Specifically, when the first transaction is judged to be the first type of transaction which can be executed only by calling the off-chain intelligent contract, sending the first notification information to the first off-chain intelligent contract for executing the first transaction includes judging whether the first transaction is the first type of transaction which can be executed only by calling the off-chain intelligent contract according to whether the first contract called by the first transaction is deployed on the blockchain; when the first transaction is judged to be a first type transaction, first notification information is sent to a first out-of-chain intelligent contract for executing the first transaction; counting a first index set required to be acquired for executing the first transaction, and sending the first index set to the block chain link point, wherein the counting of the first key set required to be acquired for executing the first transaction and the sending of the first key set to the block chain node are included, the block chain node searches for a first data set according to the first index set and caches the first data set, the block chain node searches for a first value set according to the first key set and caches the first value set, the second notification information includes executing second value sets respectively corresponding to each second transaction, executing each second transaction screened according to the second data set corresponding to each second transaction screened to obtain a first execution result set includes executing each second transaction screened according to the second value set corresponding to each second transaction screened to obtain a first execution result set; and, the first notification information includes first transactions, and the second notification information includes second transactions, for example;
assuming that the equipment for running the block chain nodes is N1-N10, and respectively running the block chain nodes N1-N10 on the equipment; n1 to n10 are deployed with intelligent contracts C1_L1 to C10_L1 written in a language L1; in addition to the blockchain program, N1 to N10 are respectively configured with C1_L2 to C10_L2 written in a language L2, C1_L3 to C10_L3 written in a language L3 and C1_L4 to C10_L4 written in a language L4; n 1-n 10 respectively receive tx1 and tx2 in sequence, the intelligent contract required to execute tx1 is C1_L1, and the intelligent contract required to execute tx2 is C10_L4; the block to be executed is a block (100), the block (100) comprises tx11 to tx20, the intelligent contract required to execute tx11 to tx15 is C1_L1, the intelligent contract required to execute tx16 to tx18 is C10_L4, and the intelligent contract required to execute tx19 to tx20 is C10_L3;
for tx1:
the block chain module receives tx1, and the intelligent contract required to be called for executing tx1 is C1_L1, C1_L1 is the intelligent contract deployed by n 1-n 10, so that the operation is performed according to the prior art;
for tx2:
the blockchain node executes step S11 to receive tx2, and sends tx2 to c10_l4 because the intelligent contract required to invoke to execute tx2 is c10_l4 and c10_l4 is the extra-chain intelligent contract outside the blockchain program;
after receiving tx2, c10_l4 performs step S12, counts the index set (assumed to be { key2, key2 '}) required to be acquired for executing tx2, and sends { key2, key2' } to the blockchain node;
the blockchain node executes step S13, searches the data set { value2, value2' } according to { key2, key2' }, and caches { value2, value2' };
the blockchain node executes step S14 to sequentially screen each transaction (i.e., tx16 to tx 20) which is a first type of transaction from the block (100), and send tx16 to tx20 to the c10_l4 and c10_l3, and execute the data sets (assumed to be { value16, value16' }, { value17, value17' }, … … { value20, value20' }) respectively corresponding to the tx16 to tx 20;
for c10_l4:
step S15 is executed by C10_L4, after receiving tx16 to tx20 and executing data sets corresponding to the tx16 to tx20 respectively, the tx16 to tx18 executable by the current out-of-chain intelligent contract and { value16, value16'}, { value17, value17' }, { value18, value18'}, executing the tx16 according to { value16, value16' }, executing the tx17 according to { value17, value17'}, executing the tx18 according to { value18, value18' }, so as to obtain an execution result set of executing the tx16 to tx 18;
for c10_l3:
step S15 is executed by C10_L3, after receiving tx16 to tx20 and executing data sets corresponding to tx16 to tx20 respectively, tx19 to tx20 executable by the current out-of-chain intelligent contract and { value19, value19'}, { value20, value20' }, executing tx19 according to { value19, value19'}, executing tx20 according to { value20, value20' }, so as to obtain an execution result set of executing tx19 to tx 20;
the blockchain node executes step S16 to execute the block (100) according to the execution result set of tx16 to tx18 and the execution result set of tx19 to tx 20. Those skilled in the art will understand that the method for obtaining the execution result set of tx11 to tx15 is the same as the prior art, and will not be described herein.
In more embodiments, the step of sending the first transaction to the intelligent contract adapter module when the first transaction is determined to be the first type of transaction that needs to be executed by calling the off-link intelligent contract may be further configured according to actual requirements, for example, configured to determine, according to the off-link intelligent contract identifier of the first transaction, whether the first transaction is the first type of transaction that needs to be executed by calling the off-link intelligent contract; when the first transaction is judged to be the first type transaction, the first transaction is sent to the intelligent contract adapter module ", and the same technical effect can be achieved.
In the above embodiment, the selected database is a kv database, so the index set is a key set, the data set is a value set (i.e., value set), and in more embodiments, the database selected for the blockchain data storage is configured according to actual requirements, so that the same technical effects can be achieved.
In further embodiments, the first notification information includes a first transaction hash of the first transaction and the second notification information includes a second transaction hash of each of the second transactions; the first transaction can be pulled from the blockchain node according to the first transaction hash after the first out-of-chain intelligent contract receives the first transaction hash, and each second transaction can be pulled from the blockchain node according to the second transaction hash after the second out-of-chain intelligent contract receives the second notification information, so that the same technical effect can be achieved.
In more embodiments, the second notification information may also be configured as a second transaction corresponding to the second off-link smart contract or a second hash value of the second transaction corresponding to the second off-link smart contract according to the actual requirement; at this time, "send second notification information to several second smart contracts corresponding to each second transaction" should be configured to "send corresponding second notification information to each second out-of-chain smart contract"; and after the second out-of-chain intelligent contract receives the second notification information, screening out each second transaction executable by the current out-of-chain intelligent contract, executing each screened second transaction according to a second data set corresponding to each screened second transaction to obtain a first execution result set, and executing each received second transaction according to a second data set corresponding to each received second transaction to obtain a first execution result set after the second out-of-chain intelligent contract receives the second notification information, so that the same technical effects can be achieved.
Those skilled in the art will appreciate that if a block link point fails to find a second out-of-chain smart contract corresponding to a cached second transaction, the second transaction fails to execute.
It should be understood by those skilled in the art that "sending the second notification information to the plurality of second intelligent contracts corresponding to each second transaction" may also be configured according to actual needs, for example, configured as "sending the second notification information to each out-of-chain intelligent contract", and only c10_l4 and c10_l3 will execute step S15 in the following steps; however, this method occupies a large network overhead due to the need to send the second notification information to each out-of-chain smart contract.
It will be appreciated by those skilled in the art that the present solution is more suitable for both the federated and private chains, as the transactions cached by the memory pools of the blockchain nodes of the federated and private chains are substantially identical; in public chains, due to reasons such as networks, a certain gap exists between transactions in memory pools of different block chain nodes, and assuming that a block to be executed is a block (101), the block (101) comprises first-class transactions tx21 to tx25, and data sets required to be acquired for executing tx21 to tx24 are cached in a current block chain node, the current block chain node should acquire the data sets required to be acquired for executing tx25 from other block chain nodes first, and the block chain node can send tx16 to tx20 to C10_L4 and C10_L3 when executing step S14, and execute the data sets respectively corresponding to tx16 to tx 20. When the current scheme is used for the alliance chain and the private chain, the situation that the current blockchain node should acquire the data set required to be acquired for executing tx25 from other blockchain nodes is basically considered to be absent, and compared with the public chain, the network overhead is saved.
The above-described embodiments facilitate blockchain development.
Preferably, when the first transaction is determined to be a first type of transaction that needs to be executed by calling the off-chain smart contract, sending the first notification information to the off-chain smart contract that executes the first transaction includes:
judging whether the first transaction is a first type transaction which can be executed only by calling the intelligent contract outside the chain according to whether the first contract called by the first transaction is deployed on the blockchain;
and when the first transaction is judged to be the first type of transaction, sending first notification information to a first out-of-chain intelligent contract for executing the first transaction.
The block execution principle of the above embodiment may refer to the method shown in fig. 1, and will not be described herein.
Preferably, counting the first index set acquired for executing the first transaction and transmitting the first index set to the block link point includes:
counting a first key set required to be acquired for executing the first transaction, and sending the first key set to the blockchain node;
the blockchain node searches the first data set according to the first index set, and caches the first data set, including:
the blockchain node searches a first value set according to the first key set and caches the first value set;
the second notification information includes a second value set corresponding to each second transaction, and executing each screened second transaction according to the second data set corresponding to each screened second transaction to obtain a first execution result set includes:
and executing each screened second transaction according to the second value set corresponding to each screened second transaction to obtain a first execution result set.
The block execution principle of the above embodiment may refer to the method shown in fig. 1, and will not be described herein.
Preferably, the first notification information includes a first transaction hash of the first transaction, and the second notification information includes a second transaction hash of each of the second transactions.
The block execution principle of the above embodiment may refer to the method shown in fig. 1, and will not be described herein.
Preferably, the first notification information includes a first transaction, and the second notification information includes each of the second transactions.
The block execution principle of the above embodiment may refer to the method shown in fig. 1, and will not be described herein.
Preferably, the blockchain node is configured with a blockchain module and an intelligent contract adapter module, the blockchain node receives a first transaction, and when the first transaction is judged to be a first type of transaction which can be executed only by calling the intelligent contract outside the chain, sending first notification information to the intelligent contract outside the chain for executing the first transaction includes:
the blockchain module receives a first transaction, and when the first transaction is judged to be a first type of transaction which can be executed only by calling the intelligent contract outside the chain, the first transaction is sent to the intelligent contract adapter module;
the intelligent contract adapter module sends first notification information to a first out-of-chain intelligent contract executing a first transaction;
transmitting the first index set to the block link point includes:
transmitting the first index set to the intelligent contract adapter module;
the intelligent contract adapter module sends the first index set to the blockchain module;
the blockchain node searches the first data set according to the first index set, and caches the first data set, including:
the block chain module searches a first data set according to the first index set and caches the first data set;
the blockchain node sequentially screens out second transactions which are first-class transactions from a first block to be executed, and sends second notification information to a plurality of second intelligent contracts corresponding to the second transactions, wherein the second notification information comprises:
the blockchain node sequentially screens out second transactions which are first-class transactions from a first block to be executed, and sends the second transactions to the intelligent contract adapter module;
the intelligent contract adapter module sends second notification information to a plurality of second intelligent contracts corresponding to each second transaction;
the blockchain node executing the first blocks according to each first execution result set comprises:
the intelligent contract adapter module acquires each first execution result set and sends each first execution result set to the blockchain module;
the block chain module executes the first blocks according to each first execution result set.
The above embodiment is different from the embodiment shown in fig. 1 in that in the above embodiment, the blockchain link points are deployed with blockchain modules and smart contract adapter modules, and the blockchain modules are configured as modules that do not directly interact with the out-of-chain smart contracts, so that the security of the blockchain modules is ensured.
Fig. 2 is a schematic structural diagram of a computer device according to an embodiment of the present application.
As shown in fig. 2, as another aspect, the present application also provides a computer apparatus including one or more Central Processing Units (CPUs) 201, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 202 or a program loaded from a storage portion 208 into a Random Access Memory (RAM) 203. In the RAM203, various programs and data required for the operation of the computer device are also stored. The CPU201, ROM202, and RAM203 are connected to each other through a bus 204. An input/output (I/O) interface 205 is also connected to bus 204.
The following components are connected to the I/O interface 205: an input section 206 including a keyboard, a mouse, and the like; an output portion 207 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage section 208 including a hard disk or the like; and a communication section 209 including a network interface card such as a LAN card, a modem, and the like. The communication section 209 performs communication processing via a network such as the internet. The drive 210 is also connected to the I/O interface 205 as needed. A removable medium 211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed on the drive 210 as needed, so that a computer program read out therefrom is installed into the storage section 208 as needed.
In particular, according to embodiments of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing any of the methods described above. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 209, and/or installed from the removable medium 211.
As still another aspect, the present application also provides a computer-readable storage medium, which may be a computer-readable storage medium contained in the apparatus of the above-described embodiment; or may be a computer-readable storage medium, alone, that is not assembled into a computer device. The computer-readable storage medium stores one or more programs for use by one or more processors to perform the methods described herein.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules involved in the embodiments of the present application may be implemented in software or in hardware. The described units or modules may also be provided in a processor, for example, each of the units may be a software program provided in a computer or a mobile smart device, or may be separately configured hardware devices. Wherein the names of the units or modules do not in some cases constitute a limitation of the units or modules themselves.
The above description is only illustrative of the preferred embodiments of the present application and of the principles of the technology employed. It will be appreciated by persons skilled in the art that the scope of the application referred to in the present application is not limited to the specific combinations of the technical features described above, but also covers other technical features formed by any combination of the technical features described above or their equivalents without departing from the spirit of the application. Such as the above-mentioned features and the technical features disclosed in the present application (but not limited to) having similar functions are replaced with each other.
Claims (8)
1. A method of executing a block, wherein each device running a blockchain node is configured with a plurality of identical off-chain intelligence contracts outside of the blockchain program, the off-chain intelligence contracts being about intelligent contracts written in an off-chain language, the method being applicable to the device running the blockchain node, the method comprising:
the block chain link point receives a first transaction, and when the first transaction is judged to be a first type of transaction which can be executed only by calling an out-of-chain intelligent contract, first notification information is sent to the out-of-chain intelligent contract for executing the first transaction;
after the first out-of-chain intelligent contract receives the first notification information, counting a first index set required to be acquired for executing the first transaction, and sending the first index set to the blockchain node;
the blockchain node searches a first data set according to the first index set and caches the first data set;
the blockchain node sequentially screens out second transactions which are the first type transactions from a first block to be executed, and sends second notification information to a plurality of second intelligent contracts corresponding to the second transactions; wherein the second notification information includes a second data set respectively corresponding to each of the second transactions;
after the second out-of-chain intelligent contract receives the second notification information, screening out each second transaction executable by the current out-of-chain intelligent contract, and executing each screened second transaction according to a second data set corresponding to each screened second transaction to obtain a first execution result set;
the blockchain node executes the first blocks according to each first execution result set.
2. The method of claim 1, wherein sending the first notification information to the first out-of-chain smart contract that performs the first transaction when the first transaction is determined to be a first type of transaction that requires invocation of the out-of-chain smart contract to perform comprises:
judging whether the first transaction is a first type transaction which can be executed only by calling an intelligent contract outside a chain according to whether the first contract called by the first transaction is deployed on a blockchain;
and when the first transaction is judged to be the first type transaction, sending first notification information to a first out-of-chain intelligent contract for executing the first transaction.
3. The method of claim 1, wherein counting a first set of indices acquired required to perform the first transaction and transmitting the first set of indices to the block link point comprises:
counting a first key set required to be acquired for executing the first transaction, and sending the first key set to the blockchain node;
the blockchain node searches a first data set according to the first index set, and caches the first data set, including:
the blockchain node searches a first value set according to the first key set and caches the first value set;
the second notification information includes a second value set corresponding to each second transaction, and the performing each screened second transaction according to the second data set corresponding to each screened second transaction to obtain a first execution result set includes:
and executing the screened second transactions according to the second value sets corresponding to the screened second transactions to obtain a first execution result set.
4. The method of claim 1, wherein the first notification information comprises a first transaction hash of the first transaction and the second notification information comprises a second transaction hash of each of the second transactions.
5. The method of claim 1, wherein the first notification information comprises the first transaction and the second notification information comprises each of the second transactions.
6. The method of any of claims 1-5, wherein a blockchain node is deployed with a blockchain module and an intelligent contract adapter module, the blockchain node receiving a first transaction, and upon determining that the first transaction is a first type of transaction that requires invocation of an off-chain intelligent contract to execute, sending first notification information to the first off-chain intelligent contract that executes the first transaction comprises:
the blockchain module receives a first transaction, and when the first transaction is judged to be a first type of transaction which can be executed only by calling an out-of-chain intelligent contract, the first transaction is sent to the intelligent contract adapter module;
the intelligent contract adapter module sends first notification information to a first out-of-chain intelligent contract executing the first transaction;
the sending the first set of indices to the block link point includes:
transmitting the first index set to the intelligent contract adapter module;
the intelligent contract adapter module sends the first index set to the blockchain module;
the blockchain node searches a first data set according to the first index set, and caches the first data set, including:
the block chain module searches a first data set according to the first index set and caches the first data set;
the blockchain node sequentially screens out second transactions which are the first type transactions from a first block to be executed, and sends second notification information to a plurality of second intelligent contracts corresponding to the second transactions, wherein the second notification information comprises:
the blockchain node sequentially screens out second transactions which are the first type transactions from a first block to be executed, and sends the second transactions to the intelligent contract adapter module;
the intelligent contract adapter module sends second notification information to a plurality of second intelligent contracts corresponding to each second transaction;
the blockchain node executing the first blocks according to each first execution result set includes:
the intelligent contract adapter module obtains each first execution result set and sends each first execution result set to the blockchain module;
the block chain module executes the first blocks according to each first execution result set.
7. A computer device, the device comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-6.
8. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110731136.XA CN113590611B (en) | 2021-06-29 | 2021-06-29 | Block execution method, computer device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110731136.XA CN113590611B (en) | 2021-06-29 | 2021-06-29 | Block execution method, computer device, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113590611A CN113590611A (en) | 2021-11-02 |
CN113590611B true CN113590611B (en) | 2023-11-24 |
Family
ID=78245075
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110731136.XA Active CN113590611B (en) | 2021-06-29 | 2021-06-29 | Block execution method, computer device, and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113590611B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110264204A (en) * | 2019-06-06 | 2019-09-20 | 杭州趣链科技有限公司 | A kind of across chain method of commerce of block chain based on intelligent contract sequencing |
WO2020133069A1 (en) * | 2018-12-27 | 2020-07-02 | 合肥达朴汇联科技有限公司 | Data processing method and apparatus for block chain |
CN112583585A (en) * | 2020-12-09 | 2021-03-30 | 杭州复杂美科技有限公司 | Transaction execution method, apparatus and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11494344B2 (en) * | 2018-03-06 | 2022-11-08 | International Business Machines Corporation | Customized endorsement logic for blockchain |
-
2021
- 2021-06-29 CN CN202110731136.XA patent/CN113590611B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020133069A1 (en) * | 2018-12-27 | 2020-07-02 | 合肥达朴汇联科技有限公司 | Data processing method and apparatus for block chain |
CN110264204A (en) * | 2019-06-06 | 2019-09-20 | 杭州趣链科技有限公司 | A kind of across chain method of commerce of block chain based on intelligent contract sequencing |
CN112583585A (en) * | 2020-12-09 | 2021-03-30 | 杭州复杂美科技有限公司 | Transaction execution method, apparatus and storage medium |
Non-Patent Citations (1)
Title |
---|
众筹区块链上的智能合约设计;黄洁华;高灵超;许玉壮;白晓敏;胡凯;;信息安全研究(03);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113590611A (en) | 2021-11-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105071976B (en) | Data transmission method and device | |
CN112583585B (en) | Transaction execution method, apparatus and storage medium | |
US11514171B2 (en) | Code vulnerability detection and remediation | |
CN110636093B (en) | Microservice registration and discovery method, microservice registration and discovery device, storage medium and microservice system | |
CN114172966B (en) | Service calling method, service processing method and device under unitized architecture | |
CN112445868B (en) | Service message processing method and device | |
CN110351366A (en) | A kind of service scheduling method of Internet application, system and computer readable storage medium | |
US20220138074A1 (en) | Method, electronic device and computer program product for processing data | |
CN113691635B (en) | Method and device for calling microservice, electronic equipment and readable storage medium | |
CN112416616B (en) | Micro-service calling method and device, electronic equipment and storage medium | |
CN109104368B (en) | Connection request method, device, server and computer readable storage medium | |
CN111666218B (en) | Code auditing method, device, electronic equipment and medium | |
CN112346872B (en) | Cloud computing capacity expansion method and device based on service call link | |
CN113590611B (en) | Block execution method, computer device, and storage medium | |
CN112714042B (en) | Pressure testing method and device, electronic equipment and storage medium | |
CN109683992B (en) | Method and apparatus for managing objects | |
CN112055077B (en) | Block link access method, device and storage medium | |
CN113742235A (en) | Method and device for checking codes | |
CN113379550B (en) | Block execution method, computer device and storage medium | |
CN115776501A (en) | Block chain system architecture, management method, electronic equipment and readable storage medium | |
CN112053154B (en) | Transaction broadcasting method, apparatus and storage medium | |
CN115291928A (en) | Task automatic integration method and device of multiple technology stacks and electronic equipment | |
CN112866365A (en) | Node communication method, computer device, and storage medium | |
CN114513548B (en) | Directional call information processing method and device | |
CN114285784B (en) | Data transmission and pipeline construction method, device, computing equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |