Network resource interaction method, network generation method and system, and network element
Through the realization of resource interaction methods in the blockchain network, the problem of high resource isolation between blockchain networks is solved, the circulation and interaction of resources are realized, and the flexibility of the blockchain network is improved.
Patent Information
- Application Number
- CN202110340811.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-30
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-03-30
AI Technical Summary
The high resource isolation between blockchain networks leads to limited resource interaction and circulation and lack of flexibility.
A network resource interaction method is proposed to receive resource interaction requests through nodes in the interactive network, generate transaction interaction target resources, and update user resources in the blockchain network to achieve resource interaction between different application blockchain networks.
Reduce the isolation between the blockchain network, improve the flexibility of the blockchain network, and enable the user resources in different applications of the blockchain network to circulate and interact.
Smart Images

Figure CN115145931B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer network technology, and in particular to a network resource interaction method, a network generation method and system, and a network element. Background Art
[0002] Blockchain technology is a new type of decentralized information technology. The data or information stored in the blockchain has the characteristics of "unforgeable", "full traceability", "traceability", "openness and transparency", and "collective maintenance". Based on these characteristics, blockchain technology has laid a solid "trust" foundation, created a reliable "cooperation" mechanism, and has broad application prospects.
[0003] A smart contract is a computer protocol designed to disseminate, verify or execute contracts in an information-based manner. It allows for trusted transactions without a third party, and these transactions are traceable and irreversible. Running smart contracts on the blockchain can ensure that the entire process is open, transparent and cannot be tampered with. At the same time, it can also avoid the influence of centralized institutions, allowing smart contracts to operate efficiently.
[0004] Nowadays, many institutions and organizations have established their own blockchain systems, and users enjoy resources on the corresponding blockchain systems. The blockchain systems of various institutions exist independently, and users can view and use their resources by accessing the corresponding blockchain systems. Summary of the invention
[0005] One purpose of the present disclosure is to improve the flexibility of blockchain networks.
[0006] According to one aspect of some embodiments of the present disclosure, a network resource interaction method is proposed, including: a node of an interactive network receives a first resource interaction request, wherein the first resource interaction request includes a user identifier, a source application identifier, a target application identifier and an interactive source resource amount, the interactive network is a blockchain network, and there are multiple nodes belonging to the same or different application blockchain networks in the interactive network; an interactive target resource amount is generated according to a pre-stored interaction ratio between the source application and the target application, and the interactive source resource amount; second resource interaction information is sent to a node of an application blockchain network belonging to the target application in the interactive network, the second resource interaction information including a user identifier and an interactive target resource amount; the node in the application blockchain network of the target application updates the user's resource amount stored in the application blockchain network according to the user identifier and the interactive target resource amount, and feeds back interaction success information to the interactive network; upon receiving an interaction success instruction, the node of the application blockchain network belonging to the source application in the interactive network updates the user's resource amount stored in the application blockchain network to which it belongs according to the interactive source resource amount.
[0007] In some embodiments, the network resource interaction method further includes: any node of the application blockchain network of the source application generates a first resource interaction request based on a user request, and sends at least one common node with the interactive network.
[0008] In some embodiments, nodes belonging to the same blockchain network exchange information by publishing blocks; the target node of the information interaction determines to execute subsequent operations by matching the target processing node information in the block.
[0009] In some embodiments, updating the resource amount of a user stored in the application blockchain network includes: generating an updated resource amount based on the resource amount of the user currently stored in the blockchain application network and the interaction resource amount, wherein the interaction resource amount is the interaction source resource amount or the interaction target resource amount; generating and publishing a block based on the updated resource amount and the user identifier.
[0010] In some embodiments, generating the interactive target resource amount based on the pre-stored interaction ratio between the source application and the target application, and the interactive source resource amount includes: querying the corresponding pre-stored interaction ratio information based on the identifier of the target application and the identifier of the source application; generating the interactive target resource amount based on the queried pre-stored interaction ratio information and the interactive source resource amount.
[0011] In some embodiments, the network resource interaction method also includes: selecting a predetermined number of nodes in each application blockchain network according to the paths between the nodes of the application blockchain network and the paths between the nodes of the application blockchain network and the predetermined initial nodes; merging the selected nodes and the paths between the nodes into the connection of the initial node, and obtaining an interactive network composed of the initial node, the selected nodes and the paths between the nodes, and the interactive network is a blockchain network.
[0012] In some embodiments, selecting a predetermined number of nodes in each application blockchain network includes: for each application blockchain network, obtaining the path weight between nodes based on the network communication delay between nodes and the average computing power of the computer; obtaining the target path between nodes based on the path weight between nodes through an improved Floyd algorithm; selecting nodes in each application blockchain network in descending order of the weight of the target path until the number of selected nodes in each application blockchain network reaches a predetermined number.
[0013] In some embodiments, obtaining the target path between nodes in descending order of weight by using the improved Floyd algorithm includes: obtaining an adjacency matrix between nodes according to the initial node of the interactive network and the nodes of each application blockchain network, and the paths between the nodes, wherein the elements in the adjacency matrix identify the weights of the paths between the nodes; according to the state transition equation:
[0014] dp[i][j]=max(dp[i][j],[dp[i][n]+dp[n][j]] / 2)
[0015] Update the adjacency matrix to obtain the target matrix, where the elements in the target matrix identify the paths with the highest weights between nodes; where dp[i][j] is the element in the i-th row and j-th column of the adjacency matrix, dp[i][n] is the element in the i-th row and n-th column of the adjacency matrix, and dp[n][j] is the element in the n-th row and j-th column of the adjacency matrix. i, j, and n are positive integers less than or equal to the sum of the number of initial nodes and the number of nodes in each application blockchain network.
[0016] In some embodiments, selecting nodes in each application blockchain network according to the order of the weights of the target paths between the nodes from high to low until the number of selected nodes in each application blockchain network reaches a predetermined number includes:
[0017] For each application blockchain network:
[0018] According to the target matrix, get the node corresponding to i that belongs to the set of initial nodes {C} k , the node corresponding to j belongs to the largest dp[i][j] of the applied blockchain network, and the corresponding i and j are determined;
[0019] Increase the number of selected nodes of the corresponding application blockchain network by 1, and merge the node corresponding to j into the set {C} k ;
[0020] Will be merged into the collection {C} k The node is selected as the first node in each application blockchain network;
[0021] For each application blockchain network, repeat the following steps until the number of selected nodes in each application blockchain network is equal to the predetermined number:
[0022] According to the target matrix, obtain the maximum dp[i][j] where the node corresponding to i belongs to the application blockchain network and the node corresponding to j does not belong to the same application blockchain network, and determine the corresponding i and j;
[0023] If the node corresponding to j belongs to the set {C} k , and the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is increased by 1, and the node corresponding to i is incorporated into the set {C} k ;
[0024] If the node corresponding to j does not belong to the set {C}k , and the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is increased by 1, and the node corresponding to i is incorporated into the set {C} k ;
[0025] If the node corresponding to j does not belong to the set {C} k , the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to j belongs increases by less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to j belongs is increased by 1, and the node corresponding to j is incorporated into the set {C} k .
[0026] Through this method, users can exchange resources in different application blockchain networks through the interactive network, so that user resources in different application blockchain networks can circulate and interact, reducing the isolation between blockchain networks and improving the flexibility of blockchain networks.
[0027] According to one aspect of some embodiments of the present disclosure, a resource interaction network generation method is proposed, comprising: selecting a predetermined number of nodes in each application blockchain network according to the paths between the nodes of the application blockchain network and the paths between the nodes of the application blockchain network and the predetermined initial nodes; incorporating the selected nodes and the paths between the nodes into the connection of the initial node, and obtaining an interaction network consisting of the initial node, the selected nodes and the paths between the nodes, so as to perform resource interaction between the application blockchain networks through the interaction network, wherein the interaction network is a blockchain network.
[0028] In some embodiments, selecting a predetermined number of nodes in each application blockchain network includes: for each application blockchain network, obtaining the path weight between nodes based on the network communication delay between nodes and the average computing power of the computer; obtaining the target path between nodes based on the path weight between nodes through an improved Floyd algorithm; selecting nodes in each application blockchain network in descending order of the weight of the target path until the number of selected nodes in each application blockchain network reaches a predetermined number.
[0029] In some embodiments, obtaining the target path between nodes in order of weight from high to low through the improved Floyd algorithm includes: obtaining an adjacency matrix between the nodes according to the initial node and the nodes of each application blockchain network, and the paths between the nodes, wherein the elements in the adjacency matrix identify the weights of the paths between the nodes; updating the adjacency matrix according to the state transfer equation: dp[i][j]=max(dp[i][j],[dp[i][n]+dp[n][j]] / 2) to obtain the target matrix, wherein the elements in the target matrix identify the highest weight path between the nodes; wherein dp[i][j] is the element in the i-th row and j-th column of the adjacency matrix, dp[i][n] is the element in the i-th row and n-th column of the adjacency matrix, dp[n][j] is the element in the n-th row and j-th column of the adjacency matrix, and i, j, and n are positive integers less than or equal to the sum of the number of initial nodes and the number of nodes of each application blockchain network.
[0030] In some embodiments, selecting nodes in each application blockchain network in descending order of the weight of the target path until a predetermined number of nodes are selected in each application blockchain network includes:
[0031] For each application blockchain network:
[0032] According to the target matrix, get the node corresponding to i that belongs to the set of initial nodes {C} k , the node corresponding to j belongs to the largest dp[i][j] of the applied blockchain network, and the corresponding i and j are determined;
[0033] Increase the number of selected nodes of the corresponding application blockchain network by 1, and merge the node corresponding to j into the set {C} k ;
[0034] Will be merged into the collection {C} k The node is selected as the first node in each application blockchain network;
[0035] For each application blockchain network, repeat the following steps until the number of selected nodes in each application blockchain network is equal to the predetermined number:
[0036] According to the target matrix, obtain the maximum dp[i][j] where the node corresponding to i belongs to the application blockchain network and the node corresponding to j does not belong to the same application blockchain network, and determine the corresponding i and j;
[0037] If the node corresponding to j belongs to the set {C} k , and the node corresponding to i does not belong to the set {C} k, if the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is increased by 1, and the node corresponding to i is incorporated into the set {C} k ;
[0038] If the node corresponding to j does not belong to the set {C} k , and the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is increased by 1, and the node corresponding to i is incorporated into the set {C} k ;
[0039] If the node corresponding to j does not belong to the set {C} k , the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to j belongs increases by less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to j belongs is increased by 1, and the node corresponding to j is incorporated into the set {C} k .
[0040] Through this method, an interactive network with nodes of different application blockchain networks can be built, so that user resources in different application blockchain networks can circulate and interact, reducing the isolation between blockchain networks and improving the flexibility of blockchain networks.
[0041] According to one aspect of some embodiments of the present disclosure, a network resource interaction system is provided, including:
[0042] An interactive network, including multiple nodes and links between nodes. There are multiple nodes belonging to the same or different application blockchain networks in the interactive network;
[0043] The interaction network is configured as:
[0044] A node of an application blockchain network belonging to a source application receives a first resource interaction request, wherein the first resource interaction request includes an identifier of a user, an identifier of a source application, an identifier of a target application, and an amount of interactive source resources, and the interactive network is a blockchain network;
[0045] Generate an interactive target resource amount according to the pre-stored interaction ratio between the source application and the target application and the interactive source resource amount;
[0046] Sending second resource interaction information to a node of the application blockchain network belonging to the target application, wherein the second resource interaction information includes a user identifier and an amount of interaction target resources;
[0047] The node of the application blockchain network belonging to the target application updates the user's resource volume stored in the application blockchain network according to the user identifier and the interactive target resource volume, and feeds back the interaction success information to the interactive network;
[0048] When a node of the application blockchain network belonging to the source application receives an interaction success instruction, it updates the resource amount of the user stored in the application blockchain network to which it belongs according to the interaction source resource amount.
[0049] In some embodiments, the network resource interaction system further includes: a plurality of application blockchain networks, each including a plurality of nodes and links between nodes; the application blockchain network is configured to perform at least one of the following: receiving a first resource interaction request from a user by any node, and sending it to a node belonging to the interaction network in the current application blockchain network; updating the stored user's resource quantity according to the interaction source resource quantity when receiving an interaction success instruction for the current application blockchain network from the interaction network; or receiving second resource interaction information by a node belonging to the interaction network; updating the user's resource quantity stored in the current application blockchain network according to the user identifier and the interaction target resource quantity, and feeding back interaction success information to the interaction network;
[0050] Such a system can realize resource exchange among users in different application blockchain networks through an interactive network, thereby enabling the circulation and interaction of user resources in different application blockchain networks, reducing the isolation between blockchain networks and improving the flexibility of blockchain networks.
[0051] According to one aspect of some embodiments of the present disclosure, a resource interaction network generating device is proposed, comprising: a selection unit, configured to select a predetermined number of nodes in each application blockchain network according to the paths between the nodes of the application blockchain network and the paths between the nodes of the application blockchain network and the predetermined initial nodes; an interaction network acquisition unit, configured to merge the selected nodes and the paths between the nodes into the connection of the initial node, and acquire an interaction network consisting of the initial node, the selected nodes and the paths between the nodes, wherein the interaction network is a blockchain network.
[0052] Such a device can build an interactive network with nodes of different application blockchain networks, so that user resources in different application blockchain networks can circulate and interact, reducing the isolation between blockchain networks and improving the flexibility of blockchain networks.
[0053] According to one aspect of some embodiments of the present disclosure, a network element is proposed, including: a memory; and a processor coupled to the memory, wherein the processor is configured to execute any one of the above methods based on instructions stored in the memory.
[0054] According to one aspect of some embodiments of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the instructions are executed by a processor, the steps of any one of the above methods are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0056] Figure 1 The present invention provides a flowchart of some embodiments of the network resource interaction method disclosed herein.
[0057] Figure 2 Flowcharts of other embodiments of the network resource interaction method disclosed herein.
[0058] Figure 3 The present invention provides a flowchart of some embodiments of the resource interaction network generation method disclosed herein.
[0059] Figure 4 Schematic diagram of some embodiments of the network resource interaction system disclosed in the present invention.
[0060] Figure 5 Schematic diagrams of some embodiments of the resource interaction network generating device disclosed in the present invention.
[0061] Figure 6 Schematic diagrams of some embodiments of network elements of the present disclosure.
[0062] Figure 7 Schematic diagrams of other embodiments of the network element of the present disclosure. DETAILED DESCRIPTION
[0063] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments.
[0064] The flowcharts of some embodiments of the network resource interaction method disclosed in the present invention are as follows: Figure 1 shown.
[0065] In step 101, a node of the interactive network receives a first resource interaction request, the first resource interaction request including a user identifier, a source application identifier, a target application identifier, and an interactive source resource amount. In some embodiments, the node of the interactive network that receives the first resource interaction request also belongs to the application blockchain network of the source application of the request.
[0066] In some embodiments, a user may initiate a first resource interaction request directly to a shared node between the interactive network and the source application, or may initiate a first resource interaction request to other blockchain network nodes of the source application, and through the interaction between application blockchain network nodes of the source application (e.g., publishing blocks), the first resource interaction request may reach the shared node between the interactive network and the source application.
[0067] In some embodiments, the interactive network is a blockchain network. There are multiple nodes in the interactive network that belong to the same or different application blockchain networks.
[0068] In step 102, the interactive network generates an interactive target resource amount according to the pre-stored interaction ratio between the source application and the target application, and the interactive source resource amount. In some embodiments, each node in the interactive network may have a smart contract, so that the interactive target resource amount calculation can be performed at any node. For example, the node receiving the first resource interaction request on the interactive network performs the calculation by itself and stores the calculation result on the chain.
[0069] In some other embodiments, an interactive server may be provided, and one or more nodes in the interactive network are connected to the interactive server. The interactive server stores a smart contract. The node of the interactive network sends the first resource interaction request to the interactive server, and obtains the interactive target resource amount from the interactive server.
[0070] In some embodiments, when a smart contract changes, the smart contract in the interactive network or interactive server is updated.
[0071] In some embodiments, if the node receiving the first resource interaction request in the above step 101 is not connected to the interactive server, the node connected to the interactive server obtains the first resource interaction request through the interactive operation between the blockchain network nodes, so as to obtain the interactive target resource amount from the interactive server.
[0072] In some embodiments, the smart contract can be a contract between two applications. When the nodes in the interactive network belong to more than two applications, the corresponding interaction ratio pre-stored information can be queried based on the identification of the target application and the identification of the source application, and then the interaction target resource amount can be generated based on the queried interaction ratio pre-stored information and the interaction source resource amount, thereby further improving the flexibility and reliability of resource interaction between different applications.
[0073] In step 103, second resource interaction information is sent to a node of the application blockchain network belonging to the target application in the interactive network, and the second resource interaction information includes a user identifier and an interactive target resource amount.
[0074] In some embodiments, the node that obtains the interactive target resource amount through its own calculation or from the interactive server in step 102 can generate the second resource interactive information, and realize the information transmission between the nodes of the interactive network through the message link.
[0075] In some embodiments, after obtaining the updated block in the network, the nodes belonging to each application blockchain network in the interactive network determine whether it is a request that requires itself to perform subsequent processing by matching the target blockchain. If the match is successful, the operation in step 104 is performed; otherwise, the request is ignored.
[0076] In step 104, the node in the application blockchain network of the target application updates the user's resource volume stored in the application blockchain network according to the user identifier and the interaction target resource volume, and feeds back interaction success information to the interaction network.
[0077] In some embodiments, the relevant nodes of the target application can generate an updated resource amount based on the user's resource amount currently stored in the blockchain application network and the interactive target resource amount; generate a block based on the updated resource amount and the user identifier and publish it on the application blockchain network of the target application.
[0078] In step 105, upon receiving the successful interaction instruction, the node of the application blockchain network belonging to the source application in the interaction network updates the resource amount of the user stored in the application blockchain network to which it belongs according to the interaction source resource amount.
[0079] In some embodiments, the relevant nodes of the source application can generate an updated resource amount based on the user's resource amount currently stored in the blockchain application network and the interactive source resource amount; generate a block based on the updated resource amount and the user identifier and publish it on the application blockchain network of the source application.
[0080] Through this method, users can exchange resources in different application blockchain networks through the interactive network, so that user resources in different application blockchain networks can circulate and interact, reducing the isolation between blockchain networks and improving the flexibility of blockchain networks.
[0081] In some embodiments, each resource interaction may be written and stored in the interactive network, so that the resource interaction can be queried through the credible interactive network, thereby improving the credibility of the resource interaction operation.
[0082] Flow charts of other embodiments of the network resource interaction method disclosed in the present invention are as follows: Figure 2 shown.
[0083] In step 201, a predetermined number of nodes are selected in each application blockchain network according to the paths between the nodes of the application blockchain network and the paths between the nodes of the application blockchain network and the predetermined initial nodes. The predetermined initial nodes are nodes in the interactive network that do not belong to any application blockchain network.
[0084] In some embodiments, node selection can be performed based on the path length between nodes of each application blockchain network and the path length between the application node and the initial node predetermined by the interactive network. In some embodiments, nodes on the path with strong processing capabilities and faster transmission speeds can also be selected based on the computing power of the node, path bandwidth, etc., to improve the performance of the interactive network.
[0085] In some embodiments, the predetermined number may be 1, thereby preventing multiple shared nodes belonging to the same application from receiving and processing requests at the same time. In other embodiments, the predetermined number may be greater than 1, thereby improving the robustness of the system. In some embodiments, priorities may be set for multiple shared nodes of the same application, and nodes with higher priorities may preferentially process requests related to the application to which they belong.
[0086] In step 202, the selected nodes and the paths between the nodes are merged into the connection of the initial node, and an interactive network consisting of the initial node, the selected nodes and the paths between the nodes is obtained, and the interactive network is a blockchain network.
[0087] In step 203, any node of the application blockchain network of the source application generates a first resource interaction request according to the user request and sends at least one common node with the interaction network.
[0088] In step 204, a shared node of the interactive network and the application blockchain network of the source application receives a first resource interaction request.
[0089] In some embodiments, when the node that directly receives the user request is a shared node, the above steps 203 and 204 can be omitted, and the first resource interaction request is directly generated according to the user request, and then step 205 is executed.
[0090] In step 205, an interactive target resource amount is generated according to the pre-stored interactive ratio between the source application and the target application, and the interactive source resource amount.
[0091] In step 206, second resource interaction information is sent to a node of the application blockchain network belonging to the target application in the interactive network, and the second resource interaction information includes a user identifier and an interactive target resource amount.
[0092] In step 207, the node in the application blockchain network of the target application updates the user's resource volume stored in the application blockchain network according to the user identifier and the interaction target resource volume, and feeds back interaction success information to the interaction network.
[0093] In step 208, upon receiving the successful interaction instruction, the node of the application blockchain network belonging to the source application in the interaction network updates the resource amount of the user stored in the application blockchain network to which it belongs according to the interaction source resource amount.
[0094] Through this method, an interactive network can be generated based on network topology and node resources, and resource exchange channels between different application blockchain networks can be built. Then, resource interaction can be carried out based on the interactive network, which utilizes the decentralized characteristics of blockchain, improves the credibility of resource interaction, and reduces the management burden.
[0095] The flowcharts of some embodiments of the resource interaction network generation method disclosed in the present invention can be as follows: Figure 2 As shown in steps 201 and 202.
[0096] Through this method, an interactive network with nodes of different application blockchain networks can be built, so that user resources in different application blockchain networks can circulate and interact, reducing the isolation between blockchain networks and improving the flexibility of blockchain networks.
[0097] Flow charts of other embodiments of the resource interaction network generation method disclosed in the present invention are as follows: Figure 3 shown.
[0098] In step 301, for each application blockchain network, the path weight between nodes is obtained according to the network communication delay between nodes and the average computing power of the computer.
[0099] In some embodiments, the path weights between nodes are calculated using two indicators: network communication delay and average computer computing power, and the indicator weights are: w1, w2, and w1+w2=1. According to the evaluation values of the indicators corresponding to the network communication delay and the average computer computing power, the path weight is calculated using a linear weighting method.
[0100] For example, the network communication delay between nodes is evaluated as v1, and the average computing power of the computer is evaluated as v2. The smaller the network communication delay, the larger v1 is, and the larger the average computing power of the computer, the larger v2 is. The path weight between nodes is:
[0101] Weight = f(v1*w1, v2*w2)
[0102] =v1*w1+v2*w2
[0103] In step 302, the target path between the nodes is obtained according to the path weights between the nodes through the improved Floyd algorithm.
[0104] The traditional Floyd algorithm is a classic algorithm for finding the shortest path between multiple source points. In the present disclosure, the path weight Weight is used as the weight of the path, and the problem of finding the minimum sum of the weights is converted into the problem of finding the maximum sum of the weights.
[0105] In some embodiments, according to the initial node of the interactive network and the nodes of each application blockchain network, and the paths between the nodes, an adjacency matrix between the nodes is obtained, wherein the elements in the adjacency matrix identify the weights of the paths between the nodes; according to the state transfer equation:
[0106] dp[i][j]=max(dp[i][j],[dp[i][n]+dp[n][j]] / 2)
[0107] Update the adjacency matrix to obtain the target matrix, where the elements in the target matrix identify the paths with the highest weights between nodes; where dp[i][j] is the element in the i-th row and j-th column of the adjacency matrix, dp[i][n] is the element in the i-th row and n-th column of the adjacency matrix, and dp[n][j] is the element in the n-th row and j-th column of the adjacency matrix. i, j, and n are positive integers less than or equal to the sum of the number of initial nodes and the number of nodes in each application blockchain network.
[0108] Further, according to the target matrix, a predetermined number of nodes are selected in the application blockchain network of each application in the order of weight with the initial node from high to low, and in the order of weight with the nodes selected to be incorporated into the interactive network from high to low.
[0109] In step 303, nodes are selected in each application blockchain network in descending order of the weight of the target path until the number of selected nodes in each application blockchain network reaches a predetermined number.
[0110] In some embodiments, a predetermined set of initial nodes may be set first. k ,In the initial state, the number of selected nodes in each application blockchain network is 0.
[0111] For each application blockchain network, perform the following operations:
[0112] According to the target matrix, get the node corresponding to i belongs to {C} k , the node corresponding to j belongs to the largest dp[i][j] of the current application blockchain network, determine the corresponding i and j; increase the number of selected nodes in the current application blockchain network by 1, and merge the node corresponding to j into the set {C} k, merge it into the set {C} k The node is selected as the first node in the current blockchain network.
[0113] Through the above operations, a node is selected in each application blockchain network.
[0114] When the predetermined number is greater than 1, the following operations are repeated for each application blockchain network until the number of selected nodes in each application blockchain network is equal to the predetermined number:
[0115] According to the target matrix, obtain the maximum dp[i][j] where the node corresponding to i belongs to the application blockchain network and the node corresponding to j does not belong to the same application blockchain network, and determine the corresponding i and j;
[0116] If the node corresponding to j belongs to the set {C} k , and the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is increased by 1, and the node corresponding to i is incorporated into the set {C} k ;
[0117] If the node corresponding to j does not belong to the set {C} k , and the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is increased by 1, and the node corresponding to i is incorporated into the set {C} k ;
[0118] If the node corresponding to j does not belong to the set {C} k , the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to j belongs increases by less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to j belongs is increased by 1, and the node corresponding to j is incorporated into the set {C} k .
[0119] In step 304, the selected nodes and the paths between the nodes are merged into the connection of the initial node, and an interactive network consisting of the initial node, the selected nodes and the paths between the nodes is obtained, so that resource interaction between the application blockchain networks is performed through the interactive network, and the interactive network is a blockchain network.
[0120] Through this method, a predetermined number of nodes can be screened out according to the weights between the nodes and the existing nodes in the interactive network, thereby minimizing the network communication delay of the interactive network, improving the average computing power of the computer in the interactive network, avoiding excessive processing burden on the nodes caused by being incorporated into the interactive network, reducing the impact on the application blockchain network, and improving the robustness of the system.
[0121] In some embodiments, the operations in steps 303 and 304 are exemplified as follows:
[0122] Target matrix dist[i][j], i = {0, 1, 2, ..., the sum of the number of initial nodes and the number of nodes of each application blockchain network}, j = {0, 1, 2, ..., the sum of the number of initial nodes and the number of nodes of each application blockchain network}.
[0123] (1) Assume that the set of initial nodes of the interaction network is {C} k , the node set of the application blockchain network A is {D}, find dp[i][j] (where: i∈{C} k , j∈{D}), the nodes corresponding to i and j are respectively denoted as C i , D j ; Then select D from the application blockchain network A j Nodes join the interactive network and D j Join k .
[0124] Similarly, other application blockchain networks select one node to join the interactive network in this way.
[0125] After this step, each points system needs to select f-1 nodes to join the points chain network.
[0126] (2) Assume that the application blockchain network A has not yet completed the selection of f (f is a predetermined number) nodes, and its node set is still recorded as {D}, then now find dp[i][j] (where: i∈{D}, And nodes i and j are different ∈{C} k ), the nodes corresponding to i and j are respectively recorded as D i , R, then it is divided into the following three cases:
[0127] a) If j∈{C} k ,and Then select D from the blockchain network A i Nodes join the interactive network and D i Join k ;
[0128] b) If j belongs to the application blockchain network B, and the number of selected nodes in the application blockchain network B is less than f:
[0129] like Then select D in the application blockchain network A i Nodes join the interactive network and D i Join k ;
[0130] If the node Then select R node in the application blockchain network to which R node belongs to join the interactive network, that is, add R to {C} k ;
[0131] c) In other cases, no node is selected to join the interactive network in this round.
[0132] (3) Repeat step 2 until the application blockchain network A completes the selection of f nodes.
[0133] Similarly, other application blockchain networks follow this method to complete the selection of f nodes.
[0134] (4) After completing the above steps, N application blockchain networks are completed, and each application blockchain network selects f nodes, for a total of N*f nodes.
[0135] In this way, the best possible performance of the interactive network can be ensured.
[0136] Schematic diagrams of some embodiments of the network resource interaction system disclosed in the present invention are as follows Figure 4 shown.
[0137] The network resource interaction system may include an interactive network 41. The interactive network 41 is a blockchain network having multiple nodes connected by links. There are multiple nodes in the interactive network belonging to the same or different application blockchain networks, such as nodes 4211, 4221, ... 42N1, where N is the number of application blockchain networks, and N is an integer greater than or equal to 2.
[0138] During the operation of the interactive network, a node of the application blockchain network belonging to the source application can receive a first resource interaction request, which includes a user identifier, a source application identifier, a target application identifier, and an interactive source resource amount; the node in the interactive network generates an interactive target resource amount according to a pre-stored interaction ratio between the source application and the target application, and the interactive source resource amount; the node that generates the interactive target resource amount sends second resource interaction information to the node of the application blockchain network belonging to the target application, and the second resource interaction information includes a user identifier and an interactive target resource amount; the node of the application blockchain network belonging to the target application updates the user's resource amount stored in the application blockchain network according to the user identifier and the interactive target resource amount, and feeds back interaction success information to the interactive network; upon receiving an interaction success instruction, the node of the application blockchain network belonging to the source application updates the user's resource amount stored in the application blockchain network to which it belongs according to the interactive source resource amount.
[0139] Such a system can realize resource exchange among users in different application blockchain networks through an interactive network, thereby enabling the circulation and interaction of user resources in different application blockchain networks, reducing the isolation between blockchain networks and improving the flexibility of blockchain networks.
[0140] In some embodiments, the network resource interaction system may further include an interaction server connected to one or more nodes in the interaction network. The interaction server stores a smart contract. The node of the interaction network sends the first resource interaction request to the interaction server, and obtains the interaction target resource amount from the interaction server.
[0141] Such a system can reduce the requirements for node functions and processing capabilities in the interactive network, which is conducive to promotion and application.
[0142] In some embodiments, the network resource interaction system may further include multiple application blockchain networks 42-1 to 42-N, each application blockchain network including multiple nodes (4211 to 421M, 4221 to 422P... 42N1 to 42NQ) and links between nodes, wherein M is the number of nodes in the application blockchain network 42-1, P is the number of nodes in the application blockchain network 42-2, Q is the number of nodes in the application blockchain network 42-N, and M, P, and Q are greater than the predetermined number of nodes that need to be incorporated into the interactive network. In some embodiments, the application corresponding to each application blockchain network needs to establish a smart contract with at least one other application, and the smart contract includes the exchange ratio information of resources between applications. The smart contract is stored in one or more nodes of the interactive network or the interactive server.
[0143] When the application blockchain network is used as the source application of the first resource interaction request, any node of the application blockchain network receives the first resource interaction request from the user and sends it to the node belonging to the interactive network in the current application blockchain network; when a successful interaction instruction for the current application blockchain network is received from the interactive network, the stored user's resource amount is updated according to the interactive source resource amount.
[0144] When the application blockchain network is used as the target application of the first resource interaction request, the second resource interaction information is received by the node belonging to the interactive network in the application blockchain network; according to the user identifier and the interactive target resource quantity, the resource quantity of the user stored in the current application blockchain network is updated, and the interaction success information is fed back to the interactive network.
[0145] In some embodiments, the application corresponding to the application blockchain network can only be used as a source application, can only be used as a target application, or can be used as a source application or a target application as needed.
[0146] Such a system includes multiple application blockchain networks, which can realize the mutual conversion of resources between applications that meet the needs of the application party through smart contracts, making it convenient for users to use, reducing the isolation of application blockchain networks in the system, and improving user experience.
[0147] Schematic diagrams of some embodiments of the resource interaction network generation device disclosed in the present invention are as follows Figure 5 shown.
[0148] The selection unit 501 can select a predetermined number of nodes in each application blockchain network according to the paths between the nodes of the application blockchain network and the paths between the nodes of the application blockchain network and the predetermined initial nodes. The predetermined initial nodes are nodes in the interactive network that do not belong to any application blockchain network.
[0149] In some embodiments, node selection can be performed based on the path length between nodes of each application blockchain network and the path length between the application node and the initial node predetermined by the interactive network. In some embodiments, nodes on the path with strong processing capabilities and faster transmission speeds can also be selected based on the computing power of the node, path bandwidth, etc., to improve the performance of the interactive network.
[0150] In some embodiments, the predetermined number may be 1, thereby preventing multiple shared nodes belonging to the same application from receiving and processing requests at the same time. In other embodiments, the predetermined number may be greater than 1, thereby improving the robustness of the system. In some embodiments, priorities may be set for multiple shared nodes of the same application, and nodes with higher priorities may preferentially process requests related to the application to which they belong.
[0151] In some embodiments, the selection unit 501 can select a predetermined number of nodes in each application blockchain network through the operations between steps 301 to 303 above.
[0152] The interactive network acquisition unit 502 can merge the selected nodes and the paths between the nodes into the connection of the initial node, and obtain an interactive network consisting of the initial node, the selected nodes and the paths between the nodes, and the interactive network is a blockchain network.
[0153] Such a system can realize resource exchange among users in different application blockchain networks through an interactive network, thereby enabling the circulation and interaction of user resources in different application blockchain networks, reducing the isolation between blockchain networks and improving the flexibility of blockchain networks.
[0154] In some embodiments, the network resource interaction system may include the above-mentioned resource interaction network generating device, thereby improving the degree of automation of the formation of the network resource interaction system, and being able to minimize the network communication delay of the generated interactive network, improve the average computing power of the computer of the interactive network, avoid incorporating the interactive network to cause excessive processing burden on the nodes, reduce the impact on the application blockchain network, and improve the robustness of the system.
[0155] A schematic diagram of the structure of an embodiment of the network element disclosed in the present invention is as follows Figure 6 As shown, the network element can be a resource interaction network generating device, or a node in a network resource interaction system. The network element includes a memory 601 and a processor 602. Among them: the memory 601 can be a disk, a flash memory or any other non-volatile storage medium. The memory is used to store the instructions in the corresponding embodiments of the network resource interaction method or the resource interaction network generating method mentioned above. The processor 602 is coupled to the memory 601 and can be implemented as one or more integrated circuits, such as a microprocessor or a microcontroller. The processor 602 is used to execute instructions stored in the memory, which can reduce the isolation between blockchain networks and improve the flexibility of the blockchain network.
[0156] In one embodiment, it is also possible to Figure 7 As shown, the network element 700 includes a memory 701 and a processor 702. The processor 702 is coupled to the memory 701 via a BUS bus 703. The network element 700 can also be connected to an external storage device 705 via a storage interface 704 to call external data, and can also be connected to a network or another computer system (not shown) via a network interface 706. No further detailed description will be given here.
[0157] In this embodiment, by storing data instructions in a memory and then processing the instructions through a processor, the isolation between blockchain networks can be reduced and the flexibility of the blockchain network can be improved.
[0158] In another embodiment, a computer-readable storage medium stores thereon computer program instructions, which, when executed by a processor, implement the steps of the method in the corresponding embodiment of the network resource interaction method or the resource interaction network generation method. It should be understood by those skilled in the art that the embodiments of the present disclosure may be provided as methods, devices, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0159] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of processes 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 a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0160] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0161] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0162] So far, the present disclosure has been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solution disclosed here.
[0163] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0164] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present disclosure rather than to limit it. Although the present disclosure has been described in detail with reference to the preferred embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present disclosure can still be modified or some technical features can be replaced by equivalents without departing from the spirit of the technical solution of the present disclosure, which should be included in the scope of the technical solution for protection of the present disclosure.
Claims
1. A network resource interaction method, comprising: According to the paths between the nodes of the application blockchain network and the paths between the nodes of the application blockchain network and the predetermined initial nodes, a predetermined number of nodes are selected in each application blockchain network, including: for each application blockchain network, according to the network communication delay between the nodes and the average computing power of the computer, the weight of the path between the nodes is obtained; according to the weight of the path between the nodes, the target path between the nodes is obtained by using the improved Floyd algorithm; in accordance with the weight of the target path from high to low, nodes are selected in each application blockchain network until the selected nodes in each application blockchain network reach the predetermined number, including: For each of the application blockchain networks, According to the target matrix, obtain the node corresponding to i that belongs to the set of the initial nodes {C} k , the node corresponding to j belongs to the largest dp[i][j] of the application blockchain network, determine the corresponding i, j, where the element in the target matrix identifies the path with the highest weight between nodes, and the dp[i][j] is the element in the i-th row and j-th column of the adjacency matrix between nodes, and the element in the adjacency matrix identifies the weight of the path between nodes; increase the number of selected nodes of the corresponding application blockchain network by 1, and merge the node corresponding to j into the set {C} k ; Will be incorporated into the collection {C} k The node is used as the first node selected in each of the application blockchain networks; Incorporating the selected node and the path between the nodes into the connection of the initial node, and obtaining an interactive network consisting of the initial node, the selected node and the path between the nodes, wherein the interactive network is a blockchain network; A node of the interactive network receives a first resource interaction request, wherein the first resource interaction request includes a user identifier, a source application identifier, a target application identifier, and an interactive source resource amount, and there are multiple nodes in the interactive network that belong to the same or different application blockchain networks; Generate an interactive target resource amount according to a pre-stored interactive ratio between the source application and the target application and the interactive source resource amount; Sending second resource interaction information to a node of the application blockchain network belonging to the target application in the interactive network, wherein the second resource interaction information includes an identifier of the user and the amount of the interactive target resource; The node in the application blockchain network of the target application updates the user's resource amount stored in the application blockchain network according to the user identifier and the interaction target resource amount, and feeds back interaction success information to the interaction network; When receiving the interaction success instruction, the node of the application blockchain network belonging to the source application in the interaction network updates the resource amount of the user stored in the application blockchain network to which it belongs according to the interaction source resource amount.
2. The method according to claim 1, further comprising: Any node of the application blockchain network of the source application generates the first resource interaction request according to the user request and sends at least one common node with the interaction network.
3. The method according to claim 1 or 2, wherein: Nodes belonging to the same blockchain network exchange information by publishing blocks; The target node of the information interaction determines to perform subsequent operations by matching the target processing node information in the block.
4. The method according to claim 1, wherein: The updating of the amount of resources of the user stored in the application blockchain network includes: Generate an updated resource amount according to the resource amount of the user currently stored in the blockchain application network and the interactive resource amount, wherein the interactive resource amount is the interactive source resource amount or the interactive target resource amount; A block is generated and published according to the updated resource amount and the user's identifier.
5. The method according to claim 1, wherein: The generating the interactive target resource amount according to the pre-stored interactive ratio between the source application and the target application and the interactive source resource amount comprises: According to the identifier of the target application and the identifier of the source application, querying the corresponding pre-stored information of the interaction ratio; The interactive target resource amount is generated according to the queried pre-stored information of the interactive ratio and the interactive source resource amount.
6. The method according to claim 1, wherein: Through the improved Floyd algorithm, the target paths between nodes are obtained in descending order of weight, including: According to the initial node of the interactive network and the nodes of each of the application blockchain networks, and the paths between the nodes, an adjacency matrix between the nodes is obtained; According to the state transfer equation: dp[i][j]=max(dp[i][j],[dp[i][n]+dp[n][j]] / 2), the adjacency matrix is updated to obtain the target matrix; Among them, dp[i][n] is the element in the i-th row and n-th column of the adjacency matrix, dp[n][j] is the element in the n-th row and j-th column of the adjacency matrix, and i, j, and n are positive integers less than or equal to the sum of the number of the initial nodes and the number of nodes of each of the application blockchain networks.
7. The method according to claim 6, wherein: The step of selecting nodes in each application blockchain network according to the order of the weights of the target paths between the nodes from high to low until the number of selected nodes in each application blockchain network reaches the predetermined number further includes: For each of the application blockchain networks, the following operations are repeated until the number of selected nodes in each application blockchain network is equal to the predetermined number: According to the target matrix, obtain the maximum dp[i][j] in which the node corresponding to i belongs to the application blockchain network and the node corresponding to j does not belong to the same application blockchain network, and determine the corresponding i and j; If the node corresponding to j belongs to the set {C} k , and the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is increased by 1, and the node corresponding to i is incorporated into the set {C} k ; If the node corresponding to j does not belong to the set {C} k , and the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is increased by 1, and the node corresponding to i is incorporated into the set {C} k ; If the node corresponding to j does not belong to the set {C} k , the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to j belongs increases by less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to j belongs increases by 1, and the node corresponding to j is incorporated into the set {C} k .
8. A method for generating a resource interaction network, comprising: According to the paths between the nodes of the application blockchain network and the paths between the nodes of the application blockchain network and the predetermined initial nodes, a predetermined number of nodes are selected in each application blockchain network, including: for each application blockchain network, according to the network communication delay between the nodes and the average computing power of the computer, the weight of the path between the nodes is obtained; according to the weight of the path between the nodes, the target path between the nodes is obtained by using the improved Floyd algorithm; in accordance with the weight of the target path from high to low, nodes are selected in each application blockchain network until the selected nodes in each application blockchain network reach the predetermined number, including: For each of the application blockchain networks, According to the target matrix, obtain the node corresponding to i that belongs to the set of the initial nodes {C} k , the node corresponding to j belongs to the largest dp[i][j] of the application blockchain network, determine the corresponding i, j, where the element in the target matrix identifies the path with the highest weight between nodes, and the dp[i][j] is the element in the i-th row and j-th column of the adjacency matrix between nodes, and the element in the adjacency matrix identifies the weight of the path between nodes; increase the number of selected nodes of the corresponding application blockchain network by 1, and merge the node corresponding to j into the set {C} k ; Will be incorporated into the collection {C} k The node is used as the first node selected in each of the application blockchain networks; The selected nodes and the paths between the nodes are merged into the connection of the initial node to obtain an interactive network consisting of the initial node, the selected nodes and the paths between the nodes, so as to perform resource interaction between the application blockchain networks through the interactive network, and the interactive network is a blockchain network.
9. The method according to claim 8, wherein: Through the improved Floyd algorithm, the target paths between nodes are obtained in descending order of weight, including: According to the initial node and the nodes of each of the application blockchain networks, and the paths between the nodes, an adjacency matrix between the nodes is obtained, wherein the elements in the adjacency matrix identify the weights of the paths between the nodes; According to the state transfer equation: dp[i][j]=max(dp[i][j],[dp[i][n]+dp[n][j]] / 2), the adjacency matrix is updated to obtain the target matrix; Among them, dp[i][n] is the element in the i-th row and n-th column of the adjacency matrix, dp[n][j] is the element in the n-th row and j-th column of the adjacency matrix, and i, j, and n are positive integers less than or equal to the sum of the number of the initial nodes and the number of nodes of each of the application blockchain networks.
10. The method according to claim 9, wherein: The step of selecting nodes in each application blockchain network in descending order of the weight of the target path until the number of selected nodes in each application blockchain network reaches the predetermined number further includes: For each of the application blockchain networks, the following operations are repeated until the number of selected nodes in each application blockchain network is equal to the predetermined number: According to the target matrix, obtain the maximum dp[i][j] in which the node corresponding to i belongs to the application blockchain network and the node corresponding to j does not belong to the same application blockchain network, and determine the corresponding i and j; If the node corresponding to j belongs to the set {C} k , and the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is increased by 1, and the node corresponding to i is incorporated into the set {C} k ; If the node corresponding to j does not belong to the set {C} k , and the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to i belongs is increased by 1, and the node corresponding to i is incorporated into the set {C} k ; If the node corresponding to j does not belong to the set {C} k , the node corresponding to i does not belong to the set {C} k , if the number of selected nodes in the application blockchain network to which the node corresponding to j belongs increases by less than the predetermined number, the number of selected nodes in the application blockchain network to which the node corresponding to j belongs increases by 1, and the node corresponding to j is incorporated into the set {C} k .
11. A network resource interaction system, comprising: An interactive network, comprising a plurality of nodes and links between the nodes, wherein the interactive network contains a plurality of nodes belonging to the same or different application blockchain networks, and the nodes in the interactive network are determined according to the resource interactive network generation method according to any one of claims 8 to 10; The interaction network is configured as follows: A first resource interaction request is received by a node of an application blockchain network belonging to a source application, wherein the first resource interaction request includes a user identifier, a source application identifier, a target application identifier, and an interactive source resource amount, and the interactive network is a blockchain network; Generate an interactive target resource amount according to a pre-stored interactive ratio between the source application and the target application and the interactive source resource amount; Sending second resource interaction information to a node of the application blockchain network belonging to the target application, wherein the second resource interaction information includes an identifier of the user and an amount of the interaction target resource; The node of the application blockchain network belonging to the target application updates the user's resource amount stored in the application blockchain network according to the user's identifier and the interaction target resource amount, and feeds back interaction success information to the interaction network; Upon receiving the successful interaction instruction, the node of the application blockchain network belonging to the source application updates the resource amount of the user stored in the application blockchain network to which it belongs according to the interaction source resource amount.
12. The system according to claim 11, further comprising: Multiple application blockchain networks, each including multiple nodes and links between nodes; The application blockchain network is configured to perform at least one of the following: Any node receives a first resource interaction request from a user and sends it to a node belonging to the interaction network in the current application blockchain network; when receiving the interaction success instruction for the current application blockchain network from the interaction network, the stored resource amount of the user is updated according to the interaction source resource amount; or The second resource interaction information is received by a node belonging to the interactive network; according to the user's identifier and the interactive target resource amount, the resource amount of the user stored in the current application blockchain network is updated, and the interaction success information is fed back to the interactive network.
13. A resource interaction network generating device, comprising: The selection unit is configured to select a predetermined number of nodes in each application blockchain network according to the paths between the nodes of the application blockchain network and the paths between the nodes of the application blockchain network and the predetermined initial nodes, including: for each application blockchain network, according to the network communication delay between the nodes and the average computing power of the computer, obtaining the weight of the path between the nodes; obtaining the target path between the nodes according to the weight of the path between the nodes through the improved Floyd algorithm; selecting nodes in each application blockchain network in descending order of the weight of the target path until the selected nodes in each application blockchain network reach the predetermined number, including: For each of the application blockchain networks, According to the target matrix, obtain the node corresponding to i that belongs to the set of the initial nodes {C} k , the node corresponding to j belongs to the largest dp[i][j] of the application blockchain network, determine the corresponding i, j, where the element in the target matrix identifies the path with the highest weight between nodes, and the dp[i][j] is the element in the i-th row and j-th column of the adjacency matrix between nodes, and the element in the adjacency matrix identifies the weight of the path between nodes; increase the number of selected nodes of the corresponding application blockchain network by 1, and merge the node corresponding to j into the set {C} k ; Will be incorporated into the collection {C} k The node is used as the first node selected in each of the application blockchain networks; The interactive network acquisition unit is configured to merge the selected node and the path between the nodes into the connection of the initial node, and obtain an interactive network composed of the initial node, the selected node and the path between the nodes, wherein the interactive network is a blockchain network.
14. A network element, comprising: Memory; as well as A processor coupled to the memory, the processor being configured to execute the method according to any one of claims 1 to 10 based on instructions stored in the memory.
15. A computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Block chain-based account transfer method, apparatus and device, and computer medium
CN111126988A
Resource data processing method and device, computer equipment and storage medium
CN111340468A