Method for automatically deploying block chain network based on intelligent contracts

文档序号:1521871 发布日期:2020-02-11 浏览:16次 中文

阅读说明:本技术 一种基于智能合约自动化部署区块链网络的方法 (Method for automatically deploying block chain network based on intelligent contracts ) 是由 张震宇 陈刚 林勇 王思涵 于 2019-09-18 设计创作,主要内容包括:本发明公开了一种基于智能合约自动化部署区块链网络的方法,将用户划分为普通账户与审核账户,实现部署需求的权限化;同时每个账户都有自己的一对公私钥,普通账户在提交部署需求申请时,用自己的私钥对申请信息进行签名,审核账户根据要求对部署需求的申请结果进行签名;系统智能合约根据审核账户的审核结果自动判定部署需求是否合法,若合法,则启动对应的部署程序,根据部署申请中的模板化信息启动对应的节点,最后会将部署结果写入系统区块链,并将对应的成功或失败的信息推送给相关的部署人员,完成区块链系统的自动化部署。本发明利用智能合约技术实现区块链网络的自动化部署流程,可消除差错,极大地提高部署效率。(The invention discloses a method for automatically deploying a block chain network based on an intelligent contract, which divides a user into a common account and an audit account to realize the permission of deployment requirements; meanwhile, each account has a pair of public and private keys, when a common account submits a deployment requirement application, the private key of the common account is used for signing the application information, and the audit account signs the application result of the deployment requirement according to the requirement; and the system intelligent contract automatically judges whether the deployment requirement is legal or not according to the auditing result of the auditing account, if so, a corresponding deployment program is started, a corresponding node is started according to the templated information in the deployment application, finally, the deployment result is written into the system block chain, and the corresponding success or failure information is pushed to related deployment personnel to complete the automatic deployment of the block chain system. The invention realizes the automatic deployment process of the block chain network by using the intelligent contract technology, can eliminate errors and greatly improves the deployment efficiency.)

1. A method for automatically deploying a block chain network based on an intelligent contract is characterized by comprising the following steps: the method comprises the steps that a user is divided into a common account and an auditing account, so that the permission of deployment requirements is realized; meanwhile, each account has a pair of public and private keys, and the public keys are stored in a system block chain, so that the property of non-tampering is ensured; when the common account submits the deployment requirement application, the application information is signed by using a private key of the common account, so that the reliability of the application information is ensured; the auditing account signs the application result of the deployment requirement according to the requirement, so that the specialty and the uniqueness of auditing are ensured, and the possibility of unauthorized deployment is avoided; and the system intelligent contract automatically judges whether the deployment requirement is legal or not according to the auditing result of the auditing account, if so, a corresponding deployment program is started, a corresponding node is started according to the templated information in the deployment application, finally, the deployment result is written into the system block chain, and the corresponding success or failure information is pushed to related deployment personnel to complete the automatic deployment of the block chain system.

2. The method for automatically deploying a blockchain network based on intelligent contracts according to claim 1, wherein the method comprises the following steps: the specific implementation steps are as follows:

the method comprises the following steps: building deployment management platform

Servers are divided into two major types: the system comprises a system server and a business server, wherein the business server is used for deploying all corresponding block chain networks, and the system server is used for deploying a management platform and managing all the business servers at the later stage;

step two: adding audit accounts and common accounts

Classifying users: the system comprises a common account and an audit account, wherein the common account has the authority of deploying the block chain system, and the audit account has the authority of auditing the common account application deployment system; the control of the process is realized through the cooperation of the two authorities;

step three: deploying system intelligence contracts

The intelligent contract is a section of automatically executed logic code, the execution logic of the intelligent contract only needs to accord with a pre-designed rule and can be automatically executed without human intervention, and meanwhile, the execution result of the intelligent contract stores required information in a block chain account book through consensus; installing a system intelligent contract on the management platform, wherein the main content of the system intelligent contract is to execute due verification, and after the verification is passed, the deployment of the block chain network is realized according to the requirement; meanwhile, all execution requests and results are stored in the account book, so that full tracing of the deployment process can be realized at the later stage, and a more convenient and faster tracing function is provided for operation and maintenance;

step four: common user proposes deployment requirement application

If an ordinary user needs to deploy the block chain network, the ordinary user cannot directly deploy the block chain network on the service server through the deployment platform due to the authority management criteria, basic information such as the deployment requirement and the purpose of the ordinary user needs to be submitted to the management system platform, and an auditor absolutely supports or allows the deployment;

when a common user submits the deployment requirement application, the deployment information needs to be signed by using an own private key stored in an offline environment, and the signature information is attached to the requirement application and submitted together;

step five: auditor auditing deployment application

The auditor receives the deployment requirement application information proposed by the common user, and starts to audit the application information, and the main flow is as follows:

1) according to the applicant in the application information, a public key of the applicant is retrieved from the system block chain, the signature of the deployment information is verified, if the verification fails, the possibility of applying for disguising exists, and the deployment requirement is directly rejected; if the verification is successful, executing the step 2);

2) analyzing the deployment template information to obtain a corresponding deployment requirement; confirming whether the server information in the deployment requirement can meet the deployment requirement at this time, if not, rejecting the deployment requirement, otherwise, confirming the deployment requirement at this time, and checking to pass;

3) the auditor signs the audit result by using the own private key, continues to attach to the application requirement information and submits the application requirement information to the system block chain;

the auditor finishes the application and audit of the deployment requirement, and the accuracy of the information and the possibility of later deployment are fully ensured;

step six: system intelligent contract automation deployment network

After receiving the auditing result submitted by the auditor, the system intelligent contract begins to analyze the result and executes corresponding actions:

1) obtaining public key information of an auditor from the block chain system, checking whether signature information of the auditor is correct, if the signature information is wrong, indicating that the audit is not the audit result of the auditor, directly abandoning the requirement, and directly writing the result into the block chain, wherein the state is marked as an 'illegal request'; if the verification is correct, executing the second step;

2) checking the auditing result, if the result is rejected, not starting a deployment process, directly writing the result into a block chain, and marking the state as 'rejected deployment'; if the data are unified, executing a third step;

3) analyzing the deployment template information one by one, acquiring corresponding service server access passwords, remotely starting corresponding block chain nodes one by one according to the types of the deployment nodes, and finally completing networking of all the nodes to realize deployment of a block chain network; if all the nodes are deployed successfully, writing the result into the block chain, marking the state as 'deployment successful', and turning to the fifth step; if the deployment fails due to network and other reasons, directly increasing 1 by the deployment frequency recorder of the node, and executing the fourth step;

4) firstly, checking a deployment recorder of the node, if the deployment recorder reaches an upper limit value prefabricated in a system intelligent contract, judging that deployment fails, writing a result into a block chain, marking a state as 'deployment failure', and turning to the fifth step; if the network connectivity does not reach the upper limit value, starting to detect the network connectivity, turning to the third step after the network is recovered, and trying again;

5) the deployment management platform monitors the account information of the system block chain, analyzes the corresponding deployment result information in the block after the deployment result of the deployment request is accounted, and pushes the information to the corresponding common user, so that an actual deployer can obtain the corresponding deployment result.

3. The method for automatically deploying a blockchain network based on intelligent contracts according to claim 2, wherein the method comprises the following steps: and automatically judging the application and verification result by adopting an intelligent contract and automatically deploying a block chain for a legal request, wherein the process comprises four steps of application, verification, automatic verification and automatic deployment.

Technical Field

The invention relates to the field of block chain network deployment, in particular to a method for automatically deploying a block chain network based on an intelligent contract.

Background

The block chain technology has acquired more time, stably operates in various production systems, and provides more convenient and efficient support for services. With the development of the technology, the later block chain technology will be more widely applied. However, the technology of the block chain is complex, and relates to the aspects of cryptography, distributed networks, container technology, intelligent contracts and the like, the number of talents who know the stack is still relatively small, and the lack of talents forms a great challenge for the operation and maintenance work of the block chain system. Therefore, an operation and maintenance method is needed to simplify the deployment and maintenance of the block chain.

Meanwhile, due to the distributed characteristic of the block chain, cross-department or cross-organization deployment becomes a normal state, in this scene, the authority problem is particularly important, and each department needs a certain auditing process during deployment so as to avoid irreversible damage to the whole block chain network caused by operation of a single department or a single node.

That is, before deploying the blockchain network, different deployment departments need to submit deployment applications to managers or auditors of the platform.

Disclosure of Invention

When the large-scale multi-platform cross-department blockchain network nodes are deployed, more interference factors exist in manual intervention, the invention aims to provide a method for automatically deploying blockchain networks based on intelligent contracts, the automatic deployment process of the blockchain networks is realized by using the intelligent contract technology, errors can be eliminated, and the deployment efficiency is greatly improved.

The purpose of the invention is realized by the following technical scheme:

a method for automatically deploying a block chain network based on an intelligent contract is characterized by comprising the following steps: the method comprises the steps that a user is divided into a common account and an auditing account, so that the permission of deployment requirements is realized; meanwhile, each account has a pair of public and private keys, and the public keys are stored in a system block chain, so that the property of non-tampering is ensured; when the common account submits the deployment requirement application, the application information is signed by using a private key of the common account, so that the reliability of the application information is ensured; the auditing account signs the application result of the deployment requirement according to the requirement, so that the specialty and the uniqueness of auditing are ensured, and the possibility of unauthorized deployment is avoided; and the system intelligent contract automatically judges whether the deployment requirement is legal or not according to the auditing result of the auditing account, if so, a corresponding deployment program is started, a corresponding node is started according to the templated information in the deployment application, finally, the deployment result is written into the system block chain, and the corresponding success or failure information is pushed to related deployment personnel to complete the automatic deployment of the block chain system.

The method comprises the following specific implementation steps:

the method comprises the following steps: building deployment management platform

Servers are divided into two major types: the system comprises a system server and a business server, wherein the business server is used for deploying all corresponding block chain networks, and the system server is used for deploying a management platform and managing all the business servers at the later stage;

step two: adding audit accounts and common accounts

Classifying users: the system comprises a common account and an audit account, wherein the common account has the authority of deploying the block chain system, and the audit account has the authority of auditing the common account application deployment system; the control of the process is realized through the cooperation of the two authorities;

step three: deploying system intelligence contracts

The intelligent contract is a section of automatically executed logic code, the execution logic of the intelligent contract only needs to accord with a pre-designed rule and can be automatically executed without human intervention, and meanwhile, the execution result of the intelligent contract stores required information in a block chain account book through consensus; installing a system intelligent contract on the management platform, wherein the main content of the system intelligent contract is to execute due verification, and after the verification is passed, the deployment of the block chain network is realized according to the requirement; meanwhile, all execution requests and results are stored in the account book, so that full tracing of the deployment process can be realized at the later stage, and a more convenient and faster tracing function is provided for operation and maintenance;

step four: common user proposes deployment requirement application

If an ordinary user needs to deploy the block chain network, the ordinary user cannot directly deploy the block chain network on the service server through the deployment platform due to the authority management criteria, basic information such as the deployment requirement and the purpose of the ordinary user needs to be submitted to the management system platform, and an auditor absolutely supports or allows the deployment;

when a common user submits the deployment requirement application, the deployment information needs to be signed by using an own private key stored in an offline environment, and the signature information is attached to the requirement application and submitted together;

step five: auditor auditing deployment application

The auditor receives the deployment requirement application information proposed by the common user, and starts to audit the application information, and the main flow is as follows:

1) according to the applicant in the application information, a public key of the applicant is retrieved from the system block chain, the signature of the deployment information is verified, if the verification fails, the possibility of applying for disguising exists, and the deployment requirement is directly rejected; if the verification is successful, executing the step 2);

2) analyzing the deployment template information to obtain a corresponding deployment requirement; confirming whether the server information in the deployment requirement can meet the deployment requirement at this time, if not, rejecting the deployment requirement, otherwise, confirming the deployment requirement at this time, and checking to pass;

3) the auditor signs the audit result by using the own private key, continues to attach to the application requirement information and submits the application requirement information to the system block chain;

the auditor finishes the application and audit of the deployment requirement, and the accuracy of the information and the possibility of later deployment are fully ensured;

step six: system intelligent contract automation deployment network

After receiving the auditing result submitted by the auditor, the system intelligent contract begins to analyze the result and executes corresponding actions:

1) obtaining public key information of an auditor from the block chain system, checking whether signature information of the auditor is correct, if the signature information is wrong, indicating that the audit is not the audit result of the auditor, directly abandoning the requirement, and directly writing the result into the block chain, wherein the state is marked as an 'illegal request'; if the verification is correct, executing the second step;

2) checking the auditing result, if the result is rejected, not starting a deployment process, directly writing the result into a block chain, and marking the state as 'rejected deployment'; if the data are unified, executing a third step;

3) analyzing the deployment template information one by one, acquiring corresponding service server access passwords, remotely starting corresponding block chain nodes one by one according to the types of the deployment nodes, and finally completing networking of all the nodes to realize deployment of a block chain network; if all the nodes are deployed successfully, writing the result into the block chain, marking the state as 'deployment successful', and turning to the fifth step; if the deployment fails due to network and other reasons, directly increasing 1 by the deployment frequency recorder of the node, and executing the fourth step;

4) firstly, checking a deployment recorder of the node, if the deployment recorder reaches an upper limit value prefabricated in a system intelligent contract, judging that deployment fails, writing a result into a block chain, marking a state as 'deployment failure', and turning to the fifth step; if the network connectivity does not reach the upper limit value, starting to detect the network connectivity, turning to the third step after the network is recovered, and trying again;

5) the deployment management platform monitors the account information of the system block chain, analyzes the corresponding deployment result information in the block after the deployment result of the deployment request is accounted, and pushes the information to the corresponding common user, so that an actual deployer can obtain the corresponding deployment result.

And automatically judging the application and verification result by adopting an intelligent contract and automatically deploying a block chain for a legal request, wherein the process comprises four steps of application, verification, automatic verification and automatic deployment.

When the large-scale multi-platform trans-department block chain network nodes are deployed, manual intervention has more interference factors, the automatic deployment process of the block chain network is realized by using an intelligent contract technology, public and private key encryption is adopted for signature, and the result is verified by using an intelligent contract, so that an auditor finishes the application and audit of the deployment requirement, and the accuracy of information and the possibility of later deployment are fully ensured; errors can be eliminated, and the deployment efficiency is greatly improved.

Drawings

FIG. 1 is a flow chart of an embodiment.

Detailed Description

In order to more clearly illustrate the technical solution of the present invention, the drawings required to be used in the embodiments will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.

A method for automatically deploying a block chain network based on an intelligent contract is characterized in that public and private key encryption is adopted for signature, and the result is verified in validity by the intelligent contract. Firstly, dividing a user into a common account and an audit account to realize the permission of deployment requirements; meanwhile, each account has a pair of public and private keys, and the public keys are stored in a system block chain, so that the property of non-tampering is ensured; when the common account submits the deployment requirement application, the application information is signed by using a private key of the common account, so that the reliability of the application information is ensured; the auditing account signs the application result of the deployment requirement according to the requirement, so that the specialty and the uniqueness of auditing are ensured, and the possibility of unauthorized deployment is avoided; and the system intelligent contract automatically judges whether the deployment requirement is legal or not according to the auditing result of the auditing account, if so, a corresponding deployment program is started, a corresponding node is started according to the templated information in the deployment application, finally, the deployment result is written into the system block chain, and the corresponding success or failure information is pushed to related deployment personnel to complete the automatic deployment of the block chain system.

FIG. 1 is a flow chart of an embodiment. The specific implementation steps are as follows:

the method comprises the following steps: building deployment management platform

Initializing a service server of x86_64 type, installing docker and docker-compound basic software, and operating all the services in the manner of docker in the later period. Servers are divided into two major types: the system server and the business server, wherein the user server is used for deploying all corresponding blockchain networks, and the system server is used for deploying the management platform and managing all the business servers at the later stage.

And loading the component mirror image of the block chain network to be deployed in the later stage on the service server to form a basic condition. And later, a corresponding container is constructed on the service server directly based on the images, so that the executable program is executed to process the service request. Meanwhile, a management platform is installed on the system server, the management platform is also a block chain system with an intelligent contract function, and the intelligent contract is realized by a high-level language and has the capability of accessing a network. In order to distinguish the intelligent contract running on the business server, the intelligent contract becomes a system intelligent contract. The system intelligent contract can realize the automatic deployment of the block chain system in the later period.

Step two: adding audit accounts and common accounts

In order to ensure the safe and stable operation of the system, users need to be classified: the system comprises a common account and an audit account, wherein the common account has the permission to deploy the block chain system, and the audit account has the permission to audit the common account applying for deploying the system. The flow is controllable through the cooperation of the two authorities.

Besides basic information such as user name, account level, adding time and the like, the account information is added with the information of the user public key, namely, each account is provided with a unique public and private key. When a user is added to the management platform, the corresponding public key needs to be carried to the platform and stored in the account book of the system block chain platform, and the private key is kept in an offline environment by the user, so that the absolute security of the account is ensured. The later-stage system platform performs signature verification on all requests by using the public keys stored in the system block chain account book, so that the correctness of all requests is guaranteed from the aspect of mathematic verifiability, and illegal behaviors such as deployment request forgery and tampering are avoided.

Step three: deploying system intelligence contracts

The intelligent contract is a section of automatically executed logic code, the execution logic of the intelligent contract only needs to accord with the pre-designed rule and can be automatically executed without human intervention, and meanwhile, the execution result of the intelligent contract stores the required information in the block chain account book through consensus. The intelligent contract of the system is installed on the management platform, the main content of the intelligent contract is to execute due verification, and after the verification is passed, the deployment of the block chain network is realized according to the requirement. Meanwhile, all execution requests and results are stored in the account book, so that full tracing of the deployment process can be realized in the later stage, and a more convenient and faster tracing function is provided for operation and maintenance.

Step four: common user proposes deployment requirement application

If the common user needs to deploy the block chain network, the common user cannot directly deploy the block chain network on the service server through the deployment platform due to the authority management criteria, and basic information such as the deployment requirement and the purpose of the common user needs to be submitted to the management system platform, so that whether the deployment is supported or allowed by an auditor is absolutely required.

The requirements application will template the deployment information, i.e. fill in part of the mandatory fields, including: the method comprises the following steps of deployment type, the number of deployment nodes, service server addresses corresponding to the nodes and access passwords of the service servers. When a common user submits the deployment requirement application, the deployment information needs to be signed by using the own private key stored in the offline environment, and the signed information is attached to the requirement application and submitted together.

Step five: auditor auditing deployment application

The auditor receives the deployment requirement application information proposed by the common user, and starts to audit the application information, and the main flow is as follows:

1) according to the applicant in the application information, a public key of the applicant is retrieved from the system block chain, the signature of the deployment information is verified, if the verification fails, the possibility of applying for disguising exists, and the deployment requirement is directly rejected; if the verification is successful, the second step is executed.

2) And analyzing the deployment template information to obtain the corresponding deployment requirement. And confirming whether the server information in the deployment requirement can meet the deployment requirement, if not, rejecting the deployment requirement, otherwise, confirming the deployment requirement and checking to pass.

3) And the auditor signs the audit result by using the own private key, continues to attach the audit result to the application requirement information and submits the application requirement information to the system block chain.

Through the three steps of processes, the auditor finishes the application and audit of the deployment requirement, and the accuracy of the information and the possibility of later deployment are fully ensured.

Step six: system intelligent contract automation deployment network

After receiving the auditing result submitted by the auditor, the system intelligent contract begins to analyze the result and executes corresponding actions:

1) obtaining public key information of an auditor from the block chain system, checking whether signature information of the auditor is correct, if the signature information is wrong, indicating that the audit is not the audit result of the auditor, directly abandoning the requirement, and directly writing the result into the block chain, wherein the state is marked as an 'illegal request'; if the verification is correct, executing the second step;

2) checking the auditing result, if the result is rejected, not starting a deployment process, directly writing the result into a block chain, and marking the state as 'rejected deployment'; if the data are unified, executing a third step;

3) analyzing the deployment template information one by one, acquiring corresponding service server access passwords, remotely starting corresponding block chain nodes one by one according to the types of the deployment nodes, and finally completing networking of all the nodes to realize deployment of a block chain network; if all the nodes are deployed successfully, writing the result into the block chain, marking the state as 'deployment successful', and turning to the fifth step; if the deployment fails due to network and other reasons, directly increasing 1 by the deployment frequency recorder of the node, and executing the fourth step;

4) firstly, checking a deployment recorder of the node, if the deployment recorder reaches an upper limit value (prefabricated in a system intelligent contract), judging that deployment fails, writing a result into a block chain, marking a state as 'deployment failure', and turning to a fifth step; if the network connectivity does not reach the upper limit value, starting to detect the network connectivity, turning to the third step after the network is recovered, and trying again;

5) the deployment management platform monitors the account information of the system block chain, analyzes the corresponding deployment result information in the block after the deployment result of the deployment request is accounted, and pushes the information to the corresponding common user, so that an actual deployer can obtain the corresponding deployment result.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于区块链的监控视频数据交易方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!