WO2020173287A1 - Systems and methods for determining network shards in blockchain network - Google Patents
Systems and methods for determining network shards in blockchain network Download PDFInfo
- Publication number
- WO2020173287A1 WO2020173287A1 PCT/CN2020/074305 CN2020074305W WO2020173287A1 WO 2020173287 A1 WO2020173287 A1 WO 2020173287A1 CN 2020074305 W CN2020074305 W CN 2020074305W WO 2020173287 A1 WO2020173287 A1 WO 2020173287A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- cluster
- nodes
- candidate
- sub
- count
- 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.)
- Ceased
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W12/00—Security arrangements; Authentication; Protecting privacy or anonymity
- H04W12/60—Context-dependent security
- H04W12/63—Location-dependent; Proximity-dependent
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/20—Network architectures or network communication protocols for network security for managing network security; network security policies in general
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1042—Peer-to-peer [P2P] networks using topology management mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/52—Network services specially adapted for the location of the user terminal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W12/00—Security arrangements; Authentication; Protecting privacy or anonymity
- H04W12/60—Context-dependent security
- H04W12/69—Identity-dependent
- H04W12/71—Hardware identity
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
Definitions
- the present disclosure generally relates to the field of Internet technology, and in particular, to systems and methods for blockchain network technology.
- a blockchain network may include a plurality of nodes, each of which is used as a basic unit for data processing (e.g., data validation) in the blockchain network.
- a method for determining network shards in a blockchain network implemented on a target node in the blockchain network may include determining a first master node in the blockchain network. In response to determining that the first master node is the target node, the method may include dividing candidate nodes in the blockchain network into different network shards. The method may also include determining a second master node in a target network shard where the target node is located.
- the method may further include determining one or more validation nodes used for data validation in the target network shard based on address information and/or a network latency of each of candidate nodes in the target network shard.
- a system for determining network shards in a blockchain network implemented on a target node in the blockchain network may include a sharding module, a first determination module, and a second determination module.
- the sharding module may be configured to determine a first master node in the blockchain network.
- the sharding module may be configured to divide candidate nodes in the blockchain network into different network shards.
- the first determination module may be configured to determine a second master node in a target network shard where the target node is located.
- the second determination module may be configured to determine one or more validation nodes used for data validation in the target network shard based on address information and/or a network latency of each of candidate nodes in the target network shard.
- an electronic device may include a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor.
- the processor may communicate with the storage medium through the bus, and the processor may execute the machine-readable instructions to execute operations of the method for determining network shards in a blockchain network.
- a computer-readable storage medium storing a computer program id provided.
- the computer program may direct the processor to perform the method for determining network shards in a blockchain network.
- a system may include at least one storage device including a set of instructions and at least one processor may be configured to communicate with the at least one storage device. When executing the set of instructions, the at least one processor is may be configured to cause the system to perform the following operations.
- the processor may obtain one or more network shards associated with a candidate node set in a blockchain network. Each of the one or more network shards may include one or more candidate nodes. For at least one of the one or more network shards, the processor may identify, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
- a method implemented on a computing device including at least one processor, at least one storage medium, and a communication platform connected to a network may include obtaining one or more network shards associated with a candidate node set in a blockchain network, each of the one or more network shards including one or more candidate nodes. For at least one of the one or more network shards, the method may include identifying, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
- a system may include an obtaining module and an identification module.
- the obtaining module may be configured to obtain one or more network shards associated with a candidate node set in a blockchain network, each of the one or more network shards including one or more candidate nodes.
- the identification module may be configured to identify, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
- a non-transitory computer readable medium including executable instructions When executed by at least one processor, the executable instructions may direct the at least one processor to perform a method.
- the method may include obtaining one or more network shards associated with a candidate node set in a blockchain network, each of the one or more network shards including one or more candidate nodes.
- the method may include identifying, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
- FIG. 1 is a schematic diagram illustrating an exemplary blockchain network according to some embodiments of the present disclosure
- FIG. 2 is a schematic diagram illustrating exemplary hardware and/or software components of an exemplary computing device according to some embodiments of the present disclosure
- FIG. 3 is a schematic diagram illustrating exemplary hardware and/or software components of an exemplary mobile device according to some
- FIG. 4 is a schematic diagram illustrating exemplary network shards in a blockchain network according to some embodiments of the present disclosure
- FIG. 5 is a flowchart illustrating an exemplary process for determining validation nodes in network shards in a blockchain network according to some embodiments of the present disclosure
- FIG. 6 is a flowchart illustrating an exemplary process for dividing a plurality of candidate nodes into a plurality of network shards according to some
- FIG. 7 is a flowchart illustrating an exemplary process for dividing a plurality of candidate nodes into a plurality of network shards based on a random seed according to some embodiments of the present disclosure
- FIG. 8 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure
- FIG. 9 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure
- FIG. 10 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure
- FIG. 11 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure
- FIG. 12 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure
- FIG. 13 is a flowchart illustrating an exemplary process for determining a network latency of a candidate node according to some embodiments of the present disclosure
- FIG. 14 is a flowchart illustrating an exemplary process for verifying a signature of a candidate node according to some embodiments of the present disclosure
- FIG. 15 is a block diagram illustrating an exemplary blockchain network sharding device according to some embodiments of the present disclosure
- FIG. 16 is a schematic diagram illustrating an exemplary electronic device according to some embodiments of the present disclosure.
- FIG. 17 is a block diagram illustrating an exemplary processing device according to some embodiments of the present disclosure.
- FIG. 18 is a flowchart illustrating an exemplary process for identifying one or more target nodes in a blockchain network according to some embodiments of the present disclosure
- FIG. 19 is a block diagram illustrating an exemplary identification module according to some embodiments of the present disclosure.
- FIG. 20 is a flowchart illustrating an exemplary process for identifying one or more target nodes in a network shard according to some embodiments of the present disclosure
- FIG. 21 is a flowchart illustrating an exemplary process for determining one or more target nodes in a cluster with the highest ranking according to some embodiments of the present disclosure.
- FIG. 22 is a flowchart illustrating an exemplary process for determining one or more target nodes from a cluster with the highest ranking to an ith cluster according to some embodiments of the present disclosure.
- An aspect of the present disclosure relates to systems and methods for identifying one or more target nodes in a blockchain network.
- the system may obtain one or more network shards associated with a candidate node set in the blockchain network.
- Each of the one or more network shards may include one or more candidate nodes.
- the system may identify, from the one or more candidate nodes in the network shard, one or more target nodes (which may be used for data processing (e.g., data validation, data storage) associated with the transaction) based on at least one of a location or a network latency of each of the one or more candidate nodes.
- the target nodes are identified from a network shard in the blockchain network based on the locations and/or the network latencies of the candidate nodes, which improves the handling capacity of the blockchain network and reduces the latency of the blockchain network, thereby improving the efficiency of the blockchain network for application in scenarios with high real-time requirements.
- FIG. 1 is a schematic diagram illustrating an exemplary blockchain network according to some embodiments of the present disclosure.
- the blockchain network (also can be referred to as a“blockchain network system,” a“blockchain system,” or a blockchain) 100 may be constructed using blockchain technology.
- the blockchain technology is becoming another major technological innovation after cloud computing, big data, and artificial intelligence, and plays an important role in continuously solving and innovating core Internet issues such as information sharing, data confirmation, privacy protection, etc. Further, in the future, the blockchain technology will also play an important role in building an effective business system, credit system, social infrastructure, etc.
- the blockchain technology can be understood as a data structure that transactions occurred in a time period in a system are packaged and stored using a block as a unit and blocks are jointed into a chain in order using a cryptographic technique.
- the blockchain network 100 may include a plurality of nodes (e.g., 102, 104, 106, 108, 110), each of which may be used as a basic unit for data processing.
- a node may package processed data as a block and a plurality of blocks (e.g., 122, 124, 126) may be connected in
- the blockchain network 100 may be a public blockchain network (e.g., Bitcoin, Ethereum), a private blockchain network, a consortium blockchain network, etc.
- the public blockchain network may allow any node to join the blockchain network.
- the private blockchain network may be controlled by a single administrator and only send invitations to selected nodes as participants with limited accesses.
- the consortium blockchain network instead of being controlled by a single administrator, may be operated by a group of organizations (e.g., financial institutions).
- the plurality of nodes may include a server, a terminal device, or any suitable device with data processing function.
- a server a terminal device, or any suitable device with data processing function.
- the server may be a single server or a server group.
- the server group may be centralized or distributed (e.g., the server may be a distributed system).
- the server may execute instructions to perform operations or methods disclosed in the present disclosure.
- the server may obtain one or more network shards associated with a candidate node set in the blockchain network.
- the server may identify one or more target nodes used for data processing (e.g., data validation) in at least one of the one or more network shards in the blockchain network based on address information and a network latency of each of candidate nodes in the at least one of the one or more network shards.
- the server may divide candidate nodes in the blockchain network into different network shards.
- the server may be implemented on a cloud platform.
- the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an inter-cloud, a multi-cloud, or the like, or any combination thereof.
- the server may be implemented on a computing device 200 illustrated in FIG. 2 or a mobile device 300 illustrated in FIG.
- FIG. 2 is a schematic diagram illustrating exemplary hardware and/or software components of an exemplary computing device according to some embodiments of the present disclosure.
- a node of the blockchain network 100 may be implemented on the computing device 200 and configured to perform functions of the node disclosed in this disclosure.
- the node of the blockchain network 100 may be implemented on the computing device 200, via its hardware, software program, firmware, or a combination thereof.
- the computer functions relating to blockchain services as described herein may be implemented in a distributed fashion on a number of similar platforms to distribute the processing load.
- the computing device 200 may include COM ports 250 connected to and from a network connected thereto to facilitate data communications.
- the computing device 200 may also include a processor 220, in the form of one or more processors (e.g., logic circuits), for executing program instructions.
- the processor 220 may include interface circuits and processing circuits therein.
- the interface circuits may be configured to receive electronic signals from a bus 210, wherein the electronic signals encode structured data and/or instructions for the processing circuits to process.
- the processing circuits may conduct logic calculations, and then determine a conclusion, a result, and/or an instruction encoded as electronic signals. Then the interface circuits may send out the electronic signals from the processing circuits via the bus 210.
- the computing device 200 may further include program storage and data storage of different forms including, for example, a disk 270, a read-only memory (ROM) 230, or a random access memory (RAM) 240, for storing various data files to be processed and/or transmitted by the computing device 200.
- the computing device 200 may also include program instructions stored in the ROM 230, RAM 240, and/or other type of non-transitory storage medium to be executed by the processor 220.
- the methods and/or processes of the present disclosure may be implemented as the program instructions.
- the computing device 200 may also include an I/O component 260, supporting input/output between the computer and other
- the computing device 200 may also receive programming and data via network communications.
- step A and step B may also be performed by two different CPUs and/or processors jointly or separately in the computing device 200 (e.g., the first processor executes step A and the second processor executes step B, or the first and second processors jointly execute steps A and B).
- FIG. 3 is a schematic diagram illustrating exemplary hardware and/or software components of an exemplary mobile device according to some
- a node of the blockchain network 100 may be implemented on the mobile device 300.
- the mobile device 300 may include a communication platform 310, a display 320, a graphic processing unit (GPU) 330, a central processing unit (CPU) 340, an I/O 350, a memory 360, a mobile operating system (OS) 370, and a storage 390.
- a communication platform 310 may include a communication platform 310, a display 320, a graphic processing unit (GPU) 330, a central processing unit (CPU) 340, an I/O 350, a memory 360, a mobile operating system (OS) 370, and a storage 390.
- GPU graphic processing unit
- CPU central processing unit
- I/O 350 I/O 350
- memory 360 a central processing unit
- OS mobile operating system
- storage 390 any other suitable storage 390.
- a component including but not limited to a system bus or a controller (not shown), may also be included in the mobile device 300.
- the mobile operating system 370 e.g., iOSTM, AndroidTM, Windows PhoneTM
- one or more applications 380 may be loaded into the memory 360 from the storage 390 in order to be executed by the CPU 340.
- the applications 380 may include a browser or any other suitable mobile apps for receiving and rendering information relating to blockchain services or other information from the blockchain network 100. User interactions with the information stream may be achieved via the I/O 350 and provided to the processor 220 and/or other components of the blockchain network 100 via the network 120.
- the plurality of nodes in the blockchain network may be used to transaction validation.
- the peak number of transactions per second (TPS) implemented by a Bitcoin system is generally only about 7 and the peak number of TPS implemented by Ethereum is generally about 15, both of which are far from the peak number (e.g., 250,000) of TPS in the Internet payment transaction scenario.
- TPS transactions per second
- one aspect is that the scalability of the blockchain network system is relatively low, which may result in that the TPS of the blockchain network system is relatively low, that is, the handling capacity (which refers to a number of tasks processed in a unit time) is relatively low; and another aspect is that a system latency (which refers to a network latency among the plurality of nodes during data transmission) generally occurs in data processing.
- the two aspects result in that the data processing performance of the existing blockchain technology is limited and further result in that the existing blockchain technology is difficult to be applied in application scenarios with high real time requirements.
- a sharding technology may be applied to the blockchain network to improve the processing performance of the blockchain network.
- the blockchain network may be divided into a plurality of sub-blockchain networks, that is, the plurality of nodes in the blockchain network may be divided into a plurality of“shards.”
- Each of the plurality of sub-blockchain networks may include a plurality of blocks (or nodes), and each of the plurality of shards may separately maintain a sub-blockchain network, that is, separately maintain a distributed ledger.
- a transaction may be distributed into a shard for processing such that different nodes in the shard may process the transaction in parallel.
- each of the different nodes only needs to process a small portion of the transaction and it is no longer necessary for each node to validate each transaction, which can increase the degree of concurrency of transaction processing and validation, thereby improving the handling capacity of the entire blockchain network.
- the existing sharding technology only considers improving the system handling capacity without paying attention to the problem of system latency. In this way, there may be great limitations in practical application scenarios. Take the sharing economy field as an example, the mobile Internet service needs to be supported by a system with high handing capacity and low latency. Although the use of sharding technology solves the problem of handling capacity, for scenarios with high real-time requirements, the low latency of the service is more important.
- a specific shard may include nodes located in country A and nodes located in country B. Since each of the nodes in the shard should be consistent when performing a transaction validation, there may be a relatively large network latency between two nodes with geographic locations far apart, for example, a network latency from Beijing, China to Virginia, the USA may be about 10 times a local network latency in Beijing locally. The problem of network latency may inevitably bring a large obstacle to the application of the blockchain technology in scenarios with high real-time requirements.
- the present disclosure provides systems and methods for determining network shards in a blockchain network.
- Candidate nodes in the blockchain network may be allocated to different network shards. By performing the network sharding, the handling capacity of the blockchain network may be increased.
- one or more validation nodes used for data validation in the network shard may be selected based on address information and network latencies of nodes in the network shard, which may further reduce the latency in data validation of each of the nodes in the blockchain network and improve the real-time performance of data validation in the blockchain network, thereby improving the processing performance of the blockchain network.
- FIG. 5 is a flowchart illustrating an exemplary process for determining validation nodes in network shards in a blockchain network according to some embodiments of the present disclosure.
- the process 500 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or a storage device 1620 illustrated in FIG. 16.
- the processor 220, the CPU 340, a processor 1610 illustrated in FIG. 16, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 500.
- the operations of the illustrated process presented below are intended to be illustrative. In some embodiments, the process 500 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 5 and described below is not intended to be limiting.
- a first master node (also referred to as a“first node”) in the blockchain network 100 may be determined.
- the first master node may be determined by a blockchain network sharding device 1500 (e.g., a sharding module 1510) illustrated in FIG. 15.
- the first master node may be determined by a target node from a plurality of candidate nodes in the blockchain network 100.
- the target node may be any node in the blockchain network 100; the plurality of candidate nodes may be randomly selected from all nodes in the blockchain network 100.
- the plurality of candidate nodes may be divided into a plurality of different network shards by the first master node.
- the plurality of candidate nodes may be divided into a plurality of different network shards by the target node.
- each of the plurality of network shards may include validation nodes used for data validation (e.g., transaction validation or other data validation) in the network shard.
- the first master node may be determined by the target node based on a first random value (also referred to as a“first condition value”) corresponding to the target node and first random values corresponding to other candidate nodes. If the first random value corresponding to the target node and the first random values corresponding to other candidate nodes satisfy a preset size relationship, the first master node may be determined to be the target node.
- a first random value also referred to as a“first condition value”
- the target node may generate the first random value
- a preset random function e.g., a verifiable random function (VRF)
- VRF verifiable random function
- the target node may determine whether the first random value corresponding to the target node and the first random values corresponding to other candidate nodes satisfy the preset size relationship. If the first random value corresponding to the target node and the first random values corresponding to other candidate nodes satisfy the preset size relationship, the first master node may be determined to be the target node.
- the preset size relationship may include at least one of the first random values corresponding to other candidate nodes being greater than the first random value corresponding to the target node, or the first random values corresponding to other candidate nodes being less than the first random value corresponding to the target node.
- the first master node may divide the plurality of candidate nodes into the plurality of different network shards. More descriptions regarding dividing the plurality of candidate nodes into the plurality of network shards can be found elsewhere in the present disclosure (e.g., FIG. 6 and the description thereof).
- a second master node (also referred to as a“second node”) in the network shard may be determined by any node in the network shard.
- a second master node in a network shard (referred to as a target network shard) where the target node is located may be determined.
- the target network shard where the target node is located may also be any network shard.
- the second master node may be determined by the blockchain network sharding device 1500 (e.g., a first determination module 1520) illustrated in FIG. 15.
- the second master node in the target network shard may be determined according to a manner similar to the manner in which the first master node in the blockchain network is determined from the plurality of candidate nodes.
- one or more validation nodes used for data validation in the network shard may be determined by the second master node based on address information and/or a network latency of each of candidate nodes in the network shard.
- the second master node is the target node
- one or more validation nodes used for data validation in the target network shard may be determined by the target node based on address information and/or a network latency of each of candidate nodes in the target network shard.
- the one or more validation nodes may be determined by the blockchain network sharding device 1500 (e.g., a second determination module 1520) illustrated in FIG. 15. More descriptions regarding determining the one or more validation nodes may be found elsewhere in the present disclosure (e.g., FIG.8 and the description thereof).
- FIG. 6 is a flowchart illustrating an exemplary process for dividing a plurality of candidate nodes into a plurality of network shards according to some
- the process 600 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620.
- the processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 600.
- the operations of the illustrated process presented below are intended to be illustrative. In some embodiments, the process 600 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 6 and described below is not intended to be limiting.
- a random seed may be generated based on a second random value corresponding to the first master node (e.g., the target node) and second random values corresponding to other candidate nodes.
- the random seed may be generated by the blockchain network sharding device 1500 (e.g., the sharding module 1510) illustrated in FIG. 15.
- the target node may generate the second random value corresponding to the target node by locally executing a preset random function and receive the second random values corresponding to other candidate nodes generated in the same manner.
- the target node may generate the random seed by concatenating the second random value corresponding to the target node and the second random values corresponding to the candidate nodes.
- the random seed may be
- the exemplary second random value is provided for illustration purposes and not intended to be limiting, the second random value may be a random value including any number of elements in any form.
- the form of the random seed may also be determined by other concatenating techniques.
- the random seed is associated with each of the candidate nodes and is not just generated based on the target node, which can ensure the randomness of the random seed and prevent the subsequent process for determining the network shards from being affected if the target node is attacked.
- the plurality of candidate nodes may be divided into a plurality of different network shards based on the random seed.
- the plurality of candidate nodes may be divided into the plurality of different network shards by the blockchain network sharding device 1500 (e.g., the sharding module 1510) illustrated in FIG. 15. More descriptions regarding dividing the plurality of candidate nodes into the plurality of network shards may be found elsewhere in the present disclosure (e.g., FIG. 7 and the description thereof).
- FIG. 7 is a flowchart illustrating an exemplary process for dividing a plurality of candidate nodes into a plurality of network shards based on a random seed according to some embodiments of the present disclosure.
- the process 700 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620.
- the processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 700.
- a third random value corresponding to the candidate node with the highest ranking may be determined based on the random seed and a preset random function.
- the third random value may be determined by the blockchain network sharding device 1500 (e.g., the sharding module 1510) illustrated in FIG. 15.
- the first master node e.g., the target node
- a third random value corresponding to the candidate node may be determined based on a third random value corresponding to a previous candidate node.
- the third random value may be determined by the blockchain network sharding device 1500 (e.g., the sharding module 1510) illustrated in FIG. 15.
- each of the third random values corresponding to the plurality of candidate nodes may match a respective one of a plurality of serial numbers corresponding to the plurality of network shards, wherein the plurality of serial numbers corresponding to the plurality of network shards may be determined by randomly ranking the plurality of network shards by the target node.
- the candidate node may be allocated to a network shard that matches a third random value corresponding to the candidate node based on the third random value corresponding to the candidate node.
- the candidate node may be allocated to the network shard by the blockchain network sharding device 1500 (e.g., the sharding module 1510) illustrated in FIG. 15.
- a first third random value may be generated based on the random seed and the candidate node with the highest ranking may be allocated to a network shard that matches the first third random value.
- a third random value corresponding to the candidate node may be generated based on a third random value corresponding to a previous candidate node of the candidate node.
- the candidate node may be allocated to a network shard that matches the third random value corresponding to the candidate node.
- third random values corresponding to the plurality of candidate nodes may be randomly generated, which can ensure that the plurality of candidate nodes are randomly divided into different network shards, thereby ensuring the security of the entire blockchain network.
- FIG. 8 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure.
- the process 800 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620.
- the processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 800.
- the operations of the illustrated process presented below are intended to be illustrative.
- the process 800 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 8 and described below is not intended to be limiting.
- candidate nodes in a network shard may be divided into at least one cluster based on address information of each of the candidate nodes.
- the candidate nodes may be divided into at least one cluster by the blockchain network sharding device 1500 (e.g., the second determination module 1530) illustrated in FIG. 15.
- the address information may include a geographic location.
- the geographic location may include a continent, a country, a province, a city, and latitude/longitude information of a location where the candidate node is located.
- the target node may divide one or more candidate nodes within the same geographic area into the same cluster based on the geographic location of each of the candidate nodes in the target network shard. For example, one or more candidate nodes within the same continent may be divided into the same cluster, or one or more candidate nodes within the same country may be divided into the same cluster.
- the clustering operation may be performed based on actual situations (e.g., a distribution of the geographic locations) associated with the geographic locations where the candidate nodes are located. If all the candidate nodes are located in Asia, the clustering operation may be performed according to“country.” If some candidate nodes are located in Asia and some other candidate nodes are located in America, the clustering operation may be performed according to“continent.”
- one or more validation nodes used for data validation in the network shard (e.g., the target network shard) may be determined based on the at least one cluster.
- the one or more validation nodes may be determined by the blockchain network sharding device 1500 (e.g., the second determination module 1530) illustrated in FIG. 15.
- the one or more validation nodes used for data validation in a network shard may be determined according to the following embodiments.
- Embodiment 1 is a diagrammatic representation of Embodiment 1:
- FIG. 9 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure.
- the process 900 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620.
- the processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 900.
- the operations of the illustrated process presented below are intended to be illustrative.
- the process 900 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 9 and described below is not intended to be limiting.
- At least one cluster may be ranked in a descending order based on a count of candidate nodes in each of the at least one cluster.
- cluster 1 includes 100 candidate nodes
- cluster 2 includes 80 candidate nodes
- cluster 3 includes 50 candidate nodes.
- the ranking order of the three clusters is“cluster 1 , cluster 2, and cluster 3.”
- the candidate nodes in the cluster with the highest ranking may be designed as the one or more validation nodes.
- the one or more validation nodes may be selected from the cluster with the highest ranking until a count of selected validation nodes is equal to the preset count.
- the address information may also include an Internet Protocol (IP) address.
- IP Internet Protocol
- the one or more validation nodes may be selected from the cluster with the highest ranking based on the IP address of each of the candidate nodes. More descriptions may be found elsewhere in the present disclosure (e.g., FIG. 10 and the description thereof) (e.g., embodiment 2).
- the one or more validation nodes may be selected from the at least one cluster in turn based on the ranking order of the at least one cluster until a count of selected validation nodes is equal to the preset count.
- the one or more validation nodes may be selected from the at least one cluster in turn based on the ranking order of the at least one cluster until the count of selected validation nodes is equal to the preset count.
- the one or more validation nodes may be selected from the at least one cluster in turn based on a network latency of each of candidate nodes in the at least one cluster. More descriptions may be found elsewhere in the present disclosure (e.g., FIG. 12 and the description thereof) (e.g., embodiment 4).
- Embodiment 2 is a diagrammatic representation of Embodiment 1:
- FIG. 10 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure.
- the process 1000 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620.
- the processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 1000.
- the operations of the illustrated process presented below are intended to be illustrative.
- the process 1000 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 10 and described below is not intended to be limiting.
- the one or more validation nodes may be selected from the cluster with the highest ranking based on an IP address of each of the candidate nodes.
- one or more candidate nodes within a same network segment may be divided into a same sub-cluster based on the IP address of each of the candidate nodes in the cluster with the highest ranking.
- the cluster with the highest ranking may be divided into three sub-clusters based on the IP address of each of the candidate nodes in the cluster with the highest ranking.
- IP addresses of candidate nodes in the sub-clusters may be in a same network segment.
- one or more candidate nodes within adjacent network segments may also be divided into a same sub-cluster according to actual situations.
- At least one sub-cluster may be ranked in a descending order based on a count of candidate nodes in each of the at least one sub-cluster.
- the cluster e.g., cluster 1
- the ranking order of the three sub-clusters is“sub-cluster 1 , sub-cluster 2, and sub-cluster 3.”
- the candidate nodes in the sub-cluster with the highest ranking may be designated as the one or more validation nodes.
- the one or more validation nodes may be selected from the sub-cluster with the highest ranking in turn until that a count of selected validation nodes is equal to the preset count.
- the one or more validation nodes may be selected from the sub-cluster with the highest ranking based on a network latency of each of the candidate nodes. More descriptions may be found elsewhere in the present disclosure (e.g., FIG. 11 and the description thereof) (e.g., embodiment 3).
- the one or more validation nodes may be selected from the at least one sub-cluster in turn according to a ranking order of the at least one sub-cluster until a count of selected validation nodes is equal to the preset count.
- a sub-cluster with a second ranking includes 30 candidate nodes and 50 plus 30 is still less than 90 (i.e., the preset count), one or more validation nodes need to be selected from a sub cluster with a third ranking.
- the sub-cluster with the third ranking includes 20 candidate nodes, 10 validation nodes may be selected from the sub-cluster with the third ranking.
- the sub-cluster with the third ranking may be designated as a first target sub-cluster and 10 validation nodes may be selected from the sub-cluster with the third ranking based on a network latency of each of the candidate nodes in the sub-cluster with the third ranking in a manner similar to process 1100 (e.g., embodiment 3) described in FIG. 11.
- Embodiment 3 is a diagrammatic representation of Embodiment 3
- FIG. 11 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure.
- the process 1100 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620.
- the processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 1100.
- the operations of the illustrated process presented below are intended to be illustrative.
- the process 1100 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 11 and described below is not intended to be limiting.
- the sub-cluster with the highest ranking may be designated as a first target sub-cluster.
- candidate nodes in the first target sub-cluster may be ranked in an ascending order based on a network latency of each of the candidate nodes in the first target sub-cluster.
- the one or more validation nodes may be selected from the first target sub-cluster in turn based on the ranking until a count of selected validation nodes is equal to the preset count.
- Embodiment 4 is a diagrammatic representation of Embodiment 4:
- FIG. 12 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure.
- the process 1200 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620.
- the processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 1200.
- the operations of the illustrated process presented below are intended to be illustrative.
- the process 1200 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 12 and described below is not intended to be limiting.
- the one or more validation nodes may be selected from the at least one cluster in turn based on the ranking order of the at least one cluster until a count of selected validation nodes is equal to the preset count.
- the one or more validation nodes may be selected from the at least one cluster based on a network latency of each of candidate nodes in the at least one cluster. Specifically, it is assumed that one or more validation node need to be selected from an ith cluster of the at least one cluster and a count of candidate nodes in the ith cluster is greater than a count of the one or more validation nodes to be selected from the ith cluster.
- candidate nodes within a same network segment may be divided into a same sub-cluster based on an IP address of each of the candidate nodes in the ith cluster.
- At least one sub-cluster may be ranked in a descending order based on a count of candidate nodes in each of the at least one sub-cluster.
- the candidate nodes in the sub-cluster with the highest ranking may be designated as the one or more validation nodes to be selected from the ith cluster.
- one or more validation nodes may be selected from the sub cluster with the highest ranking in turn until a count of selected validation nodes is equal to the count of the one or more validation nodes to be selected from the ith cluster.
- the count of the one or more validation nodes to be selected from the ith cluster is 50 and the count of candidate nodes in the sub-cluster (e.g., a sub-cluster 1 ) with the highest ranking in the ith cluster is 60 which is greater than 50, 50 validation nodes may be selected from the sub-cluster with the highest ranking in turn.
- the sub-cluster with the highest ranking may be designated as a second target sub-cluster and one or more (e.g., 50) validation nodes may be selected from the sub-cluster with the highest ranking according to a manner similar to process 1100 (e.g., embodiment 3) described in FIG. 11.
- one or more validation nodes may be selected from the ith cluster in turn according to a ranking order of the at least one sub-cluster until a count of selected validation nodes is equal to the count of the one or more validation nodes to be selected from the ith cluster.
- the count of the one or more validation nodes to be selected from the ith cluster is 50 and the count of candidate nodes in the sub-cluster (e.g., sub-cluster 1 ) with the highest ranking in the ith cluster is 40 which is less than 50
- the one or more validation nodes to be selected from the ith cluster may be selected from the at least one sub-cluster in the ith cluster in turn according to the ranking order of the at least one sub-cluster.
- the 40 candidate nodes in the sub-cluster (e.g., sub-cluster 1 ) with the highest ranking are designated as validation nodes
- one or more validation nodes may be selected from a kth sub-cluster, wherein k is an integer greater than 1.
- the sub-cluster with the second ranking may be designated as the second target sub-cluster and 10 validation nodes may be selected from the sub-cluster with the second ranking based on a network latency of each of the candidate nodes in the sub-cluster with the second ranking in a manner similar to process 1100 (e.g., embodiment 3) described in FIG. 11.
- Embodiment 5 is a diagrammatic representation of Embodiment 5:
- the count of candidate nodes in the cluster (e.g., cluster 1 ) with the highest ranking is 140
- 10 remainder validation nodes need to be selected, in this situation, if a count (e.g.,
- candidate nodes in a cluster (e.g., cluster 2) with a second ranking is much greater than 10, there may be no need to divide the candidate nodes in the cluster (e.g., cluster 2) with the second ranking into sub-clusters based on IP address information.
- 10 candidate nodes of which IP addresses are within a same network segment or adjacent network segments as the candidate nodes in the cluster (e.g., cluster 1 ) with the highest ranking may be directly selected from the cluster (e.g., cluster 2) with the second ranking.
- the target node may determine the one or more validation nodes used for data validation in the target network shard based on a network latency of each of the candidate nodes in the target network shard. For example, the candidate nodes may be ranked in an ascending order based on the network latency of each of the candidate nodes and the one or more validation nodes used for data validation may be selected in turn based on the ranking.
- FIG. 13 is a flowchart illustrating an exemplary process for determining a network latency of a candidate node according to some embodiments of the present disclosure.
- the process 1300 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620.
- the processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 1300.
- the operations of the illustrated process presented below are intended to be illustrative.
- the process 1300 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 13 and described below is not intended to be limiting.
- an echo request may be sent to the candidate node by the second master node (e.g., the target node) and an echo reply may be received from the candidate node.
- the second master node e.g., the target node
- each of the candidate nodes may automatically send an echo reply to the target node.
- the network latency of the candidate node may be determined based on a time difference between a time point at which the echo request is sent to the candidate node and a time point at which the echo node reply is received from the candidate node.
- FIG. 14 is a flowchart illustrating an exemplary process for verifying a signature of a candidate node according to some embodiments of the present disclosure.
- the process 1400 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620.
- the processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 1400.
- the operations of the illustrated process presented below are intended to be illustrative.
- the process 1400 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 14 and described below is not intended to be limiting.
- each of the candidate nodes before the address information of the candidate node is obtained by the target node, a security validation needs to be performed on the candidate node, so as to prevent an IP address of the candidate node attempting to establish a connection with the target node from being impersonated. Therefore, before the method for determining the plurality of network shards in the blockchain network is implemented, each of the candidate nodes needs to register its public key and signature to an identity chain of the blockchain network and broadcasts them to each of remainder candidate nodes.
- the signature may be associated with encryption information of an IP address that is encrypted based on a private key of the candidate node.
- the target node may receive the public key and the signature of the candidate node sent by the candidate node, or obtain the public key and the signature of the candidate node from the identity chain. Then the target node may verify the signature of the candidate node based on the public key of the candidate node. If the signature is verified, the target node may obtain the IP address of the candidate node from the signature. Further, the target node may also obtain a geographic location, a time zone, an operator, and/or Classless Inter-Domain Routing (CIDR) information of the candidate node based on the IP address.
- CIDR Classless Inter-Domain Routing
- the signature of the candidate node may be decrypted based on the public key of the candidate node.
- the IP address in the signature of the candidate node may be resolved. Further, whether an IP address of the candidate node when a connection with the candidate node is established is the same as the IP address in the signature may be determined.
- the signature of the candidate node in response to a determination that the IP address of the candidate node when the connection with the candidate node is established is the same as the IP address in the signature, the signature of the candidate node may be determined to be verified.
- a plurality of candidate nodes in the blockchain network may be divided into a plurality of different network shards, which can improve the handling capacity of the blockchain network.
- one or more validation nodes used for data validation in the network shard may be selected based on address information and/or a network latency of each of candidate nodes in the network shard, which may further reduce a latency in data validation performed by the one or more validation nodes and improve a real-time performance of the data validation.
- the plurality of candidate nodes in the blockchain network may be divided into the plurality of different network shards randomly, which can ensure security.
- FIG. 15 is a schematic diagram illustrating an exemplary blockchain network sharding device according to some embodiments of the present disclosure.
- the blockchain network sharding device 1500 may include a sharding module 1510, a first determination module 1520, a second determination module 1530, and/or an obtaining module 1540.
- the blockchain network sharding device 1500 may be configured to perform a process (e.g., process 500, process 600, process 700, process 800, process 900, process 1000, process 1100, process 1200, process 1300, process 1400) described elsewhere in the present disclosure.
- one or more modules of the blockchain network sharding device 1500 may be integrated into a processing device 1700 illustrated in FIG. 17.
- the sharding module 1510 may be configured to determine a first master node in the blockchain network 100, and divide a plurality of candidate nodes in the blockchain network 100 into a plurality of different network shards. Specifically, in response to that the first master node is a target node, the sharding module 1510 may divide the plurality of candidate nodes in the blockchain network 100 into the plurality of different network shards.
- the target node may be any node in the blockchain network 100; the plurality of candidate nodes may be randomly selected from all nodes in the blockchain network 100.
- the first master node may be determined based on a first random value corresponding to the target node and first random values corresponding tp other candidate nodes. If the first random value corresponding to the target node and the first random values corresponding to other candidate nodes satisfy a preset size relationship, the sharding module 1510 may determine the first master node to be the target node.
- the preset size relationship may include one of the first random values corresponding to other candidate nodes being greater than the first random value corresponding to the target node, or the first random values corresponding to other candidate nodes being less than the first random value corresponding to the target node.
- the sharding module 1510 may generate a random seed based on a second random value corresponding to the target node and second random values corresponding to other candidate nodes.
- the sharding module 1510 may divide the plurality of candidate nodes into the plurality of different network shards based on the random seed. For example, for a candidate node with the highest ranking, the sharding module 1510 may determine a third random value corresponding to the candidate node with the highest ranking based on the random seed and a preset random function.
- the sharding module 1510 may generate a third random value corresponding to the candidate node based on a third random value corresponding to a previous candidate node.
- each of the third random values corresponding to the plurality of candidate nodes may match a respective one of a plurality of serial numbers corresponding to a plurality of network shards.
- the sharding module 1510 may allocate the candidate node to a network shard that matches a third random value corresponding to the candidate node based on the third random value corresponding to the candidate node.
- the first determination module 1520 may be configured to for at least one of the plurality of different network shards, determine a second master node in a network shard by any node in the network shard. Specifically, the first
- determination module 1520 may determine a second master node in a network shard (e.g., a target network shard) where the target node is located.
- a network shard e.g., a target network shard
- the second determination module 1530 may be configured to for the at least one of the plurality pf network shards, one or more validation nodes used for data validation in the network shard based on address information and/or a network latency of each of candidate nodes in the network shard. Specifically, in response to determining that the second master node is the target node, the second determination module 1530 may determine one or more validation nodes used for data validation in the target network shard based on address information and/or a network latency of each of candidate nodes in the target network shard.
- the second determination module 1530 may divide the candidate nodes in the target network shard into at least one cluster based on the address information of each of the candidate nodes.
- the second determination module 1503 may determine, based on the at least one cluster, the one or more validation nodes used for data validation in the target network shard.
- the address information may include a geographic location.
- the second determination module 1530 may divide one or more candidate nodes within a same geographic area into a same cluster based on the geographic location of each of the candidate nodes in the target network shard.
- the second determination module 1530 may rank the at least one cluster in a descending order based on a count of candidate nodes in each of the at least one cluster. If a count of candidate nodes in a cluster with the highest ranking is equal to a preset count, the second determination module 1530 may designate the candidate nodes in the cluster with the highest ranking as the one or more validation nodes.
- the second determination module 1530 may divide one or more candidate nodes within a same network segment into a same sub cluster based on the IP address of each of the candidate nodes in the cluster with the highest ranking.
- the second determination module 1530 may rank at least one sub-cluster in a descending order based on a count of candidate nodes in each of the at least one sub-cluster. If a count of candidate nodes in a sub-cluster with the highest ranking is equal to the preset count, the second determination module 1530 may designate the candidate nodes in the sub-cluster with the highest ranking as the one or more validation nodes.
- the second determination module 1530 may select the one or more validation nodes from the at least one sub cluster in turn according to a ranking order of the at least one sub-cluster until a count of selected validation nodes is equal to the preset count. If the count of candidate nodes in the sub-cluster with the highest ranking is greater than the preset count, the sub-cluster with the highest ranking may be designated as a first target sub-cluster.
- the jth sub-cluster may be designated as a first target sub cluster.
- the second determination module 1530 may rank candidate nodes in the first target sub-cluster in an ascending order based on a network latency of each of the candidate nodes in the first target sub-cluster.
- the second determination module 1530 may select one or more validation nodes from the first target sub cluster in turn based on the ranking until a count of selected validation nodes is equal to a count of one or more candidate nodes to be selected from the first target sub-cluster.
- the second determination module 1530 may select the one or more validation nodes from the at least one cluster in turn based on a ranking order of the at least one cluster until a count of selected validation nodes is equal to the preset count.
- one or more validation nodes may need to be selected from an ith cluster based on the ranking, wherein a value of i is an integer greater than 1 and a count of candidate nodes in the ith cluster is greater than a count of the one or more validation nodes to be selected.
- the determination module 1530 may divide candidate nodes within a same network segment into a same sub-cluster based on the IP address of each of the candidate nodes in the ith cluster.
- the second determination module 1530 may rank at least one sub-cluster in a descending order based on a count of candidate nodes in each of the at least one sub-cluster. If a count of candidate nodes in a sub-cluster with the highest ranking is equal to the count of the one or more validation nodes to be selected from the ith cluster, the second determination module 1530 may designate the candidate nodes in the sub-cluster with the highest ranking as the one or more validation nodes to be selected from the ith cluster.
- the second determination module 1530 may select the one or more validation nodes from the ith cluster from the at least one sub-cluster in turn according to a ranking order of the at least one sub cluster until a count of selected validation nodes is equal to the count of the one or more validation nodes to be selected from the ith cluster. If the count of candidate nodes in the sub-cluster with the highest ranking is greater than the count of one or more validation nodes to be selected from the ith cluster, the sub-cluster with the highest ranking may be designated as a second target sub-cluster.
- the kth sub-cluster may be designated as a second target sub-cluster.
- the second determination module 1530 may rank candidate nodes in the second target sub-cluster in an ascending order based on a network latency of each of the candidate nodes in the second target sub cluster.
- the second determination module 1530 may select one or more validation nodes from the second target sub-cluster in turn based on the ranking until a count of selected validation nodes is equal to a count of one or more candidate nodes to be selected from the second target sub-cluster. [0147] In some embodiments, for each of the candidate nodes in the target network shard, an echo request may be sent to the candidate node by the second master node (e.g., the target node), and an echo reply may be received from the candidate node.
- the second master node e.g., the target node
- the network latency of the candidate node may be determined based on a time difference between a time point at which the echo request is sent to the candidate node and a time point at which the echo node reply is received from the candidate node.
- the obtaining module 1540 may be configured to obtain a public key and a signature of the candidate node, wherein the signature is associated with encryption information of an IP address that is encrypted based on a private key of the candidate node.
- the obtaining module 1540 may be configured to verify the signature of the candidate node based on the public key of the candidate node. If the signature of the candidate node is verified, the obtaining module 1540 may be configured to obtain the IP address of the candidate node from the signature, and obtain a geographic location of the candidate node based on the IP address. In some embodiments, the obtaining module 1540 may decrypt the signature of the candidate node based on the public key of the candidate node.
- the obtaining module 1540 may resolve the IP address in the signature of the candidate node. The obtaining module 1540 may determine whether an IP address of the candidate node when a connection with the candidate node is established is the same as the IP address in the signature. In response to a determination that the IP address of the candidate node when the connection with the candidate node is established is the same as the IP address in the signature, the obtaining module 1540 may determine that the signature of the candidate node is verified.
- a plurality of candidate nodes in the blockchain network may be divided into a plurality of different network shards, which can improve the handling capacity of the blockchain network.
- one or more validation nodes used for data validation in the network shard may be selected based on address information and/or a network latency of each of candidate nodes in the network shard, which may further reduce a latency in data validation performed by the one or more validation nodes and improve a real-time performance of the data validation.
- the plurality of candidate nodes in the blockchain network may be divided into the plurality of different network shards randomly, which can ensure security.
- the modules in the blockchain network sharding device 1500 may be connected to or communicated with each other via a wired connection or a wireless connection.
- the wired connection may include a metal cable, an optical cable, a hybrid cable, or the like, or any combination thereof.
- the wireless connection may include a Local Area Network (LAN), a Wide Area Network (WAN), a Bluetooth, a ZigBee, a Near Field Communication (NFC), or the like, or any combination thereof.
- LAN Local Area Network
- WAN Wide Area Network
- Bluetooth Bluetooth
- ZigBee ZigBee
- NFC Near Field Communication
- FIG. 16 is a schematic diagram illustrating an exemplary electronic device according to some embodiments of the present disclosure.
- the electronic device 1600 may include a processor 1610, a storage device 1620, and a bus 1630.
- one or more components of the electronic device 1600 may be integrated into or implemented by the computing device 200 or the mobile device 300.
- the storage device 1620 may store machine-readable instructions (e.g., executable instructions corresponding to the sharding module 1510, the first determination module 1520, the second determination module 1530, and/or the obtaining module 1540 in FIG. 15) that may be executed by the processor 1610.
- the processor 1610 may communicate with the storage device 1620 via the bus 1630.
- a process e.g., process 500, process 600, process 700, process 800, process 900, process 1000, process 1100, process 1200, process 1300, process 1400
- a process e.g., process 500, process 600, process 700, process 800, process 900, process 1000, process 1100, process 1200, process 1300, process 1400
- FIG. 17 is a block diagram illustrating an exemplary processing device according to some embodiments of the present disclosure.
- the processing device 1700 may include an obtaining module 1720 and an identification module 1740.
- any node in the blockchain network 100 may be implemented by the processing device 1700.
- the processing device 1700 may be implemented on the computing device 200 or the mobile device 300.
- the obtaining module 1720 may be configured to obtain one or more network shards associated with a candidate node set in the blockchain network 100.
- Each of the one or more network shards may include one or more candidate nodes.
- the blockchain network 100 may include a plurality of nodes, accordingly, the candidate node set may include all or a portion of the plurality of nodes in the blockchain network 100.
- the one or more network shards may be determined by a first node in the candidate node set.
- the one or more network shards may be pre determined in the blockchain network 100.
- the obtaining module 1720 may directly obtain the one or more network shards from the blockchain network 100. More descriptions regarding the obtaining of the one or more network shards may be found elsewhere in the present disclosure (e.g., FIG. 18 and the description thereof).
- the identification module 1740 may be configured to for at least one (e.g., a network shard where the first node is located) of the one or more network shards, identify, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
- the term“target node” may refer to a candidate node that may be used for data processing (e.g., data validation, data storage) associated with a transaction to be processed by the blockchain network 100.
- a second node in the network shard may be
- the second node may identify the one or more target nodes in the network shard.
- the identification module 1740 may divide the one or more candidate nodes in the network shard into at least one cluster based on the location (e.g., a geographic location) of each of the one or more candidate nodes in the network shard. Further, the identification module 1740 may determine the one or more target nodes in the network shard based on the at least one cluster. More descriptions regarding determining the one or more target nodes may be found elsewhere in the present disclosure (e.g., FIGs. 20-22 and the descriptions thereof).
- the identification module 1740 may rank the one or more candidate nodes in an ascending order based on the network latency of each of the one or more candidate nodes in the network shard. Further, the identification module 1740 may designate top w candidate nodes based on the ranking as the one or more target nodes in the network shard, wherein the value of w may be equal to a preset count which may be determined based on information (e.g., transaction type, transaction data amount) associated with the transaction to be processed by the blockchain network 100 or a default setting of the blockchain network 100. In some embodiments, the
- identification module 1740 may divide the one or more candidate nodes in the network shard into at least one cluster based on an IP address of each of the one or more candidate nodes in the network shard. Further, the identification module 1740 may determine the one or more target nodes in the blockchain network shard based on the at least one cluster according to a manner similar to the manner described in FIGs. 21 -22.
- the modules in the processing device 1700 may be connected to or communicated with each other via a wired connection or a wireless connection.
- the wired connection may include a metal cable, an optical cable, a hybrid cable, or the like, or any combination thereof.
- the wireless connection may include a Local Area Network (LAN), a Wide Area Network (WAN), a Bluetooth, a ZigBee, a Near Field Communication (NFC), or the like, or any combination thereof.
- LAN Local Area Network
- WAN Wide Area Network
- NFC Near Field Communication
- Two or more of the modules may be combined into a single module, and any one of the modules may be divided into two or more units.
- the obtaining module 1720 and the identification module 1740 may be combined as a single module.
- the processing device 1700 may include a storage module (not shown) for storing information and/or data generated by the processing device 1700.
- FIG. 18 is a flowchart illustrating an exemplary process for identifying one or more target nodes in a blockchain network according to some embodiments of the present disclosure.
- the process 1800 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, or the storage 390.
- the processor 220, the CPU 340, and/or the modules in FIG. 17 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, and/or the modules may be configured to perform the process 1800.
- the operations of the illustrated process presented below are intended to be illustrative. In some embodiments, the process 1800 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 18 and described below is not intended to be limiting.
- the processing device 1700 may obtain one or more network shards associated with a candidate node set in the blockchain network 100.
- Each of the one or more network shards may include one or more candidate nodes.
- the blockchain network 100 may include a plurality of nodes, accordingly, the candidate node set may include all or a portion of the plurality of nodes in the blockchain network 100. For example, a portion of the plurality of nodes may be randomly selected from the plurality of nodes and designated as candidate nodes in the candidate node set. As another example, all the plurality of nodes in the blockchain network may be designated as the candidate nodes in the candidate node set.
- the one or more network shards may be determined by a first node in the candidate node set based on a random seed, wherein the first node may satisfy a first preset condition.
- the first preset condition may include that a first condition value (e.g., a first random value) corresponding to the first node is maximum among first condition values corresponding to the candidate nodes in the candidate node set or the first condition value corresponding to the first node is minimum among the first condition values corresponding to the candidate nodes in the candidate node set.
- the first condition value may be generated by a corresponding candidate node using a first preset function such as a Verified Random Function (VRF), an Algorand algorithm, a Dfinity algorithm, an Ouroborous Praos algorithm, etc.
- VRF Verified Random Function
- Algorand algorithm Algorand algorithm
- Dfinity algorithm a Dfinity algorithm
- Ouroborous Praos algorithm etc.
- the first node may be determined by any node (e.g., the target node described in FIG. 5) in the candidate node set based on the first preset condition.
- the random seed may be determined by the first node based on second condition values (e.g., second random values) corresponding to the candidate nodes in the candidate node set.
- second condition values e.g., second random values
- the first node may generate a second condition value
- the first node may determine the random seed by concatenating the second condition values corresponding to the candidate nodes in the candidate node set.
- the second condition value may be generated by a corresponding candidate node using a second preset function which may be the same as or different from the first preset function.
- the first node may randomly rank the candidate nodes in the candidate node set. For each of the candidate nodes in the candidate node set, a third condition value (e.g., a third random value) corresponding to the candidate node may be determined based on the ranking and the random seed.
- a third condition value e.g., a third random value
- a third condition value corresponding to the candidate node with the highest ranking may be determined based on the random seed; for each of remainder candidate nodes other than the candidate node with the highest ranking in the candidate node set, a third condition value corresponding to the candidate node may be determined based on a third condition value corresponding to a previous candidate node. Further, the first node may determine the one or more network shards based on the third condition values corresponding to the candidate nodes in the candidate node set.
- the first node may allocate a candidate node with a third condition value matching a serial number corresponding to a specific network shard.
- “matching” refers to that at least a portion of the third condition value corresponding to the candidate node is the same as a portion of the serial number corresponding to the network shard.
- the first node may allocate candidate nodes with a same portion (e.g., last few digits (e.g., last three digits)) to a same network shard.
- the one or more network shards may be pre determined in the blockchain network 100.
- the processing device 1700 may directly obtain the one or more network shards from the blockchain network 100.
- the processing device 1700 e.g., the identification module 1740 (e.g., the processing circuits of the processor 220) may identify, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
- the term“target node” may refer to a candidate node that may be used for data processing (e.g., data validation, data storage) associated with a transaction to be processed by the blockchain network 100.
- a second node in the network shard may be determined according to a manner the same as or similar to the manner in which the first node in the candidate node set is determined. Further, the second node may identify the one or more target nodes in the network shard.
- the processing device 1700 may divide the one or more candidate nodes in the network shard into at least one cluster based on the location (e.g., a geographic location) of each of the one or more candidate nodes in the network shard. Further, the processing device 1700 may determine the one or more target nodes in the network shard based on the at least one cluster. More descriptions regarding determining the one or more target nodes may be found elsewhere in the present disclosure (e.g., FIGs. 20-22 and the descriptions thereof).
- the processing device 1700 may rank the one or more candidate nodes in an ascending order based on the network latency of each of the one or more candidate nodes in the network shard. Further, the processing device 1700 may designate top w candidate nodes based on the ranking as the one or more target nodes in the network shard, wherein a value of w may be equal to a preset count which may be determined based on information (e.g., transaction type, transaction data amount) associated with the transaction to be processed by the blockchain network 100 or a default setting of the blockchain network 100.
- information e.g., transaction type, transaction data amount
- the processing device 1700 may divide the one or more candidate nodes in the network shard into at least one cluster based on an IP address of each of the one or more candidate nodes in the network shard. For example, the processing device 1700 may divide candidate nodes within a same network segment or adjacent network segments into a same cluster based on IP addresses of the candidate nodes. Further, the processing device 1700 may determine the one or more target nodes in the blockchain network shard based on the at least one cluster according to a manner similar to the manner described in FIGs. 21 -22.
- the processing device 1700 may obtain a public key and a signature (which may be associated with encrypted address information of the candidate node) of the candidate node and extract the location of the candidate node from the encrypted address information by verifying the signature based on the public key.
- the location of the candidate node may include a continent, a country, a province, a state, a county, a shire, a city, a town, a borough, a district, longitude and latitude, and/or an IP address where the candidate node is located.
- the processing device 1700 may send an echo request to the candidate node at a first time point and receive an echo reply from the candidate node at a second time point. Further, the processing device 1700 may determine the network latency of the candidate node based on a time difference between the first time point and the second time point.
- the processing device 1700 may store information and/or data (e.g., the one or more target nodes) associated with the blockchain network 100 in a storage device disclosed elsewhere in the present disclosure.
- FIG. 19 is a block diagram illustrating an exemplary identification module according to some embodiments of the present disclosure.
- the identification module 1740 may include a division unit 1910, a count determination unit 1920, a ranking unit 1930, and a target node determination unit 1940.
- the division unit 1910 may be configured to divide one or more candidate nodes in a network shard into at least one cluster based on a location of each of the one or more candidate nodes. As described in connection with FIG. 8, division unit 1910 may determine the at least one cluster according to“city,”“district,” etc.
- the count determination unit 1920 may be configured to determine a count of candidate nodes in the cluster.
- the ranking unit 1930 may be configured to rank the at least one cluster in a descending order based on at least one count corresponding to the at least one cluster.
- the target node determination unit 1940 may be configured to determine one or more target nodes in the network shard. In some embodiments, the target node determination unit 1940 may determine whether a count of candidate nodes in the cluster with the highest ranking is less than a preset count. In response to a determination that the count of candidate nodes in the cluster with the highest ranking is not less than the preset count, the target node determination unit 1940 may determine the one or more target nodes in the cluster with the highest ranking.
- the target node determination unit 1940 may determine the one or more target nodes in clusters from the cluster with the highest ranking to an ith cluster based on the ranking. More descriptions regarding determining the one or more target nodes may be found elsewhere in the present disclosure (e.g., FIGs. 20-22 and the descriptions thereof).
- the units in the identification module 1740 may be connected to or communicated with each other via a wired connection or a wireless connection.
- the wired connection may include a metal cable, an optical cable, a hybrid cable, or the like, or any combination thereof.
- the wireless connection may include a Local Area Network (LAN), a Wide Area Network (WAN), a Bluetooth, a ZigBee, a Near Field Communication (NFC), or the like, or any combination thereof.
- LAN Local Area Network
- WAN Wide Area Network
- NFC Near Field Communication
- Two or more of the units may be combined into a single module, and any one of the units may be divided into two or more sub-units.
- the count determination unit 1920 and the ranking unit 1930 may be integrated into a single unit.
- a storing unit may be added in the identification module 1740 for storing.
- FIG. 20 is a flowchart illustrating an exemplary process for identifying one or more target nodes in a network shard according to some embodiments of the present disclosure.
- the process 2000 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, or the storage 390.
- the processor 220, the CPU 340, and/or the identification module 1740 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, and/or the identification module 1740 may be configured to perform the process 2000.
- the operations of the illustrated process presented below are intended to be illustrative.
- the process 2000 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 20 and described below is not intended to be limiting. In some embodiments, operation 1802 may be achieved by one or more operations of the process 2000.
- the processing device 1700 may divide one or more candidate nodes in the network shard into at least one cluster based on a location of each of the one or more candidate nodes. As described in connection with FIG. 8, the processing device 1700 may determine the at least one cluster according to“city,”“district,” etc.
- the processing device 1700 e.g., the count determination unit 1920
- the processing circuits of the processor 220 may determine a count of candidate nodes in the cluster.
- the processing device 1700 e.g., the ranking unit 1930
- the processing circuits of the processor 220 may rank the at least one cluster in a descending order based on at least one count corresponding to the at least one cluster.
- the processing device 1700 e.g., the target node determination unit 1940
- the processing circuits of the processor 220 may determine whether a count of candidate nodes in the cluster with the highest ranking is less than a preset count.
- the processing device 1700 in response to a determination that the count of candidate nodes in the cluster with the highest ranking is not less than the preset count, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine the one or more target nodes in the cluster with the highest ranking.
- the processing device 1700 e.g., the target node determination unit 1940
- the processing circuits of the processor 220 may determine the one or more target nodes in the cluster with the highest ranking.
- the processing device 1700 may designate the candidate nodes in the cluster with the highest ranking as the one or more target nodes. [0187] In some embodiments, in response to a determination that the count of candidate nodes in the cluster with the highest ranking is greater than the preset count, the processing device 1700 may determine the one or more target nodes in the cluster with the highest ranking based on an IP address and/or a network latency of each of the candidate nodes in the cluster with the highest ranking.
- the processing device 1700 may rank the candidate nodes in the cluster with the highest ranking in an ascending order based on the network latency of each of the candidate nodes in the cluster with the highest ranking.
- the processing device 1700 may designate top f candidate nodes based on the ranking as the one or more target nodes, wherein a value of f may be equal to the preset count.
- the processing device 1700 may divide the candidate nodes in the cluster with the highest ranking into at least one sub-cluster based on the IP address of each of the candidate nodes in the cluster with the highest ranking.
- the processing device 1700 may determine the one or more target nodes based on the at least one sub-cluster. More descriptions regarding determining the one or more target nodes based on the IP address of each of the candidate nodes in the cluster with the highest ranking may be found elsewhere in the present disclosure (e.g., FIG. 21 and the description thereof).
- the processing device 1700 in response to a determination that the count of candidate nodes in the cluster with the highest ranking is less than the preset count, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine the one or more target nodes in clusters from the cluster with the highest ranking to an ith cluster based on the ranking.
- the processing device 1700 e.g., the target node determination unit 1940
- the processing circuits of the processor 220 may determine the one or more target nodes in clusters from the cluster with the highest ranking to an ith cluster based on the ranking.
- the processor 220 may identify the ith cluster based on the ranking of the at least one cluster. For example, the processing device 1700 may identify the ith cluster according to a condition that a count of candidate nodes from the cluster with the highest ranking to the ith cluster is greater than the preset count and a count of candidate nodes from the cluster with the highest ranking to an (i-1 )th cluster is less than the preset count.
- the processing device 1700 may determine the one or more target nodes from the cluster with the highest ranking to the ith cluster based on an IP address and/or a network latency of each of candidate nodes in the ith cluster. For example, the processing device 1700 may rank the candidate nodes in the ith cluster in an ascending order based on network latencies corresponding to the candidate nodes in the ith cluster.
- the processing device 1700 may designate top g candidate nodes based on the ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster as the one or more target nodes, wherein a sum of a value of g and the count of the candidate nodes form the cluster with the highest ranking to the (i-1 )th cluster may be equal to the preset count.
- the processor 220 may divide the candidate nodes in the ith cluster into at least one sub-cluster based on the IP address of each of the candidate nodes in the ith cluster.
- the processing device 1700 may determine the one or more target nodes based on the at least one sub-cluster. More descriptions regarding determining the one or more target nodes based on the IP address of each of the candidate nodes in the ith cluster may be found elsewhere in the present disclosure (e.g., FIG. 22 and the description thereof).
- FIG. 21 is a flowchart illustrating an exemplary process for determining one or more target nodes in a cluster with the highest ranking according to some embodiments of the present disclosure.
- the process 2100 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, or the storage 390.
- the processor 220, the CPU 340, and/or the identification module 1740 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, and/or the identification module 1740 may be configured to perform the process 2100.
- the operations of the illustrated process presented below are intended to be illustrative.
- the process 2100 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 21 and described below is not intended to be limiting. In some embodiments, operation 2005 may be achieved by one or more operations of the process 2100.
- the processing device 1700 may divide candidate nodes in the cluster with the highest ranking into at least one sub-cluster based on an IP address of each of the candidate nodes. As described in connection with FIG. 10, the processing device 1700 may divide candidate nodes within a same network segment or adjacent network segments into a same sub-cluster.
- the term“network segment” may refer to a subnet broadcast address.
- the network segment of a candidate node may be determined by performing a logical operation (e.g., an“AND” operation) on an IP address of the candidate node and a subnet mask corresponding to the IP address.
- the processing device 1700 e.g., the target node determination unit 1940
- the processing circuits of the processor 220 may determine a count of candidate nodes in the sub-cluster.
- the processing device 1700 may rank the at least one sub-cluster in a descending order based on at least one count corresponding to the at least one sub-cluster.
- the processing device 1700 e.g., the target node determination unit 1940
- the processing circuits of the processor 220 may determine whether a count of candidate nodes in the sub-cluster with the highest ranking is less than the preset count.
- the processing device 1700 in response to a determination that the count of candidate nodes in the cluster with the highest ranking is not less than the preset count, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine the one or more target nodes in the sub-cluster with the highest ranking.
- the processing device 1700 e.g., the target node determination unit 1940
- the processing circuits of the processor 220 may determine the one or more target nodes in the sub-cluster with the highest ranking.
- the processing device 1700 may designate the candidate nodes in the sub cluster with the highest ranking as the one or more target nodes.
- the processing device 1700 may determine the one or more target nodes in the cluster with the highest ranking based on a network latency of each of the candidate nodes in the sub-cluster with the highest ranking. For example, for each of the candidate nodes in the sub-cluster with the highest ranking, the processing device 1700 may determine a network latency corresponding to the candidate node. The processing device 1700 may rank the candidate nodes in the sub-cluster with the highest ranking in an ascending order based on network latencies corresponding to the candidate nodes. The processing device 1700 may designate top m candidate nodes based on the ranking as the one or more target nodes, wherein a value of m may be equal to the preset count.
- the processing device 1700 in response to a determination that the count of candidate nodes in the sub-cluster with the highest ranking is less than the preset count, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine the one or more target nodes in sub clusters from the sub-cluster with the highest ranking to a jth sub-cluster based on the ranking.
- the processing device 1700 e.g., the target node determination unit 1940
- the processing circuits of the processor 220 may determine the one or more target nodes in sub clusters from the sub-cluster with the highest ranking to a jth sub-cluster based on the ranking.
- the processing device 1700 may identify the jth sub cluster based on the ranking of the at least one sub-cluster. For example, the processing device 1700 may identify the jth sub-cluster according to a preset condition that a count of candidate nodes from the sub-cluster with the highest ranking to the jth sub-cluster is greater than the preset count and a count of candidate nodes from the sub-cluster with the highest ranking to a (j-1 )th sub-cluster is less than the preset count.
- the processing device 1700 may determine the one or more target nodes from the sub-cluster with the highest ranking to the jth sub cluster based on a network latency of each of candidate nodes in the jth sub-cluster. For example, for each of the candidate nodes in the jth sub-cluster, the processing device 1700 may determine a network latency corresponding to the candidate node. The processing device 1700 may rank the candidate nodes in the jth sub-cluster in an ascending order based on network latencies corresponding to the candidate nodes.
- the processing device 1700 may designate top n candidate nodes based on the ranking and the candidate nodes from the sub-cluster with the highest ranking to the (j-1 )th sub-cluster as the one or more target nodes, wherein a sum of a value of n and the count of candidate nodes from the sub-cluster with the highest ranking to the (j-1 )th sub-cluster may be equal to the preset count.
- FIG. 22 is a flowchart illustrating an exemplary process for determining one or more target nodes from a cluster with the highest ranking to an ith cluster according to some embodiments of the present disclosure.
- the process 2200 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, or the storage 390.
- the processor 220 and/or the identification module 1740 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, and/or the identification module 1740 may be configured to perform the process 2200.
- the operations of the illustrated process presented below are intended to be illustrative.
- the process 2200 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 22 and described below is not intended to be limiting. In some embodiments, operation 2006 may be achieved by one or more operations of the process 2200.
- the processing device 1700 e.g., the target node determination unit 1940
- the processing circuits of the processor 220 may divide candidate nodes in the ith cluster into at least one sub-cluster based on an IP address of each of the candidate nodes.
- the processing device 1700 e.g., the target node determination unit 1940
- the processing circuits of the processor 220 may determine a count of candidate nodes in the sub-cluster.
- the processing device 1700 e.g., the target node determination unit 1940
- the processing circuits of the processor 220 may rank the at least one sub-cluster in a descending order based on at least one count corresponding to the at least one sub-cluster.
- the processing device 1700 e.g., the identification module 714, the target node determination unit 1940
- the processing circuits of the processor 220 may determine whether a count of candidate nodes in a sub-cluster with the highest ranking and candidate nodes from a cluster with the highest ranking to an (i- 1 )th cluster is less than the preset count.
- the processing device 1700 in response to a determination that the count of the candidate nodes in the sub-cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is not less than to the preset count, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine the one or more target nodes in the sub-cluster with the highest ranking and clusters from the cluster with the highest ranking to the (i-1 )th cluster.
- the processing device 1700 e.g., the target node determination unit 1940
- the processing circuits of the processor 220 may determine the one or more target nodes in the sub-cluster with the highest ranking and clusters from the cluster with the highest ranking to the (i-1 )th cluster.
- the processing device 1700 may designate the candidate nodes in the sub cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster as the one or more target nodes.
- the processing device 1700 may determine the one or more target nodes in the sub-cluster with the highest ranking and clusters from the cluster with the highest ranking to the (i-1 )th cluster based on a network latency of each of the candidate nodes in the sub-cluster with the highest ranking. For example, for each of the candidate nodes in the sub-cluster with the highest ranking, the processing device 1700 may determine a network latency corresponding to the candidate node.
- the processing device 1700 may rank the candidate nodes in the sub-cluster with the highest ranking in an ascending order based on network latencies corresponding to the candidate nodes.
- the processing device 1700 may designate top p candidate nodes based on the ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster as the one or more target nodes, wherein a sum of a value of p and the count of the one or more candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster may be equal to the preset count.
- the processing device 1700 in response to a determination that the count of the candidate nodes in the sub-cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is less than the preset count, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine the one or more target nodes in sub-clusters from the sub-cluster with the highest ranking to a kth sub cluster based on the ranking and clusters from the cluster with the highest ranking to the (i-1 )th cluster.
- the processing device 1700 e.g., the target node determination unit 1940
- the processing circuits of the processor 220 may determine the one or more target nodes in sub-clusters from the sub-cluster with the highest ranking to a kth sub cluster based on the ranking and clusters from the cluster with the highest ranking to the (i-1 )th cluster.
- the processor may identify the kth sub-cluster based on the ranking of the at least one sub-cluster. For example, the processing device 1700 may identify the kth sub-cluster according to a condition that a count of candidate nodes from the sub-cluster with the highest ranking to the kth sub-cluster and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is greater than the preset count and a count of candidate nodes from the sub cluster with the highest ranking to a (k-1 )th sub-cluster and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is less than the preset count.
- the processing device 1700 may determine the one or more target nodes in sub-clusters from the sub-cluster with the highest ranking to the kth sub-cluster based on the ranking and clusters from the cluster with the highest ranking to the (i-1 )th cluster based on a network latency of each of candidate nodes in the kth sub-cluster. For example, for each of the candidate nodes in the kth sub-cluster, the processing device 1700 may determine a network latency corresponding to the candidate node. The processing device 1700 may rank the candidate nodes in the kth sub-cluster in an ascending order based on network latencies corresponding to the candidate nodes.
- the processing device 1700 may designate top q candidate nodes based on the ranking, the candidate nodes from the sub-cluster with the highest ranking to the (k-1 )th sub-cluster, and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster as the one or more target nodes, wherein a sum of a value of q, the count of the candidate nodes from the sub-cluster with the highest ranking to the (k-1 )th sub-cluster, and the count of candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster may be equal to the preset count.
- the present disclosure may also provide a storage medium storing a computer program thereon.
- the computer program When executed by a processor, the computer program may direct the processor to perform a process (e.g., process 1800, process 2000, process 2100, process 2200) described elsewhere in the present disclosure.
- the present disclosure may also provide a computing device including a processor and a storage, wherein the storage stores a computer program.
- the computer program may direct the processor to perform a process (e.g., process 1800, process 2000, process 2100, process 2200) described elsewhere in the present disclosure.
- aspects of the present disclosure may be illustrated and described herein in any of a number of patentable classes or context including any new and useful process, machine, manufacture, or composition of matter, or any new and useful improvement thereof. Accordingly, aspects of the present disclosure may be implemented entirely hardware, entirely software (including firmware, resident software, micro-code, etc.) or combining software and hardware implementation that may all generally be referred to herein as a“unit,”“module,” or“system.” Furthermore, aspects of the present disclosure may take the form of a computer program product embodied in one or more computer readable media having computer readable program code embodied thereon.
- a computer readable signal medium may include 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 signal may take any of a variety of forms, including electro-magnetic, optical, or the like, or any suitable combination thereof.
- a computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that may 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 signal medium may be transmitted using any appropriate medium, including wireless, wireline, optical fiber cable, RF, or the like, or any suitable combination of the foregoing.
- Computer program code for carrying out operations for aspects 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, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB. NET, Python or the like, conventional procedural programming languages, such as the "C" programming language, Visual Basic, Fortran 2003, Perl, COBOL 2002, PHP, ABAP, dynamic programming languages such as Python, Ruby and Groovy, or other programming languages.
- object-oriented programming language such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB. NET
- Python or the like
- conventional procedural programming languages such as the "C" programming language, Visual Basic, Fortran 2003, Perl, COBOL 2002, PHP, ABAP, dynamic programming languages such as Python, Ruby and Groovy, or other 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.
- 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) or in a cloud computing environment or offered as a service such as a Software as a Service (SaaS).
- LAN local area network
- WAN wide area network
- SaaS Software as a Service
- implementation of various components described above may be embodied in a hardware device, it may also be implemented as a software only solution, e.g., an installation on an existing server or mobile device.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Business, Economics & Management (AREA)
- General Business, Economics & Management (AREA)
- Evolutionary Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Systems and methods for determining network shards in blockchain network are provided. In some embodiments, the system may obtain one or more network shards associated with a candidate node set in a blockchain network. Each of the one or more network shards including one or more candidate nodes. For at least one of the one or more network shards, the system may identify, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
Description
SYSTEMS AND METHODS FOR DETERMINING NETWORK SHARDS
IN BLOCKCHAIN NETWORK
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application claims priority to Chinese Patent Application No.
201910147729.4, filed on February 27, 2019, the contents of which are incorporated herein by reference in their entirety.
TECHNICAL FIELD
[0002] The present disclosure generally relates to the field of Internet technology, and in particular, to systems and methods for blockchain network technology.
BACKGROUND
[0003] With the development of Internet technology and communication technology, blockchain technology plays an important role in solving Internet issues such as information sharing, data confirmation, privacy protection, etc. Commonly, a blockchain network may include a plurality of nodes, each of which is used as a basic unit for data processing (e.g., data validation) in the blockchain network.
However, in some situations, there may be a certain latency associated with the data processing (e.g., data transmission) among the plurality of nodes, which may result in that the data processing performance is limited and it is difficult for the blockchain network to be applied in scenarios with high real-time requirements. Therefore, it is desirable to provide improved systems and methods for blockchain network technology, thereby improving data processing performance and reducing data latency.
SUMMARY
[0004] In an aspect of the present disclosure, a method for determining network shards in a blockchain network implemented on a target node in the blockchain network is provided. The method may include determining a first master node in the
blockchain network. In response to determining that the first master node is the target node, the method may include dividing candidate nodes in the blockchain network into different network shards. The method may also include determining a second master node in a target network shard where the target node is located. In response to determining that the second master node is the target node, the method may further include determining one or more validation nodes used for data validation in the target network shard based on address information and/or a network latency of each of candidate nodes in the target network shard.
[0005] In another aspect of the present disclosure, a system for determining network shards in a blockchain network implemented on a target node in the blockchain network is provided. The system may include a sharding module, a first determination module, and a second determination module. The sharding module may be configured to determine a first master node in the blockchain network. In response to determining that the first master node is the target node, the sharding module may be configured to divide candidate nodes in the blockchain network into different network shards. The first determination module may be configured to determine a second master node in a target network shard where the target node is located. In response to determining that the second master node is the target node, the second determination module may be configured to determine one or more validation nodes used for data validation in the target network shard based on address information and/or a network latency of each of candidate nodes in the target network shard.
[0006] In another aspect of the present disclosure, an electronic device is provided. The electronic device may include a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor may communicate with the storage medium through the bus, and the processor may execute the machine-readable instructions to execute operations of the method for determining
network shards in a blockchain network.
[0007] In another aspect of the present disclosure, a computer-readable storage medium storing a computer program id provided. When executed by a processor, the computer program may direct the processor to perform the method for determining network shards in a blockchain network.
[0008] In another aspect of the present disclosure, a system is provided. The system may include at least one storage device including a set of instructions and at least one processor may be configured to communicate with the at least one storage device. When executing the set of instructions, the at least one processor is may be configured to cause the system to perform the following operations. The processor may obtain one or more network shards associated with a candidate node set in a blockchain network. Each of the one or more network shards may include one or more candidate nodes. For at least one of the one or more network shards, the processor may identify, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
[0009] In another aspect of the present disclosure, a method implemented on a computing device including at least one processor, at least one storage medium, and a communication platform connected to a network is provided. The method may include obtaining one or more network shards associated with a candidate node set in a blockchain network, each of the one or more network shards including one or more candidate nodes. For at least one of the one or more network shards, the method may include identifying, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
[0010] In another aspect of the present disclosure, a system is provided. The system may include an obtaining module and an identification module. The obtaining module may be configured to obtain one or more network shards
associated with a candidate node set in a blockchain network, each of the one or more network shards including one or more candidate nodes. For at least one of the one or more network shards, the identification module may be configured to identify, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
[0011] In another aspect of the present disclosure, a non-transitory computer readable medium including executable instructions is provided. When executed by at least one processor, the executable instructions may direct the at least one processor to perform a method. The method may include obtaining one or more network shards associated with a candidate node set in a blockchain network, each of the one or more network shards including one or more candidate nodes. For at least one of the one or more network shards, the method may include identifying, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
[0012] Additional features will be set forth in part in the description which follows, and in part will become apparent to those skilled in the art upon examination of the following and the accompanying drawings or may be learned by production or operation of the examples. The features of the present disclosure may be realized and attained by practice or use of various aspects of the methodologies,
instrumentalities, and combinations set forth in the detailed examples discussed below.
BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The present disclosure is further described in terms of exemplary
embodiments. These exemplary embodiments are described in detail with reference to the drawings. These embodiments are non-limiting exemplary embodiments, in which like reference numerals represent similar structures
throughout the several views of the drawings, and wherein:
[0014] FIG. 1 is a schematic diagram illustrating an exemplary blockchain network according to some embodiments of the present disclosure;
[0015] FIG. 2 is a schematic diagram illustrating exemplary hardware and/or software components of an exemplary computing device according to some embodiments of the present disclosure;
[0016] FIG. 3 is a schematic diagram illustrating exemplary hardware and/or software components of an exemplary mobile device according to some
embodiments of the present disclosure;
[0017] FIG. 4 is a schematic diagram illustrating exemplary network shards in a blockchain network according to some embodiments of the present disclosure;
[0018] FIG. 5 is a flowchart illustrating an exemplary process for determining validation nodes in network shards in a blockchain network according to some embodiments of the present disclosure;
[0019] FIG. 6 is a flowchart illustrating an exemplary process for dividing a plurality of candidate nodes into a plurality of network shards according to some
embodiments of the present disclosure;
[0020] FIG. 7 is a flowchart illustrating an exemplary process for dividing a plurality of candidate nodes into a plurality of network shards based on a random seed according to some embodiments of the present disclosure;
[0021] FIG. 8 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure;
[0022] FIG. 9 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure;
[0023] FIG. 10 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the
present disclosure;
[0024] FIG. 11 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure;
[0025] FIG. 12 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure;
[0026] FIG. 13 is a flowchart illustrating an exemplary process for determining a network latency of a candidate node according to some embodiments of the present disclosure;
[0027] FIG. 14 is a flowchart illustrating an exemplary process for verifying a signature of a candidate node according to some embodiments of the present disclosure;
[0028] FIG. 15 is a block diagram illustrating an exemplary blockchain network sharding device according to some embodiments of the present disclosure;
[0029] FIG. 16 is a schematic diagram illustrating an exemplary electronic device according to some embodiments of the present disclosure;
[0030] FIG. 17 is a block diagram illustrating an exemplary processing device according to some embodiments of the present disclosure;
[0031] FIG. 18 is a flowchart illustrating an exemplary process for identifying one or more target nodes in a blockchain network according to some embodiments of the present disclosure;
[0032] FIG. 19 is a block diagram illustrating an exemplary identification module according to some embodiments of the present disclosure;
[0033] FIG. 20 is a flowchart illustrating an exemplary process for identifying one or more target nodes in a network shard according to some embodiments of the present disclosure;
[0034] FIG. 21 is a flowchart illustrating an exemplary process for determining one
or more target nodes in a cluster with the highest ranking according to some embodiments of the present disclosure; and
[0035] FIG. 22 is a flowchart illustrating an exemplary process for determining one or more target nodes from a cluster with the highest ranking to an ith cluster according to some embodiments of the present disclosure.
DETAILED DESCRIPTION
[0036] The following description is presented to enable any person skilled in the art to make and use the present disclosure and is provided in the context of a particular application and its requirements. Various modifications to the disclosed
embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the present disclosure. Thus, the present disclosure is not limited to the embodiments shown but is to be accorded the widest scope consistent with the claims.
[0037] The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting. As used herein, the singular forms“a,”“an,” and“the” may be intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms“comprise,”“comprises,” and/or“comprising,”“include,”“includes,” and/or “including,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
[0038] These and other features, and characteristics of the present disclosure, as well as the methods of operation, various components of the stated system, functions of the related elements of structure, and the combination of parts and economies of manufacture, may become more apparent upon consideration of the following description with reference to the accompanying drawings, all of which form
part of this disclosure. It is to be expressly understood, however, that the drawings are for the purpose of illustration and description only and are not intended to limit the scope of the present disclosure. It is understood that the drawings are not to scale.
[0039] The flowcharts used in the present disclosure illustrate operations that systems implemented according to some embodiments of the present disclosure. It is to be expressly understood, that the operations of the flowchart may be
implemented not in order. Conversely, the operations may be implemented in an inverted order, or simultaneously. Moreover, one or more other operations may be added to the flowcharts. One or more operations may be removed from the flowcharts.
[0040] An aspect of the present disclosure relates to systems and methods for identifying one or more target nodes in a blockchain network. When a transaction needs to be processed by the blockchain network, the system may obtain one or more network shards associated with a candidate node set in the blockchain network. Each of the one or more network shards may include one or more candidate nodes. For at least one of the one or more network shards, the system may identify, from the one or more candidate nodes in the network shard, one or more target nodes (which may be used for data processing (e.g., data validation, data storage) associated with the transaction) based on at least one of a location or a network latency of each of the one or more candidate nodes. According to the systems and methods of the present disclosure, the target nodes are identified from a network shard in the blockchain network based on the locations and/or the network latencies of the candidate nodes, which improves the handling capacity of the blockchain network and reduces the latency of the blockchain network, thereby improving the efficiency of the blockchain network for application in scenarios with high real-time requirements.
[0041] FIG. 1 is a schematic diagram illustrating an exemplary blockchain network
according to some embodiments of the present disclosure. The blockchain network (also can be referred to as a“blockchain network system,” a“blockchain system,” or a blockchain) 100 may be constructed using blockchain technology. Currently, with the continuous development of the blockchain technology, the blockchain technology is becoming another major technological innovation after cloud computing, big data, and artificial intelligence, and plays an important role in continuously solving and innovating core Internet issues such as information sharing, data confirmation, privacy protection, etc. Further, in the future, the blockchain technology will also play an important role in building an effective business system, credit system, social infrastructure, etc. The blockchain technology can be understood as a data structure that transactions occurred in a time period in a system are packaged and stored using a block as a unit and blocks are jointed into a chain in order using a cryptographic technique.
[0042] As shown in FIG. 1 , the blockchain network 100 may include a plurality of nodes (e.g., 102, 104, 106, 108, 110), each of which may be used as a basic unit for data processing. In some embodiments, a node may package processed data as a block and a plurality of blocks (e.g., 122, 124, 126) may be connected in
chronological order to form a chain 120. In some embodiments, the blockchain network 100 may be a public blockchain network (e.g., Bitcoin, Ethereum), a private blockchain network, a consortium blockchain network, etc. The public blockchain network may allow any node to join the blockchain network. The private blockchain network may be controlled by a single administrator and only send invitations to selected nodes as participants with limited accesses. The consortium blockchain network, instead of being controlled by a single administrator, may be operated by a group of organizations (e.g., financial institutions).
[0043] In some embodiments, the plurality of nodes may include a server, a terminal device, or any suitable device with data processing function. In some
embodiments, the server may be a single server or a server group. The server
group may be centralized or distributed (e.g., the server may be a distributed system). In some embodiments, the server may execute instructions to perform operations or methods disclosed in the present disclosure. For example, the server may obtain one or more network shards associated with a candidate node set in the blockchain network. The server may identify one or more target nodes used for data processing (e.g., data validation) in at least one of the one or more network shards in the blockchain network based on address information and a network latency of each of candidate nodes in the at least one of the one or more network shards. As another example, the server may divide candidate nodes in the blockchain network into different network shards. In some embodiments, the server may be implemented on a cloud platform. Merely by way of example, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an inter-cloud, a multi-cloud, or the like, or any
combination thereof. In some embodiments, the server may be implemented on a computing device 200 illustrated in FIG. 2 or a mobile device 300 illustrated in FIG.
3.
[0044] FIG. 2 is a schematic diagram illustrating exemplary hardware and/or software components of an exemplary computing device according to some embodiments of the present disclosure.
[0045] In some embodiments, a node of the blockchain network 100 may be implemented on the computing device 200 and configured to perform functions of the node disclosed in this disclosure. For example, the node of the blockchain network 100 may be implemented on the computing device 200, via its hardware, software program, firmware, or a combination thereof. Although only one such computer is shown, for convenience, the computer functions relating to blockchain services as described herein may be implemented in a distributed fashion on a number of similar platforms to distribute the processing load.
[0046] The computing device 200 may include COM ports 250 connected to and
from a network connected thereto to facilitate data communications. The computing device 200 may also include a processor 220, in the form of one or more processors (e.g., logic circuits), for executing program instructions. For example, the processor 220 may include interface circuits and processing circuits therein. The interface circuits may be configured to receive electronic signals from a bus 210, wherein the electronic signals encode structured data and/or instructions for the processing circuits to process. The processing circuits may conduct logic calculations, and then determine a conclusion, a result, and/or an instruction encoded as electronic signals. Then the interface circuits may send out the electronic signals from the processing circuits via the bus 210.
[0047] The computing device 200 may further include program storage and data storage of different forms including, for example, a disk 270, a read-only memory (ROM) 230, or a random access memory (RAM) 240, for storing various data files to be processed and/or transmitted by the computing device 200. The computing device 200 may also include program instructions stored in the ROM 230, RAM 240, and/or other type of non-transitory storage medium to be executed by the processor 220. The methods and/or processes of the present disclosure may be implemented as the program instructions. The computing device 200 may also include an I/O component 260, supporting input/output between the computer and other
components. The computing device 200 may also receive programming and data via network communications.
[0048] Merely for illustration, only one processor is described in FIG. 2. Multiple processors are also contemplated, thus operations and/or steps performed by one processor as described in the present disclosure may also be jointly or separately performed by the multiple processors. For example, if in the present disclosure the processor of the computing device 200 executes both step A and step B, it should be understood that step A and step B may also be performed by two different CPUs and/or processors jointly or separately in the computing device 200 (e.g., the first
processor executes step A and the second processor executes step B, or the first and second processors jointly execute steps A and B).
[0049] FIG. 3 is a schematic diagram illustrating exemplary hardware and/or software components of an exemplary mobile device according to some
embodiments of the present disclosure. In some embodiments, a node of the blockchain network 100 may be implemented on the mobile device 300.
[0050] As illustrated in FIG. 3, the mobile device 300 may include a communication platform 310, a display 320, a graphic processing unit (GPU) 330, a central processing unit (CPU) 340, an I/O 350, a memory 360, a mobile operating system (OS) 370, and a storage 390. In some embodiments, any other suitable
component, including but not limited to a system bus or a controller (not shown), may also be included in the mobile device 300.
[0051] In some embodiments, the mobile operating system 370 (e.g., iOS™, Android™, Windows Phone™) and one or more applications 380 may be loaded into the memory 360 from the storage 390 in order to be executed by the CPU 340. The applications 380 may include a browser or any other suitable mobile apps for receiving and rendering information relating to blockchain services or other information from the blockchain network 100. User interactions with the information stream may be achieved via the I/O 350 and provided to the processor 220 and/or other components of the blockchain network 100 via the network 120.
[0052] In some situations, when the blockchain technology is applied in a network transaction scenario, the plurality of nodes in the blockchain network may be used to transaction validation. Flowever, at present, when the blockchain technology is used to process transactions in the transaction scenario, the peak number of transactions per second (TPS) implemented by a Bitcoin system is generally only about 7 and the peak number of TPS implemented by Ethereum is generally about 15, both of which are far from the peak number (e.g., 250,000) of TPS in the Internet payment transaction scenario. In view of the above issue, in order to make the
blockchain technology can be applied in more scenarios (e.g., securities trading, e- commerce), it is necessary to improve the processing performance of the blockchain technology.
[0053] Commonly, there may be two technical problems associated with the processing performance of the existing blockchain technology: one aspect is that the scalability of the blockchain network system is relatively low, which may result in that the TPS of the blockchain network system is relatively low, that is, the handling capacity (which refers to a number of tasks processed in a unit time) is relatively low; and another aspect is that a system latency (which refers to a network latency among the plurality of nodes during data transmission) generally occurs in data processing. The two aspects result in that the data processing performance of the existing blockchain technology is limited and further result in that the existing blockchain technology is difficult to be applied in application scenarios with high real time requirements.
[0054] In order to solve the above problems, a sharding technology may be applied to the blockchain network to improve the processing performance of the blockchain network. As shown in FIG. 4, the blockchain network may be divided into a plurality of sub-blockchain networks, that is, the plurality of nodes in the blockchain network may be divided into a plurality of“shards.” Each of the plurality of sub-blockchain networks may include a plurality of blocks (or nodes), and each of the plurality of shards may separately maintain a sub-blockchain network, that is, separately maintain a distributed ledger. For example, in the network transaction scenario, a transaction may be distributed into a shard for processing such that different nodes in the shard may process the transaction in parallel. In this situation, each of the different nodes only needs to process a small portion of the transaction and it is no longer necessary for each node to validate each transaction, which can increase the degree of concurrency of transaction processing and validation, thereby improving the handling capacity of the entire blockchain network.
[0055] It should be noted that the existing sharding technology only considers improving the system handling capacity without paying attention to the problem of system latency. In this way, there may be great limitations in practical application scenarios. Take the sharing economy field as an example, the mobile Internet service needs to be supported by a system with high handing capacity and low latency. Although the use of sharding technology solves the problem of handling capacity, for scenarios with high real-time requirements, the low latency of the service is more important.
[0056] For example, a specific shard may include nodes located in country A and nodes located in country B. Since each of the nodes in the shard should be consistent when performing a transaction validation, there may be a relatively large network latency between two nodes with geographic locations far apart, for example, a network latency from Beijing, China to Virginia, the USA may be about 10 times a local network latency in Beijing locally. The problem of network latency may inevitably bring a large obstacle to the application of the blockchain technology in scenarios with high real-time requirements.
[0057] In order to solve the problem, the present disclosure provides systems and methods for determining network shards in a blockchain network. Candidate nodes in the blockchain network may be allocated to different network shards. By performing the network sharding, the handling capacity of the blockchain network may be increased. For each of the network shards, one or more validation nodes used for data validation in the network shard may be selected based on address information and network latencies of nodes in the network shard, which may further reduce the latency in data validation of each of the nodes in the blockchain network and improve the real-time performance of data validation in the blockchain network, thereby improving the processing performance of the blockchain network.
[0058] FIG. 5 is a flowchart illustrating an exemplary process for determining validation nodes in network shards in a blockchain network according to some
embodiments of the present disclosure. In some embodiments, the process 500 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or a storage device 1620 illustrated in FIG. 16. The processor 220, the CPU 340, a processor 1610 illustrated in FIG. 16, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 500. The operations of the illustrated process presented below are intended to be illustrative. In some embodiments, the process 500 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 5 and described below is not intended to be limiting.
[0059] In 501 , a first master node (also referred to as a“first node”) in the blockchain network 100 may be determined. The first master node may be determined by a blockchain network sharding device 1500 (e.g., a sharding module 1510) illustrated in FIG. 15.
[0060] In some embodiments, the first master node may be determined by a target node from a plurality of candidate nodes in the blockchain network 100. As used herein, the target node may be any node in the blockchain network 100; the plurality of candidate nodes may be randomly selected from all nodes in the blockchain network 100. Further, the plurality of candidate nodes may be divided into a plurality of different network shards by the first master node. Specifically, in response to that the first master node is the target node, the plurality of candidate nodes may be divided into a plurality of different network shards by the target node. In some embodiments, each of the plurality of network shards may include validation nodes used for data validation (e.g., transaction validation or other data validation) in the network shard.
[0061] In some embodiments, the first master node may be determined by the
target node based on a first random value (also referred to as a“first condition value”) corresponding to the target node and first random values corresponding to other candidate nodes. If the first random value corresponding to the target node and the first random values corresponding to other candidate nodes satisfy a preset size relationship, the first master node may be determined to be the target node.
[0062] Specifically, the target node may generate the first random value
corresponding to the target node by locally executing a preset random function (e.g., a verifiable random function (VRF)) and receive the first random values
corresponding to other candidate nodes generated in the same manner. The target node may determine whether the first random value corresponding to the target node and the first random values corresponding to other candidate nodes satisfy the preset size relationship. If the first random value corresponding to the target node and the first random values corresponding to other candidate nodes satisfy the preset size relationship, the first master node may be determined to be the target node.
[0063] In some embodiments, the preset size relationship may include at least one of the first random values corresponding to other candidate nodes being greater than the first random value corresponding to the target node, or the first random values corresponding to other candidate nodes being less than the first random value corresponding to the target node.
[0064] In some embodiments, after the first master node is determined (e.g., determined to be the target node), the first master node (e.g., the target node) may divide the plurality of candidate nodes into the plurality of different network shards. More descriptions regarding dividing the plurality of candidate nodes into the plurality of network shards can be found elsewhere in the present disclosure (e.g., FIG. 6 and the description thereof).
[0065] In 502, for at least one of the plurality of different network shards, a second master node (also referred to as a“second node”) in the network shard may be
determined by any node in the network shard. Specifically, a second master node in a network shard (referred to as a target network shard) where the target node is located may be determined. As described above, since the target node may be any node, accordingly, the target network shard where the target node is located may also be any network shard. In some embodiments, the second master node may be determined by the blockchain network sharding device 1500 (e.g., a first determination module 1520) illustrated in FIG. 15.
[0066] In some embodiments, the second master node in the target network shard may be determined according to a manner similar to the manner in which the first master node in the blockchain network is determined from the plurality of candidate nodes.
[0067] In 503, for the at least one of the plurality network shards, one or more validation nodes used for data validation in the network shard may be determined by the second master node based on address information and/or a network latency of each of candidate nodes in the network shard. Specifically, in response to that the second master node is the target node, one or more validation nodes used for data validation in the target network shard may be determined by the target node based on address information and/or a network latency of each of candidate nodes in the target network shard. In some embodiments, the one or more validation nodes may be determined by the blockchain network sharding device 1500 (e.g., a second determination module 1520) illustrated in FIG. 15. More descriptions regarding determining the one or more validation nodes may be found elsewhere in the present disclosure (e.g., FIG.8 and the description thereof).
[0068] FIG. 6 is a flowchart illustrating an exemplary process for dividing a plurality of candidate nodes into a plurality of network shards according to some
embodiments of the present disclosure. In some embodiments, the process 600 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620. The processor
220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 600. The operations of the illustrated process presented below are intended to be illustrative. In some embodiments, the process 600 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 6 and described below is not intended to be limiting.
[0069] In 601 , a random seed may be generated based on a second random value corresponding to the first master node (e.g., the target node) and second random values corresponding to other candidate nodes. The random seed may be generated by the blockchain network sharding device 1500 (e.g., the sharding module 1510) illustrated in FIG. 15.
[0070] In some embodiments, the target node may generate the second random value corresponding to the target node by locally executing a preset random function and receive the second random values corresponding to other candidate nodes generated in the same manner. The target node may generate the random seed by concatenating the second random value corresponding to the target node and the second random values corresponding to the candidate nodes.
[0071] For example, it is assumed that the second random value corresponding to the target node is“123,” the second random values corresponding to other candidate nodes are“234,”“345,” and“456” respectively, the random seed may be
“123234345456.” It should be noted that the exemplary second random value is provided for illustration purposes and not intended to be limiting, the second random value may be a random value including any number of elements in any form.
Alternatively, the form of the random seed may also be determined by other concatenating techniques.
[0072] In the present disclosure, the random seed is associated with each of the candidate nodes and is not just generated based on the target node, which can ensure the randomness of the random seed and prevent the subsequent process for determining the network shards from being affected if the target node is attacked.
[0073] In 602, the plurality of candidate nodes may be divided into a plurality of different network shards based on the random seed. The plurality of candidate nodes may be divided into the plurality of different network shards by the blockchain network sharding device 1500 (e.g., the sharding module 1510) illustrated in FIG. 15. More descriptions regarding dividing the plurality of candidate nodes into the plurality of network shards may be found elsewhere in the present disclosure (e.g., FIG. 7 and the description thereof).
[0074] FIG. 7 is a flowchart illustrating an exemplary process for dividing a plurality of candidate nodes into a plurality of network shards based on a random seed according to some embodiments of the present disclosure. In some embodiments, the process 700 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620. The processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 700. The operations of the illustrated process presented below are intended to be illustrative. In some embodiments, the process 700 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 7 and described below is not intended to be limiting.
[0075] In 701 , for a candidate node with the highest ranking, a third random value corresponding to the candidate node with the highest ranking may be determined based on the random seed and a preset random function. In some embodiments,
the third random value may be determined by the blockchain network sharding device 1500 (e.g., the sharding module 1510) illustrated in FIG. 15. In some embodiments, the first master node (e.g., the target node) may randomly rank the plurality of candidate nodes (including the first master node (e.g., target node) itself) and determine plurality of serial numbers (or referred to as“ranking numbers”) corresponding to the plurality of candidate nodes.
[0076] In 702, for each of remainder candidate nodes other than the candidate node with the highest ranking, a third random value corresponding to the candidate node may be determined based on a third random value corresponding to a previous candidate node. In some embodiments, the third random value may be determined by the blockchain network sharding device 1500 (e.g., the sharding module 1510) illustrated in FIG. 15. In some embodiments, each of the third random values corresponding to the plurality of candidate nodes may match a respective one of a plurality of serial numbers corresponding to the plurality of network shards, wherein the plurality of serial numbers corresponding to the plurality of network shards may be determined by randomly ranking the plurality of network shards by the target node.
[0077] In 703, for each of the plurality of candidate nodes, the candidate node may be allocated to a network shard that matches a third random value corresponding to the candidate node based on the third random value corresponding to the candidate node. In some embodiments, the candidate node may be allocated to the network shard by the blockchain network sharding device 1500 (e.g., the sharding module 1510) illustrated in FIG. 15.
[0078] According to the embodiments of the present disclosure, when the plurality of candidate nodes are divided into the plurality of network shards based on the random seed, firstly, a first third random value may be generated based on the random seed and the candidate node with the highest ranking may be allocated to a network shard that matches the first third random value. Secondly, for each of
remainder candidate nodes other than the candidate node with the highest ranking, a third random value corresponding to the candidate node may be generated based on a third random value corresponding to a previous candidate node of the candidate node. Finally, the candidate node may be allocated to a network shard that matches the third random value corresponding to the candidate node. Since when the preset random function is executed, different outputs may be produced based on different inputs, third random values corresponding to the plurality of candidate nodes may be randomly generated, which can ensure that the plurality of candidate nodes are randomly divided into different network shards, thereby ensuring the security of the entire blockchain network.
[0079] FIG. 8 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure. In some embodiments, the process 800 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620. The processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 800. The operations of the illustrated process presented below are intended to be illustrative.
In some embodiments, the process 800 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 8 and described below is not intended to be limiting.
[0080] In 801 , candidate nodes in a network shard (e.g., the target network shard) may be divided into at least one cluster based on address information of each of the candidate nodes. In some embodiments, the candidate nodes may be divided into at least one cluster by the blockchain network sharding device 1500 (e.g., the second determination module 1530) illustrated in FIG. 15.
[0081] In some embodiments, the address information may include a geographic location. For example, for each of the candidate nodes, the geographic location may include a continent, a country, a province, a city, and latitude/longitude information of a location where the candidate node is located.
[0082] In some embodiments, the target node may divide one or more candidate nodes within the same geographic area into the same cluster based on the geographic location of each of the candidate nodes in the target network shard. For example, one or more candidate nodes within the same continent may be divided into the same cluster, or one or more candidate nodes within the same country may be divided into the same cluster. As another example, the clustering operation may be performed based on actual situations (e.g., a distribution of the geographic locations) associated with the geographic locations where the candidate nodes are located. If all the candidate nodes are located in Asia, the clustering operation may be performed according to“country.” If some candidate nodes are located in Asia and some other candidate nodes are located in America, the clustering operation may be performed according to“continent.”
[0083] In 802, one or more validation nodes (e.g., a preset count of validation nodes) used for data validation in the network shard (e.g., the target network shard) may be determined based on the at least one cluster. In some embodiments, the one or more validation nodes may be determined by the blockchain network sharding device 1500 (e.g., the second determination module 1530) illustrated in FIG. 15.
[0084] According to the present disclosure, the one or more validation nodes used for data validation in a network shard (e.g., the target network shard) may be determined according to the following embodiments.
Embodiment 1:
[0085] FIG. 9 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the
present disclosure. In some embodiments, the process 900 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620. The processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 900. The operations of the illustrated process presented below are intended to be illustrative.
In some embodiments, the process 900 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 9 and described below is not intended to be limiting.
[0086] In 901 , at least one cluster may be ranked in a descending order based on a count of candidate nodes in each of the at least one cluster.
[0087] For example, it is assumed that there are 3 clusters including cluster 1 , cluster 2, and cluster 3, cluster 1 includes 100 candidate nodes, cluster 2 includes 80 candidate nodes, and cluster 3 includes 50 candidate nodes. According to the ranking in a descending order based on the count of candidate nodes in each of the three clusters, the ranking order of the three clusters is“cluster 1 , cluster 2, and cluster 3.”
[0088] In 902, if a count of candidate nodes in a cluster with the highest ranking is equal to the preset count, the candidate nodes in the cluster with the highest ranking may be designed as the one or more validation nodes.
[0089] For example, it is assumed that the preset count (denoted as g) is equal to 100 (i.e. , g = 100) and the count of candidate nodes in the cluster (e.g., cluster 1 ) with the highest ranking is equal to 100, the candidate nodes in the cluster with the highest ranking may be designated as the one or more validation nodes.
[0090] In 903, if the count of candidate nodes in the cluster with the highest ranking is greater than the preset count, the one or more validation nodes may be selected
from the cluster with the highest ranking until a count of selected validation nodes is equal to the preset count.
[0091] For example, it is assumed that the preset count is equal to 80 (i.e. , g = 80) and the count of candidate nodes in the cluster (e.g., cluster 1 ) with the highest ranking is 100 which is greater than 80, 80 validation nodes may be selected from the cluster with the highest ranking.
[0092] In some embodiments, the address information may also include an Internet Protocol (IP) address. Accordingly, the one or more validation nodes may be selected from the cluster with the highest ranking based on the IP address of each of the candidate nodes. More descriptions may be found elsewhere in the present disclosure (e.g., FIG. 10 and the description thereof) (e.g., embodiment 2).
[0093] In 904, if the count of candidate nodes in the cluster with the highest ranking is less than the preset count, the one or more validation nodes may be selected from the at least one cluster in turn based on the ranking order of the at least one cluster until a count of selected validation nodes is equal to the preset count.
[0094] For example, it is assumed that the preset count is equal to 150 (i.e., g =
150) and the count of candidate nodes in the cluster (e.g., cluster 1 ) with the highest ranking is 100 which is less than 150, the one or more validation nodes may be selected from the at least one cluster in turn based on the ranking order of the at least one cluster until the count of selected validation nodes is equal to the preset count.
[0095] In some embodiments, the one or more validation nodes may be selected from the at least one cluster in turn based on a network latency of each of candidate nodes in the at least one cluster. More descriptions may be found elsewhere in the present disclosure (e.g., FIG. 12 and the description thereof) (e.g., embodiment 4).
Embodiment 2:
[0096] FIG. 10 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the
present disclosure. In some embodiments, the process 1000 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620. The processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 1000. The operations of the illustrated process presented below are intended to be illustrative.
In some embodiments, the process 1000 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 10 and described below is not intended to be limiting.
[0097] As described in connection with operation 903, if the count of candidate nodes in the cluster with the highest ranking is greater than the preset count, the one or more validation nodes may be selected from the cluster with the highest ranking based on an IP address of each of the candidate nodes.
[0098] In 1001 , one or more candidate nodes within a same network segment may be divided into a same sub-cluster based on the IP address of each of the candidate nodes in the cluster with the highest ranking.
[0099] For example, the cluster with the highest ranking may be divided into three sub-clusters based on the IP address of each of the candidate nodes in the cluster with the highest ranking. For each of the three sub-clusters, IP addresses of candidate nodes in the sub-clusters may be in a same network segment.
[0100] It should be noted that when at least one sub-cluster is divided based on the IP address of each of the candidate nodes, one or more candidate nodes within adjacent network segments may also be divided into a same sub-cluster according to actual situations.
[0101] In 1002, at least one sub-cluster may be ranked in a descending order based on a count of candidate nodes in each of the at least one sub-cluster.
[0102] For example, it is assumed that the cluster (e.g., cluster 1 ) with the highest ranking includes 100 candidate nodes, a sub-cluster 1 includes 50 candidate nodes, a sub-cluster 2 includes 30 candidate nodes, and a sub-cluster 3 includes 20 candidate nodes. According to the ranking in a descending order based on the count of candidate nodes in each of the three sub-clusters, the ranking order of the three sub-clusters is“sub-cluster 1 , sub-cluster 2, and sub-cluster 3.”
[0103] In 1003, if a count of candidate nodes in a sub-cluster with the highest ranking is equal to the preset count, the candidate nodes in the sub-cluster with the highest ranking may be designated as the one or more validation nodes.
[0104] For example, it is assumed that the preset count is equal to 50 (i.e. , g = 50) and the count of candidate nodes in the sub-cluster (e.g., sub-cluster 1 ) with the highest ranking is equal to 50, the candidate nodes in the sub-cluster with the highest ranking may be designated as the one or more validation nodes.
[0105] In 1004, if the count of candidate nodes in the sub-cluster with the highest ranking is greater than the preset count, the one or more validation nodes may be selected from the sub-cluster with the highest ranking in turn until that a count of selected validation nodes is equal to the preset count.
[0106] For example, it is assumed that the preset count is equal to 40 (i.e., g = 40) and the count of candidate nodes in the sub-cluster (e.g., sub-cluster 1 ) with the highest ranking is 50 which is greater than 40, 40 validation nodes may be selected from the sub-cluster with the highest ranking in turn.
[0107] In some embodiments, the one or more validation nodes may be selected from the sub-cluster with the highest ranking based on a network latency of each of the candidate nodes. More descriptions may be found elsewhere in the present disclosure (e.g., FIG. 11 and the description thereof) (e.g., embodiment 3).
[0108] In 1005, if the count of candidate nodes in the sub-cluster with the highest ranking is less than the preset count, the one or more validation nodes may be selected from the at least one sub-cluster in turn according to a ranking order of the
at least one sub-cluster until a count of selected validation nodes is equal to the preset count.
[0109] For example, it is assumed that the preset count is equal to 90 (i.e. , g = 90) and the count of candidate nodes in the sub-cluster (e.g., sub-cluster 1 ) with the highest ranking is 50 which is less than 90, the one or more validation nodes may be selected from the at least one sub-cluster in turn according to the ranking order of the at least one sub-cluster. For example, after the 50 candidate nodes in the sub cluster (e.g., sub-cluster 1 ) with the highest ranking are designated as validation nodes, one or more validation nodes may be selected from a jth sub-cluster, wherein j is an integer greater than 1. For example, it is assumed that a sub-cluster with a second ranking includes 30 candidate nodes and 50 plus 30 is still less than 90 (i.e., the preset count), one or more validation nodes need to be selected from a sub cluster with a third ranking. For example, it is assumed that the sub-cluster with the third ranking includes 20 candidate nodes, 10 validation nodes may be selected from the sub-cluster with the third ranking. In this situation, the sub-cluster with the third ranking may be designated as a first target sub-cluster and 10 validation nodes may be selected from the sub-cluster with the third ranking based on a network latency of each of the candidate nodes in the sub-cluster with the third ranking in a manner similar to process 1100 (e.g., embodiment 3) described in FIG. 11.
Embodiment 3:
[0110] FIG. 11 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure. In some embodiments, the process 1100 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620. The processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 1100. The
operations of the illustrated process presented below are intended to be illustrative.
In some embodiments, the process 1100 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 11 and described below is not intended to be limiting.
[0111] As described in connection with operation 1004, if the count of candidate nodes in the sub-cluster with the highest ranking is greater than the preset count, the sub-cluster with the highest ranking may be designated as a first target sub-cluster.
[0112] In 1101 , candidate nodes in the first target sub-cluster may be ranked in an ascending order based on a network latency of each of the candidate nodes in the first target sub-cluster.
[0113] In 1102, the one or more validation nodes may be selected from the first target sub-cluster in turn based on the ranking until a count of selected validation nodes is equal to the preset count.
[0114] For example, it is assumed that the preset count is equal to 40 (i.e. , g = 40) and the count of candidate nodes in the sub-cluster (e.g., sub-cluster 1 ) with the highest ranking is 50 which is greater than 40, the 50 candidate nodes in the sub cluster with the highest ranking may be ranked in an ascending order based on the network latency of each of the 50 candidate nodes and top 40 nodes may be selected from the sub-cluster with the highest ranking based on the ranking and designated as the validation nodes.
Embodiment 4:
[0115] FIG. 12 is a flowchart illustrating an exemplary process for determining one or more validation nodes in a network shard according to some embodiments of the present disclosure. In some embodiments, the process 1200 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620. The processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions,
and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 1200. The operations of the illustrated process presented below are intended to be illustrative.
In some embodiments, the process 1200 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 12 and described below is not intended to be limiting.
[0116] As described in connection with operation 904, if the count of candidate nodes in the cluster with the highest ranking is less than the preset count, the one or more validation nodes may be selected from the at least one cluster in turn based on the ranking order of the at least one cluster until a count of selected validation nodes is equal to the preset count. For example, the one or more validation nodes may be selected from the at least one cluster based on a network latency of each of candidate nodes in the at least one cluster. Specifically, it is assumed that one or more validation node need to be selected from an ith cluster of the at least one cluster and a count of candidate nodes in the ith cluster is greater than a count of the one or more validation nodes to be selected from the ith cluster.
[0117] In 1201 , candidate nodes within a same network segment may be divided into a same sub-cluster based on an IP address of each of the candidate nodes in the ith cluster.
[0118] In 1202, at least one sub-cluster may be ranked in a descending order based on a count of candidate nodes in each of the at least one sub-cluster.
[0119] In 1203, if a count of candidate nodes in a sub-cluster with the highest ranking is equal to the count of the one or more validation nodes to be selected from the ith cluster, the candidate nodes in the sub-cluster with the highest ranking may be designated as the one or more validation nodes to be selected from the ith cluster.
[0120] In 1204, if the count of candidate nodes in the sub-cluster with the highest
ranking is greater than the count of the one or more validation nodes to be selected from the ith cluster, one or more validation nodes may be selected from the sub cluster with the highest ranking in turn until a count of selected validation nodes is equal to the count of the one or more validation nodes to be selected from the ith cluster.
[0121] For example, it is assumed that the count of the one or more validation nodes to be selected from the ith cluster is 50 and the count of candidate nodes in the sub-cluster (e.g., a sub-cluster 1 ) with the highest ranking in the ith cluster is 60 which is greater than 50, 50 validation nodes may be selected from the sub-cluster with the highest ranking in turn.
[0122] In some embodiments, if the count of candidate nodes in the sub-cluster with the highest ranking in the ith cluster is greater than the count of the one or more validation nodes to be selected from the ith cluster, the sub-cluster with the highest ranking may be designated as a second target sub-cluster and one or more (e.g., 50) validation nodes may be selected from the sub-cluster with the highest ranking according to a manner similar to process 1100 (e.g., embodiment 3) described in FIG. 11.
[0123] In 1205, if the count of candidate nodes in the sub-cluster with the highest ranking is less than the count of the one or more validation nodes to be selected from the ith cluster, one or more validation nodes may be selected from the ith cluster in turn according to a ranking order of the at least one sub-cluster until a count of selected validation nodes is equal to the count of the one or more validation nodes to be selected from the ith cluster.
[0124] For example, it is assumed that the count of the one or more validation nodes to be selected from the ith cluster is 50 and the count of candidate nodes in the sub-cluster (e.g., sub-cluster 1 ) with the highest ranking in the ith cluster is 40 which is less than 50, the one or more validation nodes to be selected from the ith cluster may be selected from the at least one sub-cluster in the ith cluster in turn
according to the ranking order of the at least one sub-cluster. For example, after the 40 candidate nodes in the sub-cluster (e.g., sub-cluster 1 ) with the highest ranking are designated as validation nodes, one or more validation nodes may be selected from a kth sub-cluster, wherein k is an integer greater than 1. For example, after the 40 candidate nodes in the sub-cluster (e.g., sub-cluster 1 ) with the highest ranking are designated as the validation nodes, it is assumed that a sub cluster with a second ranking includes 40 candidate nodes and 40 plus 40 is larger than 50, 10 validation nodes need to be selected from the sub-cluster with the second ranking. In this situation, the sub-cluster with the second ranking may be designated as the second target sub-cluster and 10 validation nodes may be selected from the sub-cluster with the second ranking based on a network latency of each of the candidate nodes in the sub-cluster with the second ranking in a manner similar to process 1100 (e.g., embodiment 3) described in FIG. 11.
Embodiment 5:
[0125] As described in connection with operation 904, if the count of candidate nodes in the cluster with the highest ranking is less than the preset count and a difference between them is relatively small (e.g., less than a predetermined threshold), for example, the preset count is equal to 150 (i.e. , g = 150), the count of candidate nodes in the cluster (e.g., cluster 1 ) with the highest ranking is 140, and 10 remainder validation nodes need to be selected, in this situation, if a count (e.g.,
100) of candidate nodes in a cluster (e.g., cluster 2) with a second ranking is much greater than 10, there may be no need to divide the candidate nodes in the cluster (e.g., cluster 2) with the second ranking into sub-clusters based on IP address information. Specifically, 10 candidate nodes of which IP addresses are within a same network segment or adjacent network segments as the candidate nodes in the cluster (e.g., cluster 1 ) with the highest ranking may be directly selected from the cluster (e.g., cluster 2) with the second ranking.
[0126] In some embodiments, the target node may determine the one or more
validation nodes used for data validation in the target network shard based on a network latency of each of the candidate nodes in the target network shard. For example, the candidate nodes may be ranked in an ascending order based on the network latency of each of the candidate nodes and the one or more validation nodes used for data validation may be selected in turn based on the ranking.
[0127] FIG. 13 is a flowchart illustrating an exemplary process for determining a network latency of a candidate node according to some embodiments of the present disclosure. In some embodiments, the process 1300 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620. The processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 1300. The operations of the illustrated process presented below are intended to be illustrative.
In some embodiments, the process 1300 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 13 and described below is not intended to be limiting.
[0128] In 1301 , for each of candidate nodes in a network shard (e.g., the target network shard), an echo request may be sent to the candidate node by the second master node (e.g., the target node) and an echo reply may be received from the candidate node.
[0129] For example, the echo request may include a Packet Internet Groper (PING), which is a command under Windows, Unix, or Linux systems, and also is a
communication protocol, which is a part of a Transmission Control Protocol (TCP)/IP protocol. After the PING is sent to each of the candidate nodes in the target network shard, each of the candidate nodes may automatically send an echo reply to the target node.
[0130] In 1302, for each of the candidate nodes, the network latency of the candidate node may be determined based on a time difference between a time point at which the echo request is sent to the candidate node and a time point at which the echo node reply is received from the candidate node.
[0131] FIG. 14 is a flowchart illustrating an exemplary process for verifying a signature of a candidate node according to some embodiments of the present disclosure. In some embodiments, the process 1400 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, the storage 390, or the storage device 1620. The processor 220, the CPU 340, the processor 1610, and/or the modules in FIG. 15 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, the processor 1610, and/or the modules may be configured to perform the process 1400. The operations of the illustrated process presented below are intended to be illustrative.
In some embodiments, the process 1400 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 14 and described below is not intended to be limiting.
[0132] In some embodiments, for each of the candidate nodes, before the address information of the candidate node is obtained by the target node, a security validation needs to be performed on the candidate node, so as to prevent an IP address of the candidate node attempting to establish a connection with the target node from being impersonated. Therefore, before the method for determining the plurality of network shards in the blockchain network is implemented, each of the candidate nodes needs to register its public key and signature to an identity chain of the blockchain network and broadcasts them to each of remainder candidate nodes. In some embodiments, the signature may be associated with encryption information of an IP address that is encrypted based on a private key of the candidate node.
[0133] For each of the candidate nodes, when the target node verifies the candidate
node, the target node may receive the public key and the signature of the candidate node sent by the candidate node, or obtain the public key and the signature of the candidate node from the identity chain. Then the target node may verify the signature of the candidate node based on the public key of the candidate node. If the signature is verified, the target node may obtain the IP address of the candidate node from the signature. Further, the target node may also obtain a geographic location, a time zone, an operator, and/or Classless Inter-Domain Routing (CIDR) information of the candidate node based on the IP address.
[0134] Specifically, in 1401 , the signature of the candidate node may be decrypted based on the public key of the candidate node.
[0135] In 1402, if the signature of the candidate node is decrypted, the IP address in the signature of the candidate node may be resolved. Further, whether an IP address of the candidate node when a connection with the candidate node is established is the same as the IP address in the signature may be determined.
[0136] In 1403, in response to a determination that the IP address of the candidate node when the connection with the candidate node is established is the same as the IP address in the signature, the signature of the candidate node may be determined to be verified.
[0137] According to the present disclosure, firstly, a plurality of candidate nodes in the blockchain network may be divided into a plurality of different network shards, which can improve the handling capacity of the blockchain network. Secondly, for each of the plurality of network shards, one or more validation nodes used for data validation in the network shard may be selected based on address information and/or a network latency of each of candidate nodes in the network shard, which may further reduce a latency in data validation performed by the one or more validation nodes and improve a real-time performance of the data validation.
[0138] Further, the plurality of candidate nodes in the blockchain network may be divided into the plurality of different network shards randomly, which can ensure
security.
[0139] FIG. 15 is a schematic diagram illustrating an exemplary blockchain network sharding device according to some embodiments of the present disclosure. As illustrated, the blockchain network sharding device 1500 may include a sharding module 1510, a first determination module 1520, a second determination module 1530, and/or an obtaining module 1540. In some embodiments, the blockchain network sharding device 1500 may be configured to perform a process (e.g., process 500, process 600, process 700, process 800, process 900, process 1000, process 1100, process 1200, process 1300, process 1400) described elsewhere in the present disclosure. In some embodiments, one or more modules of the blockchain network sharding device 1500 may be integrated into a processing device 1700 illustrated in FIG. 17.
[0140] The sharding module 1510 may be configured to determine a first master node in the blockchain network 100, and divide a plurality of candidate nodes in the blockchain network 100 into a plurality of different network shards. Specifically, in response to that the first master node is a target node, the sharding module 1510 may divide the plurality of candidate nodes in the blockchain network 100 into the plurality of different network shards. As used herein, the target node may be any node in the blockchain network 100; the plurality of candidate nodes may be randomly selected from all nodes in the blockchain network 100. In some embodiments, the first master node may be determined based on a first random value corresponding to the target node and first random values corresponding tp other candidate nodes. If the first random value corresponding to the target node and the first random values corresponding to other candidate nodes satisfy a preset size relationship, the sharding module 1510 may determine the first master node to be the target node. The preset size relationship may include one of the first random values corresponding to other candidate nodes being greater than the first random value corresponding to the target node, or the first random values corresponding to
other candidate nodes being less than the first random value corresponding to the target node. In some embodiments, the sharding module 1510 may generate a random seed based on a second random value corresponding to the target node and second random values corresponding to other candidate nodes. The sharding module 1510 may divide the plurality of candidate nodes into the plurality of different network shards based on the random seed. For example, for a candidate node with the highest ranking, the sharding module 1510 may determine a third random value corresponding to the candidate node with the highest ranking based on the random seed and a preset random function. For each of remainder candidate nodes other than the candidate node with the highest ranking, the sharding module 1510 may generate a third random value corresponding to the candidate node based on a third random value corresponding to a previous candidate node. In some embodiments, each of the third random values corresponding to the plurality of candidate nodes may match a respective one of a plurality of serial numbers corresponding to a plurality of network shards. For each of the candidate nodes, the sharding module 1510 may allocate the candidate node to a network shard that matches a third random value corresponding to the candidate node based on the third random value corresponding to the candidate node.
[0141] The first determination module 1520 may be configured to for at least one of the plurality of different network shards, determine a second master node in a network shard by any node in the network shard. Specifically, the first
determination module 1520 may determine a second master node in a network shard (e.g., a target network shard) where the target node is located.
[0142] The second determination module 1530 may be configured to for the at least one of the plurality pf network shards, one or more validation nodes used for data validation in the network shard based on address information and/or a network latency of each of candidate nodes in the network shard. Specifically, in response to determining that the second master node is the target node, the second
determination module 1530 may determine one or more validation nodes used for data validation in the target network shard based on address information and/or a network latency of each of candidate nodes in the target network shard.
[0143] In some embodiments, the second determination module 1530 may divide the candidate nodes in the target network shard into at least one cluster based on the address information of each of the candidate nodes. The second determination module 1503 may determine, based on the at least one cluster, the one or more validation nodes used for data validation in the target network shard.
[0144] In some embodiments, the address information may include a geographic location. The second determination module 1530 may divide one or more candidate nodes within a same geographic area into a same cluster based on the geographic location of each of the candidate nodes in the target network shard.
The second determination module 1530 may rank the at least one cluster in a descending order based on a count of candidate nodes in each of the at least one cluster. If a count of candidate nodes in a cluster with the highest ranking is equal to a preset count, the second determination module 1530 may designate the candidate nodes in the cluster with the highest ranking as the one or more validation nodes.
[0145] If the count of candidate nodes in the cluster with the highest ranking is greater than the preset count, the second determination module 1530 may divide one or more candidate nodes within a same network segment into a same sub cluster based on the IP address of each of the candidate nodes in the cluster with the highest ranking. The second determination module 1530 may rank at least one sub-cluster in a descending order based on a count of candidate nodes in each of the at least one sub-cluster. If a count of candidate nodes in a sub-cluster with the highest ranking is equal to the preset count, the second determination module 1530 may designate the candidate nodes in the sub-cluster with the highest ranking as the one or more validation nodes. If the count of candidate nodes in the sub-cluster
with the highest ranking is less than the preset count, the second determination module 1530 may select the one or more validation nodes from the at least one sub cluster in turn according to a ranking order of the at least one sub-cluster until a count of selected validation nodes is equal to the preset count. If the count of candidate nodes in the sub-cluster with the highest ranking is greater than the preset count, the sub-cluster with the highest ranking may be designated as a first target sub-cluster. Alternatively, if the count of candidate nodes in the sub-cluster with the highest ranking is less than the preset count, one or more validation nodes need to be selected from a jth sub-cluster, and a count of candidate nodes in the jth sub cluster is greater than a count of the one or more validation nodes to be selected from the jth sub-cluster, the jth sub-cluster may be designated as a first target sub cluster. The second determination module 1530 may rank candidate nodes in the first target sub-cluster in an ascending order based on a network latency of each of the candidate nodes in the first target sub-cluster. The second determination module 1530 may select one or more validation nodes from the first target sub cluster in turn based on the ranking until a count of selected validation nodes is equal to a count of one or more candidate nodes to be selected from the first target sub-cluster.
[0146] If the count of candidate nodes in the cluster with the highest ranking is less than the preset count, the second determination module 1530 may select the one or more validation nodes from the at least one cluster in turn based on a ranking order of the at least one cluster until a count of selected validation nodes is equal to the preset count. In some embodiments, one or more validation nodes may need to be selected from an ith cluster based on the ranking, wherein a value of i is an integer greater than 1 and a count of candidate nodes in the ith cluster is greater than a count of the one or more validation nodes to be selected. The second
determination module 1530 may divide candidate nodes within a same network segment into a same sub-cluster based on the IP address of each of the candidate
nodes in the ith cluster. The second determination module 1530 may rank at least one sub-cluster in a descending order based on a count of candidate nodes in each of the at least one sub-cluster. If a count of candidate nodes in a sub-cluster with the highest ranking is equal to the count of the one or more validation nodes to be selected from the ith cluster, the second determination module 1530 may designate the candidate nodes in the sub-cluster with the highest ranking as the one or more validation nodes to be selected from the ith cluster. If the count of candidate nodes in the sub-cluster with the highest ranking is less than the count of the one or more validation nodes to be selected from the ith cluster, the second determination module 1530 may select the one or more validation nodes from the ith cluster from the at least one sub-cluster in turn according to a ranking order of the at least one sub cluster until a count of selected validation nodes is equal to the count of the one or more validation nodes to be selected from the ith cluster. If the count of candidate nodes in the sub-cluster with the highest ranking is greater than the count of one or more validation nodes to be selected from the ith cluster, the sub-cluster with the highest ranking may be designated as a second target sub-cluster. Alternatively, if the count of candidate nodes in the sub-cluster with the highest ranking is less than the count of one or more validation nodes to be selected from the ith cluster, one or more validation nodes need to be selected from a kth sub-cluster, and a count of candidate nodes in the kth sub-cluster is greater than a count of the one or more validation nodes to be selected from the kth sub-cluster, the kth sub-cluster may be designated as a second target sub-cluster. The second determination module 1530 may rank candidate nodes in the second target sub-cluster in an ascending order based on a network latency of each of the candidate nodes in the second target sub cluster. The second determination module 1530 may select one or more validation nodes from the second target sub-cluster in turn based on the ranking until a count of selected validation nodes is equal to a count of one or more candidate nodes to be selected from the second target sub-cluster.
[0147] In some embodiments, for each of the candidate nodes in the target network shard, an echo request may be sent to the candidate node by the second master node (e.g., the target node), and an echo reply may be received from the candidate node. For each of the candidate nodes in the target network shard, the network latency of the candidate node may be determined based on a time difference between a time point at which the echo request is sent to the candidate node and a time point at which the echo node reply is received from the candidate node.
[0148] The obtaining module 1540 may be configured to obtain a public key and a signature of the candidate node, wherein the signature is associated with encryption information of an IP address that is encrypted based on a private key of the candidate node. The obtaining module 1540 may be configured to verify the signature of the candidate node based on the public key of the candidate node. If the signature of the candidate node is verified, the obtaining module 1540 may be configured to obtain the IP address of the candidate node from the signature, and obtain a geographic location of the candidate node based on the IP address. In some embodiments, the obtaining module 1540 may decrypt the signature of the candidate node based on the public key of the candidate node. If the signature of the candidate node is decrypted, the obtaining module 1540 may resolve the IP address in the signature of the candidate node. The obtaining module 1540 may determine whether an IP address of the candidate node when a connection with the candidate node is established is the same as the IP address in the signature. In response to a determination that the IP address of the candidate node when the connection with the candidate node is established is the same as the IP address in the signature, the obtaining module 1540 may determine that the signature of the candidate node is verified.
[0149] According to the present disclosure, firstly, a plurality of candidate nodes in the blockchain network may be divided into a plurality of different network shards, which can improve the handling capacity of the blockchain network. Secondly, for
each of the plurality of network shards, one or more validation nodes used for data validation in the network shard may be selected based on address information and/or a network latency of each of candidate nodes in the network shard, which may further reduce a latency in data validation performed by the one or more validation nodes and improve a real-time performance of the data validation.
[0150] Further, the plurality of candidate nodes in the blockchain network may be divided into the plurality of different network shards randomly, which can ensure security.
[0151] The modules in the blockchain network sharding device 1500 may be connected to or communicated with each other via a wired connection or a wireless connection. The wired connection may include a metal cable, an optical cable, a hybrid cable, or the like, or any combination thereof. The wireless connection may include a Local Area Network (LAN), a Wide Area Network (WAN), a Bluetooth, a ZigBee, a Near Field Communication (NFC), or the like, or any combination thereof. Two or more of the modules may be combined into a single module, and any one of the modules may be divided into two or more units.
[0152] FIG. 16 is a schematic diagram illustrating an exemplary electronic device according to some embodiments of the present disclosure. As shown in FIG. 16, the electronic device 1600 may include a processor 1610, a storage device 1620, and a bus 1630. In some embodiments, one or more components of the electronic device 1600 may be integrated into or implemented by the computing device 200 or the mobile device 300.
[0153] The storage device 1620 may store machine-readable instructions (e.g., executable instructions corresponding to the sharding module 1510, the first determination module 1520, the second determination module 1530, and/or the obtaining module 1540 in FIG. 15) that may be executed by the processor 1610. When the electronic device 1600 is executed, the processor 1610 may communicate with the storage device 1620 via the bus 1630. When the machine-readable
instructions are executed by the processor 1610, a process (e.g., process 500, process 600, process 700, process 800, process 900, process 1000, process 1100, process 1200, process 1300, process 1400) disclosed in the present disclosure may be implemented.
[0154] FIG. 17 is a block diagram illustrating an exemplary processing device according to some embodiments of the present disclosure. The processing device 1700 may include an obtaining module 1720 and an identification module 1740. In some embodiments, any node in the blockchain network 100 may be implemented by the processing device 1700. In some embodiments, the processing device 1700 may be implemented on the computing device 200 or the mobile device 300.
[0155] The obtaining module 1720 may be configured to obtain one or more network shards associated with a candidate node set in the blockchain network 100. Each of the one or more network shards may include one or more candidate nodes. As described in connection with FIG. 1 , the blockchain network 100 may include a plurality of nodes, accordingly, the candidate node set may include all or a portion of the plurality of nodes in the blockchain network 100. In some embodiments, the one or more network shards may be determined by a first node in the candidate node set. In some embodiments, the one or more network shards may be pre determined in the blockchain network 100. The obtaining module 1720 may directly obtain the one or more network shards from the blockchain network 100. More descriptions regarding the obtaining of the one or more network shards may be found elsewhere in the present disclosure (e.g., FIG. 18 and the description thereof).
[0156] The identification module 1740 may be configured to for at least one (e.g., a network shard where the first node is located) of the one or more network shards, identify, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes. A used herein, the term“target node” may refer to a candidate node that may be used for data processing (e.g., data validation, data
storage) associated with a transaction to be processed by the blockchain network 100. In some embodiments, a second node in the network shard may be
determined according to a manner the same as or similar to the manner in which the first node in the candidate node set is determined. Further, the second node may identify the one or more target nodes in the network shard. In some embodiments, the identification module 1740 may divide the one or more candidate nodes in the network shard into at least one cluster based on the location (e.g., a geographic location) of each of the one or more candidate nodes in the network shard. Further, the identification module 1740 may determine the one or more target nodes in the network shard based on the at least one cluster. More descriptions regarding determining the one or more target nodes may be found elsewhere in the present disclosure (e.g., FIGs. 20-22 and the descriptions thereof). In some embodiments, the identification module 1740 may rank the one or more candidate nodes in an ascending order based on the network latency of each of the one or more candidate nodes in the network shard. Further, the identification module 1740 may designate top w candidate nodes based on the ranking as the one or more target nodes in the network shard, wherein the value of w may be equal to a preset count which may be determined based on information (e.g., transaction type, transaction data amount) associated with the transaction to be processed by the blockchain network 100 or a default setting of the blockchain network 100. In some embodiments, the
identification module 1740 may divide the one or more candidate nodes in the network shard into at least one cluster based on an IP address of each of the one or more candidate nodes in the network shard. Further, the identification module 1740 may determine the one or more target nodes in the blockchain network shard based on the at least one cluster according to a manner similar to the manner described in FIGs. 21 -22.
[0157] The modules in the processing device 1700 may be connected to or communicated with each other via a wired connection or a wireless connection.
The wired connection may include a metal cable, an optical cable, a hybrid cable, or the like, or any combination thereof. The wireless connection may include a Local Area Network (LAN), a Wide Area Network (WAN), a Bluetooth, a ZigBee, a Near Field Communication (NFC), or the like, or any combination thereof. Two or more of the modules may be combined into a single module, and any one of the modules may be divided into two or more units. For example, the obtaining module 1720 and the identification module 1740 may be combined as a single module. As another example, the processing device 1700 may include a storage module (not shown) for storing information and/or data generated by the processing device 1700.
[0158] FIG. 18 is a flowchart illustrating an exemplary process for identifying one or more target nodes in a blockchain network according to some embodiments of the present disclosure. In some embodiments, the process 1800 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, or the storage 390. The processor 220, the CPU 340, and/or the modules in FIG. 17 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, and/or the modules may be configured to perform the process 1800. The operations of the illustrated process presented below are intended to be illustrative. In some embodiments, the process 1800 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 18 and described below is not intended to be limiting.
[0159] In 1801 , the processing device 1700 (e.g., the obtaining module 1720) (e.g., the interface circuits of the processor 220 or the processing circuits of the process 220) may obtain one or more network shards associated with a candidate node set in the blockchain network 100. Each of the one or more network shards may include one or more candidate nodes.
[0160] As described in connection with FIG. 1 , the blockchain network 100 may include a plurality of nodes, accordingly, the candidate node set may include all or a portion of the plurality of nodes in the blockchain network 100. For example, a portion of the plurality of nodes may be randomly selected from the plurality of nodes and designated as candidate nodes in the candidate node set. As another example, all the plurality of nodes in the blockchain network may be designated as the candidate nodes in the candidate node set.
[0161] In some embodiments, as described in connection with operation 501 , the one or more network shards may be determined by a first node in the candidate node set based on a random seed, wherein the first node may satisfy a first preset condition. In some embodiments, the first preset condition may include that a first condition value (e.g., a first random value) corresponding to the first node is maximum among first condition values corresponding to the candidate nodes in the candidate node set or the first condition value corresponding to the first node is minimum among the first condition values corresponding to the candidate nodes in the candidate node set. In some embodiments, the first condition value may be generated by a corresponding candidate node using a first preset function such as a Verified Random Function (VRF), an Algorand algorithm, a Dfinity algorithm, an Ouroborous Praos algorithm, etc. In some embodiments, the first node may be determined by any node (e.g., the target node described in FIG. 5) in the candidate node set based on the first preset condition.
[0162] In some embodiments, as described in connection with FIG. 6, the random seed may be determined by the first node based on second condition values (e.g., second random values) corresponding to the candidate nodes in the candidate node set. For example, the first node may generate a second condition value
corresponding to the first node and obtain second condition values corresponding to other candidate nodes in the candidate node set. Further, the first node may determine the random seed by concatenating the second condition values
corresponding to the candidate nodes in the candidate node set. In some
embodiments, the second condition value may be generated by a corresponding candidate node using a second preset function which may be the same as or different from the first preset function.
[0163] In some embodiments, as described in connection with FIG. 7, after determining the random seed, the first node may randomly rank the candidate nodes in the candidate node set. For each of the candidate nodes in the candidate node set, a third condition value (e.g., a third random value) corresponding to the candidate node may be determined based on the ranking and the random seed.
For example, for a candidate node with the highest ranking, a third condition value corresponding to the candidate node with the highest ranking may be determined based on the random seed; for each of remainder candidate nodes other than the candidate node with the highest ranking in the candidate node set, a third condition value corresponding to the candidate node may be determined based on a third condition value corresponding to a previous candidate node. Further, the first node may determine the one or more network shards based on the third condition values corresponding to the candidate nodes in the candidate node set.
[0164] For example, as described in connection with FIG. 7, the first node may allocate a candidate node with a third condition value matching a serial number corresponding to a specific network shard. As used herein,“matching” refers to that at least a portion of the third condition value corresponding to the candidate node is the same as a portion of the serial number corresponding to the network shard. As another example, the first node may allocate candidate nodes with a same portion (e.g., last few digits (e.g., last three digits)) to a same network shard.
[0165] In some embodiments, the one or more network shards may be pre determined in the blockchain network 100. The processing device 1700 may directly obtain the one or more network shards from the blockchain network 100.
[0166] In 1802, for at least one (e.g., a network shard where the first node is located) of the one or more network shards, the processing device 1700 (e.g., the identification module 1740) (e.g., the processing circuits of the processor 220) may identify, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes. A used herein, the term“target node” may refer to a candidate node that may be used for data processing (e.g., data validation, data storage) associated with a transaction to be processed by the blockchain network 100.
[0167] In some embodiments, a second node in the network shard may be determined according to a manner the same as or similar to the manner in which the first node in the candidate node set is determined. Further, the second node may identify the one or more target nodes in the network shard.
[0168] In some embodiments, the processing device 1700 may divide the one or more candidate nodes in the network shard into at least one cluster based on the location (e.g., a geographic location) of each of the one or more candidate nodes in the network shard. Further, the processing device 1700 may determine the one or more target nodes in the network shard based on the at least one cluster. More descriptions regarding determining the one or more target nodes may be found elsewhere in the present disclosure (e.g., FIGs. 20-22 and the descriptions thereof).
[0169] In some embodiments, the processing device 1700 may rank the one or more candidate nodes in an ascending order based on the network latency of each of the one or more candidate nodes in the network shard. Further, the processing device 1700 may designate top w candidate nodes based on the ranking as the one or more target nodes in the network shard, wherein a value of w may be equal to a preset count which may be determined based on information (e.g., transaction type, transaction data amount) associated with the transaction to be processed by the blockchain network 100 or a default setting of the blockchain network 100.
[0170] In some embodiments, the processing device 1700 may divide the one or more candidate nodes in the network shard into at least one cluster based on an IP address of each of the one or more candidate nodes in the network shard. For example, the processing device 1700 may divide candidate nodes within a same network segment or adjacent network segments into a same cluster based on IP addresses of the candidate nodes. Further, the processing device 1700 may determine the one or more target nodes in the blockchain network shard based on the at least one cluster according to a manner similar to the manner described in FIGs. 21 -22.
[0171] In some embodiments, as described in connection with FIG. 14, for each of the one or more candidate nodes, in order to obtain the location of the candidate node, the processing device 1700 (e.g., the second node) may obtain a public key and a signature (which may be associated with encrypted address information of the candidate node) of the candidate node and extract the location of the candidate node from the encrypted address information by verifying the signature based on the public key. The location of the candidate node may include a continent, a country, a province, a state, a county, a shire, a city, a town, a borough, a district, longitude and latitude, and/or an IP address where the candidate node is located.
[0172] In some embodiments, as described in connection with FIG. 13, for each of the one or more candidate nodes, in order to obtain the network latency of the candidate node, the processing device 1700 (e.g., the second node) may send an echo request to the candidate node at a first time point and receive an echo reply from the candidate node at a second time point. Further, the processing device 1700 may determine the network latency of the candidate node based on a time difference between the first time point and the second time point.
[0173] It should be noted that the above description is merely provided for the purposes of illustration, and not intended to limit the scope of the present disclosure. For persons having ordinary skills in the art, multiple variations or modifications may
be made under the teachings of the present disclosure. However, those variations and modifications do not depart from the scope of the present disclosure. For example, one or more other optional operations (e.g., a storing operation) may be added elsewhere in the process 1800. In the storing operation, the processing device 1700 may store information and/or data (e.g., the one or more target nodes) associated with the blockchain network 100 in a storage device disclosed elsewhere in the present disclosure.
[0174] FIG. 19 is a block diagram illustrating an exemplary identification module according to some embodiments of the present disclosure. The identification module 1740 may include a division unit 1910, a count determination unit 1920, a ranking unit 1930, and a target node determination unit 1940.
[0175] The division unit 1910 may be configured to divide one or more candidate nodes in a network shard into at least one cluster based on a location of each of the one or more candidate nodes. As described in connection with FIG. 8, division unit 1910 may determine the at least one cluster according to“city,”“district,” etc.
[0176] The count determination unit 1920 may be configured to determine a count of candidate nodes in the cluster.
[0177] The ranking unit 1930 may be configured to rank the at least one cluster in a descending order based on at least one count corresponding to the at least one cluster.
[0178] The target node determination unit 1940 may be configured to determine one or more target nodes in the network shard. In some embodiments, the target node determination unit 1940 may determine whether a count of candidate nodes in the cluster with the highest ranking is less than a preset count. In response to a determination that the count of candidate nodes in the cluster with the highest ranking is not less than the preset count, the target node determination unit 1940 may determine the one or more target nodes in the cluster with the highest ranking.
In response to a determination that the count of candidate nodes in the cluster with
the highest ranking is less than the preset count, the target node determination unit 1940 may determine the one or more target nodes in clusters from the cluster with the highest ranking to an ith cluster based on the ranking. More descriptions regarding determining the one or more target nodes may be found elsewhere in the present disclosure (e.g., FIGs. 20-22 and the descriptions thereof).
[0179] The units in the identification module 1740 may be connected to or communicated with each other via a wired connection or a wireless connection.
The wired connection may include a metal cable, an optical cable, a hybrid cable, or the like, or any combination thereof. The wireless connection may include a Local Area Network (LAN), a Wide Area Network (WAN), a Bluetooth, a ZigBee, a Near Field Communication (NFC), or the like, or any combination thereof. Two or more of the units may be combined into a single module, and any one of the units may be divided into two or more sub-units. For example, the count determination unit 1920 and the ranking unit 1930 may be integrated into a single unit. As another example, a storing unit may be added in the identification module 1740 for storing.
[0180] FIG. 20 is a flowchart illustrating an exemplary process for identifying one or more target nodes in a network shard according to some embodiments of the present disclosure. In some embodiments, the process 2000 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, or the storage 390. The processor 220, the CPU 340, and/or the identification module 1740 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, and/or the identification module 1740 may be configured to perform the process 2000. The operations of the illustrated process presented below are intended to be illustrative. In some embodiments, the process 2000 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 20 and described
below is not intended to be limiting. In some embodiments, operation 1802 may be achieved by one or more operations of the process 2000.
[0181] In 2001 , the processing device 1700 (e.g., the division unit 1910) (e.g., the processing circuits of the processor 220) may divide one or more candidate nodes in the network shard into at least one cluster based on a location of each of the one or more candidate nodes. As described in connection with FIG. 8, the processing device 1700 may determine the at least one cluster according to“city,”“district,” etc.
[0182] In 2002, for each of the at least one cluster, the processing device 1700 (e.g., the count determination unit 1920) (e.g., the processing circuits of the processor 220) may determine a count of candidate nodes in the cluster.
[0183] In 2003, the processing device 1700 (e.g., the ranking unit 1930) (e.g., the processing circuits of the processor 220) may rank the at least one cluster in a descending order based on at least one count corresponding to the at least one cluster.
[0184] In 2004, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine whether a count of candidate nodes in the cluster with the highest ranking is less than a preset count.
[0185] In 2005, in response to a determination that the count of candidate nodes in the cluster with the highest ranking is not less than the preset count, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine the one or more target nodes in the cluster with the highest ranking.
[0186] In some embodiments, in response to a determination that the count of candidate nodes in the cluster with the highest ranking is equal to the preset count, the processing device 1700 may designate the candidate nodes in the cluster with the highest ranking as the one or more target nodes.
[0187] In some embodiments, in response to a determination that the count of candidate nodes in the cluster with the highest ranking is greater than the preset count, the processing device 1700 may determine the one or more target nodes in the cluster with the highest ranking based on an IP address and/or a network latency of each of the candidate nodes in the cluster with the highest ranking. For example, the processing device 1700 may rank the candidate nodes in the cluster with the highest ranking in an ascending order based on the network latency of each of the candidate nodes in the cluster with the highest ranking. The processing device 1700 may designate top f candidate nodes based on the ranking as the one or more target nodes, wherein a value of f may be equal to the preset count. As another example, the processing device 1700 may divide the candidate nodes in the cluster with the highest ranking into at least one sub-cluster based on the IP address of each of the candidate nodes in the cluster with the highest ranking. The processing device 1700 may determine the one or more target nodes based on the at least one sub-cluster. More descriptions regarding determining the one or more target nodes based on the IP address of each of the candidate nodes in the cluster with the highest ranking may be found elsewhere in the present disclosure (e.g., FIG. 21 and the description thereof).
[0188] In 2006, in response to a determination that the count of candidate nodes in the cluster with the highest ranking is less than the preset count, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine the one or more target nodes in clusters from the cluster with the highest ranking to an ith cluster based on the ranking.
[0189] In some embodiments, the processor 220 may identify the ith cluster based on the ranking of the at least one cluster. For example, the processing device 1700 may identify the ith cluster according to a condition that a count of candidate nodes from the cluster with the highest ranking to the ith cluster is greater than the preset
count and a count of candidate nodes from the cluster with the highest ranking to an (i-1 )th cluster is less than the preset count.
[0190] In some embodiments, the processing device 1700 may determine the one or more target nodes from the cluster with the highest ranking to the ith cluster based on an IP address and/or a network latency of each of candidate nodes in the ith cluster. For example, the processing device 1700 may rank the candidate nodes in the ith cluster in an ascending order based on network latencies corresponding to the candidate nodes in the ith cluster. The processing device 1700 may designate top g candidate nodes based on the ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster as the one or more target nodes, wherein a sum of a value of g and the count of the candidate nodes form the cluster with the highest ranking to the (i-1 )th cluster may be equal to the preset count. As another example, the processor 220 may divide the candidate nodes in the ith cluster into at least one sub-cluster based on the IP address of each of the candidate nodes in the ith cluster. The processing device 1700 may determine the one or more target nodes based on the at least one sub-cluster. More descriptions regarding determining the one or more target nodes based on the IP address of each of the candidate nodes in the ith cluster may be found elsewhere in the present disclosure (e.g., FIG. 22 and the description thereof).
[0191] It should be noted that the above description is merely provided for the purposes of illustration, and not intended to limit the scope of the present disclosure. For persons having ordinary skills in the art, multiple variations or modifications may be made under the teachings of the present disclosure. Flowever, those variations and modifications do not depart from the scope of the present disclosure.
[0192] FIG. 21 is a flowchart illustrating an exemplary process for determining one or more target nodes in a cluster with the highest ranking according to some embodiments of the present disclosure. In some embodiments, the process 2100 may be implemented as a set of instructions (e.g., an application) stored in the ROM
230, the RAM 240, or the storage 390. The processor 220, the CPU 340, and/or the identification module 1740 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, and/or the identification module 1740 may be configured to perform the process 2100. The operations of the illustrated process presented below are intended to be illustrative. In some embodiments, the process 2100 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 21 and described below is not intended to be limiting. In some embodiments, operation 2005 may be achieved by one or more operations of the process 2100.
[0193] In 2101 , the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may divide candidate nodes in the cluster with the highest ranking into at least one sub-cluster based on an IP address of each of the candidate nodes. As described in connection with FIG. 10, the processing device 1700 may divide candidate nodes within a same network segment or adjacent network segments into a same sub-cluster. As used herein, the term“network segment” may refer to a subnet broadcast address. In some embodiments, the network segment of a candidate node may be determined by performing a logical operation (e.g., an“AND” operation) on an IP address of the candidate node and a subnet mask corresponding to the IP address.
[0194] In 2102, for each of the at least one sub-cluster, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine a count of candidate nodes in the sub-cluster.
[0195] In 2103, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may rank the at least one sub-cluster in a descending order based on at least one count corresponding to the at least one sub-cluster.
[0196] In 2104, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine whether a count of candidate nodes in the sub-cluster with the highest ranking is less than the preset count.
[0197] In 2105, in response to a determination that the count of candidate nodes in the cluster with the highest ranking is not less than the preset count, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine the one or more target nodes in the sub-cluster with the highest ranking.
[0198] In some embodiments, in response to a determination that the count of candidate nodes in the sub-cluster with the highest ranking is equal to the preset count, the processing device 1700 may designate the candidate nodes in the sub cluster with the highest ranking as the one or more target nodes.
[0199] In some embodiments, in response to a determination that the count of candidate nodes in the sub-cluster with the highest ranking is greater than the preset count, the processing device 1700 may determine the one or more target nodes in the cluster with the highest ranking based on a network latency of each of the candidate nodes in the sub-cluster with the highest ranking. For example, for each of the candidate nodes in the sub-cluster with the highest ranking, the processing device 1700 may determine a network latency corresponding to the candidate node. The processing device 1700 may rank the candidate nodes in the sub-cluster with the highest ranking in an ascending order based on network latencies corresponding to the candidate nodes. The processing device 1700 may designate top m candidate nodes based on the ranking as the one or more target nodes, wherein a value of m may be equal to the preset count.
[0200] In 2106, in response to a determination that the count of candidate nodes in the sub-cluster with the highest ranking is less than the preset count, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing
circuits of the processor 220) may determine the one or more target nodes in sub clusters from the sub-cluster with the highest ranking to a jth sub-cluster based on the ranking.
[0201] In some embodiments, the processing device 1700 may identify the jth sub cluster based on the ranking of the at least one sub-cluster. For example, the processing device 1700 may identify the jth sub-cluster according to a preset condition that a count of candidate nodes from the sub-cluster with the highest ranking to the jth sub-cluster is greater than the preset count and a count of candidate nodes from the sub-cluster with the highest ranking to a (j-1 )th sub-cluster is less than the preset count.
[0202] In some embodiments, the processing device 1700 may determine the one or more target nodes from the sub-cluster with the highest ranking to the jth sub cluster based on a network latency of each of candidate nodes in the jth sub-cluster. For example, for each of the candidate nodes in the jth sub-cluster, the processing device 1700 may determine a network latency corresponding to the candidate node. The processing device 1700 may rank the candidate nodes in the jth sub-cluster in an ascending order based on network latencies corresponding to the candidate nodes. The processing device 1700 may designate top n candidate nodes based on the ranking and the candidate nodes from the sub-cluster with the highest ranking to the (j-1 )th sub-cluster as the one or more target nodes, wherein a sum of a value of n and the count of candidate nodes from the sub-cluster with the highest ranking to the (j-1 )th sub-cluster may be equal to the preset count.
[0203] It should be noted that the above description is merely provided for the purposes of illustration, and not intended to limit the scope of the present disclosure. For persons having ordinary skills in the art, multiple variations or modifications may be made under the teachings of the present disclosure. Flowever, those variations and modifications do not depart from the scope of the present disclosure.
[0204] FIG. 22 is a flowchart illustrating an exemplary process for determining one
or more target nodes from a cluster with the highest ranking to an ith cluster according to some embodiments of the present disclosure. In some embodiments, the process 2200 may be implemented as a set of instructions (e.g., an application) stored in the ROM 230, the RAM 240, or the storage 390. The processor 220 and/or the identification module 1740 may execute the set of instructions, and when executing the instructions, the processor 220, the CPU 340, and/or the identification module 1740 may be configured to perform the process 2200. The operations of the illustrated process presented below are intended to be illustrative. In some embodiments, the process 2200 may be accomplished with one or more additional operations not described and/or without one or more of the operations herein discussed. Additionally, the order in which the operations of the process as illustrated in FIG. 22 and described below is not intended to be limiting. In some embodiments, operation 2006 may be achieved by one or more operations of the process 2200.
[0205] In 2201 , the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may divide candidate nodes in the ith cluster into at least one sub-cluster based on an IP address of each of the candidate nodes.
[0206] In 2202, for each of the at least one sub-cluster, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine a count of candidate nodes in the sub-cluster.
[0207] In 2203, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may rank the at least one sub-cluster in a descending order based on at least one count corresponding to the at least one sub-cluster.
[0208] In 2204, the processing device 1700 (e.g., the identification module 714, the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine whether a count of candidate nodes in a sub-cluster with the
highest ranking and candidate nodes from a cluster with the highest ranking to an (i- 1 )th cluster is less than the preset count.
[0209] In 2205, in response to a determination that the count of the candidate nodes in the sub-cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is not less than to the preset count, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine the one or more target nodes in the sub-cluster with the highest ranking and clusters from the cluster with the highest ranking to the (i-1 )th cluster.
[0210] In some embodiments, in response to a determination that the count of the candidate nodes in the sub-cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is equal to the preset count, the processing device 1700 may designate the candidate nodes in the sub cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster as the one or more target nodes.
[0211] In some embodiments, in response to a determination that the count of the candidate nodes in the sub-cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is greater than the preset count, the processing device 1700 may determine the one or more target nodes in the sub-cluster with the highest ranking and clusters from the cluster with the highest ranking to the (i-1 )th cluster based on a network latency of each of the candidate nodes in the sub-cluster with the highest ranking. For example, for each of the candidate nodes in the sub-cluster with the highest ranking, the processing device 1700 may determine a network latency corresponding to the candidate node. The processing device 1700 may rank the candidate nodes in the sub-cluster with the highest ranking in an ascending order based on network latencies corresponding to the candidate nodes. The processing device 1700 may designate top p candidate nodes based on the ranking and the candidate nodes from the cluster with
the highest ranking to the (i-1 )th cluster as the one or more target nodes, wherein a sum of a value of p and the count of the one or more candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster may be equal to the preset count.
[0212] In 2206, in response to a determination that the count of the candidate nodes in the sub-cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is less than the preset count, the processing device 1700 (e.g., the target node determination unit 1940) (e.g., the processing circuits of the processor 220) may determine the one or more target nodes in sub-clusters from the sub-cluster with the highest ranking to a kth sub cluster based on the ranking and clusters from the cluster with the highest ranking to the (i-1 )th cluster.
[0213] In some embodiments, the processor may identify the kth sub-cluster based on the ranking of the at least one sub-cluster. For example, the processing device 1700 may identify the kth sub-cluster according to a condition that a count of candidate nodes from the sub-cluster with the highest ranking to the kth sub-cluster and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is greater than the preset count and a count of candidate nodes from the sub cluster with the highest ranking to a (k-1 )th sub-cluster and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is less than the preset count.
[0214] In some embodiments, the processing device 1700 may determine the one or more target nodes in sub-clusters from the sub-cluster with the highest ranking to the kth sub-cluster based on the ranking and clusters from the cluster with the highest ranking to the (i-1 )th cluster based on a network latency of each of candidate nodes in the kth sub-cluster. For example, for each of the candidate nodes in the kth sub-cluster, the processing device 1700 may determine a network latency corresponding to the candidate node. The processing device 1700 may rank the candidate nodes in the kth sub-cluster in an ascending order based on network
latencies corresponding to the candidate nodes. The processing device 1700 may designate top q candidate nodes based on the ranking, the candidate nodes from the sub-cluster with the highest ranking to the (k-1 )th sub-cluster, and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster as the one or more target nodes, wherein a sum of a value of q, the count of the candidate nodes from the sub-cluster with the highest ranking to the (k-1 )th sub-cluster, and the count of candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster may be equal to the preset count.
[0215] It should be noted that the above description is merely provided for the purposes of illustration, and not intended to limit the scope of the present disclosure. For persons having ordinary skills in the art, multiple variations or modifications may be made under the teachings of the present disclosure. However, those variations and modifications do not depart from the scope of the present disclosure.
[0216] In some embodiments, the present disclosure may also provide a storage medium storing a computer program thereon. When executed by a processor, the computer program may direct the processor to perform a process (e.g., process 1800, process 2000, process 2100, process 2200) described elsewhere in the present disclosure.
[0217] In some embodiments, the present disclosure may also provide a computing device including a processor and a storage, wherein the storage stores a computer program. When executed by a processor, the computer program may direct the processor to perform a process (e.g., process 1800, process 2000, process 2100, process 2200) described elsewhere in the present disclosure.
[0218] Having thus described the basic concepts, it may be rather apparent to those skilled in the art after reading this detailed disclosure that the foregoing detailed disclosure is intended to be presented by way of example only and is not limiting. Various alterations, improvements, and modifications may occur and are intended to those skilled in the art, though not expressly stated herein. These alterations,
improvements, and modifications are intended to be suggested by this disclosure, and are within the spirit and scope of the exemplary embodiments of this disclosure.
[0219] Moreover, certain terminology has been used to describe embodiments of the present disclosure. For example, the terms“one embodiment,”“an
embodiment,” and/or“some embodiments” mean that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present disclosure. Therefore, it is emphasized and should be appreciated that two or more references to“an embodiment” or“one
embodiment” or“an alternative embodiment” in various portions of this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined as suitable in one or more embodiments of the present disclosure.
[0220] Further, it will be appreciated by one skilled in the art, aspects of the present disclosure may be illustrated and described herein in any of a number of patentable classes or context including any new and useful process, machine, manufacture, or composition of matter, or any new and useful improvement thereof. Accordingly, aspects of the present disclosure may be implemented entirely hardware, entirely software (including firmware, resident software, micro-code, etc.) or combining software and hardware implementation that may all generally be referred to herein as a“unit,”“module,” or“system.” Furthermore, aspects of the present disclosure may take the form of a computer program product embodied in one or more computer readable media having computer readable program code embodied thereon.
[0221] A computer readable signal medium may include 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 signal may take any of a variety of forms, including electro-magnetic, optical, or the like, or any suitable combination thereof. A computer readable signal medium may be any computer readable
medium that is not a computer readable storage medium and that may 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 signal medium may be transmitted using any appropriate medium, including wireless, wireline, optical fiber cable, RF, or the like, or any suitable combination of the foregoing.
[0222] Computer program code for carrying out operations for aspects 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, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB. NET, Python or the like, conventional procedural programming languages, such as the "C" programming language, Visual Basic, Fortran 2003, Perl, COBOL 2002, PHP, ABAP, dynamic programming languages such as Python, Ruby and Groovy, or other 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 latter scenario, 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) or in a cloud computing environment or offered as a service such as a Software as a Service (SaaS).
[0223] Furthermore, the recited order of processing elements or sequences, or the use of numbers, letters, or other designations therefore, is not intended to limit the claimed processes and methods to any order except as may be specified in the claims. Although the above disclosure discusses through various examples what is currently considered to be a variety of useful embodiments of the disclosure, it is to be understood that such detail is solely for that purpose, and that the appended
claims are not limited to the disclosed embodiments, but, on the contrary, are intended to cover modifications and equivalent arrangements that are within the spirit and scope of the disclosed embodiments. For example, although the
implementation of various components described above may be embodied in a hardware device, it may also be implemented as a software only solution, e.g., an installation on an existing server or mobile device.
[0224] Similarly, it should be appreciated that in the foregoing description of embodiments of the present disclosure, various features are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure aiding in the understanding of one or more of the various embodiments. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed subject matter requires more features than are expressly recited in each claim. Rather, claimed subject matter may lie in less than all features of a single foregoing disclosed embodiment.
Claims
1. A method for determining network shards in a blockchain network implemented on a target node in the blockchain network, comprising:
determining a first master node in the blockchain network;
in response to determining that the first master node is the target node, dividing candidate nodes in the blockchain network into different network shards;
determining a second master node in a target network shard where the target node is located; and
in response to determining that the second master node is the target node, determining one or more validation nodes used for data validation in the target network shard based on address information and/or a network latency of each of candidate nodes in the target network shard.
2. The method of claim 1 , wherein the determining one or more validation nodes used for data validation in the target network shard based on address information and/or a network latency of each candidate node in the target network shard includes:
dividing the candidate nodes in the target network shard into at least one cluster based on the address information of each of the candidate nodes; and
determining, based on the at least one cluster, the one or more validation nodes used for data validation in the target network shard.
3. The method of claim 2, wherein the address information includes a geographic location, and
the dividing the candidate nodes in the target network shard into at least one cluster based on the address information of each of the candidate nodes includes:
dividing one or more candidate nodes within a same geographic area into a same cluster based on the geographic location of each of the candidate nodes in the target network shard; and
the determining, based on the at least one cluster, the one or more validation nodes used for data validation in the target network shard includes:
ranking the at least one cluster in a descending order based on a count of candidate nodes in each of the at least one cluster;
if a count of candidate nodes in a cluster with the highest ranking is equal to a preset count, designating the candidate nodes in the cluster with the highest ranking as the one or more validation nodes; and
if the count of candidate nodes in the cluster with the highest ranking is less than the preset count, selecting the one or more validation nodes from the at least one cluster in turn based on a ranking order of the at least one cluster until a count of selected validation nodes is equal to the preset count.
4. The method of claim 3, wherein the address information includes an Internet Protocol (IP) address, and if the count of candidate nodes in the cluster with the highest ranking is greater than the preset count, the method further includes:
determining the one or more validation nodes used for data validation in the target network shard according to a following process including:
dividing one or more candidate nodes within a same network segment into a same sub-cluster based on the IP address of each of the candidate nodes in the cluster with the highest ranking;
ranking at least one sub-cluster in a descending order based on a count of candidate nodes in each of the at least one sub-cluster;
if a count of candidate nodes in a sub-cluster with the highest ranking is equal to the preset count, designating the candidate nodes in the sub-cluster with the highest ranking as the one or more validation nodes; and
if the count of candidate nodes in the sub-cluster with the highest ranking is less than the preset count, selecting the one or more validation nodes from the
at least one sub-cluster in turn according to a ranking order of the at least one sub-cluster until a count of selected validation nodes is equal to the preset count.
5. The method of claim 3, wherein the address information includes an Internet Protocol (IP) address, and if the count of candidate nodes in the cluster with the highest ranking is less than the preset count, one or more validation nodes need to be selected from an ith cluster based on the ranking, and the method further includes: if a count of candidate nodes in the ith cluster is greater than a count of the one or more validation nodes to be selected, a value of i being an integer greater than 1 , determining the one or more validation nodes used for data validation in the target network shard according to a following process including:
dividing candidate nodes within a same network segment into a same sub cluster based on the IP address of each of the candidate nodes in the ith cluster; ranking at least one sub-cluster in a descending order based on a count of candidate nodes in each of the at least one sub-cluster;
if a count of candidate nodes in a sub-cluster with the highest ranking is equal to the count of the one or more validation nodes to be selected from the ith cluster, designating the candidate nodes in the sub-cluster with the highest ranking as the one or more validation nodes to be selected from the ith cluster; and
if the count of candidate nodes in the sub-cluster with the highest ranking is less than the count of the one or more validation nodes to be selected from the ith cluster, selecting one or more validation nodes from the at least one sub cluster in turn according to a ranking order of the at least one sub-cluster until a count of selected validation nodes is equal to the count of the one or more validation nodes to be selected from the ith cluster.
6. The method of claim 4, further comprising:
if a count of candidate nodes in a first target sub-cluster in the cluster with the highest ranking satisfies a second preset condition, determining the one or more validation nodes used for data validation in the target network shard according to a following process including:
ranking the candidate nodes in the first target sub-cluster in an ascending order based on a network latency of each of the candidate nodes in the first target sub-cluster; and
selecting one or more validation nodes from the first target sub-cluster in turn based on the ranking until a count of selected validation nodes is equal to a count of one or more candidate nodes to be selected from the first target sub cluster, wherein
the first target sub-cluster is the sub-cluster with the highest ranking or a jth sub-cluster, a value of j being an integer greater than 1 ; and the second preset condition is that the count of candidate nodes in the sub-cluster with the highest ranking is greater than the preset count; or the count of candidate nodes in the sub-cluster with the highest ranking is less than the preset count, one or more validation nodes need to be selected from the jth sub-cluster, and a count of candidate nodes in the jth sub cluster is greater than a count of the one or more validation nodes to be selected from the jth sub-cluster.
7. The method of claim 5, further comprising:
if a count of candidate nodes in a second target sub-cluster in the ith cluster satisfies a third preset condition, determining the one or more validation nodes used for data validation in the target network shard according to a following process including:
ranking the candidate nodes in the second target sub-cluster in an
ascending order based on a network latency of each of the candidate nodes in the second target sub-cluster; and
selecting one or more validation nodes from the second target sub-cluster in turn based on the ranking until a count of selected validation nodes is equal to a count of one or more candidate nodes to be selected from the second target sub-cluster, wherein
the second target sub-cluster is the sub-cluster with the highest ranking or a kth sub-cluster, a value of k being an integer greater than 1 ; and
the third preset condition is that the count of candidate nodes in the sub-cluster with the highest ranking is greater than the count of one or more validation nodes to be selected from the ith cluster; or the count of candidate nodes in the sub-cluster with the highest ranking is less than the count of one or more validation nodes to be selected from the ith cluster, one or more validation nodes need to be selected from the kth sub-cluster, and a count of candidate nodes in the kth sub-cluster is greater than a count of the one or more validation nodes to be selected from the kth sub cluster.
8. The method of claim 1 , wherein the target node determines the network latency of each of the candidate nodes in the target network shard according to a following process including:
for each of the candidate nodes in the target network shard,
sending an echo request to the candidate node in the target network shard; receiving an echo reply from the candidate node;
determining the network latency of the candidate node based on a time difference between a time point at which the echo request is sent to the candidate node and a time point at which the echo node reply is received from the candidate node.
9. The method of claim 1 , wherein the determining a first master node in the blockchain network includes:
if a first random value corresponding to the target node and first random values corresponding to other candidate nodes satisfy a preset size relationship,
determining that the first master node is the target node.
10. The method of claim 9, wherein the preset size relationship includes one of:
the first random values corresponding to other candidate nodes being greater than the first random value corresponding to the target node; or
the first random values corresponding to other candidate nodes being less than the first random value corresponding to the target node.
11 . The method of claim 1 , wherein the dividing candidate nodes in the blockchain network into different network shards includes:
generating a random seed based on a second random value corresponding to the target node and second random values corresponding to other candidate nodes; and
dividing the candidate nodes into the different network shards based on the random seed.
12. The method of claim 11 , wherein the dividing the candidate nodes into the different network shards based on the random seed includes:
for a candidate node with the highest ranking, determining a third random value corresponding to the candidate node with the highest ranking based on the random seed and a preset random function;
for each of remainder candidate nodes other than the candidate node with the highest ranking, generating a third random value corresponding to the candidate
node based on a third random value corresponding to a previous candidate node, wherein the third random value matches a serial number of a network shard; and for each of the candidate nodes, allocating the candidate node to a network shard that matches a third random value corresponding to the candidate node based on the third random value corresponding to the candidate node.
13. The method of claim 1 , wherein before determining a first master node in the blockchain network, the method further includes:
for each of the candidate nodes,
obtaining a public key and a signature of the candidate node, wherein the signature is associated with encryption information of an IP address that is encrypted based on a private key of the candidate node;
verifying the signature of the candidate node based on the public key of the candidate node; and
if the signature of the candidate node is verified,
obtaining the IP address of the candidate node from the signature; and obtaining, based on the IP address, a geographic location of the candidate node.
14. The method of claim 13, wherein the verifying the signature of the candidate node based on the public key of the candidate node includes:
decrypting the signature of the candidate node based on the public key of the candidate node; and
if the signature of the candidate node is decrypted,
resolving the IP address in the signature of the candidate node;
determining whether an IP address of the candidate node when a connection with the candidate node is established is the same as the IP address in the signature; and
in response to a determination that the IP address of the candidate node when the connection with the candidate node is established is the same as the IP address in the signature, determining that the signature of the candidate node is verified.
15. A system for determining network shards in a blockchain network implemented on a target node in the blockchain network, comprising:
a sharding module configured to determine a first master node in the blockchain network, and in response to determining that the first master node is the target node, divide candidate nodes in the blockchain network into different network shards;
a first determination module configured to determine a second master node in a target network shard where the target node is located; and
a second determination module configured to in response to determining that the second master node is the target node, determine one or more validation nodes used for data validation in the target network shard based on address information and/or a network latency of each of candidate nodes in the target network shard.
16. The system of claim 15, wherein to determine one or more validation nodes used for data validation in the target network shard based on address information and/or a network latency of each candidate node in the target network shard, the second determination module is configured to:
divide the candidate nodes in the target network shard into at least one cluster based on the address information of each of the candidate nodes; and
determine, based on the at least one cluster, the one or more validation nodes used for data validation in the target network shard.
17. The system of claim 16, wherein the address information includes a geographic location, and
to divide the candidate nodes in the target network shard into at least one cluster based on the address information of each of the candidate nodes, the second determination module is configured to:
divide one or more candidate nodes within a same geographic area into a same cluster based on the geographic location of each of the candidate nodes in the target network shard; and
to determine, based on the at least one cluster, the one or more validation nodes used for data validation in the target network shard, the second determination module is configured to:
rank the at least one cluster in a descending order based on a count of candidate nodes in each of the at least one cluster;
if a count of candidate nodes in a cluster with the highest ranking is equal to a preset count, designate the candidate nodes in the cluster with the highest ranking as the one or more validation nodes; and
if the count of candidate nodes in the cluster with the highest ranking is less than the preset count, select the one or more validation nodes from the at least one cluster in turn based on a ranking order of the at least one cluster until a count of selected validation nodes is equal to the preset count.
18. The system of claim 17, wherein the address information includes an Internet Protocol (IP) address, and if the count of candidate nodes in the cluster with the highest ranking is greater than the preset count, the second determination module is further configured to:
determine the one or more validation nodes used for data validation in the target network shard according to a following process including:
dividing one or more candidate nodes within a same network segment into a same sub-cluster based on the IP address of each of the candidate nodes in the cluster with the highest ranking;
ranking at least one sub-cluster in a descending order based on a count of candidate nodes in each of the at least one sub-cluster;
if a count of candidate nodes in a sub-cluster with the highest ranking is equal to the preset count, designating the candidate nodes in the sub-cluster with the highest ranking as the one or more validation nodes; and
if the count of candidate nodes in the sub-cluster with the highest ranking is less than the preset count, selecting the one or more validation nodes from the at least one sub-cluster in turn according to a ranking order of the at least one sub-cluster until a count of selected validation nodes is equal to the preset count.
19. The system of claim 17, wherein the address information includes an Internet Protocol (IP) address, and if the count of candidate nodes in the cluster with the highest ranking is less than the preset count, one or more validation nodes need to be selected from an ith cluster based on the ranking, and the second determination module is further configured to:
if a count of candidate nodes in the ith cluster is greater than a count of the one or more validation nodes to be selected, a value of i being an integer greater than 1 , determine the one or more validation nodes used for data validation in the target network shard according to a following process including:
dividing candidate nodes within a same network segment into a same sub cluster based on the IP address of each of the candidate nodes in the ith cluster; ranking at least one sub-cluster in a descending order based on a count of candidate nodes in each of the at least one sub-cluster;
if a count of candidate nodes in a sub-cluster with the highest ranking is equal to the count of the one or more validation nodes to be selected from the ith cluster, designating the candidate nodes in the sub-cluster with the highest ranking as the one or more validation nodes to be selected from the ith cluster;
and
if the count of candidate nodes in the sub-cluster with the highest ranking is less than the count of the one or more validation nodes to be selected from the ith cluster, selecting one or more validation nodes from the at least one sub cluster in turn according to a ranking order of the at least one sub-cluster until a count of selected validation nodes is equal to the count of the one or more validation nodes to be selected from the ith cluster.
20. The system of claim 18, further comprising:
if a count of candidate nodes in a first target sub-cluster in the cluster with the highest ranking satisfies a second preset condition, the second determination module configured to determine the one or more validation nodes used for data validation in the target network shard according to a following process including:
ranking the candidate nodes in the first target sub-cluster in an ascending order based on a network latency of each of the candidate nodes in the first target sub-cluster; and
selecting one or more validation nodes from the first target sub-cluster in turn based on the ranking until a count of selected validation nodes is equal to a count of one or more candidate nodes to be selected from the first target sub cluster, wherein
the first target sub-cluster is the sub-cluster with the highest ranking or a jth sub-cluster, a value of j being an integer greater than 1 ; and the second preset condition is that the count of candidate nodes in the sub-cluster with the highest ranking is greater than the preset count; or the count of candidate nodes in the sub-cluster with the highest ranking is less than the preset count, one or more validation nodes need to be selected from the jth sub-cluster, and a count of candidate nodes in the jth sub cluster is greater than a count of the one or more validation nodes to be
selected from the jth sub-cluster.
21. The system of claim 19, further comprising:
if a count of candidate nodes in a second target sub-cluster in the ith cluster satisfies a third preset condition, the second determination module configured to determine the one or more validation nodes used for data validation in the target network shard according to a following process including:
ranking the candidate nodes in the second target sub-cluster in an ascending order based on a network latency of each of the candidate nodes in the second target sub-cluster; and
selecting one or more validation nodes from the second target sub-cluster in turn based on the ranking until a count of selected validation nodes is equal to a count of one or more candidate nodes to be selected from the second target sub-cluster, wherein
the second target sub-cluster is the sub-cluster with the highest ranking or a kth sub-cluster, a value of k being an integer greater than 1 ; and the third preset condition is that the count of candidate nodes in the sub-cluster with the highest ranking is greater than the count of one or more validation nodes to be selected from the ith cluster; or the count of candidate nodes in the sub-cluster with the highest ranking is less than the count of one or more validation nodes to be selected from the ith cluster, one or more validation nodes need to be selected from the kth sub-cluster, and a count of candidate nodes in the kth sub-cluster is greater than a count of the one or more validation nodes to be selected from the kth sub cluster.
22. The system of claim 15, wherein the target node determines the network latency of each of the candidate nodes in the target network shard according to a following
process including:
for each of the candidate nodes in the target network shard,
sending an echo request to the candidate node in the target network shard; receiving an echo reply from the candidate node;
determining the network latency of the candidate node based on a time difference between a time point at which the echo request is sent to the candidate node and a time point at which the echo node reply is received from the candidate node.
23. The system of claim 15, wherein to determine a first master node in the blockchain network, the sharding module is configured to:
if a first random value corresponding to the target node and first random values corresponding to other candidate nodes satisfy a preset size relationship, determine that the first master node is the target node.
24. The system of claim 23, wherein the preset size relationship includes one of: the first random values corresponding to other candidate nodes being greater than the first random value corresponding to the target node; or
the first random values corresponding to other candidate nodes being less than the first random value corresponding to the target node.
25. The system of claim 15, wherein to divide candidate nodes in the blockchain network into different network shards, the sharding module is configured to:
generate a random seed based on a second random value corresponding to the target node and second random values corresponding to other candidate nodes; and divide the candidate nodes into the different network shards based on the random seed.
26. The method of claim 25, wherein to divide the candidate nodes into the different network shards based on the random seed, the sharding module is configured to: for a candidate node with the highest ranking, determine a third random value corresponding to the candidate node with the highest ranking based on the random seed and a preset random function;
for each of remainder candidate nodes other than the candidate node with the highest ranking, generate a third random value corresponding to the candidate node based on a third random value corresponding to a previous candidate node, wherein the third random value matches a serial number of a network shard; and
for each of the candidate nodes, allocate the candidate node to a network shard that matches a third random value corresponding to the candidate node based on the third random value corresponding to the candidate node.
27. The system of claim 15, wherein before determining a first master node in the blockchain network, the system further includes:
an obtaining module configured to for each of the candidate nodes,
obtain a public key and a signature of the candidate node, wherein the signature is associated with encryption information of an IP address that is encrypted based on a private key of the candidate node;
verify the signature of the candidate node based on the public key of the candidate node; and
if the signature of the candidate node is verified,
obtain the IP address of the candidate node from the signature; and obtain, based on the IP address, a geographic location of the candidate node.
28. The system of claim 27, wherein to verify the signature of the candidate node based on the public key of the candidate node, the obtaining module is configured to:
decrypt the signature of the candidate node based on the public key of the candidate node; and
if the signature of the candidate node is decrypted,
resolve the IP address in the signature of the candidate node;
determine whether an IP address of the candidate node when a connection with the candidate node is established is the same as the IP address in the signature; and
in response to a determination that the IP address of the candidate node when the connection with the candidate node is established is the same as the IP address in the signature, determine that the signature of the candidate node is verified.
29. An electronic device, comprising: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine- readable instructions to execute operations of the method for determining network shards in a blockchain network according to any one of claims 1 to 14.
30. A computer-readable storage medium storing a computer program, when executed by a processor, direct the processor to perform the method for determining network shards in a blockchain network according to any one of claims 1 to 14.
31. A system, comprising:
at least one storage device including a set of instructions; and
at least one processor configured to communicate with the at least one storage device, wherein when executing the set of instructions, the at least one processor is configured to cause the system to perform operations including:
obtaining one or more network shards associated with a candidate node set in a blockchain network, each of the one or more network shards including one or more candidate nodes; and
for at least one of the one or more network shards, identifying, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
32. The system of claim 31 , wherein the obtaining the one or more network shards associated with the candidate node set in the blockchain network includes:
determining, by a first node in the candidate node set, the one or more network shards based on a random seed, wherein the first node satisfies a first preset condition.
33. The system of claim 32, wherein the first preset condition includes that a first condition value corresponding to the first node is maximum among first condition values corresponding to candidate nodes in the candidate node set or the first condition value corresponding to the first node is minimum among the first condition values corresponding to the candidate nodes in the candidate node set.
34. The system of claim 32 or claim 33, wherein the random seed is determined based on second condition values corresponding to candidate nodes in the candidate node set.
35. The system of any one of claims 32-34, wherein the determining, by the first node in the candidate node set, the one or more network shards based on the random seed includes:
randomly ranking candidate nodes in the candidate node set;
for each of the candidate nodes in the candidate node set, determining a third condition value corresponding to the candidate node based on the ranking and the random seed; and
determining the one or more network shards based on third condition values corresponding to the candidate nodes in the candidate node set.
36. The system of claim 35, wherein for each of the candidate nodes in the candidate node set, the determining the third condition value corresponding to the candidate node based on the ranking and the random seed includes:
for a candidate node with the highest ranking, determining the third condition value based on the random seed; and
for each of remainder candidate nodes other than the candidate node with the highest ranking in the candidate node set, determining the third condition value corresponding to the candidate node based on a third condition value corresponding to a previous candidate node;
37. The system of any one of claims 31 -36, wherein for at least one of the one or more network shards, the identifying, from the one or more candidate nodes in the network shard, the one or more target nodes based on at least one of the location or the network latency of each of the one or more candidate nodes includes:
dividing the one or more candidate nodes in the network shard into at least one cluster based on the location of each of the one or more candidate nodes; and
determining the one or more target nodes in the network shard based on the at least one cluster.
38. The system of claim 37, wherein the determining the one or more target nodes in the network shard based on the at least one cluster includes:
for each of the at least one cluster, determining a count of candidate nodes in
the cluster;
ranking the at least one cluster in a descending order based on at least one count corresponding to the at least one cluster; and
determining whether a count of candidate nodes in a cluster with the highest ranking is less than a preset count.
39. The system of claim 38, wherein the determining the one or more target nodes in the network shard based on the at least one cluster includes:
in response to a determination that the count of candidate nodes in the cluster with the highest ranking is equal to the preset count, designating the candidate nodes in the cluster with the highest ranking as the one or more target nodes; and in response to a determination that the count of candidate nodes in the cluster with the highest ranking is greater than the preset count,
dividing the candidate nodes in the cluster with the highest ranking into at least one sub-cluster based on an IP address of each of the candidate nodes; for each of the at least one sub-cluster, determining a count of candidate nodes in the sub-cluster;
ranking the at least one sub-cluster in a descending order based on at least one count corresponding to the at least one sub-cluster; and
determining whether a count of candidate nodes in a sub-cluster with the highest ranking is less than the preset count.
40. The system of claim 39, wherein the determining the one or more target nodes in the network shard based on the at least one cluster includes:
in response to a determination that the count of candidate nodes in the sub cluster with the highest ranking is equal to the preset count, designating the candidate nodes in the sub-cluster with the highest ranking as the one or more target
nodes; and
in response to a determination that the count of candidate nodes in the sub cluster with the highest ranking is greater than the preset count,
for each of the candidate nodes in the sub-cluster with the highest ranking, determining a network latency corresponding to the candidate node;
ranking the candidate nodes in the sub-cluster with the highest ranking in an ascending order based on network latencies corresponding to the candidate nodes; and
designating top m candidate nodes based on the ranking as the one or more target nodes, wherein a value of m is equal to the preset count.
41. The system of claim 39 or claim 40, wherein the determining the one or more target nodes in the network shard based on the at least one cluster includes:
in response to a determination that the count of candidate nodes in the sub cluster with the highest ranking is less than the preset count,
identifying a jth sub-cluster from the at least one sub-cluster based on the ranking, wherein a count of candidate nodes from the sub-cluster with the highest ranking to the jth sub-cluster is greater than the preset count and a count of candidate nodes from the sub-cluster with the highest ranking to a (j- 1 )th sub-cluster is less than the preset count;
for each of candidate nodes in the jth sub-cluster, determining a network latency corresponding to the candidate node;
ranking the candidate nodes in the jth sub-cluster in an ascending order based on network latencies corresponding to the candidate nodes; and
designating top n candidate nodes based on the ranking and the candidate nodes from the sub-cluster with the highest ranking to the (j-1 )th sub-cluster as the one or more target nodes, wherein a sum of n and the count of candidate nodes from the sub-cluster with the highest ranking to the (j-1 )th sub-cluster is
equal to the preset count.
42. The system of any one of claims 38-41 , wherein the determining the one or more target nodes in the network shard based on the at least one cluster includes:
in response to a determination that the count of the candidate nodes in the cluster with the highest ranking is less than the preset count,
identifying an ith cluster from the at least one cluster based on the ranking, wherein a count of candidate nodes from the cluster with the highest ranking to the ith cluster is greater than the preset count and a count of candidate nodes from the cluster with the highest ranking to an (i-1 )th cluster is less than the preset count;
dividing candidate nodes in the ith cluster into at least one sub-cluster based on an IP address of each of the candidate nodes;
for each of the at least one sub-cluster, determining a count of candidate nodes in the sub-cluster;
ranking the at least one sub-cluster in a descending order based on at least one count corresponding to the at least one sub-cluster; and
determining whether a count of the candidate nodes in a sub-cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is less than the preset count.
43. The system of claim 42, wherein the determining the one or more target nodes in the network shard based on the at least one cluster includes:
in response to a determination that the count of the candidate nodes in the sub cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is equal to the preset count, designating the candidate nodes in the sub-cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster as the one or more
target nodes; and
in response to a determination that the count of the candidate nodes in the sub cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is greater than the preset count,
determining a network latency corresponding to each of the candidate nodes in the sub-cluster with the highest ranking:
ranking the candidate nodes in the sub-cluster with the highest ranking in an ascending order based on network latencies corresponding to the candidate nodes; and
designating top p candidate nodes based on the ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster as the one or more target nodes, wherein a sum of p and the count of candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is equal to the preset count.
44. The system of claim 42 or claim 43, wherein the determining the one or more target nodes in the network shard based on the at least one cluster includes:
in response to a determination that the count of the candidate nodes in the sub cluster with the highest ranking and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is less than the preset count,
determining a kth sub-cluster in the at least one sub-cluster, wherein a count of candidate nodes from the sub-cluster with the highest ranking to the kth sub-cluster and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is greater than the preset count and a count of candidate nodes from the sub-cluster with the highest ranking to a (k-1 )th sub-cluster and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is less than the preset count;
for each of candidate nodes in the kth sub-cluster, determining a network
latency corresponding to the candidate node;
ranking the candidate nodes in the kth sub-cluster in an ascending order based on network latencies corresponding to the candidate nodes; and
designating top q candidate nodes based on the ranking, the candidate nodes from the sub-cluster with the highest ranking to the (k-1 )th sub-cluster, and the candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster as the one or more target nodes, wherein a sum of q, the count of the candidate nodes from the sub-cluster with the highest ranking to the (k-1 )th sub cluster, and the count of candidate nodes from the cluster with the highest ranking to the (i-1 )th cluster is equal to the preset count.
45. The system of any one of claims 31 -44, wherein for at least one of the one or more network shards, the identifying, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes includes:
ranking the one or more candidate nodes in an ascending order based on the network latency of each of the one or more candidate nodes; and
designating top w candidate nodes based on the ranking as the one or more target nodes in the target network shard, wherein a value of w is equal to the preset count.
46. The system of any one of claims 31 -45, wherein the network latency of each of the one or more candidate nodes is determined according to a process including: sending an echo request to the candidate node at a first time point;
receiving an echo reply from the candidate node at a second time point; and determining the network latency of the candidate node based on a time difference between the first time point and the second time point.
47. The system of any one of claims 31 -46, wherein the location of each of the one or more candidate node is determined according to a process including:
obtaining a public key and a signature of the candidate node, wherein the signature is associated with encrypted address information of the candidate node; and
extracting the location of the candidate node from the encrypted address information by verifying the signature based on the public key.
48. A method implemented on a computing device including at least one processor, at least one storage medium, and a communication platform connected to a network, the method comprising:
obtaining one or more network shards associated with a candidate node set in a blockchain network, each of the one or more network shards including one or more candidate nodes; and
for at least one of the one or more network shards, identifying, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
49. A system, comprising:
an obtaining module configured to obtain one or more network shards
associated with a candidate node set in a blockchain network, each of the one or more network shards including one or more candidate nodes; and
an identification module configured to for at least one of the one or more network shards, identify, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
50. A non-transitory computer readable medium, comprising executable instructions that, when executed by at least one processor, direct the at least one processor to perform a method, the method comprising:
obtaining one or more network shards associated with a candidate node set in a blockchain network, each of the one or more network shards including one or more candidate nodes; and
for at least one of the one or more network shards, identifying, from the one or more candidate nodes in the network shard, one or more target nodes based on at least one of a location or a network latency of each of the one or more candidate nodes.
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910147729.4 | 2019-02-27 | ||
| CN201910147729.4A CN110753026B (en) | 2019-02-27 | 2019-02-27 | Block chain-based fragmentation method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020173287A1 true WO2020173287A1 (en) | 2020-09-03 |
Family
ID=69275704
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/074305 Ceased WO2020173287A1 (en) | 2019-02-27 | 2020-02-05 | Systems and methods for determining network shards in blockchain network |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110753026B (en) |
| WO (1) | WO2020173287A1 (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112260836A (en) * | 2020-09-28 | 2021-01-22 | 电子科技大学 | Method for improving block chain throughput based on fragmentation technology |
| CN112615905A (en) * | 2020-12-03 | 2021-04-06 | 广州智链未来科技有限公司 | Method, device and equipment for scheduling block chain fragments and storage medium |
| US20210406872A1 (en) * | 2020-06-24 | 2021-12-30 | University Of Florida Research Foundation, Inc. | Optimal transactions sharding for scalable blockchain |
| WO2022218033A1 (en) * | 2021-04-13 | 2022-10-20 | 华为技术有限公司 | Data processing method and apparatus |
| CN117499017A (en) * | 2023-12-31 | 2024-02-02 | 湖南天河国云科技有限公司 | Blockchain network transmission methods, systems, storage media and terminal equipment |
Families Citing this family (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110753026B (en) * | 2019-02-27 | 2020-10-30 | 北京嘀嘀无限科技发展有限公司 | Block chain-based fragmentation method and device |
| CN111612466B (en) * | 2020-01-17 | 2022-02-18 | 厦门潭宏信息科技有限公司 | Consensus and resource transmission method, device and storage medium |
| CN111510309B (en) * | 2020-04-08 | 2022-05-10 | 深圳大学 | Blockchain data transmission method, apparatus, device and computer-readable storage medium |
| CN111491020B (en) * | 2020-04-08 | 2021-09-28 | 腾讯科技(深圳)有限公司 | Data processing method, data processing device, computer equipment and storage medium |
| CN111858771A (en) * | 2020-07-30 | 2020-10-30 | 杭州复杂美科技有限公司 | Distributed data storage method, device and storage medium |
| CN112954074B (en) * | 2021-03-29 | 2022-05-06 | 北京三快在线科技有限公司 | Block chain network connection method and device |
| CN113746809B (en) * | 2021-08-12 | 2023-07-07 | 广州分布式软件有限责任公司 | Network node security verification method based on big data and smart city |
| CN113395357B (en) * | 2021-08-16 | 2021-11-12 | 支付宝(杭州)信息技术有限公司 | Method and device for fragmenting block chain system |
| CN114389825B (en) * | 2022-03-24 | 2022-07-08 | 腾讯科技(深圳)有限公司 | Data communication method based on block chain and related device |
| CN115858677B (en) * | 2022-12-13 | 2026-01-09 | 湖南天河国云科技有限公司 | Blockchain dynamic sharding methods, devices, computer equipment, and storage media |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170344580A1 (en) * | 2016-05-27 | 2017-11-30 | Mastercard International Incorporated | Method and system for transferring trust across block chain segments |
| CN107809484A (en) * | 2017-10-30 | 2018-03-16 | 中国联合网络通信集团有限公司 | Block chain exchange information processing method and block chain node |
| CN108847925A (en) * | 2018-06-20 | 2018-11-20 | 深圳大学 | A kind of fragment block chain generation method based on tree |
| WO2018217804A1 (en) * | 2017-05-22 | 2018-11-29 | Visa International Service Association | Network for improved verification speed with tamper resistant data |
| CN110753026A (en) * | 2019-02-27 | 2020-02-04 | 北京嘀嘀无限科技发展有限公司 | Block chain-based fragmentation method and device |
Family Cites Families (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10102265B1 (en) * | 2017-04-12 | 2018-10-16 | Vijay K. Madisetti | Method and system for tuning blockchain scalability for fast and low-cost payment and transaction processing |
| CN107528886B (en) * | 2017-07-25 | 2020-07-31 | 中国科学院计算技术研究所 | Block chain full-network splitting method and system |
| CN107766540A (en) * | 2017-10-31 | 2018-03-06 | 上海分布信息科技有限公司 | A kind of block chain network of subregion and its method for realizing partitioned storage |
| CN107807984A (en) * | 2017-10-31 | 2018-03-16 | 上海分布信息科技有限公司 | A kind of block chain network of subregion and its method for realizing subregion common recognition |
| CN109146447B (en) * | 2018-07-09 | 2022-07-05 | 矩阵元技术(深圳)有限公司 | Transparent block chain slicing method, device and system |
| CN108881488B (en) * | 2018-08-01 | 2020-12-22 | 夸克链科技(深圳)有限公司 | A method and network for blockchain transaction processing based on segmentation |
| CN109086139B (en) * | 2018-08-15 | 2020-10-09 | 昧来网络科技(上海)有限公司 | Dynamic fragmentation method, device and computer storage medium |
| CN109359992A (en) * | 2018-10-09 | 2019-02-19 | 北京彩球世纪科技有限公司 | A kind of novel block chain subregion sliced fashion and device |
-
2019
- 2019-02-27 CN CN201910147729.4A patent/CN110753026B/en active Active
-
2020
- 2020-02-05 WO PCT/CN2020/074305 patent/WO2020173287A1/en not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170344580A1 (en) * | 2016-05-27 | 2017-11-30 | Mastercard International Incorporated | Method and system for transferring trust across block chain segments |
| WO2018217804A1 (en) * | 2017-05-22 | 2018-11-29 | Visa International Service Association | Network for improved verification speed with tamper resistant data |
| CN107809484A (en) * | 2017-10-30 | 2018-03-16 | 中国联合网络通信集团有限公司 | Block chain exchange information processing method and block chain node |
| CN108847925A (en) * | 2018-06-20 | 2018-11-20 | 深圳大学 | A kind of fragment block chain generation method based on tree |
| CN110753026A (en) * | 2019-02-27 | 2020-02-04 | 北京嘀嘀无限科技发展有限公司 | Block chain-based fragmentation method and device |
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20210406872A1 (en) * | 2020-06-24 | 2021-12-30 | University Of Florida Research Foundation, Inc. | Optimal transactions sharding for scalable blockchain |
| US11531982B2 (en) * | 2020-06-24 | 2022-12-20 | University Of Florida Research Foundation, Inc. | Optimal transactions sharding for scalable blockchain |
| CN112260836A (en) * | 2020-09-28 | 2021-01-22 | 电子科技大学 | Method for improving block chain throughput based on fragmentation technology |
| CN112615905A (en) * | 2020-12-03 | 2021-04-06 | 广州智链未来科技有限公司 | Method, device and equipment for scheduling block chain fragments and storage medium |
| CN112615905B (en) * | 2020-12-03 | 2022-09-20 | 广州智链未来科技有限公司 | Method, device and equipment for scheduling block chain fragments and storage medium |
| WO2022218033A1 (en) * | 2021-04-13 | 2022-10-20 | 华为技术有限公司 | Data processing method and apparatus |
| CN117499017A (en) * | 2023-12-31 | 2024-02-02 | 湖南天河国云科技有限公司 | Blockchain network transmission methods, systems, storage media and terminal equipment |
| CN117499017B (en) * | 2023-12-31 | 2024-03-22 | 湖南天河国云科技有限公司 | Block chain network transmission method, system, storage medium and terminal equipment |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110753026B (en) | 2020-10-30 |
| CN110753026A (en) | 2020-02-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020173287A1 (en) | Systems and methods for determining network shards in blockchain network | |
| US12505254B2 (en) | Data processing method and apparatus based on blockchain network, and computer device | |
| AU2019416333B2 (en) | Blockchain management system | |
| CN109493050B (en) | Transfer method based on block chain main chain and parallel multiple sub-chains | |
| US10601911B2 (en) | Partitioning of a blockchain ledger | |
| JP7114629B2 (en) | System and method for parallel verification of blockchain transactions | |
| US10776786B2 (en) | Method for creating, registering, revoking authentication information and server using the same | |
| US11115418B2 (en) | Registration and authorization method device and system | |
| CN109472572B (en) | Contract system based on block chain main chain and parallel multiple sub-chains | |
| JP2024032950A (en) | Blockchain network splitting | |
| Xue et al. | STBC: A novel blockchain-based spectrum trading solution | |
| WO2020253634A1 (en) | Data processing method, system and device | |
| KR20250139331A (en) | Data processing methods, devices, equipment, and storage media based on blockchain keys | |
| JP6920442B2 (en) | Methods and devices for establishing communication between nodes in a blockchain system | |
| CN110149323A (en) | A kind of processing unit with millions TPS contract processing capacity | |
| CN111597567A (en) | Data processing method, data processing device, node equipment and storage medium | |
| CN110910110A (en) | Data processing method and device and computer storage medium | |
| CN111597537A (en) | Block chain network-based certificate issuing method, related equipment and medium | |
| Kale et al. | Sharding: a scalability solutions for blockchain networks | |
| CN108076092A (en) | Web server resources balance method and device | |
| CN110990790B (en) | Data processing method and equipment | |
| US20230351374A1 (en) | System for accelerated distributed ledger and for digital wallet deployment | |
| CN110276693A (en) | Settlement of insurance claim method and system | |
| CN112231415B (en) | Data synchronization method and system of block chain network, electronic device and readable medium | |
| WO2020093609A1 (en) | Block generation method, apparatus and device for blockchain, and non-volatile readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20763492 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20763492 Country of ref document: EP Kind code of ref document: A1 |