CN110460471B - Super node election method, device and storage medium - Google Patents

Super node election method, device and storage medium Download PDF

Info

Publication number
CN110460471B
CN110460471B CN201910757152.9A CN201910757152A CN110460471B CN 110460471 B CN110460471 B CN 110460471B CN 201910757152 A CN201910757152 A CN 201910757152A CN 110460471 B CN110460471 B CN 110460471B
Authority
CN
China
Prior art keywords
node
transaction
super
longitude
latitude
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
CN201910757152.9A
Other languages
Chinese (zh)
Other versions
CN110460471A (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.)
Guangzhou Ant Bit Block Chain Technology Co ltd
Original Assignee
Guangzhou Ant Bit Block Chain 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 Guangzhou Ant Bit Block Chain Technology Co ltd filed Critical Guangzhou Ant Bit Block Chain Technology Co ltd
Priority to CN201910757152.9A priority Critical patent/CN110460471B/en
Publication of CN110460471A publication Critical patent/CN110460471A/en
Application granted granted Critical
Publication of CN110460471B publication Critical patent/CN110460471B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/30Decision processes by autonomous network management units using voting and bidding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • 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/107Network architectures or network communication protocols for network security for controlling access to devices or network resources wherein the security policies are location-dependent, e.g. entities privileges depend on current location or allowing specific operations only from locally connected terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/52Network services specially adapted for the location of the user terminal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Abstract

An object of an embodiment of the present application is to provide a super node election method, apparatus and storage medium, which are applied to a node, where the method includes: determining the distance between the node and the node initiating the transaction; judging whether the distance exceeds a preset distance or not; if so, the nodes compete for the super nodes through the verifiable random function, and determine that the super nodes are the super nodes after the requirements of the verifiable random function are met.

Description

Super node election method, device and storage medium
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a super node election method, device and storage medium.
Background
At present, a selection method of a super node is generally random selection, for example, a plurality of nodes are randomly selected from 100 nodes participating in election of the super node as the super node, but the random selection method may cause that the selected super node is too close to a node initiated by a transaction, thereby causing a problem of cheating.
Disclosure of Invention
An object of the embodiments of the present application is to provide a super node election method, an apparatus, and a storage medium, which are used to solve the problem that cheating is caused when a randomly selected super node is too close to a node initiated by a transaction.
In order to achieve the above object, the present application provides the following technical solutions:
in a first aspect: the application provides a super node election method, which is applied to nodes and comprises the following steps:
determining a distance between the node and a node initiating a transaction;
judging whether the distance exceeds a preset distance or not;
if so, the nodes select the super nodes through the verifiable random function, and determine that the super nodes are the super nodes after the requirements of the verifiable random function are met.
According to the method designed by the scheme, before nodes compete for selection of the super nodes, the distance between the nodes and the nodes initiating the transaction is determined to carry out screening, the nodes which are closer to the nodes initiating the transaction are removed, and then the super nodes are selected from the nodes after the closer nodes are removed, so that the problem of cheating caused by too close distance between the selected super nodes and the nodes initiating the transaction is solved, and the super nodes are selected more fairly.
In an optional implementation of the first aspect, the determining a distance of the node from the node initiating the transaction comprises:
and determining the distance between the node and the node initiating the transaction through a Google S2 algorithm according to the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction.
According to the method designed by the scheme, the spatial distance between the nodes is calculated according to the longitude and latitude of the nodes through the Google S2 distance algorithm, the algorithm consumes less computing resources, and the performance requirements of the node server are met.
In an optional implementation manner of the first aspect, before the determining, according to the longitude and latitude of the node and the longitude and latitude of the transaction initiating node, the distance between the node and the transaction initiating node through a google S2 algorithm, the method further includes:
and acquiring the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction, wherein the longitude and latitude of the node is generated by the Internet protocol IP address of the node, and the longitude and latitude of the node initiating the transaction is generated by the Internet protocol IP address of the node initiating the transaction.
The method designed by the scheme generates the longitude and latitude corresponding to the node through the internet protocol IP address of the node, can be realized by using the existing method for converting the longitude and latitude by using the IP, and has the advantages of fast operation and stable performance.
In an optional implementation manner of the first aspect, after the obtaining of the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction, the method further includes:
sending the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction to a verification node on a block chain;
and receiving verification success information returned by the verification node.
The method designed by the scheme verifies the longitude and latitude through the verification node, and achieves the effect of preventing data from being tampered.
In an optional implementation manner of the first aspect, the competing for the super node by the verifiable random function and becoming the super node after meeting the requirements of the verifiable random function includes:
generating a new random number according to the private key of the node and the received consensus random number, wherein the consensus random number is generated by the super node which successfully generates the block in the previous round when the super node is selected as the super node and is broadcasted on the block chain;
judging whether the new random number meets the specified numerical value requirement or not;
and if so, broadcasting the new random number and the public key of the node on the blockchain, so that the nodes except the node on the blockchain verify the new random number according to the public key of the node, and determining the node except the node on the blockchain as the super node after the nodes except the node on the blockchain successfully verify.
The method designed by the scheme determines the super node through the verifiable random function, so that other nodes can achieve the verification effect without knowing the private key of the node during verification.
In an optional implementation of the first aspect, after the broadcasting the new nonce and the node's public key on the blockchain, the method further comprises:
judging whether to carry out block output according to a block output protocol of a super node except the node;
and if so, performing block outputting.
The method designed by the scheme judges whether the super node is blocked or not through the blocking protocol, so that the blocking is more rapid and convenient.
In a second aspect: the application provides a super node election device is applied to the node, the device includes:
a determining module for determining a distance of the node from a node initiating a transaction;
the judging module is used for judging whether the distance exceeds a preset distance or not;
and the election module is used for election the super node through a verifiable random function after the judging module judges that the distance exceeds the preset distance, and determining the super node after the requirements of the verifiable random function are met.
According to the device designed by the scheme, before nodes compete for selection of the super nodes, the distance between the nodes and the nodes initiating the transaction is determined to screen the nodes, the nodes which are closer to the nodes initiating the transaction are removed, and then the super nodes are selected from the nodes after the closer nodes are removed, so that the problem of cheating caused by too close distance between the selected super nodes and the nodes initiating the transaction is solved, and the super nodes are selected more fairly.
In an optional implementation of the second aspect, the determining module determines the distance of the node from the node initiating the transaction, including:
and determining the distance between the node and the node initiating the transaction through a Google S2 algorithm according to the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction.
In an optional implementation manner of the second aspect, the apparatus further includes an obtaining module, where the obtaining module is configured to obtain the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction before the determining module determines the distance between the node and the node initiating the transaction through a google S2 algorithm according to the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction, where the longitude and latitude of the node is generated by an internet protocol IP address of the node, and the longitude and latitude of the node initiating the transaction is generated by an internet protocol IP address of the node initiating the transaction.
In an optional implementation manner of the second aspect, the apparatus further includes a sending module and a receiving module, where the sending module is configured to send the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction to a verification node on a block chain after the obtaining module obtains the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction;
and the receiving module is used for receiving verification success information returned by the verification node.
In a third aspect: the present application further provides an electronic device, comprising: a processor, a memory connected to the processor, the memory storing a machine-readable storage medium executable by the processor, the machine-readable storage medium being executable by the processor when the computing device is running to perform the method of the first aspect, any of the alternative implementations of the first aspect.
In a fourth aspect: the present application provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect, any of the optional implementations of the first aspect.
In a fifth aspect: the present application provides a computer program product which, when run on a computer, causes the computer to perform the method of the first aspect, any of the alternative implementations of the first aspect.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic view of a first process of a super node election method according to a first embodiment of the present application;
fig. 2 is a second flow chart of a super node election method according to a first embodiment of the present application;
fig. 3 is a schematic view of a third flow of a super node election method according to a first embodiment of the present application;
fig. 4 is a fourth flowchart illustrating a super node election method according to a first embodiment of the present application;
fig. 5 is a schematic structural diagram of a super node election device according to a second embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to a third embodiment of the present application.
Detailed Description
To facilitate understanding by those skilled in the art, the words in the embodiments of the application are explained and illustrated below.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. 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 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 that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as separate products. 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, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application.
First embodiment
As shown in fig. 1, the present application provides a super node election method, which is applied to a node, where the node refers to any node server except a node initiating a transaction in a blockchain, and the following method steps are performed by taking any node server except the node initiating a transaction as an execution subject, where the method includes:
step S100: the distance of the node from the node initiating the transaction is determined.
Step S102: and judging whether the distance exceeds a preset distance, if so, turning to the step S104.
Step S104: the node competitively selects the super node through the verifiable random function, and determines that the node is the super node after the requirements of the verifiable random function are met.
The node initiating the transaction in the above steps S100 to S104 represents a transaction initiator in a transaction record, for example, a transaction is performed between a node a and a node B on the blockchain, and if the transaction is initiated by the node a, the node a can be marked as a node initiating the transaction; the super node is a node capable of collecting, packaging and verifying transaction information into a block; the Verifiable Random Function (VRF) refers to a Hash Function combined with an asymmetric key technology, for example, result is VRF _ Hash (SK, info), SK is a private key, info is any number, a node a on the block chain generates a result through the private key and info, and other nodes on the block chain want to verify whether the result is correct, and verification can be performed only by knowing the result, info, and a public key corresponding to the private key SK of the node a. It should be noted that the super node election method in this embodiment is not limited to the consensus algorithm, and for example, Proof of workload (Proof of Work, POW), Proof of rights and interests (POS), and Proof of delegation rights and interests (DPOS) may be applied.
The step S100 of determining the distance between the node and the node initiating the transaction means that the spatial distance between any one node except the node initiating the transaction and the node initiating the transaction is determined.
The meaning expressed in step S102 is that unless the distance between any one of the nodes initiating the transaction and the node initiating the transaction needs to satisfy a certain distance requirement, the distance requirement is the preset distance in S102, and the meaning expressed by the preset distance may be as follows: firstly, the distance from the node initiating the transaction to the nearest node may be taken as the preset distance, and the meaning expressed at this time is that the node participating in the election of the super node cannot be the node closest to the node initiating the transaction, for example, the node initiating the transaction is the fifth node in the blockchain, and by calculating that the distance between the sixth node and the fifth node is the nearest, the nodes participating in the election of the super node are all nodes on the blockchain except the fifth node and the sixth node; secondly, a distance range can be set, the distance range is greater than the distance of the node closest to the transaction initiating node, and at this time, the qualification of participating in super node competition can be removed from a plurality of nodes at a certain distance around the transaction initiating node, for example, the transaction initiating node is the fifth node in the block chain, the distance between the sixth node and the fifth node is calculated to be closest and the distance is 500km, the set distance range is greater than 500km, the range can be adjusted according to the actual situation, the set distance range is assumed to be 800km, at this time, the distances between the seventh node and the eighth node from the fifth node are 600km and 700km respectively, and the seventh node and the eighth node can not participate in super node competition except that the sixth node can not participate in super node competition; thirdly, the distances between all the nodes and the transaction initiating node can be calculated, the distances between all the nodes and the transaction initiating node are counted, the distance values are sorted from small to large, and the qualification that a certain percentage of the nodes with the higher sorting rate participate in the election of the super nodes is removed. Through the distance requirement setting, the problem that the selected super node is possibly too close to the space distance of the transaction initiating node, and further the user corresponding to the super node and the transaction initiating node are possibly communicated with each other to cheat is solved.
After the nodes participating in the election of the super node are selected in step S102, step S104 is executed, the nodes elect the super node through the verifiable random function, and the nodes meeting the requirements of the verifiable random function become the super node.
According to the method designed by the scheme, before nodes compete for selection of the super nodes, the distance between the nodes and the nodes initiating the transaction is determined to screen, the nodes which are close to the nodes initiating the transaction are removed, and then the super nodes are selected from the nodes with the close nodes removed, so that the problem that the selected super nodes are possibly too close to the space distance between the nodes initiating the transaction, and further, users corresponding to the super nodes and the nodes initiating the transaction are possibly in series connection with each other to cheat is solved, and the super nodes are more fair in selection.
In an optional implementation manner of this embodiment, as shown in fig. 2, the determining the distance between the node and the node initiating the transaction in step S100 may specifically be:
step S1002: and determining the distance between the node and the node initiating the transaction through a Google S2 algorithm according to the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction.
In step S1002, the google S2 distance algorithm is synchronized in the block chain program, so that the nodes on the block chain can calculate the distance between the nodes according to the google S2 distance algorithm program after obtaining the longitude and latitude of the nodes.
The method designed by the scheme can calculate the spatial distance between the nodes according to the longitude and latitude of the nodes through the Google S2 distance algorithm, the Google S2 distance algorithm consumes less computing resources, and the performance requirements of the node server are met.
In an alternative implementation manner of this embodiment, as shown in fig. 2, before step S1002, the method further includes:
step S1000: and acquiring the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction, wherein the longitude and latitude of the node is generated by the Internet protocol IP address of the node, and the longitude and latitude of the node initiating the transaction is generated by the Internet protocol IP address of the node initiating the transaction.
The node in step S1000 is also represented as any node except the node initiating the transaction, and the generation of the longitude and latitude includes the following two ways: firstly, the longitude and latitude of any one node except the transaction initiating node and the longitude and latitude of the transaction initiating node can be calculated by a specific node on the block chain, before that, all the nodes on the block chain publish respective internet protocol IP addresses on the block chain, then the specific node calculates the longitude and latitude of each node according to the internet protocol IP address of each node and stores the longitude and latitude, when the distance between the nodes needs to be calculated in the subsequent step S1002, the specific node sends the longitude and latitude of each node except the transaction initiating node and the longitude and latitude of the transaction initiating node to the specific node, because the longitude and latitude are uniformly calculated by the specific node, the specific node is easy to be tampered, so a verification node can be arranged on the block chain, and after the longitude and latitude are calculated by the specific node, the longitude and latitude are sent to the verification node for verification, after the verification is successful, the specific node sends the longitude and latitude of each node except the transaction initiating node and the longitude and latitude of the transaction initiating node.
Secondly, the longitude and latitude of any node except the node initiating the transaction and the longitude and latitude of the node initiating the transaction can be calculated by any node except the node initiating the transaction without being calculated for a specific node, the longitude and latitude of any node except the node initiating the transaction and the longitude and latitude of the node initiating the transaction are calculated according to the Internet protocol IP of the node and the Internet protocol IP of the node initiating the transaction, the space distance is further calculated according to the longitude and latitude, as the longitude and latitude are calculated by the node, in order to prevent the node cheating, the longitude and latitude obtained by calculation can be sent to the verification node by any node except the node initiating the transaction for verification, after the verification node receives the verification success message sent by the verification node after verification, the distance between any node except the node initiating the transaction and the node initiating the transaction is continuously calculated according to the longitude and latitude, the calculated distance may then be sent to a verification node for verification to ensure fairness. The method for generating the longitude and latitude of the internet protocol IP address can be a logstack conversion method or an accurate IP positioning method using a hundred degrees.
In an optional implementation manner of this embodiment, as shown in fig. 3, the super node is elected by the verifiable random function in step S104, and is determined to be the super node after the requirements of the verifiable random function are met, and any node participating in election of the super node is taken as an execution subject, which may specifically be:
step S1040: and generating a new random number according to the private key of the node and the received consensus random number, wherein the consensus random number is generated by the super node which succeeds in the previous round of block selection and is broadcasted on the block chain when the super node is selected as the super node.
Step S1042: and judging whether the new random number meets the specified numerical requirement, and if so, turning to step 1044.
Step S1044: broadcasting the new random number and the public key of the node on the blockchain so that the nodes except the node on the blockchain verify the new random number generated by the node according to the public key of the node, and determining that the node except the node on the blockchain is a super node after the verification is successful.
The above steps S1040 to S1044 can be expressed as an execution process of a verifiable random function, and the verifiable random function can be regarded as a drawing process, for example, the above steps can be understood by assuming that the drawing of the 10 th round is performed, the number of nodes after being screened according to the distance can be 100, and the 100 nodes generate a new random number by adding a random number (i.e. the aforesaid consensus random number) known by the whole network to respective private keys, where the random number known by the whole network is a new random number generated when the super node determined as the final block by the block generated in the previous round, i.e. the 9 th round, of the plurality of super nodes is race to be the super node in the previous 9 th round (for example, the random number known by the whole network is the number 10 of rounds of the round). Before this, a condition is set, the generated new random number meets the specified numerical requirement, for example, who generates the new random number with a value greater than 10, the node with the generated random number greater than 10 can become a super node, the new random number generated by node 5 is assumed to be value 11, but only node 5 knows that it has drawn value 11 to meet the specified numerical requirement, and if other nodes accept node 5 to become a super node, node 5 needs to broadcast the new random number generated by itself and its public key on the block chain, after other nodes verify that node 5 really has produced 11, other nodes also accept node 5 to become the super node of the 10 th round, wherein, the number of super nodes generated by each round of drawing can be multiple, for example, after the node 5 becomes the super node of the 10 th round, other nodes can also become the super nodes of the 10 th round, and only the new random numbers generated by the nodes need to meet the specified numerical requirements.
In an alternative implementation manner of this embodiment, as shown in fig. 4, after the super node is elected by the verifiable random function in step S104, and is determined to be the super node after the requirements of the verifiable random function are met, the method further includes:
step S106: and judging whether to carry out block output according to a block output protocol of the super node except the node, and if so, turning to the step S108.
Step S108: the node goes out of block.
The meaning expressed in the above steps S106 to S108 is that after the plurality of super nodes are selected in the above step S104, one super node needs to be selected from the plurality of super nodes to record the transaction record corresponding to the node initiating the transaction, and the record is stored and synchronized on the block chain, that is, the so-called out-block. In step S106, the plurality of super nodes may measure which super node is based on a protocol set in advance to perform blocking on the transaction record, for example, the super node selected in step S104 has nodes No. 5, No. 11, No. 23, No. 33, No. 44, and No. 55, the nodes measure the round of blocking the transaction record by the super node No. 5 according to a previously set blocking protocol, then the node No. 5 performs blocking, after the super node that has performed blocking is determined, a new random number generated by the super node during previous super node election and broadcasted on a block chain is used as a consensus random number of the super node in the next round of election, and the new random number 11 generated by the node No. 5 during super node election is used as a consensus random number of the super node in the next round of election. The way of determining the super node block out may be determined according to the workload of the super nodes, like the POW mechanism, in addition to the above-mentioned determination according to the preset block out protocol.
In addition, after any super node in the plurality of super nodes blocks the transaction record of this time, the plurality of super nodes are invalidated, and the super nodes are re-elected after the next transaction record is generated, for example, in the above example, after the node 5 records the transaction record of the node initiating the transaction, the super nodes 5, 11, 23, 33, 44 and 55 in the 10 th round are all invalidated, and after the next transaction record is generated, the super node election in the 11 th round is re-performed, that is, all the above steps are repeated.
Second embodiment
As shown in fig. 5, the present application provides a super node election device, applied to a node, the device including:
a determining module 200, configured to determine a distance between a node and a node initiating a transaction;
a judging module 202, configured to judge whether the distance exceeds a preset distance;
and an election module 204, configured to elect a supernode through a verifiable random function after the determining module 202 determines that the distance exceeds the preset distance, and determine that the supernode is a supernode after the requirements of the verifiable random function are met.
According to the device designed by the scheme, before nodes compete for selection of the super nodes, the distance between the nodes and the nodes initiating the transaction is determined to screen the nodes, the nodes which are closer to the nodes initiating the transaction are removed, and then the super nodes are selected from the nodes after the closer nodes are removed, so that the problem of cheating caused by too close distance between the selected super nodes and the nodes initiating the transaction is solved, and the super nodes are selected more fairly.
In an alternative implementation of the second embodiment, the determining module 200 determines the distance between the node and the node initiating the transaction, including:
and determining the distance between the node and the node initiating the transaction through a Google S2 algorithm according to the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction.
In an optional implementation manner of the second embodiment, the apparatus further includes an obtaining module 206, configured to obtain the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction before the determining module 200 determines the distance between the node and the node initiating the transaction through the google S2 algorithm according to the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction, where the longitude and latitude of the node is generated by the internet protocol IP address of the node and the longitude and latitude of the node initiating the transaction is generated by the internet protocol IP address of the node initiating the transaction.
In an alternative implementation of the second embodiment, the apparatus further comprises a sending module 208 and a receiving module 210.
A sending module 208, configured to send the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction to the verification node on the block chain after the obtaining module 206 obtains the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction.
The receiving module 210 is configured to receive verification success information returned by the verification node.
The device designed by the scheme verifies the longitude and latitude through the verification node, and achieves the effect of preventing data from being tampered.
Third embodiment
As shown in fig. 6, the present application provides an electronic device comprising: a processor 301, a memory 302 connected to the processor, the memory 302 storing a storage medium executable by the processor 301, when the computing device is running, the processor 301 executing the storage medium to execute the method of the first embodiment or any optional implementation manner of the first embodiment.
The present application provides a storage medium having a computer program stored thereon, where the computer program is executed by a processor to perform the method of the first embodiment or any alternative implementation manner of the first embodiment.
The storage medium may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
The present application provides a computer program product, which when run on a computer causes the computer to execute the method of the first embodiment or any alternative implementation of the first embodiment.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present application, and shall 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 (10)

1. A super node election method is applied to nodes, and comprises the following steps:
determining a distance between the node and a node initiating a transaction;
judging whether the distance exceeds a preset distance or not;
if so, the nodes select the super nodes through the verifiable random function, and determine that the super nodes are the super nodes after the requirements of the verifiable random function are met.
2. The method of claim 1, wherein said determining the distance between the node and the node initiating the transaction comprises:
and determining the distance between the node and the node initiating the transaction through a Google S2 algorithm according to the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction.
3. The method of claim 2, wherein before said determining the distance between said node and said transaction originating node according to said longitude and latitude of said node and said longitude and latitude of said transaction originating node by google S2 algorithm, said method further comprises:
and acquiring the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction, wherein the longitude and latitude of the node are generated by the Internet protocol IP address of the node, and the longitude and latitude of the node initiating the transaction are generated by the Internet protocol IP address of the node initiating the transaction.
4. The method of claim 3, wherein after said obtaining the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction, the method further comprises:
sending the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction to a verification node on a block chain;
and receiving verification success information returned by the verification node.
5. The method of claim 1, wherein the competing for the super node by the verifiable random function and determining that the super node is the super node after the requirements of the verifiable random function are met comprises:
generating a new random number according to the private key of the node and the received consensus random number, wherein the consensus random number is generated by the super node which successfully generates the block in the previous round when the super node is selected as the super node and is broadcasted on the block chain;
judging whether the new random number meets the specified numerical value requirement or not;
and if so, broadcasting the new random number and the public key of the node on the blockchain, so that the nodes except the node on the blockchain verify the new random number according to the public key of the node, and determining that the node except the node on the blockchain is a super node after the verification is successful.
6. The method as claimed in claim 1, wherein after the node elects a super node through a verifiable random function and determines itself to be a super node after meeting the requirements of the verifiable random function, the method further comprises:
judging whether to carry out block output according to a block output protocol of a super node except the node;
and if so, performing block outputting.
7. A super node election device, applied to a node, the device comprising:
a determining module for determining a distance of the node from a node initiating a transaction;
the judging module is used for judging whether the distance exceeds a preset distance;
and the election module is used for election the super node through a verifiable random function after the judging module judges that the distance exceeds the preset distance, and determining that the super node is the super node after the requirements of the verifiable random function are met.
8. The supernode election device of claim 7 wherein said means for determining determines a distance of said node from said node initiating said transaction includes:
and determining the distance between the node and the node initiating the transaction through a Google S2 algorithm according to the longitude and latitude of the node and the longitude and latitude of the node initiating the transaction.
9. An electronic device comprising a memory, a processor, and a storage medium stored on the memory and executable by the processor, the storage medium being executable by the processor to perform the steps of the method of any one of claims 1 to 6 when the electronic device is run.
10. A storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the method of any one of claims 1-6.
CN201910757152.9A 2019-08-15 2019-08-15 Super node election method, device and storage medium Active CN110460471B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910757152.9A CN110460471B (en) 2019-08-15 2019-08-15 Super node election method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910757152.9A CN110460471B (en) 2019-08-15 2019-08-15 Super node election method, device and storage medium

Publications (2)

Publication Number Publication Date
CN110460471A CN110460471A (en) 2019-11-15
CN110460471B true CN110460471B (en) 2022-07-08

Family

ID=68487160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910757152.9A Active CN110460471B (en) 2019-08-15 2019-08-15 Super node election method, device and storage medium

Country Status (1)

Country Link
CN (1) CN110460471B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110505313B (en) * 2019-09-25 2022-04-15 广东卓启投资有限责任公司 Super node selection method, device and equipment
CN111416843A (en) * 2020-03-06 2020-07-14 厦门区块链云科技有限公司 Super node election method for block chain community
CN111698218A (en) * 2020-05-20 2020-09-22 厦门区块链云科技有限公司 Super node election system of block chain community

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105323818B (en) * 2015-11-04 2018-09-14 天津理工大学 Energy saving cluster routing method based on network area division and distance
CN107438002B (en) * 2016-05-27 2022-02-11 索尼公司 Block chain based system and electronic device and method in system
CN109427012B (en) * 2017-08-22 2021-06-01 汇链丰(北京)科技有限公司 Transaction and verification method based on block chain
CN109785130B (en) * 2018-12-17 2021-05-28 金蝶软件(中国)有限公司 Block chain random consensus method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110460471A (en) 2019-11-15

Similar Documents

Publication Publication Date Title
CN107566124B (en) Hash operation-based consensus establishing method, block chain system and storage medium
CN109165945B (en) Representative node device election method and device, computer device and storage medium
CN110460471B (en) Super node election method, device and storage medium
US20210099280A1 (en) Systems and methods for controlled random endorsement in a blockchain network
CN109543075B (en) Block generation method and system
Shala et al. Novel trust consensus protocol and blockchain-based trust evaluation system for M2M application services
JP7038228B2 (en) Selection method of representative node equipment, equipment, computer equipment and computer programs
JP7398000B2 (en) Blockchain-based data detection method and device, computer device and program
WO2022217807A1 (en) Blockchain consensus node selection method and apparatus, and computer device and storage medium
CN110928880B (en) Data processing method, device, terminal and medium based on block chain
JP7198371B2 (en) How to elect a leader node using a role-based consensus protocol in a blockchain network
CN109508987B (en) Block chain construction method, system and related components
WO2022267715A1 (en) Oracle machine node screening method and apparatus, and storage medium and electronic apparatus
WO2020115496A2 (en) A node testing method and apparatus for a blockchain system
CN110990790B (en) Data processing method and equipment
CN111641559B (en) Block chain-based multi-person session data transmission method and system and computer equipment
CN114372589A (en) Federated learning method and related device
CN112749968A (en) Service data recording method and device based on block chain
CN114024960B (en) Multiparty security computing method, device, system, storage medium and equipment
Islam et al. A comparative analysis of proof-of-authority consensus algorithms: Aura vs Clique
CN112862607A (en) Method, device, equipment and storage medium for realizing block chain consensus mechanism
CN113282418A (en) Model aggregation processing method and device
CN111769984A (en) Method for adding nodes in block chain network and block chain system
CN111371769B (en) Consensus processing method, consensus node, electronic device, and readable storage medium
US20180197362A1 (en) Method for generating winning numbers and apparatus

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