CN113312429B - Intelligent contract management system, method, medium, and article in a blockchain - Google Patents

Intelligent contract management system, method, medium, and article in a blockchain Download PDF

Info

Publication number
CN113312429B
CN113312429B CN202110694661.9A CN202110694661A CN113312429B CN 113312429 B CN113312429 B CN 113312429B CN 202110694661 A CN202110694661 A CN 202110694661A CN 113312429 B CN113312429 B CN 113312429B
Authority
CN
China
Prior art keywords
intelligent contract
container
virtual machine
module
controller module
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
CN202110694661.9A
Other languages
Chinese (zh)
Other versions
CN113312429A (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.)
Industrial and Commercial Bank of China Ltd ICBC
ICBC Technology Co Ltd
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
ICBC Technology Co Ltd
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 Industrial and Commercial Bank of China Ltd ICBC, ICBC Technology Co Ltd filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110694661.9A priority Critical patent/CN113312429B/en
Publication of CN113312429A publication Critical patent/CN113312429A/en
Application granted granted Critical
Publication of CN113312429B publication Critical patent/CN113312429B/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
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)

Abstract

The utility model provides an intelligent contract management system in block chain belongs to block chain technical field. The intelligent contract management system in the blockchain comprises a Kubernets-based container controller module, and the Kubernets-based container controller module is used for realizing the creation, operation, closing or removal of intelligent contract containers by using a Kubernets platform. By means of the management system, the operation and maintenance and management capacity of the intelligent contract container in the block chain network can be improved, and the usability and the availability of the intelligent contract container in a cluster environment are optimized. The present disclosure also provides a method, medium, and article of intelligent contract management in a blockchain.

Description

Intelligent contract management system, method, medium, and article in a blockchain
Technical Field
The present disclosure relates to the field of blockchain technology. And in particular to an intelligent contract management system, method, medium, and article of manufacture in a blockchain.
Background
Before explaining the present disclosure, terms well known in the art are explained as follows:
container (Container): the container is a light-weight virtualization technology, and compared with the traditional virtual machine technology, the container has the advantages of being light in weight, convenient to transplant, high in performance, expandable and the like.
Docker: docker is a tool for creating containers, and is an engine for container management.
Mirror Image (Image): the Docker image is a special file system that contains configuration parameters (e.g., environment variables) prepared for the container runtime in addition to the files of programs, libraries, resources, configuration, etc. required by the container runtime.
Kubernetes (K8S): kubernetes is a powerful container scheduling management platform and one of the best micro-service operating environments at present, and gives more value to Docker: the system can be scheduled, arranged, managed and expanded; the resource utilization rate of the cluster can be greatly improved through the Kubernetes management container and the bottom layer resources; the blockchain service deployed on the cloud in the alliance chain scene can be operated in a container mode by using Kubernets, and convenient management is achieved.
Hyperhedger Fabric (hyper ledger): hyperLegridge Fabric is the most popular open source blockchain project in the industry at present, is one of the most used blockchain bottom layers in the national alliance chain scene, is an open source enterprise-level blockchain solution, and has a highly modular and configurable architecture.
In Hyperledger Fabric, chain code (Chaincode) is also called an intelligent contract, and the intelligent contract of Hyperledger Fabric supports general mainstream language writing and is used as a virtualized container sandbox in a Docker mode to run on a host in an isolated manner. With the popularization of container technology and the large-scale application of distributed clusters, hyperhedger Fabric cannot be well integrated into a mainstream distributed container management platform based on a Docker deployment and operation mode. With the expansion of services and the upgrade of versions, more and more intelligent contract containers cannot be effectively recovered and distributed in different servers of a cluster after the life cycle is finished, so that the difficulty of managing the containers by the cluster is increased, and the waste of resources is also caused.
Disclosure of Invention
In order to solve the problem of difficult contract management caused by the fact that a Fabric intelligent contract container in the prior art cannot be adapted to the existing Kubernets cluster environment, the disclosure provides an intelligent contract management system, a method, a medium and a product in a block chain, which are used for improving the operation, maintenance and management capacity of the intelligent contract container in a block chain network and optimizing the usability and availability of the intelligent contract container in the cluster environment.
According to a first aspect of the present disclosure, there is provided an intelligent contract management system in a blockchain, the management system comprising a Kubernetes-based container controller module, wherein:
the Kubernetes-based container controller module is used for realizing an operation method of an intelligent contract container by using a Kubernetes platform.
According to an embodiment of the present disclosure, the kubernets-based container controller module includes a Provider module and a kubernets-based virtual machine, wherein:
the Provider module is used for creating a virtual machine based on Kubernetes;
the virtual machine based on Kubernetes is used for realizing the operation method of the intelligent contract container.
According to an embodiment of the present disclosure, the method for operating the intelligent contract container includes: creation, operation, closing or removal of an intelligent contract container.
According to an embodiment of the present disclosure, the kubernets-based container controller module is further to:
and the access to the Kubernets API is encapsulated through a k8s.io/client-go package provided by a Kubernets platform, so that the Kubernets can be called.
According to an embodiment of the present disclosure, the creating an intelligent contract specifically includes:
and calling a Kubernetes-based virtual machine to create an intelligent contract, newly adding a related certificate file for the intelligent contract, and starting the intelligent contract.
According to the embodiment of the disclosure, the invoking of a Kubernetes-based virtual machine to create an intelligent contract, adding a new related certificate file to the intelligent contract, and starting the intelligent contract specifically includes:
generating a mirror image file, adding a new certificate file for the intelligent contract, updating the certificate file to the mirror image file, creating a mirror image, calling a Kubernets-based virtual machine to create the intelligent contract, and calling the Kubernets to operate an intelligent contract container.
According to the embodiment of the present disclosure, the invoking a virtual machine based on Kubernetes to create an intelligent contract, adding a new related certificate file to the intelligent contract, and starting the intelligent contract further includes:
adding the Node Name Kube _ Node _ Name of the starting host machine into the Node environment variable to set the starting position of the intelligent contract.
According to the embodiment of the present disclosure, the invoking a virtual machine based on Kubernetes to create an intelligent contract, adding a new related certificate file to the intelligent contract, and starting the intelligent contract further includes:
and adding a name parameter Kube _ Namespace of the currently located Namespace into the node environment variable, so that the intelligent contract container is added into the grouping of the block chain network, and the centralized and unified management of the contract container is facilitated.
According to an embodiment of the present disclosure, the management system further comprises a Docker-based container controller module, wherein:
the container controller module based on the Docker is used for calling a registered Docker virtual machine to realize an operation method of the intelligent contract container, and the operation method of the intelligent contract container comprises the creation, the running, the closing or the removal of the intelligent contract container.
According to the embodiment of the disclosure, the container controller module based on the Docker is further used for encapsulating access to the Docker API through a go-Docker package, so as to realize call to the Docker.
According to an embodiment of the present disclosure, the management system further comprises a virtual machine controller module, wherein:
the virtual machine controller module is used for selecting and calling the Kubernetes-based container controller module or the Docker-based container controller module according to a judgment condition.
According to an embodiment of the present disclosure, the selectively invoking the kubernets-based container controller module or the Docker-based container controller module according to a determination condition specifically includes:
when the virtual machine controller module judges that Kubernetes intelligent contract configuration is started, calling the Kubernetes-based container controller module;
and when the virtual machine controller module judges that Kubernetes intelligent contract configuration is not started, calling the container controller module based on Docker.
According to the embodiment of the disclosure, the virtual machine controller module judges whether Kubernets intelligent contract configuration is started or not by setting a conditional configuration parameter Kube _ Enable, and then selects to call the Kubernets-based container controller module or the Docker-based container controller module.
According to an embodiment of the present disclosure, when it is judged that the Kube _ Enable = true, determining to call the Kubernetes-based container controller module;
when the Kube _ Enable = false is judged, determining to call the Docker-based container controller module.
According to an embodiment of the present disclosure, the management system further includes: intelligent contract support module, intelligent contract operation support module, handle management module, platform support module, wherein:
the intelligent contract support module is used for processing the related requests and parameters of the intelligent contracts and is an entrance of the intelligent contract operation;
the intelligent contract operation support module comprises a Launcher module and a Container module, wherein the Launcher module is used for providing registration of an intelligent contract and is an entrance for creating and deploying the intelligent contract; the Container module is used as an inlet of a Container and/or a virtual machine operation and is responsible for interaction with the virtual machine controller module;
the handle management module is used for managing the starting state of each intelligent contract and the communication handle;
the platform support module is an intelligent contract writing language platform support module, realizes the creation and packaging of an intelligent contract image file, and is convenient for the execution of the virtual machine controller module.
A second aspect of the present disclosure provides an intelligent contract management method in a blockchain, the management method including the steps of:
the Kubernetes-based container controller module realizes an operation method of an intelligent contract container by using a Kubernetes platform.
According to an embodiment of the present disclosure, the method for operating the intelligent contract container includes: creation, operation, closing or removal of an intelligent contract container.
According to the embodiment of the disclosure, the operation method for realizing the intelligent contract container by using the Kubernetes platform specifically comprises the following steps:
the Kubernetes-based container controller module invokes a Kubernetes-based virtual machine to create, run, close, or remove smart contracts.
According to an embodiment of the present disclosure, the kubernets-based virtual machine is created by a Provider module in the kubernets-based container controller module.
According to an embodiment of the present disclosure, the method further comprises:
the virtual machine based on the Kubernetes encapsulates access to the Kubernetes API through a k8s.io/client-go package provided by a Kubernetes platform, and calling of the Kubernetes is achieved.
According to the embodiment of the disclosure, the invoking of the kubernets-based virtual machine to create the intelligent contract specifically includes:
and calling the virtual machine based on the Kubernetes to create an intelligent contract, newly adding a related certificate file for the intelligent contract, and starting the intelligent contract.
According to the embodiment of the disclosure, the invoking of a Kubernetes-based virtual machine to create an intelligent contract, adding a new related certificate file to the intelligent contract, and starting the intelligent contract specifically includes:
generating an image file, adding a new certificate file for the intelligent contract, updating the certificate file to the image file, creating an image, calling a Kubernetes-based virtual machine to create the intelligent contract, and calling the Kubernetes to operate an intelligent contract container.
According to the embodiment of the present disclosure, the invoking a virtual machine based on Kubernetes to create an intelligent contract, adding a new related certificate file to the intelligent contract, and starting the intelligent contract further includes:
and adding the Node Name Kube _ Node _ Name of the starting host machine into the Node environment variable to set the starting position of the intelligent contract.
According to the embodiment of the present disclosure, the invoking a virtual machine based on Kubernetes to create an intelligent contract, adding a new related certificate file to the intelligent contract, and starting the intelligent contract further includes:
and adding a name parameter Kube _ Namespace of the currently located Namespace into the node environment variable, so that the intelligent contract container is added into the grouping of the block chain network, and the centralized and unified management of the contract container is facilitated.
According to an embodiment of the present disclosure, the method further comprises:
and when the virtual machine controller module judges that the Kubernetes intelligent contract configuration is started, the Kubernetes-based container controller module realizes the operation method of the intelligent contract container by using a Kubernetes platform.
According to an embodiment of the present disclosure, the method further comprises:
when the virtual machine controller module judges that the Kubernets intelligent contract configuration is not started, the Docker-based container controller module calls a registered Docker virtual machine to realize an operation method of an intelligent contract container, a Docker file is generated through a platform forms module, and an intelligent contract mirror image dependency package is created, wherein the operation method of the intelligent contract container comprises the steps of creating, running, closing or removing the intelligent contract container.
According to the embodiment of the disclosure, the virtual machine controller module judges whether Kubernets intelligent contract configuration is started or not by setting a condition configuration parameter Kube _ Enable = true or false, and then selects to call the Kubernets-based container controller module or the Docker-based container controller module.
According to an embodiment of the present disclosure, when it is judged that the Kube _ Enable = true, determining to call the Kubernetes-based container controller module;
when the Kube _ Enable = false is judged, determining to call the Docker-based container controller module.
According to an embodiment of the present disclosure, the method further comprises:
receiving an intelligent contract deployment or execution request sent by a client;
the intelligent contract support module processes the request according to the type of the request, checks whether an intelligent contract communication handle exists in the handle management module, and enters the intelligent contract operation support module to create an intelligent contract and update the communication handle if the intelligent contract communication handle does not exist in the handle management module;
the Launcher module in the intelligent contract operation support module checks the operation state of the intelligent contract, if the intelligent contract operates, the intelligent contract state is returned to update the intelligent contract communication handle, and the process is finished; if the intelligent contract is not operated, entering a Container module in the intelligent contract operation support module to start the intelligent contract;
and a Container module in the intelligent contract operation support module acquires relevant configuration parameters of the intelligent contract, assembles an intelligent contract starting request and calls a virtual machine controller module.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the above-described method for intelligent contract management in a blockchain.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-mentioned one method of intelligent contract management in a blockchain.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements an intelligent contract management method in a blockchain as described above.
Compared with the prior art, the intelligent contract management system, the intelligent contract management method, the intelligent contract management medium and the intelligent contract management product in the block chain can transform an original Fabric intelligent contract module by means of the Kubernets platform, control the management of the Kubernets intelligent contract container through parameter configuration, realize the management function of the intelligent contract on the Kubernets platform, improve the operation and maintenance and management capacity of the intelligent contract container in the block chain network, and optimize the usability and availability of the intelligent contract container in a cluster environment.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following description of embodiments of the disclosure, which proceeds with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates a system architecture diagram of a blockchain network suitable for use in embodiments of the present disclosure;
FIG. 2 is a block diagram schematically illustrating an overall architecture of an intelligent contract management system in a blockchain in the prior art;
FIG. 3 is a flow diagram schematically illustrating a prior art method for an intelligent contract management system in a blockchain;
FIG. 4 schematically illustrates a block diagram of a Kubernets-based container controller module, in accordance with an embodiment of the present disclosure;
FIG. 5 schematically illustrates an overall architecture block diagram of an intelligent contract management system in a blockchain according to an embodiment of the present disclosure;
FIG. 6 schematically illustrates a flow diagram of a method for an intelligent contract management system in a blockchain according to an embodiment of the present disclosure;
fig. 7 schematically illustrates a block diagram of an electronic device adapted to implement an intelligent contract management system method in a blockchain according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that these descriptions are illustrative only and are not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "A, B and at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include, but not be limited to, systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Embodiments of the present disclosure provide a system, method, medium, and article of intelligent contract management in a blockchain. The management system comprises a Kubernets-based container controller module, the Kubernets-based container controller module is a core module for intelligent contract deployment and operation, and is used for realizing an operation method of an intelligent contract container by using a Kubernets platform, and the operation method of the intelligent contract container comprises creation, operation, closing or removal of the intelligent contract container. The Kubernetes-based container controller module is also used for packaging access to the Kubernetes API through a k8s.io/client-go package provided by a Kubernetes platform, and calling of the Kubernetes is achieved. The Kubernetes-based container controller module comprises a Provider module and a Kubernetes-based virtual machine (namely KubeVM), wherein: the Provider module is used for creating a virtual machine based on Kubernetes; the virtual machine based on the Kubernetes is used for creating, running, closing or removing intelligent contracts, and packages access to the Kubernetes API through a k8s.
Compared with the prior art, the intelligent contract management system, the intelligent contract management method, the intelligent contract management medium and the intelligent contract management product in the block chain can transform an original Fabric intelligent contract module by means of the Kubernets platform, control the management of the Kubernets intelligent contract container through parameter configuration, realize the management function of the intelligent contract on the Kubernets platform, improve the operation and maintenance and management capacity of the intelligent contract container in the block chain network, and optimize the usability and availability of the intelligent contract container in a cluster environment.
Fig. 1 schematically shows a system architecture of a blockchain network in the prior art suitable for use in embodiments of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 101 of the blockchain network includes a blockchain link point 1011, a blockchain link point 1012, a blockchain link point 1013, a blockchain link point 1014, and a blockchain network 103. The blockchain network 103 is used to provide a medium for communication links between a plurality of blockchain nodes. The blockchain network 103 may include various connection types such as wired, wireless communication links, or fiber optic cables, among others.
It should be understood that the number of nodes in the system architecture of the blockchain network deployed in fig. 1 is merely illustrative. There may be any number of blockchain nodes, as desired for implementation.
A system, method, medium, and article of manufacture for intelligent contract management in blockchains according to embodiments of the present disclosure are described in detail below with reference to fig. 2-7 based on the network architecture scenario described in fig. 1.
Fig. 2 schematically shows an overall architecture of an intelligent contract management system 200 in a blockchain in the prior art, and the overall architecture comprises the following modules:
the intelligent contract support module 201, namely a chaincodesipport module, is used for processing related requests and parameters of intelligent contracts, is an entrance for intelligent contract operation, and provides methods such as launchers, executes, invoke and the like;
the intelligent contract operation support module 202, namely a Runtime module, mainly includes two modules, namely a Launcher module and a Container module, the Launcher module is used for providing registration of intelligent contracts and is an entrance for intelligent contract creation and deployment; the Container module is used as an inlet of a Container and/or a virtual machine operation and is responsible for interaction with the lower VMController module;
the virtual machine controller module 203, i.e. the VMController module, may create different virtual machine modules according to the parameter types, and provide common intelligent contract operation entries such as start, pause, and the like;
the container controller module 204 based on a Docker, that is, a Docker controller module, is a core module of intelligent contract deployment and operation, and is configured to invoke a registered Docker virtual machine to implement an operation method of an intelligent contract container, where the operation method of the intelligent contract container includes creation, operation, closing, or removal of the intelligent contract container. The container controller module based on the Docker encapsulates access to the Docker API through a go-Docker package, and calling of the Docker is achieved;
the handle management module 205, namely a HandlerManager module, is responsible for the management of the starting state and the communication handle of each intelligent contract;
the platform support module 206, i.e. platform modules, is an intelligent contract authoring language platform support module, and implements creation and packaging of an intelligent contract image file, so as to facilitate execution of the container controller module. At present, three common languages of golang, node and java are realized.
Docker module 207: docker is a tool for creating containers, and is an engine for container management.
Based on the overall architecture of the intelligent contract management system in the blockchain in the prior art in fig. 2, fig. 3 schematically illustrates the overall process of the intelligent contract management method in the blockchain in the prior art, where the overall process includes operations S301 to S306, which are as follows:
in operation 301, receiving an intelligent contract deployment or execution request sent by a client;
in operation 302, the intelligent contract support module (i.e. chaincodessurt module) processes the request according to the type of the request, checks whether an intelligent contract communication handle exists in the handle management module (i.e. HandlerManager module), and if the intelligent contract communication handle does not exist in the handle management module, the intelligent contract operation support module (i.e. Runtime module) is entered to create an intelligent contract and update the communication handle;
in operation 303, a Launcher module in the intelligent contract running support module (i.e., runtime module) checks the running state of the intelligent contract, if the intelligent contract runs, the state of the intelligent contract is returned to update the intelligent contract communication handle, and the process is finished; if the intelligent contract is not operated, entering a Container module in the Runtime module to start the intelligent contract;
in operation 304, a Container module in the intelligent contract running support module (i.e., runtime module) acquires relevant configuration parameters of the intelligent contract, assembles the configuration parameters to generate an intelligent contract starting request, and invokes a virtual machine controller module (i.e., VMController module);
in operation 305, the virtual machine controller module (i.e., VMController module) calls a Docker virtual machine (i.e., docker VM) registered in the Docker-based container controller module (i.e., docker controller module) according to the relevant configuration parameters of the intelligent contract, and simultaneously generates a Docker file and creates an intelligent contract image dependent package through the Platforms module;
in operation 306, an intelligent contract is created based on a Docker virtual machine in a Docker container controller module (i.e., docker controller module), a relevant certificate file is newly added to the intelligent contract, and the intelligent contract is started to complete the intelligent contract starting process. Specifically, in the Docker mode, the starting process of the intelligent contract is as follows: generating an image file and creating an image, creating an intelligent contract, updating a certificate file of the intelligent contract into a container, and operating an intelligent contract container.
It can be seen from the above-mentioned overall process of creating, starting, and deploying an intelligent contract in the prior art that the core operations such as creating, starting, deploying, and stopping an intelligent contract are all implemented by a Docker virtual machine in a Docker controller module, an interface standard of a virtual machine VM is defined in a VMController, and a plug-in virtual machine can be implemented by using the interface standard, which makes it possible to implement core operations such as creating, starting, deploying, and stopping an intelligent contract based on another framework or a management platform.
In view of the powerful functions of kubernets, the management capability of the intelligent contract container can be improved by newly building a set of kubernets-based container controller module (i.e., kubeController module), which includes a kubernets-based virtual machine (i.e., kubeVM) 401 for managing the intelligent contract and a Provider module 402 for creating a kubernets-based virtual machine, see fig. 4, instead of the DockerController module and the Provider module and Docker virtual machine included therein in the prior art.
Fig. 5 schematically illustrates an intelligent contract management system 500 in a blockchain according to an embodiment of the present disclosure, where the management system includes a kubernets-based container controller module (i.e., kubeController module) 501.
The Kubernetes-based container controller module 501 is a core module for deploying and operating intelligent contracts, and is used for implementing an operation method of an intelligent contract container by using a Kubernetes platform, wherein the operation method of the intelligent contract container comprises creation, operation, closing or removal of the intelligent contract container. The Kubernetes-based container controller module is also used for packaging access to the Kubernetes API through a k8s.io/client-go package provided by a Kubernetes platform, and calling of the Kubernetes is achieved.
The kubernets-based container controller module 501 includes a Provider module 5011 and a kubernets-based virtual machine (i.e., kubeVM) 5012, wherein:
the Provider module 5011 is used for creating a virtual machine 5012 based on Kubernetes;
the virtual machine 5012 based on the kubernets is used for realizing an operation method of an intelligent contract container, the operation method of the intelligent contract container comprises the steps of creating, running, closing or removing an intelligent contract, and the access to the kubernets API is packaged through a k8s.io/client-go package provided by a kubernets platform, so that the call to the kubernets is realized.
The creating of the intelligent contract specifically comprises the following steps: and calling a virtual machine 5012 based on Kubernetes to create an intelligent contract, newly adding a related certificate file for the intelligent contract, and starting the intelligent contract.
Further, the Provider module 5011 and the kubernets-based virtual machine 5012 are registered in advance in the virtual machine controller module 503.
Because the Docker itself can be used as an infrastructure of a Kubernets cluster environment, the Kubecontroller can be directly reused in the flows of mirror image creation and the like related to the conventional Docker, thereby reducing the transformation difficulty.
However, in the aspect of embedding a certificate, an original Docker mode in the prior art is different from a kubernets mode, and a starting process of an intelligent contract in the Docker mode is as follows: generating an image file and creating an image, creating an intelligent contract, updating a certificate file of the intelligent contract into a container, and operating an intelligent contract container. However, the updating of the container cannot be performed in the kubernets mode, so that the certificate files need to be packaged into the mirror image together at first and then directly run, the adjusted process in the kubernets mode, that is, the virtual machine 5012 based on the kubernets is called to create the intelligent contract, the related certificate file is newly added to the intelligent contract, and the intelligent contract is started, which specifically includes: generating an image file, adding a new certificate file for the intelligent contract, updating the certificate file to the image file, creating an image, calling a Kubernetes-based virtual machine to create the intelligent contract, and calling the Kubernetes to operate an intelligent contract container.
Meanwhile, the mirror image is only created locally, and the mirror images of other machines cannot be acquired in the cluster environment, so the Node Name Kube _ Node _ Name of the starting host is added into the Node environment variable and is used for setting the starting position of the intelligent contract. Therefore, the invoking of the virtual machine 5012 based on kubernets to create an intelligent contract, adding a new related certificate file to the intelligent contract, and starting the intelligent contract further includes: adding the Node Name Kube _ Node _ Name of the starting host machine into the Node environment variable to set the starting position of the intelligent contract.
In addition, in kubernets, all nodes in a set of blockchain networks may be grouped into a set of centralized management in a namespace manner, so that the invoking of the virtual machine 5012 based on kubernets creates an intelligent contract, adds a new related certificate file to the intelligent contract, and starts the intelligent contract, further including: and adding a name parameter Kube _ Namespace of the currently located Namespace into the node environment variable, so that the intelligent contract container is added into the grouping of the block chain network, and the centralized and unified management of the contract container is facilitated.
Further, the management system further includes:
a container controller module (i.e., a Docker controller module) 502 based on Docker is a core module of the intelligent contract deployment and operation, and is configured to invoke a registered Docker virtual machine to implement an operation method of an intelligent contract container, where the operation method of the intelligent contract container includes creation, operation, closing, or removal of the intelligent contract container. The container controller module based on the Docker is also used for packaging access to the Docker API through a go-Docker live package and realizing call to the Docker.
The Docker-based container controller module 502 includes a Provider module 5021 and a Docker virtual machine (i.e., docker vm) 5022, wherein:
the Provider module 5021 is used for creating a Docker virtual machine 5022;
the Docker virtual machine 5022 is used for realizing an operation method of an intelligent contract container, the operation method of the intelligent contract container comprises the steps of creating, running, closing or removing an intelligent contract, and the access to a Docker API is packaged through a go-dockerclient package, so that the call to the Docker is realized.
Further, the creating of the intelligent contract specifically includes: and calling a Docker virtual machine to create an intelligent contract, newly adding a related certificate file for the intelligent contract, and starting the intelligent contract.
Further, the management system further includes: a virtual machine controller module (i.e., VMController module) 503, configured to select and invoke the kubernets-based container controller module 501 or the Docker-based container controller module 502 according to a determination condition.
The selecting and calling the Kubernetes-based container controller module 501 or the Docker-based container controller module 502 according to the determination condition specifically includes:
when the virtual machine controller module 503 determines that kubernets intelligent contract configuration has been opened, the kubernets-based container controller module 501 is invoked.
The selecting and calling the Kubernetes-based container controller module 501 or the Docker-based container controller module 502 according to the determination condition further includes:
when the virtual machine controller module 503 judges that kubernets intelligent contract configuration is not started, the container controller module 502 based on Docker is called, a Dockerfile file is generated through a platform forms module, and an intelligent contract mirror image dependency package is created.
Further, the selecting and calling the Kubernetes-based container controller module 501 or the Docker-based container controller module 502 according to the determination condition specifically includes:
the virtual machine controller module 503 determines to invoke the Kubernetes-based container controller module 501 or the Docker-based container controller module 502 by setting a conditional configuration parameter Kube _ Enable = true or false. Specifically, when it is determined that the Kube _ Enable = true, it is determined that the kubernets-based container controller module 501 is invoked to perform kubernets intelligent contract configuration; when the Kube _ Enable = false is judged, it is determined to invoke the Docker-based container controller module 502 for Docker intelligent contract configuration.
Further, the management system further includes: an intelligent contract support module 504, an intelligent contract running support module 505, a handle management module 506, and a platform support module 507, wherein:
the intelligent contract support module 504, namely a chaincodesipport module, is used for processing related requests and parameters of intelligent contracts, is an entrance for intelligent contract operation, and provides methods such as launchers, executes, invoke and the like;
the intelligent contract operation support module 505, namely a Runtime module, includes two modules, namely a Launcher module and a Container module, the Launcher module is used for providing registration of an intelligent contract and is an entrance for creation and deployment of the intelligent contract; the Container module is used as an entrance of Container and/or virtual machine operation and is responsible for interaction with the virtual machine controller module 503;
the handle management module 506, namely a handler manager module, is responsible for managing the starting state of each intelligent contract and the communication handle;
the platform support module 507, i.e. platform modules, is an intelligent contract authoring language platform support module, and implements creation and packaging of an intelligent contract image file, so as to facilitate execution of the virtual machine controller module. At present, three common languages of golang, node and java are realized.
Docker module 508, docker is a tool to create containers, an engine for container management.
Kubernets module 509, kubernets is a powerful container scheduling management platform, and is one of the best micro service operating environments at present, and it gives more value to Docker: the system can be scheduled, arranged, managed and expanded; the resource utilization rate of the cluster can be greatly improved through the Kubernetes management container and the bottom layer resources; in a alliance chain scenario, a blockchain service deployed on a cloud can be operated in a container mode by using Kubernets, and convenient management is achieved.
Based on the overall architecture in fig. 4 and 5, fig. 6 schematically illustrates an intelligent contract management method in a blockchain provided by an embodiment of the present disclosure, where the method includes the following operations:
at operation 606, a kubernets-based container controller module implements a method of operating an intelligent contract container using a kubernets platform. The operation method of the intelligent contract container comprises the creation, the running, the closing or the removal of the intelligent contract container.
Further, the method for implementing the operation of the intelligent contract container by using the kubernets platform specifically includes: the Kubernetes-based container controller module invokes a Kubernetes-based virtual machine to create, run, close, or remove smart contracts.
Wherein the Kubernetes-based virtual machine is created by a Provider module in the Kubernetes-based container controller module.
Further, the method further comprises: and the virtual machine based on the Kubernets encapsulates the access to the Kubernets API through a k8s.io/client-go package provided by the Kubernets platform, so as to realize the call to the Kubernets.
Further, the invoking of the kubernets-based virtual machine to create the intelligent contract specifically includes: and calling a virtual machine based on Kubernetes to create an intelligent contract, newly adding a related certificate file for the intelligent contract, and starting the intelligent contract.
Because the Docker itself can be used as an infrastructure of a Kubernets cluster environment, the Kubecontroller can be directly reused in the flows of mirror image creation and the like related to the conventional Docker, thereby reducing the transformation difficulty.
However, in the aspect of embedding a certificate, an original Docker mode in the prior art is different from a kubernets mode, and a starting process of the intelligent contract in the Docker mode is as follows: generating an image file and creating an image, creating an intelligent contract, updating a certificate file of the intelligent contract into a container, and operating an intelligent contract container. However, the updating of the container cannot be performed in the kubernets mode, so that the certificate files need to be packaged into the mirror image together at first and then directly run, the adjusted process in the kubernets mode, that is, the virtual machine based on the kubernets is called to create the intelligent contract, the related certificate file is newly added to the intelligent contract, and the intelligent contract is started, specifically including: generating an image file, adding a new certificate file for the intelligent contract, updating the certificate file to the image file, creating an image, calling a Kubernetes-based virtual machine to create the intelligent contract, and calling the Kubernetes to operate an intelligent contract container.
Meanwhile, the mirror image is only created locally, and the mirror images of other machines cannot be acquired in the cluster environment, so the Node Name Kube _ Node _ Name of the starting host is added into the Node environment variable and is used for setting the starting position of the intelligent contract; therefore, the invoking a virtual machine based on kubernets to create an intelligent contract, newly adding a related certificate file to the intelligent contract, and starting the intelligent contract further includes: adding the Node Name Kube _ Node _ Name of the starting host machine into the Node environment variable to set the starting position of the intelligent contract.
In addition, in kubernets, all nodes in a set of blockchain networks may be grouped into a set of centralized management in a namespace manner, so that the invoking of a virtual machine based on kubernets creates an intelligent contract, adds a new related certificate file for the intelligent contract, and starts the intelligent contract, further including: and adding a name parameter Kube _ Namespace of the currently located Namespace into the node environment variable, so that the intelligent contract container is added into the grouping of the block chain network, and the centralized and unified management of the contract container is facilitated.
The method further comprises:
in operation 605, when the virtual machine controller module (i.e., the VMController module) determines that the kubernets intelligent contract configuration is opened, the operation 606 is executed, that is, the kubernets-based container controller module uses the kubernets platform to implement the operation method of the intelligent contract container.
Before performing the operation 606, the virtual machine controller module generates a Dockerfile file through a platform modules module and creates an intelligent contract mirror dependency package.
Further, the operation 605 further comprises:
when the virtual machine controller module judges that the Kubernets intelligent contract configuration is not started, the operation 607 is executed, a Dockerfile file is generated through the platform modules, and an intelligent contract mirror image dependency package is created.
At operation 607, the Docker-based container controller module invokes the registered Docker virtual machine to implement the operation method of the intelligent contract container. The operation method of the intelligent contract container comprises the steps of creating, running, closing or removing the intelligent contract container.
The creating of the intelligent contract container specifically comprises: and calling a Docker virtual machine to create an intelligent contract, newly adding a related certificate file for the intelligent contract, and starting the intelligent contract. Further, the invoking a Docker virtual machine to create an intelligent contract, newly adding a related certificate file to the intelligent contract, and starting the intelligent contract specifically includes: generating an image file and creating an image, calling a Docker virtual machine to create an intelligent contract, updating a certificate file of the intelligent contract into a container, and operating the intelligent contract container.
Further, whether Kubernets intelligent contract configuration is started or not is judged by setting a conditional configuration parameter Kube _ Enable = true or false. Specifically, when Kube _ Enable = true is judged, kubernets intelligent contract configuration is determined to be started; when Kube _ Enable = false is judged, it is determined that kubernets smart contract configuration is not opened.
Prior to the operation 605, the method further includes operations 601-604:
in operation 601, receiving an intelligent contract deployment or execution request sent by a client;
in operation 602, the intelligent contract support module processes the request according to the type of the request, checks whether an intelligent contract communication handle exists in the handle management module, and if the intelligent contract communication handle does not exist in the handle management module, enters a Runtime module to create an intelligent contract and update the communication handle;
in operation 603, the Launcher module in the intelligent contract running support module checks the running state of the intelligent contract, if the intelligent contract runs, the intelligent contract state is returned to update the intelligent contract communication handle, and the process is finished; if the intelligent contract is not operated, entering a Container module in the intelligent contract operation supporting module to start the intelligent contract;
in operation 604, the Container module in the intelligent contract running support module obtains the relevant configuration parameters of the intelligent contract, assembles the intelligent contract start request, and calls the virtual machine controller module;
the method further comprises the following steps:
the Provider module in the Kubernetes-based container controller module and the Kubernetes-based virtual machine are registered together in the virtual machine controller module at node startup. And the Provider module is used for creating a virtual machine based on Kubernetes for the external module.
According to the above embodiments of the present disclosure, any multiple modules in the modules may be combined into one module to be implemented, or any one of the modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the respective modules may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware by any other reasonable manner of integrating or packaging a circuit, or in any one of three implementations of software, hardware, and firmware, or in a suitable combination of any of them. Alternatively, at least one of the respective modules may be at least partially implemented as a computer program module, which when executed, may perform a corresponding function.
Fig. 7 schematically shows a block diagram of an electronic device adapted to implement a block chain based backup recording data processing method according to an embodiment of the present disclosure.
As shown in fig. 7, an electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. The processor 701 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 701 may also include on-board memory for caching purposes. The processor 701 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. The processor 701 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 702 and/or the RAM 703. Note that the programs may also be stored in one or more memories other than the ROM 702 and the RAM 703. The processor 701 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 700 may also include input/output (I/O) interface 705, which input/output (I/O) interface 705 is also connected to bus 704, according to an embodiment of the present disclosure. The electronic device 700 may also include one or more of the following components connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the above-described ROM 702 and/or RAM 703 and/or one or more memories other than the ROM 702 and RAM 703.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method illustrated by the flow chart. When the computer program product runs in a computer system, the program code is used for causing the computer system to realize the item recommendation method provided by the embodiment of the disclosure.
The computer program performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure when executed by the processor 701. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted in the form of a signal over a network medium, distributed, and downloaded and installed via the communication section 709, and/or installed from the removable medium 711. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by the processor 701, performs the above-described functions defined in the system of the embodiment of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments of the present disclosure and/or the claims may be made without departing from the spirit and teachings of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (23)

1. An intelligent contract management system in a blockchain, the management system comprising:
the Kubernetes-based container controller module is used for realizing an operation method of an intelligent contract container by using a Kubernetes platform;
the container controller module based on the Docker is used for calling the registered Docker virtual machine to realize the operation method of the intelligent contract container;
the virtual machine controller module is used for selecting and calling the container controller module based on Kubernetes or the container controller module based on Docker according to a judgment condition;
the intelligent contract support module is used for processing the related requests and parameters of the intelligent contracts and is an entrance of the intelligent contract operation;
the intelligent contract operation support module comprises a Launcher module and a Container module, wherein the Launcher module is used for providing registration of an intelligent contract and is an entrance for creating and deploying the intelligent contract; the Container module is used as an entrance of a Container and/or a virtual machine operation and is responsible for interaction with the virtual machine controller module;
the handle management module is used for managing the starting state of each intelligent contract and the communication handle; and
the platform support module is an intelligent contract compiling language platform support module, realizes the creation and packaging of intelligent contract image files, is convenient for the execution of the virtual machine controller module,
wherein the selectively invoking the kubernets-based container controller module or the Docker-based container controller module according to the determination condition specifically includes:
when the virtual machine controller module judges that Kubernetes intelligent contract configuration is started, calling the Kubernetes-based container controller module;
when the virtual machine controller module judges that Kubernetes intelligent contract configuration is not opened, the Docker-based container controller module is called,
and the virtual machine controller module judges whether Kubernets intelligent contract configuration is started or not by setting a condition configuration parameter Kube _ Enable, and then selects to call the Kubernets-based container controller module or the Docker-based container controller module.
2. The intelligent contract management system in a blockchain of claim 1, wherein the kubernets-based container controller module includes a Provider module and a kubernets-based virtual machine, wherein:
the Provider module is used for creating a virtual machine based on Kubernetes;
the virtual machine based on Kubernetes is used for realizing the operation method of the intelligent contract container.
3. The intelligent contract management system in a blockchain according to claim 1 or 2, wherein the operation method of the intelligent contract container comprises the following steps: creation, operation, closing, or removal of intelligent contract containers.
4. An intelligent contract management system in a blockchain according to claim 1 or 2 wherein said Kubernetes based container controller module is further configured to:
and the access to the Kubernets API is encapsulated through a k8s.io/client-go package provided by a Kubernets platform, so that the call to the Kubernets is realized.
5. The intelligent contract management system in a blockchain of claim 3, wherein creating an intelligent contract specifically comprises:
and calling a virtual machine based on Kubernetes to create an intelligent contract, newly adding a related certificate file for the intelligent contract, and starting the intelligent contract.
6. The intelligent contract management system in a blockchain according to claim 5, wherein the invoking a kubernets-based virtual machine to create an intelligent contract, adding a new related certificate file to the intelligent contract, and starting the intelligent contract specifically comprises:
generating an image file, adding a new certificate file for the intelligent contract, updating the certificate file to the image file, creating an image, calling a Kubernetes-based virtual machine to create the intelligent contract, and calling the Kubernetes to operate an intelligent contract container.
7. The system for intelligent contract management in a blockchain according to claim 6, wherein the invoking of the Kubernetes-based virtual machine to create an intelligent contract, adding a related certificate file to the intelligent contract, and starting the intelligent contract further comprises:
adding the Node Name Kube _ Node _ Name of the starting host machine into the Node environment variable to set the starting position of the intelligent contract.
8. The system according to claim 7, wherein the invoking of the Kubernetes-based virtual machine creates an intelligent contract, adds a related certificate file to the intelligent contract, and starts an intelligent contract, further comprising:
and adding a name parameter Kube _ Namespace of the currently located Namespace into the node environment variable, so that the intelligent contract container is added into the grouping of the block chain network, and the centralized and unified management of the contract container is facilitated.
9. The system according to claim 1, wherein the Docker-based container controller module is further configured to encapsulate access to a Docker API through a go-dockerclient package to implement calling of Docker.
10. An intelligent contract management system in a blockchain according to claim 1,
when the Kube _ Enable = true is judged, determining to call the Kubernetes-based container controller module;
when the Kube _ Enable = false is judged, determining to call the Docker-based container controller module.
11. An intelligent contract management method in a blockchain, the management method comprising the steps of:
a Kubernetes-based container controller module realizes an operation method of an intelligent contract container by using a Kubernetes platform;
receiving an intelligent contract deployment or execution request sent by a client;
the intelligent contract support module processes the request according to the type of the request, checks whether an intelligent contract communication handle exists in the handle management module, and enters the intelligent contract operation support module to create an intelligent contract and update the communication handle if the intelligent contract communication handle does not exist in the handle management module;
the Launcher module in the intelligent contract operation support module checks the operation state of the intelligent contract, if the intelligent contract operates, the intelligent contract state is returned to update the intelligent contract communication handle, and the process is finished; if the intelligent contract is not operated, entering a Container module in the intelligent contract operation support module to start the intelligent contract; and
the Container module in the intelligent contract operation support module acquires the relevant configuration parameters of the intelligent contract, assembles the intelligent contract starting request and calls the virtual machine controller module,
the Kubernetes-based container controller module uses a Kubernetes platform to realize an operation method of an intelligent contract container, and the operation method comprises the following steps:
when the virtual machine controller module judges that kubernets intelligent contract configuration is started, the kubernets-based container controller module realizes an operation method of an intelligent contract container by using a kubernets platform, and the method specifically comprises the following steps:
when the virtual machine controller module judges that the Kubernets intelligent contract configuration is not started, the container controller module based on Docker calls a registered Docker virtual machine to realize the operation method of the intelligent contract container, generates a Docker file through a platform modules, creates an intelligent contract mirror image dependency package,
and the virtual machine controller module judges whether Kubernets intelligent contract configuration is started or not by setting a condition configuration parameter Kube _ Enable = true or false, and then selects to call the Kubernets-based container controller module or the Docker-based container controller module.
12. The method of intelligent contract management in a blockchain of claim 11 wherein the method of operation of the intelligent contract container comprises: creation, operation, closing, or removal of intelligent contract containers.
13. The intelligent contract management method in the blockchain according to claim 11 or 12, wherein the method for implementing the operation of the intelligent contract container by using a kubernets platform specifically includes:
the Kubernetes-based container controller module invokes a Kubernetes-based virtual machine to create, run, close, or remove smart contracts.
14. The method of intelligent contract management in a blockchain of claim 13 wherein said kubernets-based virtual machine is created by a Provider module in said kubernets-based container controller module.
15. A method of intelligent contract management in a blockchain according to claim 11 or 12, the method further comprising:
the virtual machine based on the Kubernets encapsulates access to the Kubernets API through a k8s.io/client-go package provided by a Kubernets platform, and calling of the Kubernets is achieved.
16. The method for intelligent contract management in a blockchain according to claim 13, wherein the invoking of a kubernets-based virtual machine to create an intelligent contract specifically comprises:
and calling the virtual machine based on the Kubernetes to create an intelligent contract, newly adding a related certificate file for the intelligent contract, and starting the intelligent contract.
17. The intelligent contract management method in the blockchain according to claim 16, wherein the invoking of a Kubernetes-based virtual machine to create an intelligent contract, adding a new related certificate file to the intelligent contract, and starting an intelligent contract specifically includes:
generating an image file, adding a new certificate file for the intelligent contract, updating the certificate file to the image file, creating an image, calling a Kubernetes-based virtual machine to create the intelligent contract, and calling the Kubernetes to operate an intelligent contract container.
18. The intelligent contract management method in a blockchain according to claim 17, wherein the invoking of a Kubernetes-based virtual machine to create an intelligent contract, adding a new related certificate file to the intelligent contract, and starting an intelligent contract further comprises:
and adding the Node Name Kube _ Node _ Name of the starting host machine into the Node environment variable to set the starting position of the intelligent contract.
19. The intelligent contract management method in a blockchain according to claim 18, wherein said invoking a kubernets-based virtual machine to create an intelligent contract, adding a related certificate file to the intelligent contract, and starting the intelligent contract further comprises:
and adding a name parameter Kube _ Namespace of the currently located Namespace into the node environment variable, so that the intelligent contract container is added into the grouping of the block chain network, and the centralized and unified management of the contract container is facilitated.
20. The method of intelligent contract management in a blockchain of claim 11,
when the Kube _ Enable = true is judged, determining to call the Kubernetes-based container controller module;
when the Kube _ Enable = false is judged, determining to call the Docker-based container controller module.
21. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 11-20.
22. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 11 to 20.
23. A computer program product comprising a computer program which, when executed by a processor, implements a method according to any one of claims 11 to 20.
CN202110694661.9A 2021-06-22 2021-06-22 Intelligent contract management system, method, medium, and article in a blockchain Active CN113312429B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110694661.9A CN113312429B (en) 2021-06-22 2021-06-22 Intelligent contract management system, method, medium, and article in a blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110694661.9A CN113312429B (en) 2021-06-22 2021-06-22 Intelligent contract management system, method, medium, and article in a blockchain

Publications (2)

Publication Number Publication Date
CN113312429A CN113312429A (en) 2021-08-27
CN113312429B true CN113312429B (en) 2023-01-17

Family

ID=77379782

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110694661.9A Active CN113312429B (en) 2021-06-22 2021-06-22 Intelligent contract management system, method, medium, and article in a blockchain

Country Status (1)

Country Link
CN (1) CN113312429B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989389A (en) * 2018-06-11 2018-12-11 北京航空航天大学 A method of establishing intelligent contract micro services
CN109800056A (en) * 2019-01-16 2019-05-24 杭州趣链科技有限公司 A kind of block chain dispositions method based on container
CN111130841A (en) * 2019-11-21 2020-05-08 深圳壹账通智能科技有限公司 Block chain network deployment method, electronic device and computer readable storage medium
CN111258714A (en) * 2020-01-13 2020-06-09 电子科技大学 Intelligent contract execution method for block chain
CN111355718A (en) * 2020-02-25 2020-06-30 中国工商银行股份有限公司 Block chain intelligent contract cloud deployment system and method
CN111404923A (en) * 2020-03-12 2020-07-10 北京金山云网络技术有限公司 Control method and system for access authority of container cluster
CN111581277A (en) * 2020-04-07 2020-08-25 浙商银行股份有限公司 Block chain management method based on container technology
CN112035090A (en) * 2020-07-13 2020-12-04 翼帆数字科技(苏州)有限公司 Intelligent contract management system and method based on containerization technology

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020062131A1 (en) * 2018-09-29 2020-04-02 北京连云决科技有限公司 Container cloud management system based on blockchain technology
WO2019072310A2 (en) * 2018-12-29 2019-04-18 Alibaba Group Holding Limited System and method for implementing native contract on blockchain
CN109766722B (en) * 2019-01-22 2020-11-10 苏州同济区块链研究院有限公司 Method for constructing intelligent contract in block chain
CN109976774B (en) * 2019-04-11 2022-07-26 北京启迪区块链科技发展有限公司 Block link point deployment method, device, equipment and storage medium
US20200356866A1 (en) * 2019-05-08 2020-11-12 International Business Machines Corporation Operative enterprise application recommendation generated by cognitive services from unstructured requirements
US11539786B2 (en) * 2019-11-19 2022-12-27 Jeff Wang Method and system for heterogeneous blockchain service management
CN111562969B (en) * 2020-07-15 2020-10-20 百度在线网络技术(北京)有限公司 Intelligent contract implementation method, device, equipment and medium for block chain

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989389A (en) * 2018-06-11 2018-12-11 北京航空航天大学 A method of establishing intelligent contract micro services
CN109800056A (en) * 2019-01-16 2019-05-24 杭州趣链科技有限公司 A kind of block chain dispositions method based on container
CN111130841A (en) * 2019-11-21 2020-05-08 深圳壹账通智能科技有限公司 Block chain network deployment method, electronic device and computer readable storage medium
WO2021098140A1 (en) * 2019-11-21 2021-05-27 深圳壹账通智能科技有限公司 Blockchain network deployment method, electronic device, and computer-readable storage medium
CN111258714A (en) * 2020-01-13 2020-06-09 电子科技大学 Intelligent contract execution method for block chain
CN111355718A (en) * 2020-02-25 2020-06-30 中国工商银行股份有限公司 Block chain intelligent contract cloud deployment system and method
CN111404923A (en) * 2020-03-12 2020-07-10 北京金山云网络技术有限公司 Control method and system for access authority of container cluster
CN111581277A (en) * 2020-04-07 2020-08-25 浙商银行股份有限公司 Block chain management method based on container technology
CN112035090A (en) * 2020-07-13 2020-12-04 翼帆数字科技(苏州)有限公司 Intelligent contract management system and method based on containerization technology

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
云环境下基于Kubernetes集群系统的容器网络研究与优化;刘渊等;《信息网络安全》;20200310(第03期);全文 *
基于资源虚拟化区块链平台的列控密钥管理系统设计与实现;熊寒;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》;20210315;第10-19,25-34,57-63页 *
熊寒.基于资源虚拟化区块链平台的列控密钥管理系统设计与实现.《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》.2021, *

Also Published As

Publication number Publication date
CN113312429A (en) 2021-08-27

Similar Documents

Publication Publication Date Title
CN112585919B (en) Method for managing application configuration state by using cloud-based application management technology
US9661071B2 (en) Apparatus, systems and methods for deployment and management of distributed computing systems and applications
US9996331B1 (en) Customized application state transition
CA2939400C (en) Systems and methods for controlling branch latency within computing applications
US9323619B2 (en) Deploying parallel data integration applications to distributed computing environments
US20180113799A1 (en) Model generation for model-based application testing
JP2017107555A (en) Methods, systems and programs for determining identities of software in software containers
KR20120113716A (en) Porting virtual machine images between platforms
US20210133066A1 (en) Dynamic application decomposition for execution in a computing environment
CN113687913A (en) Lightweight application adaptation method for edge computing heterogeneous environment
CN117112122A (en) Cluster deployment method and device
CN114675935A (en) Method and system for deploying chain code in alliance chain
US20240086176A1 (en) Continuous deployment and orchestration of feature processing units in a managed cloud and a provider network for consistent data processing
CN114489954A (en) Tenant creation method based on virtualization platform, tenant access method and equipment
CN110955415B (en) Method for projecting multi-platform service adaptation
CN113312429B (en) Intelligent contract management system, method, medium, and article in a blockchain
US20200133709A1 (en) System and method for content - application split
CN111897565A (en) Data processing method, device and equipment based on Internet of things
US11816204B2 (en) Multi-tenant actor systems with web assembly
CN114237760B (en) Method for packaging industrial mechanism model into container mirror image and publishing web service
US20230023945A1 (en) Orchestrating and Automating Product Deployment Flow and Lifecycle Management
CN114661421A (en) Method and system for deploying chain code in alliance chain
Solayman et al. Seamless Integration of DevOps Tools for Provisioning Automation of the IoT Application on Multi-Infrastructures
Fiaidhi et al. Empowering extreme automation via zero-touch operations and GPU parallelization
WO2023193470A1 (en) Service management method and system, and related device

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