WO2023103341A1 - Procédé, appareil et dispositif d'invocation de contrat intelligent à base de chaîne de blocs - Google Patents

Procédé, appareil et dispositif d'invocation de contrat intelligent à base de chaîne de blocs Download PDF

Info

Publication number
WO2023103341A1
WO2023103341A1 PCT/CN2022/100650 CN2022100650W WO2023103341A1 WO 2023103341 A1 WO2023103341 A1 WO 2023103341A1 CN 2022100650 W CN2022100650 W CN 2022100650W WO 2023103341 A1 WO2023103341 A1 WO 2023103341A1
Authority
WO
WIPO (PCT)
Prior art keywords
smart contract
storage
resource
transaction information
information
Prior art date
Application number
PCT/CN2022/100650
Other languages
English (en)
Chinese (zh)
Inventor
郭锐
李辉忠
范瑞彬
张开翔
Original Assignee
深圳前海微众银行股份有限公司
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 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2023103341A1 publication Critical patent/WO2023103341A1/fr

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9017Indexing; Data structures therefor; Storage structures using directory or table look-up
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/405Establishing or using transaction specific rules

Definitions

  • Embodiments of the present disclosure relate to the technical field of financial technology (Fintech), and in particular to a blockchain-based smart contract calling method, device and equipment.
  • Fetech technical field of financial technology
  • Embodiments of the present disclosure relate to the technical field of financial technology (Fintech), and in particular to a blockchain-based smart contract calling method, device and equipment.
  • the executor that executes the smart contract in the node of the blockchain will maintain a CNS (Contract Name Service , contract naming service) table
  • the CNS table stores the mapping relationship between the smart contract name and the smart contract address. Smart contract address, and obtain the corresponding smart contract from the smart contract address to execute the transaction.
  • the blockchain needs to execute transactions in parallel, and multiple executors of the blockchain need to execute smart contracts in parallel.
  • each executor needs to maintain a CNS table (the mapping relationship between the smart contract name and the smart contract address), when the user modifies the smart contract related information in the CNS table in an executor , it is necessary to synchronize the data of the modified CNS table to all other executors, otherwise other executors will execute wrong smart contracts, thus resulting in frequent synchronization of CNS table data between executors, affecting the blockchain Processing efficiency for executing multiple smart contracts in parallel.
  • CNS table the mapping relationship between the smart contract name and the smart contract address
  • Embodiments of the present disclosure provide a blockchain-based smart contract calling method, device, and equipment to overcome the need for frequent synchronization of CNS table data between executors in the related art, which affects the parallel execution of multiple smart contracts by the blockchain. problem of processing efficiency.
  • an embodiment of the present disclosure provides a method for invoking a smart contract based on blockchain, the method is applied to any node of the blockchain, and the node is provided with a system for scheduling and distributing transaction information.
  • a scheduler, an executor for executing smart contracts and a storage unit for storing smart contracts, the method includes:
  • the transaction information includes path information of the smart contract to be executed corresponding to the transaction information, wherein the path information corresponds to a unique smart contract storage path;
  • each executor queries the storage unit to obtain the smart contract corresponding to each transaction information, wherein the storage unit contains each smart contract stored according to the tree file directory structure. contract, and the storage path of each smart contract is unique;
  • Each executor executes the smart contract on the transaction information to obtain an execution result.
  • the storage unit contains smart contracts stored in a tree-shaped file directory structure, and the storage path of each smart contract is unique, specifically: the storage unit contains Stored directory resources and smart contract resources; each directory resource contains multiple sub-resources, the same type of smart contract resources belong to the last sub-resource under the same directory resource, and the smart contract resource contains the code segment information of the smart contract and status information.
  • each executor queries the storage unit to obtain the smart contract corresponding to each transaction information based on the path information of the smart contract to be executed corresponding to each transaction information, including: corresponding to any transaction information Split the path information of the smart contract to be executed to obtain the names of the storage tables corresponding to the path information; access the corresponding storage tables in the storage unit in turn according to the names of the storage tables to obtain the corresponding smart contract resources.
  • the sequentially accessing the corresponding storage tables in the storage unit according to the names of the storage tables to obtain the smart contract resources corresponding to the path information includes: accessing the cache, from the cache Read each storage table whose name is the name of each storage table in turn; if each storage table can be read from the cache, then query each storage table sequentially from the cache according to the names of each storage table until it is determined The storage table corresponding to the smart contract resource, to obtain the smart contract resource corresponding to the path information from the storage table corresponding to the smart contract resource; if the storage table cannot be read from the cache, then from the storage unit of the block chain Query each storage table in turn according to the names of the storage tables until the storage table corresponding to the smart contract resource is determined, so as to obtain the smart contract resource corresponding to the path information from the storage table corresponding to the smart contract resource.
  • the storage tables are queried sequentially according to the names of the storage tables until the storage table corresponding to the smart contract resource is determined, so as to obtain the smart information corresponding to the path information from the storage table corresponding to the smart contract resource.
  • Contract resources including: according to the level of each storage table name in the path information, query the storage tables corresponding to each storage table name one by one to obtain the storage table corresponding to the smart contract resource, so as to obtain the storage table corresponding to the smart contract resource. Obtain the smart contract resource corresponding to the path information.
  • each smart contract also includes the step of storing each smart contract according to the tree file directory structure, as follows: determine any directory resource by creating or querying; write the smart contract to be created in the directory resource.
  • any directory resource is determined by creation or query, including:
  • the writing the smart contract to be created in the directory resource includes: generating the storage table name of any smart contract according to user input; judging whether the storage table name of the smart contract is Exist; if not, then obtain the directory resource, and start the virtual machine to execute the smart contract, if the execution is successful, then write the code segment information and status information of the smart contract in the directory resource.
  • the embodiment of the present disclosure provides a block chain-based smart contract calling device, the device is applied to any node of the block chain, and the node is provided with a system for scheduling and distributing transaction information.
  • a scheduler, an executor for executing smart contracts and a storage unit for storing smart contracts, the device includes:
  • the receiving module is used to receive the transaction information sent by the client, wherein the transaction information includes the path information of the smart contract to be executed corresponding to the transaction information, wherein the path information corresponds to a unique smart contract storage path;
  • a scheduling module configured to put the received transaction information into a scheduler so that the scheduler distributes the transaction information to different executors
  • the dispatching module is used to query the storage unit to obtain the smart contract corresponding to each transaction information through each executor based on the path information of the smart contract to be executed corresponding to each transaction information, wherein the storage unit contains the following information according to the tree file directory Each smart contract stored in the structure, and the storage path of each smart contract is unique;
  • the execution module is configured to execute the smart contract on the transaction information through each executor to obtain an execution result.
  • an embodiment of the present disclosure provides a service device, including: a processor and a memory;
  • the memory stores computer-executable instructions
  • the processor executes the computer-executed instructions stored in the memory, so that the processor executes the blockchain-based smart contract calling method described in the first aspect and various possible designs of the first aspect.
  • an embodiment of the present disclosure provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the processor executes the computer-executable instructions, the above first aspect and the first The smart contract calling method based on the block chain described in various possible designs.
  • any node of the blockchain carries the path information of the smart contract to be executed corresponding to the transaction information in the transaction information, and the The path information corresponds to the unique storage path of the smart contract; the storage unit of each node of the blockchain stores the smart contracts stored according to the tree file directory structure, and the storage path of each smart contract is unique, the blockchain node According to the path information, each executor accesses the storage unit to obtain the corresponding smart contract according to the unique smart contract storage path, and executes the transaction information according to the smart contract to obtain the execution result.
  • FIG. 1 is a schematic diagram of a scenario of a blockchain-based smart contract calling method provided by the present disclosure
  • FIG. 2 is a first schematic flow diagram of a blockchain-based smart contract calling method provided by an embodiment of the present disclosure
  • FIG. 3 is a logical structure diagram of smart contracts stored according to the tree-shaped file directory structure provided by the embodiment of the present disclosure
  • Fig. 4 is a schematic diagram of the actual storage form of the smart contract provided by the embodiment of the present disclosure.
  • FIG. 5 is a second schematic flow diagram of a blockchain-based smart contract calling method provided by an embodiment of the present disclosure
  • FIG. 6 is a schematic structural diagram of a block chain-based smart contract calling device provided by an embodiment of the present disclosure
  • FIG. 7 is a second structural diagram of a blockchain-based smart contract calling device provided by an embodiment of the present disclosure.
  • FIG. 8 is a schematic diagram of a hardware structure of a service device provided by an embodiment of the present disclosure.
  • the blockchain system can be understood as a distributed storage system maintained and trusted by multiple nodes.
  • the bottom layer of the blockchain is a chain composed of a series of blocks.
  • each block also records the hash value of the previous block.
  • a block consists of a block header and a block body, where the block header defines important fields such as the height of the block and the hash value of the previous block, while the block body mainly stores transaction data.
  • the blockchain uses cryptography to ensure the security of data transmission and access, and uses a chain structure to ensure that the data on the chain cannot be tampered with.
  • Smart contract refers to a contract defined in digital form that can automatically execute terms.
  • the digital form means that the contract must be implemented with computer code, because as long as the participants reach an agreement, the rights and obligations established by the smart contract will be automatically executed. And the results cannot be denied.
  • blockchain applications when the transaction to deploy the smart contract reaches a consensus among most nodes, it can be considered that the smart contract has been embedded in the blockchain system.
  • Ethereum Virtual Machine (the executor of the smart contract): After the smart contract is compiled into a binary file, it is deployed to the node of the blockchain. The user triggers the execution of the smart contract by calling the interface of the smart contract. As the executor of the smart contract code, the Ethereum virtual machine executes the code of the smart contract and modifies the data (state) on the current blockchain. The modified data will be consensused to ensure consistency.
  • FIG. 1 is a schematic diagram of a scenario of a blockchain-based smart contract calling method provided by the present disclosure.
  • client 101 includes: client 101 and blockchain node 102, which can install SDK (Software Development Kit, software development kit) for initiating transactions and generating transaction information.
  • SDK Software Development Kit, software development kit
  • the client 101 may be a personal computer, a mobile terminal or other devices such as servers.
  • the blockchain node 102 can be any node in the blockchain system, for example, it can be any node participating in the consensus process in the blockchain, or a leader node elected from the consensus nodes, and this disclosure does not make any any restrictions.
  • the blockchain node 102 is used to receive the transaction information sent by the client, and obtain the smart contract corresponding to the transaction information. Based on the smart contract, the Ethereum virtual machine (executor) is used to execute the transaction information to obtain the execution result. Consensus is carried out in the blockchain, and after the consensus is completed, it is stored on the blockchain.
  • the executor (Ethereum smart contract virtual machine) that executes the smart contract in the node of the blockchain will maintain a CNS table.
  • the CNS table will be accessed first to query the corresponding smart contract address, and the corresponding smart contract will be obtained from the smart contract address to execute the transaction.
  • the blockchain needs to execute transactions in parallel, multiple executors of the blockchain need to execute smart contracts in parallel.
  • the data of the modified CNS table must be synchronized to all other executors, otherwise other executors will execute wrong smart contracts, thus resulting in the need for frequent synchronization of CNS table data between executors, affecting blockchain parallelism Processing efficiency for executing multiple smart contracts.
  • this disclosure provides the following technical solutions: carrying the path information of the smart contract to be executed corresponding to the transaction information in the transaction information, and the path information corresponds to the unique storage path of the smart contract;
  • the storage unit stores smart contracts that are stored according to the tree-shaped file directory structure, and the storage path of each smart contract is unique.
  • Each executor of the blockchain node accesses the storage unit according to the path information and stores them according to the unique smart contract.
  • the path obtains the corresponding smart contract, executes the transaction information according to the smart contract, and obtains the execution result.
  • FIG. 2 is a first schematic flowchart of a blockchain-based smart contract calling method provided by an embodiment of the present disclosure. This embodiment is applied to any node of the block chain shown in Figure 1, and the node is provided with a scheduler for scheduling and distributing transaction information, an executor for executing smart contracts, and a storage device for storing smart contracts. unit, the above method is detailed as follows:
  • S201 Receive the transaction information sent by the client, wherein the transaction information includes the path information of the smart contract to be executed corresponding to the transaction information, wherein the path information corresponds to a unique storage path of the smart contract.
  • the client may be any client that has a transaction behavior, and the client generates transaction information according to the transaction behavior and sends it to any node of the blockchain.
  • a user purchases goods in an online mall and completes the transaction through the client, and the client sends the transaction information of the purchased goods to any node in the blockchain.
  • any node of the blockchain is any node among the consensus nodes in the blockchain.
  • the leader node is elected from the consensus nodes of the blockchain. Any consensus node can be either a leader node or a replica node.
  • the user can specify the smart contract to be executed corresponding to the transaction information on the client side, and add the path information of the smart contract to be executed to the transaction information.
  • the path information corresponds to a unique smart contract storage path, and the corresponding smart contract is obtained through the unique smart contract storage path according to the path information.
  • S202 Put the received transaction information into the scheduler so that the scheduler distributes the transaction information to different executors.
  • the scheduler is a virtual scheduler set in the nodes of the blockchain, and the virtual scheduler distributes each transaction information that can execute the smart contract in parallel to different executors according to preset rules.
  • the preset rule may be to evenly distribute each transaction information to each executor. For example, if there are 10 transaction information and 2 executors, 5 transaction information can be assigned to one executor, and the other 5 transaction information can be assigned to another executor.
  • S203 Through each executor, based on the path information of the smart contract to be executed corresponding to each transaction information, query the storage unit to obtain the smart contract corresponding to each transaction information, wherein the storage unit contains each smart contract stored according to the tree file directory structure contract, and the storage path of each smart contract is unique.
  • the storage unit contains smart contracts stored according to the tree-shaped file directory structure, and the storage path of each smart contract is unique, specifically: the storage unit contains directory resources stored in the form of a storage table and smart contract resources; each directory resource contains multiple sub-resources, and the same type of smart contract resources belong to the last sub-resource under the same directory resource, and the smart contract resource contains the code segment information and status information of the smart contract.
  • FIG. 3 is a logical structure diagram of smart contracts stored in a tree-shaped file directory structure according to an embodiment of the present disclosure.
  • “/" is the root directory, which contains multiple directory resources, as shown in Figure 3
  • "sys”, “usr”, “apps”, and “tables” are all directory resources, which are system class directories Resources, user class directory resources, application class directory resources, and table class directory resources.
  • each directory resource includes a plurality of sub-resources, and the sub-resources may be a sub-resource of the current directory resource, or may directly be smart contract resources.
  • the sub-resources of "sys1" and “sys2" contained in “sys” are the directory resources of the next level of directory resources, and "sys1" and “sys2" each contain two system smart contract resources , where “sys1” includes “system smart contract resource 1” and “system smart contract resource 2"; “sys2” includes “system smart contract resource 3” and “system smart contract resource 4".
  • FIG. 4 is a schematic diagram of the actual storage form of the smart contract provided by the embodiment of the present disclosure.
  • the storage unit contains directory resources and smart contract resources stored in the form of storage tables.
  • the storage table name is: "/tables” is a directory resource, and the storage table names of the smart contract resources contained in it are “/tables/table1" and “/tables/table2".
  • the storage table named "/tables” describes the meta information of smart contract resources
  • the storage table named “/tables/table1" and “/tables/table2” respectively contain tables Data for smart contracts "table1" and "table2".
  • each executor based on the path information of the smart contract to be executed corresponding to each transaction information, query the storage unit to obtain the smart contract corresponding to each transaction information, including:
  • path information "/apps/Hello1" is taken as an example for description:
  • the corresponding storage tables in the storage unit are sequentially accessed to obtain the smart contract resources corresponding to the path information, including: accessing the cache, and sequentially reading the storage tables whose names are the names of the storage tables from the cache ; If the storage tables can be read from the cache, query the storage tables in sequence according to the names of the storage tables from the cache until the storage table corresponding to the smart contract resource is determined, so as to obtain path information from the storage table corresponding to the smart contract resource Corresponding smart contract resources; if the storage tables cannot be read from the cache, query each storage table in turn from the storage unit of the blockchain according to the names of the storage tables until the storage table corresponding to the smart contract resource is determined, so as to obtain the data from the smart contract. Get the smart contract resource corresponding to the path information in the storage table corresponding to the resource.
  • each storage table in turn according to the name of each storage table until the storage table corresponding to the smart contract resource is determined, so as to obtain the smart contract resource corresponding to the path information from the storage table corresponding to the smart contract resource, including: according to the name of each storage table in the path The level in the information, query the storage table corresponding to each storage table name one by one to obtain the storage table corresponding to the smart contract resource, and obtain the smart contract resource corresponding to the path information from the storage table corresponding to the smart contract resource.
  • each executor after the transaction information of the smart contract that can be executed in parallel is distributed to different executors, each executor will first read the cache. If the executor has executed the same smart contract before, then the execution The server will cache the data corresponding to the smart contract, and the data corresponding to the smart contract includes each storage table corresponding to the storage path of the smart contract.
  • the executor will first read the storage table named "/apps” and the storage table “/tables” from the cache; and then read the Take the storage table whose names are “/apps/Hello1" and “/tables/table1", respectively, where the storage table of "/apps/Hello1" and “/tables/table1” respectively contain Smart contract resources for the "Hello1" smart contract and the "table1" smart contract.
  • the executor If the executor does not read the above storage tables from the cache, it will obtain the corresponding storage tables from the storage unit, and write the storage tables obtained from the storage unit into the executor.
  • the writing process For slow writing, it takes longer than reading directly from the buffer.
  • each storage table of the smart contract can support distributed storage of data in the storage unit, so that when the executor loads each storage table from the storage unit, all data is dispersed.
  • the executor when the executor loads the smart contract from the storage unit, it can also specify the path of a certain directory resource, and load all the smart contracts under the directory resource to the same executor, so that different execution
  • the directory resources loaded by the server are different, so as to achieve the isolation of smart contracts at the directory resource level.
  • S204 Execute the smart contract on the transaction information through each executor, and obtain the execution result.
  • the executor executes the smart contract on the transaction information, obtains the execution result of the transaction information, and then sends the execution result of the transaction information to other consensus nodes in the blockchain for consensus. After the consensus of the execution result, the execution result of the transaction information is stored on the chain in the blockchain.
  • each executor of the blockchain node accesses the storage unit according to the path information to obtain the corresponding smart contract according to the unique smart contract storage path, and Execute the transaction information according to the smart contract and get the execution result. Since the smart contracts stored in the storage unit according to the tree-shaped file directory structure are unique and isolated from each other when they are scheduled by different executors, it is not necessary for each executor to perform smart contract-related CNS when executing transactions in parallel. The synchronization of table data improves the efficiency of blockchain in parallel execution of smart contracts for transaction information.
  • FIG. 5 is a second schematic flow diagram of a blockchain-based smart contract calling method provided by an embodiment of the present disclosure. This embodiment also describes the steps of how to store each smart contract according to the tree-shaped file directory structure, which is detailed as follows:
  • S501 Determine any directory resource by creating or querying.
  • any directory resource including:
  • the user can create a new directory resource under any existing directory resource.
  • S502 Write the smart contract to be created in the directory resource.
  • write the smart contract to be created in the directory resource including:
  • the directory resource is obtained, and the virtual machine is started to execute the smart contract. If the execution is successful, the code segment information and status information of the smart contract are written in the directory resource.
  • the virtual machine when deploying a contract, it will be pre-determined that the parent directory of the level directory already exists and information can be written, and then the virtual machine is started to execute the deployment and creation contract operation; after the virtual machine is successfully executed, the contract table is created, And write the contract code segment, ABI, state data, etc. after the virtual machine is executed into the contract table, and finally record the meta information of the newly deployed contract in the data table of the parent directory.
  • users can access the meta information of resources (directory resources and smart contract resources) under any path through the interface.
  • it is pre-determined whether there is a resource in the path, and if it exists, access the storage table of the upper-level directory resource to check whether the target resource under the path is a smart contract resource or a directory resource. If it is a smart contract resource, it will return the meta information of the smart contract; if it is a directory resource type, it will return the meta information of the directory resource, and return all sub-resources under the path (which contains all the smart contract meta information).
  • FIG. 6 is a first structural diagram of a block chain-based smart contract calling device provided by an embodiment of the present disclosure.
  • the block chain-based smart contract calling device 60 is applied to any node of the block chain, and the node is provided with a scheduler for scheduling and distributing transaction information, for executing An executor of the smart contract and a storage unit for storing the smart contract, the device includes: a receiving module 601 , a scheduling module 602 , a processing module 603 and an executing module 604 .
  • the receiving module 601 is used to receive the transaction information sent by the client, wherein the transaction information includes the path information of the smart contract to be executed corresponding to the transaction information, wherein the path information corresponds to a unique smart contract storage path ;
  • the processing module 603 is used to query the storage unit to obtain the smart contract corresponding to each transaction information through each executor based on the path information of the smart contract to be executed corresponding to each transaction information, wherein the storage unit contains information according to the tree file Each smart contract stored in the directory structure, and the storage path of each smart contract is unique;
  • the execution module 604 is configured to execute the smart contract on the transaction information through each executor to obtain an execution result.
  • the storage unit of each node of the blockchain stores the information according to the tree file directory structure
  • Each stored smart contract, and the storage path of each smart contract is unique, each executor of the blockchain node accesses the storage unit according to the path information to obtain the corresponding smart contract according to the unique smart contract storage path, and executes the transaction according to the smart contract information to get the execution result. Since the smart contracts stored in the storage unit according to the tree-shaped file directory structure are unique and isolated from each other when they are scheduled by different executors, it is not necessary for each executor to perform smart contract-related CNS when executing transactions in parallel. The synchronization of table data improves the efficiency of blockchain in parallel execution of smart contracts for transaction information.
  • the storage unit contains smart contracts stored in a tree-shaped file directory structure, and the storage path of each smart contract is unique, specifically: the storage unit contains the following Store directory resources and smart contract resources stored in the form of tables; each directory resource contains multiple sub-resources, the same type of smart contract resources belong to the last sub-resource under the same directory resource, and the smart contract resource contains the code of the smart contract segment information and status information.
  • the scheduling module 602 is specifically configured to: split the path information of the smart contract to be executed corresponding to any transaction information, and obtain the storage Table name; according to the names of the storage tables, access the corresponding storage tables in the storage unit in order to obtain the smart contract resources corresponding to the path information.
  • the scheduling module 602 is specifically configured to sequentially access the corresponding storage tables in the storage unit according to the names of the storage tables, so as to obtain the intelligence information corresponding to the path information.
  • the process of contract resources including: accessing the cache, sequentially reading the storage tables whose names are the names of the storage tables from the cache; if the storage tables can be read from the cache, then from the cache Query each storage table in turn according to the names of the storage tables until the storage table corresponding to the smart contract resource is determined, so as to obtain the smart contract resource corresponding to the path information from the storage table corresponding to the smart contract resource;
  • Each storage table is read from the storage unit of the blockchain, and each storage table is queried sequentially according to the names of the storage tables in the blockchain until the storage table corresponding to the smart contract resource is determined, so as to obtain all data from the storage table corresponding to the smart contract resource.
  • the smart contract resource corresponding to the above path information.
  • the scheduling module 602 is specifically used to inquire each storage table in turn according to the names of the storage tables until the storage table corresponding to the smart contract resource is determined, so as to obtain from the smart contract resource
  • the process of obtaining the smart contract resource corresponding to the path information in the corresponding storage table includes: according to the level of each storage table name in the path information, query the storage table corresponding to each storage table name one by one to obtain the smart contract resource
  • the corresponding storage table is used to obtain the smart contract resource corresponding to the path information from the storage table corresponding to the smart contract resource.
  • the device provided in this embodiment can be used to implement the technical solutions of the above method embodiments, and its implementation principle and technical effect are similar, so this embodiment will not repeat them here.
  • FIG. 7 is a second schematic structural diagram of a blockchain-based smart contract calling device provided by an embodiment of the present disclosure. As shown in Figure 7, the block chain-based smart contract calling device 60 also includes:
  • a directory creation module 605, configured to determine any directory resource by creating or querying
  • a contract creation module 606, configured to write the smart contract to be created in the directory resource.
  • the directory creation module 605 is specifically configured to generate the storage table name of any directory resource according to user input; determine whether the storage table name of the directory resource already exists; if If it does not exist, then create the directory resource, wherein the directory resource includes the meta information of the directory; if it exists, then judge whether the storage table name is the table name of the smart contract resource, if not, then return that the directory resource has been hints that exist.
  • the directory creation module 606 is specifically configured to generate the storage table name of any smart contract according to user input; determine whether the storage table name of the smart contract already exists; if If it does not exist, then obtain the directory resource, start a virtual machine to execute the smart contract, and if the execution is successful, write the code segment information and status information of the smart contract in the directory resource.
  • the device provided in this embodiment can be used to implement the technical solutions of the above method embodiments, and its implementation principle and technical effect are similar, so this embodiment will not repeat them here.
  • FIG. 8 is a schematic diagram of a hardware structure of a service device provided by an embodiment of the present disclosure.
  • the service device 80 of this embodiment includes: a processor 801 and a memory 802;
  • memory 802 for storing computer-executable instructions
  • the processor 801 is configured to execute the computer-executed instructions stored in the memory, so as to realize the various steps executed by the server-side blockchain in the above-mentioned embodiments. For details, refer to the related descriptions in the foregoing method embodiments.
  • the memory 802 can be independent or integrated with the processor 801 .
  • the service-based device further includes a bus 803 for connecting the memory 802 and the processor 801 .
  • An embodiment of the present disclosure also provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the processor executes the computer-executable instructions, the aforementioned blockchain-based intelligence Contract call method.
  • An embodiment of the present disclosure also provides a computer program product, when the computer program is executed by a processor, it implements the blockchain-based smart contract calling method as described above.
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the modules is only a logical function division. In actual implementation, there may be other division methods, for example, multiple modules can be combined or integrated. to another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or modules may be in electrical, mechanical or other forms.
  • modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to implement the solution of this embodiment.
  • each functional module in each embodiment of the present disclosure may be integrated into one processing unit, each module may exist separately physically, or two or more modules may be integrated into one unit.
  • the units formed by the above modules can be implemented in the form of hardware, or in the form of hardware plus software functional units.
  • the above-mentioned integrated modules implemented in the form of software function modules can be stored in a computer-readable storage medium.
  • the above-mentioned software function modules are stored in a storage medium, and include several instructions for enabling a computer device (which may be a personal computer, server, or network device, etc.) or a processor to execute some steps of the methods described in various embodiments of the present disclosure.
  • processor may be a central processing unit (Central Processing Unit, referred to as CPU), and may also be other general-purpose processors, digital signal processors (Digital Signal Processor (DSP for short), Application Specific Integrated Circuit (ASIC for short), etc.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the steps of the method disclosed in conjunction with the invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
  • the storage may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk storage, and may also be a U disk, a mobile hard disk, a read-only memory, a magnetic disk, or an optical disk.
  • NVM non-volatile storage
  • the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI for short) bus or Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA for short) bus, etc.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the buses in the drawings of the present disclosure are not limited to only one bus or one type of bus.
  • the above-mentioned storage medium can be realized by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable In addition to programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM programmable read-only memory
  • ROM read-only memory
  • magnetic memory magnetic memory
  • flash memory magnetic disk or optical disk.
  • a storage media may be any available media that can be accessed by a general purpose or special purpose computer.
  • An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium.
  • the storage medium may also be a component of the processor.
  • Processors and storage media can be located in application-specific integrated circuits (Application Specific Integrated Circuits, referred to as ASIC).
  • ASIC Application Specific Integrated Circuits
  • the processor and the storage medium can also exist in the electronic device or the main control device as discrete components.
  • the aforementioned program can be stored in a computer-readable storage medium.
  • the program executes the steps including the above-mentioned method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Les modes de réalisation de la présente divulgation concernent un procédé, un appareil et un dispositif d'invocation de contrat intelligent à base de chaîne de blocs. Le procédé comprend : la réception d'éléments d'informations de transaction envoyés par un client, chaque élément d'informations de transaction incluant des informations de chemin d'un contrat intelligent, à exécuter, correspondant aux informations de transaction ; l'introduction des éléments d'informations de transaction reçus dans un ordonnanceur de sorte que l'ordonnanceur distribue les éléments d'informations de transaction à différents exécuteurs ; l'interrogation d'une unité de stockage au moyen des exécuteurs et sur la base des informations de chemin des contrats intelligents, à exécuter, correspondant aux éléments d'informations de transaction, de façon à acquérir des contrats intelligents correspondant aux éléments d'informations de transaction, l'unité de stockage incluant des contrats intelligents qui sont stockés selon une structure arborescente de répertoires de fichiers, et le chemin de stockage de chaque contrat intelligent est unique ; et l'exécution des contrats intelligents sur les éléments d'informations de transaction au moyen des exécuteurs de façon à obtenir un résultat d'exécution. Il n'est pas nécessaire que des exécuteurs synchronisent des données de table CNS liées à des contrats intelligents puisqu'une exécution simultanée est réalisée sur une transaction, ce qui améliore l'efficacité d'une chaîne de blocs lorsqu'une exécution simultanée de contrats intelligents est réalisée sur des informations de transaction.
PCT/CN2022/100650 2021-12-07 2022-06-23 Procédé, appareil et dispositif d'invocation de contrat intelligent à base de chaîne de blocs WO2023103341A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111478999.7 2021-12-07
CN202111478999.7A CN113888173B (zh) 2021-12-07 2021-12-07 基于区块链的智能合约调用方法、装置及设备

Publications (1)

Publication Number Publication Date
WO2023103341A1 true WO2023103341A1 (fr) 2023-06-15

Family

ID=79015658

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/100650 WO2023103341A1 (fr) 2021-12-07 2022-06-23 Procédé, appareil et dispositif d'invocation de contrat intelligent à base de chaîne de blocs

Country Status (2)

Country Link
CN (1) CN113888173B (fr)
WO (1) WO2023103341A1 (fr)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113888173B (zh) * 2021-12-07 2022-04-26 深圳前海微众银行股份有限公司 基于区块链的智能合约调用方法、装置及设备
CN114827002B (zh) * 2022-03-17 2023-04-07 西安电子科技大学 多域网络安全路径计算方法、系统、设备、介质及终端

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109271255A (zh) * 2018-09-25 2019-01-25 深圳市元征科技股份有限公司 资源调度方法、系统及电子设备和存储介质
CN110135985A (zh) * 2019-04-04 2019-08-16 杭州抖音科技有限公司 一种区块链上交易的并行执行方法及系统
CN112261156A (zh) * 2020-12-21 2021-01-22 支付宝(杭州)信息技术有限公司 一种提交跨片事务的方法及系统、主链节点和源分片节点
CN113888173A (zh) * 2021-12-07 2022-01-04 深圳前海微众银行股份有限公司 基于区块链的智能合约调用方法、装置及设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107590189B (zh) * 2017-08-10 2020-05-22 深圳先进技术研究院 智能合约执行方法、装置、设备及存储介质
CA3061603A1 (fr) * 2018-11-14 2020-05-14 Royal Bank Of Canada Systeme et methode de stockage des structures de donnees de contrats sur les registres distribues permis
CN112261163B (zh) * 2020-12-21 2021-03-12 支付宝(杭州)信息技术有限公司 一种区块链系统中的状态存储方法及区块链系统、节点
CN112749152A (zh) * 2021-01-19 2021-05-04 矩阵元技术(深圳)有限公司 智能合约的数据迁移方法、装置及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109271255A (zh) * 2018-09-25 2019-01-25 深圳市元征科技股份有限公司 资源调度方法、系统及电子设备和存储介质
CN110135985A (zh) * 2019-04-04 2019-08-16 杭州抖音科技有限公司 一种区块链上交易的并行执行方法及系统
CN112261156A (zh) * 2020-12-21 2021-01-22 支付宝(杭州)信息技术有限公司 一种提交跨片事务的方法及系统、主链节点和源分片节点
CN113888173A (zh) * 2021-12-07 2022-01-04 深圳前海微众银行股份有限公司 基于区块链的智能合约调用方法、装置及设备

Also Published As

Publication number Publication date
CN113888173A (zh) 2022-01-04
CN113888173B (zh) 2022-04-26

Similar Documents

Publication Publication Date Title
WO2020063786A1 (fr) Procédé de sauvegarde de données, support d'enregistrement et dispositif informatique
WO2020063820A1 (fr) Procédé de transaction d'actif, support de stockage et dispositif informatique
WO2020082871A1 (fr) Procédé, dispositif et système d'exécution de transactions de chaîne de blocs en parallèle
TWI727467B (zh) 聯盟鏈的可信度驗證方法、系統、裝置及設備
CN109669709B (zh) 一种区块链升级的数据迁移方法及数据迁移系统
WO2020211483A1 (fr) Procédé et appareil de stockage et d'exécution d'un contrat intelligent dans une chaîne de blocs et dispositif électronique
WO2023103341A1 (fr) Procédé, appareil et dispositif d'invocation de contrat intelligent à base de chaîne de blocs
WO2020220764A1 (fr) Procédé et appareil de compression et de requête de données basés sur une chaîne de blocs et dispositif électronique
US20180089249A1 (en) Remote policy validation for managing distributed system resources
US10454786B2 (en) Multi-party updates to distributed systems
CN109032803B (zh) 数据处理方法和装置、客户端
KR20120037397A (ko) 카탈로그-기반 소프트웨어 컴포넌트 관리
CN110569108B (zh) 小游戏虚拟机执行环境的创建方法及相关产品
CN109614167B (zh) 一种管理插件的方法和系统
US11775507B2 (en) Methods and apparatuses for reading and updating data structures, and electronic devices
WO2022077186A1 (fr) Procédé et appareil d'exécution d'un contrat intelligent dans une chaîne de blocs, et dispositif électronique
US10102230B1 (en) Rate-limiting secondary index creation for an online table
CN111639309B (zh) 一种数据处理方法、装置、节点设备及存储介质
WO2021139431A1 (fr) Procédé et appareil de synchronisation de donnees pour microservice, dispositif électronique et support de stockage
WO2022247316A1 (fr) Système de traitement d'objet de stockage, procédé de traitement de requête, passerelle et support de stockage
WO2022134797A1 (fr) Procédé et appareil de stockage de fragmentation de données, dispositif informatique et support de stockage
WO2023160083A1 (fr) Procédé d'exécution de transactions, blockchain, nœud maître et nœud esclave
CN109145053B (zh) 数据处理方法和装置、客户端、服务器
WO2019153880A1 (fr) Procédé de téléchargement de fichier miroir dans un groupe, nœud et serveur d'interrogation
US20200202355A1 (en) Storage and execution of smart contracts in blockchains

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22902778

Country of ref document: EP

Kind code of ref document: A1