Font Size: a A A

Method And Application Of Blockchain Smart Contract Generation Based On Natural Language Processing

Posted on:2021-05-29Degree:MasterType:Thesis
Country:ChinaCandidate:Z YangFull Text:PDF
GTID:2518306503973979Subject:Software engineering
Abstract/Summary:PDF Full Text Request
In recent years,the emergence and development of blockchain technology has brought great improvements to issues such as authentication and information coordination in the field of supply chain.Relying on the paradigm of the blockchain,the supply chain adopts the form of private chain or alliance chain and gradually moves towards digital intelligence,taking advantage of the natural advantages of blockchain technology credits such as easier circulation,difficult tampering with information on the chain,and transparent transactions.At present,the supply chain contract relies on smart contracts to replace contracts running on the blockchain.There are three main problems:First,the paper contracts signed between participants in the supply chain are heterogeneous,and there is a lack of unified description to generate smart contracts;Second,the key to generating a smart contract for a trade contract is the execution of the contract terms.How to translate contract terms into executable code of smart contracts poses a challenge to supply chain.Finally,the generation of smart contracts mainly address credit problems encountered by multiple parties in the trading activities.How to generate smart contracts automatically from the trade contract,and how to use execution logic of transactions on smart contract to avoid the "double spend" of financing in trade financing due to repeated pledges or bill forgery are the challenges that the current blockchain application faces in the field of supply chain.In view of the above problems,a method is proposed for generating smart contracts in blockchains based on Natural Language Processing(NLP)in this paper.This method generates contract metadata by using keyword extraction algorithms and template concept matching methods based on contracts in the field of supply chain;and this method generates structured clauses of contracts based on dependency syntax analysis combined with a domain rule dictionary;finally,this method uses contract ontology to generate executable code of smart contracts by contract metadata and structured clauses of contracts,and designs smart contract calling methods in the process of executing trade contracts which is applied to financing detection,combined with trade transaction execution logic.The main research contents of this paper are as follows:(1)A method framework for generating smart contracts based on NLP is proposedA NLP-based smart contract generation method framework is proposed in this paper,which contains a layer where contract metadata are generated,a layer where clauses are to be structured,and a layer where smart contracts are generated.The three layers achieved the goal of the generation of contract metadata and the construction of the contract ontology,the generation of structured terms of contracts,and the generation of smart contracts respectively.(2)A method of generation of the contract metadata based on feature keyword extraction is proposed.A method for constructing contract metadata based on feature keyword extraction is proposed in this paper.First,the text is preprocessed based on natural language processing.Then,a TF-IDF method is proposed based on feature indicators is used to extract the feature keywords of contract text.And then combine with HowNet to match the templets with the extracted feature keywords,based on template matching concept hierarchy matching algorithm.(3)A method of structuring contract terms based on dependency syntax analysis is Proposed.This paper takes an contract in the domain for instance.The metadata is used to match the contract.The contract terms are separated,and a contract clause is used as a unit to generate a syntactic dependency tree by using dependent syntactic analysis.Classify the rules by adopting domain rules dictionary method.Generate structured contract terms by the syntactic dependency tree and rule matching.(4)A smart contract generation method based on ontology mapping and trade transaction execution logic is proposed.This method constructs a smart contract description model,builds a smart contract structure data model,and constructs a smart contract ontology;then a mapping algorithm is designed and realized between contract ontology and domain ontology,and smart contracts was generated by importing contract structured data according to the smart contract ontology to realize the instantiation of the smart contract ontology.Finally,clause enforcement logic and bill detection methods are designed and the smart contract methods are generated according to the trade transaction execution logic.(5)A smart contract generation prototype system is built.Based on the method framework proposed in this paper,a smart contract generation prototype system is constructed.Taking the field of trade finance as the background,verify the availability of the method by establishing smart contract generation prototype system for trade contracts.This paper implements the verification of smart contracts through the currently widely used enterprise alliance chain platform called Hyperledger Fabric.
Keywords/Search Tags:Smart Contract, NLP, Feature Extraction, Dependency Syntax Analysis, Ontology Mapping
PDF Full Text Request
Related items