A resource query method, system and electronic device for a block node
By building a routing planning model and dividing information management node domains, the query efficiency problems caused by the large number of block nodes and changes in the blockchain network are solved, and fast and stable information resource query is achieved, reducing the computing cost and routing update frequency.
Patent Information
- Application Number
- CN202211526153.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-01
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-12-01
AI Technical Summary
The large number of block nodes and changes in the blockchain network lead to low efficiency in querying information resources, and frequent updates of query routes have caused unstable storage of information resources and increased operation costs.
By building a routing planning model, the query route of the central block node is determined, the information management node domain is divided, and the central block node is used as the entrance and exit nodes to build a query route from the information query root node to other central block nodes, and match the query route to quickly locate the target information resources.
It improves the speed and stability of information query, reduces the operation cost, enhances the convenience of block node joining, and reduces the frequent update of query routes.
Smart Images

Figure CN115766741B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blockchain, and in particular to a method, a system, and an electronic device for querying resources of block nodes. Background Art
[0002] With the rapid development of information technology, the amount of data information in each platform is increasing day by day, and how to manage the data in each platform (including querying information resources) has become an urgent problem to be solved.
[0003] In the prior art, a blockchain network stores the information resources uploaded in each platform in each block node in the blockchain. When a certain information resource (target information resource) needs to be used subsequently, it can be searched from the blockchain. However, due to the large number of block nodes in the blockchain and the changes of block nodes, the efficiency of querying information resources from the blockchain is too low.
[0004] Therefore, a method, a system, and an electronic device for querying resources of block nodes are proposed. Summary of the Invention
[0005] This specification provides a method, a system, and an electronic device for querying resources of block nodes. By matching the query route associated with the central block node through the routing planning model, the target block node is found, and the target information resource corresponding to the information query condition on the target block node is obtained, so as to improve the retrieval speed of information query.
[0006] A method for querying resources of block nodes provided by the present application adopts the following technical solutions, including:
[0007] In response to the information query condition received by the central block node, match the query route associated with the central block node through the routing planning model, and the information query condition corresponds to the target information resource one by one;
[0008] Find the target block node according to the query route, and obtain the target information resource on the target block node.
[0009] Optionally, it further includes: constructing a routing planning model;
[0010] The constructing of the routing planning model includes:
[0011] Obtain the original node sequence;
[0012] Take the first central block node in the original node sequence as the information query root node, and determine the upper and lower position relationships between the central block nodes according to the preset interval and the preset number of hops;
[0013] Construct a query route from the information query root node to all other central block nodes based on the above-mentioned upper and lower relationships.
[0014] Optionally, it further includes:
[0015] Divide all block nodes into multiple information management node domains, and determine the central block nodes and general block nodes in the information management node domains.
[0016] Optionally, it further includes:
[0017] When the general block node receives the information query condition sent by the user, forward the information query condition to the central block node in the same information management node domain.
[0018] Optionally, it further includes:
[0019] When a block node joins or exits, conduct a voting consensus on the block node, update the information resources stored on the central block node, and update the routing planning model;
[0020] Optionally, it further includes:
[0021] Regularly conduct a voting consensus on the block nodes, update the information resources stored on the central block node, and update the routing planning model.
[0022] A resource query system for block nodes provided by this application adopts the following technical solutions, including:
[0023] A link pool module, which is used to connect to the IP address and port corresponding to the block node, send the information resources of the block node, and perform heartbeat management and disconnection and reconnection management on the block node.
[0024] A session management module, which is used to connect and log in to the block node.
[0025] A block node management module: which is used to conduct a consensus on the query route of the block node;
[0026] A routing proxy module, which is used to perform routing broadcast on information according to the consensus query route;
[0027] An upper-layer scheduling application module, which is used to call information sending.
[0028] Optionally, the block node management module includes:
[0029] A node information set sub-module, which is used to store the routing information table of the block node;
[0030] A domain information aggregation sub-module, which is used to maintain the information management of the information management node domain and determine the central block node and the general block node;
[0031] A voting sub-module, which is used to vote on the block nodes, update the information resources stored on the central block node according to the voting results, and update the routing planning model.
[0032] Optionally, the routing proxy module includes:
[0033] A matching sub-module, which is used to respond to the information query condition received by the central block node, match the query route associated with the central block node through the routing planning model, and the information query condition corresponds to the target information resource one by one;
[0034] A searching sub-module, which is used to search for the target block node according to the query route and obtain the target information resource on the target block node.
[0035] Optionally, the domain information aggregation sub-module further includes:
[0036] A construction unit, which is used to construct a routing planning model;
[0037] The construction unit includes:
[0038] An obtaining subunit, which is used to obtain the original node sequence;
[0039] A superior-inferior relationship determination subunit, which is used to use the first central block node in the original node sequence as the information query root node, and determine the superior-inferior relationship between the central block nodes according to the preset interval and the preset hop count;
[0040] A query route construction subunit, which is used to construct a query route from the information query root node to all other central block nodes based on the superior-inferior relationship.
[0041] Optionally, the domain information aggregation sub-module further includes:
[0042] A partitioning unit, which is used to divide all block nodes into multiple information management node domains, and determine the central block node and the general block node in the information management node domain.
[0043] Optionally, the domain information aggregation sub-module further includes:
[0044] A forwarding unit, which is used to forward the information query condition to the central block node in the same information management node domain when the general block node receives the information query condition sent by the user.
[0045] Optionally, the voting sub-module includes:
[0046] A first update unit, configured to perform voting consensus on the block node when a block node joins or exits, update the information resources stored on the central block node, and update the routing planning model;
[0047] Optionally, the voting sub-module further includes:
[0048] A second update unit, configured to perform voting consensus on the block node regularly, update the information resources stored on the central block node, and update the routing planning model.
[0049] This specification also provides an electronic device, where the electronic device includes:
[0050] A processor; and,
[0051] A memory storing computer-executable instructions, where the executable instructions, when executed, cause the processor to execute any of the above methods.
[0052] This specification also provides a computer-readable storage medium, where the computer-readable storage medium stores one or more programs, and the one or more programs, when executed by a processor, implement any of the above methods.
[0053] In this application, in response to an information query condition received by the central block node, a query route associated with the central block node is matched through the routing planning model, and the information query condition corresponds to the target information resource one by one; the target block node is found according to the query route, and the target information resource on the target block node is quickly obtained. Description of the Drawings
[0054] Figure 1 It is a schematic diagram of the principle of a method for querying resources of a block node provided by an embodiment of this specification;
[0055] Figure 2 It is a schematic diagram of the principle of a method for querying resources of a block node provided by a specific embodiment of this specification Figure 1 ;
[0056] Figure 3 It is a schematic diagram of the principle of a method for querying resources of a block node provided by a specific embodiment of this specification Figure 2 ;
[0057] Figure 4 It is a schematic diagram of the principle of a method for querying resources of a block node provided by a specific embodiment of this specification Figure 3 ;
[0058] Figure 5Schematic structural diagram of a resource query system for a block node provided by an embodiment of this specification;
[0059] Figure 6 Schematic structural diagram of a routing proxy module provided by an embodiment of this specification;
[0060] Figure 7 Schematic structural diagram of an electronic device provided by an embodiment of this specification;
[0061] Figure 8 Schematic diagram of the principle of a computer-readable medium provided by an embodiment of this specification. Detailed implementation manners
[0062] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art can think of other obvious variations. The basic principles defined in the following description of the present invention can be applied to other implementation manners, variations, improvements, equivalent manners, and other technical solutions that do not depart from the spirit and scope of the present invention.
[0063] Now, the exemplary embodiments of the present invention will be described more comprehensively with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in various forms and should not be understood that the present invention is limited to the embodiments described herein. On the contrary, providing these exemplary embodiments can make the present invention more comprehensive and complete, and more convenient to fully convey the inventive concept to those skilled in the art. The same reference numerals in the figures represent the same or similar elements, components, or parts, and thus the repeated description thereof will be omitted.
[0064] On the premise of conforming to the technical concept of the present invention, the features, structures, characteristics, or other details described in a specific embodiment may not be excluded from being combined in a suitable manner in one or more other embodiments.
[0065] In the description of specific embodiments, the features, structures, characteristics, or other details described in the present invention are for those skilled in the art to fully understand the embodiments. However, it does not exclude that those skilled in the art can practice the technical solutions of the present invention without one or more of the specific features, structures, characteristics, or other details.
[0066] The flowcharts shown in the accompanying drawings are only exemplary illustrations, and do not necessarily include all the contents and operations / steps, nor do they necessarily need to be executed in the described order. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined. Therefore, the actual execution order may be changed according to the actual situation.
[0067] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0068] The term "and / or" or "and / or" includes all combinations of any one or more of the associated listed items.
[0069] Figure 1 A schematic diagram of a resource query method for a block node provided in an embodiment of this specification, the method comprising:
[0070] S2 responds to the information query condition received by the central block node, matching the query route associated with the central block node through the routing planning model, wherein the information query condition corresponds to the target information resource in a one-to-one manner;
[0071] S3 searches for the target block node according to the query route and obtains the target information resource on the target block node.
[0072] Block nodes store information resources. As the number of block nodes increases, the efficiency of information querying decreases significantly. Furthermore, the addition or removal of individual block nodes changes the corresponding query routing. Frequently updating the query routing leads to unstable information resource storage and significantly increases computational costs. Based on this, the present invention proposes a block node resource query method that accelerates information resource query speed while maintaining a relatively stable query routing.
[0073] First, the optimal query route corresponding to each central block node must be planned, that is, S1 builds a routing planning model;
[0074] In this application, in order to facilitate the query of information resources and the management of block nodes, block nodes are managed by domain. Specifically, all block nodes are divided into multiple information management node domains, and central block nodes and general block nodes are determined in the information management node domains.
[0075] The central block node in the information management node domain serves as an entry node and / or exit node for proxy and load. Newly added block nodes are defaulted to general block nodes.
[0076] Build a routing planning model based on the central block node, including:
[0077] S11 obtains the original node sequence;
[0078] Randomly arrange the central block nodes to obtain several node sequences and construct a node sequence set;
[0079] In one embodiment of the present specification, s block nodes include m general block nodes and n central block nodes i, where s = m + n; according to the n central block nodes i, n node sequences P are constructed i , generating a set of node sequences Among them,
[0080] Randomly select one of the node sequences from the set of node sequences as the original node sequence.
[0081] S12 uses the first central block node in the original node sequence as the information query root node, and determines the upper and lower position relationships between the central block nodes according to a preset interval and a preset number of hops;
[0082] Specifically, S121 determines the preset interval and the preset number of hops according to the number of central block nodes i; in one embodiment of the present specification, a ring parameter is determined according to the number of central block nodes, and the ring parameter includes a preset interval and a preset number of hops, where the preset interval Ω = [0, n - 1]; the preset number of hops includes a direct connection hop number σ and a farthest hop number ρ, where the direct connection hop number σ = 1, and the farthest hop number ρ takes the integer part. The ring parameter further includes a maximum hop number value μ, μ = Min(n, (ρ + 1) 2 ).
[0083] S122 constructs a node order relationship graph according to the order of the central block nodes i in the original node sequence P i ; assigns a node identifier α to the central block nodes according to the preset interval, and the node identifier α corresponding to the xth central block node i is α = x - 1, x ≤ n; uses the first central block node in the original node sequence as the information query root node i0;
[0084] In one embodiment of the present specification, the node order relationship graph is a ring - shaped structure topology graph, and the node order relationship graph is constructed clockwise according to the order of the central block nodes i in the original node sequence P i .
[0085] S123 determines the upper and lower position relationships between the central block nodes i α according to the preset number of hops, and constructs a set of central block nodes of the next hop of the central block nodes i α .
[0086] In one embodiment of the present specification, S1231 constructs a node information set MapSet of the information query root node i0, where MapSet is a set from one central block node to other central block nodes.
[0087] S1232 Find MapSet central block node i α If there is no subset, it is empty and is recorded as CurSet=i α ->[];
[0088] S1233 calculates the number of nodes from the central block node i according to the preset interval and the preset number of hops. α Departure, arrive at the next hop central block node, build CurSet = i α ->[], wherein the first node of the next hop includes the directly connected node d and the farthest node τ;
[0089] According to the central block node i α and the number of direct hops σ, determine the central block node i α Directly connected node d, where d = {i α-1 ,i α+1};
[0090] According to the central block node i α and the farthest hop number ρ, determine the central block node i α The farthest node τ, where τ={i α+ρ ,i α+2*ρ ,i α+3*ρ ,......,i α+(ρ-2)*ρ}, the number of τ is ρ-2, and a∈Ω, a=α+(ρ-2)*ρ.
[0091] For each farthest node τ, determine whether there is CurSet = i->[], that is, determine whether there is a corresponding subset in the node information set MapSet: if not, construct ModSet = τ-->[i α+(ρ-2)*ρ ].
[0092] Take a from 0 to n-1 in sequence and execute S1232 and S1233 in a loop.
[0093] In a specific embodiment of the present specification, if the number of central block nodes n=10, then ρ=3.
[0094] like Figure 2 As shown, a node sequence relationship diagram is constructed, and node identifiers α are assigned to central block nodes according to the preset interval Ω=[0,9], which are arranged in the order of i0, i1, i2, ..., i9; the first central block node i0 in the original node sequence is used as the information query root node.
[0095] Then, starting from α=0, d=[i9,i1];
[0096] When α = 0, CurSet = {[i0, [i9, i1, i3]]}, ModSet = {[i3, [i0]]};
[0097] When α = 1, CurSet = {[i1, [i0, i2, i4]]}, ModSet = {[i4, [i1]]};
[0098] When α = 2, CurSet = {[i2, [i1, i3, i5]]}, ModSet = {[i5, [i2]]};
[0099] When α = 3, CurSet = {[i3, [i0, i2, i4, i6]]}, ModSet = {[i6, [i3]]};
[0100] When α = 4, CurSet = {[i4, [i1, i3, i5, i7]]}, ModSet = {[i7, [i4]]};
[0101] When α = 5, CurSet = {[i5, [i2, i4, i6, i8]]}, ModSet = {[i8, [i5]]}.
[0102] When α = 6, CurSet = {[i6, [i3, i5, i7, i9]]}, ModSet = {[i9, [i6]]}.
[0103] When α = 7, CurSet = {[i7, [i4, i6, i8, i0]]}, ModSet = {[i0, [i9, i1, i3, i7]]}.
[0104] When α = 8, CurSet = {[i8, [i5, i7, i9, i1]]}, ModSet = {[i1, [i0, i2, i4, i8]]}.
[0105] When α = 9, CurSet = {[i9, [i6, i8, i0, i2]]}, ModSet = {[i2, [i1, i3, i5, i8]]}.
[0106] Therefore,
[0107] S13 constructs a query route from the information query root node to all other central block nodes based on the above - mentioned upper - lower relationship;
[0108] Based on the node information set MapSet, construct a node path set StackSet of the information query root node i0; successively take a from 0 to n - 1, and put the corresponding central block nodes into the node path set StackSet.
[0109] Specifically, in S131, find the central block node of the next hop of the information query root node i0 as the first node, and put it into the node path set StackSet.
[0110] In S132, traverse the newly generated first node, find the set nextHopSet of central block nodes of the next hop corresponding to the first node from the node information set MapSet, and take the central block nodes in the set nextHopSet as the new first nodes, and put them into the node path set StackSet one by one.
[0111] Repeat step S132 until the number of block nodes in the node path set StackSet >= n.
[0112] In S133, construct a query route from the information query root node i0 to all other central block nodes.
[0113] In a specific embodiment of this specification, according to step S131, a = 0, and StackSet = {i0} is obtained.
[0114] According to step S132, find the set of central block nodes of the next hop corresponding to the first node from the node information set MapSet according to i0, where i0 corresponds to the first central block node in the original node sequence.
[0115] When a = 0, then nextHopSet = Set(i9, i1, i3, i7), and the first - layer StackSet = {i1, i3, i7, i9}, corresponding to the 2nd, 4th, 8th, and 10th central block nodes in the original node sequence.
[0116] At this time, StackSet = {i0, i1, i3, i7, i9};
[0117] Continue according to step S132, then:
[0118] When a = 1, then nextHopSet = Set(i0, i2, i4, i8);
[0119] At this time, StackSet = {i0, i1, i3, i7, i9, i2, i4, i8};
[0120] When a = 3, then nextHopSet = Set(i0, i2, i6, i4);
[0121] At this time, StackSet = {i0, i1, i3, i7, i9, i2, i4, i8, i6};
[0122] When a = 7, then nextHopSet = Set(i0, i6, i4, i8);
[0123] At this time, StackSet = {i0, i1, i3, i7, i9, i2, i4, i8, i6};
[0124] When a = 9, then nextHopSet = Set(i0, i2, i6, i8)
[0125] The second - layer StackSet = {i2, i4, i6, i8}, corresponding to the 3rd, 5th, 7th, and 9th central block nodes in the original node sequence.
[0126] At this time, StackSet = {i0, i1, i3, i7, i9, i2, i4, i8, i6};
[0127] Continue according to step S132, then:
[0128] When a = 2, then nextHopSet = Set(i9, i1, i5, i3);
[0129] The third - layer StackSet = {i5}, corresponding to the 6th central block node in the original node sequence.
[0130] At this time, StackSet = {i0, i1, i3, i7, i9, i2, i4, i8, i6, i5}, and the total number of central block nodes is 10, and the calculation ends. As Figures 3 - 4 shown, construct a query route from the information query root node i0 to all other said central block nodes for subsequent resource queries.
[0131] Based on multiple said original node sequences, obtain multiple said query routes. In one embodiment of this specification, based on n said original node sequences, obtain n said query routes, and the information query root node i0 corresponding to each query route is different, so that based on any central block node, the target block node can be quickly located according to the best query route associated with it.
[0132] S2. In response to the information query condition received by the central block node, match the query route associated with the central block node through the routing planning model, and the information query condition corresponds one - to - one with the target information resource;
[0133] The user sends an information query condition to the block node. If this block node is a central block node, then this central block node forwards the information query condition to the next - hop central block node according to the query route associated with it.
[0134] If the block node is not a central block node but a general block node, that is, when the general block node receives the information query condition sent by the user, it forwards the information query condition to the central block node in the same information management node domain as the general block node, and the central block node performs further processing to improve the query speed.
[0135] S3 Finds the target block node according to the query route and obtains the target information resource on the target block node.
[0136] If the information resource corresponding to the information query condition is stored on the central block node, it is determined that the central block node is the target block node, and the information resource is the target information resource. In an embodiment of the present specification, the target information resource is a data packet.
[0137] The target block node finds the target information resource according to the information query condition and sends the target information resource to the central block node of the previous hop until it returns to the user.
[0138] The block node includes a central block node and a general block node. In an embodiment of the present specification, the number of central block nodes in the same information management node domain is less than the number of general block nodes. Substantially, the number of central block nodes in the blockchain network is significantly less than the number of general block nodes. Therefore, although block nodes may join or exit at any time, the central block node does not change all the time. Therefore, the constructed query route is relatively stable. The newly added block node is defaulted to be a general block node, and its addition does not immediately affect the query route. To a certain extent, it also improves the convenience of adding block nodes to the blockchain network.
[0139] It should be noted that based on the fact that the target block node may change and the information resource will be updated, in order to avoid the situation that the target information resource cannot be returned due to the inability to find the correct target block node, it is still necessary to update the central block node and the information resource stored on the central block node in a timely manner.
[0140] In an embodiment of the present specification, when a block node joins or exits, a voting consensus is performed on the block node to update the information resource stored on the central block node and update the routing planning model;
[0141] In another embodiment of the present specification, a voting consensus is periodically performed on the block node to update the information resource stored on the central block node and update the routing planning model.
[0142] Figure 5 The structural schematic diagram of a resource query system for a block node provided by the embodiment of the present specification, the system includes:
[0143] The link pool module 51 is used to connect to the IP address and port corresponding to the block node, send the information resources (data packets) of the block node, and perform heartbeat management and disconnection and reconnection management on the block node.
[0144] The session management module 52 is applied to the session layer of the block node and is used to connect and log in to the block node to prevent multiple storms of the block node. Among them, the session management needs to exist for a long time.
[0145] The block node management module 53: is used to perform consensus on the query routing of the block node;
[0146] The routing proxy module 54 is used to perform routing broadcast on the information according to the query routing of the consensus result;
[0147] The upper layer scheduling application module 55 is used to call information sending.
[0148] Optionally, the block node management module 53 includes:
[0149] The node information set sub-module 531 is used to store the routing information table of the block node, and the routing information table reaches a consistent consensus with all block nodes;
[0150] The domain information set sub-module 532 is used to maintain the information management of the information management node domain, determine the central block node and the general block node. The central block node is used for proxy and load, and the general block node can join the existing blockchain network without a public network;
[0151] The voting sub-module 533 is used to vote on the block node, form a new node information set and domain information set based on Byzantine fault tolerance, update the information resources stored on the central block node according to the voting result, and update the routing planning model;
[0152] Optionally, as Figure 6 shown, the routing proxy module 54 includes:
[0153] The matching sub-module 541 is used to respond to the information query condition received by the central block node, match the query routing associated with the central block node through the routing planning model, and the information query condition corresponds to the target information resource one by one;
[0154] The searching sub-module 542 is used to search for the target block node according to the query routing and obtain the target information resource on the target block node.
[0155] Optionally, the domain information set sub-module 532 further includes:
[0156] A building unit for building a routing planning model;
[0157] The building unit includes:
[0158] An acquisition subunit for acquiring an original node sequence;
[0159] A superordinate and subordinate relationship determination subunit for using the first central block node in the original node sequence as an information query root node, and determining the superordinate and subordinate relationships between the central block nodes according to a preset interval and a preset number of hops;
[0160] A query routing construction subunit for constructing a query routing from the information query root node to all other central block nodes based on the superordinate and subordinate relationships.
[0161] Optionally, the domain information aggregation sub-module 532 further includes:
[0162] A partitioning unit for partitioning all block nodes into multiple information management node domains, and determining the central block nodes and general block nodes in the information management node domains.
[0163] A partitioning unit for partitioning all block nodes into multiple information management node domains, and determining the central block nodes and general block nodes in the information management node domains.
[0164] Optionally, the domain information aggregation sub-module 532 further includes:
[0165] A forwarding unit for, when the general block node receives the information query condition sent by the user, forwarding the information query condition to the central block node in the same information management node domain.
[0166] Optionally, the voting sub-module 533 includes:
[0167] A first update unit for, when a block node joins or exits, performing voting consensus on the block node, updating the information resources stored on the central block node, and updating the routing planning model;
[0168] Optionally, the voting sub-module 533 further includes:
[0169] A second update unit for periodically performing voting consensus on the block nodes, updating the information resources stored on the central block node, and updating the routing planning model.
[0170] The functions of the system according to the embodiments of the present invention have been described in the above method embodiments. Therefore, for the parts not detailed in the description of this embodiment, reference may be made to the relevant descriptions in the foregoing embodiments, and details are not repeated here.
[0171] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0172] The present invention is described with reference to the flowcharts and / or block diagrams of methods, systems (devices), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.
[0173] These computer program instructions can 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, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.
[0174] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operating steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.
[0175] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.
Claims
1. A resource query method for a block node, characterized in that, Including: Dividing all block nodes into multiple information management node domains, and determining the central block nodes and general block nodes in the information management node domains; wherein, taking the central block nodes in the information management node domains as entry nodes and / or exit nodes for proxy and load; newly added block nodes are general block nodes; Constructing a routing planning model, including: randomly arranging the central block nodes to obtain a node sequence, constructing a set of node sequences; randomly selecting one of the node sequences from the set of node sequences as the original node sequence; taking the first central block node in the original node sequence as the information query root node, and determining the hierarchical relationship between the central block nodes according to a preset interval and a preset number of hops; constructing a query route from the information query root node to all other central block nodes based on the hierarchical relationship; In response to an information query condition received by a central block node, matching a query route associated with the central block node through the routing planning model, where the information query condition corresponds one-to-one with the target information resource; Searching for the target block node according to the query route, and obtaining the target information resource on the target block node.
2. The method according to claim 1, characterized in that Further including: When the general block node receives the information query condition sent by the user, forwarding the information query condition to the central block node in the same information management node domain.
3. The method according to claim 1, wherein Further including: When a block node joins or exits, performing a voting consensus on the block node, updating the information resources stored on the central block node, and updating the routing planning model; Or, Regularly performing a voting consensus on the block nodes, updating the information resources stored on the central block node, and updating the routing planning model.
4. A resource query system for block nodes, characterized in that, Including: A block node management module for performing consensus on the query routes of block nodes; A routing proxy module for routing and broadcasting information according to the query routes that have passed the consensus; The block node management module includes: a node information set sub-module for storing a routing information table of block nodes; the node information set sub-module includes: a division unit and a construction unit; The division unit is used for dividing all block nodes into multiple information management node domains, and determining the central block nodes and general block nodes in the information management node domains; wherein, taking the central block nodes in the information management node domains as entry nodes and / or exit nodes for proxy and load; newly added block nodes are general block nodes; The construction unit is used for constructing a routing planning model, including: randomly arranging the central block nodes to obtain a node sequence, constructing a set of node sequences; randomly selecting one of the node sequences from the set of node sequences as the original node sequence; taking the first central block node in the original node sequence as the information query root node, and determining the hierarchical relationship between the central block nodes according to a preset interval and a preset number of hops; constructing a query route from the information query root node to all other central block nodes based on the hierarchical relationship; The routing proxy module includes: A matching sub-module, configured to, in response to an information query condition received by a central block node, match a query route associated with the central block node through the routing planning model, where the information query condition corresponds to a target information resource one by one; A searching sub-module, configured to search for a target block node according to the query route and obtain the target information resource on the target block node.
5. The system according to claim 4, characterized in that, It further includes: A link pool module, configured to connect to the IP address and port corresponding to a block node, send the information resource of the block node, and perform heartbeat management and disconnection and reconnection management on the block node; A session management module, configured to connect and log in to the block node; An upper-layer scheduling application module, configured to call information sending.
6. The system according to claim 4, characterized in that, The block node management module further includes: A domain information set sub-module, configured to maintain the information management of an information management node domain and determine a central block node and a general block node; A voting sub-module, configured to vote on a block node, update the information resource stored on the central block node, and update the routing planning model.
7. An electronic device, wherein, The electronic device includes: A processor; and A memory storing computer-executable instructions, where the executable instructions, when executed, cause the processor to execute the method according to any one of claims 1-3.
8. A computer-readable storage medium, wherein, The computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, the method according to any one of claims 1-3 is implemented.
Citation Information
Patent Citations
Spatio-temporal data-oriented block chain architecture and range query processing method
CN113901142A