CN113486114B - Block chain intelligent contract calling management method - Google Patents

Block chain intelligent contract calling management method Download PDF

Info

Publication number
CN113486114B
CN113486114B CN202110735633.7A CN202110735633A CN113486114B CN 113486114 B CN113486114 B CN 113486114B CN 202110735633 A CN202110735633 A CN 202110735633A CN 113486114 B CN113486114 B CN 113486114B
Authority
CN
China
Prior art keywords
contract
calling
service
control
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110735633.7A
Other languages
Chinese (zh)
Other versions
CN113486114A (en
Inventor
夏琦
高建彬
王嘉唯
宋炜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN202110735633.7A priority Critical patent/CN113486114B/en
Publication of CN113486114A publication Critical patent/CN113486114A/en
Application granted granted Critical
Publication of CN113486114B publication Critical patent/CN113486114B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Abstract

The invention provides a block chain intelligent contract calling management method, which comprises the following steps: 1) Creating a service contract and a control contract; the business contract is written into the block and simultaneously registered in the control contract; 2) Eliminating redundant calling: the control contract is set to periodically execute redundancy check at the time of creation, and the check is based on a control contract mapping table maintained in the contract; the control contract retrieves that a nested calling interface exists in the service contract; the control contract pushes the redundant calling information to a service contract; the service contract receives the redundant calling information, modifies the interface calling and the corresponding context, and sends the calling interface and the version number to the control contract; and the control contract updates the contract mapping table according to the received calling interface and the version number. The invention can coordinate and standardize the management of a plurality of intelligent contracts and eliminate potential safety hazards in contract calling under the scenes that data services and participants are complex and a plurality of intelligent contracts are called.

Description

Block chain intelligent contract calling management method
Technical Field
The invention relates to a block chain technology, in particular to a block chain intelligent contract technology.
Background
The blockchain technology is a brand new distributed infrastructure and computing paradigm that utilizes blockchain data structures to verify and store data, utilizes distributed node consensus algorithms to generate and update data, cryptographically secures data transmission and access, and utilizes intelligent contracts composed of automated script code to program and manipulate data. In a block chain system, transaction data generated by each participating main body is packed into a data block after a period of time, the data blocks are sequentially arranged according to a time sequence to form a chain of the data blocks, each participating main body has the same data chain and cannot be tampered unilaterally, any information can be modified only by a main body agreeing party in an agreed proportion, new information can be added, and old information cannot be deleted or modified, so that information sharing and consistent decision among multiple main bodies are realized, and the identity of each main body and the transaction information among the main bodies are guaranteed to be not tampered, and transparent.
The intelligent contract is a computer transaction protocol which does not need an intermediary, is self-verified and automatically executes contract terms, is concerned with the increasing popularization of a block chain technology in recent years, has the characteristics of decentralization, distrust, programmability, non-falsification and the like, can be flexibly embedded with various data and assets, helps to realize safe and efficient information exchange, value transfer and asset management, is expected to deeply change the traditional business model and social production relationship, and lays a foundation for constructing programmable assets, systems and society.
Generally, an intelligent contract execution engine is a very Virtual Machine (EVM) and a JAVA Virtual Machine (JVM), which are respectively used for intelligent contract development in the Solidity and JAVA languages. The EVM may perform any encoding of complex algorithms, and the accounts on the etherhouse may be divided into external accounts (EOAs) controlled by private keys and contract accounts controlled by contract codes; in the JVM environment, however, smart contracts are called abstractly in the form of interfaces.
Traditionally, the service content of an intelligent contract mainly relates to the financial industry and related services thereof, such as asset management, fund raising and dispersion, auction, product transaction and the like, and the function of the intelligent contract for processing the financial related services on a block chain is highlighted to a great extent. However, the application to smart contracts is not limited to this. In the face of increasingly complex and variable scenes and services on a block chain, how to deal with data and information contained in the scenes and services is urgent, and especially in some specific scenes, an intelligent contract is required to deal with and automatically process the information, and the intelligent contract with the functions such as the above needs to be further developed.
In a block chain scene with more complex data services and more complex participants, a plurality of intelligent contracts are often required to be called, a set of multi-intelligent contracts are formed on a chain to coordinate with each other, a cooperation mechanism of the data services is promoted in an ordered and standardized manner, and the high-efficiency safe execution of each service process and the reasonable implementation of rights and interests of each participant on the chain are ensured by combining the existing consensus mechanism. Therefore, in the process of mutual cooperation calling among a plurality of intelligent contract services, a block chain intelligent contract calling management scheme is lacked, so that the problems of potential safety hazards caused by intelligent contract iteration upgrading and redundant calling among contracts are solved.
Disclosure of Invention
The invention aims to provide a management method for coordinating and standardizing a plurality of intelligent contracts under the scene that a block chain relates to a plurality of intelligent contract calls.
The technical scheme adopted by the invention for solving the technical problems is that the intelligent contract calling management method of the block chain comprises the following steps:
1) Contract creation step
1-1) establishing a service contract, wherein the service contract is used for supporting the execution flow of related data services on a chain and allowing the service contract to have a calling relationship with each other;
1-2) creating a control contract, wherein the control contract is used for maintaining a contract mapping table and recording the addresses, external interfaces, calling interfaces and version numbers of all service contracts;
1-3) the business contract is written into the block and simultaneously the register operation is carried out on the control contract;
2) Eliminating redundant Call Steps
2-1) the control contract is set to periodically execute redundancy check at the time of creation, and the check is based on a control contract mapping table maintained in the contract;
2-2) the control contract retrieves that a nested calling interface exists in the service contract, and the calling mode has the same effect as that of directly calling an inner layer interface and cannot influence the execution of service logic, and then the condition that the service contract has redundant calling is judged; the control contract pushes the redundant calling information to a service contract;
2-3) the service contract receives the redundant calling information, modifies the interface calling and the corresponding context, and sends the calling interface and the version number to the control contract;
2-4) the control contract updates the contract mapping table according to the received calling interface and the version number.
Further comprising 3) an updating step:
3-1) when the interface of the business contract is changed or the interface is deleted, the business contract sends change information to the control contract;
3-2) controlling the contract to update the interface information of the service contract in the contract mapping table, and pushing the updated interface information of the service contract to other service contracts to be updated due to the iteration of the service contract;
3-3) updating corresponding interface information of other service contracts which receive the push message, and sending the updated contract information to a control contract;
3-4) controlling the contract to update the contract information of the other service contracts in the contract mapping table.
The invention has the advantages that under the scene that the data service and the participators are complex and a plurality of intelligent contracts are called, the management of a plurality of intelligent contracts is coordinated and standardized, the potential safety hidden danger in the contract calling is eliminated, and the smooth execution of the service on the chain is ensured.
Drawings
FIG. 1 is a diagram of a contract creation architecture of the present invention.
FIG. 2 is a flow chart of a method for eliminating redundant calls according to an embodiment of the present invention.
FIG. 3 is a flow chart of an update mechanism of an embodiment of the present invention.
Detailed description of the preferred embodiments
The invention is explained in detail and the technical scheme of the invention is clearly described according to the attached drawings and the embodiment. The examples chosen herein are intended to be illustrative of the invention and are not intended to be limiting.
A block chain intelligent contract calling management scheme is characterized in that a virtual machine execution engine of an event is a JAVA virtual machine, the virtual machine receives a contract file in a JAR form and deploys the contract file on a block chain platform, the contract file is loaded through a self-defined class loader, a contract instance is initialized, and a client can call an intelligent contract in an interface form.
As shown in fig. 1, an embodiment of the present invention provides a block chain intelligent contract invocation management model, which includes the following steps:
s1: the intelligent contract of P type is stored on the block chain, can be created by any node, the contract instance has definite address and corresponding variable, method, the type of contract is responsible for executing relevant business process.
S2: the contracts M are generated by code creation after all P-type contracts are determined. The essence of the contract M is to maintain a mapping table of the service contract and its related information, including contract name, address, external interface, calling interface, version number, etc. The contract M can record the relevant information of the contract P and update the information in real time, and can eliminate redundant calls existing among a plurality of service contracts.
As shown in fig. 2, when the solution needs to eliminate the redundant call, the following steps are performed:
s1: the contracts M make redundant call checks on the contracts recorded in the mapping table. For example, redundant call checks are made on contract P1: p1 calls an external interface a of P2, P2 calls an external interface b of P3, and the context in interface a does not influence the execution of the service, so that the contract P1 is judged to have redundant calling.
S2: the contract M pushes redundant call hint information P2.A, P3.B to the contract P1.
S3: and the P1 changes the interface call P2.A in the contract into P3.b according to the redundant call prompt information [ P2.A and P3.b ], and correspondingly matches the context thereof, and updates the contract version number from 1.0 to 1.1.
S4: the contract P1 pushes the current version information and the related interface information to the contract M, i.e. version number 1.1, and the calling interface is changed from P2.A to P3.B.
S5: and updating the calling interface and version number information of the entry where the P1 is located in the mapping table by the contract M according to the push information.
As shown in fig. 3, when the contract P in the scheme is updated, the following steps are performed:
s1: when the service requirement changes, the corresponding contract P needs to be iteratively upgraded. For example, contract P1 deletes interface fun1 in one iteration update.
S2: the contract P1 pushes the current version information and the relevant interface information to the contract M, namely the version number 1.1, and the external interface information deletes fun1 on the original basis.
S3: and updating the external interface and version number information of the entry where the P1 is located in the mapping table according to the push information by the contract M.
S4: the contract M checks whether the contract to be updated exists according to the mapping table and pushes information to the contract to be updated. Due to the deletion of the P1.Fun1 interface, the related contract called to the fun1 interface also needs to be iterated, the contract P3 needs to be iterated after the examination, and then the message < P1.Fun1, delete > is pushed to the P3.
S5: and the P3 correspondingly updates the interface call P1.Fun1 and the context thereof in the contract according to the push message < P1.Fun1, delete >, and the contract version number is updated from 1.1 to 1.2.
S6: the contract P3 pushes the current version information and the relevant interface information to the contract M, namely the version number 1.2, and the fun1 is deleted on the original basis by calling the interface information.
S7: and updating the calling interface and version number information of the entry where the P3 is located in the mapping table according to the push information by the contract M.

Claims (2)

1. The intelligent contract calling management method for the block chain is characterized by comprising the following steps
1) Contract creation step
1-1) establishing a service contract, wherein the service contract is used for supporting the execution flow of related data services on a chain and allowing the service contract to have a calling relationship with each other;
1-2) creating a control contract, wherein the control contract is used for maintaining a contract mapping table and recording the addresses, external interfaces, calling interfaces and version numbers of all service contracts;
1-3) the business contract is written into the block and simultaneously the register operation is carried out on the control contract;
2) Eliminating redundant Call Steps
2-1) the control contract is set to periodically execute redundancy check at the time of creation, and the check is based on a control contract mapping table maintained in the contract;
2-2) the control contract retrieves that a nested calling interface exists in the service contract, and the calling mode has the same effect as that of directly calling an inner layer interface and cannot influence the execution of service logic, and then the condition that the service contract has redundant calling is judged; the control contract pushes the redundant calling information to a service contract;
2-3) the service contract receives the redundant calling information, modifies the interface calling and the corresponding context, and sends the calling interface and the version number to the control contract;
2-4) the control contract updates the contract mapping table according to the received calling interface and the version number.
2. The method of claim 1, further comprising 3) the updating step of:
3-1) when the interface of the service contract is changed or the interface is deleted, the service contract sends change information to the control contract;
3-2) controlling the contract to update the interface information of the service contract in the contract mapping table, and pushing the updated interface information of the service contract to other service contracts to be updated due to the iteration of the service contract;
3-3) updating corresponding interface information of other service contracts which receive the push message, and sending the updated contract information to a control contract;
3-4) controlling the contract to update the contract information of the other service contracts in the contract mapping table.
CN202110735633.7A 2021-06-30 2021-06-30 Block chain intelligent contract calling management method Active CN113486114B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110735633.7A CN113486114B (en) 2021-06-30 2021-06-30 Block chain intelligent contract calling management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110735633.7A CN113486114B (en) 2021-06-30 2021-06-30 Block chain intelligent contract calling management method

Publications (2)

Publication Number Publication Date
CN113486114A CN113486114A (en) 2021-10-08
CN113486114B true CN113486114B (en) 2023-03-28

Family

ID=77937041

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110735633.7A Active CN113486114B (en) 2021-06-30 2021-06-30 Block chain intelligent contract calling management method

Country Status (1)

Country Link
CN (1) CN113486114B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114490874A (en) * 2022-01-25 2022-05-13 鼎链数字科技(厦门)有限公司 Block chain intelligent contract calling management method
CN117172913B (en) * 2023-10-12 2024-02-13 广州保德来小额贷款有限公司 Intelligent contract-based contract change procedure execution method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020018777A (en) * 2000-09-04 2002-03-09 박대희 An incremental updating data mining method for pattern classification
CN109977638A (en) * 2019-02-22 2019-07-05 亦非云互联网技术(上海)有限公司 Intelligent contract update method and system, storage medium and terminal based on ether mill
CN111159301A (en) * 2019-12-31 2020-05-15 中国银行股份有限公司 Data creating method, device, equipment and storage medium based on intelligent contract
CN111966994A (en) * 2020-07-08 2020-11-20 厦门达辰美网络科技有限公司 Block chain authentication method, system and storage medium based on database
CN112400182A (en) * 2020-10-12 2021-02-23 北京和联共识科技有限公司 Method and device for executing intelligent contracts in block chain and electronic equipment
CN112514345A (en) * 2018-03-29 2021-03-16 Dlt全球公司 Renewable intelligent contract
CN112597762A (en) * 2020-12-04 2021-04-02 广东省科学院智能制造研究所 Block chain system with intelligent contract data supervision function and supervision method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020018777A (en) * 2000-09-04 2002-03-09 박대희 An incremental updating data mining method for pattern classification
CN112514345A (en) * 2018-03-29 2021-03-16 Dlt全球公司 Renewable intelligent contract
CN109977638A (en) * 2019-02-22 2019-07-05 亦非云互联网技术(上海)有限公司 Intelligent contract update method and system, storage medium and terminal based on ether mill
CN111159301A (en) * 2019-12-31 2020-05-15 中国银行股份有限公司 Data creating method, device, equipment and storage medium based on intelligent contract
CN111966994A (en) * 2020-07-08 2020-11-20 厦门达辰美网络科技有限公司 Block chain authentication method, system and storage medium based on database
CN112400182A (en) * 2020-10-12 2021-02-23 北京和联共识科技有限公司 Method and device for executing intelligent contracts in block chain and electronic equipment
CN112597762A (en) * 2020-12-04 2021-04-02 广东省科学院智能制造研究所 Block chain system with intelligent contract data supervision function and supervision method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈瑶.基于区块链的智慧城市资源共享系统的研究与实现.《中国优秀硕士学位论文全文数据库 工程科技II辑》.2021,C038-842. *

Also Published As

Publication number Publication date
CN113486114A (en) 2021-10-08

Similar Documents

Publication Publication Date Title
CN110597925B (en) Cross-chain data processing method and device based on block chain
Wöhrer et al. Design patterns for smart contracts in the ethereum ecosystem
CN106681739B (en) Automatic intelligent contract generation method
CN113486114B (en) Block chain intelligent contract calling management method
CN111681017B (en) Goods batch true checking method and device based on block chain and electronic equipment
US11748752B2 (en) Modular, configurable smart contracts for blockchain transaction processing validations
EP1300757A1 (en) Shareable installation hierarchies
CN109547488B (en) Credible data computing and exchanging system based on alliance block chain
CA3152588A1 (en) Pruning entries in tamper-evident data stores
CN112214802B (en) Block chain intelligent contract message publishing and subscribing method
CN111429995B (en) Vaccine tracing method and system based on alliance chain
CN112306645B (en) Transaction processing method, device, equipment and medium for Ether house virtual machine
CN110930152B (en) Data processing method based on block chain and related equipment
CN110297721B (en) Cross-contract calling method of intelligent contract based on JAVA
CN110032568B (en) Data structure reading and updating method and device, and electronic equipment
CN111143476A (en) Intelligent contract data rapid query method based on database
US7437708B2 (en) Enhanced software components
CN111429250A (en) Data management method and device in escort scene
Xu et al. Model-driven engineering for blockchain applications
CN111813836A (en) Method for improving Ethereum block chain system expansibility
CN116645061A (en) Customs clearance data processing method based on block chain system and consensus node
CN112163024B (en) Configuration information export and import method based on hierarchical association structure
CN115221559A (en) Data account access authorization method and device
CN115203747A (en) Data account creation method and device
CN113987574A (en) Block chain private transaction method, device, equipment and readable 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