Block chain network view generation method and device, equipment, medium and program product

By determining the legitimacy and connectivity of the associated nodes of the target node, a blockchain network view is constructed, which solves the problem of difficulty in obtaining a global view in traditional methods and achieves faster and more accurate network view construction.

CN121765744APending Publication Date: 2026-03-31HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Traditional methods are insufficient to efficiently and accurately obtain a global view in blockchain P2P networks, especially without disrupting the decentralized network structure.

Method used

By identifying the associated nodes of the target node, including the first and second associated nodes, and determining their legality and connectivity based on the node record information, a target network view is constructed.

Benefits of technology

Without compromising the decentralization of the blockchain, it enables the rapid and accurate acquisition of a global view of the blockchain network, improving the efficiency and accuracy of network view construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121765744A_ABST
    Figure CN121765744A_ABST
Patent Text Reader

Abstract

The invention relates to a block chain network view generation method and device, equipment, a medium and a program product. The method comprises the following steps: determining each associated node of a target node; the association nodes comprise a first association node and a second association node; the first association node and the target node have a direct connection relationship; the second association node and the target node have an indirect connection relationship; determining the legality of each association node according to the node record information corresponding to each association node; for any legal associated node, determining connectivity between the associated node and the target node according to the node record information corresponding to the associated node; the connectivity is used for constructing a target network view of the block chain network to which the target node belongs. By adopting the method, the block chain network view construction efficiency and accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular to a method, apparatus, device, medium, and program product for generating blockchain network views. Background Technology

[0002] With the rapid development of blockchain technology, it has been widely applied in numerous fields due to its unique advantages. Among them, peer-to-peer (P2P) blockchain technology serves as a key support, exhibiting significant decentralized characteristics. In this network architecture, each node has the ability to participate in the network independently, without relying on a centralized server; nodes communicate directly with each other through the P2P protocol. This model greatly enhances the network's resistance to censorship, ensuring its robust operation even in the face of various interferences.

[0003] However, traditional methods struggle to obtain a comprehensive view of blockchain P2P networks, a problem that urgently needs to be addressed. Summary of the Invention

[0004] Therefore, it is necessary to provide a blockchain network view generation method, apparatus, device, medium, and program product that can improve the efficiency and accuracy of blockchain network view construction in response to the above-mentioned technical problems.

[0005] Firstly, this application provides a method for generating a blockchain network view, applicable to any target node in a blockchain network, including:

[0006] Identify all associated nodes of the target node; associated nodes include a first associated node and a second associated node; the first associated node has a direct connection to the target node; the second associated node has an indirect connection to the target node;

[0007] The legitimacy of each associated node is determined based on the node record information corresponding to each associated node.

[0008] For any legitimate associated node, the connectivity between the associated node and the target node is determined based on the node record information corresponding to the associated node; the connectivity is used to construct a target network view of the blockchain network to which the target node belongs.

[0009] In one embodiment, determining the connectivity between the associated node and the target node based on the node record information corresponding to the associated node includes:

[0010] The node record information is parsed to obtain the node connection data of the associated nodes;

[0011] Based on the node connection data, construct the connection address of the associated node and send a node verification request to the connection address;

[0012] Receive the node verification message returned by the associated node in response to the node verification request;

[0013] Based on the node verification message, determine the connectivity between the associated node and the target node.

[0014] In one embodiment, the parsing result of the node record information includes the node's public key data; correspondingly, based on the node verification message, determining the connectivity between the associated node and the target node includes:

[0015] Based on the node's public key data, the signature information in the node verification message is decrypted; the signature information is generated by the associated node based on the node's private key data.

[0016] If decryption is successful, it is determined that the associated node and the target node are connected;

[0017] If decryption fails, it is determined that the associated node and the target node are not connected.

[0018] In one embodiment, determining the associated nodes of the target node includes:

[0019] Retrieve the first associated nodes from the distributed hash table (DHT) stored in the target node;

[0020] Retrieve each second associated node from the DHT stored in each first associated node.

[0021] In one embodiment, retrieving each second associated node from the DHT stored in each first associated node includes:

[0022] Candidate nodes are selected from the DHT stored in each first associated node based on the random parameters generated by the target node; the random parameters are used to indicate the node position.

[0023] Select each second associated node from the candidate nodes; the second associated nodes are not in the initial network view of the blockchain network to which the target node belongs; the initial network view is constructed based on the target node and each first associated node.

[0024] In one embodiment, the target network view is used to deploy servers of the blockchain network to which the target node belongs;

[0025] The server is deployed as follows:

[0026] Determine the node density for different regions based on the location of different nodes in the target network view;

[0027] For any given region, deploy servers for that region based on the corresponding node density.

[0028] Secondly, this application also provides a blockchain network view generation device, deployed on any target node in a blockchain network, comprising:

[0029] The node determination module is used to determine the associated nodes of the target node; the associated nodes include a first associated node and a second associated node; the first associated node has a direct connection relationship with the target node; the second associated node has an indirect connection relationship with the target node;

[0030] The legality determination module is used to determine the legality of each associated node based on the node record information corresponding to each associated node.

[0031] The connectivity determination module is used to determine the connectivity between any legitimate associated node and the target node based on the node record information corresponding to the associated node; the connectivity is used to construct a target network view of the blockchain network to which the target node belongs.

[0032] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0033] Identify all associated nodes of the target node; associated nodes include a first associated node and a second associated node; the first associated node has a direct connection to the target node; the second associated node has an indirect connection to the target node;

[0034] The legitimacy of each associated node is determined based on the node record information corresponding to each associated node.

[0035] For any legitimate associated node, the connectivity between the associated node and the target node is determined based on the node record information corresponding to the associated node; the connectivity is used to construct a target network view of the blockchain network to which the target node belongs.

[0036] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0037] Identify all associated nodes of the target node; associated nodes include a first associated node and a second associated node; the first associated node has a direct connection to the target node; the second associated node has an indirect connection to the target node;

[0038] The legitimacy of each associated node is determined based on the node record information corresponding to each associated node.

[0039] For any legitimate associated node, the connectivity between the associated node and the target node is determined based on the node record information corresponding to the associated node; the connectivity is used to construct a target network view of the blockchain network to which the target node belongs.

[0040] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0041] Identify all associated nodes of the target node; associated nodes include a first associated node and a second associated node; the first associated node has a direct connection to the target node; the second associated node has an indirect connection to the target node;

[0042] The legitimacy of each associated node is determined based on the node record information corresponding to each associated node.

[0043] For any legitimate associated node, the connectivity between the associated node and the target node is determined based on the node record information corresponding to the associated node; the connectivity is used to construct a target network view of the blockchain network to which the target node belongs.

[0044] The aforementioned blockchain network view generation method, apparatus, device, medium, and program products, for any target node, determine its associated nodes; associated nodes include a first associated node and a second associated node; the first associated node has a direct connection to the target node; the second associated node has an indirect connection to the target node; the legitimacy of each associated node is determined based on its corresponding node record information; for any legitimate associated node, the connectivity between the associated node and the target node is determined based on its corresponding node record information; the connectivity is used to construct a target network view of the blockchain network to which the target node belongs. This process can obtain a global view of the blockchain network to which the target node belongs more quickly and accurately without compromising the decentralization of the blockchain; in other words, the above process can improve the efficiency and accuracy of blockchain network view construction. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a flowchart illustrating a blockchain network view generation method in one embodiment;

[0047] Figure 2 This is a flowchart illustrating the connectivity determination step in one embodiment;

[0048] Figure 3This is a flowchart illustrating the steps for determining associated nodes in one embodiment;

[0049] Figure 4 This is a flowchart illustrating a blockchain network view generation method in another embodiment;

[0050] Figure 5 This is a structural block diagram of a blockchain network view generation device in one embodiment;

[0051] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0053] Before describing the embodiments of this application, the terms used in this application will be introduced:

[0054] Distributed Hash Table (DHT): DHT is a distributed storage method that uses hash functions to map data to nodes in a large distributed network. Each node is responsible for maintaining an index of a portion of the data and collaborates to achieve efficient data storage and retrieval.

[0055] Ethereum Node Record (ENR): An ENR typically refers to an entry in a distributed hash table that contains a node's network address and other metadata. In the blockchain field, the ENR is a record used by nodes to identify themselves, containing information such as the node's public key, Internet Protocol Address (IP) address, and port number, used for node discovery and communication in P2P networks.

[0056] Blockchain P2P Network: A P2P network, or peer-to-peer network, is an internet system without a central server, relying on a group of users to exchange information. In blockchain, P2P networks allow nodes to directly interconnect and exchange data, achieving a decentralized network structure.

[0057] Blockchain Nodes: Blockchain nodes are key elements in a blockchain network. Any computer running the relevant blockchain protocol software and connected to the network can become a node. The primary responsibility of a node is to maintain, verify, and update the state of the blockchain. Node types include full nodes, light nodes, mining nodes, and proof-of-stake nodes, each playing different roles in the blockchain network, such as transaction verification, block generation, and network maintenance.

[0058] Before introducing the embodiments of this application, it should be noted that blockchain P2P networks are decentralized, and each node can participate in the network independently without going through a centralized server. Nodes communicate directly with each other through the P2P protocol, which ensures the network's resistance to censorship and its robustness. However, precisely because of the decentralized nature of blockchain P2P networks, it is difficult to obtain a global view of the entire blockchain network through traditional methods. This brings many difficulties to understanding the overall network operation status (number of blockchain nodes, geographical distribution of blockchain nodes) and the degree of decentralization.

[0059] Traditional technologies for determining a blockchain network view fall into two main categories: The first is based on probe nodes: A large number of probe nodes are deployed across different geographical regions to maximize their maximum connection capacity, ensuring sufficient connectivity. The connection status of probe nodes from different regions is then aggregated to create a global view of the blockchain network. The second is based on registration: All blockchain nodes must register with a public contract before joining the network, and when connecting to other nodes, they must verify whether the peer node is registered in the public contract. Both methods either require modifying the underlying blockchain operating logic, increasing network neutrality, or suffer from poor real-time performance, making it difficult to efficiently and accurately obtain a global view of the blockchain P2P network.

[0060] In one exemplary embodiment, such as Figure 1 As shown, a method for generating a blockchain network view is provided, including the following steps:

[0061] S110, determine the associated nodes of the target node.

[0062] The target node can be understood as any node in the blockchain network, and this application does not impose any restrictions on the node type of the target node.

[0063] In some embodiments, the associated nodes include a first associated node and a second associated node; the first associated node has a direct connection with the target node; and the second associated node has an indirect connection with the target node.

[0064] In one alternative implementation, the target node can broadcast a specific message to the blockchain network, which requests other nodes to provide feedback on their connection relationship with the target node; obtain feedback information from each node in the blockchain in response to the specific broadcast message; if the target node can directly receive the feedback information, the node that sent the feedback information is designated as the first associated node; if the target node needs to receive the feedback information through other nodes, the node that sent the feedback information is designated as the second associated node.

[0065] In another alternative implementation, the target node can use each node existing in its own stored DHT as the target node's first associated nodes. Furthermore, the target node can send query messages to each of the first associated nodes, requesting them to provide information about the nodes it is connected to. The node information returned by each of the first associated nodes is integrated and processed, for example, deduplication, to determine the target node's second associated nodes. Furthermore, each of the first associated nodes and each of the second associated nodes are used as the target node's associated nodes.

[0066] S120, determine the legitimacy of each associated node based on the node record information corresponding to each associated node.

[0067] The node record information can be understood as Ethereum Node Record (ENR) information. Node record information includes at least one of the following: node identification information, node connection information, etc. It should be noted that each node in the blockchain has corresponding ENR information, which records the node's public key, IP address, and port number, among other things.

[0068] In one optional implementation, the node record information corresponding to each associated node can be verified according to preset rules, and the legality of each associated node can be determined based on the verification results. For example, nodes whose node record information passes verification are considered legal nodes, and nodes whose node record information fails verification are considered illegal nodes.

[0069] The preset rules can be determined based on human experience, and this application does not impose any restrictions on them.

[0070] In another alternative implementation, the node record information corresponding to each associated node can be decoded based on the decoding method corresponding to the blockchain network, and the legitimacy of each associated node can be determined according to the decoding result. For example, nodes whose node record information can be successfully decoded are regarded as legitimate nodes; nodes whose node record information cannot be successfully decoded are regarded as illegitimate nodes.

[0071] It should be noted that the node record information of different nodes in a blockchain network is encoded in the same way. The encoding method corresponds to the decoding method. Therefore, the target node can decode the node record information of the associated node based on the decoding method corresponding to its own node record information in order to verify whether the associated node is legitimate, that is, to verify whether the associated node belongs to the same blockchain network as the target node.

[0072] S130: For any valid associated node, determine the connectivity between the associated node and the target node based on the node record information corresponding to the associated node.

[0073] Connectivity is used to construct a target network view of the blockchain network to which the target node belongs. The target network view can be understood as a node topology graph in the blockchain network, where any node belongs to the blockchain network to which the target node belongs, and nodes with connections also have connections in the node topology graph.

[0074] In one alternative implementation, the node record information corresponding to the associated node can be input into a pre-trained connectivity determination model to obtain the connectivity between the associated node and the target node.

[0075] In another alternative implementation, the connection address of the associated node can be determined based on the node record information corresponding to the associated node, and a handshake message can be sent to the connection address. Then, based on the feedback result of the handshake message, the connectivity between the associated node and the target node can be determined.

[0076] In one optional implementation, the target network view is used to deploy servers of the blockchain network to which the target node belongs; the server deployment method is as follows: determine the node density corresponding to different regions based on the location of different nodes in the target network view; for any region, deploy servers for the region based on the node density corresponding to the region.

[0077] For example, based on the location of different nodes in the target network view, the deployment area of ​​nodes in the blockchain network and the node density of each area are determined. For areas with high node density, such as the highest area, it is considered that the probability and number of block transactions in that area are relatively high. Such areas are designated as hotspot areas, and more servers are deployed in hotspot areas to support more block transactions.

[0078] In the aforementioned blockchain network view generation method, for any target node, the associated nodes of the target node are determined. These associated nodes include a first associated node and a second associated node. The first associated node has a direct connection to the target node, while the second associated node has an indirect connection. Based on the node record information corresponding to each associated node, the legitimacy of each associated node is determined. For any legitimate associated node, the connectivity between the associated node and the target node is determined based on the node record information corresponding to that associated node. This connectivity is used to construct the target network view of the blockchain network to which the target node belongs. This process can obtain a global view of the blockchain network to which the target node belongs more quickly and accurately without compromising the decentralization of the blockchain. In other words, the above process can improve the efficiency and accuracy of blockchain network view construction.

[0079] Based on the technical solutions of the above embodiments, this application also provides an optional embodiment. In this optional embodiment, the process of determining the connectivity between the associated node and the target node based on the node record information corresponding to the associated node is refined.

[0080] See Figure 2 The connectivity determination steps shown include:

[0081] S210, parse the node record information to obtain the node connection data of the associated nodes.

[0082] The node connection data is used to represent the address information of the corresponding associated nodes, such as IP address, port number, etc.

[0083] For example, in this embodiment, the target node can decode the node record information to obtain the decoded node, and obtain the node connection data of the associated node from the decoding result.

[0084] It should be noted that the node record information of different nodes in a blockchain network is encoded in the same way. The encoding method corresponds to the decoding method. Therefore, the target node can decode the node record information of the associated node based on the decoding method corresponding to its own node record information.

[0085] S220: Based on the node connection data, construct the connection address of the associated node and send a node verification request to the connection address.

[0086] The node verification request is used to request the signature information of the corresponding associated node in order to verify the authenticity of the corresponding associated node.

[0087] For example, in this embodiment, the connection data in the nodes is concatenated based on address concatenation rules to obtain the connection address of the associated node. For instance, the IP address and port number are concatenated based on address concatenation rules to obtain the connection address of the corresponding associated node.

[0088] In one alternative implementation, after constructing the connection address of the associated node, a node verification request can be sent directly to that connection address.

[0089] In another alternative implementation, after constructing the connection address of the associated node, a Transmission Control Protocol (TCP) connection can be attempted with the connection address. If the connection is successful, a handshake can be attempted with the connection address. If the handshake is successful, a node verification request can be sent to the connection address.

[0090] S230, Receive the node verification message returned by the associated node in response to the node verification request.

[0091] Among them, the node verification message is the message returned by the corresponding associated node in response to the node verification request. Under normal circumstances, the node verification message carries the signature information of the corresponding associated node.

[0092] S240, Based on the node verification message, determine the connectivity between the associated node and the target node.

[0093] In one optional implementation, it can be determined whether the node verification message meets the preset requirements. If yes, it is determined that the corresponding associated node and the target node are connected; if no, it is determined that the corresponding associated node and the target node are not connected.

[0094] In another optional implementation, the parsing result of the node record information includes the node's public key data; accordingly, based on the node's public key data, the signature information in the node verification message is decrypted; wherein, the signature information is generated by the associated node based on the node's private key data; if the decryption is successful, it is determined that the associated node and the target node are connected; if the decryption fails, it is determined that the associated node and the target node are not connected.

[0095] It should be noted that when there is a connection between the associated node and the target node, the associated node is added to the initial network view, and the connection relationship between the corresponding associated node and the target node is reflected in the initial network view, such as direct connection or indirect connection. In the case of indirect connection, other nodes between the target node and the corresponding associated node are reflected.

[0096] The above embodiments provide a specific method for determining the connectivity between the associated node and the target node. When the target node can communicate with the associated node, the connectivity between the two is further verified based on the node verification message fed back by the associated node in response to the node verification request, thereby improving the accuracy of connectivity and thus improving the accuracy of the target network view.

[0097] Based on the technical solutions of the above embodiments, this application also provides an optional embodiment. In this optional embodiment, the part about determining each associated node of the target node is refined.

[0098] See Figure 3 The steps for determining associated nodes, as shown, include:

[0099] S310: Obtain each first associated node from the distributed hash table (DHT) stored in the target node.

[0100] The DHT records the ENR information of all nodes that are connected to the target node, and all nodes recorded in the DHT are used as the first associated nodes of the target node.

[0101] In one alternative implementation, a list to be traversed is pre-built to store the associated nodes of the target node. Accordingly, the blockchain node queries its local DHT to obtain the ENR information of all nodes in the DHT (including the node's public key, IP address, port number, etc.), and adds all nodes in the DHT as the first associated nodes to the list to be traversed.

[0102] S320: Obtain each second associated node from the DHT stored in each first associated node.

[0103] In one alternative implementation, candidate nodes are selected from the DHT stored by each first associated node based on random parameters generated by the target node; the random parameters are used to indicate the node position; each second associated node is selected from the candidate nodes; the second associated nodes do not belong to the initial network view of the blockchain network to which the target node belongs; the initial network view is constructed based on the target node and each first associated node.

[0104] Candidate nodes can be all nodes in the DHT stored by the first associated node. The initial network view can include the associated nodes of the identified target node.

[0105] For example, the target node can repeatedly call the FindnodeRandom interface of each first associated node, generating a random parameter each time. Based on this random parameter, the node position is determined, and a preset number of nodes around that position are selected as candidate nodes. This process is repeated until no new candidate nodes are selected. Further, it is determined whether the candidate node exists in the initial network view. If not, the candidate node is selected as the second associated node.

[0106] The above embodiments provide a specific method for determining the associated nodes of the target node, in which all nodes in the blockchain network are traversed.

[0107] Based on the technical solutions of the above embodiments, this application also provides an optional embodiment. In this optional embodiment, the blockchain network view generation method provided by this application is described in detail.

[0108] See Figure 4 The blockchain network view generation method shown includes:

[0109] S401, retrieve each first associated node from the distributed hash table (DHT) stored in the target node;

[0110] S402, Based on the random parameters generated by the target node, select candidate nodes from the DHT stored by each first associated node; the random parameters are used to indicate the node position;

[0111] S403, Select each second associated node from the candidate nodes; the second associated node does not belong to the initial network view of the blockchain network to which the target node belongs;

[0112] The initial network view is constructed based on the target node and each first associated node;

[0113] Among them, the first associated node has a direct connection with the target node; the second associated node has an indirect connection with the target node.

[0114] S404, Determine the legitimacy of each associated node based on the node record information corresponding to each associated node;

[0115] S405: For any valid associated node, parse the node record information to obtain the node connection data of the associated node;

[0116] S406: Based on the node connection data, construct the connection address of the associated node and send a node verification request to the connection address;

[0117] S407, Receive the node verification message returned by the associated node in response to the node verification request;

[0118] S408, based on the node's public key data, decrypts the signature information in the node verification message; the signature information is generated by the associated node based on the node's private key data;

[0119] S409, if decryption is successful, determine that the associated node and the target node are connected;

[0120] S410: In the event of decryption failure, determine that the associated node and the target node are not connected.

[0121] Connectivity is used to construct the target network view of the blockchain network to which the target node belongs; the target network view is used to deploy the servers of the blockchain network to which the target node belongs; the server deployment method is as follows: determine the node density corresponding to different regions based on the location of different nodes in the target network view; for any region, deploy servers for the region based on the node density corresponding to the region.

[0122] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0123] Based on the same inventive concept, this application also provides a blockchain network view generation apparatus for implementing the blockchain network view generation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more embodiments of the blockchain network view generation apparatus provided below can be found in the limitations of the blockchain network view generation method described above, and will not be repeated here.

[0124] In one exemplary embodiment, such as Figure 5 As shown, a blockchain network view generation device is provided, including: a node determination module 510, a legality determination module 520, and a connectivity determination module 530, wherein:

[0125] The node determination module 510 is used to determine each associated node of the target node; the associated nodes include a first associated node and a second associated node; the first associated node has a direct connection relationship with the target node; the second associated node has an indirect connection relationship with the target node;

[0126] The legality determination module 520 is used to determine the legality of each associated node based on the node record information corresponding to each associated node;

[0127] The connectivity determination module 530 is used to determine the connectivity between the associated node and the target node for any legitimate associated node based on the node record information corresponding to the associated node; the connectivity is used to construct a target network view of the blockchain network to which the target node belongs.

[0128] In one embodiment, the connectivity determination module 530 includes a parsing unit for parsing node record information to obtain node connection data of associated nodes; a request sending unit for constructing the connection address of associated nodes based on the node connection data and sending a node verification request to the connection address; a message receiving unit for receiving a node verification message fed back by the associated nodes in response to the node verification request; and a first determination unit for determining the connectivity between the associated nodes and the target node based on the node verification message.

[0129] In one embodiment, the parsing result of the node record information includes the node's public key data; correspondingly, the first determining unit includes a decryption subunit, used to decrypt the signature information in the node verification message based on the node's public key data; the signature information is generated by the associated node based on the node's private key data; the first determining subunit is used to determine that the associated node and the target node are connected if the decryption is successful; the second determining subunit is used to determine that the associated node and the target node are not connected if the decryption fails.

[0130] In one embodiment, the node determination module 510 includes a first acquisition unit for acquiring each first associated node from the distributed hash table (DHT) stored by the target node; and a second acquisition unit for acquiring each second associated node from the DHT stored by each first associated node.

[0131] In one embodiment, the second acquisition unit includes a first selection subunit, used to select candidate nodes from the DHT stored by each first associated node according to random parameters generated by the target node; the random parameters are used to indicate the node position; the second selection subunit is used to select each second associated node from the candidate nodes; the second associated nodes do not belong to the initial network view of the blockchain network to which the target node belongs; the initial network view is constructed based on the target node and each first associated node.

[0132] In one embodiment, the target network view is used to deploy servers for the blockchain network to which the target node belongs; the server deployment method is as follows: determine the node density corresponding to different regions based on the location of different nodes in the target network view; for any region, deploy servers for the region based on the node density corresponding to the region.

[0133] Each module in the aforementioned blockchain network view generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0134] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a blockchain network view generation method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0135] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0136] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0137] Identify all associated nodes of the target node; associated nodes include a first associated node and a second associated node; the first associated node has a direct connection to the target node; the second associated node has an indirect connection to the target node;

[0138] The legitimacy of each associated node is determined based on the node record information corresponding to each associated node.

[0139] For any legitimate associated node, the connectivity between the associated node and the target node is determined based on the node record information corresponding to the associated node; the connectivity is used to construct a target network view of the blockchain network to which the target node belongs.

[0140] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0141] The node record information is parsed to obtain the node connection data of the associated nodes;

[0142] Based on the node connection data, construct the connection address of the associated node and send a node verification request to the connection address;

[0143] Receive the node verification message returned by the associated node in response to the node verification request;

[0144] Based on the node verification message, determine the connectivity between the associated node and the target node.

[0145] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0146] Based on the node's public key data, the signature information in the node verification message is decrypted; the signature information is generated by the associated node based on the node's private key data.

[0147] If decryption is successful, it is determined that the associated node and the target node are connected;

[0148] If decryption fails, it is determined that the associated node and the target node are not connected.

[0149] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0150] Retrieve the first associated nodes from the distributed hash table (DHT) stored in the target node;

[0151] Retrieve each second associated node from the DHT stored in each first associated node.

[0152] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0153] Candidate nodes are selected from the DHT stored in each first associated node based on the random parameters generated by the target node; the random parameters are used to indicate the node position.

[0154] Select each second associated node from the candidate nodes; the second associated nodes are not in the initial network view of the blockchain network to which the target node belongs; the initial network view is constructed based on the target node and each first associated node.

[0155] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0156] The server is deployed as follows:

[0157] Determine the node density for different regions based on the location of different nodes in the target network view;

[0158] For any given region, deploy servers for that region based on the corresponding node density.

[0159] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0160] Identify all associated nodes of the target node; associated nodes include a first associated node and a second associated node; the first associated node has a direct connection to the target node; the second associated node has an indirect connection to the target node;

[0161] The legitimacy of each associated node is determined based on the node record information corresponding to each associated node.

[0162] For any legitimate associated node, the connectivity between the associated node and the target node is determined based on the node record information corresponding to the associated node; the connectivity is used to construct a target network view of the blockchain network to which the target node belongs.

[0163] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0164] The node record information is parsed to obtain the node connection data of the associated nodes;

[0165] Based on the node connection data, construct the connection address of the associated node and send a node verification request to the connection address;

[0166] Receive the node verification message returned by the associated node in response to the node verification request;

[0167] Based on the node verification message, determine the connectivity between the associated node and the target node.

[0168] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0169] Based on the node's public key data, the signature information in the node verification message is decrypted; the signature information is generated by the associated node based on the node's private key data.

[0170] If decryption is successful, it is determined that the associated node and the target node are connected;

[0171] If decryption fails, it is determined that the associated node and the target node are not connected.

[0172] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0173] Retrieve the first associated nodes from the distributed hash table (DHT) stored in the target node;

[0174] Retrieve each second associated node from the DHT stored in each first associated node.

[0175] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0176] Candidate nodes are selected from the DHT stored in each first associated node based on the random parameters generated by the target node; the random parameters are used to indicate the node position.

[0177] Select each second associated node from the candidate nodes; the second associated nodes are not in the initial network view of the blockchain network to which the target node belongs; the initial network view is constructed based on the target node and each first associated node.

[0178] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0179] The server is deployed as follows:

[0180] Determine the node density for different regions based on the location of different nodes in the target network view;

[0181] For any given region, deploy servers for that region based on the corresponding node density.

[0182] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0183] Identify all associated nodes of the target node; associated nodes include a first associated node and a second associated node; the first associated node has a direct connection to the target node; the second associated node has an indirect connection to the target node;

[0184] The legitimacy of each associated node is determined based on the node record information corresponding to each associated node.

[0185] For any legitimate associated node, the connectivity between the associated node and the target node is determined based on the node record information corresponding to the associated node; the connectivity is used to construct a target network view of the blockchain network to which the target node belongs.

[0186] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0187] The node record information is parsed to obtain the node connection data of the associated nodes;

[0188] Based on the node connection data, construct the connection address of the associated node and send a node verification request to the connection address;

[0189] Receive the node verification message returned by the associated node in response to the node verification request;

[0190] Based on the node verification message, determine the connectivity between the associated node and the target node.

[0191] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0192] Based on the node's public key data, the signature information in the node verification message is decrypted; the signature information is generated by the associated node based on the node's private key data.

[0193] If decryption is successful, it is determined that the associated node and the target node are connected;

[0194] If decryption fails, it is determined that the associated node and the target node are not connected.

[0195] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0196] Retrieve the first associated nodes from the distributed hash table (DHT) stored in the target node;

[0197] Retrieve each second associated node from the DHT stored in each first associated node.

[0198] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0199] Candidate nodes are selected from the DHT stored in each first associated node based on the random parameters generated by the target node; the random parameters are used to indicate the node position.

[0200] Select each second associated node from the candidate nodes; the second associated nodes are not in the initial network view of the blockchain network to which the target node belongs; the initial network view is constructed based on the target node and each first associated node.

[0201] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0202] The server is deployed as follows:

[0203] Determine the node density for different regions based on the location of different nodes in the target network view;

[0204] For any given region, deploy servers for that region based on the corresponding node density.

[0205] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0206] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0207] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0208] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for generating a blockchain network view, characterized in that, The method, applied to any target node in a blockchain network, includes: Identify the associated nodes of the target node; the associated nodes include a first associated node and a second associated node; the first associated node has a direct connection with the target node; the second associated node has an indirect connection with the target node. The legitimacy of each associated node is determined based on the node record information corresponding to each associated node; For any of the legitimate associated nodes, the connectivity between the associated node and the target node is determined based on the node record information corresponding to the associated node; the connectivity is used to construct a target network view of the blockchain network to which the target node belongs.

2. The method according to claim 1, characterized in that, The step of determining the connectivity between the associated node and the target node based on the node record information corresponding to the associated node includes: The node record information is parsed to obtain the node connection data of the associated nodes; Based on the node connection data, construct the connection address of the associated node, and send a node verification request to the connection address; Receive the node verification message returned by the associated node in response to the node verification request; Based on the node verification message, the connectivity between the associated node and the target node is determined.

3. The method according to claim 2, characterized in that, The parsing result of the node record information includes the node public key data; correspondingly, determining the connectivity between the associated node and the target node based on the node verification message includes: Based on the node public key data, the signature information in the node verification message is decrypted; the signature information is generated by the associated node based on the node private key data. If decryption is successful, it is determined that the associated node is connected to the target node; If decryption fails, it is determined that the associated node and the target node are not connected.

4. The method according to any one of claims 1-3, characterized in that, The process of determining the associated nodes of the target node includes: Obtain each first associated node from the distributed hash table (DHT) stored in the target node; Obtain each second associated node from the DHT stored in each of the first associated nodes.

5. The method according to claim 4, characterized in that, The step of obtaining each second associated node from the DHT stored in each of the first associated nodes includes: Candidate nodes are selected from the DHT stored in each of the first associated nodes based on the random parameters generated by the target node; the random parameters are used to indicate the node position. Each second associated node is selected from the candidate nodes; the second associated node does not belong to the initial network view of the blockchain network to which the target node belongs; the initial network view is constructed based on the target node and each of the first associated nodes.

6. The method according to any one of claims 1-3, characterized in that, The target network view is used to deploy servers in the blockchain network to which the target node belongs; The server is deployed as follows: Based on the location of different nodes in the target network view, determine the node density corresponding to different regions; For any given region, servers are deployed for that region based on the corresponding node density.

7. A blockchain network view generation device, characterized in that, The device, deployed on any target node in a blockchain network, includes: A node determination module is used to determine each associated node of the target node; the associated nodes include a first associated node and a second associated node; the first associated node has a direct connection relationship with the target node; the second associated node has an indirect connection relationship with the target node; The legality determination module is used to determine the legality of each associated node based on the node record information corresponding to each associated node; The connectivity determination module is used to determine the connectivity between the associated node and the target node for any legitimate associated node, based on the node record information corresponding to the associated node; the connectivity is used to construct a target network view of the blockchain network to which the target node belongs.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-6.