CN111861469A - Processing method and device for consensus mechanism in block chain and electronic equipment - Google Patents

Processing method and device for consensus mechanism in block chain and electronic equipment Download PDF

Info

Publication number
CN111861469A
CN111861469A CN202010735354.6A CN202010735354A CN111861469A CN 111861469 A CN111861469 A CN 111861469A CN 202010735354 A CN202010735354 A CN 202010735354A CN 111861469 A CN111861469 A CN 111861469A
Authority
CN
China
Prior art keywords
consensus
consensus mechanism
target
block chain
default
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.)
Pending
Application number
CN202010735354.6A
Other languages
Chinese (zh)
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202010735354.6A priority Critical patent/CN111861469A/en
Publication of CN111861469A publication Critical patent/CN111861469A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • 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/12Accounting

Abstract

The application provides a processing method, a processing device and electronic equipment for a consensus mechanism in a block chain, wherein the method comprises the following steps: if the current node equipment in the block chain receives the consensus mechanism change instruction, updating the default consensus mechanism in the current node equipment into a target consensus mechanism indicated by the consensus mechanism change instruction; and informing the appointed equipment in the block chain, and updating the default consensus mechanism in the appointed equipment into a target consensus mechanism. In the method, a plurality of consensus mechanisms are compatible in the block chain, so that the node equipment in the block chain can change the instruction and the notification according to the consensus mechanism and change the used default consensus mechanism into the target consensus mechanism, therefore, the method completes the replacement operation of the consensus mechanism on the premise of not restarting the block chain network, improves the flexibility of the block chain network consensus mechanism, so that a user can select and replace different consensus mechanisms according to business requirements, and is favorable for further exploiting the block chain ecology.

Description

Processing method and device for consensus mechanism in block chain and electronic equipment
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a processing method and apparatus for a consensus mechanism in a blockchain, and an electronic device.
Background
The consensus mechanism refers to a process of agreeing on a state by nodes participating in consensus in a blockchain network, which means that a plurality of nodes agree on the occurrence order, validity of a certain batch of transactions and their updates on the ledger state.
In the related art, a blockchain network (e.g., a hyper-hedger Fabric network) may provide multiple consensus mechanisms, where the blockchain network needs to complete an internal configuration before the network is started, and the internal configuration only includes one consensus mechanism selected by a user; after the network is successfully started, the nodes in the block chain network complete the consensus sequencing service of the services submitted on the block chain network according to the consensus mechanism. The mode can not change and modify the consensus mechanism after the network is successfully started, so that the method is difficult to meet and adapt to the increasing and changing service requirements of the block chain network, and is not beneficial to the ecological expansion of the block chain.
Disclosure of Invention
The application aims to provide a processing method and device for a consensus mechanism in a block chain and electronic equipment, so as to meet and adapt to the increasing and changing business requirements of a block chain network and help the ecological expansion of the block chain.
In a first aspect, an embodiment of the present application provides a method for processing a consensus mechanism in a block chain, where the method is applied to a node device in the block chain, where multiple consensus mechanisms and a default consensus mechanism in an activated state among the multiple consensus mechanisms are stored in the node device; the default consensus mechanism is used to: providing consensus sequencing service for the service received by the node equipment; the method comprises the following steps: if a consensus mechanism change instruction is received, updating a default consensus mechanism in the current node equipment into a target consensus mechanism indicated by the consensus mechanism change instruction; notifying the designated equipment in the blockchain to update a default consensus mechanism in the designated equipment to be a target consensus mechanism; wherein the specifying device includes: and in the block chain, except the current node equipment, the node equipment is used for providing the consensus sequencing service.
In an alternative embodiment, the block chain is a designated network; a number of consensus mechanisms include: an inherent consensus mechanism of the given network, and/or a user-defined consensus mechanism.
In an optional embodiment, before the step of updating the default consensus mechanism in the current node device to the target consensus mechanism indicated by the consensus mechanism change instruction, if the consensus mechanism change instruction is received, the method further includes: initializing a plurality of consensus mechanisms to obtain a consensus example of each consensus mechanism; wherein the consensus instance is used to perform a consensus ranking operation.
In an optional implementation manner, the step of performing an initialization operation on the multiple consensus mechanisms to obtain a consensus instance of each consensus mechanism includes: for each of a plurality of consensus mechanisms, performing the following: compiling code of a current consensus mechanism into an executable file; and setting initial values for parameters and/or conditions in the executable file to obtain the consensus instance of the current consensus mechanism.
In an optional implementation manner, after the step of initializing the plurality of consensus mechanisms to obtain the consensus instances of each consensus mechanism, the method further includes: uploading the consensus instances of each consensus mechanism or the consensus instances of the default consensus mechanism to an account manager of the block chain, so that the node device calls the consensus instances of the default consensus mechanism from the account manager to perform consensus sequencing operation on the services received by the node device.
In an optional embodiment, the ledger manager of the block chain stores a consensus instance of multiple consensus mechanisms, where the consensus instance is used to perform a consensus sorting operation; before the step of updating the default consensus mechanism in the current node device to the target consensus mechanism indicated by the consensus mechanism change instruction, the method further includes: inquiring whether the account book manager contains a consensus instance of the target consensus mechanism; and if the common recognition instance of the target common recognition mechanism is not included, uploading the common recognition instance of the target common recognition mechanism to the ledger manager.
In an optional embodiment, the ledger manager of the block chain stores a consensus instance of multiple consensus mechanisms, where the consensus instance is used to perform a consensus sorting operation; after the step of updating the default consensus mechanism in the current node device to the target consensus mechanism indicated by the consensus mechanism change instruction, the method further includes: inquiring whether the account book manager contains a consensus instance of the target consensus mechanism; if the consensus instance of the target consensus mechanism is contained, calling the consensus instance of the target consensus mechanism from the account book manager to execute consensus sequencing operation on the service received by the node equipment by adopting the consensus instance of the target consensus mechanism.
In a second aspect, an embodiment of the present application provides a method for processing a consensus mechanism in a block chain, where the method is applied to a node device in the block chain, where the node device includes a default consensus mechanism in an active state; the default consensus mechanism is used to: providing consensus sequencing service for the service received by the node equipment; the method comprises the following steps: if receiving a notification for changing the consensus mechanism, updating the default consensus mechanism in the current node equipment into a target consensus mechanism indicated by the notification; wherein, the notification is sent by the node equipment for providing the consensus sequencing service except the current node equipment in the block chain.
In an alternative embodiment, if a notification for changing the consensus mechanism is received, the step of updating the default consensus mechanism in the current node device to the target consensus mechanism indicated by the notification includes: carrying out endorsement operation on the notification to obtain an endorsement result; wherein the endorsement operation is to verify whether the node device sending the notification is a designated node device; and if the endorsement result indicates that the node equipment sending the notification is the designated node equipment, updating the default consensus mechanism in the current node equipment into the target consensus mechanism.
In an optional embodiment, the ledger manager of the block chain stores a consensus instance of multiple consensus mechanisms, where the consensus instance is used to perform a consensus sorting operation; if the endorsement result indicates that the node device sending the notification is the designated node device, the step of updating the default consensus mechanism in the current node device to the target consensus mechanism comprises the following steps: inquiring whether the account book manager contains a consensus instance of the target consensus mechanism; if the account book manager does not contain the consensus instances of the target consensus mechanism, sending a consensus instance uploading instruction to the appointed node equipment so that the appointed node equipment uploads the consensus instances of the target consensus mechanism to the account book manager; if the account book manager comprises the consensus instances of the target consensus mechanism, calling the consensus instances of the target consensus mechanism from the account book manager to execute consensus sequencing operation on the services received by the node equipment by adopting the consensus instances of the target consensus mechanism.
In a third aspect, an embodiment of the present application provides a device for processing a consensus mechanism in a block chain, where the device is disposed in a node device in the block chain, and multiple consensus mechanisms and a default consensus mechanism in an activated state among the multiple consensus mechanisms are stored in the node device; the default consensus mechanism is used to: providing consensus sequencing service for the service received by the node equipment; the device includes: a change instruction receiving module, configured to update a default consensus mechanism in the current node device to a target consensus mechanism indicated by the consensus mechanism change instruction if the consensus mechanism change instruction is received; the system comprises a mechanism change notification module, a target consensus mechanism and a target consensus mechanism, wherein the mechanism change notification module is used for notifying the specified equipment in the block chain so as to update the default consensus mechanism in the specified equipment into the target consensus mechanism; wherein the specifying device includes: and in the block chain, except the current node equipment, the node equipment is used for providing the consensus sequencing service.
In a fourth aspect, an embodiment of the present application provides a device for processing a consensus mechanism in a block chain, where the device is disposed in a node device in the block chain, and the node device includes a default consensus mechanism in an active state; the default consensus mechanism is used to: providing consensus sequencing service for the service received by the node equipment; the device includes: a mechanism changing module, configured to update a default consensus mechanism in current node equipment to a target consensus mechanism indicated by the notification if the notification for changing the consensus mechanism is received; wherein, the notification is sent by the node equipment for providing the consensus sequencing service except the current node equipment in the block chain.
In a fifth aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, where the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the processing method of the above-mentioned blockchain consensus mechanism.
In a sixth aspect, embodiments of the present application provide a machine-readable storage medium storing machine-executable instructions, which when invoked and executed by a processor, cause the processor to implement the processing method of the above-mentioned block chain consensus mechanism.
The embodiment of the application brings the following beneficial effects:
the method is applied to node equipment in a block chain, and the node equipment stores multiple consensus mechanisms and a default consensus mechanism in an activated state among the multiple consensus mechanisms. Firstly, if the current node equipment receives a consensus mechanism change instruction, updating a default consensus mechanism in the current node equipment into a target consensus mechanism indicated by the consensus mechanism change instruction; and informing the node equipment which is used for providing the consensus sequencing service except the current node equipment in the block chain, and updating the default consensus mechanism into the target consensus mechanism. In the method, a plurality of consensus mechanisms are compatible in the block chain, so that the node equipment in the block chain can change the instruction and the notification according to the consensus mechanism and change the used default consensus mechanism into the target consensus mechanism, therefore, the method completes the replacement operation of the consensus mechanism on the premise of not restarting the block chain network, improves the flexibility of the block chain network consensus mechanism, so that a user can select and replace different consensus mechanisms according to business requirements, and is favorable for further exploiting the block chain ecology.
Additional features and advantages of the application will be set forth in the description which follows, or in part may be learned by the practice of the technology described above.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the detailed description of the present application or the technical solutions in the prior art, the drawings needed to be used in the detailed description of the present application or the prior art description will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a processing method of a consensus mechanism in a block chain according to an embodiment of the present disclosure;
fig. 2 is a flowchart of another processing method for a consensus mechanism in a blockchain according to an embodiment of the present disclosure;
fig. 3 is a flowchart of another processing method for a consensus mechanism in a blockchain according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a processing apparatus for a block chain consensus mechanism according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
With the updating of information technology, a blockchain is gradually becoming popular as a new storage technology, and a blockchain network system is a data network system which utilizes cryptography to ensure the security of data transmission and access and generates a non-falsifiable and non-counterfeitable distributed account book. The block chain has the advantage of how to obtain trust in a decentralized system, and the consensus mechanism is used as a core part for obtaining trust and represents the irreplaceable advantage. The consensus mechanism refers to a process of agreeing on nodes participating in consensus in the blockchain network, and when nodes in the network vote for the same transaction information, if a certain number (or all) of the nodes agree, the transaction is said to agree in the whole blockchain network.
There is no centralized mechanism like a bank in the blockchain network system, so that the consensus mechanism ensures the consistency and correctness of each transaction on all accounting nodes when information transmission and value transfer are carried out. The new consensus mechanism of the blockchain enables the blockchain to operate in a large-scale efficient cooperation mode without depending on a centralized organization.
In the related art, some block chain networks, such as bitcoin, ether house, etc., only provide a consensus mechanism, which cannot be changed or modified; some blockchain networks, such as Hyperridge Fabric networks, can provide multiple consensus mechanisms, and the blockchain networks have already completed configuration of internal consensus mechanisms before starting, for example, corresponding consensus mechanisms are configured when creating a created block, so that nodes in the blockchain networks need to verify and confirm transactions generated inside the blockchain networks (equivalent to providing consensus sequencing services) according to the consensus mechanisms embedded in the blockchain networks. However, the above method cannot change and modify the consensus mechanism after the blockchain network is successfully started, which makes it difficult to meet and adapt to the increasing and changing service requirements of the blockchain network, and is also not beneficial to the ecological expansion of the blockchain.
Based on this, the embodiments of the present application provide a processing method and apparatus for a consensus mechanism in a blockchain, and an electronic device. In order to facilitate understanding of the embodiment of the present application, a detailed description is first given of a processing method for a consensus mechanism in a block chain disclosed in the embodiment of the present application, where the method is applied to a node device in the block chain, and multiple consensus mechanisms and a default consensus mechanism in an activated state among the multiple consensus mechanisms are stored in the node device; the default consensus mechanism is used to: providing consensus sequencing service for the service received by the node equipment; as shown in fig. 1, the method comprises the following specific steps:
step S102, if the consensus mechanism change instruction is received, the default consensus mechanism in the current node equipment is updated to the target consensus mechanism indicated by the consensus mechanism change instruction.
The blockchain includes a plurality of node devices, which may be electronic devices, mobile terminals (e.g., mobile phones, tablet computers), computers, and the like. Wherein, the node device corresponding to an administrator in the plurality of node devices is the current node device, and the administrator (i.e. the user having the authority to change the consensus mechanism) can store a plurality of consensus mechanisms on the current node device before starting the blockchain network, i.e. the administrator can modify the configuration file (e.g. node configuration file, channel configuration file, created block configuration file, etc.) in the current node device, add multiple consensus mechanisms in the configuration file, and choose one of the consensus mechanisms as the default consensus mechanism according to the requirement or randomly, therefore, after the blockchain network is started, all the node devices in the blockchain can adopt the default consensus mechanism to provide the consensus sequencing service for the received service, and can also be understood as enabling the default consensus mechanism to be in an activated state.
The above-mentioned multiple consensus mechanisms may include various of a workload Proof mechanism (Proof of Work, PoW for short), a rights and interests Proof mechanism (Proof of stamp, PoS for short), a rights and rights Proof mechanism (freed Proof of stamp, DPoS for short), a verification Pool consensus mechanism (Pool for short), and a Practical Byzantine fault tolerance mechanism (PBFT for short). The applicable scenes of each consensus mechanism in the block chain are different, and due to the existence of the theoretical limit boundary of the consensus mechanism, different types of consensus mechanisms have certain advantages and disadvantages, so that an administrator needs to select and replace different consensus mechanisms to meet the current service requirements.
The PoW mechanism described above can be simply understood as a proof that the user has done a certain amount of work. It is possible to know which specified amounts of work the user has completed, usually by looking at the work results. This PoW mechanism is also the most common consensus mechanism in blockchains. For example, the consensus mechanism used by the bit coin system in the block generation process is a PoW mechanism, and the simple understanding is that everyone contends for the accounting right, who wins and completes the accounting work correctly, who gets the reward of the system, and the reward is the bit coin, that is, the so-called "digging mine"; miners (who participate in mining) perform this accounting work with the computational power of a computer, and the professional computer with the computational power is a so-called "mining machine".
The PoW mechanism described above has the following advantages: the centralization is completely removed, the equipment nodes can freely enter and exit, and the cost for establishing and maintaining a centralized credit institution is avoided; as long as the computing power of the network disruptor does not exceed 50% of the total computing power of the whole network, the transaction state of the network can be agreed, and the historical records can not be tampered; the more computationally invested, the greater the probability of obtaining accounting rights, and the more likely a new block reward will be generated. This PoW mechanism has the following disadvantages: the current bitcoin digging causes a great amount of computing power and energy waste; the excitation mechanism of ore excavation causes high concentration of ore excavation computational power; the settlement period is long, and 7 transactions are settled at most every second, which is not suitable for commercial application.
The PoS mechanism can determine the probability of obtaining the account by holding the number and duration of tokens, and similarly to the dividend system of stocks, people who have more rights can obtain more dividends; the Token is equivalent to the interest of the blockchain system. There are many digital assets that currently issue new currencies with PoS. The advantages of the PoS mechanism are: the resource waste of the PoW mechanism is reduced; the operation speed is accelerated, and the method can also be understood as an upgraded version of a workload proving mechanism. The disadvantages of this PoS mechanism are: the probability that the equipment nodes with longer coin ages obtain the accounting right is higher, so that the Martian effect is easily caused, namely, the richers are richer, and the rights and interests are more concentrated and the fairness is poorer.
The DPoS mechanism described above may be a more professional solution derived based on the PoS mechanism, similar to board voting, which generally means that a person who owns Token votes to a fixed node, elects several agents, and the agents take charge of verification and accounting. Different from the mode that nodes in the whole network in the PoW mechanism and the PoS mechanism can participate in accounting competition, accounting nodes of the DPoS mechanism are determined within a certain time period. The DPoS mechanism to incentivize more people and contests, the block chain system generates a small number of tokens as rewards, e.g., the bit shares employ the DPoS mechanism. The DPoS mechanism has the advantages that: compared with a PoW mechanism and a DPoS mechanism, the block chain data processing capability is improved, even the second arrival can be realized, and the cost for maintaining the network security of the block chain is reduced; the disadvantages of the DPoS mechanism are: the decentration degree is weak, the node agents are selected artificially, the fairness is lower than that of a PoS mechanism, and the stability of the agent nodes is maintained by relying on the increment of tokens.
The Pool mechanism is generally based on a traditional distributed consistency technology, and is a mechanism of data verification, which is also a common mechanism widely used by the block chain in the industry at present. The advantage of the Pool is: second-level consensus verification can be achieved without relying on tokens; the disadvantages of this Pool are: the decentralization degree is weak, and the method is more suitable for a multi-center business model with multi-party participation.
The PBFT mechanism described above is typically such that each "general" (a designated node on the blockchain) maintains an internal state (persistent specific information or state) that when it receives a message they use it in conjunction with its internal state to run computations or operations. This calculation in turn tells the "general" how to think about the information, then, after reaching an individual decision about a new message, the "general" shares that decision with all other "general" in the system, and finally determines consensus decisions based on all decisions submitted by all general. The advantages of this PBFT mechanism are: PBFT requires pairwise communication between all nodes, so this communication mechanism requires that the number of nodes cannot be too large, usually several tens, and in this mode, the speed of agreement of nodes is faster and the delay is lower; the control of the number of the nodes enables the PBFT network not to be limited by the nodes with the lowest processing capacity like a large-scale PoW network, so that the throughput of the whole network is greatly improved. The disadvantages of this PBFT mechanism are: the expandability and decentralization degree are weak, and the fault tolerance is low.
Combining the above several consensus mechanisms: each consensus mechanism cannot satisfy security, efficiency, and fairness at the same time. Wherein, the weaker the de-centering degree is, the lower the security is, and the faster the block chain speed is; the stronger the decentralization, the higher the security and the slower the block chain speed. Therefore, in the blockchain network, different consensus mechanisms are required to be adopted to provide consensus sequencing services for the services submitted to the blockchain according to different application scenarios.
When the consensus mechanism currently used by the blockchain cannot meet the requirements of the service system, the administrator can change the consensus mechanism according to the service requirements, that is, the administrator selects and confirms to adopt one of the multiple consensus mechanisms as the target consensus mechanism according to the scene type of the current blockchain, the current network environment security and the service requirements of the blockchain, clicks or triggers a control corresponding to the consensus mechanism in the user operation interface, and can send a consensus mechanism change instruction to the current node device. When the current node equipment receives the consensus mechanism change instruction, the default consensus mechanism in the current node equipment is updated to the target consensus mechanism indicated by the consensus mechanism change instruction, so that the current node equipment adopts the target consensus mechanism to provide consensus sequencing service for the service submitted to the current node equipment.
Step S104, notifying the appointed equipment in the block chain to update the default consensus mechanism in the appointed equipment into a target consensus mechanism; wherein the specifying device includes: and in the block chain, except the current node equipment, the node equipment is used for providing the consensus sequencing service.
When the current node device receives the consensus mechanism change instruction, the default consensus mechanism in the current node device can be updated to the target consensus mechanism indicated by the consensus mechanism change instruction, and the node devices, which are used for providing the consensus sequencing service and are except the current node device, on the block chain can be notified, the default consensus mechanism is changed to the target consensus mechanism, so that all the node devices on the block chain adopt the target consensus mechanism to provide the consensus sequencing service for the service submitted to the block chain.
In the concrete implementation, aiming at the service (equivalent to transaction) submitted to the block chain before the target consensus mechanism is updated, the default consensus mechanism is adopted to complete the consensus sequencing service, and the data in all the services can be ensured to be linked up normally; aiming at the transaction submitted to the block chain after being updated to the target consensus mechanism, the target consensus mechanism is adopted to complete the consensus sequencing service and ensure that the data in all services can be linked up normally.
In a specific implementation, after the default consensus mechanism adopted in the blockchain is changed to the target consensus mechanism, if the consensus mechanism change instruction is received again, the consensus mechanism indicated in the consensus mechanism change instruction may be referred to as a new target consensus mechanism, the target consensus mechanism currently being adopted may be referred to as a new default consensus mechanism, and the above steps S102 to S104 are continuously performed to implement the change of the consensus mechanism.
In the processing method for the consensus mechanism in the block chain provided in the embodiment of the present application, if the current node device in the block chain receives a consensus mechanism change instruction, the default consensus mechanism in the current node device is updated to a target consensus mechanism indicated by the consensus mechanism change instruction; and notifying the appointed equipment of the node equipment for providing the consensus sequencing service except the current node equipment in the block chain, and updating a default consensus mechanism in the appointed equipment into a target consensus mechanism. In the method, a plurality of consensus mechanisms are compatible in the block chain, so that the node equipment in the block chain can change the instruction and the notification according to the consensus mechanism and change the used default consensus mechanism into the target consensus mechanism, therefore, the method completes the replacement operation of the consensus mechanism on the premise of not restarting the block chain network, improves the flexibility of the block chain network consensus mechanism, so that a user can select and replace different consensus mechanisms according to business requirements, and is favorable for further exploiting the block chain ecology.
The embodiment of the application also provides another processing method of the consensus mechanism in the block chain, which is realized on the basis of the method of the embodiment; before the step of updating the default consensus mechanism in the current node device to the target consensus mechanism indicated by the consensus mechanism change instruction, the method focuses on a specific process of initializing multiple consensus mechanisms stored in the node device (which is implemented by the following steps S202-S204), as shown in fig. 2, the method includes the following steps:
step S202, initializing a plurality of consensus mechanisms to obtain a consensus instance of each consensus mechanism; wherein the consensus instance is used to perform a consensus ranking operation.
Before starting the blockchain network, an administrator needs to modify a configuration file in the current node device, that is, multiple consensus mechanisms needing initialization are added in the configuration file, and one of the consensus mechanisms is selected as a default consensus mechanism according to requirements or randomly. In an embodiment, the blockchain network may be a designated network; the multiple consensus mechanisms include: an inherent consensus mechanism specifying a network, and/or a user-defined consensus mechanism. The designated network may be a Fabric network, and thus the plurality of consensus mechanisms included in the configuration file may include only the inherent consensus mechanism of the Fabric network (e.g., PoW mechanism, PoS mechanism, PBFT mechanism, etc.), may include only the user-defined consensus mechanism, or may include both the inherent consensus mechanism of the Fabric network and the user-defined consensus mechanism.
Generally, the inherent consensus mechanism is generated to solve a specific problem and may not meet the requirements of the user, so that the user can define the consensus mechanism by himself and generate a custom consensus mechanism; the user-defined consensus mechanism may be a code written according to a user service requirement and executed when each node device in the blockchain network performs transaction verification and confirmation, that is, a code providing a consensus ranking service.
In the process of starting the blockchain network, all consensus mechanisms set in the configuration file need to be initialized, and a consensus instance corresponding to each consensus mechanism is generated, so that the node device can call the consensus mechanism to realize consensus sequencing service.
In particular implementations, for each of a plurality of consensus mechanisms, the following steps 10-11 may be performed to obtain a consensus instance for each consensus mechanism:
step 10, compiling codes of the current consensus mechanism into an executable file; the code of the consensus mechanism is also a code that can implement the consensus sequencing service corresponding to the consensus mechanism, and the code includes parameters and conditions for execution of the consensus mechanism. In a specific implementation, the code of the consensus mechanism may be compiled into an executable file, which is called a consensus mechanism plug-in, that is, the executable file may be configured in a node device of the blockchain in the form of a plug-in.
And 11, setting initial values for parameters and/or conditions in the executable file to obtain a consensus instance of the current consensus mechanism.
In a specific implementation, the blockchain network includes an initialization function of the consensus mechanism, where the initialization function is used to be called by a consensus module in the blockchain network in a form of a function according to a state of a current blockchain network when the consensus mechanism is deployed in the blockchain network, and to initialize the consensus mechanism, that is, to assign an initial value to a parameter and/or a condition included in an executable file of the consensus mechanism, so as to obtain a consensus instance of the consensus mechanism. In specific implementation, when the consensus mechanism is initialized, only initial values may be given to parameters in the executable file, only initial values may be given to conditions in the executable file, or both the initial values and the initial values may be given to the parameters in the executable file; the above process of initializing the consensus mechanism may also be understood as a process of instantiating the consensus mechanism.
Step S204, uploading the consensus instances of each consensus mechanism or the consensus instances of the default consensus mechanism to the ledger manager of the block chain, so as to invoke the consensus instances of the default consensus mechanism from the ledger manager through the node device, and perform a consensus sequencing operation on the services received by the node device.
The account book manager in the block chain is generally configured to manage an account book of each node device and a consensus mechanism of each node device, so that each node device can invoke a consensus instance of the consensus mechanism currently in an activated state from the account book manager, provide a consensus sorting service for a service currently received by the node device, and perform a consensus sorting operation on the currently received service. In a specific implementation, the initialized consensus instances of each of the multiple consensus mechanisms may be sent to the ledger manager of the blockchain, or only the consensus instance corresponding to the default consensus mechanism may be sent to the ledger manager of the blockchain, so that after the blockchain network is successfully started, the node device on the blockchain may automatically select the default consensus mechanism when performing consensus ranking.
Step S206, if a consensus mechanism change instruction is received, whether the account book manager of the block chain comprises a consensus instance of the target consensus mechanism is inquired; if not, executing the following step S208; otherwise, step S210 is performed.
Step S208, uploading the consensus instances of the target consensus mechanism to an account book manager; step S210 is performed.
The ledger manager of the block chain may store a consensus instance of multiple consensus mechanisms. When a change instruction of the consensus mechanism is received, in order to ensure that the account manager has a consensus instance corresponding to the target consensus mechanism, whether the account manager of the block chain includes the consensus instance of the target consensus mechanism needs to be inquired, if not, an instance uploading request needs to be returned, so that an administrator triggers an instance uploading control of the target consensus mechanism, and uploads the consensus instance of the target consensus mechanism to the account manager through the triggering operation, so that node devices in subsequent block chains can call the target consensus mechanism from the account manager to provide consensus sequencing service.
Step S210, updating the default consensus mechanism in the current node equipment to a target consensus mechanism, and notifying the specified equipment in the block chain to update the default consensus mechanism in the specified equipment to the target consensus mechanism; and calling the consensus instances of the target consensus mechanism from the account book manager to execute consensus sequencing operation on the received services by adopting the consensus instances of the target consensus mechanism.
In some embodiments, after the default consensus mechanisms in the current device and the designated device are both updated to the target consensus mechanism, it is necessary to query the ledger manager again whether a consensus instance of the target consensus mechanism is included in the ledger manager to ensure the accuracy of invoking the consensus mechanism, if not, the consensus instance of the target consensus mechanism needs to be uploaded to the ledger manager, and if so, the node device on the block chain may invoke the consensus instance of the target consensus mechanism from the ledger manager to perform a consensus sequencing operation on the received service by using the consensus instance of the target consensus mechanism.
Before starting up the blockchain network, the processing method of the consensus mechanism in the blockchain can initialize a plurality of consensus mechanisms at the same time, and select one of the consensus mechanisms as a default consensus mechanism; when the default consensus mechanism cannot meet the service requirement of the user, the user can directly replace the consensus mechanism without changing the configuration and restarting the blockchain network, so that the pluggable property of the blockchain consensus mechanism is realized, the flexibility of the blockchain network consensus mechanism is improved, and the further development of the blockchain ecology is facilitated.
The embodiment of the application also provides another processing method of a consensus mechanism in a block chain, which is applied to node equipment in the block chain, wherein the node equipment comprises a default consensus mechanism in an activated state; the default consensus mechanism is used to: providing consensus sequencing service for the service received by the node equipment; the node equipment in the method is mainly used for: if receiving a notification for changing the consensus mechanism, updating the default consensus mechanism in the current node equipment into a target consensus mechanism indicated by the notification; wherein, the notification is sent by the node equipment for providing the consensus sequencing service except the current node equipment in the block chain.
The current node device receiving the notification of changing the consensus mechanism in this embodiment is equivalent to any one of the designated devices in the above embodiments, and the current node device may update the default consensus mechanism currently in an active state to the target consensus mechanism according to the received notification of changing the consensus mechanism.
In order to facilitate understanding of the embodiment of the present invention, the following description focuses on specific steps (specifically, implemented by the following steps S302-S304) of updating, by the node device, the default consensus mechanism in the current node device to the target consensus mechanism indicated by the notification if the node device receives the notification for changing the consensus mechanism, and as shown in fig. 3, the process includes the following steps:
step S302, if a notice for changing the consensus mechanism is received, carrying out endorsement operation on the notice to obtain an endorsement result; wherein the endorsement operation is to verify whether the node device sending the notification is a designated node device.
During specific implementation, the notification of the change consensus mechanism carries the identity of the node device sending the notification, and the node device receiving the notification of the change consensus mechanism comprises the identity of the node device authorized to send the notification of the change consensus mechanism; and if the current node equipment receives the notification for changing the consensus mechanism, the identity carried in the notification needs to be matched with the identity stored in the current node equipment, if the matching is successful, the endorsement result of the current node equipment with successful endorsement is obtained, and otherwise, the endorsement result of the endorsement failure is obtained.
Step S304, if the endorsement result indicates that the node device sending the notification is the designated node device, updating the default consensus mechanism in the current node device to be the target consensus mechanism.
The specified node device is the node device that has the authority to send the notification of changing the consensus mechanism, and the endorsement result indicates that the node device sending the notification is the specified node device, that is, the endorsement is successful, and it can also be understood that the identity carried in the notification is matched with the identity stored in the current node device. And if the endorsement is successful, updating the default consensus mechanism in the current node equipment into the target consensus mechanism.
In some embodiments, in order to ensure the endorsement accuracy, it is necessary that more than half of the node devices on the block chain successfully endorse, so that the default consensus mechanism in the current node device may be updated to the target consensus mechanism.
In specific implementation, the account book manager of the block chain stores a consensus instance of multiple consensus mechanisms, and the consensus instance is used for executing a consensus sorting operation; the step S304 can also be realized by the following steps 20 to 22:
step 20, inquiring whether the account book manager contains a consensus instance of the target consensus mechanism; if not, step 21 is performed, if so, step 22 is performed.
And step 21, sending a consensus instance uploading instruction to the designated node equipment, so that the designated node equipment uploads the consensus instance of the target consensus mechanism to the ledger manager.
And step 22, calling the consensus instances of the target consensus mechanism from the account book manager to execute consensus sequencing operation on the services received by the node equipment by adopting the consensus instances of the target consensus mechanism.
According to the processing method of the consensus mechanism in the block chain, multiple consensus mechanisms are compatible in the block chain, and the pluggable property of the block chain consensus mechanism is realized, so that the mode completes the replacement operation of the consensus mechanism on the premise of not restarting a block chain network, the flexibility of the block chain network consensus mechanism is improved, a user can select and replace different consensus mechanisms according to business requirements, and the ecological development of the block chain is facilitated.
Corresponding to the above method embodiment, an embodiment of the present application provides a processing apparatus for a consensus mechanism in a blockchain, where the apparatus is disposed in a node device in the blockchain, and multiple consensus mechanisms and a default consensus mechanism in an activated state among the multiple consensus mechanisms are stored in the node device; the default consensus mechanism is used to: providing consensus sequencing service for the service received by the node equipment; as shown in fig. 4, the apparatus includes:
and a change instruction receiving module 40, configured to update the default consensus mechanism in the current node device to the target consensus mechanism indicated by the consensus mechanism change instruction if the consensus mechanism change instruction is received.
A mechanism change notification module 41, configured to notify a specified device in the blockchain, so as to update a default consensus mechanism in the specified device to a target consensus mechanism; wherein the specifying device includes: and in the block chain, except the current node equipment, the node equipment is used for providing the consensus sequencing service.
In the processing apparatus for the consensus mechanism in the block chain, if the current node device in the block chain receives the consensus mechanism change instruction, the default consensus mechanism in the current node device is updated to the target consensus mechanism indicated by the consensus mechanism change instruction; and notifying the appointed equipment of the node equipment for providing the consensus sequencing service except the current node equipment in the block chain, and updating a default consensus mechanism in the appointed equipment into a target consensus mechanism. In the method, a plurality of consensus mechanisms are compatible in the block chain, so that the node equipment in the block chain can change the instruction and the notification according to the consensus mechanism and change the used default consensus mechanism into the target consensus mechanism, therefore, the method completes the replacement operation of the consensus mechanism on the premise of not restarting the block chain network, improves the flexibility of the block chain network consensus mechanism, so that a user can select and replace different consensus mechanisms according to business requirements, and is favorable for further exploiting the block chain ecology.
Specifically, the block chain is a designated network; the multiple consensus mechanisms include: an inherent consensus mechanism specifying a network, and/or a user-defined consensus mechanism. In some embodiments, the designated network comprises a Fabric network.
Further, the apparatus further includes an initialization module configured to: initializing a plurality of consensus mechanisms to obtain a consensus example of each consensus mechanism; wherein the consensus instance is used to perform a consensus ranking operation.
Specifically, the initialization module is further configured to: for each of a plurality of consensus mechanisms, performing the following: compiling code of a current consensus mechanism into an executable file; and setting initial values for parameters and/or conditions in the executable file to obtain the consensus instance of the current consensus mechanism.
Further, the apparatus further includes a consensus instance uploading module configured to: uploading the consensus instances of each consensus mechanism or the consensus instances of the default consensus mechanism to an account manager of the block chain, so that the node device calls the consensus instances of the default consensus mechanism from the account manager to perform consensus sequencing operation on the services received by the node device.
In specific implementation, the account book manager of the block chain stores a consensus instance of multiple consensus mechanisms, and the consensus instance is used for executing a consensus sorting operation; the device also comprises an example query module used for querying whether the account book manager contains the consensus example of the target consensus mechanism; and if the common recognition instance of the target common recognition mechanism is not contained, uploading the common recognition instance of the target common recognition mechanism to the account book manager.
Further, the device further comprises an instance calling module, configured to query whether the ledger manager includes a consensus instance of the target consensus mechanism; if the consensus instance of the target consensus mechanism is contained, calling the consensus instance of the target consensus mechanism from the account book manager to execute consensus sequencing operation on the service received by the node equipment by adopting the consensus instance of the target consensus mechanism.
The processing apparatus of the consensus mechanism in the blockchain provided in the embodiments of the present application has the same implementation principle and technical effect as those of the foregoing method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the foregoing method embodiments for the part of the apparatus embodiments that is not mentioned.
Corresponding to the above method embodiment, the present application further provides another processing apparatus for a consensus mechanism in a block chain, where the apparatus is disposed in a node device in the block chain, and the node device includes a default consensus mechanism in an active state; the default consensus mechanism is used to: providing consensus sequencing service for the service received by the node equipment; the device includes: a mechanism changing module, configured to update a default consensus mechanism in current node equipment to a target consensus mechanism indicated by the notification if the notification for changing the consensus mechanism is received; wherein, the notification is sent by the node equipment for providing the consensus sequencing service except the current node equipment in the block chain.
Further, the mechanism changing module includes: the endorsement unit is used for carrying out an endorsement operation on the notification to obtain an endorsement result; wherein the endorsement operation is to verify whether the node device sending the notification is a designated node device; and the mechanism changing unit is used for updating the default consensus mechanism in the current node equipment into the target consensus mechanism if the endorsement result indicates that the node equipment sending the notification is the specified node equipment.
Specifically, the account book manager of the block chain stores a consensus instance of multiple consensus mechanisms, and the consensus instance is used for executing a consensus sequencing operation; the mechanism changing unit is used for inquiring whether the account book manager comprises a consensus instance of the target consensus mechanism; if the account book manager does not contain the consensus instances of the target consensus mechanism, sending a consensus instance uploading instruction to the appointed node equipment so that the appointed node equipment uploads the consensus instances of the target consensus mechanism to the account book manager; if the account book manager comprises the consensus instances of the target consensus mechanism, calling the consensus instances of the target consensus mechanism from the account book manager to execute consensus sequencing operation on the services received by the node equipment by adopting the consensus instances of the target consensus mechanism.
The processing device of the consensus mechanism in the block chain realizes compatibility of various consensus mechanisms in the block chain, realizes the pluggable property of the block chain consensus mechanism, and completes the replacement operation of the consensus mechanism on the premise of not restarting the block chain network by the mode, thereby improving the flexibility of the block chain network consensus mechanism, enabling a user to select and replace different consensus mechanisms according to business requirements, and being beneficial to further exploiting the ecology of the block chain.
Referring to fig. 5, the electronic device includes a processor 101 and a memory 100, where the memory 100 stores machine executable instructions that can be executed by the processor 101, and the processor 101 executes the machine executable instructions to implement the processing method of the consensus in the blockchain.
Further, the electronic device shown in fig. 5 further includes a bus 102 and a communication interface 103, and the processor 101, the communication interface 103, and the memory 100 are connected through the bus 102.
The memory 100 may include a high-speed Random Access Memory (RAM) and may further include a non-volatile memory (non-volatile memory), such as at least one disk memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 102 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
The processor 101 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 101. The processor 101 may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100, and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
The embodiment of the present application further provides a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the processing method of the block chain consensus mechanism, and specific implementation may refer to method embodiments, and is not described herein again.
The processing method and apparatus for a consensus mechanism in a block chain and the computer program product of an electronic device provided in the embodiments of the present application include a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementations may refer to the method embodiments and are not described herein again.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (14)

1. A processing method of consensus mechanism in a block chain is characterized in that the method is applied to node equipment in the block chain, wherein a plurality of consensus mechanisms and a default consensus mechanism in an activated state in the plurality of consensus mechanisms are stored in the node equipment; the default consensus mechanism is to: providing consensus sequencing service for the service received by the node equipment; the method comprises the following steps:
if a consensus mechanism change instruction is received, updating the default consensus mechanism in the current node equipment to a target consensus mechanism indicated by the consensus mechanism change instruction;
notifying a designated device in the blockchain to update the default consensus mechanism in the designated device to the target consensus mechanism; wherein the specifying device includes: and in the block chain, except the current node equipment, the node equipment is used for providing consensus sequencing service.
2. The method of claim 1, wherein the blockchain is a designated network; the plurality of consensus mechanisms include: an inherent consensus mechanism of the given network, and/or a user-defined consensus mechanism.
3. The method according to claim 1, wherein, before the step of updating the default consensus mechanism in the current node device to the target consensus mechanism indicated by the consensus mechanism change instruction, if a consensus mechanism change instruction is received, the method further comprises:
initializing the multiple consensus mechanisms to obtain a consensus instance of each consensus mechanism; wherein the consensus instance is used to perform a consensus ranking operation.
4. The method according to claim 3, wherein the step of initializing the plurality of consensus mechanisms to obtain a consensus instance for each of the consensus mechanisms comprises:
for each of the plurality of consensus mechanisms, performing the following:
compiling code of a current consensus mechanism into an executable file;
setting initial values for parameters and/or conditions in the executable file to obtain the consensus instances of the current consensus mechanism.
5. The method of claim 3, wherein after the step of initializing the plurality of consensus mechanisms to obtain a consensus instance for each of the consensus mechanisms, the method further comprises:
uploading the consensus instance of each consensus mechanism or the consensus instance of the default consensus mechanism to an accounting manager of the block chain, so that the node device calls the consensus instance of the default consensus mechanism from the accounting manager to perform consensus sequencing operation on the services received by the node device.
6. The method according to claim 1, wherein a ledger manager of the blockchain stores therein consensus instances of the plurality of consensus mechanisms, the consensus instances for performing consensus ranking operations;
before the step of updating the default consensus mechanism in the current node device to the target consensus mechanism indicated by the consensus mechanism change instruction, the method comprises:
inquiring whether a consensus instance of the target consensus mechanism is contained in the account book manager;
and if the common identification instance of the target common identification mechanism is not contained, uploading the common identification instance of the target common identification mechanism to the ledger manager.
7. The method according to claim 1, wherein a ledger manager of the blockchain stores therein consensus instances of the plurality of consensus mechanisms, the consensus instances for performing consensus ranking operations;
after the step of updating the default consensus mechanism in the current node device to the target consensus mechanism indicated by the consensus mechanism change instruction, the method includes:
inquiring whether a consensus instance of the target consensus mechanism is contained in the account book manager;
if the common recognition example of the target common recognition mechanism is contained, calling the common recognition example of the target common recognition mechanism from the account book manager so as to adopt the common recognition example of the target common recognition mechanism to execute common recognition sequencing operation on the service received by the node equipment.
8. A processing method of a consensus mechanism in a block chain is characterized in that the method is applied to node equipment in the block chain, and the node equipment comprises a default consensus mechanism in an activated state; the default consensus mechanism is to: providing consensus sequencing service for the service received by the node equipment; the method comprises the following steps:
if a notification for changing the consensus mechanism is received, updating the default consensus mechanism in the current node equipment to a target consensus mechanism indicated by the notification;
wherein the notification is sent by a node device for providing consensus sequencing service except the current node device in the block chain.
9. The method of claim 8, wherein if a notification to change the consensus mechanism is received, the step of updating the default consensus mechanism in the current node device to the target consensus mechanism indicated by the notification comprises:
carrying out endorsement operation on the notification to obtain an endorsement result; wherein the endorsement operation is to verify whether the node device sending the notification is a designated node device;
and if the endorsement result indicates that the node equipment sending the notification is the designated node equipment, updating a default consensus mechanism in the current node equipment to the target consensus mechanism.
10. The method according to claim 9, wherein a ledger manager of the blockchain stores consensus instances of multiple consensus mechanisms, the consensus instances being used to perform consensus ranking operations;
the step of updating the default consensus mechanism in the current node device to the target consensus mechanism if the endorsement result indicates that the node device sending the notification is the designated node device, includes:
inquiring whether a consensus instance of the target consensus mechanism is contained in the account book manager;
if the account book manager does not contain the consensus instance of the target consensus mechanism, sending a consensus instance uploading instruction to the designated node device, so that the designated node device uploads the consensus instance of the target consensus mechanism to the account book manager;
if the account book manager comprises the consensus instance of the target consensus mechanism, calling the consensus instance of the target consensus mechanism from the account book manager to adopt the consensus instance of the target consensus mechanism to execute consensus sequencing operation on the service received by the node equipment.
11. The device for processing the consensus mechanism in the block chain is characterized in that the device is arranged in node equipment in the block chain, a plurality of consensus mechanisms and a default consensus mechanism in an activated state in the plurality of consensus mechanisms are stored in the node equipment; the default consensus mechanism is to: providing consensus sequencing service for the service received by the node equipment; the device comprises:
a change instruction receiving module, configured to update the default consensus mechanism in the current node device to a target consensus mechanism indicated by the consensus mechanism change instruction if a consensus mechanism change instruction is received;
a mechanism change notification module, configured to notify a specific device in the blockchain to update the default consensus mechanism in the specific device to the target consensus mechanism; wherein the specifying device includes: and in the block chain, except the current node equipment, the node equipment is used for providing consensus sequencing service.
12. A processing device of a consensus mechanism in a block chain is characterized in that the device is arranged in a node device in the block chain, and the node device comprises a default consensus mechanism in an activated state; the default consensus mechanism is to: providing consensus sequencing service for the service received by the node equipment; the device comprises:
a mechanism changing module, configured to update the default consensus mechanism in the current node device to a target consensus mechanism indicated by the notification if a notification for changing the consensus mechanism is received;
wherein the notification is sent by a node device for providing consensus sequencing service except the current node device in the block chain.
13. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the processing method of the in-block-chain consensus mechanism of any one of claims 1 to 10.
14. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to carry out a method of processing the in-blockchain consensus mechanism of any one of claims 1 to 10.
CN202010735354.6A 2020-07-27 2020-07-27 Processing method and device for consensus mechanism in block chain and electronic equipment Pending CN111861469A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010735354.6A CN111861469A (en) 2020-07-27 2020-07-27 Processing method and device for consensus mechanism in block chain and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010735354.6A CN111861469A (en) 2020-07-27 2020-07-27 Processing method and device for consensus mechanism in block chain and electronic equipment

Publications (1)

Publication Number Publication Date
CN111861469A true CN111861469A (en) 2020-10-30

Family

ID=72947860

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010735354.6A Pending CN111861469A (en) 2020-07-27 2020-07-27 Processing method and device for consensus mechanism in block chain and electronic equipment

Country Status (1)

Country Link
CN (1) CN111861469A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114296831A (en) * 2021-12-30 2022-04-08 迅鳐成都科技有限公司 Dynamic loading method, device and system for block chain consensus algorithm and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107360248A (en) * 2017-07-31 2017-11-17 众安信息技术服务有限公司 For configuring the method and apparatus locally known together and computer-readable recording medium
CN107579848A (en) * 2017-08-30 2018-01-12 上海保险交易所股份有限公司 The method that common recognition node is dynamically changed in practical Byzantine failure tolerance common recognition mechanism
CN108647967A (en) * 2018-05-10 2018-10-12 北京京东尚科信息技术有限公司 Select the method, apparatus and common recognition node of block chain common recognition mechanism
CN108683539A (en) * 2018-05-21 2018-10-19 腾讯科技(深圳)有限公司 Management method, device, medium and the electronic equipment of block chain network
CN109002297A (en) * 2018-07-16 2018-12-14 百度在线网络技术(北京)有限公司 Dispositions method, device, equipment and the storage medium of common recognition mechanism
CN110365695A (en) * 2019-07-24 2019-10-22 中国工商银行股份有限公司 The block chain data interactive method and device of changeable common recognition algorithm
CN110674217A (en) * 2019-09-23 2020-01-10 百度在线网络技术(北京)有限公司 Block chain data processing method, device, equipment and medium
CN110766551A (en) * 2019-09-10 2020-02-07 中国科学院信息工程研究所 Alliance chain based on improved Kafka consensus mechanism and transaction method
CN110944046A (en) * 2019-11-21 2020-03-31 腾讯科技(深圳)有限公司 Control method of consensus mechanism and related equipment
CN111131184A (en) * 2019-12-06 2020-05-08 长沙理工大学 Autonomous adjusting method of block chain consensus mechanism
CN111260301A (en) * 2018-11-30 2020-06-09 北京京东尚科信息技术有限公司 Information processing method and device of block chain network and storage medium
CN111443998A (en) * 2019-01-17 2020-07-24 杨税令 Multi-layer segment type consensus method and system applied to block chain

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107360248A (en) * 2017-07-31 2017-11-17 众安信息技术服务有限公司 For configuring the method and apparatus locally known together and computer-readable recording medium
CN107579848A (en) * 2017-08-30 2018-01-12 上海保险交易所股份有限公司 The method that common recognition node is dynamically changed in practical Byzantine failure tolerance common recognition mechanism
CN108647967A (en) * 2018-05-10 2018-10-12 北京京东尚科信息技术有限公司 Select the method, apparatus and common recognition node of block chain common recognition mechanism
CN108683539A (en) * 2018-05-21 2018-10-19 腾讯科技(深圳)有限公司 Management method, device, medium and the electronic equipment of block chain network
CN109002297A (en) * 2018-07-16 2018-12-14 百度在线网络技术(北京)有限公司 Dispositions method, device, equipment and the storage medium of common recognition mechanism
CN111260301A (en) * 2018-11-30 2020-06-09 北京京东尚科信息技术有限公司 Information processing method and device of block chain network and storage medium
CN111443998A (en) * 2019-01-17 2020-07-24 杨税令 Multi-layer segment type consensus method and system applied to block chain
CN110365695A (en) * 2019-07-24 2019-10-22 中国工商银行股份有限公司 The block chain data interactive method and device of changeable common recognition algorithm
CN110766551A (en) * 2019-09-10 2020-02-07 中国科学院信息工程研究所 Alliance chain based on improved Kafka consensus mechanism and transaction method
CN110674217A (en) * 2019-09-23 2020-01-10 百度在线网络技术(北京)有限公司 Block chain data processing method, device, equipment and medium
CN110944046A (en) * 2019-11-21 2020-03-31 腾讯科技(深圳)有限公司 Control method of consensus mechanism and related equipment
CN111131184A (en) * 2019-12-06 2020-05-08 长沙理工大学 Autonomous adjusting method of block chain consensus mechanism

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GORENFLO, C ET AL.: "FastFabric: Scaling Hyperledger Fabric to 20, 000 Transactions per Second", 《 2019 IEEE INTERNATIONAL CONFERENCE ON BLOCKCHAIN AND CRYPTOCURRENCY (ICBC)》, pages 455 - 463 *
刘天野等: "基于区块链技术的密钥生命周期演示设计", 《密码学报》, vol. 7, no. 3, pages 404 - 420 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114296831A (en) * 2021-12-30 2022-04-08 迅鳐成都科技有限公司 Dynamic loading method, device and system for block chain consensus algorithm and storage medium

Similar Documents

Publication Publication Date Title
US20230113492A1 (en) Computer-implemented system and method for managing transactions over a blockchain network
CN109359957B (en) Safe multiparty computing method and related device
CN107566124B (en) Hash operation-based consensus establishing method, block chain system and storage medium
CN108848055B (en) Block chain consensus method, accounting node and node
US20190354518A1 (en) Chain mesh network for decentralized transaction systems
EP3586493B1 (en) Method for mining a block in a decentralized blockchain consensus network
CN111629039B (en) Block chain consensus method, client, endorsement node and sequencing node
CN110189128B (en) Distributed consensus method and device for block rapid generation
Das et al. Yoda: Enabling computationally intensive contracts on blockchains with byzantine and selfish nodes
US11367055B2 (en) Decentralized pooled mining for enabling proof-of-work on blockchains
CN108347483B (en) Decentralized computing system based on double-layer network
CN110400217B (en) Rule change processing method and device for intelligent contract
EP4006742A1 (en) Fork processing method and blockchain node
CN110084596B (en) Method and device for processing block chain mixed consensus
CN110599349A (en) Data processing method based on block chain network, related equipment and storage medium
CN111861469A (en) Processing method and device for consensus mechanism in block chain and electronic equipment
CN112822267B (en) Data processing method and device based on block chain
CN113112358A (en) Block chain-based decision method and device and electronic equipment
CN113282418A (en) Model aggregation processing method and device
CN113034137A (en) Data processing method and device based on block chain and related equipment
CN110458541B (en) Object replacement method and device based on block chain
CN112132669A (en) Online auction system, method, device and electronic equipment
CN112070503A (en) Contract execution method, device, equipment and storage medium based on block chain
WO2023116790A1 (en) Method and apparatus for executing computing task, and storage medium and electronic apparatus
CN115879889A (en) Service processing method and device based on block chain and computer 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