WO2021109735A1 - Cross-chain-network-based resource processing method, and device - Google Patents

Cross-chain-network-based resource processing method, and device Download PDF

Info

Publication number
WO2021109735A1
WO2021109735A1 PCT/CN2020/121949 CN2020121949W WO2021109735A1 WO 2021109735 A1 WO2021109735 A1 WO 2021109735A1 CN 2020121949 W CN2020121949 W CN 2020121949W WO 2021109735 A1 WO2021109735 A1 WO 2021109735A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
cross
chain
blockchain network
call
Prior art date
Application number
PCT/CN2020/121949
Other languages
French (fr)
Chinese (zh)
Inventor
莫楠
贺双洪
石翔
李辉忠
张开翔
范瑞彬
Original Assignee
深圳前海微众银行股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2021109735A1 publication Critical patent/WO2021109735A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1059Inter-group management mechanisms, e.g. splitting, merging or interconnection of groups
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Definitions

  • the present invention relates to the technical field of financial technology (Fintech), in particular to a resource processing method and device based on a cross-chain network.
  • Hash locking technology is a commonly used cross-chain technology.
  • the two parties of the cross-chain transaction first lock the assets in the accounts of both parties on the basis of the smart contract, and then enter the original hash value. If both parties can enter the correct original hash value within a limited time, Then both parties to the cross-chain transaction can complete the processing of cross-chain assets.
  • this method also requires that the two parties involved in the cross-chain transaction respectively adapt to the blockchain network that executes the cross-chain transaction. Only through the adaptation can the cross-chain assets in the blockchain network be processed, so this method is executing The resource processing of the cross-chain network is less flexible.
  • the present invention provides a resource processing method and device based on a cross-chain network, which is used to solve the technology of poor flexibility caused by the need to adapt the blockchain network where the resource is located when calling resources in the cross-chain network in the prior art problem.
  • the present invention provides a resource processing method based on a cross-chain network.
  • the method is suitable for a proxy node.
  • the method includes: the proxy node first receives a resource call request sent by a user, and then according to the identification and zone of the cross-chain resource
  • the corresponding relationship of the blockchain network determines the blockchain network corresponding to the identifier of the resource to be called, and finally calls the resource to be called from the blockchain network corresponding to the resource to be called to obtain the calling result.
  • the resource calling request includes the identification of the resource to be called.
  • this method can also use a unified calling method to call different resources in different blockchain networks, without the need to adapt each blockchain network one by one, so that it has better flexibility and helps improve users’ Experience.
  • the proxy node may also be encapsulated with a management unit corresponding to each blockchain network one-to-one.
  • the proxy node before the proxy node receives the resource call request sent by the client, the proxy node can also receive the deployment request sent by the client.
  • the deployment request includes each cross-chain resource to be deployed and the required deployment of each cross-chain resource The identity of the blockchain network.
  • the proxy node can determine the management unit corresponding to the cross-chain resource according to the identifier of the blockchain network that the cross-chain resource needs to deploy in the deployment request, and then assign the cross-chain resource Distributed to the management unit corresponding to the cross-chain resource, so that the management unit corresponding to the cross-chain resource deploys the cross-chain resource to the blockchain network managed by the management unit corresponding to the cross-chain resource.
  • the proxy node can also obtain the deployment result of each cross-chain resource by each management unit, and then generate the correspondence between the identifier of the cross-chain resource and the blockchain network according to the deployment result.
  • the call work of the cross-chain resources in each blockchain network is placed in each block Executed at the management unit corresponding to the chain network, on the one hand, it can decouple the management operation and call operation of cross-chain resources, and improve the flexibility of resource processing. On the other hand, it can also reduce the pressure and performance loss of the agent node.
  • the proxy node calls the resource to be called from the blockchain network corresponding to the resource to be called to obtain the calling result, which includes: the proxy node first according to the blockchain network corresponding to the identifier of the resource to be called, Determine the target management unit corresponding to the resource to be called, and obtain the identifiers of all the cross-chain resources in the blockchain network managed by the target management unit. If it is determined that all the cross-chain resources include the resource to be called, then according to the resource to be called The identification generates a call instruction and sends it to the target management unit. Among them, the call instruction is used for the target management unit to call the resource to be called in the blockchain network.
  • the resource call request may also include a call interface
  • the call interface may refer to any one or more of the general interfaces of each cross-chain resource.
  • the proxy node generates the calling instruction according to the identifier of the resource to be called, including: the proxy node generates the calling instruction according to the identifier of the resource to be called and the calling interface.
  • the call instruction is used for the target management unit to use the call interface to call the resource to be called in the blockchain network.
  • the identifier of the calling resource may be the contract address of the smart contract.
  • the proxy node generates a call instruction according to the identification of the resource to be called and the call interface, including: the proxy node generates a call instruction according to the contract address and the call interface of the smart contract.
  • the call instruction is used by the target management unit to generate a contract object according to the contract address of the smart contract, and call the call interface of the contract object to obtain or update the contract data of the smart contract.
  • the identifier of the calling resource may be the table name of the data table.
  • the proxy node generates a call instruction according to the identification of the resource to be called and the call interface, including: the proxy node generates the call instruction according to the table name of the data table and the call interface.
  • the calling instruction is used for the target management unit to obtain the data table according to the table name of the data table, and to query or modify the data in the data table according to the calling interface.
  • the correspondence between the identifier of the cross-chain resource and the blockchain network may be based on the cross-chain network, the blockchain network included in the cross-chain network, and the cross-chain resource deployed in the blockchain network.
  • the hierarchical relationship is set.
  • cross-chain resources and blocks are set according to the hierarchical form of each cross-chain network, each cross-chain network in each cross-chain network, and cross-chain resources deployed in the blockchain network.
  • the correspondence of the chain network enables the proxy node to flexibly manage the cross-chain resources in each cross-chain network, which helps the proxy node to quickly determine the blockchain corresponding to the cross-chain resource based on the correspondence when using the correspondence. Network, thereby effectively improving the efficiency of cross-chain resource calls.
  • the present invention provides a resource processing device based on a cross-chain network, the device including:
  • the transceiver module is used to receive the resource call request sent by the user terminal, and the resource call request includes the identifier of the resource to be called;
  • the determining module is used to determine the blockchain network corresponding to the identifier of the resource to be called based on the correspondence between the identifier of the cross-chain resource and the blockchain network;
  • the calling module is used to call the resource to be called from the blockchain network corresponding to the resource to be called to obtain the calling result.
  • the resource processing device based on the cross-chain network may also be encapsulated with a management unit corresponding to each blockchain network on a one-to-one basis.
  • the resource processing device based on the cross-chain network may also include a deployment module. Before the transceiver module receives the resource call request sent by the user terminal, the transceiver module may also receive a deployment request sent by the user terminal. The deployment request includes the deployment request. The identity of each deployed cross-chain resource and the blockchain network that each cross-chain resource needs to deploy.
  • the deployment module can determine the management unit corresponding to the cross-chain resource according to the identifier of the blockchain network that any cross-chain resource needs to deploy in the deployment request, and distribute the cross-chain resource to the corresponding cross-chain resource The management unit, so that the management unit corresponding to the cross-chain resource deploys the cross-chain resource to the blockchain network managed by the management unit corresponding to the cross-chain resource.
  • the transceiver module can also obtain the deployment result of each cross-chain resource by each management unit, and generate the corresponding relationship between the identifier of the cross-chain resource and the blockchain network according to the deployment result.
  • the calling module is specifically configured to: first determine the target management unit corresponding to the resource to be called according to the blockchain network corresponding to the identifier of the resource to be called, and then obtain the block managed by the target management unit The identification of all cross-chain resources in the chain network, if it is determined that all the cross-chain resources include the resource to be called, a calling instruction is generated according to the identification of the resource to be called and sent to the target management unit. Among them, the call instruction is used for the target management unit to call the resource to be called in the blockchain network.
  • the resource call request may also include a call interface, and the call interface may be any one or more of the general interfaces of each cross-chain resource.
  • the calling module is specifically used to generate a calling instruction according to the identifier of the resource to be called and the calling interface. Among them, the calling instruction is used by the target management unit to use the calling interface to call the resources to be called in the blockchain network.
  • the identifier of the calling resource may be the contract address of the smart contract.
  • the calling module is specifically used to generate a calling instruction according to the contract address and calling interface of the smart contract.
  • the call instruction is used by the target management unit to generate a contract object according to the contract address of the smart contract, and call the call interface of the contract object to obtain or update the contract data of the smart contract.
  • the identifier of the calling resource may be the table name of the data table.
  • the calling module is specifically used to generate a calling instruction according to the table name of the data table and the calling interface.
  • the calling instruction is used for the target management unit to obtain the data table according to the table name of the data table, and to query or modify the data in the data table according to the calling interface.
  • the correspondence between the identifier of the cross-chain resource and the blockchain network may be based on the cross-chain network, the blockchain network included in the cross-chain network, and the cross-chain resource deployed in the blockchain network.
  • the hierarchical relationship is set.
  • the present invention provides a computing device including at least one processor and at least one memory.
  • the memory may store a computer program.
  • the processor can execute any of the above-mentioned first aspects.
  • the resource processing method based on the cross-chain network.
  • the present invention provides a computer-readable storage medium that stores a computer program executable by a computing device.
  • the computing device can execute any of the above-mentioned Resource processing method of cross-chain network.
  • FIG. 1 is a schematic diagram of a system architecture of a cross-chain network provided by an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a possible system architecture provided by an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a resource processing method based on a cross-chain network provided by an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a resource processing device based on a cross-chain network provided by an embodiment of the present invention
  • Fig. 5 is a schematic structural diagram of a computing device provided by an embodiment of the present invention.
  • FIG. 1 is a schematic diagram of a system architecture of a cross-chain network provided by an embodiment of the present invention.
  • at least two (ie, two or more) blockchain networks may be provided in the cross-chain network 10 , Such as blockchain network 101, blockchain network 102, and blockchain network 103.
  • any two of the at least two blockchain networks can be connected according to the set requirements, and the connection method can be a wired connection or a wireless connection, and the specifics are not limited.
  • each of the at least two blockchain networks may include one or more nodes.
  • the blockchain network 101 may include nodes 1011, 1012, 1013, and nodes. 1014, any two nodes among the nodes 1011 to 1014 can be communicatively connected to jointly maintain the blockchain system.
  • Each node in the blockchain network can have multiple functions, such as routing functions, transaction functions, blockchain functions, and consensus functions.
  • a node in a blockchain network can transmit transaction data and other information sent by other nodes to more nodes to realize the communication function between nodes.
  • the nodes in the blockchain network can be used to support users to conduct transactions.
  • the nodes in the blockchain network can also be used to record all transactions in history.
  • nodes in the blockchain network can generate new blocks in the blockchain network by verifying and recording transactions.
  • the routing function is a function that each node in the blockchain network must have, and other functions can be set by those skilled in the art according to actual needs.
  • a node in the blockchain network can refer to a physical machine (server), or can refer to a process or a series of processes running in the server.
  • the node 1011 may be a process running on the server, or it may refer to the server, which is not specifically limited.
  • dedicated chain resources and cross-chain resources can be deployed in any blockchain network.
  • the dedicated chain resources are the resources required by the blockchain network to execute internal transactions
  • the cross-chain resources are the blockchain network. Resources required to perform external transactions with other blockchain networks.
  • the blockchain network 101 is a transaction chain network
  • the blockchain network 102 is a settlement chain network
  • the blockchain network 103 is a point chain network
  • the cross-chain network 10 may constitute a cross-chain payment network.
  • Transaction cross-chain resources are deployed on the transaction chain network
  • settlement cross-chain resources are deployed on the settlement chain network
  • point cross-chain resources are deployed on the loyalty chain network.
  • the transaction chain network can call the settlement cross-chain resource of the settlement chain network for asset settlement when using the transaction cross-chain resource to execute the transaction, and can also call the point chain network to update the points according to the asset settlement result of the settlement chain network and the transaction type of the transaction chain network.
  • the block network and the number of nodes in the block network listed therein are only for the convenience of explaining the solution, and do not constitute a limitation on the solution.
  • the number of block networks included in the cross-chain network can be greater than 3, for example, it can be 4 or more.
  • the number of nodes included in each block network can be greater than 4, for example, it can be 5 or more, which is not limited.
  • FIG. 2 is a schematic diagram of a possible system architecture provided by an embodiment of the present invention.
  • the system architecture may be provided with a proxy node 130 and at least one cross-chain network, such as a cross-chain network 10 and a cross-chain network 11. And cross-chain network 12.
  • the cross-chain network 10 includes the blockchain network 101, the blockchain network 102, and the blockchain network 103
  • the cross-chain network 11 includes the blockchain network 111 and the blockchain network 112
  • the cross-chain network 12 includes Block chain network 121 and block chain network 122.
  • Each blockchain network in each cross-chain network can be set up in the manner shown in Figure 1.
  • a user terminal 140 may also be provided in the system architecture.
  • the user terminal 140 may be any terminal device set on the developer's side, such as a notebook computer, an Ipad, a mobile phone, and so on. Developers can participate in the development process of the cross-chain network through the client 140.
  • the proxy node 130 may be connected to the client 140 and each blockchain network respectively.
  • it may be connected in a limited way, or it may be connected in a wireless way, which is not specifically limited.
  • FIG. 3 is a schematic flowchart of a resource processing method provided by an embodiment of the present invention.
  • the method can be applied to a proxy node, such as the proxy node 130 shown in FIG. 2.
  • the method includes:
  • Step 301 The proxy node receives a resource invocation request sent by the client, and the resource invocation request includes an identifier of the resource to be invoked.
  • the cross-chain resource may be deployed in each blockchain network of the cross-chain network by the developer during the development phase.
  • Cross-chain resources can refer to any type of resources, such as smart contracts deployed on the blockchain network, or data or assets stored in the database of the blockchain network, or can also be stored in the smart contract.
  • the data in the contract can be a data table or other types, such as stacks, graphs, etc., which are not limited.
  • the identification of the resource to be called may be composed of the address of the resource to be called, the identification of the blockchain network where the resource to be called is deployed, and the identification of the cross-chain network where the blockchain network where the resource to be called is deployed is located.
  • the identifier of the resource to be called may be "cross-chain network 11. Blockchain network 112.0X1".
  • the developer when it is necessary to call any cross-chain resource in any cross-chain network, the developer can input the identification of the resource to be called on the calling interface of the user terminal 140.
  • the client 140 After the client 140 receives the identifier of the resource to be called, it can obtain the Internet Protocol (IP) address of the proxy node 130 and the port number used for the cross-chain service in the proxy node 130, and then based on the The resource call request is generated by calling the identifier of the resource, the IP address of the proxy node 130, and the port number used for the cross-chain service.
  • IP Internet Protocol
  • the IP address of the proxy node 130 and the port number used for the cross-chain service can be obtained in advance by the user terminal 140 interacting with the proxy node 130, and can also be updated in real time by the user terminal 140 and the proxy node 130 through interaction.
  • the resource invocation request may be a uniform resource locator (URL) address constructed based on the identifier of the resource to be invoked, the IP address of the proxy node, and the port number used for the cross-chain service. For example, if the IP address of the proxy node is ip:127.0.0.1, the port number used for the cross-chain service in the proxy node is 8080, and the identifier of the resource to be called is "cross-chain network 11. Blockchain network 112.0X1", then The resource call request can be "http://127.0.0.1/8080. Cross-chain network 11/Blockchain network 112/0X1".
  • URL uniform resource locator
  • the agent node determines the blockchain network corresponding to the identifier of the resource to be invoked according to the corresponding relationship between the resource identifier and the blockchain network.
  • the agent node may also be encapsulated with management units corresponding to each block chain network one-to-one, and the agent node may be indirectly connected to each block chain network through each management unit.
  • the proxy node 130 may respectively encapsulate a management unit corresponding to the blockchain network 101, a management unit corresponding to the blockchain network 102, and a management unit corresponding to the blockchain network 103. 3.
  • the management unit 4 corresponding to the blockchain network 111, the management unit 5 corresponding to the blockchain network 112, the management unit 6 corresponding to the blockchain network 121, the management unit 7 corresponding to the blockchain network 122, and the proxy node 130 can The connection to the blockchain network 101 to the blockchain network 103, the blockchain network 111 and the blockchain network 112, and the blockchain network 121 and the blockchain network 122 are realized through the management unit 1 to the management unit 7, respectively.
  • packaging can have multiple meanings.
  • the management unit can be a software development kit (SDK) component deployed inside the agent node, or it can be independent of the agent.
  • SDK software development kit
  • the equipment outside the node realizes the communication with the agent node through the remote procedure call (Remote Procedure Call, RPC) protocol.
  • RPC Remote Procedure Call
  • the management unit is encapsulated in the agent node, the application program running on the management unit is independent of the application program running on the agent node.
  • the application program running on the management unit is used to manage the nodes and nodes in the connected blockchain network. Resources, and the application program running on the agent node is used to manage the management unit.
  • the management unit may communicate with each node in the blockchain network corresponding to the management unit.
  • communication can be achieved through wired or wireless connection with each node, or SDK components can be deployed on each node, and communication with each node can be achieved through SDK components on each node, which is not specifically limited.
  • Step a The developer sends the configuration information of each cross-chain resource to be deployed to the agent node 130 through the client 140.
  • the configuration information of each cross-chain resource can include the identification of the blockchain network to be deployed by the cross-chain resource, the identification of the cross-chain network where the blockchain network to be deployed is located, and the cross-chain resource .
  • the cross-chain resources are also different.
  • the cross-chain resource is a smart contract
  • the cross-chain resource may include the implementation logic (or implementation logic and initial data) of the smart contract.
  • the data of the cross-chain resource may include the asset type of each account and the value corresponding to the asset type.
  • the proxy node 130 can open the registration interface to each client in advance. If the client 140 has the registration authority, the client 140 can input the configuration information of the cross-chain resource in the registration interface of the proxy node 130, so that the cross-chain resource configuration information can be entered in the registration interface of the proxy node 130. The configuration information of the chain resource is sent to the agent node 130.
  • Step b The proxy node 130 determines the management unit corresponding to each cross-chain resource according to the configuration information of each cross-chain resource to be deployed, and distributes each cross-chain resource to be deployed to the corresponding management unit.
  • the proxy node 130 may first determine the identity of the blockchain network to be deployed and the cross-chain network where the blockchain network to be deployed is located.
  • the corresponding management unit then distributes the data of the cross-chain resource to the corresponding management unit. For example, as shown in Figure 2, if a certain cross-chain resource is a smart contract, and the blockchain network to be deployed by the smart contract is the blockchain network 112 in the cross-chain system 11, the management unit 5 It is used to manage each node in the blockchain network 112, so the blockchain network corresponding to the smart contract is the management unit 5, and the agent node 130 can send the smart contract to the management unit 5.
  • Step c After receiving the cross-chain resource to be deployed, the management unit deploys the cross-chain resource in the blockchain network under its management.
  • the management unit 5 can send the smart contract to any node (or all nodes) in the blockchain network 112 through the SDK component deployed on the node , So that each node in the blockchain network 112 deploys the execution contract to the blockchain network 112. If the deployment is successful, any node can send the address of the smart contract deployed in the blockchain network 112 to the management unit 5. If the deployment fails, each node can retry multiple times. If it fails, a response message of deployment failure may be sent to the management unit 5.
  • step d the management unit sends the deployment result of each cross-chain resource to be deployed to the agent node 130.
  • the deployment result of the cross-chain resource can be the address of the smart contract in the blockchain network; if the cross-chain resource is in the data table Data, the deployment result of the cross-chain resource can be the table name of the data table; if the cross-chain resource is an asset, the deployment result of the cross-chain resource can be the asset account name.
  • step e the proxy node 130 sends the deployment result of each management unit to the client 140.
  • the proxy node 130 can also generate a correspondence between the cross-chain resource and the blockchain network according to the deployment result of each management unit, and the correspondence can be used to indicate the deployed cross-chain resources and the assigned block. Correspondence of the chain network. Wherein, the corresponding relationship may be stored in the form of a table, or may also be stored in the form of a graph, which is not limited.
  • Table 1 exemplarily shows a schematic table of the correspondence between cross-chain resources and blockchain networks.
  • the correspondence between cross-chain resources and blockchain networks can include the resource deployment status of each cross-chain network managed by the agent node 130, and the resource deployment status of each cross-chain network can include the cross-chain network.
  • the cross-chain network 11 includes a blockchain network 111 and a blockchain network 112.
  • the blockchain network 111 corresponds to the management unit 4.
  • the blockchain network 111 is deployed with smart contract 0X3 and data table 2, and the blockchain network 112 Corresponding to the management unit 5, a data table 3 is deployed on the blockchain network 112.
  • cross-chain resources and blocks are set according to the hierarchical form of each cross-chain network managed by the agent node, each blockchain network in each cross-chain network, and cross-chain resources deployed in the blockchain network.
  • the correspondence relationship of the chain network not only enables the agent node to flexibly manage the cross-chain resources in each cross-chain network, but also helps the agent node to quickly determine the blockchain network corresponding to the cross-chain resource based on the corresponding relationship, so as to improve the cross-chain resources.
  • the efficiency of chain resource calls are set according to the hierarchical form of each cross-chain network managed by the agent node, each blockchain network in each cross-chain network, and cross-chain resources deployed in the blockchain network.
  • the proxy node 130 may first parse the resource call request to obtain the identifier of the resource to be called, and then query the resource identifier and block according to the identifier of the resource to be called. The corresponding relationship of the chain network to determine the blockchain network corresponding to the identifier of the resource to be called.
  • Step 303 The proxy node calls the resource to be called from the blockchain system corresponding to the resource to be called, and obtains the calling result.
  • the proxy node can also be directly connected to each node in each cross-chain network under management. In this way, after determining the blockchain network corresponding to the identifier of the resource to be called, the proxy node can directly The call request corresponding to the resource is sent to any node of the blockchain network, so that each node in the blockchain network calls the resource to be called to perform the call operation.
  • the agent node not only needs to manage the cross-chain resources of each cross-chain network, but also needs to perform the call operation of the cross-chain resources, so the agent node is under greater pressure and the performance loss is more serious.
  • the proxy node is indirectly connected to the nodes in each cross-chain network through each management unit, and each management unit manages a blockchain network.
  • the proxy node can first query Table 1 according to the identification of the cross-chain network in the identification of the resource to be invoked to obtain each blockchain network in the cross-chain network And the management unit corresponding to each blockchain network, and then according to the identifier of the blockchain network in the identifier of the resource to be called, the management unit corresponding to the blockchain network in the identifier of the resource to be called is determined, and the management unit As the management unit corresponding to the resource to be called, the call request of the resource to be called is sent to the management unit corresponding to the resource to be called.
  • Cross-chain network 11/Blockchain network 111/0X3 the proxy node can start from "http://127.0.0.1/8080 .Cross-chain network 11/blockchain network 111/0X3" restores the identity of the resource to be called “cross-chain network 11.
  • Blockchain network 111.0X3 restores the identity of the resource to be called "cross-chain network 11.
  • Blockchain network 111.0X3 restores the identity of the resource to be called "cross-chain network 11.
  • the identification "cross-chain network 11” is pulled from Table 1 to all management units under cross-chain network 11, namely management unit 4 and management unit 5.
  • Management unit 4 is used to manage blockchain network 111
  • management unit 5 is used to Manage the blockchain network 112.
  • the proxy node can determine the management unit that manages the blockchain network 111 from all the management units under the cross-chain network 11 according to the identifier of the blockchain network "blockchain network 111" in the identifier of the resource to be called, namely
  • the management unit 4 may further generate a call instruction according to the identification of the cross-chain resource smart contract 0X3 to be called, and send the call instruction to the management unit 4.
  • the call work of cross-chain resources in each blockchain network is placed at the management unit corresponding to each blockchain network for execution, not only can
  • the decoupling of cross-chain resource management and cross-chain resource invocation work improves the flexibility of resource processing, and can also reduce the pressure and performance loss of agent nodes.
  • the resource call request may also include a call interface
  • the call interface may be one or more of the general interfaces of various cross-chain resources.
  • the proxy node may also generate a call instruction according to the identification and call interface of the cross-chain resource to be called, and send the call instruction to the corresponding management unit.
  • the general interface of various cross-chain resources can be set based on the resource access requirements of various cross-chain resources, or can be set by those skilled in the art based on experience, and the details are not limited.
  • cross-chain resources can have the following general interfaces:
  • the getData() interface is used to obtain the data or assets in the data table or database deployed in the blockchain network;
  • the setData() interface is used to update the data or assets in the data table or database deployed in the blockchain network.
  • the update operation is to add, delete or modify;
  • the call() interface is used to call the logic of the smart contract deployed in the blockchain network to obtain the data in the smart contract;
  • sendTransaction() interface used to call the logic of the smart contract deployed in the blockchain network to operate on the data in the smart contract
  • the registerEventHandler() interface is used to register a buried event on the blockchain network. When a buried event on the blockchain network is triggered, this interface can actively push the information that the buried event is triggered to the set address.
  • the call() interface is only used to obtain the data in the smart contract, but does not execute the transaction. Therefore, the call() interface will not update the data in the smart contract, and accordingly will not update the data in the blockchain network. data.
  • the sendTransaction() interface is used to perform operations using the data in the smart contract, so the sendTransaction() interface will update the data in the smart contract, and the data in the blockchain network will be updated accordingly.
  • the getData() interface and the setData() interface are usually used to operate on the data table, and the call() interface and the sendTransaction() interface are usually used to operate on the smart contract.
  • the cross-chain resource is a smart contract 0X3 (that is, the identifier of the cross-chain resource is the address of the smart contract 0X03)
  • the blockchain network 111 will be in the smart contract
  • the address of the contract 0X3 stores the above 5 call interfaces of the smart contract 0X3 and the contract data of the smart contract 0X3.
  • the management unit 4 can first create a smart contract 0X3 contract object based on the address of the smart contract 0X3, and then call the smart contract 0X3 contract object
  • the call() interface is used to obtain the contract data in the smart contract 0X3, that is, the contract data stored at the address of the smart contract 0X3, and get the call result.
  • the cross-chain resource is a data table Table (that is, the identifier of the cross-chain resource is the table name Table of the data table)
  • the blockchain network will The address of the table stores the above five calling interfaces of the data table and the data of the data table.
  • the management unit receives the call instruction of "data table Table, setData() interface"
  • the management unit can first open the data table Table according to the table name of the data table Table, and create the contract of the first contract during the opening process Object, and then call the setData() interface of the contract object of the first contract to update the data in the data table Table, and get the call result.
  • the first contract may be a contract pre-deployed in the blockchain network, and the first contract is used to operate on the data in the data table.
  • the calling operation in the embodiment of the present invention may be a calling operation in a single blockchain network, or may be an interactive calling operation in multiple blockchain networks, and is not limited.
  • the user can call each calling resource based on the same input mode without adapting to each calling resource, thereby reducing the complexity of development , Improve the efficiency of development.
  • the following interface can also be set in the management unit:
  • the getResource() interface is used to obtain all the resources managed by the management unit
  • the getBlockHeader() interface is used to obtain the block header information of the blockchain network managed by the management unit.
  • the management unit can first use the getResource() interface to pull all the resources managed by the management unit, and determine whether all the resources managed include the resources to be called in the call instruction. If it contains, it can send a call failure response message to the proxy node 130, and if it contains, it can perform the call operation.
  • the management unit may also send the call result of the resource to be called back to the client via the proxy node.
  • the management unit may also send the call result of the resource to be called back to the client via the proxy node.
  • the proxy node first receives the resource call request sent by the user terminal, and then determines the corresponding relationship between the identifier of the cross-chain resource carried in the resource call request and the blockchain network.
  • the blockchain network then calls the resource to be called from the blockchain network corresponding to the resource to be called to obtain the calling result.
  • a proxy node is set to manage the cross-chain resources in the cross-chain network, so that the user can directly send a resource call request to the proxy node to complete the call to the cross-chain resources in the cross-chain network, which is helpful Simplify the operation process on the user side.
  • this method can use a unified calling method to call different resources in different blockchain networks, without the need to adapt each blockchain network one by one, so that the flexibility is better and the user experience is better.
  • an embodiment of the present invention also provides a resource processing device based on a cross-chain network, and the specific content of the device can be implemented with reference to the foregoing method.
  • Fig. 4 is a resource processing device based on a cross-chain network provided by an embodiment of the present invention, and the device includes:
  • the transceiver module 401 is configured to receive a resource call request sent by a user terminal, where the resource call request includes an identifier of the resource to be called;
  • the determining module 402 is configured to determine the blockchain network corresponding to the identifier of the resource to be called according to the corresponding relationship between the identifier of the cross-chain resource and the blockchain network;
  • the calling module 403 is used to call the resource to be called from the blockchain network corresponding to the resource to be called to obtain the calling result.
  • a management unit corresponding to each blockchain network is packaged in the device.
  • the device may also include a deployment module 404. Before the transceiver module 401 receives a resource invocation request sent by the client, the transceiver module 401 is further configured to receive a deployment request sent by the client.
  • the deployment request includes The identity of each deployed cross-chain resource and the blockchain network that each cross-chain resource needs to be deployed.
  • the deployment module 404 is configured to, for any cross-chain resource, determine the management unit corresponding to the cross-chain resource according to the identifier of the blockchain network that the cross-chain resource needs to be deployed in the deployment request, and then The cross-chain resource is distributed to the management unit corresponding to the cross-chain resource, so that the management unit deploys the cross-chain resource to the blockchain network managed by the management unit; and obtains the management unit
  • the deployment result of each cross-chain resource is described, and the corresponding relationship between the identifier of the cross-chain resource and the blockchain network is generated according to the deployment result.
  • the calling module 403 is specifically configured to: determine the target management unit corresponding to the resource to be called according to the blockchain network corresponding to the identifier of the resource to be called, and obtain the area managed by the target management unit.
  • the identification of all cross-chain resources in the blockchain network is based on the identification of all the cross-chain resources in the blockchain network managed by the target management unit, if it is determined that all the cross-chain resources include the resource to be called,
  • a call instruction is generated according to the identifier of the resource to be called and sent to the target management unit; the call instruction is used by the target management unit to call the resource to be called in the blockchain network.
  • the resource call request further includes a call interface
  • the call interface is any one or more of the general interfaces of each cross-chain resource.
  • the invoking module 403 is specifically configured to: generate the invoking instruction according to the identifier of the resource to be invoked and the invoking interface, and the invoking instruction is used by the target management unit to use the invoking interface to pair The resource to be called in the blockchain network is called.
  • the identifier of the calling resource is the contract address of the smart contract.
  • the invoking module 403 is specifically configured to generate the invoking instruction according to the contract address of the smart contract and the invoking interface, and the invoking instruction is used by the target management unit according to the smart contract.
  • the contract address generates a contract object, and calls the calling interface of the contract object to obtain or update the contract data of the smart contract.
  • the identifier of the calling resource is the table name of the data table.
  • the invoking module 403 is specifically configured to generate the invoking instruction according to the table name of the data table and the invoking interface, and the invoking instruction is used by the target management unit according to the table of the data table. Obtain the data table by name, and query or modify the data in the data table according to the calling interface.
  • the corresponding relationship between the identifier of the cross-chain resource and the blockchain network is set according to the hierarchical relationship of the cross-chain network, the blockchain network included in the cross-chain network, and the cross-chain resources deployed in the blockchain network.
  • the proxy node first receives the resource call request sent by the client, and then determines the correspondence between the cross-chain resource identifier carried in the resource call request and the blockchain network.
  • the blockchain network corresponding to the identifier of the resource to be called calls the resource to be called from the blockchain network corresponding to the resource to be called, and the calling result is obtained.
  • the user can directly send a resource call request to the proxy node to complete the call to the cross-chain resources in the cross-chain network, which is helpful To simplify the operation process of the user side.
  • this method can also use a unified calling method to call different resources of different blockchain networks, without the need to adapt each blockchain network one by one, so that the flexibility is better and the user experience is better.
  • an embodiment of the present invention also provides a computing device.
  • the computing device may include at least one processor 501 and a memory 502 connected to the at least one processor.
  • the specific connection medium between the processor 501 and the memory 502 is not limited.
  • the processor 501 and the memory 502 are connected through a bus as an example.
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the memory 502 stores instructions that can be executed by at least one processor 501.
  • the at least one processor 501 can execute the aforementioned resource processing method based on a cross-chain network. A step of.
  • the processor 501 is the control center of the computing device, which can use various interfaces and lines to connect various parts of the computing device, and realize data by running or executing instructions stored in the memory 502 and calling data stored in the memory 502. deal with.
  • the processor 501 may include one or more processing units, and the processor 501 may integrate an application processor and a modem processor.
  • the application processor mainly processes the operating system, user interface, and application programs.
  • the adjustment processor mainly handles issuing instructions. It can be understood that the foregoing modem processor may not be integrated into the processor 501.
  • the processor 501 and the memory 502 may be implemented on the same chip, and in some embodiments, they may also be implemented on separate chips.
  • the processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention.
  • the general-purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiment of resource processing based on a cross-chain network can be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • the memory 502 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules.
  • the memory 502 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), magnetic memory, disk , CD, etc.
  • the memory 502 is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
  • the memory 502 in the embodiment of the present invention may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
  • embodiments of the present invention also provide a computer-readable storage medium that stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device executes The resource processing method based on the cross-chain network as described in any of the above-mentioned Figure 3.
  • the embodiments of the present invention can be provided as a method or a computer program product. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.

Abstract

A cross-chain-network-based resource processing method and a device, used to improve the flexibility of cross-chain resource processing. The method comprises: a proxy node receiving a resource scheduling request sent by a user terminal, determining, according to a correspondence relationship between a cross-chain resource identifier carried in the resource scheduling request and a blockchain network, a blockchain network corresponding to an identifier of a resource to be scheduled, and scheduling the resource from the blockchain network corresponding to the resource to obtain a scheduling result. The invention configures the proxy node to manage cross-chain resources in a cross-chain network, such that a user terminal is capable of completing cross-chain resource scheduling in the cross-chain network simply by directly sending a resource scheduling request to the proxy node, thereby simplifying an operation process at user terminals. In addition, the method enables different resources in different blockchain networks to be scheduled in a consistent scheduling manner without making adaption for individual blockchain networks, thereby improving flexibility and enhancing user experience.

Description

一种基于跨链网络的资源处理方法及装置Resource processing method and device based on cross-chain network
相关申请的交叉引用Cross-references to related applications
本申请要求在2019年12月05日提交中国专利局、申请号为201911236666.6、申请名称为“一种基于跨链网络的资源处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on December 5, 2019, the application number is 201911236666.6, and the application name is "a resource processing method and device based on a cross-chain network", the entire content of which is by reference Incorporated in this application.
技术领域Technical field
本发明涉及金融科技(Fintech)技术领域,尤其涉及一种基于跨链网络的资源处理方法及装置。The present invention relates to the technical field of financial technology (Fintech), in particular to a resource processing method and device based on a cross-chain network.
背景技术Background technique
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变,区块链技术也不例外。然而,由于金融行业的安全性和实时性要求,金融科技也对区块链技术提出了更高的要求。With the development of computer technology, more and more technologies are applied in the financial field. The traditional financial industry is gradually changing to Fintech, and blockchain technology is no exception. However, due to the security and real-time requirements of the financial industry, financial technology also puts forward higher requirements on blockchain technology.
哈希锁定技术是现有较为常用的一种跨链技术。在哈希锁定技术中,跨链交易的双方先在智能合约的基础上锁定双方账户中的资产,再输入哈希原值,若双方都能在有限的时间内输入正确的哈希原值,则跨链交易的双方可以完成跨链资产的处理。然而,该种方式还需要参与跨链交易的双方分别对执行跨链交易的区块链网络进行适配,只有适配通过才能处理区块链网络中的跨链资产,因此该种方式在执行跨链网络的资源处理时灵活性较差。Hash locking technology is a commonly used cross-chain technology. In the hash lock technology, the two parties of the cross-chain transaction first lock the assets in the accounts of both parties on the basis of the smart contract, and then enter the original hash value. If both parties can enter the correct original hash value within a limited time, Then both parties to the cross-chain transaction can complete the processing of cross-chain assets. However, this method also requires that the two parties involved in the cross-chain transaction respectively adapt to the blockchain network that executes the cross-chain transaction. Only through the adaptation can the cross-chain assets in the blockchain network be processed, so this method is executing The resource processing of the cross-chain network is less flexible.
综上,目前亟需一种基于跨链网络的资源处理方法,用以解决现有技术在调用跨链网络中的资源时需要对资源所在的区块链网络进行适配所导致的灵活性差的技术问题。In summary, there is an urgent need for a resource processing method based on a cross-chain network to solve the problem of poor flexibility caused by the need to adapt the blockchain network where the resource is located when calling resources in the cross-chain network. technical problem.
发明内容Summary of the invention
本发明提供一种基于跨链网络的资源处理方法及装置,用以解决现有技术在调用跨链网络中的资源时需要对资源所在的区块链网络进行适配所导致的灵活性差的技术问题。The present invention provides a resource processing method and device based on a cross-chain network, which is used to solve the technology of poor flexibility caused by the need to adapt the blockchain network where the resource is located when calling resources in the cross-chain network in the prior art problem.
第一方面,本发明提供一种基于跨链网络的资源处理方法,该方法适用于代理节点,该方法包括:代理节点先接收用户端发送的资源调用请求,再根据跨链资源的标识与区块链网络的对应关系,确定出待调用资源的标识对应的区块链网络,最后从待调用资源对应的区块链网络中调用该待调用资源,以得到调用结果。其中,资源调用请求中包括待调用资源的标识。在上述设计中,通过设置代理节点来管理跨链网络中的跨链资源,使得用户端直接向代理节点发送资源调用请求即可完成对跨链网络中的跨链资源的调用,有助于简化用户端的操作流程。且,该种方式还能采用统一的调用方式调用不同区块链网络中的不同资源,而不需要对各个区块链网络进行一一适配,从而灵活性更好,有助于提高用户的体验。In the first aspect, the present invention provides a resource processing method based on a cross-chain network. The method is suitable for a proxy node. The method includes: the proxy node first receives a resource call request sent by a user, and then according to the identification and zone of the cross-chain resource The corresponding relationship of the blockchain network determines the blockchain network corresponding to the identifier of the resource to be called, and finally calls the resource to be called from the blockchain network corresponding to the resource to be called to obtain the calling result. Wherein, the resource calling request includes the identification of the resource to be called. In the above design, by setting up proxy nodes to manage the cross-chain resources in the cross-chain network, the user can directly send resource call requests to the proxy node to complete the call to the cross-chain resources in the cross-chain network, which helps simplify Operation process on the user side. Moreover, this method can also use a unified calling method to call different resources in different blockchain networks, without the need to adapt each blockchain network one by one, so that it has better flexibility and helps improve users’ Experience.
在一种可选地实现方式中,代理节点中还可以封装有与各个区块链网络一一对应的管理单元。在这种情况下,在代理节点接收用户端发送的资源调用请求之前,代理节点还可以接收用户端发送的部署请求,部署请求中包括待部署的各个跨链资源和各个跨链资源所需部署的区块链网络的标识。进一步地,针对于任一跨链资源,代理节点可以根据部署请求中该跨链资源所需部署的区块链网络的标识,确定出该跨链资源对应的管理单元,并将 该跨链资源分发给该跨链资源对应的管理单元,以使该跨链资源对应的管理单元将跨链资源部署到该跨链资源对应的管理单元所管理的区块链网络中。最后,代理节点还可以获取各个管理单元对各个跨链资源的部署结果,进而根据部署结果生成跨链资源的标识与区块链网络的对应关系。在上述实现方式中,通过在代理节点中封装多个管理节点,并将跨链资源的管理工作放置在代理节点处执行,将各个区块链网络中跨链资源的调用工作放置在各个区块链网络对应的管理单元处执行,一方面可以解耦跨链资源的管理操作和调用操作,提高资源处理的灵活性,另一方面还可以降低代理节点的压力和性能损耗。In an optional implementation manner, the proxy node may also be encapsulated with a management unit corresponding to each blockchain network one-to-one. In this case, before the proxy node receives the resource call request sent by the client, the proxy node can also receive the deployment request sent by the client. The deployment request includes each cross-chain resource to be deployed and the required deployment of each cross-chain resource The identity of the blockchain network. Further, for any cross-chain resource, the proxy node can determine the management unit corresponding to the cross-chain resource according to the identifier of the blockchain network that the cross-chain resource needs to deploy in the deployment request, and then assign the cross-chain resource Distributed to the management unit corresponding to the cross-chain resource, so that the management unit corresponding to the cross-chain resource deploys the cross-chain resource to the blockchain network managed by the management unit corresponding to the cross-chain resource. Finally, the proxy node can also obtain the deployment result of each cross-chain resource by each management unit, and then generate the correspondence between the identifier of the cross-chain resource and the blockchain network according to the deployment result. In the above implementation, by encapsulating multiple management nodes in the proxy node, and placing the management work of cross-chain resources at the proxy node for execution, the call work of the cross-chain resources in each blockchain network is placed in each block Executed at the management unit corresponding to the chain network, on the one hand, it can decouple the management operation and call operation of cross-chain resources, and improve the flexibility of resource processing. On the other hand, it can also reduce the pressure and performance loss of the agent node.
在一种可选地实现方式中,代理节点从待调用资源对应的区块链网络中调用待调用资源,得到调用结果,包括:代理节点先根据待调用资源的标识对应的区块链网络,确定出待调用资源对应的目标管理单元,并获取目标管理单元所管理的区块链网络中的全部跨链资源的标识,若确定全部跨链资源中包括待调用资源,则根据待调用资源的标识生成调用指令,并发送给目标管理单元。其中,调用指令用于目标管理单元对区块链网络中的待调用资源进行调用。在上述实现方式中,通过在执行调用操作之前先判断待调用资源是否属于管理单元所管理的跨链资源,不仅使管理单元能准确调用自己所管理的跨链资源,还能避免无谓的调用操作,提高调用的效率。In an optional implementation manner, the proxy node calls the resource to be called from the blockchain network corresponding to the resource to be called to obtain the calling result, which includes: the proxy node first according to the blockchain network corresponding to the identifier of the resource to be called, Determine the target management unit corresponding to the resource to be called, and obtain the identifiers of all the cross-chain resources in the blockchain network managed by the target management unit. If it is determined that all the cross-chain resources include the resource to be called, then according to the resource to be called The identification generates a call instruction and sends it to the target management unit. Among them, the call instruction is used for the target management unit to call the resource to be called in the blockchain network. In the above implementation, by first determining whether the resource to be called belongs to the cross-chain resource managed by the management unit before executing the call operation, not only can the management unit accurately call the cross-chain resource managed by itself, but also avoid unnecessary call operations. , Improve the efficiency of the call.
在一种可选地实现方式中,资源调用请求中还可以包括调用接口,调用接口可以是指各个跨链资源的通用接口中的任意一种或多种。在这种情况下,代理节点根据待调用资源的标识生成调用指令,包括:代理节点根据待调用资源的标识和调用接口生成调用指令。其中,该调用指令用于目标管理单元使用调用接口对区块链网络中的待调用资源进行调用。In an optional implementation manner, the resource call request may also include a call interface, and the call interface may refer to any one or more of the general interfaces of each cross-chain resource. In this case, the proxy node generates the calling instruction according to the identifier of the resource to be called, including: the proxy node generates the calling instruction according to the identifier of the resource to be called and the calling interface. Wherein, the call instruction is used for the target management unit to use the call interface to call the resource to be called in the blockchain network.
在一种可选地实现方式中,调用资源的标识可以为智能合约的合约地址。在这种情况下,代理节点根据待调用资源的标识和调用接口生成调用指令,包括:代理节点根据智能合约的合约地址和调用接口生成调用指令。其中,调用指令用于目标管理单元根据智能合约的合约地址生成合约对象,调用合约对象的调用接口获取或更新智能合约的合约数据。In an optional implementation manner, the identifier of the calling resource may be the contract address of the smart contract. In this case, the proxy node generates a call instruction according to the identification of the resource to be called and the call interface, including: the proxy node generates a call instruction according to the contract address and the call interface of the smart contract. Among them, the call instruction is used by the target management unit to generate a contract object according to the contract address of the smart contract, and call the call interface of the contract object to obtain or update the contract data of the smart contract.
在一种可选地实现方式中,调用资源的标识可以为数据表的表名。在这种情况下,代理节点根据待调用资源的标识和调用接口生成调用指令,包括:代理节点根据数据表的表名和调用接口生成调用指令。其中,调用指令用于目标管理单元根据数据表的表名获取数据表,并根据调用接口查询或修改数据表中的数据。在上述实现方式中,通过为各种跨链资源设置相同的调用接口,使得用户可以基于相同的输入方式调用各个调用资源,而无需针对于每种调用资源进行适配,从而可以减低调用的复杂性,提高调用的效率。In an optional implementation manner, the identifier of the calling resource may be the table name of the data table. In this case, the proxy node generates a call instruction according to the identification of the resource to be called and the call interface, including: the proxy node generates the call instruction according to the table name of the data table and the call interface. Among them, the calling instruction is used for the target management unit to obtain the data table according to the table name of the data table, and to query or modify the data in the data table according to the calling interface. In the above implementation, by setting the same calling interface for various cross-chain resources, users can call each calling resource based on the same input method without adapting to each calling resource, thereby reducing the complexity of calling Improve the efficiency of the call.
在一种可选地实现方式中,跨链资源的标识与区块链网络的对应关系可以按照跨链网络、跨链网络包括的区块链网络、区块链网络中部署的跨链资源的层级关系进行设置。在上述实现方式中,通过按照代理节点管理的每个跨链网络、每个跨链网络中的区块链网络、区块链网络中部署的跨链资源的层级形式设置跨链资源与区块链网络的对应关系,使得代理节点能够灵活地管理各个跨链网络中的跨链资源,有助于代理节点在使用该对应关系时能够基于该对应关系快速地确定跨链资源对应的区块链网络,从而有效提高跨链资源调用的效率。In an optional implementation manner, the correspondence between the identifier of the cross-chain resource and the blockchain network may be based on the cross-chain network, the blockchain network included in the cross-chain network, and the cross-chain resource deployed in the blockchain network. The hierarchical relationship is set. In the above implementation, cross-chain resources and blocks are set according to the hierarchical form of each cross-chain network, each cross-chain network in each cross-chain network, and cross-chain resources deployed in the blockchain network. The correspondence of the chain network enables the proxy node to flexibly manage the cross-chain resources in each cross-chain network, which helps the proxy node to quickly determine the blockchain corresponding to the cross-chain resource based on the correspondence when using the correspondence. Network, thereby effectively improving the efficiency of cross-chain resource calls.
第二方面,本发明提供一种基于跨链网络的资源处理装置,该装置包括:In a second aspect, the present invention provides a resource processing device based on a cross-chain network, the device including:
收发模块,用于接收用户端发送的资源调用请求,该资源调用请求中包括待调用资源的标识;The transceiver module is used to receive the resource call request sent by the user terminal, and the resource call request includes the identifier of the resource to be called;
确定模块,用于根据跨链资源的标识与区块链网络的对应关系,确定待调用资源的标 识对应的区块链网络;The determining module is used to determine the blockchain network corresponding to the identifier of the resource to be called based on the correspondence between the identifier of the cross-chain resource and the blockchain network;
调用模块,用于从待调用资源对应的区块链网络中调用待调用资源,得到调用结果。The calling module is used to call the resource to be called from the blockchain network corresponding to the resource to be called to obtain the calling result.
在一种可选地实现方式中,基于跨链网络的资源处理装置中还可以封装有与各个区块链网络一一对应的管理单元。这种情况下,基于跨链网络的资源处理装置还可以包括部署模块,在收发模块接收用户端发送的资源调用请求之前,收发模块还可以接收用户端发送的部署请求,该部署请求中包括待部署的各个跨链资源和各个跨链资源所需部署的区块链网络的标识。对应的,部署模块可以根据部署请求中任一跨链资源所需部署的区块链网络的标识,确定出该跨链资源对应的管理单元,将该跨链资源分发给该跨链资源对应的管理单元,以使该跨链资源对应的管理单元将该跨链资源部署到该跨链资源对应的管理单元所管理的区块链网络中。收发模块还可以获取各个管理单元对各个跨链资源的部署结果,并根据部署结果生成跨链资源的标识与区块链网络的对应关系。In an optional implementation manner, the resource processing device based on the cross-chain network may also be encapsulated with a management unit corresponding to each blockchain network on a one-to-one basis. In this case, the resource processing device based on the cross-chain network may also include a deployment module. Before the transceiver module receives the resource call request sent by the user terminal, the transceiver module may also receive a deployment request sent by the user terminal. The deployment request includes the deployment request. The identity of each deployed cross-chain resource and the blockchain network that each cross-chain resource needs to deploy. Correspondingly, the deployment module can determine the management unit corresponding to the cross-chain resource according to the identifier of the blockchain network that any cross-chain resource needs to deploy in the deployment request, and distribute the cross-chain resource to the corresponding cross-chain resource The management unit, so that the management unit corresponding to the cross-chain resource deploys the cross-chain resource to the blockchain network managed by the management unit corresponding to the cross-chain resource. The transceiver module can also obtain the deployment result of each cross-chain resource by each management unit, and generate the corresponding relationship between the identifier of the cross-chain resource and the blockchain network according to the deployment result.
在一种可选地实现方式中,调用模块具体用于:先根据待调用资源的标识对应的区块链网络,确定待调用资源对应的目标管理单元,再获取目标管理单元所管理的区块链网络中的全部跨链资源的标识,若确定全部跨链资源中包括待调用资源,则根据待调用资源的标识生成调用指令,并发送给目标管理单元。其中,调用指令用于目标管理单元对区块链网络中的待调用资源进行调用。In an optional implementation manner, the calling module is specifically configured to: first determine the target management unit corresponding to the resource to be called according to the blockchain network corresponding to the identifier of the resource to be called, and then obtain the block managed by the target management unit The identification of all cross-chain resources in the chain network, if it is determined that all the cross-chain resources include the resource to be called, a calling instruction is generated according to the identification of the resource to be called and sent to the target management unit. Among them, the call instruction is used for the target management unit to call the resource to be called in the blockchain network.
在一种可选地实现方式中,资源调用请求中还可以包括调用接口,调用接口可以为各个跨链资源的通用接口中的任意一种或多种。在这种情况下,调用模块具体用于:根据待调用资源的标识和调用接口生成调用指令。其中,调用指令用于目标管理单元使用调用接口对区块链网络中的待调用资源进行调用。In an optional implementation manner, the resource call request may also include a call interface, and the call interface may be any one or more of the general interfaces of each cross-chain resource. In this case, the calling module is specifically used to generate a calling instruction according to the identifier of the resource to be called and the calling interface. Among them, the calling instruction is used by the target management unit to use the calling interface to call the resources to be called in the blockchain network.
在一种可选地实现方式中,调用资源的标识可以为智能合约的合约地址。在这种情况下,调用模块具体用于:根据智能合约的合约地址和调用接口生成调用指令。其中,调用指令用于目标管理单元根据智能合约的合约地址生成合约对象,调用合约对象的调用接口获取或更新智能合约的合约数据。In an optional implementation manner, the identifier of the calling resource may be the contract address of the smart contract. In this case, the calling module is specifically used to generate a calling instruction according to the contract address and calling interface of the smart contract. Among them, the call instruction is used by the target management unit to generate a contract object according to the contract address of the smart contract, and call the call interface of the contract object to obtain or update the contract data of the smart contract.
在一种可选地实现方式中,调用资源的标识可以为数据表的表名。在这种情况下,调用模块具体用于:根据数据表的表名和调用接口生成调用指令。其中,调用指令用于目标管理单元根据数据表的表名获取数据表,并根据调用接口查询或修改数据表中的数据。In an optional implementation manner, the identifier of the calling resource may be the table name of the data table. In this case, the calling module is specifically used to generate a calling instruction according to the table name of the data table and the calling interface. Among them, the calling instruction is used for the target management unit to obtain the data table according to the table name of the data table, and to query or modify the data in the data table according to the calling interface.
在一种可选地实现方式中,跨链资源的标识与区块链网络的对应关系可以按照跨链网络、跨链网络包括的区块链网络、区块链网络中部署的跨链资源的层级关系进行设置。In an optional implementation manner, the correspondence between the identifier of the cross-chain resource and the blockchain network may be based on the cross-chain network, the blockchain network included in the cross-chain network, and the cross-chain resource deployed in the blockchain network. The hierarchical relationship is set.
第三方面,本发明提供一种计算设备,包括至少一个处理器以及至少一个存储器,其中,存储器可以存储有计算机程序,当该计算机程序被处理器执行时,处理器可以执行上述第一方面任意所述的基于跨链网络的资源处理方法。In a third aspect, the present invention provides a computing device including at least one processor and at least one memory. The memory may store a computer program. When the computer program is executed by the processor, the processor can execute any of the above-mentioned first aspects. The resource processing method based on the cross-chain network.
第四方面,本发明提供一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当该计算机程序在计算设备上运行时,计算设备可以执行上述第一方面任意所述的基于跨链网络的资源处理方法。In a fourth aspect, the present invention provides a computer-readable storage medium that stores a computer program executable by a computing device. When the computer program runs on the computing device, the computing device can execute any of the above-mentioned Resource processing method of cross-chain network.
本发明的这些方面或其他方面在以下实施例的描述中会更加简明易懂。These and other aspects of the present invention will be more concise and understandable in the description of the following embodiments.
附图说明Description of the drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领 域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions in the embodiments of the present invention more clearly, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained from these drawings without creative labor.
图1为本发明实施例提供的一种跨链网络的系统架构示意图;FIG. 1 is a schematic diagram of a system architecture of a cross-chain network provided by an embodiment of the present invention;
图2为本发明实施例提供的一种可能的系统架构示意图;FIG. 2 is a schematic diagram of a possible system architecture provided by an embodiment of the present invention;
图3为本发明实施例提供的一种基于跨链网络的资源处理方法对应的流程示意图;FIG. 3 is a schematic flowchart of a resource processing method based on a cross-chain network provided by an embodiment of the present invention;
图4为本发明实施例提供的一种基于跨链网络的资源处理装置的结构示意图;4 is a schematic structural diagram of a resource processing device based on a cross-chain network provided by an embodiment of the present invention;
图5为本发明实施例提供的一种计算设备的结构示意图。Fig. 5 is a schematic structural diagram of a computing device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
图1为本发明实施例提供的一种跨链网络的系统架构示意图,如图1所示,跨链网络10中可以设置有至少两个(即两个或两个以上的)区块链网络,比如区块链网络101、区块链网络102和区块链网络103。其中,至少两个区块链网络中的任意两个区块链网络可以按照设定要求连接,连接的方式可以为有线连接,也可以为无线连接,具体不作限定。FIG. 1 is a schematic diagram of a system architecture of a cross-chain network provided by an embodiment of the present invention. As shown in FIG. 1, at least two (ie, two or more) blockchain networks may be provided in the cross-chain network 10 , Such as blockchain network 101, blockchain network 102, and blockchain network 103. Among them, any two of the at least two blockchain networks can be connected according to the set requirements, and the connection method can be a wired connection or a wireless connection, and the specifics are not limited.
继续参照图1所示,至少两个区块链网络中的每个区块链网络都可以包括一个或多个节点,例如区块链网络101中可以包括节点1011、节点1012、节点1013与节点1014,节点1011~节点1014中的任意两个节点可以通信连接,以共同维护区块链系统。区块链网络中的每个节点都可以具有多种功能,比如路由功能、交易功能、区块链功能和共识功能等。举例来说,区块链网络中的节点可以把其他节点传送过来的交易数据等信息传送给更多的节点以实现节点之间的通信功能。或者,区块链网络中的节点可以用于支持用户进行交易。或者,区块链网络中的节点还可以用于记录历史上的所有交易。或者,区块链网络中的节点可以通过验证和记录交易生成区块链网络中的新区块。在实际应用中,路由功能是区块链网络中的每个节点必须具有的功能,而其它功能可由本领域技术人员根据实际需要进行设置。Continuing to refer to FIG. 1, each of the at least two blockchain networks may include one or more nodes. For example, the blockchain network 101 may include nodes 1011, 1012, 1013, and nodes. 1014, any two nodes among the nodes 1011 to 1014 can be communicatively connected to jointly maintain the blockchain system. Each node in the blockchain network can have multiple functions, such as routing functions, transaction functions, blockchain functions, and consensus functions. For example, a node in a blockchain network can transmit transaction data and other information sent by other nodes to more nodes to realize the communication function between nodes. Alternatively, the nodes in the blockchain network can be used to support users to conduct transactions. Alternatively, the nodes in the blockchain network can also be used to record all transactions in history. Alternatively, nodes in the blockchain network can generate new blocks in the blockchain network by verifying and recording transactions. In practical applications, the routing function is a function that each node in the blockchain network must have, and other functions can be set by those skilled in the art according to actual needs.
需要说明的是,区块链网络中的一个节点可以是指一台物理机(服务器),也可以是指服务器中运行的一个进程或者一系列进程。比如,节点1011可以为服务器上运行的一个进程,或者也可以为是指服务器,具体不作限定。It should be noted that a node in the blockchain network can refer to a physical machine (server), or can refer to a process or a series of processes running in the server. For example, the node 1011 may be a process running on the server, or it may refer to the server, which is not specifically limited.
本发明实施例中,任一区块链网络中均可以部署有专链资源和跨链资源,专链资源为区块链网络执行内部交易所需的资源,而跨链资源为区块链网络执行与其他区块链网络之间的外部交易所需的资源。举例来说,当区块链网络101为交易链网络,区块链网络102为结算链网络,区块链网络103为积分链网络时,跨链网络10可以构成跨链支付网络。交易链网络上部署有交易跨链资源,结算链网络上部署有结算跨链资源,积分链网络上部署有积分跨链资源。交易链网络在使用交易跨链资源执行交易时可以调用结算链网络的结算跨链资源进行资产结算,还可以调用积分链网络根据结算链网络的资产结算结果和交易链网络的交易类型更新积分。In the embodiment of the present invention, dedicated chain resources and cross-chain resources can be deployed in any blockchain network. The dedicated chain resources are the resources required by the blockchain network to execute internal transactions, and the cross-chain resources are the blockchain network. Resources required to perform external transactions with other blockchain networks. For example, when the blockchain network 101 is a transaction chain network, the blockchain network 102 is a settlement chain network, and the blockchain network 103 is a point chain network, the cross-chain network 10 may constitute a cross-chain payment network. Transaction cross-chain resources are deployed on the transaction chain network, settlement cross-chain resources are deployed on the settlement chain network, and point cross-chain resources are deployed on the loyalty chain network. The transaction chain network can call the settlement cross-chain resource of the settlement chain network for asset settlement when using the transaction cross-chain resource to execute the transaction, and can also call the point chain network to update the points according to the asset settlement result of the settlement chain network and the transaction type of the transaction chain network.
需要说明的是,上述仅是一种示例性的简单说明,其所列举的区块网络及区块网络中节点的数量仅是为了便于说明方案,并不构成对方案的限定。在具体实施中,跨链网络所 包含的区块网络的数量可以大于3个,比如可以为4个或4个以上。相应地,每个区块网络所包含的节点数量可以大于4个,比如可以为5个或5个以上,不作限定。It should be noted that the foregoing is only an exemplary simple description, and the block network and the number of nodes in the block network listed therein are only for the convenience of explaining the solution, and do not constitute a limitation on the solution. In a specific implementation, the number of block networks included in the cross-chain network can be greater than 3, for example, it can be 4 or more. Correspondingly, the number of nodes included in each block network can be greater than 4, for example, it can be 5 or more, which is not limited.
图2为本发明实施例提供的一种可能的系统架构示意图,如图2所示,该系统架构中可以设置有代理节点130和至少一个跨链网络,比如跨链网络10、跨链网络11和跨链网络12。其中,跨链网络10中包含区块链网络101、区块链网络102和区块链网络103,跨链网络11中包含区块链网络111和区块链网络112,跨链网络12中包含区块链网络121和区块链网络122。每个跨链网络中的各个区块链网络都可以按照图1所示意的方式进行设置。FIG. 2 is a schematic diagram of a possible system architecture provided by an embodiment of the present invention. As shown in FIG. 2, the system architecture may be provided with a proxy node 130 and at least one cross-chain network, such as a cross-chain network 10 and a cross-chain network 11. And cross-chain network 12. Among them, the cross-chain network 10 includes the blockchain network 101, the blockchain network 102, and the blockchain network 103, the cross-chain network 11 includes the blockchain network 111 and the blockchain network 112, and the cross-chain network 12 includes Block chain network 121 and block chain network 122. Each blockchain network in each cross-chain network can be set up in the manner shown in Figure 1.
继续参照图2所示,该系统架构中还可以设置有用户端140。用户端140可以为设置在开发人员一侧的任意终端设备,比如笔记本电脑、Ipad、手机等。开发人员可以通过用户端140参与跨链网络的开发过程。Continuing to refer to FIG. 2, a user terminal 140 may also be provided in the system architecture. The user terminal 140 may be any terminal device set on the developer's side, such as a notebook computer, an Ipad, a mobile phone, and so on. Developers can participate in the development process of the cross-chain network through the client 140.
本发明实施例中,代理节点130可以分别与用户端140和每个区块链网络连接。例如可以通过有限方式连接,也可以通过无线方式连接,具体不作限定。In the embodiment of the present invention, the proxy node 130 may be connected to the client 140 and each blockchain network respectively. For example, it may be connected in a limited way, or it may be connected in a wireless way, which is not specifically limited.
基于图1和图2所示意的系统架构,图3为本发明实施例提供的一种资源处理方法的流程示意图,该方法可以应用于代理节点,例如图2所示意的代理节点130。如图3所示,该方法包括:Based on the system architecture shown in FIG. 1 and FIG. 2, FIG. 3 is a schematic flowchart of a resource processing method provided by an embodiment of the present invention. The method can be applied to a proxy node, such as the proxy node 130 shown in FIG. 2. As shown in Figure 3, the method includes:
步骤301,代理节点接收用户端发送的资源调用请求,该资源调用请求中包括待调用资源的标识。Step 301: The proxy node receives a resource invocation request sent by the client, and the resource invocation request includes an identifier of the resource to be invoked.
在一种可选地实施方式中,跨链资源可以由开发人员在开发阶段时部署在跨链网络的各个区块链网络中。跨链资源可以是指任意类型的资源,比如可以为部署在区块链网络上的智能合约,或者也可以为存储在区块链网络的数据库中的数据或资产,或者还可以为存储在智能合约中的数据。其中,数据的存储形式可以为数据表,也可以为其它类型,例如栈、图等,不作限定。In an optional implementation manner, the cross-chain resource may be deployed in each blockchain network of the cross-chain network by the developer during the development phase. Cross-chain resources can refer to any type of resources, such as smart contracts deployed on the blockchain network, or data or assets stored in the database of the blockchain network, or can also be stored in the smart contract. The data in the contract. Among them, the storage form of the data may be a data table or other types, such as stacks, graphs, etc., which are not limited.
在一个示例中,待调用资源的标识可以由待调用资源的地址、待调用资源所部署的区块链网络的标识和待调用资源所部署的区块链网络所在的跨链网络的标识构成。举例来说,若待调用资源为区块链网络112上部署的智能合约0X1,则待调用资源的标识可以为“跨链网络11.区块链网络112.0X1”。In one example, the identification of the resource to be called may be composed of the address of the resource to be called, the identification of the blockchain network where the resource to be called is deployed, and the identification of the cross-chain network where the blockchain network where the resource to be called is deployed is located. For example, if the resource to be called is a smart contract 0X1 deployed on the blockchain network 112, the identifier of the resource to be called may be "cross-chain network 11. Blockchain network 112.0X1".
参照图2所示意的系统架构,当需要调用任一跨链网络中的跨链资源时,开发人员可以在用户端140的调用界面上输入待调用资源的标识。这种情况下,用户端140接收到待调用资源的标识后,可以获取代理节点130的网络互联协议(Internet Protocol,IP)地址和代理节点130中用于跨链服务的端口号,然后基于待调用资源的标识、代理节点130的IP地址和用于跨链服务的端口号生成资源调用请求。其中,代理节点130的IP地址和用于跨链服务的端口号可以预先由用户端140与代理节点130交互得到,且还可以由用户端140与代理节点130通过交互进行实时更新。Referring to the system architecture shown in FIG. 2, when it is necessary to call any cross-chain resource in any cross-chain network, the developer can input the identification of the resource to be called on the calling interface of the user terminal 140. In this case, after the client 140 receives the identifier of the resource to be called, it can obtain the Internet Protocol (IP) address of the proxy node 130 and the port number used for the cross-chain service in the proxy node 130, and then based on the The resource call request is generated by calling the identifier of the resource, the IP address of the proxy node 130, and the port number used for the cross-chain service. Wherein, the IP address of the proxy node 130 and the port number used for the cross-chain service can be obtained in advance by the user terminal 140 interacting with the proxy node 130, and can also be updated in real time by the user terminal 140 and the proxy node 130 through interaction.
在一个示例中,资源调用请求可以为基于待调用资源的标识、代理节点的IP地址和用于跨链服务的端口号构建的统一资源定位符(uniform resource locator,URL)地址。比如,若代理节点的IP地址为ip:127.0.0.1,代理节点中用于跨链服务的端口号为8080,待调用资源的标识为“跨链网络11.区块链网络112.0X1”,则资源调用请求可以为“http://127.0.0.1/8080.跨链网络11/区块链网络112/0X1”。In an example, the resource invocation request may be a uniform resource locator (URL) address constructed based on the identifier of the resource to be invoked, the IP address of the proxy node, and the port number used for the cross-chain service. For example, if the IP address of the proxy node is ip:127.0.0.1, the port number used for the cross-chain service in the proxy node is 8080, and the identifier of the resource to be called is "cross-chain network 11. Blockchain network 112.0X1", then The resource call request can be "http://127.0.0.1/8080. Cross-chain network 11/Blockchain network 112/0X1".
步骤302,代理节点根据资源标识与区块链网络的对应关系,确定待调用资源的标识 对应的区块链网络。In step 302, the agent node determines the blockchain network corresponding to the identifier of the resource to be invoked according to the corresponding relationship between the resource identifier and the blockchain network.
在一种可能的实现方式中,代理节点中还可以封装有与各个区块链网络一一对应的管理单元,代理节点可以通过各个管理单元间接地与各个区块链网络连接。举例来说,继续参照图2所示,代理节点130中可以分别封装有区块链网络101对应的管理单元1、区块链网络102对应的管理单元2、区块链网络103对应的管理单元3、区块链网络111对应的管理单元4、区块链网络112对应的管理单元5、区块链网络121对应的管理单元6、区块链网络122对应的管理单元7,代理节点130可以分别通过管理单元1~管理单元7实现与区块链网络101~区块链网络103、区块链网络111和区块链网络112、区块链网络121和区块链网络122的连接。In a possible implementation manner, the agent node may also be encapsulated with management units corresponding to each block chain network one-to-one, and the agent node may be indirectly connected to each block chain network through each management unit. For example, continuing to refer to FIG. 2, the proxy node 130 may respectively encapsulate a management unit corresponding to the blockchain network 101, a management unit corresponding to the blockchain network 102, and a management unit corresponding to the blockchain network 103. 3. The management unit 4 corresponding to the blockchain network 111, the management unit 5 corresponding to the blockchain network 112, the management unit 6 corresponding to the blockchain network 121, the management unit 7 corresponding to the blockchain network 122, and the proxy node 130 can The connection to the blockchain network 101 to the blockchain network 103, the blockchain network 111 and the blockchain network 112, and the blockchain network 121 and the blockchain network 122 are realized through the management unit 1 to the management unit 7, respectively.
在该实现方式中,封装可以具有多种含义,比如在一种情况下,管理单元可以为部署在代理节点内部的软件工具开发包(Software Development Kit,SDK)组件,或者也可以为独立于代理节点外部的设备,并通过远程过程调用(Remote Procedure Call,RPC)协议来实现与代理节点的通信。且,管理单元虽然封装在代理节点中,但是管理单元上运行的应用程序独立于代理节点上运行的应用程序,管理单元上运行的应用程序用于管理所连接的区块链网络中的节点和资源,而代理节点上运行的应用程序用于管理管理单元。In this implementation, packaging can have multiple meanings. For example, in one case, the management unit can be a software development kit (SDK) component deployed inside the agent node, or it can be independent of the agent. The equipment outside the node realizes the communication with the agent node through the remote procedure call (Remote Procedure Call, RPC) protocol. Moreover, although the management unit is encapsulated in the agent node, the application program running on the management unit is independent of the application program running on the agent node. The application program running on the management unit is used to manage the nodes and nodes in the connected blockchain network. Resources, and the application program running on the agent node is used to manage the management unit.
本发明实施例中,管理单元可以与该管理单元对应的区块链网络中的每个节点进行通信连接。比如可以通过与每个节点有线连接或无线连接以实现通信,也可以在每个节点上部署SDK组件,通过各个节点上的SDK组件实现与各个节点的通信,具体不作限定。In the embodiment of the present invention, the management unit may communicate with each node in the blockchain network corresponding to the management unit. For example, communication can be achieved through wired or wireless connection with each node, or SDK components can be deployed on each node, and communication with each node can be achieved through SDK components on each node, which is not specifically limited.
在该种实现方式的一个示例中,继续参照图2所示,开发人员可以通过如下方式部署跨链资源:In an example of this implementation, referring to Figure 2, developers can deploy cross-chain resources in the following ways:
步骤a,开发人员通过用户端140将待部署的各个跨链资源的配置信息发送给代理节点130。Step a: The developer sends the configuration information of each cross-chain resource to be deployed to the agent node 130 through the client 140.
在上述步骤a中,每个跨链资源的配置信息中可以包括跨链资源所需部署的区块链网络的标识、所需部署的区块链网络所在的跨链网络的标识和跨链资源。当跨链资源的类型不同时,跨链资源也不同。比如若跨链资源为智能合约,则跨链资源可以包括智能合约的实现逻辑(或者实现逻辑和初始数据)。又比如若跨链资源为资产,则跨链资源的数据可以包括各个账户的资产类型及资产类型对应的值。In the above step a, the configuration information of each cross-chain resource can include the identification of the blockchain network to be deployed by the cross-chain resource, the identification of the cross-chain network where the blockchain network to be deployed is located, and the cross-chain resource . When the types of cross-chain resources are different, the cross-chain resources are also different. For example, if the cross-chain resource is a smart contract, the cross-chain resource may include the implementation logic (or implementation logic and initial data) of the smart contract. For another example, if the cross-chain resource is an asset, the data of the cross-chain resource may include the asset type of each account and the value corresponding to the asset type.
具体实施中,代理节点130可以预先向各个用户端开放注册界面,若用户端140具有注册权限,则用户端140可以通过在代理节点130的注册界面中输入跨链资源的配置信息,从而将跨链资源的配置信息发送给代理节点130。In specific implementation, the proxy node 130 can open the registration interface to each client in advance. If the client 140 has the registration authority, the client 140 can input the configuration information of the cross-chain resource in the registration interface of the proxy node 130, so that the cross-chain resource configuration information can be entered in the registration interface of the proxy node 130. The configuration information of the chain resource is sent to the agent node 130.
步骤b,代理节点130根据待部署的各个跨链资源的配置信息确定各个跨链资源对应的管理单元,并将待部署的各个跨链资源分发给对应的管理单元。Step b: The proxy node 130 determines the management unit corresponding to each cross-chain resource according to the configuration information of each cross-chain resource to be deployed, and distributes each cross-chain resource to be deployed to the corresponding management unit.
具体实施中,针对于任一待部署的跨链资源,代理节点130可以先根据该跨链资源所需部署的区块链网络和所需部署的区块链网络所在的跨链网络的标识确定其对应的管理单元,然后将跨链资源的数据分发给对应的管理单元。举例来说,如图2所示,若某一跨链资源为智能合约,且该智能合约所需部署的区块链网络为跨链系统11中的区块链网络112,则由于管理单元5用于管理区块链网络112中的每个节点,因此该智能合约对应的区块链网络为管理单元5,代理节点130可以将该智能合约发送给管理单元5。In specific implementation, for any cross-chain resource to be deployed, the proxy node 130 may first determine the identity of the blockchain network to be deployed and the cross-chain network where the blockchain network to be deployed is located. The corresponding management unit then distributes the data of the cross-chain resource to the corresponding management unit. For example, as shown in Figure 2, if a certain cross-chain resource is a smart contract, and the blockchain network to be deployed by the smart contract is the blockchain network 112 in the cross-chain system 11, the management unit 5 It is used to manage each node in the blockchain network 112, so the blockchain network corresponding to the smart contract is the management unit 5, and the agent node 130 can send the smart contract to the management unit 5.
步骤c,管理单元接收到待部署的跨链资源后,将跨链资源部署在其管理的区块链网络中。Step c: After receiving the cross-chain resource to be deployed, the management unit deploys the cross-chain resource in the blockchain network under its management.
举例来说,若管理单元5接收到代理节点130发送的智能合约,则管理单元5可以通过节点上部署的SDK组件向区块链网络112中的任一节点(或全部节点)发送该智能合约,以使区块链网络112中的各个节点部署该执行合约到区块链网络112中。若部署成功,则任一节点可以将该智能合约在区块链网络112中部署的地址发送给管理单元5,若部署失败,则各个节点可以重试多次,若重试预设次数后仍失败,则可以向管理单元5发送部署失败的响应消息。For example, if the management unit 5 receives the smart contract sent by the agent node 130, the management unit 5 can send the smart contract to any node (or all nodes) in the blockchain network 112 through the SDK component deployed on the node , So that each node in the blockchain network 112 deploys the execution contract to the blockchain network 112. If the deployment is successful, any node can send the address of the smart contract deployed in the blockchain network 112 to the management unit 5. If the deployment fails, each node can retry multiple times. If it fails, a response message of deployment failure may be sent to the management unit 5.
步骤d,管理单元将各个待部署的跨链资源的部署结果发送给代理节点130。In step d, the management unit sends the deployment result of each cross-chain resource to be deployed to the agent node 130.
在上述步骤d中,在部署成功的情况下:若跨链资源为智能合约,则跨链资源的部署结果可以为智能合约在区块链网络中的地址;若跨链资源为数据表中的数据,则跨链资源的部署结果可以为数据表的表名;若跨链资源为资产,则跨链资源的部署结果可以为资产账户名。In the above step d, in the case of successful deployment: if the cross-chain resource is a smart contract, the deployment result of the cross-chain resource can be the address of the smart contract in the blockchain network; if the cross-chain resource is in the data table Data, the deployment result of the cross-chain resource can be the table name of the data table; if the cross-chain resource is an asset, the deployment result of the cross-chain resource can be the asset account name.
步骤e,代理节点130将各个管理单元的部署结果发送给用户端140。In step e, the proxy node 130 sends the deployment result of each management unit to the client 140.
在一个示例中,代理节点130还可以根据各个管理单元的部署结果生成跨链资源与区块链网络的对应关系,该对应关系可以用于指示已部署的各个跨链资源与所部属的区块链网络的对应关系。其中,该对应关系可以以表格的形式存储,或者也可以以图的形式存储,不作限定。In an example, the proxy node 130 can also generate a correspondence between the cross-chain resource and the blockchain network according to the deployment result of each management unit, and the correspondence can be used to indicate the deployed cross-chain resources and the assigned block. Correspondence of the chain network. Wherein, the corresponding relationship may be stored in the form of a table, or may also be stored in the form of a graph, which is not limited.
举例来说,以图2所示意的系统架构为例,表1示例性示出一种跨链资源与区块链网络的对应关系的示意表。For example, taking the system architecture shown in FIG. 2 as an example, Table 1 exemplarily shows a schematic table of the correspondence between cross-chain resources and blockchain networks.
Figure PCTCN2020121949-appb-000001
Figure PCTCN2020121949-appb-000001
表1Table 1
如表1所示,跨链资源与区块链网络的对应关系中可以包括代理节点130管理的每个跨链网络上的资源部署情况,每个跨链网络上的资源部署情况可以包括该跨链网络中每个区块链网络上部署的跨链资源和每个区块链网络对应的管理单元。比如跨链网络11中包括区块链网络111和区块链网络112,区块链网络111对应管理单元4,区块链网络111上部署有智能合约0X3和数据表2,区块链网络112对应管理单元5,区块链网络112上部署有数据表3。As shown in Table 1, the correspondence between cross-chain resources and blockchain networks can include the resource deployment status of each cross-chain network managed by the agent node 130, and the resource deployment status of each cross-chain network can include the cross-chain network. The cross-chain resources deployed on each blockchain network in the chain network and the management unit corresponding to each blockchain network. For example, the cross-chain network 11 includes a blockchain network 111 and a blockchain network 112. The blockchain network 111 corresponds to the management unit 4. The blockchain network 111 is deployed with smart contract 0X3 and data table 2, and the blockchain network 112 Corresponding to the management unit 5, a data table 3 is deployed on the blockchain network 112.
本发明实施例中,通过按照代理节点管理的每个跨链网络、每个跨链网络中的区块链网络、区块链网络中部署的跨链资源的层级形式设置跨链资源与区块链网络的对应关系,不仅能使代理节点灵活地管理各个跨链网络中的跨链资源,还有助于代理节点基于该对应关系快速确定出跨链资源对应的区块链网络,以提高跨链资源调用的效率。In the embodiment of the present invention, cross-chain resources and blocks are set according to the hierarchical form of each cross-chain network managed by the agent node, each blockchain network in each cross-chain network, and cross-chain resources deployed in the blockchain network. The correspondence relationship of the chain network not only enables the agent node to flexibly manage the cross-chain resources in each cross-chain network, but also helps the agent node to quickly determine the blockchain network corresponding to the cross-chain resource based on the corresponding relationship, so as to improve the cross-chain resources. The efficiency of chain resource calls.
在一种可选地实现方式中,代理节点130在接收到资源调用请求后,还可以先从资源调用请求中解析得到待调用资源的标识,再根据待调用资源的标识查询资源标识与区块链 网络的对应关系,以确定出待调用资源的标识对应的区块链网络。In an optional implementation manner, after receiving the resource call request, the proxy node 130 may first parse the resource call request to obtain the identifier of the resource to be called, and then query the resource identifier and block according to the identifier of the resource to be called. The corresponding relationship of the chain network to determine the blockchain network corresponding to the identifier of the resource to be called.
步骤303,代理节点从待调用资源对应的区块链系统中调用待调用资源,得到调用结果。Step 303: The proxy node calls the resource to be called from the blockchain system corresponding to the resource to be called, and obtains the calling result.
本发明实施例中,代理节点也可以直接与所管理的各个跨链网络中的每个节点连接,如此,当确定待调用资源的标识对应的区块链网络后,代理节点可以直接将待调用资源对应的调用请求发送给该区块链网络的任一节点,以使该区块链网络中的各个节点调用待调用资源执行调用操作。然而,采用该种方式,代理节点不仅需要管理各个跨链网络的跨链资源,还需要执行跨链资源的调用操作,从而代理节点的压力较大,性能损耗较为严重。In the embodiment of the present invention, the proxy node can also be directly connected to each node in each cross-chain network under management. In this way, after determining the blockchain network corresponding to the identifier of the resource to be called, the proxy node can directly The call request corresponding to the resource is sent to any node of the blockchain network, so that each node in the blockchain network calls the resource to be called to perform the call operation. However, in this way, the agent node not only needs to manage the cross-chain resources of each cross-chain network, but also needs to perform the call operation of the cross-chain resources, so the agent node is under greater pressure and the performance loss is more serious.
为了解决上述问题,在一种可能的实现方式中,代理节点通过各个管理单元间接地与各个跨链网络中的节点连接,每个管理单元管理一个区块链网络。如此,当从调用请求中解析得到待调用资源的标识后,代理节点可以先根据待调用资源的标识中的跨链网络的标识查询表1,以得到该跨链网络中的各个区块链网络以及各个区块链网络对应的管理单元,进而再根据待调用资源的标识中的区块链网络的标识,确定出待调用资源的标识中的区块链网络对应的管理单元,将该管理单元作为待调用资源对应的管理单元,然后将待调用资源的调用请求发送给该待调用资源对应的管理单元。In order to solve the above problems, in a possible implementation manner, the proxy node is indirectly connected to the nodes in each cross-chain network through each management unit, and each management unit manages a blockchain network. In this way, after the identification of the resource to be invoked is obtained from the invocation request, the proxy node can first query Table 1 according to the identification of the cross-chain network in the identification of the resource to be invoked to obtain each blockchain network in the cross-chain network And the management unit corresponding to each blockchain network, and then according to the identifier of the blockchain network in the identifier of the resource to be called, the management unit corresponding to the blockchain network in the identifier of the resource to be called is determined, and the management unit As the management unit corresponding to the resource to be called, the call request of the resource to be called is sent to the management unit corresponding to the resource to be called.
举例来说,若资源调用请求为“http://127.0.0.1/8080.跨链网络11/区块链网络111/0X3”,则代理节点可以先从“http://127.0.0.1/8080.跨链网络11/区块链网络111/0X3”中还原出待调用资源的标识“跨链网络11.区块链网络111.0X3”,然后再根据待调用资源的标识中的跨链网络的标识“跨链网络11”从表1中拉取得到跨链网络11下的全部管理单元,即管理单元4和管理单元5,管理单元4用于管理区块链网络111,管理单元5用于管理区块链网络112。如此,代理节点可以根据待调用资源的标识中的区块链网络的标识“区块链网络111”从跨链网络11下的全部管理单元中确定出管理区块链网络111的管理单元,即管理单元4,进而可以根据待调用的跨链资源智能合约0X3的标识生成调用指令,并将调用指令发送给管理单元4。For example, if the resource call request is "http://127.0.0.1/8080. Cross-chain network 11/Blockchain network 111/0X3", the proxy node can start from "http://127.0.0.1/8080 .Cross-chain network 11/blockchain network 111/0X3" restores the identity of the resource to be called "cross-chain network 11. Blockchain network 111.0X3", and then according to the cross-chain network in the identity of the resource to be called The identification "cross-chain network 11" is pulled from Table 1 to all management units under cross-chain network 11, namely management unit 4 and management unit 5. Management unit 4 is used to manage blockchain network 111, and management unit 5 is used to Manage the blockchain network 112. In this way, the proxy node can determine the management unit that manages the blockchain network 111 from all the management units under the cross-chain network 11 according to the identifier of the blockchain network "blockchain network 111" in the identifier of the resource to be called, namely The management unit 4 may further generate a call instruction according to the identification of the cross-chain resource smart contract 0X3 to be called, and send the call instruction to the management unit 4.
在上述实现方式中,通过将跨链资源的管理工作放置在代理节点处执行,将各个区块链网络中跨链资源的调用工作放置在各个区块链网络对应的管理单元处执行,不仅可以解耦跨链资源的管理工作和跨链资源的调用工作,提高资源处理的灵活性,还可以降低代理节点的压力和性能损耗。In the above implementation, by placing the management work of cross-chain resources at the proxy node for execution, the call work of cross-chain resources in each blockchain network is placed at the management unit corresponding to each blockchain network for execution, not only can The decoupling of cross-chain resource management and cross-chain resource invocation work improves the flexibility of resource processing, and can also reduce the pressure and performance loss of agent nodes.
在一种可能的实现方式中,资源调用请求中还可以包括调用接口,调用接口可以为各种跨链资源的通用接口中的一种或多种。这种情况下,代理节点在确定出待调用跨链资源对应的管理单元之后,还可以根据待调用的跨链资源的标识和调用接口生成调用指令,并将调用指令发送给对应的管理单元。其中,各种跨链资源的通用接口可以是基于各种跨链资源的资源访问需求进行设置,也可以由本领域技术人员根据经验进行设置,具体不作限定。In a possible implementation manner, the resource call request may also include a call interface, and the call interface may be one or more of the general interfaces of various cross-chain resources. In this case, after determining the management unit corresponding to the cross-chain resource to be called, the proxy node may also generate a call instruction according to the identification and call interface of the cross-chain resource to be called, and send the call instruction to the corresponding management unit. Among them, the general interface of various cross-chain resources can be set based on the resource access requirements of various cross-chain resources, or can be set by those skilled in the art based on experience, and the details are not limited.
示例性地,跨链资源可以具有如下几种通用接口:Exemplarily, cross-chain resources can have the following general interfaces:
getData()接口,用于获取部署在区块链网络中的数据表或数据库中的数据或资产;The getData() interface is used to obtain the data or assets in the data table or database deployed in the blockchain network;
setData()接口,用于更新部署在区块链网络中的数据表或数据库中的数据或资产,更新操作为增加、删除或修改;The setData() interface is used to update the data or assets in the data table or database deployed in the blockchain network. The update operation is to add, delete or modify;
call()接口,用于调用部署在区块链网络中的智能合约的逻辑以获取智能合约中的数据;The call() interface is used to call the logic of the smart contract deployed in the blockchain network to obtain the data in the smart contract;
sendTransaction()接口:用于调用部署在区块链网络中的智能合约的逻辑以对智能合约 中的数据进行操作;sendTransaction() interface: used to call the logic of the smart contract deployed in the blockchain network to operate on the data in the smart contract;
registerEventHandler()接口,用于在区块链网络上注册埋点事件,当区块链网络上的埋点事件被触发时,该接口可以将埋点事件被触发的信息主动推送到设定地址。The registerEventHandler() interface is used to register a buried event on the blockchain network. When a buried event on the blockchain network is triggered, this interface can actively push the information that the buried event is triggered to the set address.
在该示例中,call()接口仅用于获取智能合约中的数据,而不执行交易,因此call()接口不会更新智能合约中的数据,相应地也不会更新区块链网络中的数据。而sendTransaction()接口用于使用智能合约中的数据执行操作,因此sendTransaction()接口会更新智能合约中的数据,相应地也会更新区块链网络中的数据。In this example, the call() interface is only used to obtain the data in the smart contract, but does not execute the transaction. Therefore, the call() interface will not update the data in the smart contract, and accordingly will not update the data in the blockchain network. data. The sendTransaction() interface is used to perform operations using the data in the smart contract, so the sendTransaction() interface will update the data in the smart contract, and the data in the blockchain network will be updated accordingly.
本发明实施例中,getData()接口和setData()接口通常用于对数据表进行操作,而call()接口和sendTransaction()接口通常用于对智能合约进行操作。In the embodiment of the present invention, the getData() interface and the setData() interface are usually used to operate on the data table, and the call() interface and the sendTransaction() interface are usually used to operate on the smart contract.
举个例子,若跨链资源为智能合约0X3(即跨链资源的标识为智能合约的地址0X03),则智能合约0X3在被部署到区块链网络111后,区块链网络111会在智能合约0X3的地址处存储智能合约0X3的上述5个调用接口以及智能合约0X3的合约数据。如此,若管理单元4接收到“智能合约0X3,call()接口”的调用指令,则管理单元4可以先基于智能合约0X3的地址创建智能合约0X3的合约对象,然后调用智能合约0X3的合约对象的call()接口来获取智能合约0X3中的合约数据,即智能合约0X3的地址处存储的合约数据,并得到调用结果。For example, if the cross-chain resource is a smart contract 0X3 (that is, the identifier of the cross-chain resource is the address of the smart contract 0X03), then after the smart contract 0X3 is deployed to the blockchain network 111, the blockchain network 111 will be in the smart contract The address of the contract 0X3 stores the above 5 call interfaces of the smart contract 0X3 and the contract data of the smart contract 0X3. In this way, if the management unit 4 receives the call instruction of "smart contract 0X3, call() interface", the management unit 4 can first create a smart contract 0X3 contract object based on the address of the smart contract 0X3, and then call the smart contract 0X3 contract object The call() interface is used to obtain the contract data in the smart contract 0X3, that is, the contract data stored at the address of the smart contract 0X3, and get the call result.
再举个例子,若跨链资源为数据表Table(即跨链资源的标识为数据表的表名Table),则数据表Table在被部署到区块链网络后,区块链网络会在数据表Table的地址处存储数据表Table的上述5个调用接口以及数据表的数据。如此,若管理单元接收到“数据表Table,setData()接口”的调用指令,则管理单元可以先根据数据表Table的表名打开数据表Table,并在打开的过程中创建第一合约的合约对象,然后调用第一合约的合约对象的setData()接口来更新数据表Table中的数据,并得到调用结果。这种情况下,第一合约可以为预先部署在区块链网络中的合约,第一合约用于对数据表中的数据进行操作。For another example, if the cross-chain resource is a data table Table (that is, the identifier of the cross-chain resource is the table name Table of the data table), after the data table Table is deployed to the blockchain network, the blockchain network will The address of the table stores the above five calling interfaces of the data table and the data of the data table. In this way, if the management unit receives the call instruction of "data table Table, setData() interface", the management unit can first open the data table Table according to the table name of the data table Table, and create the contract of the first contract during the opening process Object, and then call the setData() interface of the contract object of the first contract to update the data in the data table Table, and get the call result. In this case, the first contract may be a contract pre-deployed in the blockchain network, and the first contract is used to operate on the data in the data table.
需要说明的是,上述仅是一种示例性的说明,并不构成对本方案的限定。可以理解的,本发明实施例中的调用操作可以为单个区块链网络中的调用操作,也可以为多个区块链网络中的交互调用操作,不作限定。It should be noted that the foregoing is only an exemplary description, and does not constitute a limitation to the solution. It is understandable that the calling operation in the embodiment of the present invention may be a calling operation in a single blockchain network, or may be an interactive calling operation in multiple blockchain networks, and is not limited.
本发明实施例中,通过为各种调用资源设置相同的调用接口,使得用户可以基于相同的输入方式调用各个调用资源,而无需针对于每种调用资源进行适配,从而可以减低开发的复杂性,提高开发的效率。In the embodiment of the present invention, by setting the same calling interface for various calling resources, the user can call each calling resource based on the same input mode without adapting to each calling resource, thereby reducing the complexity of development , Improve the efficiency of development.
在一个示例中,管理单元中也可以设置有如下所示的接口:In an example, the following interface can also be set in the management unit:
getResource()接口,用于获取管理单元所管理的全部资源;The getResource() interface is used to obtain all the resources managed by the management unit;
getBlockHeader()接口,用于获取管理单元所管理的区块链网络的区块头信息。The getBlockHeader() interface is used to obtain the block header information of the blockchain network managed by the management unit.
具体实施中,管理单元在接收到调用指令后,可以先使用getResource()接口拉取管理单元所管理的全部资源,并确定所管理的全部资源中是否包含调用指令中的待调用资源,若不包含,则可以向代理节点130发送调用失败的响应消息,若包含,则可以执行调用操作。In specific implementation, after receiving the call instruction, the management unit can first use the getResource() interface to pull all the resources managed by the management unit, and determine whether all the resources managed include the resources to be called in the call instruction. If it contains, it can send a call failure response message to the proxy node 130, and if it contains, it can perform the call operation.
在上述示例中,通过在执行调用操作之前先判断待调用资源是否属于自己所管理的跨链资源,不仅能使管理单元准确调用自己所管理的跨链资源,还能避免无谓的调用操作,提高调用的效率。In the above example, by judging whether the resource to be called belongs to the cross-chain resource managed by itself before executing the call operation, not only can the management unit accurately call the cross-chain resource managed by itself, but also avoid unnecessary call operations and improve The efficiency of the call.
本发明实施例中,在管理单元接收到区块链网络发送的调用结果之后,管理单元还可 以经由代理节点将待调用资源的调用结果发送回用户端。如此,开发人员通过用户端获取到调用结果后,可以根据调用结果执行后续操作,比如确定跨链网络上部署的各个跨链资源是否准确、是否对跨链网络进行业务上线,等等。In the embodiment of the present invention, after the management unit receives the call result sent by the blockchain network, the management unit may also send the call result of the resource to be called back to the client via the proxy node. In this way, after the developer obtains the call result through the user terminal, he can perform follow-up operations based on the call result, such as determining whether each cross-chain resource deployed on the cross-chain network is accurate, whether the cross-chain network is online, and so on.
本发明的上述实施例中,代理节点先接收用户端发送的资源调用请求,再根据资源调用请求中携带的跨链资源的标识与区块链网络的对应关系,确定待调用资源的标识对应的区块链网络,进而从待调用资源对应的区块链网络中调用待调用资源,得到调用结果。在该实施例中,通过设置代理节点来管理跨链网络中的跨链资源,使得用户端直接向代理节点发送资源调用请求即可完成对跨链网络中的跨链资源的调用,有助于简化用户端的操作流程。且,该种方式能够采用统一的调用方式调用不同区块链网络中的不同资源,而不需要再对各个区块链网络进行一一适配,从而灵活性更好,用户的体验更好。In the above-mentioned embodiment of the present invention, the proxy node first receives the resource call request sent by the user terminal, and then determines the corresponding relationship between the identifier of the cross-chain resource carried in the resource call request and the blockchain network. The blockchain network then calls the resource to be called from the blockchain network corresponding to the resource to be called to obtain the calling result. In this embodiment, a proxy node is set to manage the cross-chain resources in the cross-chain network, so that the user can directly send a resource call request to the proxy node to complete the call to the cross-chain resources in the cross-chain network, which is helpful Simplify the operation process on the user side. Moreover, this method can use a unified calling method to call different resources in different blockchain networks, without the need to adapt each blockchain network one by one, so that the flexibility is better and the user experience is better.
针对上述方法流程,本发明实施例还提供一种基于跨链网络的资源处理装置,该装置的具体内容可以参照上述方法实施。In view of the foregoing method flow, an embodiment of the present invention also provides a resource processing device based on a cross-chain network, and the specific content of the device can be implemented with reference to the foregoing method.
图4为本发明实施例提供的一种基于跨链网络的资源处理装置,该装置包括:Fig. 4 is a resource processing device based on a cross-chain network provided by an embodiment of the present invention, and the device includes:
收发模块401,用于接收用户端发送的资源调用请求,所述资源调用请求中包括待调用资源的标识;The transceiver module 401 is configured to receive a resource call request sent by a user terminal, where the resource call request includes an identifier of the resource to be called;
确定模块402,用于根据跨链资源的标识与区块链网络的对应关系,确定所述待调用资源的标识对应的区块链网络;The determining module 402 is configured to determine the blockchain network corresponding to the identifier of the resource to be called according to the corresponding relationship between the identifier of the cross-chain resource and the blockchain network;
调用模块403,用于从所述待调用资源对应的区块链网络中调用所述待调用资源,得到调用结果。The calling module 403 is used to call the resource to be called from the blockchain network corresponding to the resource to be called to obtain the calling result.
可选地,所述装置中封装有与各个区块链网络一一对应的管理单元。该装置还可以包括部署模块404,在所述收发模块401接收用户端发送的资源调用请求之前,所述收发模块401还用于接收所述用户端发送的部署请求,所述部署请求中包括待部署的各个跨链资源和所述各个跨链资源所需部署的区块链网络的标识。所述部署模块404用于针对于任一跨链资源,根据所述部署请求中所述跨链资源所需部署的区块链网络的标识,确定所述跨链资源对应的管理单元,将所述跨链资源分发给所述跨链资源对应的管理单元,以使所述管理单元将所述跨链资源部署到所述管理单元管理的区块链网络中;获取所述各个管理单元对所述各个跨链资源的部署结果,并根据所述部署结果生成所述跨链资源的标识与区块链网络的对应关系。Optionally, a management unit corresponding to each blockchain network is packaged in the device. The device may also include a deployment module 404. Before the transceiver module 401 receives a resource invocation request sent by the client, the transceiver module 401 is further configured to receive a deployment request sent by the client. The deployment request includes The identity of each deployed cross-chain resource and the blockchain network that each cross-chain resource needs to be deployed. The deployment module 404 is configured to, for any cross-chain resource, determine the management unit corresponding to the cross-chain resource according to the identifier of the blockchain network that the cross-chain resource needs to be deployed in the deployment request, and then The cross-chain resource is distributed to the management unit corresponding to the cross-chain resource, so that the management unit deploys the cross-chain resource to the blockchain network managed by the management unit; and obtains the management unit The deployment result of each cross-chain resource is described, and the corresponding relationship between the identifier of the cross-chain resource and the blockchain network is generated according to the deployment result.
可选地,所述调用模块403具体用于:根据所述待调用资源的标识对应的区块链网络,确定所述待调用资源对应的目标管理单元,获取所述目标管理单元所管理的区块链网络中的全部跨链资源的标识,根据所述目标管理单元所管理的区块链网络中的全部跨链资源的标识,若确定所述全部跨链资源中包括所述待调用资源,则根据所述待调用资源的标识生成调用指令,并发送给所述目标管理单元;所述调用指令用于所述目标管理单元对区块链网络中的所述待调用资源进行调用。Optionally, the calling module 403 is specifically configured to: determine the target management unit corresponding to the resource to be called according to the blockchain network corresponding to the identifier of the resource to be called, and obtain the area managed by the target management unit. The identification of all cross-chain resources in the blockchain network is based on the identification of all the cross-chain resources in the blockchain network managed by the target management unit, if it is determined that all the cross-chain resources include the resource to be called, A call instruction is generated according to the identifier of the resource to be called and sent to the target management unit; the call instruction is used by the target management unit to call the resource to be called in the blockchain network.
可选地,所述资源调用请求中还包括调用接口,所述调用接口为各个跨链资源的通用接口中的任意一种或多种。这种情况下,所述调用模块403具体用于:根据所述待调用资源的标识和所述调用接口生成所述调用指令,所述调用指令用于所述目标管理单元使用所述调用接口对区块链网络中的所述待调用资源进行调用。Optionally, the resource call request further includes a call interface, and the call interface is any one or more of the general interfaces of each cross-chain resource. In this case, the invoking module 403 is specifically configured to: generate the invoking instruction according to the identifier of the resource to be invoked and the invoking interface, and the invoking instruction is used by the target management unit to use the invoking interface to pair The resource to be called in the blockchain network is called.
可选地,所述调用资源的标识为智能合约的合约地址。这种情况下,所述调用模块403具体用于:根据所述智能合约的合约地址和所述调用接口生成所述调用指令,所述调用指 令用于所述目标管理单元根据所述智能合约的合约地址生成合约对象,调用所述合约对象的所述调用接口获取或更新所述智能合约的合约数据。Optionally, the identifier of the calling resource is the contract address of the smart contract. In this case, the invoking module 403 is specifically configured to generate the invoking instruction according to the contract address of the smart contract and the invoking interface, and the invoking instruction is used by the target management unit according to the smart contract. The contract address generates a contract object, and calls the calling interface of the contract object to obtain or update the contract data of the smart contract.
可选地,所述调用资源的标识为数据表的表名。这种情况下,所述调用模块403具体用于:根据所述数据表的表名和所述调用接口生成所述调用指令,所述调用指令用于所述目标管理单元根据所述数据表的表名获取所述数据表,并根据所述调用接口查询或修改所述数据表中的数据。Optionally, the identifier of the calling resource is the table name of the data table. In this case, the invoking module 403 is specifically configured to generate the invoking instruction according to the table name of the data table and the invoking interface, and the invoking instruction is used by the target management unit according to the table of the data table. Obtain the data table by name, and query or modify the data in the data table according to the calling interface.
可选地,所述跨链资源的标识与区块链网络的对应关系按照跨链网络、跨链网络包括的区块链网络、区块链网络中部署的跨链资源的层级关系进行设置。Optionally, the corresponding relationship between the identifier of the cross-chain resource and the blockchain network is set according to the hierarchical relationship of the cross-chain network, the blockchain network included in the cross-chain network, and the cross-chain resources deployed in the blockchain network.
从上述内容可以看出:本发明的上述实施例中,代理节点先接收用户端发送的资源调用请求,再根据资源调用请求中携带的跨链资源的标识与区块链网络的对应关系,确定待调用资源的标识对应的区块链网络,从待调用资源对应的区块链网络中调用待调用资源,得到调用结果。在该种实施例中,通过设置代理节点管理跨链网络中的跨链资源,使得用户端直接向代理节点发送资源调用请求即可完成对跨链网络中的跨链资源的调用,从而有助于简化用户端的操作流程。且,该种方式还能够采用统一的调用方式调用不同区块链网络的不同资源,而不需要再对各个区块链网络进行一一适配,从而灵活性更好,用户的体验更好。It can be seen from the above content that in the above-mentioned embodiment of the present invention, the proxy node first receives the resource call request sent by the client, and then determines the correspondence between the cross-chain resource identifier carried in the resource call request and the blockchain network. The blockchain network corresponding to the identifier of the resource to be called calls the resource to be called from the blockchain network corresponding to the resource to be called, and the calling result is obtained. In this embodiment, by setting a proxy node to manage the cross-chain resources in the cross-chain network, the user can directly send a resource call request to the proxy node to complete the call to the cross-chain resources in the cross-chain network, which is helpful To simplify the operation process of the user side. Moreover, this method can also use a unified calling method to call different resources of different blockchain networks, without the need to adapt each blockchain network one by one, so that the flexibility is better and the user experience is better.
基于同一发明构思,本发明实施例还提供了一种计算设备,如图5所示,该计算设备可以包括至少一个处理器501,以及与至少一个处理器连接的存储器502,本发明实施例中不限定处理器501与存储器502之间的具体连接介质,图5中处理器501和存储器502之间通过总线连接为例。总线可以分为地址总线、数据总线、控制总线等。Based on the same inventive concept, an embodiment of the present invention also provides a computing device. As shown in FIG. 5, the computing device may include at least one processor 501 and a memory 502 connected to the at least one processor. In the embodiment of the present invention, The specific connection medium between the processor 501 and the memory 502 is not limited. In FIG. 5, the processor 501 and the memory 502 are connected through a bus as an example. The bus can be divided into address bus, data bus, control bus and so on.
在本发明实施例中,存储器502存储有可被至少一个处理器501执行的指令,至少一个处理器501通过执行存储器502存储的指令,可以执行前述的基于跨链网络的资源处理方法中所包括的步骤。In the embodiment of the present invention, the memory 502 stores instructions that can be executed by at least one processor 501. By executing the instructions stored in the memory 502, the at least one processor 501 can execute the aforementioned resource processing method based on a cross-chain network. A step of.
其中,处理器501是计算设备的控制中心,可以利用各种接口和线路连接计算设备的各个部分,通过运行或执行存储在存储器502内的指令以及调用存储在存储器502内的数据,从而实现数据处理。可选的,处理器501可包括一个或多个处理单元,处理器501可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理下发指令。可以理解的是,上述调制解调处理器也可以不集成到处理器501中。在一些实施例中,处理器501和存储器502可以在同一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。Among them, the processor 501 is the control center of the computing device, which can use various interfaces and lines to connect various parts of the computing device, and realize data by running or executing instructions stored in the memory 502 and calling data stored in the memory 502. deal with. Optionally, the processor 501 may include one or more processing units, and the processor 501 may integrate an application processor and a modem processor. The application processor mainly processes the operating system, user interface, and application programs. The adjustment processor mainly handles issuing instructions. It can be understood that the foregoing modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 may be implemented on the same chip, and in some embodiments, they may also be implemented on separate chips.
处理器501可以是通用处理器,例如中央处理器(CPU)、数字信号处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合基于跨链网络的资源处理实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。The processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiment of resource processing based on a cross-chain network can be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
存储器502作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块。存储器502可以包括至少一种类型的存储介质,例如可以包括闪存、硬盘、多媒体卡、卡型存储器、随机访问存储器(Random Access Memory,RAM)、静态随机访问存储器(Static Random Access Memory,SRAM)、可编程只读存储 器(Programmable Read Only Memory,PROM)、只读存储器(Read Only Memory,ROM)、带电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性存储器、磁盘、光盘等等。存储器502是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本发明实施例中的存储器502还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。The memory 502, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The memory 502 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), magnetic memory, disk , CD, etc. The memory 502 is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memory 502 in the embodiment of the present invention may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
基于同一发明构思,本发明实施例还提供了一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行如上述图3任意所述的基于跨链网络的资源处理方法。Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium that stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device executes The resource processing method based on the cross-chain network as described in any of the above-mentioned Figure 3.
本领域内的技术人员应明白,本发明的实施例可提供为方法、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention can be provided as a method or a computer program product. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and/or block in the 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 the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. In this way, 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 (16)

  1. 一种基于跨链网络的资源处理方法,其特征在于,所述方法包括:A resource processing method based on a cross-chain network, characterized in that the method includes:
    代理节点接收用户端发送的资源调用请求,所述资源调用请求中包括待调用资源的标识;The proxy node receives a resource call request sent by the user terminal, where the resource call request includes an identifier of the resource to be called;
    所述代理节点根据跨链资源的标识与区块链网络的对应关系,确定所述待调用资源的标识对应的区块链网络;The proxy node determines the blockchain network corresponding to the identifier of the resource to be invoked according to the correspondence between the identifier of the cross-chain resource and the blockchain network;
    所述代理节点从所述待调用资源对应的区块链网络中调用所述待调用资源,得到调用结果。The proxy node calls the resource to be called from the blockchain network corresponding to the resource to be called, and obtains the calling result.
  2. 根据权利要求1所述的方法,其特征在于,所述代理节点中封装有与各个区块链网络一一对应的管理单元;The method according to claim 1, wherein the agent node is encapsulated with a management unit corresponding to each blockchain network one-to-one;
    所述代理节点接收用户端发送的资源调用请求之前,还包括:Before the proxy node receives the resource call request sent by the user terminal, the method further includes:
    所述代理节点接收所述用户端发送的部署请求;所述部署请求中包括待部署的各个跨链资源和所述各个跨链资源所需部署的区块链网络的标识;The proxy node receives the deployment request sent by the client; the deployment request includes each cross-chain resource to be deployed and the identifier of the blockchain network to be deployed for each cross-chain resource;
    针对于任一跨链资源,所述代理节点根据所述部署请求中所述跨链资源所需部署的区块链网络的标识,确定所述跨链资源对应的管理单元,将所述跨链资源分发给所述跨链资源对应的管理单元,以使所述管理单元将所述跨链资源部署到所述管理单元管理的区块链网络中;For any cross-chain resource, the proxy node determines the management unit corresponding to the cross-chain resource according to the identifier of the blockchain network that the cross-chain resource needs to deploy in the deployment request, and transfers the cross-chain resource Distribute the resources to the management unit corresponding to the cross-chain resource, so that the management unit deploys the cross-chain resource to the blockchain network managed by the management unit;
    所述代理节点获取所述各个管理单元对所述各个跨链资源的部署结果,并根据所述部署结果生成所述跨链资源的标识与区块链网络的对应关系。The proxy node obtains the deployment result of each cross-chain resource by each management unit, and generates a correspondence between the identifier of the cross-chain resource and the blockchain network according to the deployment result.
  3. 根据权利要求2所述的方法,其特征在于,所述代理节点从所述待调用资源对应的区块链网络中调用所述待调用资源,得到调用结果,包括:The method according to claim 2, wherein the proxy node calls the resource to be called from a blockchain network corresponding to the resource to be called to obtain the calling result, comprising:
    所述代理节点根据所述待调用资源的标识对应的区块链网络,确定所述待调用资源对应的目标管理单元;The proxy node determines the target management unit corresponding to the resource to be called according to the blockchain network corresponding to the identifier of the resource to be called;
    所述代理节点获取所述目标管理单元所管理的区块链网络中的全部跨链资源的标识;Acquiring, by the proxy node, the identifiers of all cross-chain resources in the blockchain network managed by the target management unit;
    所述代理节点根据所述目标管理单元所管理的区块链网络中的全部跨链资源的标识,若确定所述全部跨链资源中包括所述待调用资源,则根据所述待调用资源的标识生成调用指令,并发送给所述目标管理单元;所述调用指令用于所述目标管理单元对区块链网络中的所述待调用资源进行调用。According to the identifiers of all cross-chain resources in the blockchain network managed by the target management unit, the proxy node determines that the resources to be called are included in all the cross-chain resources, then according to the identification of the resources to be called The identification generates a call instruction and sends it to the target management unit; the call instruction is used by the target management unit to call the resource to be called in the blockchain network.
  4. 根据权利要求3所述的方法,其特征在于,所述资源调用请求中还包括调用接口,所述调用接口为各个跨链资源的通用接口中的任意一种或多种;The method according to claim 3, wherein the resource call request further includes a call interface, and the call interface is any one or more of the general interfaces of each cross-chain resource;
    所述代理节点根据所述待调用资源的标识生成调用指令,包括:The proxy node generates a call instruction according to the identifier of the resource to be called, including:
    所述代理节点根据所述待调用资源的标识和所述调用接口生成所述调用指令,所述调用指令用于所述目标管理单元使用所述调用接口对区块链网络中的所述待调用资源进行调用。The proxy node generates the call instruction according to the identifier of the resource to be called and the call interface, and the call instruction is used by the target management unit to use the call interface to make the call to the block chain network. Resources are called.
  5. 根据权利要求4所述的方法,其特征在于,所述调用资源的标识为智能合约的合约地址;The method according to claim 4, wherein the identifier of the calling resource is a contract address of a smart contract;
    所述代理节点根据所述待调用资源的标识和所述调用接口生成所述调用指令,包括:The proxy node generating the calling instruction according to the identifier of the resource to be called and the calling interface includes:
    所述代理节点根据所述智能合约的合约地址和所述调用接口生成所述调用指令,所述调用指令用于所述目标管理单元根据所述智能合约的合约地址生成合约对象,调用所述合 约对象的所述调用接口获取或更新所述智能合约的合约数据。The proxy node generates the call instruction according to the contract address of the smart contract and the call interface, and the call instruction is used by the target management unit to generate a contract object according to the contract address of the smart contract, and call the contract The calling interface of the object obtains or updates the contract data of the smart contract.
  6. 根据权利要求4所述的方法,其特征在于,所述调用资源的标识为数据表的表名;The method according to claim 4, wherein the identifier of the calling resource is a table name of a data table;
    所述代理节点根据所述待调用资源的标识和所述调用接口生成所述调用指令,包括:The proxy node generating the calling instruction according to the identifier of the resource to be called and the calling interface includes:
    所述代理节点根据所述数据表的表名和所述调用接口生成所述调用指令,所述调用指令用于所述目标管理单元根据所述数据表的表名获取所述数据表,并根据所述调用接口查询或修改所述数据表中的数据。The proxy node generates the call instruction according to the table name of the data table and the call interface, and the call instruction is used by the target management unit to obtain the data table according to the table name of the data table, and according to the name of the data table. The calling interface is used to query or modify the data in the data table.
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述跨链资源的标识与区块链网络的对应关系按照跨链网络、跨链网络包括的区块链网络、区块链网络中部署的跨链资源的层级关系进行设置。The method according to any one of claims 1 to 6, wherein the correspondence between the identifier of the cross-chain resource and the blockchain network is in accordance with the cross-chain network, the blockchain network included in the cross-chain network, and the zone Set the hierarchical relationship of the cross-chain resources deployed in the blockchain network.
  8. 一种基于跨链网络的资源处理装置,其特征在于,所述装置包括:A resource processing device based on a cross-chain network, characterized in that the device includes:
    收发模块,用于接收用户端发送的资源调用请求,所述资源调用请求中包括待调用资源的标识;The transceiver module is configured to receive a resource call request sent by the user terminal, where the resource call request includes the identifier of the resource to be called;
    确定模块,用于根据跨链资源的标识与区块链网络的对应关系,确定所述待调用资源的标识对应的区块链网络;The determining module is used to determine the blockchain network corresponding to the identifier of the resource to be invoked according to the corresponding relationship between the identifier of the cross-chain resource and the blockchain network;
    调用模块,用于从所述待调用资源对应的区块链网络中调用所述待调用资源,得到调用结果。The calling module is used to call the resource to be called from the blockchain network corresponding to the resource to be called to obtain the calling result.
  9. 根据权利要求8所述的装置,其特征在于,所述装置中封装有与各个区块链网络一一对应的管理单元;The device according to claim 8, wherein the device is encapsulated with a management unit corresponding to each blockchain network in a one-to-one manner;
    所述装置还包括部署模块;The device also includes a deployment module;
    所述收发模块接收用户端发送的资源调用请求之前,还用于接收所述用户端发送的部署请求;所述部署请求中包括待部署的各个跨链资源和所述各个跨链资源所需部署的区块链网络的标识;Before the transceiver module receives the resource call request sent by the client, it is also used to receive the deployment request sent by the client; the deployment request includes each cross-chain resource to be deployed and the deployment required for each cross-chain resource The identity of the blockchain network;
    所述部署模块,用于针对于任一跨链资源,根据所述部署请求中所述跨链资源所需部署的区块链网络的标识,确定所述跨链资源对应的管理单元,将所述跨链资源分发给所述跨链资源对应的管理单元,以使所述管理单元将所述跨链资源部署到所述管理单元管理的区块链网络中;获取所述各个管理单元对所述各个跨链资源的部署结果,并根据所述部署结果生成所述跨链资源的标识与区块链网络的对应关系。The deployment module is configured to determine the management unit corresponding to the cross-chain resource according to the identifier of the blockchain network to be deployed by the cross-chain resource in the deployment request for any cross-chain resource, and The cross-chain resource is distributed to the management unit corresponding to the cross-chain resource, so that the management unit deploys the cross-chain resource to the blockchain network managed by the management unit; and obtains all the management units The deployment result of each cross-chain resource is described, and the corresponding relationship between the identifier of the cross-chain resource and the blockchain network is generated according to the deployment result.
  10. 根据权利要求9所述的装置,其特征在于,所述调用模块具体用于:The device according to claim 9, wherein the calling module is specifically configured to:
    根据所述待调用资源的标识对应的区块链网络,确定所述待调用资源对应的目标管理单元;Determine the target management unit corresponding to the resource to be called according to the blockchain network corresponding to the identifier of the resource to be called;
    获取所述目标管理单元所管理的区块链网络中的全部跨链资源的标识;Acquiring the identifiers of all cross-chain resources in the blockchain network managed by the target management unit;
    根据所述目标管理单元所管理的区块链网络中的全部跨链资源的标识,若确定所述全部跨链资源中包括所述待调用资源,则根据所述待调用资源的标识生成调用指令,并发送给所述目标管理单元;所述调用指令用于所述目标管理单元对区块链网络中的所述待调用资源进行调用。According to the identifiers of all cross-chain resources in the blockchain network managed by the target management unit, if it is determined that all the cross-chain resources include the resource to be called, a call instruction is generated according to the identifier of the resource to be called , And sent to the target management unit; the call instruction is used by the target management unit to call the resource to be called in the blockchain network.
  11. 根据权利要求10所述的装置,其特征在于,所述资源调用请求中还包括调用接口,所述调用接口为各个跨链资源的通用接口中的任意一种或多种;The device according to claim 10, wherein the resource calling request further comprises a calling interface, and the calling interface is any one or more of the general interfaces of each cross-chain resource;
    所述调用模块具体用于:The calling module is specifically used for:
    根据所述待调用资源的标识和所述调用接口生成所述调用指令,所述调用指令用于所述目标管理单元使用所述调用接口对区块链网络中的所述待调用资源进行调用。The call instruction is generated according to the identifier of the resource to be called and the call interface, and the call instruction is used by the target management unit to call the resource to be called in the blockchain network using the call interface.
  12. 根据权利要求11所述的装置,其特征在于,所述调用资源的标识为智能合约的合约地址;The device according to claim 11, wherein the identifier of the calling resource is a contract address of a smart contract;
    所述调用模块具体用于:The calling module is specifically used for:
    根据所述智能合约的合约地址和所述调用接口生成所述调用指令,所述调用指令用于所述目标管理单元根据所述智能合约的合约地址生成合约对象,调用所述合约对象的所述调用接口获取或更新所述智能合约的合约数据。The call instruction is generated according to the contract address of the smart contract and the call interface, and the call instruction is used by the target management unit to generate a contract object according to the contract address of the smart contract, and call the contract object Call the interface to obtain or update the contract data of the smart contract.
  13. 根据权利要求11所述的装置,其特征在于,所述调用资源的标识为数据表的表名;The device according to claim 11, wherein the identifier of the calling resource is a table name of a data table;
    所述调用模块具体用于:The calling module is specifically used for:
    根据所述数据表的表名和所述调用接口生成所述调用指令,所述调用指令用于所述目标管理单元根据所述数据表的表名获取所述数据表,并根据所述调用接口查询或修改所述数据表中的数据。The call instruction is generated according to the table name of the data table and the call interface, and the call instruction is used for the target management unit to obtain the data table according to the table name of the data table, and query according to the call interface Or modify the data in the data table.
  14. 根据权利要求8至13中任一项所述的装置,其特征在于,所述跨链资源的标识与区块链网络的对应关系按照跨链网络、跨链网络包括的区块链网络、区块链网络中部署的跨链资源的层级关系进行设置。The device according to any one of claims 8 to 13, wherein the correspondence between the identifier of the cross-chain resource and the blockchain network is in accordance with the cross-chain network, the blockchain network included in the cross-chain network, and the zone. Set the hierarchical relationship of the cross-chain resources deployed in the blockchain network.
  15. 一种计算设备,其特征在于,包括至少一个处理器以及至少一个存储器,其中,所述存储器存储有计算机程序,当所述程序被所述处理器执行时,使得所述处理器执行权利要求1~7任一权利要求所述的方法。A computing device, comprising at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processor executes claim 1 ~7 The method of any one of claims.
  16. 一种计算机可读存储介质,其特征在于,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行权利要求1~7任一权利要求所述的方法。A computer-readable storage medium, characterized in that it stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device executes any one of claims 1-7 Require the described method.
PCT/CN2020/121949 2019-12-05 2020-10-19 Cross-chain-network-based resource processing method, and device WO2021109735A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911236666.6 2019-12-05
CN201911236666.6A CN111163129B (en) 2019-12-05 2019-12-05 Resource processing method and device based on cross-link network

Publications (1)

Publication Number Publication Date
WO2021109735A1 true WO2021109735A1 (en) 2021-06-10

Family

ID=70556407

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/121949 WO2021109735A1 (en) 2019-12-05 2020-10-19 Cross-chain-network-based resource processing method, and device

Country Status (2)

Country Link
CN (1) CN111163129B (en)
WO (1) WO2021109735A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113467888A (en) * 2021-06-29 2021-10-01 网易(杭州)网络有限公司 Cross-chain calling method and device of intelligent contract, electronic equipment and storage medium
CN113507480A (en) * 2021-07-23 2021-10-15 北京众享比特科技有限公司 Network equipment, network gate equipment and system, and data transmission and reporting method between networks
CN113781216A (en) * 2021-08-27 2021-12-10 浙商银行股份有限公司 Asynchronous cross-chain transaction query method and device based on callback contract mechanism
CN115314375A (en) * 2022-07-22 2022-11-08 京东科技信息技术有限公司 Block chain network cross-domain networking method, device, storage medium and program product
WO2023207085A1 (en) * 2022-04-29 2023-11-02 蚂蚁区块链科技(上海)有限公司 System and method for cross-blockchain interaction

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111163129B (en) * 2019-12-05 2021-12-14 深圳前海微众银行股份有限公司 Resource processing method and device based on cross-link network
CN113691569A (en) * 2020-05-18 2021-11-23 顺丰科技有限公司 Dynamic extended billing method and device based on alliance chain
CN111652728A (en) * 2020-06-17 2020-09-11 深圳前海微众银行股份有限公司 Transaction processing method and device
CN111770102B (en) * 2020-07-01 2022-07-19 中国建设银行股份有限公司 Block chain cross-chain method and device, computer equipment and storage medium
CN111931215B (en) * 2020-09-11 2021-01-05 腾讯科技(深圳)有限公司 Data management method and device and storage medium
CN112508703B (en) * 2020-12-10 2024-04-05 浙商银行股份有限公司 Isomorphic public-private chain value exchange method
CN113242317B (en) * 2021-06-11 2022-08-19 广东浪潮智慧计算技术有限公司 Addressing route synchronization method and related device for alliance chain supervision system
CN113535690B (en) * 2021-09-15 2021-12-21 支付宝(杭州)信息技术有限公司 Block chain service network establishing method and device
CN114531305B (en) * 2022-04-23 2022-07-19 东南大学 Block chain cross-chain supervision method for chain management
CN116016523B (en) * 2023-03-22 2023-07-14 浪潮电子信息产业股份有限公司 Data access method, device, system and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109035012A (en) * 2018-06-11 2018-12-18 西安纸贵互联网科技有限公司 A kind of across the chain processing method and computer readable storage medium of block catenary system
CN109347955A (en) * 2018-10-19 2019-02-15 北京奇艺世纪科技有限公司 A kind of block chain network system and information processing method
WO2019042101A1 (en) * 2017-08-29 2019-03-07 华为技术有限公司 Cross-chain trading method and apparatus
CN110442652A (en) * 2019-08-15 2019-11-12 腾讯科技(深圳)有限公司 A kind of across chain data processing method and device based on block chain
CN111163129A (en) * 2019-12-05 2020-05-15 深圳前海微众银行股份有限公司 Resource processing method and device based on cross-link network

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108616578A (en) * 2018-04-09 2018-10-02 上海点融信息科技有限责任公司 Method for processing business, equipment and the computer readable storage medium of transregional piece of platform chain
US11194837B2 (en) * 2018-05-01 2021-12-07 International Business Machines Corporation Blockchain implementing cross-chain transactions
CN108876618A (en) * 2018-06-15 2018-11-23 浙江华信区块链科技服务有限公司 A kind of exchange block catenary system and corresponding universal block chain mutual operation method and network
CN109145205B (en) * 2018-07-27 2020-09-01 阿里巴巴集团控股有限公司 Cross-chain data operation method and device based on block chain
CN110020860B (en) * 2019-04-09 2023-09-05 湖南天河国云科技有限公司 Cross-chain asset transfer method, system and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019042101A1 (en) * 2017-08-29 2019-03-07 华为技术有限公司 Cross-chain trading method and apparatus
CN109035012A (en) * 2018-06-11 2018-12-18 西安纸贵互联网科技有限公司 A kind of across the chain processing method and computer readable storage medium of block catenary system
CN109347955A (en) * 2018-10-19 2019-02-15 北京奇艺世纪科技有限公司 A kind of block chain network system and information processing method
CN110442652A (en) * 2019-08-15 2019-11-12 腾讯科技(深圳)有限公司 A kind of across chain data processing method and device based on block chain
CN111163129A (en) * 2019-12-05 2020-05-15 深圳前海微众银行股份有限公司 Resource processing method and device based on cross-link network

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113467888A (en) * 2021-06-29 2021-10-01 网易(杭州)网络有限公司 Cross-chain calling method and device of intelligent contract, electronic equipment and storage medium
CN113467888B (en) * 2021-06-29 2024-02-23 网易(杭州)网络有限公司 Cross-chain calling method and device of intelligent contract, electronic equipment and storage medium
CN113507480A (en) * 2021-07-23 2021-10-15 北京众享比特科技有限公司 Network equipment, network gate equipment and system, and data transmission and reporting method between networks
CN113507480B (en) * 2021-07-23 2023-10-27 北京众享比特科技有限公司 Network equipment, gateway equipment and system and inter-network data transmission and reporting method
CN113781216A (en) * 2021-08-27 2021-12-10 浙商银行股份有限公司 Asynchronous cross-chain transaction query method and device based on callback contract mechanism
WO2023207085A1 (en) * 2022-04-29 2023-11-02 蚂蚁区块链科技(上海)有限公司 System and method for cross-blockchain interaction
CN115314375A (en) * 2022-07-22 2022-11-08 京东科技信息技术有限公司 Block chain network cross-domain networking method, device, storage medium and program product
CN115314375B (en) * 2022-07-22 2024-02-06 京东科技信息技术有限公司 Blockchain network cross-domain networking method, equipment, storage medium and program product

Also Published As

Publication number Publication date
CN111163129B (en) 2021-12-14
CN111163129A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
WO2021109735A1 (en) Cross-chain-network-based resource processing method, and device
WO2018137564A1 (en) Service processing method and apparatus
CN110189121B (en) Data processing method and device, block chain client and block chain link point
US6775700B2 (en) System and method for common information model object manager proxy interface and management
WO2020258847A1 (en) Method and apparatus for cross-chain transmission of authenticable message based on processing module
CN111213340A (en) Selecting and securing attestation delegations for cryptographic functions
TWI658418B (en) Business implementation method, device and system of financial information exchange (FIX) protocol
US10999283B2 (en) Addressing transaction conflict in blockchain systems
CN112075062A (en) Automated commit transaction management in blockchain networks
CN111258723B (en) Transaction processing method, device, system, medium and equipment of distributed system
CN114281573A (en) Workflow data interaction method and device, electronic device and readable storage medium
US6754819B1 (en) Method and system for providing cryptographic services in a distributed application
CN109104368B (en) Connection request method, device, server and computer readable storage medium
US20230079672A1 (en) Cross-chain data transmission method and apparatus, computer device, storage medium, and computer program product
WO2020207194A1 (en) Blockchain-based iot device changing method and apparatus
CN113722114A (en) Data service processing method and device, computing equipment and storage medium
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
CN109729121B (en) Cloud storage system and method for realizing custom data processing in cloud storage system
US7941454B2 (en) Apparatus, methods and computer programs for monitoring processing in a data processing system or network
CN113691511A (en) Service request processing method, device, equipment and medium thereof
WO2023078200A1 (en) Block migration
CN112181599A (en) Model training method, device and storage medium
US20240104558A1 (en) Blockchain transaction execution method and apparatus, program product, device, and medium
CN112565340B (en) Service scheduling method, device, computer system and medium for distributed application
WO2024066749A1 (en) Blockchain transaction execution method and apparatus, program product, device, and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20896498

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 10/10/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20896498

Country of ref document: EP

Kind code of ref document: A1