CN114884673A - Management method and device for block chain and electronic equipment - Google Patents

Management method and device for block chain and electronic equipment Download PDF

Info

Publication number
CN114884673A
CN114884673A CN202210474099.3A CN202210474099A CN114884673A CN 114884673 A CN114884673 A CN 114884673A CN 202210474099 A CN202210474099 A CN 202210474099A CN 114884673 A CN114884673 A CN 114884673A
Authority
CN
China
Prior art keywords
management
voting
transaction
blockchain
contract
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210474099.3A
Other languages
Chinese (zh)
Other versions
CN114884673B (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.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai 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 Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202210474099.3A priority Critical patent/CN114884673B/en
Publication of CN114884673A publication Critical patent/CN114884673A/en
Application granted granted Critical
Publication of CN114884673B publication Critical patent/CN114884673B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0894Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The embodiment of the specification provides a management method and device for a block chain and an electronic device. The method comprises the following steps: receiving a proposal request submitted by a management user for performing management operation on a block chain; responding to the proposal request, invoking voting logic contained in a management contract deployed on the blockchain, generating voting events corresponding to the management operations for users participating in voting, so that the users participating in voting respond to the voting events, perform voting processing on the management operations, and submit voting results to the management contract as event responses corresponding to the voting events for voting and summarize; acquiring a voting processing result of the users participating in voting, which is obtained by voting and summarizing the management contract, for the management operation, and determining whether the voting passes for the management operation based on the voting processing result; and if so, granting the management user the authority of management operation aiming at the block chain.

Description

Management method and device for block chain and electronic equipment
Technical Field
One or more embodiments of the present disclosure relate to the field of block chain technologies, and in particular, to a management method and apparatus for a block chain, and an electronic device.
Background
The block chain technology, also called distributed ledger technology, is an emerging technology in which several computing devices participate in "accounting" together, and a complete distributed database is maintained together. The blockchain technology has been widely used in many fields due to its characteristics of decentralization, transparency, participation of each computing device in database records, and rapid data synchronization between computing devices.
Disclosure of Invention
The embodiment of the specification provides a management method and device for a block chain and an electronic device.
According to a first aspect of embodiments of the present specification, there is provided a management method for a blockchain, which is applied to a blockchain management system, the method including:
receiving a proposal request submitted by a management user for performing management operation on a block chain;
responding to the proposal request, invoking voting logic contained in a management contract deployed on the blockchain, generating voting events corresponding to the management operations for users participating in voting, so that the users participating in voting respond to the voting events, perform voting processing on the management operations, and submit voting results to the management contract as event responses corresponding to the voting events for voting and summarize; acquiring a voting processing result of the users participating in voting, which is obtained by voting and summarizing the management contract, for the management operation, and determining whether the voting passes for the management operation based on the voting processing result; and if so, granting the management user the authority of management operation aiming at the block chain.
Optionally, the method further includes:
receiving a management request for the block chain initiated by the management user; wherein the management request comprises a management operation to be executed by the management user for the block chain;
determining whether the management user has a right to perform the management operation for the blockchain in response to the management request;
if so, performing the management operation on the blockchain.
Optionally, the blockchain management system is docked with a blockchain service platform;
the invoking a voting logic included in a management contract deployed on the blockchain to generate a voting event corresponding to the management operation for a user participating in voting comprises:
generating a proposed transaction corresponding to the proposed request, and sending the proposed transaction to the blockchain service platform, and further sending the proposed transaction to a node device in the blockchain by the blockchain service platform, so that the node device invokes voting logic included in a management contract deployed on the blockchain in response to the proposed transaction to generate a voting event corresponding to the management operation for a user participating in voting;
obtaining a voting processing result of the user participating in the voting for the management operation, including:
and obtaining a voting processing result of the user participating in voting aiming at the management operation, wherein the voting processing result is obtained by voting and summarizing the management contract pushed by the block chain service platform.
Optionally, the management operation includes an operation related to version upgrade of a target intelligent contract deployed in the blockchain; the management contract comprises upgrade management logic related to version upgrade of the target intelligent contract; the block chain is provided with an old version target intelligent contract before version upgrading and a new version target intelligent contract after version upgrading; the management contract maintains a drainage policy for draining the target intelligent contract; the drainage policy comprises a first drainage policy for draining the contract invocation transaction aiming at the target intelligent contract to the target intelligent contract of the new version for execution and a second drainage policy for draining the contract invocation transaction aiming at the target intelligent contract to the target intelligent contract of the old version for execution;
performing the management operation for the blockchain, including:
and generating a management transaction corresponding to the management request, sending the management transaction to the blockchain service platform, and further sending the management transaction to node equipment in the blockchain by the blockchain service platform so that the node equipment responds to the management transaction, calls an upgrade management logic contained in the management contract, and switches the drainage policy maintained by the management contract to a drainage policy corresponding to an operation related to version upgrade.
Optionally, the version upgrade includes a grayscale upgrade; the grey scale upgrade comprises a pre-release stage of the target intelligent contract aiming at the new version; and a gray scale release stage after the pre-release stage is completed;
the operation related to the version upgrading comprises the following steps: the method comprises the following steps of carrying out a first operation of pre-release testing corresponding to a pre-release stage on a target intelligent contract, carrying out a second operation of gray level testing corresponding to a gray level release stage on the target intelligent contract, and carrying out a third operation of version switching on the target intelligent contract after the gray level testing is finished;
the invoking of the upgrade management logic included in the management contract switches the drainage policy maintained by the management contract to a drainage policy corresponding to an operation related to the version upgrade, including:
if the management operation is the first operation, calling an upgrade management logic corresponding to the version upgrade operation and contained in the management contract, and switching a drainage policy, which is maintained by the management contract and corresponds to a pre-release test transaction corresponding to the pre-release test, into the first drainage policy;
if the management operation is the second operation, calling an upgrade management logic corresponding to the version upgrade operation and contained in the management contract, and switching a drainage strategy, which is maintained by the management contract and corresponds to a gray release test transaction corresponding to the gray release test, into the first drainage strategy;
if the management operation is the third operation, the upgrade management logic corresponding to the production transaction and contained in the management contract is called, and the drainage strategy corresponding to the production transaction and maintained by the management contract is switched to the first drainage strategy.
Optionally, the management operation includes performing a version upgrade related operation on transaction processing logic supported by a node device in the blockchain; a blockchain service platform interfaced with the blockchain management system maintains a drainage policy that drains the blockchain transactions; at least part of transaction processing logic supported by node equipment in the blockchain managed by the blockchain service platform is replaced by transaction processing logic of a new version after gray scale upgrading; the drainage strategy comprises a third drainage strategy for sending the blockchain transaction to the node equipment supporting the transaction processing logic of the new version for execution and a fourth drainage strategy for sending the blockchain transaction to the node equipment supporting the transaction processing logic of the old version for execution;
performing the management operation for the blockchain, including:
and sending the management request to the blockchain service platform, so that the blockchain service platform responds to the management request and switches the drainage strategy maintained by the blockchain service platform to a drainage strategy corresponding to the operation related to the version upgrading.
Optionally, the version upgrade includes a grayscale upgrade; the grey scale upgrade comprises a pre-release stage of the target intelligent contract aiming at the new version; and a gray scale release stage after the pre-release stage is completed;
the operation related to the version upgrading comprises the following steps: performing a fourth operation of a pre-release test corresponding to the pre-release stage on the transaction processing logic supported by the node device in the block chain, performing a fifth operation of a gray scale test corresponding to the gray scale release stage on the transaction processing logic supported by the node device in the block chain, and performing a sixth operation of version switching on the transaction processing logic supported by the node device in the block chain after the gray scale test is completed;
the sending the management request to the blockchain service platform so that the blockchain service platform switches the drainage policy maintained by the blockchain service platform to a drainage policy corresponding to an operation related to the version upgrade in response to the management request includes:
sending the management request to the blockchain service platform, so that the blockchain service platform responds to the management request, and when the management operation is the fourth operation, switching the maintained drainage policy corresponding to the pre-release test transaction corresponding to the pre-release test to the third drainage policy;
when the management operation is a fifth operation, switching the maintained drainage strategy corresponding to the gray scale test transaction corresponding to the gray scale test to the third drainage strategy;
and when the management operation is a sixth operation, switching the maintained drainage strategy corresponding to the production transaction to the third drainage strategy.
Optionally, the private key of the management user is hosted and stored in the blockchain management platform;
the generating an offered transaction corresponding to the offered request and sending the offered transaction to the blockchain service platform includes:
generating an offered transaction corresponding to the offered request, signing the offered transaction based on a private key of the managed user managed and stored, and sending the signed offered transaction to the blockchain service platform;
the generating a management transaction corresponding to the management request and sending the management transaction to the blockchain service platform includes:
and generating a management transaction corresponding to the management request, signing the management transaction based on a private key of the managed user which is managed and stored, and sending the signed management transaction to the block chain service platform.
Optionally, the private key of the management user is hosted and stored in a KMS system interfaced with the blockchain management platform;
the signature processing of the transaction based on the private key of the managed user stored by the escrow comprises the following steps:
and acquiring a private key of the management user from the KMS, and signing the transaction based on the private key.
Optionally, the blockchain service platform includes a Baas platform.
According to a second aspect of the embodiments of the present specification, there is provided a management apparatus for a blockchain, which is applied to a blockchain management system, the apparatus including:
the receiving unit is used for receiving an offer request which is submitted by a management user and used for carrying out management operation on the block chain;
the management unit is used for responding to the proposal request, calling voting logic contained in a management contract deployed on the blockchain, generating voting events corresponding to the management operation for users participating in voting, so that the users participating in voting respond to the voting events, perform voting processing on the management operation, and submit voting results to the management contract as event responses corresponding to the voting events for voting and perform voting collection; acquiring a voting processing result of the users participating in voting, which is obtained by voting and summarizing the management contract, for the management operation, and determining whether the voting passes for the management operation based on the voting processing result; and if so, granting the management user the authority of management operation aiming at the block chain.
Optionally, the apparatus further comprises:
the receiving unit further receives a management request for the block chain initiated by the management user; wherein the management request comprises a management operation to be executed by the management user for the block chain;
a determination unit that determines whether the management user has a right to perform the management operation for the blockchain in response to the management request;
and the execution unit executes the management operation on the blockchain when the management user has the right to execute the management operation on the blockchain.
Optionally, the blockchain management system is docked with a blockchain service platform;
in the management unit, invoking a voting logic included in a management contract deployed on the blockchain, and generating a voting event corresponding to the management operation for a user participating in voting, includes:
generating a proposed transaction corresponding to the proposed request, and sending the proposed transaction to the blockchain service platform, and further sending the proposed transaction to a node device in the blockchain by the blockchain service platform, so that the node device invokes voting logic included in a management contract deployed on the blockchain in response to the proposed transaction to generate a voting event corresponding to the management operation for a user participating in voting;
the acquiring, by the management unit, a voting processing result of the user participating in the voting for the management operation includes:
and obtaining a voting processing result of the user participating in voting aiming at the management operation, wherein the voting processing result is obtained by voting and summarizing the management contract pushed by the block chain service platform.
Optionally, the management operation includes an operation related to version upgrade of a target intelligent contract deployed in the blockchain; the management contract comprises upgrade management logic related to version upgrade of the target intelligent contract; the block chain is provided with an old version target intelligent contract before version upgrading and a new version target intelligent contract after version upgrading; the management contract maintains a drainage policy for draining the target intelligent contract; the drainage policy comprises a first drainage policy for draining the contract invocation transaction aiming at the target intelligent contract to the target intelligent contract of the new version for execution and a second drainage policy for draining the contract invocation transaction aiming at the target intelligent contract to the target intelligent contract of the old version for execution;
in the execution unit, the performing the management operation on the blockchain includes:
and generating a management transaction corresponding to the management request, sending the management transaction to the blockchain service platform, and further sending the management transaction to node equipment in the blockchain by the blockchain service platform, so that the node equipment responds to the management transaction, calls an upgrade management logic contained in the management contract, and switches the drainage policy maintained by the management contract to a drainage policy corresponding to an operation related to version upgrade.
Optionally, the version upgrade includes a grayscale upgrade; the grey scale upgrade comprises a pre-release stage of the target intelligent contract aiming at the new version; and a gray scale release stage after the pre-release stage is completed;
the operation related to the version upgrading comprises the following steps: the method comprises the following steps of carrying out a first operation of pre-release testing corresponding to a pre-release stage on a target intelligent contract, carrying out a second operation of gray level testing corresponding to a gray level release stage on the target intelligent contract, and carrying out a third operation of version switching on the target intelligent contract after the gray level testing is finished;
in the execution unit, invoking an upgrade management logic included in the management contract, and switching the drainage policy maintained by the management contract to a drainage policy corresponding to an operation related to the version upgrade, including:
if the management operation is the first operation, calling an upgrade management logic corresponding to the version upgrade operation and contained in the management contract, and switching a drainage policy, which is maintained by the management contract and corresponds to a pre-release test transaction corresponding to the pre-release test, into the first drainage policy;
if the management operation is the second operation, calling an upgrade management logic corresponding to the version upgrade operation and contained in the management contract, and switching a drainage strategy, which is maintained by the management contract and corresponds to a gray release test transaction corresponding to the gray release test, into the first drainage strategy;
if the management operation is the third operation, the upgrade management logic corresponding to the production transaction and contained in the management contract is called, and the drainage strategy which is maintained by the management contract and corresponds to the production transaction is switched to the first drainage strategy.
Optionally, the management operation includes performing a version upgrade related operation on transaction processing logic supported by a node device in the blockchain; a blockchain service platform interfaced with the blockchain management system maintains a drainage policy that drains the blockchain transactions; at least part of transaction processing logic supported by node equipment in the blockchain managed by the blockchain service platform is replaced by transaction processing logic of a new version after gray scale upgrading; the drainage strategy comprises a third drainage strategy for sending the blockchain transaction to the node equipment supporting the transaction processing logic of the new version for execution and a fourth drainage strategy for sending the blockchain transaction to the node equipment supporting the transaction processing logic of the old version for execution;
in the execution unit, the performing the management operation on the blockchain includes:
and sending the management request to the blockchain service platform, so that the blockchain service platform responds to the management request and switches the drainage strategy maintained by the blockchain service platform to a drainage strategy corresponding to the operation related to the version upgrading.
Optionally, the version upgrade includes a grayscale upgrade; the gray scale upgrading comprises a pre-release stage of the target intelligent contract aiming at the new version; and a gray scale release stage after the pre-release stage is completed;
the operation related to the version upgrading comprises the following steps: performing a fourth operation of a pre-release test corresponding to the pre-release stage on the transaction processing logic supported by the node device in the block chain, performing a fifth operation of a gray scale test corresponding to the gray scale release stage on the transaction processing logic supported by the node device in the block chain, and performing a sixth operation of version switching on the transaction processing logic supported by the node device in the block chain after the gray scale test is completed;
in the execution unit, sending the management request to the blockchain service platform, so that the blockchain service platform responds to the management request, and switches the drainage policy maintained by the blockchain service platform to a drainage policy corresponding to an operation related to the version upgrade, where the method includes:
sending the management request to the blockchain service platform, so that the blockchain service platform responds to the management request, and when the management operation is the fourth operation, switching the maintained drainage policy corresponding to the pre-release test transaction corresponding to the pre-release test to the third drainage policy;
when the management operation is a fifth operation, switching the maintained drainage strategy corresponding to the gray scale test transaction corresponding to the gray scale test to the third drainage strategy;
and when the management operation is a sixth operation, switching the maintained drainage strategy corresponding to the production transaction to the third drainage strategy.
Optionally, the private key of the management user is hosted and stored in the blockchain management platform;
the management unit generates an offered transaction corresponding to the offered request and sends the offered transaction to the blockchain service platform, and the management unit comprises:
generating an offered transaction corresponding to the offered request, signing the offered transaction based on a private key of the managed user managed and stored, and sending the signed offered transaction to the blockchain service platform;
in the execution unit, generating a management transaction corresponding to the management request, and sending the management transaction to the blockchain service platform includes:
and generating a management transaction corresponding to the management request, signing the management transaction based on a private key of the managed user which is managed and stored, and sending the signed management transaction to the block chain service platform.
Optionally, the private key of the management user is hosted and stored in a KMS system interfaced with the blockchain management platform;
in the execution unit, signing the transaction based on the private key of the managed user managed and stored, including:
and acquiring a private key of the management user from the KMS, and signing the transaction based on the private key.
Optionally, the blockchain service platform includes a Baas platform.
According to a third aspect of embodiments herein, there is provided an electronic apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured as any one of the above management methods for a blockchain.
The embodiment of the present specification provides a management scheme for a block chain, where an independent block chain management system manages management operations of the block chain, and when a vote passes, the authority to manage the managed block chain can be obtained, so that an effect of strongly controlling the management operations of the block chain can be achieved.
Drawings
FIG. 1 is a flow chart of a method for managing blockchains provided by an exemplary embodiment;
FIG. 2 is a schematic diagram of an electronic device according to an exemplary embodiment;
fig. 3 is a block diagram of a management apparatus for a blockchain according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
In the related art of the block chain, the management of the block chain is usually performed by a management user directly operating the block chain. For example, publishing intelligent contracts to blockchains is by an administrative user publishing the intelligent contracts directly into blockchains.
Due to the lack of control, such a management method is likely to cause the exception of the block chain. For example, an issued intelligent contract is wrong, the wrong business logic in the intelligent contract directly affects the business data in the block chain.
To this end, embodiments of the present specification aim to implement the normalization and the streamlining of blockchain management. Management operation of the block chain is managed through an independent block chain management system, and the authority of the management operation of the block chain can be obtained only when the vote passes, so that the effect of strong management and control on the management operation of the block chain can be achieved.
Referring to fig. 1, fig. 1 is a flowchart illustrating a management method for a blockchain according to an exemplary embodiment. The method is applied to a block chain management system and comprises the following steps:
step 110: receiving a proposal request submitted by a management user for performing management operation on a block chain;
step 120: responding to the proposal request, invoking voting logic contained in a management contract deployed on the blockchain, generating voting events corresponding to the management operations for users participating in voting, so that the users participating in voting respond to the voting events, perform voting processing on the management operations, and submit voting results to the management contract as event responses corresponding to the voting events for voting and summarize; acquiring a voting processing result of the users participating in voting, which is obtained by voting and summarizing the management contract, for the management operation, and determining whether the voting passes for the management operation based on the voting processing result; and if so, granting the management user the authority of management operation aiming at the block chain.
In this specification, the blockchain management system is a system that standardizes management of blockchains and intelligent contracts in blockchains. The blockchain management system is a system independent of blockchains, and the proposal and voting process for managing the blockchains is completed by calling a management contract.
In an embodiment, the method may further include:
receiving a management request for the block chain initiated by the management user; wherein the management request comprises a management operation to be executed by the management user for the block chain;
determining whether the management user has a right to perform the management operation for the blockchain in response to the management request; if so, performing the management operation on the blockchain.
In this specification, an independent blockchain management system is used to manage the management operation of the blockchain, and the blockchain management system only executes a management request initiated by a management user having a management operation authority, so as to achieve an effect of strongly controlling the management operation of the blockchain.
In one embodiment, the blockchain management system interfaces with a blockchain service platform;
in step 120, invoking a voting logic included in the management contract deployed on the blockchain, and generating a voting event corresponding to the management operation for a user participating in voting, includes:
generating a proposed transaction corresponding to the proposed request, and sending the proposed transaction to the blockchain service platform, and further sending the proposed transaction to a node device in the blockchain by the blockchain service platform, so that the node device invokes voting logic included in a management contract deployed on the blockchain in response to the proposed transaction to generate a voting event corresponding to the management operation for a user participating in voting;
in step 120, obtaining a voting processing result of the user participating in the voting for the management operation includes:
and obtaining a voting processing result of the user participating in voting aiming at the management operation, wherein the voting processing result is obtained by voting and summarizing the management contract pushed by the block chain service platform.
In this specification, the block chain Service platform may include a BaaS platform (also referred to as a BaaS cloud) for providing a block chain as a Service (BaaS). The BaaS platform can provide a pre-programmed software mode for activities (such as subscription and notification, user verification, database management and remote updating) occurring on the block chain, provides simple and easy-to-use one-key deployment, rapid verification and flexible and customizable block chain service for user client side computing equipment coupled with the BaaS platform, and further can accelerate the development, testing and online of block chain service application and assist landing of block chain business application scenes of various industries.
In this specification, the blockchain management system may complete the invocation of the management contract through the blockchain service platform, so as to complete the proposing and voting process for managing the blockchain.
The following description takes the upgrade of the intelligent contract in the blockchain as an example:
the function of a Smart contract (Smart contract) is generally provided in the block chain. An intelligent contract on a blockchain is a contract on a blockchain that can be triggered to execute by blockchain transactions. An intelligent contract may be defined in the form of code. By writing the execution logic of specific business into a target intelligent contract in a code form and issuing the contract into the blockchain, various complex business logics can be realized on the blockchain.
Since the execution logic of the business can change continuously with the development of the business, the target intelligent contract also has the requirement of upgrading. However, due to the non-tamper-able characteristic of the blockchain, the target smart contract which is already issued in the blockchain cannot be modified; therefore, the contract code is not simply modified for the target intelligent contract upgrading, but a completely new version (containing upgraded business logic) of the target intelligent contract needs to be issued, and then the target intelligent contract in effect in the block chain is switched to the target intelligent contract of the new version so as to lose the target intelligent contract of the old version before failure.
In practical application, because the target intelligent contract may have an incompatibility problem in the upgrading process, if the target intelligent contracts in the block chain are all switched to a new version, once the new version is incompatible with the old version, the execution of normal services is affected. Based on this, a gray scale upgrade for the target intelligent contract is generated. The method for upgrading the gray scale can ensure that a block chain for deploying the target intelligent contract is stable, problems can be found and timely processed in the initial gray scale stage, and the influence range of the problems is limited even if the user group in the initial gray scale stage is few.
Since the blockchain deploys the target intelligent contracts of the old version and the new version at the same time, whether the blockchain transaction initiated by the transaction initiator is a test transaction related to gray scale upgrading needs to be sensed, and the corresponding target intelligent contract is called to execute the blockchain transaction.
Specifically, in this specification, the blockchain deploys an old version of target intelligent contract before the grayscale upgrade and a new version of target intelligent contract after the grayscale upgrade; and the management intelligent contract is used for carrying out gray scale upgrading management on the target intelligent contract.
In one embodiment, the management operation includes a version-up related operation on a target intelligent contract deployed in the blockchain; the management contract comprises upgrade management logic related to version upgrade of the target intelligent contract; the block chain is provided with an old version target intelligent contract before version upgrading and a new version target intelligent contract after version upgrading; the management contract maintains a drainage policy for draining the target intelligent contract; the drainage policy comprises a first drainage policy for draining the contract invocation transaction aiming at the target intelligent contract to the target intelligent contract of the new version for execution and a second drainage policy for draining the contract invocation transaction aiming at the target intelligent contract to the target intelligent contract of the old version for execution;
in step 120, the performing the management operation on the blockchain includes:
and generating a management transaction corresponding to the management request, sending the management transaction to the blockchain service platform, and further sending the management transaction to node equipment in the blockchain by the blockchain service platform, so that the node equipment responds to the management transaction, calls an upgrade management logic contained in the management contract, and switches the drainage policy maintained by the management contract to a drainage policy corresponding to an operation related to version upgrade.
In one embodiment, the private key of the management user is stored in the blockchain management platform;
the generating an offered transaction corresponding to the offered request and sending the offered transaction to the blockchain service platform includes:
generating an offered transaction corresponding to the offered request, signing the offered transaction based on a private key of the managed user managed and stored, and sending the signed offered transaction to the blockchain service platform;
the generating a management transaction corresponding to the management request and sending the management transaction to the blockchain service platform includes:
and generating a management transaction corresponding to the management request, signing the management transaction based on a private key of the managed user which is managed and stored, and sending the signed management transaction to the block chain service platform.
In an embodiment, the private key of the administrative user is hosted in a KMS system that interfaces with the blockchain management platform;
the signature processing of the transaction based on the private key of the managed user stored by the escrow comprises the following steps:
and acquiring a private key of the management user from the KMS, and signing the transaction based on the private key.
In this specification, the blockchain Management system is further connected to a KMS (Key Management Service), and the KMS stores a private Key of a Management user for performing unified Management on the private Key of the Management user. And the private key of the certificate of the KMS corresponds to the public key of the certificate of the management user on the block chain one by one.
The risk of leakage of the private key stored at the local end can be avoided by uniformly storing the user private key originally stored locally by the management user to the KMS.
In one embodiment, the version upgrade comprises a grayscale upgrade; the grey scale upgrade comprises a pre-release stage of the target intelligent contract aiming at the new version; and a gray scale release stage after the pre-release stage is completed;
the operation related to the version upgrading comprises the following steps: the method comprises the following steps of carrying out a first operation of pre-release testing corresponding to a pre-release stage on a target intelligent contract, carrying out a second operation of gray level testing corresponding to a gray level release stage on the target intelligent contract, and carrying out a third operation of version switching on the target intelligent contract after the gray level testing is finished;
the invoking of the upgrade management logic included in the management contract switches the drainage policy maintained by the management contract to a drainage policy corresponding to an operation related to the version upgrade, including:
if the management operation is the first operation, calling an upgrade management logic corresponding to the version upgrade operation and contained in the management contract, and switching a drainage policy, which is maintained by the management contract and corresponds to a pre-release test transaction corresponding to the pre-release test, into the first drainage policy;
if the management operation is the second operation, calling an upgrade management logic corresponding to the version upgrade operation and contained in the management contract, and switching a drainage strategy, which is maintained by the management contract and corresponds to a gray release test transaction corresponding to the gray release test, into the first drainage strategy;
if the management operation is the third operation, the upgrade management logic corresponding to the production transaction and contained in the management contract is called, and the drainage strategy which is maintained by the management contract and corresponds to the production transaction is switched to the first drainage strategy.
In this specification, the process of gray scale upgrading may be to perform pre-release first, and complete the pre-release test; and then carrying out gray release, completing the gray release test and carrying out the production stage.
Because the pre-release test transaction corresponding to the pre-release test needs to be executed by the target intelligent contract of the new version, the block chain management system needs to switch the drainage policy corresponding to the pre-release test transaction to the first drainage policy, that is, switch from the target intelligent contract of the old version to the target intelligent contract of the new version, so that the pre-release test transaction is executed by the target intelligent contract of the new version. Further, whether the new version of the service intelligent contract passes the pre-release test corresponding to the pre-release stage or not can be determined according to the execution result of the pre-release test transaction; if so, gray scale distribution may be performed. Otherwise, if not, the block chain management system needs to switch the drainage policy corresponding to the pre-release test transaction to a second drainage policy to implement rollback of the gray scale upgrade.
Similarly, since the gray release test transaction corresponding to the gray release test also needs to be executed by the target intelligent contract of the new version, the block chain management system needs to switch the drainage policy corresponding to the gray release test transaction to the first drainage policy, that is, switch from the target intelligent contract of the old version to the target intelligent contract of the new version, so that the target intelligent contract of the new version executes the gray release test transaction. Further, whether the new version of the service intelligent contract passes the gray release test corresponding to the gray release stage or not can be determined according to the execution result of the gray release test transaction; if so, a production phase may be performed. Otherwise, if not, the block chain management system needs to switch the drainage strategies corresponding to the pre-release test transaction and the gray release test transaction into the second drainage strategy so as to realize the rollback of the gray scale upgrade.
In the production stage, the blockchain management system needs to switch the drainage policy corresponding to the production transaction to the first drainage policy, so that the production transaction is executed by the target intelligent contract of the new version. If the execution result of the production transaction is wrong, the block chain management system needs to switch the drainage strategies corresponding to the pre-release test transaction, the gray release test transaction and the production transaction into a second drainage strategy so as to realize the rollback of the gray upgrading.
The gray scale upgrading of the intelligent contract can be completed by the transaction testing and the drainage strategy switching.
The following description takes the gray scale upgrade of node devices in the blockchain as an example:
and at least part of transaction processing logic supported by the node equipment in the block chain is replaced by the transaction processing logic of a new version after the gray scale is upgraded.
In one embodiment, the management operations include version-up related operations on transaction processing logic supported by node devices in the blockchain; a blockchain service platform interfaced with the blockchain management system maintains a drainage policy that drains the blockchain transactions; at least part of transaction processing logic supported by node equipment in the blockchain managed by the blockchain service platform is replaced by transaction processing logic of a new version after gray scale upgrading; the drainage strategy comprises a third drainage strategy for sending the blockchain transaction to the node equipment supporting the transaction processing logic of the new version for execution and a fourth drainage strategy for sending the blockchain transaction to the node equipment supporting the transaction processing logic of the old version for execution;
in step 120, the performing the management operation on the blockchain includes:
and sending the management request to the blockchain service platform, so that the blockchain service platform responds to the management request and switches the drainage strategy maintained by the blockchain service platform to a drainage strategy corresponding to the operation related to the version upgrading.
In one embodiment, the version upgrade comprises a grayscale upgrade; the grey scale upgrade comprises a pre-release stage of the target intelligent contract aiming at the new version; and a gray scale release stage after the pre-release stage is completed;
the operation related to the version upgrading comprises the following steps: performing a fourth operation of a pre-release test corresponding to the pre-release stage on the transaction processing logic supported by the node device in the block chain, performing a fifth operation of a gray scale test corresponding to the gray scale release stage on the transaction processing logic supported by the node device in the block chain, and performing a sixth operation of version switching on the transaction processing logic supported by the node device in the block chain after the gray scale test is completed;
the sending the management request to the blockchain service platform so that the blockchain service platform responds to the management request and switches the drainage policy maintained by the blockchain service platform to a drainage policy corresponding to an operation related to the version upgrade includes:
sending the management request to the blockchain service platform, so that the blockchain service platform responds to the management request, and when the management operation is the fourth operation, switching the maintained drainage policy corresponding to the pre-release test transaction corresponding to the pre-release test to the third drainage policy;
when the management operation is a fifth operation, switching the maintained drainage strategy corresponding to the gray scale test transaction corresponding to the gray scale test to the third drainage strategy;
and when the management operation is a sixth operation, switching the maintained drainage strategy corresponding to the production transaction to the third drainage strategy.
In this specification, the process of gray scale upgrading may be to perform pre-release first, and complete the pre-release test; and then carrying out gray release, completing the gray release test and carrying out the production stage.
Because the pre-release test transaction corresponding to the pre-release test needs to be executed by the node device supporting the transaction processing logic of the new version, the block chain service platform needs to switch the drainage policy corresponding to the pre-release test transaction to the third drainage policy, that is, switch from the node device supporting the transaction processing logic of the old version to the node device supporting the transaction processing logic of the new version, so that the node device supporting the transaction processing logic of the new version executes the pre-release test transaction. Further, whether the transaction processing logic of the new version passes the pre-release test corresponding to the pre-release stage or not can be determined according to the execution result of the pre-release test transaction; if so, gray scale distribution may be performed. Otherwise, if not, the block chain service platform needs to switch the drainage policy corresponding to the pre-release test transaction to a fourth drainage policy so as to implement rollback of the gray scale upgrade.
Similarly, since the gray release test transaction corresponding to the gray release test also needs to be executed by the node device supporting the new version of the transaction processing logic, the block chain service platform needs to switch the drainage policy corresponding to the gray release test transaction to the third drainage policy, that is, switch from the node device supporting the old version of the transaction processing logic to the node device supporting the new version of the transaction processing logic, so that the node device supporting the new version of the transaction processing logic executes the gray release test transaction. Further, whether the transaction processing logic of the new version passes the pre-release test corresponding to the pre-release stage or not can be determined according to the execution result of the gray release test transaction; if so, a production phase may be performed. Otherwise, if not, the block chain service platform needs to switch the drainage strategies corresponding to the pre-release test transaction and the gray release test transaction into a fourth drainage strategy so as to realize the rollback of the gray scale upgrade.
In the production stage, the blockchain service platform needs to switch the drainage policy corresponding to the production transaction to a third drainage policy, so that the production transaction is executed by the target intelligent contract of the new version. If the execution result of the production transaction is wrong, the block chain service platform needs to switch the drainage strategies corresponding to the pre-release test transaction, the gray release test transaction and the production transaction into a fourth drainage strategy so as to realize the rollback of the gray upgrading.
The gray scale upgrading of the transaction processing logic supported by the node equipment can be completed by the transaction testing and the diversion strategy switching.
Corresponding to the above method embodiments, the present specification also provides an embodiment of a management apparatus for a block chain.
The embodiment of the management apparatus for a block chain in this specification can be applied to an electronic device. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation.
From a hardware aspect, as shown in fig. 2, the hardware structure diagram of the electronic device where the management apparatus for a block chain in this specification is located is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 2, the electronic device where the apparatus is located in the embodiment may also include other hardware according to an actual function of the electronic device, which is not described again.
Fig. 3 illustrates an exemplary embodiment of an apparatus corresponding to the embodiment of fig. 1. Applied to a block chain management system, the device comprises:
a receiving unit 310, which receives a proposal request submitted by a management user for performing management operation on a block chain;
the management unit 320, in response to the proposal request, invokes voting logic included in a management contract deployed on the blockchain, generates a voting event corresponding to the management operation for a user participating in voting, so that the user participating in voting responds to the voting event, performs voting processing on the management operation, and submits a voting result as an event response corresponding to the voting event to the management contract for voting and summarizing; acquiring a voting processing result of the users participating in voting, which is obtained by voting and summarizing the management contract, for the management operation, and determining whether the voting passes for the management operation based on the voting processing result; and if so, granting the management user the authority of management operation aiming at the block chain.
Optionally, the apparatus further comprises:
the receiving unit 310 further receives a management request for the block chain initiated by the management user; wherein the management request comprises a management operation to be executed by the management user for the block chain;
a determination unit that determines whether the management user has a right to perform the management operation for the blockchain in response to the management request;
and the execution unit executes the management operation on the blockchain when the management user has the right to execute the management operation on the blockchain.
Optionally, the blockchain management system is docked with a blockchain service platform;
in the management unit 320, invoking a voting logic included in the management contract deployed on the blockchain, and generating a voting event corresponding to the management operation for a user participating in voting, includes:
generating a proposed transaction corresponding to the proposed request, and sending the proposed transaction to the blockchain service platform, and further sending the proposed transaction to a node device in the blockchain by the blockchain service platform, so that the node device invokes voting logic included in a management contract deployed on the blockchain in response to the proposed transaction to generate a voting event corresponding to the management operation for a user participating in voting;
the acquiring, by the management unit 320, a voting processing result of the user participating in the voting for the management operation includes:
and obtaining a voting processing result of the user participating in voting aiming at the management operation, wherein the voting processing result is obtained by voting and summarizing the management contract pushed by the block chain service platform.
Optionally, the management operation includes an operation related to version upgrade of a target intelligent contract deployed in the blockchain; the management contract comprises upgrade management logic related to version upgrade of the target intelligent contract; the block chain is provided with an old version target intelligent contract before version upgrading and a new version target intelligent contract after version upgrading; the management contract maintains a drainage policy for draining the target intelligent contract; the drainage policy comprises a first drainage policy for draining the contract invocation transaction aiming at the target intelligent contract to the target intelligent contract of the new version for execution and a second drainage policy for draining the contract invocation transaction aiming at the target intelligent contract to the target intelligent contract of the old version for execution;
in the execution unit, the performing the management operation on the blockchain includes:
and generating a management transaction corresponding to the management request, sending the management transaction to the blockchain service platform, and further sending the management transaction to node equipment in the blockchain by the blockchain service platform, so that the node equipment responds to the management transaction, calls an upgrade management logic contained in the management contract, and switches the drainage policy maintained by the management contract to a drainage policy corresponding to an operation related to version upgrade.
Optionally, the version upgrade includes a grayscale upgrade; the grey scale upgrade comprises a pre-release stage of the target intelligent contract aiming at the new version; and a gray scale release stage after the pre-release stage is completed;
the operation related to the version upgrading comprises the following steps: the method comprises the following steps of carrying out a first operation of pre-release testing corresponding to a pre-release stage on a target intelligent contract, carrying out a second operation of gray level testing corresponding to a gray level release stage on the target intelligent contract, and carrying out a third operation of version switching on the target intelligent contract after the gray level testing is finished;
in the execution unit, invoking an upgrade management logic included in the management contract, and switching the drainage policy maintained by the management contract to a drainage policy corresponding to an operation related to the version upgrade, including:
if the management operation is the first operation, calling an upgrade management logic corresponding to the version upgrade operation and contained in the management contract, and switching a drainage policy, which is maintained by the management contract and corresponds to a pre-release test transaction corresponding to the pre-release test, into the first drainage policy;
if the management operation is the second operation, calling an upgrade management logic corresponding to the version upgrade operation and contained in the management contract, and switching a drainage strategy, which is maintained by the management contract and corresponds to a gray release test transaction corresponding to the gray release test, into the first drainage strategy;
if the management operation is the third operation, the upgrade management logic corresponding to the production transaction and contained in the management contract is called, and the drainage strategy which is maintained by the management contract and corresponds to the production transaction is switched to the first drainage strategy.
Optionally, the management operation includes performing a version upgrade related operation on transaction processing logic supported by a node device in the blockchain; a blockchain service platform interfaced with the blockchain management system maintains a drainage policy that drains the blockchain transactions; at least part of transaction processing logic supported by node equipment in the blockchain managed by the blockchain service platform is replaced by transaction processing logic of a new version after gray scale upgrading; the drainage strategy comprises a third drainage strategy for sending the blockchain transaction to the node equipment supporting the transaction processing logic of the new version for execution and a fourth drainage strategy for sending the blockchain transaction to the node equipment supporting the transaction processing logic of the old version for execution;
in the execution unit, the performing the management operation on the blockchain includes:
and sending the management request to the block chain service platform, so that the block chain service platform responds to the management request and switches the drainage strategy maintained by the block chain service platform to a drainage strategy corresponding to the operation related to the version upgrading.
Optionally, the version upgrade includes a grayscale upgrade; the grey scale upgrade comprises a pre-release stage of the target intelligent contract aiming at the new version; and a gray scale release stage after the pre-release stage is completed;
the operation related to the version upgrading comprises the following steps: performing a fourth operation of a pre-release test corresponding to the pre-release stage on the transaction processing logic supported by the node device in the block chain, performing a fifth operation of a gray scale test corresponding to the gray scale release stage on the transaction processing logic supported by the node device in the block chain, and performing a sixth operation of version switching on the transaction processing logic supported by the node device in the block chain after the gray scale test is completed;
in the execution unit, sending the management request to the blockchain service platform, so that the blockchain service platform responds to the management request, and switches the drainage policy maintained by the blockchain service platform to a drainage policy corresponding to an operation related to the version upgrade, where the method includes:
sending the management request to the blockchain service platform, so that the blockchain service platform responds to the management request, and when the management operation is the fourth operation, switching the maintained drainage policy corresponding to the pre-release test transaction corresponding to the pre-release test to the third drainage policy;
when the management operation is a fifth operation, switching the maintained drainage strategy corresponding to the gray scale test transaction corresponding to the gray scale test to the third drainage strategy;
and when the management operation is a sixth operation, switching the maintained drainage strategy corresponding to the production transaction to the third drainage strategy.
Optionally, the private key of the management user is hosted and stored in the blockchain management platform;
the generating, by the managing unit 320, an offered transaction corresponding to the offered request and sending the offered transaction to the blockchain service platform includes:
generating an offered transaction corresponding to the offered request, signing the offered transaction based on a private key of the managed user managed and stored, and sending the signed offered transaction to the blockchain service platform;
in the execution unit, generating a management transaction corresponding to the management request, and sending the management transaction to the blockchain service platform includes:
and generating a management transaction corresponding to the management request, signing the management transaction based on a private key of the managed user which is managed and stored, and sending the signed management transaction to the block chain service platform.
Optionally, the private key of the management user is hosted and stored in a KMS system interfaced with the blockchain management platform;
in the execution unit, signing the transaction based on the private key of the managed user managed and stored, including:
and acquiring a private key of the management user from the KMS, and signing the transaction based on the private key.
Optionally, the blockchain service platform includes a Baas platform.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.

Claims (12)

1. A management method for a block chain is applied to a block chain management system, and the method comprises the following steps:
receiving a proposal request submitted by a management user for performing management operation on a block chain;
responding to the proposal request, invoking voting logic contained in a management contract deployed on the blockchain, generating voting events corresponding to the management operations for users participating in voting, so that the users participating in voting respond to the voting events, perform voting processing on the management operations, and submit voting results to the management contract as event responses corresponding to the voting events for voting and summarize; acquiring a voting processing result of the users participating in voting, which is obtained by voting and summarizing the management contract, for the management operation, and determining whether the voting passes for the management operation based on the voting processing result; and if so, granting the management user the authority of management operation aiming at the block chain.
2. The method of claim 1, further comprising:
receiving a management request for the block chain initiated by the management user; wherein the management request comprises a management operation to be executed by the management user for the block chain;
determining whether the management user has a right to perform the management operation for the blockchain in response to the management request;
if so, performing the management operation on the blockchain.
3. The method of claim 2, the blockchain management system interfacing with a blockchain service platform;
the invoking of the voting logic included in the management contract deployed on the blockchain to generate a voting event corresponding to the management operation for a user participating in voting includes:
generating a proposed transaction corresponding to the proposed request, and sending the proposed transaction to the blockchain service platform, and further sending the proposed transaction to a node device in the blockchain by the blockchain service platform, so that the node device invokes voting logic included in a management contract deployed on the blockchain in response to the proposed transaction to generate a voting event corresponding to the management operation for a user participating in voting;
the obtaining of the voting processing result of the user participating in the voting for the management operation includes:
and obtaining a voting processing result of the user participating in voting aiming at the management operation, wherein the voting processing result is obtained by voting and summarizing the management contract pushed by the block chain service platform.
4. The method of claim 3, the management operations comprising version-up related operations on target intelligent contracts deployed in the blockchain; the management contract comprises upgrade management logic related to version upgrade of the target intelligent contract; the block chain is provided with an old version target intelligent contract before version upgrading and a new version target intelligent contract after version upgrading; the management contract maintains a drainage policy for draining the target intelligent contract; the drainage policy comprises a first drainage policy for draining the contract invocation transaction aiming at the target intelligent contract to the target intelligent contract of the new version for execution and a second drainage policy for draining the contract invocation transaction aiming at the target intelligent contract to the target intelligent contract of the old version for execution;
performing the management operation for the blockchain, including:
and generating a management transaction corresponding to the management request, sending the management transaction to the blockchain service platform, and further sending the management transaction to node equipment in the blockchain by the blockchain service platform, so that the node equipment responds to the management transaction, calls an upgrade management logic contained in the management contract, and switches the drainage policy maintained by the management contract to a drainage policy corresponding to an operation related to version upgrade.
5. The method of claim 4, the version upgrade comprising a grayscale upgrade; the gray scale upgrading comprises a pre-release stage of the target intelligent contract aiming at the new version; and a gray scale release stage after the pre-release stage is completed;
the operation related to the version upgrading comprises the following steps: the method comprises the following steps of carrying out a first operation of pre-release testing corresponding to a pre-release stage on a target intelligent contract, carrying out a second operation of gray level testing corresponding to a gray level release stage on the target intelligent contract, and carrying out a third operation of version switching on the target intelligent contract after the gray level testing is finished;
the invoking of the upgrade management logic included in the management contract switches the drainage policy maintained by the management contract to a drainage policy corresponding to an operation related to the version upgrade, including:
if the management operation is the first operation, calling an upgrade management logic corresponding to the version upgrade operation and contained in the management contract, and switching a drainage policy, which is maintained by the management contract and corresponds to a pre-release test transaction corresponding to the pre-release test, into the first drainage policy;
if the management operation is the second operation, calling an upgrade management logic corresponding to the version upgrade operation and contained in the management contract, and switching a drainage strategy, which is maintained by the management contract and corresponds to a gray release test transaction corresponding to the gray release test, into the first drainage strategy;
if the management operation is the third operation, the upgrade management logic corresponding to the production transaction and contained in the management contract is called, and the drainage strategy which is maintained by the management contract and corresponds to the production transaction is switched to the first drainage strategy.
6. The method of claim 2, the management operations comprising version-up related operations on transaction processing logic supported by node devices in the blockchain; a blockchain service platform interfaced with the blockchain management system maintains a drainage policy that drains the blockchain transactions; at least part of transaction processing logic supported by node equipment in the blockchain managed by the blockchain service platform is replaced by transaction processing logic of a new version after gray scale upgrading; the drainage strategy comprises a third drainage strategy for sending the blockchain transaction to the node equipment supporting the transaction processing logic of the new version for execution and a fourth drainage strategy for sending the blockchain transaction to the node equipment supporting the transaction processing logic of the old version for execution;
performing the management operation for the blockchain, including:
and sending the management request to the blockchain service platform, so that the blockchain service platform responds to the management request and switches the drainage strategy maintained by the blockchain service platform to a drainage strategy corresponding to the operation related to the version upgrading.
7. The method of claim 6, the version upgrade comprising a grayscale upgrade; the grey scale upgrade comprises a pre-release stage of the target intelligent contract aiming at the new version; and a gray scale release stage after the pre-release stage is completed;
the operation related to the version upgrading comprises the following steps: performing a fourth operation of a pre-release test corresponding to the pre-release stage on the transaction processing logic supported by the node device in the block chain, performing a fifth operation of a gray scale test corresponding to the gray scale release stage on the transaction processing logic supported by the node device in the block chain, and performing a sixth operation of version switching on the transaction processing logic supported by the node device in the block chain after the gray scale test is completed;
the sending the management request to the blockchain service platform so that the blockchain service platform switches the drainage policy maintained by the blockchain service platform to a drainage policy corresponding to an operation related to the version upgrade in response to the management request includes:
sending the management request to the blockchain service platform, so that the blockchain service platform responds to the management request, and when the management operation is the fourth operation, switching the maintained drainage policy corresponding to the pre-release test transaction corresponding to the pre-release test to the third drainage policy;
when the management operation is a fifth operation, switching the maintained drainage strategy corresponding to the gray scale test transaction corresponding to the gray scale test to the third drainage strategy;
and when the management operation is a sixth operation, switching the maintained drainage strategy corresponding to the production transaction to the third drainage strategy.
8. The method of claim 4, the management user's private key is hosted stored at the blockchain management platform;
the generating an offered transaction corresponding to the offered request and sending the offered transaction to the blockchain service platform includes:
generating an offered transaction corresponding to the offered request, signing the offered transaction based on a private key of the managed user managed and stored, and sending the signed offered transaction to the blockchain service platform;
the generating a management transaction corresponding to the management request and sending the management transaction to the blockchain service platform includes:
and generating a management transaction corresponding to the management request, signing the management transaction based on a private key of the managed user which is managed and stored, and sending the signed management transaction to the block chain service platform.
9. The method of claim 8, the management user's private key is hosted stored in a KMS system that interfaces with the blockchain management platform;
the signature processing of the transaction based on the private key of the managed user stored by the escrow comprises the following steps:
and acquiring a private key of the management user from the KMS, and signing the transaction based on the private key.
10. The method of claim 3, the block chain service platform comprising a Baas platform.
11. A management device for a block chain, which is applied to a block chain management system, the device comprises:
the receiving unit is used for receiving an offer request which is submitted by a management user and used for carrying out management operation on the block chain;
the management unit is used for responding to the proposal request, calling voting logic contained in a management contract deployed on the blockchain, generating voting events corresponding to the management operation for users participating in voting, so that the users participating in voting respond to the voting events, perform voting processing on the management operation, and submit voting results to the management contract as event responses corresponding to the voting events for voting and perform voting collection; acquiring a voting processing result of the users participating in voting, which is obtained by voting and summarizing the management contract, for the management operation, and determining whether the voting passes for the management operation based on the voting processing result; and if so, granting the management user the authority of management operation aiming at the block chain.
12. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of claims 1-10 by executing the executable instructions.
CN202210474099.3A 2022-04-29 2022-04-29 Management method and device for block chain and electronic equipment Active CN114884673B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210474099.3A CN114884673B (en) 2022-04-29 2022-04-29 Management method and device for block chain and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210474099.3A CN114884673B (en) 2022-04-29 2022-04-29 Management method and device for block chain and electronic equipment

Publications (2)

Publication Number Publication Date
CN114884673A true CN114884673A (en) 2022-08-09
CN114884673B CN114884673B (en) 2024-02-02

Family

ID=82674038

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210474099.3A Active CN114884673B (en) 2022-04-29 2022-04-29 Management method and device for block chain and electronic equipment

Country Status (1)

Country Link
CN (1) CN114884673B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110245183A (en) * 2019-05-05 2019-09-17 上海链度科技有限公司 A kind of encrypted electronic voting system and method based on alliance's block chain technology
CN110417844A (en) * 2018-04-30 2019-11-05 慧与发展有限责任合伙企业 Use the system and method for block chain Decentralization multiple-owner node
KR102186029B1 (en) * 2019-12-20 2020-12-03 (주) 모로보기 Electronic voting system using blockchain and electronic voting method using blockchain
CN113193992A (en) * 2021-04-16 2021-07-30 宁波图灵奇点智能科技有限公司 Block chain platform, method and device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417844A (en) * 2018-04-30 2019-11-05 慧与发展有限责任合伙企业 Use the system and method for block chain Decentralization multiple-owner node
CN110245183A (en) * 2019-05-05 2019-09-17 上海链度科技有限公司 A kind of encrypted electronic voting system and method based on alliance's block chain technology
KR102186029B1 (en) * 2019-12-20 2020-12-03 (주) 모로보기 Electronic voting system using blockchain and electronic voting method using blockchain
CN113193992A (en) * 2021-04-16 2021-07-30 宁波图灵奇点智能科技有限公司 Block chain platform, method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN114884673B (en) 2024-02-02

Similar Documents

Publication Publication Date Title
CN110033244B (en) Intelligent contract execution method and device based on block chain and electronic equipment
CN108335206B (en) Asset management method and device and electronic equipment
US11336589B2 (en) Allocating virtual resource based on blockchain
CN110020542B (en) Data reading and writing method and device and electronic equipment
US20130145371A1 (en) Batch processing of business objects
US20110225574A1 (en) Virtual Machine Image Update Service
CN109598407B (en) Method and device for executing business process
CN110032598B (en) Method and device for updating field and electronic equipment
CN111782668A (en) Data structure reading and updating method and device, and electronic equipment
CN111476667A (en) Block chain-based original work transaction method and device and electronic equipment
US11615078B2 (en) Blockchain-based transaction methods
CN112686519A (en) Gray scale adjusting method and device, electronic equipment and storage medium
CN111768303A (en) Transaction processing method, device, equipment and system
CN110244951B (en) Application publishing method and device
CN111813379A (en) Application deployment method and device, electronic equipment and computer readable storage medium
CN114884673A (en) Management method and device for block chain and electronic equipment
CN111402058A (en) Data processing method, device, equipment and medium
CN111091353A (en) Loving public interest management method, equipment and medium based on block chain
CN109857450A (en) A kind of verification service orchestration method and device
CN113469815A (en) Data management method and device
CN110297625B (en) Application processing method and device
CN112950181A (en) Asset management method, electronic device and readable storage medium
CN111242624A (en) Removal compensation method, device and medium based on block chain
CN114816493A (en) Gray scale upgrading method and device for block chain service platform and electronic equipment
CN114817406A (en) Block chain transaction execution method and device and electronic equipment

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