CN113486114A - Block chain intelligent contract calling management method - Google Patents
Block chain intelligent contract calling management method Download PDFInfo
- Publication number
- CN113486114A CN113486114A CN202110735633.7A CN202110735633A CN113486114A CN 113486114 A CN113486114 A CN 113486114A CN 202110735633 A CN202110735633 A CN 202110735633A CN 113486114 A CN113486114 A CN 113486114A
- 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.)
- Granted
Links
Images
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/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- 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
- 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/25—Integrating or interfacing systems involving database management systems
- G06F16/252—Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4482—Procedural
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Fuzzy Systems (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Computational Linguistics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
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 hidden dangers in contract calling under the conditions that data service and participants are complex and a plurality of intelligent contracts are called.
Description
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 every 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 modification can be performed only by a main body agreeing party with an agreed proportion, new information can only 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 are 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, the smart contract execution engine is commonly an Ethernet Virtual Machine (EVM) and a JAVA Virtual Machine (JVM), which are respectively used for smart contract development in the identity and JAVA languages. The EVM may perform any complex algorithmic encoding, and the accounts on the ethernet house 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 collection and distribution, auction, product transaction and the like, which greatly highlights the role of the intelligent contract for processing the financial related services on a block chain. 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 condition that a blockchain relates to a plurality of intelligent contract calls.
The technical scheme adopted by the invention for solving the technical problems is that the block chain intelligent contract calling management method 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 registration 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 for contract P1: p1 calls the external interface a of P2, P2 calls the external interface b of P3, and the context in interface a does not influence the execution of the service, then the judgment is made that the contract P1 has a redundant call.
S2: contract M pushes redundant call hints [ P2.a, P3.b ] to 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, P3.b ] and correspondingly matches the context thereof, and the contract version number is updated 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 changes from P2.a to P3.b.
S5: and the contract M updates the calling interface and version number information of the entry where the P1 is located in the mapping table 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 related interface information to the contract M, i.e., version number 1.1, and the external interface information deletes fun1 on the original basis.
S3: and the contract M updates the external interface and version number information of the entry where the P1 is located in the mapping table according to the push information.
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 is checked and found to need to be iterated, and then the message < P1.fun1, delete > is pushed to P3.
S5: and the P3 correspondingly updates the interface call P1.fun1 in the contract and the context thereof 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, i.e. version number 1.2, and the call interface information deletes fun1 on the original basis.
S7: and the contract M updates the calling interface and version number information of the entry where the P3 is located in the mapping table according to the push information.
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 registration 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 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.
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 true CN113486114A (en) | 2021-10-08 |
CN113486114B 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) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114490874A (en) * | 2022-01-25 | 2022-05-13 | 鼎链数字科技(厦门)有限公司 | Block chain intelligent contract calling management method |
CN117172913A (en) * | 2023-10-12 | 2023-12-05 | 广州保德来小额贷款有限公司 | Intelligent contract-based contract change procedure execution method and system |
Citations (7)
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 |
-
2021
- 2021-06-30 CN CN202110735633.7A patent/CN113486114B/en active Active
Patent Citations (7)
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)
Title |
---|
陈瑶: "基于区块链的智慧城市资源共享系统的研究与实现" * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114490874A (en) * | 2022-01-25 | 2022-05-13 | 鼎链数字科技(厦门)有限公司 | Block chain intelligent contract calling management method |
CN117172913A (en) * | 2023-10-12 | 2023-12-05 | 广州保德来小额贷款有限公司 | Intelligent contract-based contract change procedure execution method and system |
CN117172913B (en) * | 2023-10-12 | 2024-02-13 | 广州保德来小额贷款有限公司 | Intelligent contract-based contract change procedure execution method and system |
Also Published As
Publication number | Publication date |
---|---|
CN113486114B (en) | 2023-03-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111681017B (en) | Goods batch true checking method and device based on block chain and electronic equipment | |
CN110032599B (en) | Data structure reading and updating method and device, and electronic equipment | |
US11748752B2 (en) | Modular, configurable smart contracts for blockchain transaction processing validations | |
CN113486114B (en) | Block chain intelligent contract calling management method | |
EP1300757A1 (en) | Shareable installation hierarchies | |
CN109493072B (en) | Privacy contract protection method based on alliance block chain | |
CN108958714A (en) | Business component type development method and device, computer equipment and storage medium | |
CN112835612A (en) | Electronic document version management method and device based on block chain | |
CN112214802B (en) | Block chain intelligent contract message publishing and subscribing method | |
CN110032568B (en) | Data structure reading and updating method and device, and electronic equipment | |
CN111143476A (en) | Intelligent contract data rapid query method based on database | |
CN110930152B (en) | Data processing method based on block chain and related equipment | |
CN109885612B (en) | Synchronous validation method and device for intelligent contracts of block chains | |
CN111429250A (en) | Data management method and device in escort scene | |
CN113849191B (en) | Intelligent contract deployment method, system, device and storage medium | |
CN111813836A (en) | Method for improving Ethereum block chain system expansibility | |
CN111552989A (en) | Service data processing method, device, equipment and storage medium based on block chain | |
CN114978686B (en) | Digital asset chaining method and device | |
CN112163024B (en) | Configuration information export and import method based on hierarchical association structure | |
CN115203747A (en) | Data account creation method and device | |
CN114398376A (en) | Data processing method and device and readable storage medium | |
NL2029245B1 (en) | Method and a system for cross-ecological identification of digital product based on blockchain, and medium | |
CN114840604A (en) | Data storage method, device, equipment and storage medium based on block chain network | |
WO2024037117A1 (en) | Blockchain-based data processing method and device, medium, and program product | |
CN117592755A (en) | Supply chain digital control system based on micro-point code block chain technology |
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 |