CN111447216B - Method and apparatus for changing consensus node - Google Patents

Method and apparatus for changing consensus node Download PDF

Info

Publication number
CN111447216B
CN111447216B CN202010218700.3A CN202010218700A CN111447216B CN 111447216 B CN111447216 B CN 111447216B CN 202010218700 A CN202010218700 A CN 202010218700A CN 111447216 B CN111447216 B CN 111447216B
Authority
CN
China
Prior art keywords
consensus
node set
nodes
common
access control
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010218700.3A
Other languages
Chinese (zh)
Other versions
CN111447216A (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.)
Baidu International Technology Shenzhen Co ltd
Original Assignee
Baidu International Technology Shenzhen 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 Baidu International Technology Shenzhen Co ltd filed Critical Baidu International Technology Shenzhen Co ltd
Priority to CN202010218700.3A priority Critical patent/CN111447216B/en
Publication of CN111447216A publication Critical patent/CN111447216A/en
Application granted granted Critical
Publication of CN111447216B publication Critical patent/CN111447216B/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
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • H04L63/101Access control lists [ACL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • 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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Abstract

The embodiment of the disclosure relates to the technical field of block chains, and discloses a method and a device for changing a common node. One embodiment of the method comprises: monitoring whether a consensus node in an access control list of a target account is changed, wherein the target account is an account controlled by a preset consensus node set, and the access control list comprises the consensus node set for controlling the target account; if the change occurs, obtaining the vote of the change of the consensus nodes in the consensus node set aiming at the consensus nodes in the access control list; determining a processing result aiming at the consensus node set based on the voting result, wherein the processing result represents whether the consensus node set is changed or not; and if the processing result represents that the consensus node set is changed, changing the consensus node set. The embodiment realizes the change of the common node set by changing the owner of the target account, and the mode is simpler and more efficient.

Description

Method and apparatus for changing consensus node
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a method and a device for changing a consensus node.
Background
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. In an actual blockchain network, an abnormality occurs in the behavior of a node, such as a failure, falsification or information discarding, etc., resulting in loss, damage, delay, or repeated transmission of data. In order to ensure that the blockchain network operates normally and that each node can receive correct data information, the blockchain network adopts a consensus mechanism to verify and confirm the transaction.
In some cases, changes need to be made to the consensus nodes in the blockchain network. The method for changing the consensus node is that a node to be added to the consensus node set initiates a proposal, the existing consensus node votes for the proposal, and determines whether to add the node to be added to the consensus node set based on the voting result.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for changing a consensus node.
In a first aspect, an embodiment of the present disclosure provides a method for changing a consensus node, including: monitoring whether a consensus node in an access control list of a target account is changed, wherein the target account is an account controlled by a preset consensus node set, and the access control list comprises the consensus node set for controlling the target account; if the change occurs, obtaining the vote of the change of the consensus nodes in the consensus node set aiming at the consensus nodes in the access control list; determining a processing result aiming at the consensus node set based on the voting result, wherein the processing result represents whether the consensus node set is changed or not; and if the processing result represents that the consensus node set is changed, changing the consensus node set.
In some embodiments, before listening for whether a change occurs to a consensus node in an access control list of a target account, the method further comprises: initializing the consensus node set by using preset creation parameters, wherein the creation parameters comprise: the target account, the consensus node identifier, the network address of the consensus node, and the consensus mechanism name.
In some embodiments, determining a processing result for the set of consensus nodes based on the voting result comprises: determining whether the number of tickets of the support tickets changed aiming at the common identification nodes in the access control list is larger than a preset ticket number threshold value; and if so, determining the processing result aiming at the common identification node set as changing the common identification node set.
In some embodiments, the access control list includes voting weights corresponding to the consensus nodes in the set of consensus nodes; and determining whether the number of tickets of the support tickets changed for the common identification node in the access control list is greater than a preset threshold value of the number of tickets, including: adding voting weights corresponding to the common identification nodes from which the support tickets are changed aiming at the common identification nodes in the access control list to obtain the number of the support tickets; it is determined whether the number of tickets supported is greater than a preset threshold number of tickets.
In some embodiments, determining a processing result for the set of consensus nodes based on the voting result comprises: determining the ratio of the number of tickets of the support tickets which are changed aiming at the common identification nodes in the access control list to the number of the common identification nodes in the common identification node set; determining whether the ratio is greater than a preset ratio threshold; and if so, determining the processing result aiming at the common identification node set as changing the common identification node set.
In a second aspect, an embodiment of the present disclosure provides an apparatus for changing a consensus node, including: the monitoring unit is configured to monitor whether a consensus node in an access control list of a target account is changed, wherein the target account is an account controlled by a preset consensus node set, and the access control list comprises the consensus node set for controlling the target account; the acquisition unit is configured to acquire votes of the consensus nodes in the consensus node set for the change of the consensus nodes in the access control list if the change occurs; a determination unit configured to determine a processing result for the set of consensus nodes based on the voting result, wherein the processing result characterizes whether to modify the set of consensus nodes; and the changing unit is configured to change the common node set if the processing result represents that the common node set is changed.
In some embodiments, the apparatus further comprises: the initialization unit is configured to initialize the consensus node set by using preset creation parameters, wherein the creation parameters include: the target account, the consensus node identifier, the network address of the consensus node, and the consensus mechanism name.
In some embodiments, the determining unit is further configured to determine the processing result for the set of consensus nodes based on the voting result by: determining whether the number of tickets of the support tickets changed aiming at the common identification nodes in the access control list is larger than a preset ticket number threshold value; and if so, determining the processing result aiming at the common identification node set as changing the common identification node set.
In some embodiments, the access control list includes voting weights corresponding to the consensus nodes in the set of consensus nodes; and the determining unit is further configured to determine whether the number of tickets of the support ticket changed for the common node in the access control list is greater than a preset threshold of number of tickets by: adding voting weights corresponding to the common identification nodes from which the support tickets are changed aiming at the common identification nodes in the access control list to obtain the number of the support tickets; it is determined whether the number of tickets supported is greater than a preset threshold number of tickets.
In some embodiments, the determining unit is further configured to determine the processing result for the set of consensus nodes based on the voting result by: determining the ratio of the number of tickets of the support tickets which are changed aiming at the common identification nodes in the access control list to the number of the common identification nodes in the common identification node set; determining whether the ratio is greater than a preset ratio threshold; and if so, determining the processing result aiming at the common identification node set as changing the common identification node set.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, which, when executed by the one or more processors, cause the one or more processors to implement the method as described in any implementation manner of the first aspect.
In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
According to the method and the device for changing the consensus node, provided by the embodiment of the disclosure, whether the consensus node in the access control list of the target account is changed or not is monitored; if the change occurs, obtaining the vote of the change of the consensus nodes in the consensus node set aiming at the consensus nodes in the access control list; then, based on the voting result, determining a processing result aiming at the consensus node set; if the processing result represents that the common node set is changed, the common node set can be changed. The target account number and the consensus node set can be associated in the mode, the change of the consensus node set is achieved in a mode of changing the owner of the target account, and the mode is simpler and more efficient.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which various embodiments of the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for altering a consensus node, according to the present disclosure;
fig. 3 is a flow diagram of another embodiment of a method for altering a consensus node according to the present disclosure;
fig. 4 is a flow diagram of yet another embodiment of a method for altering a consensus node according to the present disclosure;
FIG. 5 is a block diagram illustrating one embodiment of an apparatus for altering a consensus node according to the present disclosure;
FIG. 6 is a schematic block diagram of a computer system suitable for use with an electronic device implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the disclosed method for altering consensus nodes may be applied.
As shown in fig. 1, the system architecture 100 may include a change node 101, a network 102, and consensus nodes 1031, 1032, 1033. The network 102 is used to provide a medium for communication links between the change node 101 and the consensus nodes 1031, 1032, 1033. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
It should be noted that the change node 101 and the consensus nodes 1031, 1032, 1033 are computers existing in the same blockchain network, and include, but are not limited to, smart phones, tablet computers, laptop computers, desktop computers, servers, and the like. The consensus node 1031, the consensus node 1032 and the consensus node 1033 also have a network providing communication links between each other, not shown in fig. 1.
Note that the change node 101 may be a consensus node, and may be present in a set of consensus nodes where the consensus nodes 1031, 1032, and 1033 are present.
The change node 101 may first monitor whether a consensus node in the access control list of the target account is changed; if the change occurs, votes of the change of the consensus nodes (e.g., consensus nodes 1031, 1032, 1033) in the consensus node set for the consensus nodes in the access control list may be obtained; then, based on the voting result, a processing result for the consensus node set (the consensus node set including the consensus nodes 1031, 1032, 1033) may be determined; if the processing result represents that the common node set is changed, the common node set can be changed.
Consensus nodes 1031, 1032, 1033 are typically nodes that participate in consensus in a blockchain network for completing verification and validation of transactions in a short amount of time.
The change node 101 and the consensus nodes 1031, 1032, 1033 may be hardware or software. When the change node 101 and the consensus nodes 1031, 1032, 1033 are hardware, they may be various electronic devices that support information interaction, including but not limited to smart phones, tablets, laptop computers, desktop computers, servers, and the like. When the change node 101 and the consensus nodes 1031, 1032, 1033 are software, they may be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules, or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the method for changing the consensus node provided by the embodiments of the present disclosure is generally performed by the change node 101.
It should be understood that the number of change nodes, networks, and consensus nodes in fig. 1 is merely illustrative. There may be any number of change nodes, networks, and consensus nodes, as desired for an implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for altering a consensus node is shown, in accordance with the present disclosure. The method for changing the consensus node comprises the following steps:
step 201, monitoring whether the consensus node in the access control list of the target account is changed.
In this embodiment, an execution subject of the method for changing the consensus node (e.g., the change node shown in fig. 1) may monitor whether the consensus node in the Access Control List (ACL) of the target account is changed. If the consensus node in the access control list of the target account is changed, step 202 may be executed.
In this embodiment, the execution subject may be a node in the blockchain network, and the node may be configured to change a consensus node in the blockchain network. The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. The consensus mechanism is that the verification and confirmation of the transaction is completed in a short time through the voting of a special node. For a transaction, if several nodes with irrelevant benefits can achieve consensus, we can consider that the whole network can achieve consensus for the node. Here, the target account is generally an account controlled by a preset consensus node set, and the consensus nodes in the consensus node set are generally nodes participating in consensus and generally include the special node.
It should be noted that the consensus mechanism used in the blockchain network may include a Proof-of-Authority (POA) consensus algorithm, which is a reputation-based consensus algorithm that uses the value of identity, meaning that the verifier of the blockchain is chosen to rely on not the secured cryptocurrency but the reputation of the individual. Authoritative people (consensus nodes) use their reputations to verify transactions and blocks, and by binding identity and reputation together witnesses are motivated to verify transactions and maintain network security.
In this embodiment, the access control list is a packet filtering based access control technique that can filter the data packets on the interface according to the set conditions, allowing them to pass or drop. The access control list typically includes a set of consensus nodes that control the target account.
Here, the changing of the common node in the access control list may include adding a new common node to the access control list, or may include deleting an original common node from the access control list. The consensus nodes in the access control list may be characterized by node identities. The node identifier may include a key pair corresponding to the node, and may also include an identity of the node generated based on the corresponding key pair.
Step 202, if the change occurs, obtaining votes of the consensus nodes in the consensus node set for the change of the consensus nodes in the access control list.
In this embodiment, if it is monitored in step 202 that the consensus node in the access control list of the target account is changed, the execution main body may obtain a vote that the consensus node in the consensus node set is changed for the consensus node in the access control list. The vote may reflect whether the consensus node in the set of consensus nodes agrees with the event that the consensus node in the set of consensus nodes changes to the consensus node in the access control list.
The execution agent may send a vote acquisition request to each consensus node in the set of consensus nodes, and then receive a vote returned by the consensus node to change the consensus node in the access control list. The votes may include support, opposition and revocation votes. In some cases, the votes may also include only the support votes, which may be characterized by the signatures of the consensus nodes, as an example. In this case, when the signature transmitted by the consensus node is received, it can be characterized that the consensus node supports the change of the consensus node in the access control list.
And step 203, determining a processing result aiming at the consensus node set based on the voting result.
In this embodiment, the execution subject may determine a processing result for the consensus node set based on the voting result. The processing result may indicate whether the common node set is to be changed. The changing of the common node set may be synchronizing the common node, which is changed in the access control list, with the common node set. For example, the common node set may be changed by using a character "1" or "T", and in this case, the common node set may not be changed by using a character "0" or "F".
Here, the access control list may include a voting policy. The voting strategy may include agreeing upon receipt of a support vote for a designated consensus node. At this time, the execution body may determine whether a support ticket of the designated consensus node is received. If the support ticket of the designated common node is received, the processing result of the common node set can be determined as the change of the common node set. If the support ticket of the designated common node is not received, the processing result of the common node set can be determined not to change the common node set.
And step 204, determining whether the processing result represents that the common node set is changed.
In this embodiment, the executing entity may determine whether the processing result determined in step 204 represents a change to the common node set. As an example, if the processing result is a character "1" or "T", it may be determined that the common node set is changed; if the processing result is the character "0" or "F", it can be determined that the common node set is not to be changed. If it is determined that the processing result indicates that the common node set is changed, step 205 may be performed.
And step 205, if the processing result represents that the consensus node set is changed, changing the consensus node set.
In this embodiment, if it is determined in step 204 that the processing result indicates that the common node set is to be changed, the execution subject may change the common node set. Specifically, the execution agent may synchronize the common node, which is changed in the access control list, into the common node set. For example, if a new consensus node D is added to the access control list, the executing entity may add the added consensus node D to the set of consensus nodes. If an original consensus node a is deleted from the access control list, the executing agent may delete the consensus node a from the set of consensus nodes.
In some optional implementation manners of this embodiment, the execution subject may initialize the consensus node set by using a preset creation parameter. Specifically, the consensus nodes may be specified by using the creation parameters to form a consensus node set. The creation parameter may be a parameter configured for a creation block. The blockchain is generally composed of a plurality of connected blocks, each block records the transaction condition of bitcoin in the network for a period of time, and the blocks can be regarded as account pages in the account book. The first block to be constructed earliest is called a founder block and has a unique ID number. The creating parameters may include: the target account, the consensus node identifier, the network address of the consensus node, and the consensus mechanism name are described above. The consensus node identification may be an identity of the node generated based on the corresponding key pair. Here, the above-mentioned common recognition mechanism name may include POA.
In some optional implementations of the embodiment, the execution subject may determine the processing result for the consensus node set based on the voting result by: the execution subject may count the number of tickets of the support ticket that is changed for the consensus node in the access control list; then, whether the number of the tickets supported by the ticket is larger than a preset ticket number threshold value or not can be determined; the execution agent may determine that the processing result for the common node set is to be changed if it is determined that the number of tickets of the support ticket is greater than the ticket number threshold.
According to the method provided by the embodiment of the disclosure, the target account number is associated with the consensus node set, and the change of the consensus node set is realized by changing the owner of the target account, so that the method is simpler and more efficient.
With further reference to fig. 3, a flow 300 of another embodiment of a method for altering a consensus node according to the present disclosure is shown, comprising the steps of:
step 301, monitoring whether the consensus node in the access control list of the target account is changed.
Step 302, if the change occurs, obtaining the vote of the change of the consensus node in the consensus node set aiming at the consensus node in the access control list.
In the present embodiment, the steps 301-302 can be performed in a similar manner to the steps 201-202, and will not be described herein again.
Step 303, adding the voting weights corresponding to the common identification nodes from which the support votes changed with respect to the common identification nodes in the access control list are derived, and taking the sum as the number of votes of the support votes.
In this embodiment, the access control list may include voting weights corresponding to the common nodes in the common node set. The execution agent for changing the common recognition node may add voting weights corresponding to the common recognition nodes from which the support votes changed for the common recognition node in the access control list are derived, as the number of votes of the support votes. For example, if the consensus node a, the consensus node D, and the consensus node E change and cast a support vote for the consensus node in the access control list, the voting weight for the consensus node a is 1, the voting weight for the consensus node D is 0.5, and the voting weight for the consensus node E is 0.3, the execution body may determine 1.8 obtained by adding the voting weight 1 for the consensus node a, the voting weight 0.5 for the consensus node D, and the voting weight 0.3 for the consensus node E as the number of votes for the support vote.
Step 304, determining whether the number of tickets supported is greater than a preset threshold number of tickets.
In this embodiment, the executing entity may determine whether the number of tickets of the support ticket determined in step 303 is greater than a preset threshold number of tickets (e.g., 1.5). If it is determined that the number of tickets of the support ticket is greater than the ticket number threshold, the executing entity may execute step 305.
If yes, the processing result of the common node set is determined as changing the common node set in the step 305.
In this embodiment, if it is determined in step 305 that the number of tickets of the support ticket is greater than the ticket number threshold, the execution main body may determine the processing result for the common node set as a change to the common node set. For example, if the common node set is changed by using a character "1" or "T" as a token, the execution subject may determine that the processing result for the common node set is the character "1" or "T".
Step 306, determining whether the processing result represents that the common node set is changed.
And 307, if the processing result represents that the consensus node set is changed, changing the consensus node set.
In the present embodiment, the steps 306-307 can be performed in a similar manner to the steps 204-205, and are not described herein again.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the flow 300 of the method for changing the common node in this embodiment represents a step of adding the voting weights corresponding to the common node from which the support ticket is derived as the number of votes of the support ticket, determining whether the number of votes of the support ticket is greater than a preset threshold value of the number of votes, and if so, determining the processing result as changing the common node set. Therefore, the scheme described in the embodiment provides a way of determining the processing result for the consensus node set based on the voting result, thereby improving the flexibility of the processing result determination way.
With further reference to fig. 4, there is shown a flow 400 of yet another embodiment of a method for altering a consensus node according to the present disclosure, comprising the steps of:
and step 401, monitoring whether the consensus node in the access control list of the target account is changed.
Step 402, if the change occurs, obtaining votes of the consensus nodes in the consensus node set for the change of the consensus nodes in the access control list.
In the present embodiment, the steps 401-402 can be performed in a similar manner to the steps 201-202, and are not described herein again.
Step 403, determining the ratio of the number of tickets of the support tickets changed for the common node in the access control list to the number of common nodes in the common node set.
In this embodiment, the executing entity for changing the consensus node may count the number of tickets of the consensus node in the consensus node set that changes for the consensus node in the access control list, and then may determine a ratio of the number of tickets of the support tickets to the number of consensus nodes in the consensus node set. For example, if the number of tickets for the support ticket is 6 tickets and the number of common nodes in the common node set is 8, the ratio of the number of tickets for the support ticket 6 to the number of common nodes in the common node set is 0.75.
At step 404, it is determined whether the ratio is greater than a predetermined ratio threshold.
In this embodiment, the execution subject may determine whether the ratio determined in step 403 is greater than a preset ratio threshold (e.g., 0.7). If it is determined that the ratio is greater than the ratio threshold, the executing entity may execute step 405.
And 405, if so, determining the processing result aiming at the consensus node set as the change of the consensus node set.
In this embodiment, if it is determined in step 404 that the ratio is greater than the ratio threshold, the execution subject may determine the processing result for the common node set as a change to the common node set. For example, if the common node set is changed by using a character "1" or "T" as a token, the execution subject may determine that the processing result for the common node set is the character "1" or "T".
Step 406, determining whether the processing result represents that the common node set is changed.
Step 407, if the processing result represents that the consensus node set is changed, the consensus node set is changed.
In the present embodiment, the steps 406-407 can be performed in a similar manner to the steps 204-205, and are not described herein again.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for changing the consensus node in this embodiment embodies the steps of determining the ratio of the number of tickets supporting the tickets to the number of consensus nodes in the consensus node set, and determining the initial result by using the ratio. Therefore, the scheme described in the embodiment provides another way for determining the processing result for the consensus node set based on the voting result, thereby further improving the flexibility of the processing result determination way.
With further reference to fig. 5, as an implementation of the method shown in the above figures, the present disclosure provides an embodiment of an apparatus for changing a consensus node, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be applied to various electronic devices in particular.
As shown in fig. 5, the apparatus 500 for changing a consensus node of the present embodiment includes: a listening unit 501, an acquisition unit 502, a determination unit 503, and a change unit 504. The monitoring unit 501 is configured to monitor whether a consensus node in an access control list of a target account is changed, where the target account is an account controlled by a preset consensus node set, and the access control list includes a consensus node set controlling the target account; the obtaining unit 502 is configured to obtain, if the change occurs, a vote that the consensus node in the consensus node set changes for the consensus node in the access control list; the determining unit 503 is configured to determine a processing result for the set of consensus nodes based on the voting result, wherein the processing result characterizes whether to modify the set of consensus nodes; the changing unit 504 is configured to change the set of consensus nodes if the processing result indicates that the set of consensus nodes is changed.
In this embodiment, the specific processes of the listening unit 501, the obtaining unit 502, and the determining unit 503 of the apparatus 500 for changing a consensus node may refer to step 201, step 202, and step 203 in the corresponding embodiment of fig. 2, and the specific processes of the changing unit 504 of the apparatus 500 for changing a consensus node may refer to step 204 and step 205 in the corresponding embodiment of fig. 2.
In some optional implementations of the present embodiment, the apparatus 500 for changing a common node may further include an initialization unit (not shown in the figure). The initialization unit may initialize the consensus node set by using a preset creation parameter. Specifically, the initialization unit may designate the consensus nodes by using the creation parameters to form a consensus node set. The creation parameter may be a parameter configured for a creation block. The blockchain is generally composed of a plurality of connected blocks, each block records the transaction condition of bitcoin in the network for a period of time, and the blocks can be regarded as account pages in the account book. The first block to be constructed earliest is called a founder block and has a unique ID number. The creating parameters may include: the target account, the consensus node identifier, the network address of the consensus node, and the consensus mechanism name are described above. The consensus node identification may be an identity of the node generated based on the corresponding key pair. Here, the above-mentioned common recognition mechanism name may include POA.
In some optional implementations of the present embodiment, the determining unit 503 may determine the processing result for the common node set based on the voting result by: the determining unit 503 may count the number of tickets of the support tickets that are changed for the consensus node in the access control list; then, whether the number of the tickets supported by the ticket is larger than a preset ticket number threshold value or not can be determined; if it is determined that the number of tickets of the support ticket is greater than the ticket number threshold, the determining unit 503 may determine the processing result for the common node set as a change to the common node set.
In some optional implementations of the embodiment, the access control list may include voting weights corresponding to the common nodes in the common node set. The determining unit 503 may add voting weights corresponding to the common identification nodes from which the support votes changed with respect to the common identification nodes in the access control list, as the number of votes of the support votes. After that, the determining unit 503 may determine whether the number of tickets of the support ticket is greater than a preset threshold value of the number of tickets. If it is determined that the number of tickets of the support ticket is greater than the ticket number threshold, the determining unit 503 may determine the processing result for the common node set as a change to the common node set. For example, if the common node set is changed by using a character "1" or a character "T", the determining unit 503 may determine the processing result for the common node set as the character "1" or the character "T".
In some optional implementation manners of this embodiment, the determining unit 503 may count the number of tickets of the common node in the common node set that is changed for the common node in the access control list, and then the determining unit 503 may determine a ratio of the number of tickets of the common node in the common node set to the number of common nodes in the common node set. After that, the determining unit 503 may determine whether the ratio is greater than a preset ratio threshold. If it is determined that the ratio is greater than the ratio threshold, the determining unit 503 may determine the processing result for the common node set as a change to the common node set. For example, if the common node set is changed by using a character "1" or a character "T", the determining unit 503 may determine the processing result for the common node set as the character "1" or the character "T".
Referring now to fig. 6, a schematic diagram of an electronic device (e.g., change node in fig. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure. It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: monitoring whether a consensus node in an access control list of a target account is changed, wherein the target account is an account controlled by a preset consensus node set, and the access control list comprises the consensus node set for controlling the target account; if the change occurs, obtaining the vote of the change of the consensus nodes in the consensus node set aiming at the consensus nodes in the access control list; determining a processing result aiming at the consensus node set based on the voting result, wherein the processing result represents whether the consensus node set is changed or not; and if the processing result represents that the consensus node set is changed, changing the consensus node set.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a listening unit, an acquisition unit, a determination unit, and a change unit. The names of these units do not form a limitation on the unit itself in some cases, for example, a listening unit may also be described as a "unit that listens for whether a change occurs to a consensus node in an access control list of a target account".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (12)

1. A method for altering a consensus node, comprising:
monitoring whether a common node in an access control list of a target account is changed, wherein the target account is an account controlled by a preset common node set, and the access control list comprises a common node set for controlling the target account;
if the change occurs, obtaining the vote of the change of the consensus nodes in the consensus node set aiming at the consensus nodes in the access control list;
determining a processing result for the set of consensus nodes based on the voting result, wherein the processing result characterizes whether to alter the set of consensus nodes;
and if the processing result represents that the consensus node set is changed, changing the consensus node set.
2. The method of claim 1, wherein prior to whether a change occurs to a consensus node in an access control list of the listening target account, the method further comprises:
initializing a consensus node set by using preset creation parameters, wherein the creation parameters comprise: the target account, the consensus node identifier, the network address of the consensus node and the consensus mechanism name.
3. The method of claim 1, wherein the determining a processing result for the set of consensus nodes based on the voting results comprises:
determining whether the number of tickets of the support tickets changed aiming at the common identification nodes in the access control list is larger than a preset ticket number threshold value;
and if so, determining the processing result aiming at the common identification node set as changing the common identification node set.
4. The method of claim 3, wherein the access control list comprises voting weights corresponding to consensus nodes in the set of consensus nodes; and
the determining whether the number of tickets of the support tickets changed for the common node in the access control list is greater than a preset threshold value of the number of tickets includes:
adding voting weights corresponding to the common identification nodes from which the support tickets are changed aiming at the common identification nodes in the access control list to obtain the number of the support tickets;
determining whether the number of tickets of the support tickets is larger than a preset ticket number threshold value.
5. The method of claim 1, wherein the determining a processing result for the set of consensus nodes based on the voting results comprises:
determining a ratio of the number of tickets of the support tickets changed for the common nodes in the access control list to the number of common nodes in the common node set;
determining whether the ratio is greater than a preset ratio threshold;
and if so, determining the processing result aiming at the common identification node set as changing the common identification node set.
6. An apparatus for altering a consensus node, comprising:
the monitoring unit is configured to monitor whether a consensus node in an access control list of a target account is changed, wherein the target account is an account controlled by a preset consensus node set, and the access control list comprises the consensus node set controlling the target account;
an obtaining unit configured to obtain, if a change occurs, a vote that a consensus node in the consensus node set changes for a consensus node in the access control list;
a determination unit configured to determine a processing result for the set of consensus nodes based on the voting result, wherein the processing result characterizes whether to modify the set of consensus nodes;
a changing unit configured to change the common node set if the processing result indicates that the common node set is changed.
7. The apparatus of claim 6, wherein the apparatus further comprises:
an initialization unit configured to initialize the consensus node set by using preset creation parameters, wherein the creation parameters include: the target account, the consensus node identifier, the network address of the consensus node and the consensus mechanism name.
8. The apparatus of claim 6, wherein the determining unit is further configured to determine a processing result for the set of consensus nodes based on the voting results by:
determining whether the number of tickets of the support tickets changed aiming at the common identification nodes in the access control list is larger than a preset ticket number threshold value;
and if so, determining the processing result aiming at the common identification node set as changing the common identification node set.
9. The apparatus of claim 8, wherein the access control list comprises voting weights corresponding to consensus nodes in the set of consensus nodes; and
the determining unit is further configured to determine whether the number of tickets of the support ticket changed for the common node in the access control list is greater than a preset threshold number of tickets by:
adding voting weights corresponding to the common identification nodes from which the support tickets are changed aiming at the common identification nodes in the access control list to obtain the number of the support tickets;
determining whether the number of tickets of the support tickets is larger than a preset ticket number threshold value.
10. The apparatus of claim 6, wherein the determining unit is further configured to determine a processing result for the set of consensus nodes based on the voting results by:
determining a ratio of the number of tickets of the support tickets changed for the common nodes in the access control list to the number of common nodes in the common node set;
determining whether the ratio is greater than a preset ratio threshold;
and if so, determining the processing result aiming at the common identification node set as changing the common identification node set.
11. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN202010218700.3A 2020-03-25 2020-03-25 Method and apparatus for changing consensus node Active CN111447216B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010218700.3A CN111447216B (en) 2020-03-25 2020-03-25 Method and apparatus for changing consensus node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010218700.3A CN111447216B (en) 2020-03-25 2020-03-25 Method and apparatus for changing consensus node

Publications (2)

Publication Number Publication Date
CN111447216A CN111447216A (en) 2020-07-24
CN111447216B true CN111447216B (en) 2021-12-10

Family

ID=71652427

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010218700.3A Active CN111447216B (en) 2020-03-25 2020-03-25 Method and apparatus for changing consensus node

Country Status (1)

Country Link
CN (1) CN111447216B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112887436B (en) * 2021-04-28 2021-08-03 支付宝(杭州)信息技术有限公司 Consensus method, consensus node and block chain system of pipeline mode

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878000A (en) * 2017-03-06 2017-06-20 中钞信用卡产业发展有限公司北京智能卡技术研究院 A kind of alliance's chain common recognition method and system
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
CN109309723A (en) * 2018-08-18 2019-02-05 上海分布信息科技有限公司 A kind of common recognition node variation and its realize system
CN110266765A (en) * 2019-05-21 2019-09-20 西安中星测控有限公司 A kind of Internet of Things based on block chain is known together node real time updating method and device online
CN110800255A (en) * 2019-03-04 2020-02-14 阿里巴巴集团控股有限公司 Updating block chain world state mercker patricia dictionary tree subtree
CN110912990A (en) * 2019-11-21 2020-03-24 腾讯科技(深圳)有限公司 Method and related equipment for updating consensus period

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11310234B2 (en) * 2017-11-16 2022-04-19 International Business Machines Corporation Securing permissioned blockchain network from pseudospoofing network attacks
US11323262B2 (en) * 2018-03-13 2022-05-03 Paul Zawierka Method and system for verifying a voter through the use of blockchain validation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878000A (en) * 2017-03-06 2017-06-20 中钞信用卡产业发展有限公司北京智能卡技术研究院 A kind of alliance's chain common recognition method and system
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
CN109309723A (en) * 2018-08-18 2019-02-05 上海分布信息科技有限公司 A kind of common recognition node variation and its realize system
CN110800255A (en) * 2019-03-04 2020-02-14 阿里巴巴集团控股有限公司 Updating block chain world state mercker patricia dictionary tree subtree
CN110266765A (en) * 2019-05-21 2019-09-20 西安中星测控有限公司 A kind of Internet of Things based on block chain is known together node real time updating method and device online
CN110912990A (en) * 2019-11-21 2020-03-24 腾讯科技(深圳)有限公司 Method and related equipment for updating consensus period

Also Published As

Publication number Publication date
CN111447216A (en) 2020-07-24

Similar Documents

Publication Publication Date Title
JP7030981B2 (en) Asset management methods and equipment, and electronic devices
CN108712257B (en) Cross-block-chain authentication method and device and electronic equipment
CN111602161B (en) Blockchain Data Protection Based on Universal Account Model and Homomorphic Encryption
US11170092B1 (en) Document authentication certification with blockchain and distributed ledger techniques
KR102002509B1 (en) Privite blockchain system including notarizing center and notarial method thereof
US11030681B2 (en) Intermediate blockchain system for managing transactions
CN101960464B (en) Information processing device
EP3247070B1 (en) Cryptocurrency-based event participation verification
KR20200059234A (en) Smart contract execution with distributed reconciliation
EP3739538A1 (en) System and method of supporting reflection of transactions between blockchain networks
CN110177124B (en) Identity authentication method based on block chain and related equipment
CN110597916B (en) Data processing method and device based on block chain, storage medium and terminal
US20210014064A1 (en) Method and apparatus for managing user authentication in a blockchain network
CN110400217B (en) Rule change processing method and device for intelligent contract
CN112075062A (en) Automated commit transaction management in blockchain networks
CN110908786A (en) Intelligent contract calling method, device and medium
JP2023542681A (en) Integrating device identity into blockchain permission frameworks
CN114039733B (en) Certificate storage service transfer method, device and equipment for alliance chains
CN114500119B (en) Method and device for calling block chain service
CN111447216B (en) Method and apparatus for changing consensus node
CN110599384A (en) Organization relation transfer method, device, equipment and storage medium
CN111222885B (en) Data processing request endorsement method and device, computer equipment and storage medium
CN113474804A (en) Transaction and account verification method, device and storage medium of digital currency
CN110225103B (en) Service recommendation method, device and equipment
CN112688775A (en) Management method and device of alliance chain intelligent contract, electronic equipment and medium

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