A management method, device and electronic device for blockchain nodes

By using the knowledge graph in the alliance chain to determine the target path between nodes, the problems of node management complexity and network latency in the alliance chain are solved, and transaction and consensus efficiency are improved.

CN115034895BActive Publication Date: 2025-05-30CHINA ZHESHANG BANK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210409863.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-19
Publication Date
2025-05-30
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

As the scale of the alliance chain expands, the alliance chain network becomes more complex, and the requirements for node management are improved. The differences in node hardware and networks lead to high network latency, affecting consensus efficiency.

Method used

After the target node receives the transaction data, the target path between the target node and the consensus node is determined according to the knowledge graph corresponding to the target alliance chain, the transaction data is sent to the consensus node through the target node, and the consensus node is synchronized to other nodes after the consensus node completes the consensus.

Benefits of technology

The transaction efficiency and consensus efficiency of nodes in the alliance chain are improved. By optimizing the data propagation path between nodes, network delay is reduced and overall system performance is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115034895B_ABST
    Figure CN115034895B_ABST
Patent Text Reader

Abstract

The present invention discloses a management method, device and electronic device for blockchain nodes, including: after detecting that a target node in a target consortium chain receives transaction data, determining a target path between the target node and each consensus node according to a knowledge graph corresponding to the target consortium chain; sending the transaction data to each consensus node by the target node according to the target path; after each consensus node completes the consensus on the transaction data, synchronizing the transaction data on which the consensus is completed to other nodes in the target consortium chain. The technical solution of the embodiment of the present invention can improve the transaction efficiency and consensus efficiency of nodes in the consortium chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of blockchain technology, and in particular, to a method, apparatus, and electronic device for managing blockchain nodes. Background Art

[0002] Blockchains are divided into public blockchains, private blockchains, consortium blockchains, etc., and have different application scenarios due to different attributes. Among them, a consortium blockchain refers to a blockchain jointly managed by several specific institutions or organizations. A consortium blockchain is a semi-open ledger that is only open to specific organizational groups. Each specific institution or organization runs one or more nodes respectively to jointly complete the ledger tasks, and is widely used in different fields such as finance, banking, trade, and enterprises.

[0003] However, as the scale of the consortium blockchain continues to expand, the consortium blockchain network becomes increasingly complex, and the management requirements for consortium blockchain nodes are getting higher and higher. Moreover, due to differences in the hardware and networks of the respective nodes of the consortium blockchain participants, there may be a relatively high network latency between nodes, resulting in an unsatisfactory consensus efficiency of the consortium blockchain nodes. Summary of the Invention

[0004] Embodiments of the present invention provide a method, apparatus, and electronic device for managing blockchain nodes, which can improve the transaction efficiency and consensus efficiency of nodes in a consortium blockchain.

[0005] In a first aspect, embodiments of the present invention provide a method for managing blockchain nodes, the method comprising:

[0006] After detecting that a target node in a target consortium blockchain receives transaction data, determining a target path between the target node and each consensus node according to a knowledge graph corresponding to the target consortium blockchain;

[0007] Wherein, the knowledge graph pre-stores the association relationships between the nodes in the target consortium blockchain and the weight values of each node in the target consortium blockchain;

[0008] Sending the transaction data to each consensus node through the target node according to the target path;

[0009] After each consensus node completes consensus on the transaction data, synchronizing the transaction data after consensus to other nodes in the target consortium blockchain.

[0010] In a second aspect, embodiments of the present invention further provide a device for managing blockchain nodes, the device comprising:

[0011] A path determination module, configured to determine a target path between the target node and each consensus node according to a knowledge graph corresponding to the target consortium blockchain after detecting that the target node in the target consortium blockchain receives transaction data;

[0012] Among them, the knowledge graph pre-stores the association relationships between the nodes in the target consortium chain and the weight values of the nodes in the target consortium chain;

[0013] A data sending module, configured to send transaction data to each consensus node along the target path through the target node;

[0014] A data synchronization module, configured to synchronize the transaction data after consensus to other nodes in the target consortium chain through each of the consensus nodes after the transaction data is consensus-completed.

[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes:

[0016] One or more processors;

[0017] A storage device, configured to store one or more programs;

[0018] When the one or more programs are executed by the one or more processors, such that the one or more processors execute the programs, the management method of the blockchain node provided in any embodiment of the present invention is implemented.

[0019] The technical solution of the embodiment of the present invention, after detecting that the target node in the target consortium chain receives transaction data, determines the target path between the target node and each consensus node according to the knowledge graph corresponding to the target consortium chain, and sends the transaction data to each consensus node along the target path through the target node. After each of the consensus nodes completes the consensus on the transaction data, the transaction data after consensus is synchronized to other nodes in the target consortium chain. By such technical means, the transaction efficiency and consensus efficiency of the nodes in the consortium chain can be improved.

[0020] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. Description of the Drawings

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0022] Figure 1 is a flowchart of a management method of a blockchain node provided in Embodiment 1 of the present invention;

[0023] Figure 2a It is a flowchart of a method for managing blockchain nodes provided in Embodiment 2 of the present invention;

[0024] Figure 2b It is a schematic diagram of a knowledge graph provided in Embodiment 2 of the present invention;

[0025] Figure 2c It is a schematic diagram of another knowledge graph provided in Embodiment 2 of the present invention;

[0026] Figure 3 It is a flowchart of a method for managing blockchain nodes provided in Embodiment 3 of the present invention;

[0027] Figure 4 It is a flowchart of a method for managing blockchain nodes provided in Embodiment 4 of the present invention;

[0028] Figure 5 It is a schematic structural diagram of a device for managing blockchain nodes provided in Embodiment 4 of the present invention;

[0029] Figure 6 It is a schematic structural diagram of an electronic device for implementing the method for managing blockchain nodes in the embodiments of the present invention. Detailed implementation manners

[0030] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. In addition, it should be noted that for the sake of description, only parts related to the present invention rather than all structures are shown in the accompanying drawings.

[0031] Embodiment 1

[0032] Figure 1 It is a flowchart of a method for managing blockchain nodes provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of managing nodes in a consortium blockchain. The method can be executed by a device for managing blockchain nodes. The device for managing blockchain nodes can be implemented by software and / or hardware, and generally can be integrated in an electronic device with data processing functions. The specific steps are as follows:

[0033] Step 110: After detecting that a target node in a target consortium blockchain receives transaction data, determine a target path between the target node and each consensus node according to the knowledge graph corresponding to the target consortium blockchain; the knowledge graph pre-stores the association relationships between nodes in the target consortium blockchain and the weight values of each node in the target consortium blockchain.

[0034] In this embodiment, the target consortium blockchain may be the consortium blockchain to be managed. The consortium blockchain can be understood as a blockchain jointly operated by multiple institutions or organizations, and each institution or organization manages one or more nodes in the consortium blockchain. After detecting that any node in the target consortium blockchain receives transaction data, the node can be used as the target node, and according to the association relationships stored in the knowledge graph among the nodes, the shortest path between the target node and each consensus node is used as the target path.

[0035] In a specific embodiment, the association relationships among the nodes can be generated in advance in the knowledge graph according to the connection relationships among the nodes. Each node corresponds to a weight value. Specifically, according to the weight values corresponding to the nodes and a preset consensus mechanism, consensus nodes can be elected in the target consortium blockchain. Among them, the consensus mechanism can be a non-mining consensus mechanism, such as PBFT (Practical Byzantine Fault Tolerance) or the Raft algorithm.

[0036] Step 120: Send the transaction data to each consensus node along the target path through the target node.

[0037] In this embodiment, after determining the target path between the target node and each consensus node, the transaction data can be sent to each consensus node along the corresponding target path through the target node, so that each consensus node can perform consensus on this transaction according to the transaction data.

[0038] Step 130: After each consensus node completes the consensus on the transaction data, synchronize the transaction data on which the consensus has been completed to other nodes in the target consortium blockchain.

[0039] In this embodiment, after each consensus node completes the consensus on the transaction data, the transaction data on which the consensus has been completed can be sent to other nodes in the target consortium blockchain except the target node to ensure the consistency of the node data in the target consortium blockchain.

[0040] In this embodiment, by pre-constructing a knowledge graph corresponding to the target consortium blockchain, the association relationships among the nodes in the consortium blockchain can be intuitively obtained through the knowledge graph, and the optimal propagation path between the nodes can be determined according to the association relationships, thereby improving the transaction efficiency and consensus efficiency of the nodes in the consortium blockchain.

[0041] After detecting that a target node in the target alliance chain receives transaction data, the technical solution of the embodiment of the present invention determines a target path between the target node and each consensus node according to the knowledge graph corresponding to the target alliance chain, and sends the transaction data to each consensus node along the target path through the target node. After each consensus node completes the consensus on the transaction data, the transaction data on which the consensus is completed is synchronized to other nodes in the target alliance chain, which can improve the transaction efficiency and consensus efficiency of the nodes in the alliance chain.

[0042] Embodiment 2

[0043] This embodiment is a further refinement of the above embodiment, and the same or corresponding term explanations as those in the above embodiment will not be repeated in this embodiment. Figure 2a The flowchart of a method for managing blockchain nodes provided in this Embodiment 2. In this embodiment, the technical solution of this embodiment can be combined with one or more methods in the solution of the above embodiment, such as Figure 2a As shown, the method provided in this embodiment may further include:

[0044] Step 210: Construct a plurality of entities corresponding to the target alliance chain according to the node information corresponding to each node in the target alliance chain; each entity corresponds to a node in the target alliance chain; the attribute information of each entity is the node information of the corresponding node.

[0045] In this embodiment, optionally, the node information may include the identity document (ID) of the node, hardware configuration information, working performance information, and node status information, etc. The node status information may include the running status information of the node.

[0046] Step 220: Construct an association relationship between each entity according to the connection relationship between each node in the target alliance chain, and use the network latency information between each node as the attribute information of the association relationship.

[0047] In this embodiment, specifically, the network latency information may include the network latency time between nodes.

[0048] Step 230: Construct a knowledge graph corresponding to the target alliance chain according to the plurality of entities, the attribute information corresponding to each entity, the association relationship between each entity, and the attribute information of each association relationship.

[0049] In a specific embodiment, assume that the target consortium blockchain includes nodes A, B, C, D, E, F, G, and H. Among them, node A is respectively connected to nodes B, C, D, E, and F, node D is connected to node H, and node E is connected to node G. Then, according to the above-mentioned multiple nodes and the connection relationships between the nodes, the constructed knowledge graph can be as Figure 2b shown.

[0050] In Figure 2b the corresponding knowledge graph, each entity corresponds to a node in the target consortium blockchain, and the attribute information of each entity is the node information of the corresponding node. The connection line between two entities represents the association relationship between these two entities, and the attribute information of the association relationship can be the network latency information between the corresponding two nodes.

[0051] Step 240: After detecting that the target node in the target consortium blockchain receives transaction data, determine the target path between the target node and each consensus node according to the knowledge graph corresponding to the target consortium blockchain.

[0052] In an implementation manner of the embodiment of the present invention, determining the target path between the target node and each consensus node according to the knowledge graph corresponding to the target consortium blockchain includes:

[0053] Step 241: Determine multiple paths between the target node and the consensus node according to the association relationship between the target node and the consensus node in the knowledge graph;

[0054] In this step, optionally, multiple paths between the target node and the consensus node can be determined according to the connection lines between the entities corresponding to the target node and the consensus node in the knowledge graph.

[0055] Step 242: Calculate the network latency time corresponding to each path according to the attribute information of each association relationship in the knowledge graph;

[0056] In this step, the network latency information between each node on each path can be determined according to the attribute information of the association relationship between the entities on each path in the knowledge graph, and the network latency time corresponding to each path can be calculated according to the network latency information between each node.

[0057] Step 243: Select the path corresponding to the minimum network latency time as the target path between the target node and the consensus node.

[0058] In a specific embodiment, assume that the knowledge graph corresponding to the target consortium blockchain is as Figure 2c shown, where node A is the target node and node B is the consensus node. According to Figure 2cAccording to the corresponding knowledge graph, there are two paths between node A and node B. The first is "node A - node C - node B", and the second is "node A - node D - node B".

[0059] Among them, the network latency between node A and node C is t1, and the network latency between node C and node B is t2. Then, it can be determined that the network latency corresponding to the first path is t1 + t2. Correspondingly, the network latency between node A and node D is t3, and the network latency between node D and node B is t4. Then, it can be determined that the network latency corresponding to the second path is t3 + t4. If (t1 + t2) > (t3 + t4), then the second path can be used as the target path between node A and node B; conversely, if (t1 + t2) < (t3 + t4), then the first path can be used as the target path between node A and node B.

[0060] The advantage of this setting is that through the knowledge graph, the network status between nodes in the consortium chain can be intuitively obtained, and the optimal propagation path between nodes can be quickly determined, thereby improving the transaction efficiency and consensus efficiency of nodes in the consortium chain.

[0061] Step 250: Through the target node, send the transaction data to each consensus node according to the target path.

[0062] Step 260: After each consensus node completes the consensus on the transaction data, synchronize the transaction data after consensus to other nodes in the target consortium chain.

[0063] The technical solution of the embodiment of the present invention can improve the transaction efficiency and consensus efficiency of nodes in the consortium chain by constructing multiple entities corresponding to the target consortium chain according to the node information corresponding to each node in the target consortium chain, constructing the association relationship between each entity according to the connection relationship between each node in the target consortium chain, and using the network latency information between each node as the attribute information of the association relationship, constructing a knowledge graph corresponding to the target consortium chain according to multiple entities, the attribute information corresponding to each entity, the association relationship between each entity, and the attribute information of each association relationship, determining the target path between the target node and each consensus node according to the knowledge graph after detecting that the target node in the target consortium chain receives the transaction data, sending the transaction data to each consensus node according to the target path through the target node, and synchronizing the transaction data after consensus to other nodes in the target consortium chain after each consensus node completes the consensus on the transaction data.

[0064] Embodiment III

[0065] This embodiment is a further refinement of the above embodiment. For the same or corresponding term explanations as the above embodiment, this embodiment will not be repeated.Figure 3 This is a flowchart of a method for managing blockchain nodes provided in the third embodiment. In this embodiment, the technical solution of this embodiment can be combined with one or more methods in the solutions of the above embodiments. For example, Figure 3 As shown, the method provided in this embodiment may further include:

[0066] Step 310: Construct a plurality of entities corresponding to the target consortium chain according to the node information corresponding to each node in the target consortium chain.

[0067] Step 320: Construct the association relationships between the entities according to the connection relationships between the nodes in the target consortium chain, and use the network latency information between the nodes as the attribute information of the association relationships.

[0068] Step 330: Construct a knowledge graph corresponding to the target consortium chain according to the plurality of entities, the attribute information corresponding to each entity, the association relationships between the entities, and the attribute information of each association relationship.

[0069] Step 340: After detecting that a node in the target consortium chain has changed, update the knowledge graph according to the changed node and the connection relationships between the nodes.

[0070] In this embodiment, after detecting that a node in the target consortium chain has changed, the entities in the knowledge graph and the association relationships between the entities can be updated according to the changed node and the connection relationships between the nodes.

[0071] In an implementation manner of the embodiment of the present invention, after detecting that a node in the target consortium chain has changed, updating the knowledge graph according to the changed node and the connection relationships between the nodes includes: if a new node is detected to be added to the target consortium chain, updating the entities in the knowledge graph according to the node information of the new node, and updating the association relationships between the entities in the knowledge graph according to the connection relationships between the new node and other nodes.

[0072] In this embodiment, if a new node is detected to be added to the target consortium chain, a new entity corresponding to the new node can be constructed in the knowledge graph according to the node information of the new node, and the association relationships between the new entity and other entities can be constructed according to the connection relationships between the new node and other nodes.

[0073] In another implementation manner of the embodiment of the present invention, after detecting a change in a node in the target consortium blockchain, the knowledge graph is updated according to the changed node and the connection relationship between each node, including: if it is detected that a node exits the target consortium blockchain, the target entity corresponding to the exited node in the knowledge graph and the association relationship between the target entity and other entities are deleted.

[0074] In this embodiment, if it is detected that a node exits the target consortium blockchain, the node can be used as the exited node, and the target entity corresponding to the exited node in the knowledge graph and the association relationship between the target entity and other entities are deleted.

[0075] The advantage of such a setting is that after the nodes in the consortium blockchain change, by updating the knowledge graph, the management method of each node in the consortium blockchain can be simplified and the management efficiency can be improved.

[0076] Step 350: After detecting a change in the network delay information between nodes in the target consortium blockchain, update the attribute information of the association relationship in the knowledge graph according to the changed network delay information.

[0077] In this embodiment, if the network delay information between two nodes in the target consortium blockchain changes, the attribute information of the association relationship between the entities corresponding to the two nodes can be updated according to the changed network delay information.

[0078] The advantage of such a setting is that the latest network delay information can be ensured to be stored in the knowledge graph, so as to facilitate obtaining an accurate optimal propagation path between nodes.

[0079] Step 360: After detecting that the target node in the target consortium blockchain receives transaction data, determine the target path between the target node and each consensus node according to the knowledge graph corresponding to the target consortium blockchain.

[0080] Step 370: Through the target node, send the transaction data to each consensus node according to the target path.

[0081] Step 380: After each consensus node completes the consensus on the transaction data, synchronize the transaction data on which the consensus is completed to other nodes in the target consortium blockchain.

[0082] In this embodiment, the update process of the knowledge graph can be set before or after the node transaction process, and this embodiment does not limit the specific execution order.

[0083] The technical solution of the embodiment of the present invention constructs multiple entities corresponding to the target consortium chain according to the node information corresponding to each node in the target consortium chain, constructs the association relationship between each entity according to the connection relationship between each node, constructs a knowledge graph according to the multiple entities, the attribute information corresponding to each entity, the association relationship between each entity, and the attribute information of each association relationship. After detecting that a node in the target consortium chain has changed, the knowledge graph is updated according to the changed node and the connection relationship between each node. After detecting that the network delay information between nodes in the target consortium chain has changed, the attribute information of the association relationship is updated according to the changed network delay information. After detecting that a target node in the target consortium chain receives transaction data, the target path between the target node and each consensus node is determined according to the knowledge graph, and the transaction data is sent to each consensus node by the target node according to the target path. After each consensus node completes the consensus on the transaction data, the transaction data on which the consensus is completed is synchronized to other nodes in the target consortium chain. By these technical means, the transaction efficiency and consensus efficiency of nodes in the consortium chain can be improved.

[0084] Based on the above embodiment, the method further includes: assigning corresponding initial weight values to each node according to the node type corresponding to each node in the target consortium chain; updating the initial weight values of each node in real time according to the network delay information and the running status information corresponding to each node; storing the updated weight values corresponding to each node in the knowledge graph corresponding to the target consortium chain.

[0085] In this embodiment, corresponding initial weight values can be assigned to each node according to the node type of each node (such as core nodes, secondary nodes, and query nodes, etc.). For example, the initial weight value of a core node can be set to N, the initial weight value of a secondary node can be set to M, and the initial weight value of a query node can be set to 0.

[0086] After assigning the initial weight values to each node, the weight values of each node can be updated in real time according to the network delay information and the running status information of the node. Specifically, assuming that the standard network delay time corresponding to a core node or a secondary node is K milliseconds, on this basis, if the actual network delay time increases or decreases by T milliseconds each time, the weight value corresponding to the core node or the secondary node will increase or decrease by one accordingly.

[0087] In addition, if the running status of the node is poor (such as too high CPU usage, too much memory occupancy, and insufficient remaining disk capacity, etc.), the weight value of the node will be automatically updated to 0. In this case, the node is not allowed to participate in the consensus until the running status of the node returns to normal.

[0088] The advantage of such a setting is that by updating the weight values of the nodes in real time, the effectiveness of subsequent selection of consensus nodes can be ensured, thereby improving the transaction efficiency and consensus efficiency of the nodes in the consortium blockchain.

[0089] Embodiment 4

[0090] This embodiment is a further refinement of the above embodiments. For the same or corresponding term explanations as in the above embodiments, they will not be repeated in this embodiment. Figure 4 The flowchart of a method for managing blockchain nodes provided in this Embodiment 4. In this embodiment, the technical solution of this embodiment can be combined with one or more methods in the solutions of the above embodiments, such as Figure 4 As shown, the method provided in this embodiment may further include:

[0091] Step 401: Construct a plurality of entities corresponding to the target consortium blockchain according to the node information corresponding to each node in the target consortium blockchain.

[0092] Step 402: Construct the association relationships between the entities according to the connection relationships between the nodes in the target consortium blockchain, and use the network latency information between the nodes as the attribute information of the association relationships.

[0093] Step 403: Construct a knowledge graph corresponding to the target consortium blockchain according to the plurality of entities, the attribute information corresponding to each entity, the association relationships between the entities, and the attribute information of each association relationship.

[0094] Step 404: Elect a plurality of candidate consensus nodes in the target consortium blockchain through a preset consensus mechanism.

[0095] Step 405: Determine the final consensus nodes among the plurality of candidate consensus nodes according to the weight values corresponding to each candidate consensus node and the network latency information between the target node and each candidate consensus node.

[0096] In this embodiment, if the weight value of each candidate consensus node is greater than or equal to 2, the sum of the weight values of all candidate consensus nodes is greater than 50% of the sum of the weight values in the entire target consortium blockchain, and the network latency time between the target node and each candidate consensus node is less than a preset value, then each candidate consensus node is determined as the final consensus node; otherwise, re-elect candidate consensus nodes in the target consortium blockchain until each candidate consensus node meets the above requirements.

[0097] Step 406: After detecting that the target node in the target consortium blockchain receives transaction data, determine the target paths between the target node and each consensus node according to the knowledge graph corresponding to the target consortium blockchain.

[0098] Step 407: Send the transaction data to each consensus node through the target node according to the target path.

[0099] Step 408: During the process of each consensus node completing the consensus on the transaction data, if it is detected that the weight value of the target consensus node does not meet the preset weight condition, a new consensus node is selected according to the knowledge graph.

[0100] In this embodiment, during the process of each consensus node completing the consensus on the transaction data, if a certain consensus node (i.e., the target consensus node) fails, resulting in the weight value of the target consensus node being less than 2, or the sum of the weight values of all consensus nodes being less than or equal to 50% of the sum of the weight values in the entire target consortium chain, then the target consensus node can be removed from the consensus network, and a new consensus node is reselected according to the current weight values corresponding to each node in the knowledge graph.

[0101] Step 409: Send the transaction data to the new consensus node through the target node according to the target path, so that the new consensus node completes the consensus on the transaction data.

[0102] In this step, the new consensus node can be added to the consensus network, and the transaction data is sent to the new consensus node through the target node according to the target path.

[0103] Step 410: After each consensus node completes the consensus on the transaction data, synchronize the transaction data on which the consensus has been completed to other nodes in the target consortium chain.

[0104] In this embodiment, by constructing a knowledge graph corresponding to the target consortium chain through the root, electing multiple candidate consensus nodes in the target consortium chain through a preset consensus mechanism, determining the final consensus node among multiple candidate consensus nodes according to the weight values corresponding to each candidate consensus node and the network latency information between the target node and each candidate consensus node, after detecting that the target node in the target consortium chain receives the transaction data, determining the target path between the target node and each consensus node according to the knowledge graph corresponding to the target consortium chain, sending the transaction data to each consensus node through the target node according to the target path, during the process of each consensus node completing the consensus on the transaction data, if it is detected that the weight value of the target consensus node does not meet the preset weight condition, then a new consensus node is selected according to the knowledge graph, sending the transaction data to the new consensus node through the target node according to the target path, so that the new consensus node completes the consensus on the transaction data, and after each consensus node completes the consensus on the transaction data, synchronizing the transaction data on which the consensus has been completed to other nodes in the target consortium chain, the technical means can ensure the authority of the consensus node and improve the transaction efficiency and consensus efficiency of the nodes in the consortium chain.

[0105] Embodiment Five

[0106] Figure 5 The structural schematic diagram of a management device for a blockchain node provided in Embodiment 5 of the present invention is as follows. As Figure 5 shown, the device includes: a path determination module 510, a data sending module 520, and a data synchronization module 530.

[0107] Among them, the path determination module 510 is configured to, after detecting that a target node in a target consortium chain receives transaction data, determine a target path between the target node and each consensus node according to the knowledge graph corresponding to the target consortium chain; the association relationships between nodes in the target consortium chain and the weight values of each node in the target consortium chain are pre-stored in the knowledge graph;

[0108] The data sending module 520 is configured to send the transaction data to each consensus node along the target path through the target node;

[0109] The data synchronization module 530 is configured to, after each consensus node completes the consensus on the transaction data, synchronize the transaction data after consensus to other nodes in the target consortium chain.

[0110] The technical solution provided in the embodiment of the present invention can improve the transaction efficiency and consensus efficiency of nodes in the consortium chain by detecting that a target node in the target consortium chain receives transaction data, determining a target path between the target node and each consensus node according to the knowledge graph corresponding to the target consortium chain, sending the transaction data to each consensus node along the target path through the target node, and synchronizing the transaction data after consensus to other nodes in the target consortium chain after each consensus node completes the consensus on the transaction data.

[0111] Based on the above embodiment, the management device for the blockchain node further includes:

[0112] An entity construction module, configured to construct a plurality of entities corresponding to the target consortium chain according to the node information corresponding to each node in the target consortium chain; each entity corresponds to a node in the target consortium chain; the attribute information of each entity is the node information of the corresponding node;

[0113] An association relationship construction module, configured to construct the association relationships between the entities according to the connection relationships between the nodes in the target consortium chain, and use the network delay information between the nodes as the attribute information of the association relationships;

[0114] A knowledge graph construction module, configured to construct a knowledge graph corresponding to the target consortium chain according to the plurality of entities, the attribute information corresponding to each entity, the association relationships between the entities, and the attribute information of each association relationship;

[0115] A weight value assignment module, configured to assign corresponding initial weight values to each node according to the node types corresponding to the nodes in the target consortium chain;

[0116] A weight value update module, configured to update the initial weight values of each node in real time according to the network delay information and the running status information corresponding to each node;

[0117] A weight value storage module, configured to store the updated weight values corresponding to each node into the knowledge graph corresponding to the target consortium chain.

[0118] The knowledge graph construction module includes:

[0119] A first knowledge graph update unit, configured to update the knowledge graph according to the changed nodes and the connection relationships between the nodes after detecting that a node in the target consortium chain has changed;

[0120] A new node update unit, configured to, if it is detected that a new node is added to the target consortium chain, update the entities in the knowledge graph according to the node information of the new node, and update the association relationships between the entities in the knowledge graph according to the connection relationships between the new node and other nodes;

[0121] An exited node update unit, configured to, if it is detected that a node exits the target consortium chain, delete the target entity corresponding to the exited node in the knowledge graph and the association relationships between the target entity and other entities;

[0122] A second knowledge graph update unit, configured to update the attribute information of the association relationships in the knowledge graph according to the changed network delay information after detecting that the network delay information between nodes in the target consortium chain has changed.

[0123] The path determination module 510 includes:

[0124] A path determination unit, configured to determine multiple paths between the target node and the consensus node according to the association relationships between the target node and the consensus node in the knowledge graph;

[0125] A time calculation unit, configured to calculate the network delay time corresponding to each path according to the attribute information of each association relationship in the knowledge graph;

[0126] A target path selection unit, configured to select the path corresponding to the minimum network delay time as the target path between the target node and the consensus node.

[0127] The data sending module 520 includes:

[0128] The consensus node selection unit is used to elect multiple candidate consensus nodes in the target consortium blockchain through a preset consensus mechanism;

[0129] The consensus node determination unit is used to determine the final consensus node among multiple candidate consensus nodes according to the weight values corresponding to each candidate consensus node and the network latency information between the target node and each candidate consensus node;

[0130] The consensus node detection unit is used to, during the process of each consensus node completing consensus on transaction data, if it detects that the weight value of the target consensus node does not meet the preset weight condition, select a new consensus node according to the knowledge graph;

[0131] The new consensus node processing unit is used to send the transaction data to the new consensus node through the target node according to the target path, so that the new consensus node completes consensus on the transaction data.

[0132] The above device can execute the methods provided in all the foregoing embodiments of the present invention, and has corresponding functional modules and beneficial effects for executing the above methods. For technical details not described in detail in the embodiments of the present invention, reference may be made to the methods provided in all the foregoing embodiments of the present invention.

[0133] Embodiment Six

[0134] Figure 6 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described herein and / or claimed.

[0135] As Figure 6As shown, the electronic device 10 includes at least one processor 11 and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0136] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0137] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the management method of a blockchain node.

[0138] In some embodiments, the management method of a blockchain node can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the management method of the blockchain node described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the management method of the blockchain node in any other appropriate manner (e.g., by means of firmware).

[0139] The various embodiments of the systems and techniques described above in this specification can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.

[0140] The computer program for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer program can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.

[0141] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0142] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).

[0143] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.

[0144] A computing system can include a client and a server. The client and the server are generally far from each other and typically interact through a communication network. The relationship between the client and the server is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.

[0145] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.

[0146] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for managing blockchain nodes, characterized in that, the method includes: After detecting that a target node in the target consortium chain receives transaction data, according to the knowledge graph corresponding to the target consortium chain, determine the target paths between the target node and each consensus node; Wherein, the knowledge graph pre-stores the association relationships between the nodes in the target consortium chain and the weight values of each node in the target consortium chain; Through the target node, send the transaction data to each consensus node according to the target path; After each consensus node completes the consensus on the transaction data, synchronize the transaction data that has completed the consensus to other nodes in the target consortium chain; Before detecting that a target node in the target consortium chain receives transaction data and determining the target paths between the target node and each consensus node according to the knowledge graph corresponding to the target consortium chain, it further includes: Elect multiple candidate consensus nodes in the target consortium chain through a preset consensus mechanism; According to the weight values corresponding to each candidate consensus node and the network latency information between the target node and each candidate consensus node, determine the final consensus nodes among the multiple candidate consensus nodes.

2. The method according to claim 1, characterized in that, Before detecting that a target node in the target consortium chain receives transaction data and determining the target paths between the target node and each consensus node according to the knowledge graph corresponding to the target consortium chain, it further includes: According to the node information corresponding to each node in the target consortium chain, construct multiple entities corresponding to the target consortium chain; each entity corresponds to a node in the target consortium chain; the attribute information of each entity is the node information of the corresponding node; According to the connection relationships between the nodes in the target consortium chain, construct the association relationships between the entities, and use the network latency information between the nodes as the attribute information of the association relationships; According to the multiple entities, the attribute information corresponding to each entity, the association relationships between the entities, and the attribute information of each association relationship, construct the knowledge graph corresponding to the target consortium chain.

3. The method according to claim 2, characterized in that, the method further includes: According to the node types corresponding to each node in the target consortium chain, assign corresponding initial weight values to each node; According to the network latency information and operating status information corresponding to each node, perform real-time updates on the initial weight values of each node; Store the updated weight values corresponding to each node into the knowledge graph corresponding to the target consortium chain.

4. The method according to claim 2, characterized in that, Determining the target paths between the target node and each consensus node according to the knowledge graph corresponding to the target consortium chain includes: According to the association relationships between the target node and the consensus nodes in the knowledge graph, determine multiple paths between the target node and the consensus nodes; According to the attribute information of each association relationship in the knowledge graph, calculate the network latency time corresponding to each path; Select the path corresponding to the minimum network latency time as the target path between the target node and the consensus nodes.

5. The method according to claim 3, It is characterized in that after sending the transaction data to each consensus node according to the target path through the target node, it further includes: during the process of each consensus node completing the consensus on the transaction data, if it is detected that the weight value of the target consensus node does not meet the preset weight condition, a new consensus node is selected according to the knowledge graph; the transaction data is sent to the new consensus node through the target node according to the target path, so that the new consensus node completes the consensus on the transaction data.

6. The method according to claim 2, it is characterized in that after constructing the knowledge graph corresponding to the target consortium chain, it further includes: after detecting that the node information or the running state in the target consortium chain has changed, the knowledge graph is updated according to the changed nodes and the connection relationship between the nodes.

7. The method according to claim 2, it is characterized in that after constructing the knowledge graph corresponding to the target consortium chain, it further includes: after detecting that the network delay information between the nodes in the target consortium chain has changed, the attribute information of the association relationship in the knowledge graph is updated according to the changed network delay information.

8. A management device for blockchain nodes, it is characterized in that the device includes: a path determination module, configured to determine the target path between the target node and each consensus node according to the knowledge graph corresponding to the target consortium chain after detecting that the target node in the target consortium chain receives the transaction data; wherein, the association relationship between each node in the target consortium chain and the weight value of each node in the target consortium chain are pre-stored in the knowledge graph; a data sending module, configured to send the transaction data to each consensus node through the target node according to the target path; a data synchronization module, configured to synchronize the transaction data that has completed the consensus to other nodes in the target consortium chain after each consensus node completes the consensus on the transaction data; the data sending module includes: a consensus node selection unit, configured to elect a plurality of alternative consensus nodes in the target consortium chain through a preset consensus mechanism; a consensus node determination unit, configured to determine the final consensus node among the plurality of alternative consensus nodes according to the weight value corresponding to each alternative consensus node and the network delay information between the target node and each alternative consensus node.

9. An electronic device, the electronic device includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors execute the programs to implement the management method for blockchain nodes as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Alliance chain management method, system and device based on knowledge graph and storage medium

    CN114095373A