# US 2021/0176160 A1 · Method and device for synchronizing node of blockchain

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0176160 A1
- Document ID: US20210176160A1
- Status: Published application
- Kind: A1
- Application number: 16/770,757
- Filed: 2019-01-22
- Published: 2021-06-10
- Earliest claimed: 2018-06-29
- Assignees: Beijing Kingsoft Internet Security Software Co., Ltd.
- Applicants: Beijing Kingsoft Internet Security Software Co., Ltd.
- Inventors: Wenyu Yang; Chunmeng Gao
- Web page: https://patentgrep.com/patent/US20210176160A1

## CPC

- H04L 67/104: Peer-to-peer [P2P] networks
- H04L 45/02: Topology update or discovery
- H04L 45/44: Distributed routing
- H04L 67/1095: Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A method and a device for synchronizing a node of a blockchain includes: acquiring information of a plurality of nodes adjacent to a node to be synchronized, and information of a plurality of nodes adjacent to an XOR node of the node to be synchronized, and determining candidate nodes according to the acquired information of the nodes; selecting a first predefined number of nodes from the candidate nodes as a newly added node; updating, according to information of the newly added node, a routing table of the node to be synchronized, to obtain an updated routing table; and synchronizing, according to the updated routing table, the node to be synchronized.

## Claims

### Claim 1

A method for synchronizing blockchain nodes, comprising:
obtaining information of a plurality of first nodes adjacent to a node to be synchronized, and information of a plurality of second nodes adjacent to an XOR node of the node to be synchronized, and determining candidate nodes according to the information of the plurality of first nodes and the information of the plurality of second nodes, wherein the XOR node of the node to be synchronized refers to a node whose node identifier is an XOR value of a node identifier of the node to be synchronized;
selecting a first predefined number of nodes from the candidate nodes as new nodes;
updating a routing table of the node to be synchronized according to information of the new nodes to obtain an updated routing table; and
synchronizing the node to be synchronized according to the updated routing table.

### Claim 2 (depends on 1)

The method according to claim 1, wherein obtaining the information of the plurality of first nodes adjacent to the node to be synchronized and the information of the plurality of second nodes adjacent to the XOR node of the node to be synchronized, and determining the candidate nodes according to the information of the plurality of first nodes and the information of the plurality of second nodes, comprises:
sending a node search request to each node in the routing table of the node to be synchronized, wherein the node search request comprises: requesting a target node to return information of M first nodes closest to the node to be synchronized to the routing table, and requesting the target node to return information of M second nodes closest to the XOR node of the node to be synchronized to the routing table, where M is a predefined positive integer;
obtaining information returned by each node in the routing table; and
determining the candidate nodes according to the information returned by each node in the routing table.

### Claim 3 (depends on 2)

The method according to claim 2, wherein sending the node search request to each node in the routing table of the node to be synchronized, comprises:
starting to time after sending the node search request; and
in response to that a timing result reaches a first predefined time period, stopping sending the node search request.

### Claim 4 (depends on 1)

The method according to claim 1, wherein obtaining the information of the plurality of first nodes adjacent to the node to be synchronized and the information of the plurality of second nodes adjacent to the XOR node of the node to be synchronized, and determining the candidate nodes according to the information of the plurality of first nodes and the information of the plurality of second nodes, comprises:
obtaining information of all nodes from a global routing table containing all nodes of a blockchain system and stored by the node to be synchronized, wherein the global routing table comprises a node identifier, a node internet protocol address and current status information of each node of a blockchain network;
determining information of M first nodes closest to the node to be synchronized among all the nodes, and information of M second nodes closest to the XOR node of the node to be synchronized according to the information of all nodes, where M is a predefined positive integer; and
determining the M first nodes closest to the node to be synchronized and the M second nodes closest to the XOR node of the node to be synchronized as the candidate nodes.

### Claim 5 (depends on 4)

The method according to claim 4, comprising:
updating the global routing table every second predefined time period to obtain latest node information.

### Claim 6 (depends on 1)

The method according to claim 1, wherein selecting the first predefined number of nodes from the candidate nodes as the new nodes, comprises:
according to a total difficulty value of a blockchain stored in each candidate node, selecting the first predefined number of nodes each with a highest total difficulty value as the new nodes.

### Claim 7 (depends on 1)

The method according to claim 1, wherein synchronizing the node to be synchronized according to the updated routing table, comprises:
obtaining a total difficulty value of a blockchain stored in each node of the updated routing table;
determining a node with a highest total difficulty value as a target synchronization node; and
synchronizing blockchain data of the node to be synchronized according to the target synchronization node.

### Claim at position 8

-14. (canceled)

### Claim 15

A non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the processor is caused to implement a method for synchronizing blockchain nodes comprising:
obtaining information of a plurality of first nodes adjacent to a node to be synchronized, and information of a plurality of second nodes adjacent to an XOR node of the node to be synchronized, and determining candidate nodes according to the information of the plurality of first nodes and the information of the plurality of second nodes, wherein the XOR node of the node to be synchronized refers to a node whose node identifier is an XOR value of a node identifier of the node to be synchronized;
selecting a first predefined number of nodes from the candidate nodes as new nodes;
updating a routing table of the node to be synchronized according to information of the new nodes to obtain an updated routing table; and
synchronizing the node to be synchronized according to the updated routing table.

### Claim 16

(canceled)

### Claim 17

A computing device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the program is executed by the processor, the processor is caused to implement a method for synchronizing blockchain nodes comprising:
obtaining information of a plurality of first nodes adjacent to a node to be synchronized, and information of a plurality of second nodes adjacent to an XOR node of the node to be synchronized, and determining candidate nodes according to the information of the plurality of first nodes and the information of the plurality of second nodes, wherein the XOR node of the node to be synchronized refers to a node whose node identifier is an XOR value of a node identifier of the node to be synchronized;
selecting a first predefined number of nodes from the candidate nodes as new nodes;
updating a routing table of the node to be synchronized according to information of the new nodes to obtain an updated routing table; and
synchronizing the node to be synchronized according to the updated routing table.

### Claim 18 (depends on 15)

The non-transitory computer-readable storage medium according to claim 15, wherein obtaining the information of the plurality of first nodes adjacent to the node to be synchronized and the information of the plurality of second nodes adjacent to the XOR node of the node to be synchronized, and determining the candidate nodes according to the information of the plurality of first nodes and the information of the plurality of second nodes, comprises:
sending a node search request to each node in the routing table of the node to be synchronized, wherein the node search request comprises: requesting a target node to return information of M first nodes closest to the node to be synchronized to the routing table, and requesting the target node to return information of M second nodes closest to the XOR node of the node to be synchronized to the routing table, where M is a predefined positive integer;
obtaining information returned by each node in the routing table; and
determining the candidate nodes according to the information returned by each node in the routing table.

### Claim 19 (depends on 18)

The non-transitory computer-readable storage medium according to claim 18, wherein sending the node search request to each node in the routing table of the node to be synchronized, comprises:
starting to time after sending the node search request; and
in response to that a timing result reaches a first predefined time period, stopping sending the node search request.

### Claim 20 (depends on 15)

The non-transitory computer-readable storage medium according to claim 15, wherein obtaining the information of the plurality of first nodes adjacent to the node to be synchronized and the information of the plurality of second nodes adjacent to the XOR node of the node to be synchronized, and determining the candidate nodes according to the information of the plurality of first nodes and the information of the plurality of second nodes, comprises:
obtaining information of all nodes from a global routing table containing all nodes of a blockchain system and stored by the node to be synchronized, wherein the global routing table comprises a node identifier, a node internet protocol address and current status information of each node of a blockchain network;
determining information of M first nodes closest to the node to be synchronized among all the nodes, and information of M second nodes closest to the XOR node of the node to be synchronized according to the information of all nodes, where M is a predefined positive integer; and
determining the M first nodes closest to the node to be synchronized and the M second nodes closest to the XOR node of the node to be synchronized as the candidate nodes.

### Claim 21 (depends on 20)

The non-transitory computer-readable storage medium according to claim 20, the method further comprising:
updating the global routing table every second predefined time period to obtain latest node information.

### Claim 22 (depends on 15)

The non-transitory computer-readable storage medium according to claim 15, wherein selecting the first predefined number of nodes from the candidate nodes as the new nodes, comprises:
according to a total difficulty value of a blockchain stored in each candidate node, selecting the first predefined number of nodes each with a highest total difficulty value as the new nodes.

### Claim 23 (depends on 15)

The non-transitory computer-readable storage medium according to claim 15, wherein synchronizing the node to be synchronized according to the updated routing table, comprises:
obtaining a total difficulty value of a blockchain stored in each node of the updated routing table;
determining a node with a highest total difficulty value as a target synchronization node; and
synchronizing blockchain data of the node to be synchronized according to the target synchronization node.

### Claim 24 (depends on 17)

The computing device according to claim 17, wherein obtaining the information of the plurality of first nodes adjacent to the node to be synchronized and the information of the plurality of second nodes adjacent to the XOR node of the node to be synchronized, and determining the candidate nodes according to the information of the plurality of first nodes and the information of the plurality of second nodes, comprises:
sending a node search request to each node in the routing table of the node to be synchronized, wherein the node search request comprises: requesting a target node to return information of M first nodes closest to the node to be synchronized to the routing table, and requesting the target node to return information of M second nodes closest to the XOR node of the node to be synchronized to the routing table, where M is a predefined positive integer;
obtaining information returned by each node in the routing table; and
determining the candidate nodes according to the information returned by each node in the routing table.

### Claim 25 (depends on 24)

The computing device according to claim 24, wherein sending the node search request to each node in the routing table of the node to be synchronized, comprises:
starting to time after sending the node search request; and
in response to that a timing result reaches a first predefined time period, stopping sending the node search request.

### Claim 26 (depends on 17)

The computing device according to claim 17, wherein obtaining the information of the plurality of first nodes adjacent to the node to be synchronized and the information of the plurality of second nodes adjacent to the XOR node of the node to be synchronized, and determining the candidate nodes according to the information of the plurality of first nodes and the information of the plurality of second nodes, comprises:
obtaining information of all nodes from a global routing table containing all nodes of a blockchain system and stored by the node to be synchronized, wherein the global routing table comprises a node identifier, a node internet protocol address and current status information of each node of a blockchain network;
determining information of M first nodes closest to the node to be synchronized among all the nodes, and information of M second nodes closest to the XOR node of the node to be synchronized according to the information of all nodes, where M is a predefined positive integer; and
determining the M first nodes closest to the node to be synchronized and the M second nodes closest to the XOR node of the node to be synchronized as the candidate nodes.

### Claim 27 (depends on 26)

The computing device according to claim 26, the method further comprising:
updating the global routing table every second predefined time period to obtain latest node information.

### Claim 28 (depends on 17)

The computing device according to claim 17, wherein selecting the first predefined number of nodes from the candidate nodes as the new nodes, comprises:
according to a total difficulty value of a blockchain stored in each candidate node, selecting the first predefined number of nodes each with a highest total difficulty value as the new nodes.

### Claim 29 (depends on 17)

The computing device according to claim 17, wherein synchronizing the node to be synchronized according to the updated routing table, comprises:
obtaining a total difficulty value of a blockchain stored in each node of the updated routing table;
determining a node with a highest total difficulty value as a target synchronization node; and
synchronizing blockchain data of the node to be synchronized according to the target synchronization node.
