A blockchain core network construction method and device
By building a blockchain core network and determining core nodes through centrality algorithms and machine learning algorithms, the problem of low transaction processing efficiency in large blockchain networks is solved, labor costs are reduced and node utilization is improved.
Patent Information
- Application Number
- CN202310610692.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-26
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2043-05-26
AI Technical Summary
In large or ultra-large blockchain networks, the role configuration of blockchain nodes in existing technologies does not distinguish between core nodes, resulting in low transaction processing efficiency and high labor costs.
Through centrality algorithms and machine learning algorithms, the blockchain core network is constructed and core nodes are determined, including obtaining the initial network, generating the test network, iteratively updating the weighted coefficients, screening and updating the core nodes, and optimizing node utilization.
It reduces labor costs, improves transaction processing efficiency, and reduces network maintenance and upgrade costs.
Smart Images

Figure CN116668452B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, particularly to the field of artificial intelligence technology, and more particularly to a method and device for constructing a blockchain core network. Background Art
[0002] In the decentralized internet (web3.0) running on blockchain technology, communication nodes are numerous, and their configurations vary widely. Consortium blockchains are generally used in small networks. In related technologies, blockchain nodes are manually assigned their role-related configurations before deployment. Blockchain nodes are essentially equal, with no ability to distinguish between core nodes. However, if these technologies are applied to large or ultra-large web3.0 networks, all nodes will continue to assume equal roles and execute all blockchain transactions within the network. This significantly increases labor costs, reduces node utilization, and leads to inefficient transaction processing. Summary of the Invention
[0003] One object of the present invention is to provide a method for constructing a blockchain core network based on a centrality algorithm, identify core nodes, reduce labor costs, and increase node utilization, thereby improving transaction processing efficiency. Another object of the present invention is to provide an apparatus for constructing a blockchain core network. Another object of the present invention is to provide a computer-readable medium. Yet another object of the present invention is to provide a computer device.
[0004] In order to achieve the above objectives, the present invention discloses a method for constructing a blockchain core network, comprising:
[0005] Obtaining an initial blockchain network, where the initial blockchain network includes multiple nodes to be screened and edges connecting the nodes to be screened;
[0006] Generate a blockchain test network based on a plurality of nodes to be screened and the connection edges between the nodes to be screened using a preset initial weighting coefficient. The blockchain test network includes a plurality of core nodes.
[0007] The initial weighting coefficient is iteratively updated through a machine learning algorithm to obtain the target weighting coefficient;
[0008] According to a preset time period and a target weighted coefficient, the blockchain test network is updated to obtain a blockchain core network, which includes multiple updated core nodes.
[0009] Preferably, a blockchain test network is generated based on a plurality of nodes to be screened and the connection edges between the nodes to be screened by using a preset initial weight coefficient, including:
[0010] Generate a comprehensive centrality score for each node to be screened based on the preset initial weighting coefficient and the connection edges between the multiple nodes to be screened;
[0011] Based on the comprehensive centrality score of each node to be screened, a blockchain test network is generated, which includes multiple core nodes.
[0012] Preferably, a comprehensive centrality score of each node to be screened is generated based on a plurality of nodes to be screened and the connecting edges between the nodes to be screened, using a preset initial weighting coefficient, including:
[0013] Through the centrality algorithm, according to the preset time period, based on multiple nodes to be screened and the connecting edges between each node to be screened, the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score of each node to be screened are generated;
[0014] According to the initial weighting coefficient, the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score are weightedly calculated to obtain the comprehensive centrality score of the node to be screened.
[0015] Preferably, a blockchain test network is generated based on the comprehensive centrality score of each node to be screened. The blockchain test network includes multiple core nodes, including:
[0016] Compare the preset centrality score threshold with the comprehensive centrality score of each node to be screened, and screen out the comprehensive centrality scores that are greater than the centrality score threshold;
[0017] The nodes to be screened corresponding to the screened comprehensive centrality scores are determined as core nodes;
[0018] A blockchain test network is constructed based on multiple core nodes and the connection edges between each core node.
[0019] Preferably, the initial weighting coefficient is iteratively updated by a machine learning algorithm to obtain a target weighting coefficient, including:
[0020] The initial weighting coefficient is input into the machine learning algorithm for iterative training until the average transaction processing delay of the blockchain system is less than the preset transaction processing delay threshold, and the target weighting coefficient is output.
[0021] Preferably, according to a preset time period and a target weighted coefficient, the blockchain test network is updated to obtain a blockchain core network, including:
[0022] Through the centrality algorithm, according to the preset time period, based on multiple core nodes in the blockchain test network and the connecting edges between each core node, the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score of each core node are generated;
[0023] According to the target weighting coefficient, the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score are weighted and calculated to obtain the comprehensive centrality score of the core node;
[0024] According to the comprehensive centrality scores of the core nodes, the blockchain test network is updated to obtain the blockchain core network.
[0025] Preferably, the blockchain test network is updated based on the comprehensive centrality scores of the core nodes to obtain a blockchain core network, including:
[0026] From multiple core nodes in the blockchain test network, select those whose comprehensive centrality scores are less than a preset centrality score threshold for a specified number of consecutive preset time periods;
[0027] The core nodes corresponding to the screened comprehensive centrality scores are determined as nodes to be exited;
[0028] The nodes to be exited are filtered from the blockchain test network to obtain the blockchain core network, which includes multiple updated core nodes.
[0029] Preferably, after updating the blockchain test network according to the target weighted coefficient in a preset time period to obtain the blockchain core network, the method further includes:
[0030] In response to a new node joining request, the node with a comprehensive centrality score greater than the access threshold is selected based on the comprehensive centrality scores of the core nodes according to the preset access threshold;
[0031] The core nodes corresponding to the screened comprehensive centrality scores are determined as nodes to be connected;
[0032] The nodes to be accessed are sent to the new node, so that the new node can select a node to be accessed.
[0033] The present invention also discloses a blockchain core network construction device, comprising:
[0034] A blockchain initial network acquisition unit is used to acquire a blockchain initial network, where the blockchain initial network includes a plurality of nodes to be screened and connection edges between the nodes to be screened;
[0035] A blockchain test network generation unit, configured to generate a blockchain test network based on a plurality of nodes to be screened and the connection edges between the nodes to be screened using a preset initial weighting coefficient, wherein the blockchain test network includes a plurality of core nodes;
[0036] A weighting coefficient updating unit, configured to iteratively update the initial weighting coefficient through a machine learning algorithm to obtain a target weighting coefficient;
[0037] The blockchain core network generation unit is used to update the blockchain test network according to a preset time period and a target weighted coefficient to obtain a blockchain core network, which includes multiple updated core nodes.
[0038] The present invention also discloses a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.
[0039] The present invention also discloses a computer device, including a memory and a processor, wherein the memory is used to store information including program instructions, the processor is used to control the execution of program instructions, and the processor implements the above method when executing the program.
[0040] The present invention also discloses a computer program product, comprising a computer program / instruction, which implements the above method when the computer program / instruction is executed by a processor.
[0041] The present invention obtains an initial blockchain network, which includes multiple nodes to be screened and connection edges between each node to be screened; generates a blockchain test network based on a preset initial weighting coefficient and the connection edges between the multiple nodes to be screened, and the blockchain test network includes multiple core nodes; iteratively updates the initial weighting coefficient through a machine learning algorithm to obtain a target weighting coefficient; updates the blockchain test network according to the target weighting coefficient according to a preset time period to obtain a blockchain core network, and the blockchain core network includes multiple updated core nodes; constructs a blockchain core network based on a centrality algorithm, determines the core nodes, reduces labor costs, improves node utilization, and thus improves transaction processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1A flowchart of a blockchain core network construction method provided by an embodiment of the present invention;
[0044] Figure 2 A flowchart of another blockchain core network construction method provided by an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of the structure of a blockchain core network construction device provided by an embodiment of the present invention;
[0046] Figure 4 A schematic structural diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0048] It should be noted that the blockchain core network construction method and device disclosed in this application can be used in the field of artificial intelligence technology, and can also be used in any field other than the field of artificial intelligence technology. The application field of the blockchain core network construction method and device disclosed in this application is not limited.
[0049] In order to facilitate the understanding of the technical solution provided by the present application, the relevant contents of the technical solution of the present application are first explained below. The centrality algorithm can be used to identify the role of a specific node in a graph and its impact on the graph network, and can identify the most important nodes, calculate the node credibility, accessibility, transaction propagation speed and the connection between groups. In order to enable the blockchain alliance chain to be applied to large or ultra-large web3 networks, the present invention proposes a blockchain core network construction method based on a centrality algorithm. The underlying communication of the blockchain network combines a variety of centrality algorithms to identify the role of a specific node in the network and its impact on the network. Taking into account the results of a variety of centrality algorithms, a method for calculating comprehensive centrality is proposed, and artificial intelligence (AI) modeling is used to adjust the parameters of the comprehensive centrality calculation model, and the core nodes are located and analyzed, thereby minimizing the average transaction delay of the blockchain network and reducing the cost of network maintenance or upgrades.
[0050] The present invention includes a training phase and an application phase. In the training phase, blockchain nodes calculate the scores of various centrality criteria; based on the scores of various centrality criteria, a comprehensive centrality score is calculated. Blockchain nodes with higher comprehensive centrality scores are core nodes, thereby establishing a blockchain test network. With the help of AI modeling technology, the six weighted coefficients in the comprehensive centrality are periodically iterated and adjusted, so that the blockchain transaction delay reaches the preset target.
[0051] During the application phase, each blockchain node calculates the scores of various centrality criteria and the comprehensive centrality. Blockchain nodes with high scores serve as core nodes to form the blockchain core network and have priority access rights for new nodes to join the network. Blockchain nodes with long-term low scores will be processed to exit the blockchain network.
[0052] The following uses a blockchain core network construction device as an example to illustrate the implementation process of the blockchain core network construction method provided by the embodiment of the present invention. It is understood that the execution subject of the blockchain core network construction method provided by the embodiment of the present invention includes but is not limited to the blockchain core network construction device.
[0053] Figure 1 A flowchart of a method for constructing a blockchain core network provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:
[0054] Step 101: Obtain an initial blockchain network, where the initial blockchain network includes multiple nodes to be screened and connecting edges between the nodes to be screened.
[0055] Step 102: Generate a blockchain test network based on a plurality of nodes to be screened and the connection edges between the nodes to be screened using a preset initial weighting coefficient. The blockchain test network includes a plurality of core nodes.
[0056] Step 103: Iteratively update the initial weighting coefficient through a machine learning algorithm to obtain a target weighting coefficient.
[0057] Step 104: Update the blockchain test network according to the preset time period and the target weight coefficient to obtain a blockchain core network, which includes multiple updated core nodes.
[0058] In the technical solution provided by the embodiment of the present invention, an initial blockchain network is obtained, which includes multiple nodes to be screened and connecting edges between each node to be screened; a blockchain test network is generated based on the multiple nodes to be screened and the connecting edges between each node to be screened through a preset initial weighting coefficient, and the blockchain test network includes multiple core nodes; the initial weighting coefficient is iteratively updated through a machine learning algorithm to obtain a target weighting coefficient; according to a preset time period, the blockchain test network is updated according to the target weighting coefficient to obtain a blockchain core network, which includes multiple updated core nodes; the blockchain core network is constructed based on the centrality algorithm, the core nodes are determined, labor costs are reduced, node utilization is improved, and transaction processing efficiency is improved.
[0059] Figure 2 A flowchart of another method for constructing a blockchain core network provided by an embodiment of the present invention is as follows: Figure 2 As shown, the method includes:
[0060] Step 201: Obtain an initial blockchain network, where the initial blockchain network includes multiple nodes to be screened and connecting edges between the nodes to be screened.
[0061] In the embodiment of the present invention, each step is executed by each node of the blockchain.
[0062] In an embodiment of the present invention, the role configuration of the node to be screened is unknown, and the core node is to be screened out; the connection edges between the nodes to be screened identify the connection relationship between the nodes to be screened. If there is a connection edge between two nodes to be screened, it indicates that there is a connection relationship between the two nodes to be screened.
[0063] Step 202: Generate a comprehensive centrality score for each node to be screened based on a plurality of nodes to be screened and the connecting edges between the nodes to be screened using a preset initial weighting coefficient.
[0064] In the embodiment of the present invention, step 202 specifically includes:
[0065] Step 2021: Generate the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score of each node to be screened based on the centrality algorithm and the connection edges between the nodes to be screened according to the preset time period.
[0066] In the embodiment of the present invention, the preset time period can be set according to actual needs, and the embodiment of the present invention does not limit this.
[0067] In an embodiment of the present invention, a centrality algorithm is used to calculate the centrality index of each node, and the centrality indexes include but are not limited to: degree centrality, closeness centrality, betweenness centrality, eigenvector centrality, K-core centrality and consensus centrality.
[0068] In this embodiment of the present invention, a node to be screened counts the number of connections along its edges over a preset time period, and the counted number of connections serves as the degree centrality score S1. Nodes to be screened whose connection count exceeds a preset connection threshold are considered degree centralities. The connection threshold can be set based on actual needs and is not limited in this embodiment of the present invention.
[0069] In order to prevent nodes from colluding with each other to increase their degree centrality, a weighted degree centrality algorithm can be used to calculate the degree centrality score. Specifically, a weight can be set for each connecting edge to perform a weighted calculation to obtain the degree centrality score, which is not limited in the embodiment of the present invention.
[0070] In this embodiment of the present invention, a node to be screened calculates the reciprocal of the sum of the shortest path lengths between itself and other nodes to be screened in the initial blockchain network over a preset time period. This reciprocal is used as the proximity centrality score S2. A higher S2 indicates a more efficient message transmission for the node to be screened; a lower S2 indicates a lower message transmission efficiency for the node to be screened. After consensus is reached within a blockchain, the expected average number of network hops required for a block to propagate to each node in the network over a period of time is calculated. A higher expected value indicates a more complex blockchain network structure and lower network efficiency; a lower expected value indicates a simpler blockchain network structure and higher network efficiency. If a blockchain uses a multi-node voting consensus algorithm, the consensus leader node typically collects statistics from follower nodes and performs the calculations. The network hop count refers to the number of routes used for communication between two nodes.
[0071] In this embodiment of the present invention, a node to be screened counts the number of shortest paths passing through it over a preset time period; this counted number serves as its betweenness centrality score S3. A higher betweenness centrality score S3 indicates a greater impact on the blockchain's information flow, and a node outage could potentially lead to a general increase in the shortest paths in the blockchain network. A lower betweenness centrality score S3 indicates a lower impact on the blockchain's information flow.
[0072] In this embodiment of the present invention, the node to be screened generates a characteristic vector centrality score S4 for the node to be screened based on the proximity centrality score S2 of its directly adjacent nodes, according to a preset time period. The more direct connections the node to be screened has with high-scoring S2 adjacent nodes, the higher its characteristic vector centrality score S4. Connections with low-scoring S2 adjacent nodes have a smaller impact on the score of the node to be screened. Characteristic vector centrality is primarily based on the consideration of more concentrated core nodes, which is more convenient when human intervention and management are required. Therefore, the blockchain network tends to keep the core nodes calculated as concentrated as possible.
[0073] As an optional solution, the proximity centrality scores S2 of the neighboring nodes of the own node can be accumulated to generate the eigenvector centrality score S4 of the node to be filtered. Alternatively, the proximity centrality scores S2 of the neighboring nodes of the own node can be weighted according to a preset neighboring node weight coefficient to obtain the eigenvector centrality score S4 of the node to be filtered. This embodiment of the present invention is not limited to this.
[0074] In an embodiment of the present invention, the node to be screened determines the average of the proximity centrality scores S2 of all neighboring nodes within K of the node to be screened according to a preset time period as the K-core centrality score S5 of the node to be screened. Among them, all neighboring nodes include directly adjacent neighboring nodes and indirectly adjacent neighboring nodes. K-core centrality considers the influence of directly adjacent neighboring nodes and indirectly adjacent neighboring nodes. The number of directly adjacent neighboring nodes and the proximity centrality score S2 have a greater impact on the current node to be screened, while the influence of indirectly adjacent neighboring nodes is less affected by the attenuation factor.
[0075] It is worth noting that the value of K can be set according to actual needs, and the embodiment of the present invention does not limit this.
[0076] In this embodiment of the present invention, if the blockchain uses a multi-node voting consensus algorithm, the node to be screened counts the total number of blocks produced during the period when it served as the consensus leader node; this total number is used as the consensus centrality score S6. If the blockchain does not use a multi-node voting consensus algorithm, the consensus centrality score S6 is 0. The higher the consensus centrality score S6, the greater the influence of the node to be screened in the blockchain network.
[0077] Step 2022: Based on the initial weighting coefficients, weighted calculations are performed on the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score, and consensus centrality score to obtain a comprehensive centrality score of the node to be screened.
[0078] In this embodiment of the present invention, to prevent excessive or insignificant fluctuations in the value of a centrality criterion, which could lead to an incomplete consideration of the overall centrality calculation result, we introduce a1 through a6 as weighting coefficients for each centrality criterion score. These six weighting coefficients are initialized to obtain initial weighting coefficients. The initial weighting coefficients are set based on actual needs. Different centrality metrics have their own corresponding weighting coefficients, which are not limited in this embodiment of the present invention.
[0079] Specifically, the initial weighting coefficient, degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score, and consensus centrality score are weighted and calculated using S = a1 × S1 + a2 × S2 + a3 × S3 + a4 × S4 + a5 × S5 + a6 × S6 to obtain the comprehensive centrality score. Here, S is the comprehensive centrality score, S1 is the degree centrality score, a1 is the initial weighting coefficient corresponding to the degree centrality indicator, S2 is the closeness centrality score, a2 is the initial weighting coefficient corresponding to the closeness centrality indicator, S3 is the betweenness centrality score, a3 is the initial weighting coefficient corresponding to the betweenness centrality indicator, S4 is the eigenvector centrality score, a4 is the initial weighting coefficient corresponding to the eigenvector centrality indicator, S5 is the K-core centrality score, a5 is the initial weighting coefficient corresponding to the K-core centrality indicator, S6 is the consensus centrality score, and a6 is the initial weighting coefficient corresponding to the consensus centrality indicator.
[0080] Step 203: Generate a blockchain test network based on the comprehensive centrality score of each node to be screened, where the blockchain test network includes multiple core nodes.
[0081] In the embodiment of the present invention, step 203 specifically includes:
[0082] Step 2031: Compare the preset centrality score threshold with the comprehensive centrality score of each node to be screened, and screen out the comprehensive centrality scores that are greater than the centrality score threshold.
[0083] In the embodiment of the present invention, the centrality score threshold is set according to actual needs, and the embodiment of the present invention does not limit this.
[0084] In an embodiment of the present invention, if the comprehensive centrality of the node to be screened is greater than the centrality score threshold, it indicates that the comprehensive centrality score of the node to be screened is high, it has strong comprehensive capabilities, and has a greater influence in the blockchain network; if the comprehensive centrality of the node to be screened is less than or equal to the centrality score threshold, it indicates that the comprehensive centrality score of the node to be screened is low, its comprehensive capabilities are poor, its influence in the blockchain network is small, and it is not suitable to be a core node.
[0085] Step 2032: Determine the nodes to be screened corresponding to the screened comprehensive centrality scores as core nodes.
[0086] In an embodiment of the present invention, if the node to be screened has strong comprehensive capabilities and has a greater influence in the blockchain network, the node to be screened will be determined as a core node.
[0087] Step 2033: Build a blockchain test network based on multiple core nodes and the connection edges between each core node.
[0088] In an embodiment of the present invention, each core node and the connection edges between each core node are screened out from the blockchain initial network to construct a blockchain test network.
[0089] Furthermore, the blockchain test network is applied to actual production, transaction processing is performed through the blockchain test network, and the average delay of blockchain transaction processing over a period of time is calculated.
[0090] Step 204: Iteratively update the initial weighting coefficient through a machine learning algorithm to obtain a target weighting coefficient.
[0091] Specifically, the initial weighting coefficient is input into the machine learning algorithm for iterative training until the average transaction processing delay of the blockchain system is less than the preset transaction processing delay threshold, and the target weighting coefficient is output.
[0092] It is worth noting that the present invention does not limit the selection of a specific machine learning algorithm, which can be selected according to actual conditions; the present invention does not limit the setting of the transaction processing delay threshold, which can be selected according to actual conditions. As an optional solution, the transaction processing delay threshold is 3 seconds.
[0093] The present invention uses AI modeling to autonomously learn the correlation and characteristics between various centrality indicators of each core node in the blockchain test network. During training, the six initial weighting coefficients are continuously adjusted to reduce the average transaction processing delay until the average transaction processing delay of the blockchain system is less than the preset transaction processing delay threshold. That is, the loss function of the AI model is the average transaction processing delay in the blockchain system.
[0094] Step 205: Generate the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score, and consensus centrality score of each core node based on the multiple core nodes and the connection edges between the core nodes in the blockchain test network according to the preset time period through the centrality algorithm.
[0095] In the embodiment of the present invention, the preset time period can be set according to actual needs, and the embodiment of the present invention does not limit this.
[0096] It is worth noting that the calculation method of the core node's degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score is the same as step 2021 and will not be repeated here.
[0097] Step 206: Perform weighted calculation on the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score, and consensus centrality score according to the target weight coefficient to obtain the comprehensive centrality score of the core node.
[0098] Specifically, through S'=a1'×S1+a2'×S2+a3'×S3+a4'×S4+a5'×S5+a6'×S6, the target weight coefficient, degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score are weightedly calculated to obtain the comprehensive centrality score. Among them, S' is the comprehensive centrality score of the core node, S1 is the degree centrality score, a1' is the target weighting coefficient corresponding to the degree centrality indicator, S2 is the closeness centrality score, a2' is the target weighting coefficient corresponding to the closeness centrality indicator, S3 is the betweenness centrality score, a3' is the target weighting coefficient corresponding to the betweenness centrality indicator, S4 is the eigenvector centrality score, a4' is the target weighting coefficient corresponding to the eigenvector centrality indicator, S5 is the K-core centrality score, a5' is the target weighting coefficient corresponding to the K-core centrality indicator, S6 is the consensus centrality score, and a6' is the target weighting coefficient corresponding to the consensus centrality indicator.
[0099] Step 207: Update the blockchain test network based on the comprehensive centrality scores of the core nodes to obtain the blockchain core network.
[0100] In the embodiment of the present invention, step 207 specifically includes:
[0101] Step 2071: Filter out, from multiple core nodes in the blockchain test network, those whose comprehensive centrality scores are less than a preset centrality score threshold for a specified number of consecutive preset time periods.
[0102] In the embodiment of the present invention, the continuous specified number, the preset time period and the centrality score threshold can be set according to actual needs, and the embodiment of the present invention does not limit this.
[0103] In an embodiment of the present invention, if the comprehensive centrality score of a core node is less than the centrality score threshold for a specified number of consecutive preset time periods, it indicates that the comprehensive centrality score of the core node is long-term low, the comprehensive ability of the core node is weak, and the influence in the blockchain network is small, and it is no longer suitable to be a core node. These core nodes with long-term low comprehensive centrality scores are screened out from the blockchain test network.
[0104] Step 2072: Determine the core nodes corresponding to the screened comprehensive centrality scores as nodes to be exited.
[0105] In the embodiment of the present invention, the core nodes screened out are nodes with a long-term low comprehensive centrality score, weak comprehensive capabilities, and less influence in the blockchain network; these nodes are no longer suitable as core nodes; these core nodes are determined to be nodes to be exited.
[0106] Step 2073: Filter the nodes to be exited from the blockchain test network to obtain the blockchain core network, which includes multiple updated core nodes.
[0107] Specifically, the nodes to be delisted and their connections are filtered from the blockchain test network. The resulting network is the blockchain core network, which includes multiple updated core nodes and their connections.
[0108] Step 208: In response to the new node joining request, the preset access threshold is used and, based on the comprehensive centrality scores of the core nodes, the comprehensive centrality scores of the core nodes are screened out.
[0109] In the embodiment of the present invention, the access threshold is set according to actual needs, and the embodiment of the present invention does not limit this.
[0110] In an embodiment of the present invention, when a new node requests to join the blockchain core network, core nodes with a comprehensive centrality score greater than the access threshold are screened out.
[0111] Step 209: Determine the core nodes corresponding to the screened comprehensive centrality scores as nodes to be connected.
[0112] In the embodiment of the present invention, the core nodes whose comprehensive centrality scores are greater than the access threshold are selected and are nodes with strong comprehensive capabilities and greater influence in the blockchain network, and are suitable for receiving access from new nodes.
[0113] Step 210: Send the nodes to be accessed to the new node, so that the new node can select a node to be accessed.
[0114] In an embodiment of the present invention, if the number of nodes to be accessed is 1, the identifier of the node to be accessed and the node information are sent to the new node for the new node to access; if the number of nodes to be accessed is multiple, multiple access node identifiers and node information are sent to the new node for the new node to select a node to be accessed according to the node information.
[0115] It is worth noting that the new node may select a node to be accessed for access according to its own needs, or may randomly select a node to be accessed for access, which is not limited in the embodiment of the present invention.
[0116] The present invention uses blockchain smart contracts to automatically and intelligently locate and analyze the core nodes of the blockchain in the web3.0 network. It can regularly perform targeted maintenance or upgrades on the core nodes, and automatically exit the blockchain nodes that deviate far from the centrality algorithm results through smart contracts, thereby reducing the probability of requiring intervention from operation and maintenance personnel and reducing the number of blockchain node devices that require operation and maintenance.
[0117] The positioning and analysis of core blockchain nodes within the web3.0 network utilizes multiple centrality algorithms. By comprehensively considering the results of these algorithms, a comprehensive centrality calculation method is proposed. AI modeling is then used to adjust the parameters of this comprehensive centrality calculation model, minimizing the average transaction latency of the blockchain network. This allows the identification of core blockchain nodes within the web3 network, and the construction of a core blockchain network based on these multiple core nodes. The centrality node determination logic design incorporates more comprehensive considerations and allows for more intelligent parameter adjustments.
[0118] It is worth noting that the acquisition, storage, use, and processing of data in the technical solutions of this application are in compliance with the relevant provisions of laws and regulations. The user information in the embodiments of this application is obtained through legal and compliant channels, and the acquisition, storage, use, and processing of user information are authorized and agreed by the customer.
[0119] In the technical solution of the blockchain core network construction method provided by the embodiment of the present invention, an initial blockchain network is obtained, and the initial blockchain network includes multiple nodes to be screened and connection edges between each node to be screened; a blockchain test network is generated based on the multiple nodes to be screened and the connection edges between each node to be screened through a preset initial weighting coefficient, and the blockchain test network includes multiple core nodes; the initial weighting coefficient is iteratively updated through a machine learning algorithm to obtain a target weighting coefficient; according to a preset time period, the blockchain test network is updated according to the target weighting coefficient to obtain a blockchain core network, and the blockchain core network includes multiple updated core nodes. The blockchain core network is constructed based on the centrality algorithm, the core nodes are determined, labor costs are reduced, node utilization is improved, and transaction processing efficiency is improved.
[0120] Figure 3A schematic diagram of the structure of a blockchain core network construction device provided by an embodiment of the present invention, which is used to execute the above-mentioned blockchain core network construction method, such as Figure 3 As shown, the device includes: a blockchain initial network acquisition unit 11, a blockchain test network generation unit 12, a weighted coefficient updating unit 13 and a blockchain core network generation unit 14.
[0121] The blockchain initial network acquisition unit 11 is used to acquire the blockchain initial network, which includes multiple nodes to be screened and connection edges between the nodes to be screened.
[0122] The blockchain test network generation unit 12 is used to generate a blockchain test network based on a preset initial weighting coefficient, a plurality of nodes to be screened and the connection edges between each node to be screened, and the blockchain test network includes a plurality of core nodes.
[0123] The weighting coefficient updating unit 13 is used to iteratively update the initial weighting coefficient through a machine learning algorithm to obtain a target weighting coefficient.
[0124] The blockchain core network generation unit 14 is used to update the blockchain test network according to a preset time period and a target weight coefficient to obtain a blockchain core network, which includes multiple updated core nodes.
[0125] In an embodiment of the present invention, the blockchain test network generation unit 12 is specifically used to generate a comprehensive centrality score of each node to be screened based on a preset initial weighting coefficient and the connection edges between multiple nodes to be screened; based on the comprehensive centrality score of each node to be screened, a blockchain test network is generated, and the blockchain test network includes multiple core nodes.
[0126] In an embodiment of the present invention, the blockchain test network generation unit 12 is specifically used to generate the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score of each node to be screened according to a preset time period based on a plurality of nodes to be screened and the connecting edges between each node to be screened through a centrality algorithm; according to the initial weighting coefficient, the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score are weightedly calculated to obtain the comprehensive centrality score of the node to be screened.
[0127] In an embodiment of the present invention, the blockchain test network generation unit 12 is specifically used to compare a preset centrality score threshold with the comprehensive centrality score of each node to be screened, and screen out a comprehensive centrality score greater than the centrality score threshold; determine the node to be screened corresponding to the screened comprehensive centrality score as a core node; and construct a blockchain test network based on multiple core nodes and the connecting edges between each core node.
[0128] In the embodiment of the present invention, the weighting coefficient updating unit 13 is specifically configured to input the initial weighting coefficient into the machine learning algorithm for iterative training until the average transaction processing delay of the blockchain system is less than a preset transaction processing delay threshold, and output a target weighting coefficient.
[0129] In an embodiment of the present invention, the blockchain core network generation unit 14 is specifically used to generate the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score of each core node according to a preset time period based on multiple core nodes in the blockchain test network and the connecting edges between each core node through a centrality algorithm; according to the target weighting coefficient, the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score are weightedly calculated to obtain the comprehensive centrality score of the core node; according to the comprehensive centrality score of the core node, the blockchain test network is updated to obtain the blockchain core network.
[0130] In an embodiment of the present invention, the blockchain core network generation unit 14 is specifically used to screen out, from multiple core nodes in the blockchain test network, comprehensive centrality scores that are less than a preset centrality score threshold for a specified number of consecutive preset time periods; determine the core nodes corresponding to the screened comprehensive centrality scores as nodes to be exited; filter the nodes to be exited from the blockchain test network to obtain a blockchain core network, which includes multiple updated core nodes.
[0131] In the embodiment of the present invention, the device further includes: a screening unit 15 , a determining unit 16 and an accessing unit 17 .
[0132] The screening unit 15 is configured to respond to a new node joining request and, based on a preset access threshold and the comprehensive centrality scores of the core nodes, screen out nodes with comprehensive centrality scores greater than the access threshold.
[0133] The determining unit 16 is configured to determine the core nodes corresponding to the screened comprehensive centrality scores as nodes to be accessed.
[0134] The access unit 17 is used to send the nodes to be accessed to the new node, so that the new node can select a node to be accessed.
[0135] In the solution of the embodiment of the present invention, an initial blockchain network is obtained, which includes multiple nodes to be screened and connecting edges between each node to be screened; a blockchain test network is generated based on the multiple nodes to be screened and the connecting edges between each node to be screened through a preset initial weighting coefficient, and the blockchain test network includes multiple core nodes; the initial weighting coefficient is iteratively updated through a machine learning algorithm to obtain a target weighting coefficient; according to a preset time period, the blockchain test network is updated according to the target weighting coefficient to obtain a blockchain core network, which includes multiple updated core nodes; the blockchain core network is constructed based on the centrality algorithm, the core nodes are determined, labor costs are reduced, node utilization is improved, and transaction processing efficiency is improved.
[0136] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer device. Specifically, the computer device may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0137] An embodiment of the present invention provides a computer device comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions. When the program instructions are loaded and executed by the processor, the steps of the embodiment of the above-mentioned blockchain core network construction method are implemented. For a specific description, please refer to the embodiment of the above-mentioned blockchain core network construction method.
[0138] Reference below Figure 4 , which shows a structural diagram of a computer device 600 suitable for implementing an embodiment of the present application.
[0139] like Figure 4 As shown, the computer device 600 includes a central processing unit (CPU) 601, which can perform various appropriate tasks and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the computer device 600 are also stored in the RAM 603. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0140] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, and the like; an output section 607 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 608 including devices such as a hard disk; and a communication section 609 including a network interface card such as a LAN card or a modem. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. Removable media 611, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 610 as needed, so that computer programs read therefrom can be installed in the storage section 608 as needed.
[0141] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program including program code for executing the methods illustrated in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication portion 609 and / or installed from removable media 611.
[0142] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0143] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0144] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0145] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0146] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0147] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0148] The acquisition, storage, use, and processing of data in this application's technical solution comply with relevant national laws and regulations.
[0149] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0150] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0151] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0152] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A method for constructing a blockchain core network, characterized in that: The method comprises: Obtaining an initial blockchain network, wherein the initial blockchain network includes a plurality of nodes to be screened and connection edges between the nodes to be screened; Generating a comprehensive centrality score for each node to be screened based on the multiple nodes to be screened and the connecting edges between the nodes to be screened using a preset initial weighting coefficient; generating a blockchain test network based on the comprehensive centrality score of each node to be screened, wherein the blockchain test network includes multiple core nodes; Iteratively updating the initial weighting coefficient through a machine learning algorithm to obtain a target weighting coefficient; According to the target weight coefficient, the blockchain test network is updated according to the preset time period to obtain a blockchain core network, wherein the blockchain core network includes a plurality of updated core nodes. Among them, a preset centrality score threshold is compared with the comprehensive centrality score of each node to be screened, and a comprehensive centrality score greater than the centrality score threshold is screened out; the node to be screened corresponding to the screened comprehensive centrality score is determined as the core node; and the blockchain test network is constructed based on the multiple core nodes and the connecting edges between each core node.
2. The method for constructing a blockchain core network according to claim 1, wherein: The method generates a comprehensive centrality score of each node to be screened based on the plurality of nodes to be screened and the connection edges between the nodes to be screened by using a preset initial weighting coefficient, including: Generate a degree centrality score, a closeness centrality score, a betweenness centrality score, a eigenvector centrality score, a K-core centrality score, and a consensus centrality score for each node to be screened based on the multiple nodes to be screened and the connecting edges between the nodes to be screened according to a preset time period through a centrality algorithm; According to the initial weighting coefficient, the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score are weightedly calculated to obtain the comprehensive centrality score of the node to be screened.
3. The method for constructing a blockchain core network according to claim 1, wherein: The iterative updating of the initial weighting coefficient by the machine learning algorithm to obtain the target weighting coefficient includes: The initial weighting coefficient is input into the machine learning algorithm for iterative training until the average transaction processing delay of the blockchain system is less than a preset transaction processing delay threshold, and the target weighting coefficient is output.
4. The method for constructing a blockchain core network according to claim 1, wherein: The updating of the blockchain test network according to the target weighting coefficient in accordance with the preset time period to obtain the blockchain core network includes: Generate, by means of a centrality algorithm, a degree centrality score, a closeness centrality score, a betweenness centrality score, an eigenvector centrality score, a K-core centrality score, and a consensus centrality score for each core node in the blockchain test network based on the multiple core nodes and the connecting edges between the core nodes according to the preset time period; According to the target weighting coefficient, the degree centrality score, closeness centrality score, betweenness centrality score, eigenvector centrality score, K-core centrality score and consensus centrality score are weightedly calculated to obtain the comprehensive centrality score of the core node; The blockchain test network is updated according to the comprehensive centrality scores of the core nodes to obtain a blockchain core network.
5. The method for constructing a blockchain core network according to claim 4, wherein: The blockchain test network is updated according to the comprehensive centrality score of the core node to obtain the blockchain core network, including: Filtering, from a plurality of core nodes in the blockchain test network, the nodes whose comprehensive centrality scores are less than a preset centrality score threshold for a specified number of consecutive preset time periods; The core nodes corresponding to the screened comprehensive centrality scores are determined as nodes to be exited; The nodes to be exited are filtered from the blockchain test network to obtain the blockchain core network, where the blockchain core network includes multiple updated core nodes.
6. The method for constructing a blockchain core network according to claim 5, wherein: After the blockchain test network is updated according to the target weight coefficient in accordance with the preset time period to obtain the blockchain core network, the method further includes: In response to a new node joining request, screening out nodes with a comprehensive centrality score greater than the access threshold according to the comprehensive centrality scores of the core nodes based on a preset access threshold; The core nodes corresponding to the screened comprehensive centrality scores are determined as nodes to be connected; The nodes to be accessed are sent to the new node, so that the new node selects a node to be accessed for access.
7. A blockchain core network construction device, characterized in that: The device comprises: A blockchain initial network acquisition unit, configured to acquire a blockchain initial network, wherein the blockchain initial network includes a plurality of nodes to be screened and connection edges between the nodes to be screened; A blockchain test network generation unit, configured to generate a comprehensive centrality score for each to-be-screened node based on the plurality of to-be-screened nodes and the connection edges between the plurality of to-be-screened nodes using a preset initial weighting coefficient; generate a blockchain test network based on the comprehensive centrality score of each to-be-screened node, the blockchain test network comprising a plurality of core nodes, wherein a preset centrality score threshold is compared with the comprehensive centrality score of each to-be-screened node to screen out a comprehensive centrality score greater than the centrality score threshold; determine the to-be-screened node corresponding to the screened comprehensive centrality score as a core node; and construct the blockchain test network based on the plurality of core nodes and the connection edges between the core nodes; A weighting coefficient updating unit, configured to iteratively update the initial weighting coefficient using a machine learning algorithm to obtain a target weighting coefficient; The blockchain core network generation unit is used to update the blockchain test network according to the target weight coefficient in a preset time period to obtain a blockchain core network, wherein the blockchain core network includes multiple updated core nodes.
8. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the blockchain core network construction method described in any one of claims 1 to 6 is implemented.
9. A computer device comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, characterized in that: When the program instructions are loaded and executed by the processor, the blockchain core network construction method described in any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the blockchain core network construction method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Image voxel and priori brain atlas division fused brain network construction method
CN103077298A
Analysis method for interaction between credible node layers of community network
CN107888422A