Cross-chain calling method and device, equipment, storage medium and program product

By generating and storing the hash value of the cross-chain function of the blockchain and exchanging information between the blockchain smart contract and the cross-chain stack, the problem of cross-chain data and asset flow in the blockchain system is solved, and the problem of cross-chain data and asset flow in the blockchain system is realized. Efficient and secure cross-chain calls enhance the interoperability of blockchain systems.

CN119474207APending Publication Date: 2025-02-18CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411571594.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing blockchain system lacks effective mechanisms to realize the flow of cross-chain data and assets, which limits the scope of application of blockchain technology.

Method used

By generating the hash of the blockchain's cross-chain function and storing it to the cross-chain smart contract, cross-chain information is sent to the cross-chain stack of another blockchain, and accessing the cross-chain smart contract after receiving the cross-chain successful message , confirm the success of cross-chain.

Benefits of technology

The flow of cross-chain data and assets is realized, the speed and efficiency of call processing is improved, the security of cross-chain calls and data integrity is ensured, the interoperability of the blockchain ecosystem is enhanced, and the center is reduced. Reliance of service providers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474207A_ABST
    Figure CN119474207A_ABST
Patent Text Reader

Abstract

The invention discloses a cross-chain calling method and device, equipment, a storage medium and a program product, and relates to the technical field of computers, and the cross-chain calling method comprises the steps that a cross-chain function hash value of a first block chain is generated, and the cross-chain function hash value of the first block chain is stored in a cross-chain smart contract; sending cross-chain information to a cross-chain stack of the second block chain, and accessing the cross-chain smart contract after receiving a cross-chain success message returned by the cross-chain stack of the second block chain; and if the cross-chain function hash value of the first block chain and the cross-chain function hash value of the second block chain are queried in the cross-chain smart contract, determining that the cross-chain initiation of the first block chain is successful. According to the method, cross-chain calling between the two block chains is realized through the cross-chain stack, direct communication and data exchange between different block chain networks are allowed, and interoperability of a block chain ecological system is greatly enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a cross-chain calling method, apparatus, device, storage medium and program product. Background Art

[0002] With the rapid development of blockchain technology, more and more blockchain networks have emerged. These blockchain networks usually have their own unique characteristics and application scenarios. Existing blockchain systems are usually isolated and lack effective mechanisms to achieve cross-chain data and asset flows, which limits the application scope of blockchain technology. For example, cross-chain implementation through third parties cannot fully utilize its advantages of decentralization and transparency. Summary of the invention

[0003] The main purpose of this application is to provide a cross-chain calling method, device, equipment, storage medium and program product, aiming to solve the technical problem of the lack of an effective mechanism to realize the flow of cross-chain data and assets.

[0004] To achieve the above objectives, the present application proposes a cross-chain calling method, the method comprising:

[0005] Generate a cross-chain function hash value of the first blockchain, and store the cross-chain function hash value of the first blockchain in a cross-chain smart contract;

[0006] Send the cross-chain information to the cross-chain stack of the second blockchain, and after receiving the cross-chain success message returned by the cross-chain stack of the second blockchain, access the cross-chain smart contract;

[0007] If the first blockchain cross-chain function hash value and the second blockchain cross-chain function hash value are queried in the cross-chain smart contract, it is determined that the first blockchain has successfully initiated the cross-chain.

[0008] In one embodiment, the step of generating a cross-chain function hash value of the first blockchain includes:

[0009] Obtain the cross-chain business contract function name of the first blockchain, and obtain the block height when the first blockchain initiates the cross-chain;

[0010] Determine the cross-chain function hash value of the first blockchain according to the cross-chain business contract function name and the block height.

[0011] In one embodiment, the method comprises:

[0012] Determine a target storage node among the storage nodes to be selected;

[0013] The data of the first blockchain and / or the data of the second blockchain are stored in a target storage node.

[0014] In one embodiment, the step of determining a target storage node among storage nodes to be selected includes:

[0015] Obtaining node information of a storage node to be selected, wherein the node information includes at least one of a blockchain type, a storage data volume, a storage speed, and a storage evaluation;

[0016] The target storage node is determined according to the node information of the storage node to be selected.

[0017] To achieve the above objectives, the present application proposes a cross-chain calling method, the method comprising:

[0018] After receiving the cross-chain information, generate a cross-chain function hash value of the second blockchain;

[0019] The cross-chain function hash value of the second blockchain is stored in the cross-chain smart contract, and a cross-chain success message is sent to the cross-chain stack of the first blockchain.

[0020] In one embodiment, the step of generating a cross-chain function hash value of the second blockchain includes:

[0021] Obtain the cross-chain business contract function name of the second blockchain, and obtain the block height of the second blockchain;

[0022] Determine the cross-chain function hash value of the second blockchain according to the cross-chain business contract function name of the second blockchain and the block height.

[0023] In addition, to achieve the above purpose, the present application also proposes a cross-chain calling device, which includes:

[0024] A generation module, used to generate a cross-chain function hash value of the first blockchain, and store the cross-chain function hash value of the first blockchain in a cross-chain smart contract;

[0025] A receiving module, used to send cross-chain information to the cross-chain stack of the second blockchain, and access the cross-chain smart contract after receiving a cross-chain success message returned by the cross-chain stack of the second blockchain;

[0026] The determination module is used to determine that the first blockchain successfully initiates the cross-chain if the first blockchain cross-chain function hash value and the second blockchain cross-chain function hash value are queried in the cross-chain smart contract.

[0027] In addition, to achieve the above-mentioned objectives, the present application also proposes a cross-chain calling device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the cross-chain calling method described above.

[0028] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the cross-chain call method described above are implemented.

[0029] In addition, to achieve the above-mentioned objectives, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the cross-chain calling method described above.

[0030] One or more technical solutions proposed in this application have at least the following technical effects:

[0031] Automatically processing cross-chain calls through cross-chain smart contracts reduces the number of intermediate links, improves the speed and efficiency of call processing, and ensures the security of cross-chain calls and the integrity of data by using hash values ​​and the immutability of cross-chain smart contracts. Cross-chain calls between two blockchains are realized through a cross-chain stack, allowing direct communication and data exchange between different blockchain networks, greatly enhancing the interoperability of the blockchain ecosystem, and automated cross-chain calls reduce dependence on centralized service providers, thereby reducing call costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0034] Figure 1 A flowchart of the first embodiment of the cross-chain calling method of this application is provided;

[0035] Figure 2 A brief flow chart of a dual-stack cross-chain method based on cross-chain smart contract Merkle tree notarization in the cross-chain calling method embodiment of this application;

[0036] Figure 3 A flowchart diagram of the second embodiment of the cross-chain calling method of this application;

[0037] Figure 4 A schematic diagram of a storage node load balancing algorithm based on a BP neural network in the cross-chain calling method of this application;

[0038] Figure 5A flowchart diagram of the third embodiment of the cross-chain calling method of this application;

[0039] Figure 6 A schematic diagram of the structure of a cross-chain storage service system based on a BP neural network load balancing algorithm provided in Embodiment 4 of the cross-chain calling method of this application;

[0040] Figure 7 This is a schematic diagram of the workflow of the blockchain oracle plug-in in the cross-chain calling method of this application;

[0041] Figure 8 This is a brief flowchart of the IBC cross-chain plug-in working in the cross-chain calling method of this application;

[0042] Fig. 9 This is a schematic diagram of the module structure of the cross-chain calling device according to an embodiment of the present application;

[0043] Fig.10 This is a schematic diagram of the device structure of the hardware operating environment involved in the cross-chain calling method in the embodiment of the present application.

[0044] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0045] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0046] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0047] The main solution of the embodiment of the present application is: generate a cross-chain function hash value of the first blockchain, store the cross-chain function hash value of the first blockchain in a cross-chain smart contract; send cross-chain information to the cross-chain stack of the second blockchain, and access the cross-chain smart contract after receiving the cross-chain success message returned by the cross-chain stack of the second blockchain; if the cross-chain function hash value of the first blockchain and the cross-chain function hash value of the second blockchain are queried in the cross-chain smart contract, it is determined that the first blockchain has successfully initiated the cross-chain.

[0048] In this embodiment, for ease of description, the following description is made using a cross-chain calling device as the execution subject.

[0049] Since existing blockchain systems are usually isolated and lack effective mechanisms to achieve the flow of cross-chain data and assets, the application scope of blockchain technology is limited. For example, cross-chain implementation through third parties cannot fully utilize the advantages of decentralization and transparency.

[0050] This application provides a solution that automatically processes cross-chain calls through cross-chain smart contracts, reduces intermediate links, improves the speed and efficiency of call processing, and uses hash values ​​and the immutability of cross-chain smart contracts to ensure the security of cross-chain calls and the integrity of data. Cross-chain calls between two blockchains are realized through a cross-chain stack, allowing direct communication and data exchange between different blockchain networks, greatly enhancing the interoperability of the blockchain ecosystem, and automated cross-chain calls reduce dependence on centralized service providers, thereby reducing call costs.

[0051] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device that can realize the above functions, a cross-chain calling device, etc. The following takes the cross-chain calling device as an example to illustrate this embodiment and the following embodiments.

[0052] Blockchain is a type of distributed ledger. A blockchain is an independent ledger. Two different chains are two different independent ledgers. The two ledgers are not related. In essence, value cannot be transferred between ledgers, but for a specific user, the value stored by the user on one blockchain can become the value on another chain. This is the circulation of value. If the consensus mechanism is the soul of the blockchain, then for blockchain, especially alliance chain and private chain, cross-chain technology is the key to realizing the value network. It saves the alliance chain from scattered and isolated islands and is a bridge for blockchain to expand and connect outward.

[0053] Based on this, the embodiment of the present application provides a cross-chain calling method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the cross-chain calling method of the present application.

[0054] In this embodiment, the cross-chain calling method includes steps S10 to S30:

[0055] Step S10, generate a cross-chain function hash value of the first blockchain, and store the cross-chain function hash value of the first blockchain in a cross-chain smart contract.

[0056] Optionally, this embodiment is applied to the first blockchain service system, or the cross-chain stack of the first blockchain. Among them, the blockchain service system BaaS (Blockchain as a Service) refers to embedding the blockchain framework into the cloud computing platform, using the deployment and management advantages of the cloud service infrastructure to provide developers with a convenient and high-performance blockchain ecological environment and ecological supporting services, and supporting the business expansion and operation support of developers. The blockchain open platform. Generally, a complete BaaS solution includes four main links: device access, access control, service monitoring and blockchain platform. The cross-chain stack refers to a set of technical components and services that work together to achieve interoperability between different blockchains. The cross-chain stack usually includes a series of protocols, interfaces, data structures and smart contracts, which enable different blockchain networks to communicate with each other, exchange data and perform cross-chain transactions.

[0057] It should be noted that the first blockchain is the current blockchain, and the second blockchain is the blockchain to be cross-chain called. The first blockchain is represented by chain A, and the second blockchain is represented by chain B.

[0058] Optionally, step S10 includes: a cross-chain function hash value is generated according to the cross-chain business contract function name of the first blockchain and a preset hash function.

[0059] Optionally, step S10 includes: obtaining the name of the cross-chain business contract function of the first blockchain, and obtaining the block height when the first blockchain initiates the cross-chain; according to the cross-chain business contract function name and the block height, determining the cross-chain function hash value of the first blockchain. Exemplarily, the cross-chain function hash value of chain A = sh256 (cross-chain business contract function name of chain A + block height when chain A initiates the cross-chain).

[0060] Optionally, the cross-chain function hash value of the first blockchain is stored in a data structure in the cross-chain smart contract. Different data structures are used for specific application scenarios and requirements. Data structures include linked lists, graphs, hash tables, databases, binary search trees, or Merkle trees.

[0061] Among them, linked lists are used to store a series of data items and can be used to implement certain types of data flows or logs. Graphs are used to represent complex relationships and networks and are suitable for scenarios that require complex interactions between nodes. Hash tables are used to provide fast data search and storage and are suitable for scenarios that require efficient retrieval. Binary search trees are used to maintain data structures with ordered elements and are suitable for scenarios that require ordered data operations. Databases are used in some cases where cross-chain smart contracts may interact with external databases to store and retrieve large amounts of data.

[0062] like Figure 2As shown in Figure 1, the Merkle tree is a binary tree data structure. The Merkle tree is also called a hash tree or a binary hash tree and is widely used in blockchain technology and network security. The Merkle tree is a very efficient data structure that provides a way to verify and store large amounts of data through hash functions while maintaining the security and integrity of the data.

[0063] Each leaf node of the Merkle tree contains the hash value of a data block, and non-leaf nodes contain the hash of the hash values ​​of their child nodes. If the number of data blocks is odd, the bottom layer ensures that the number of leaf nodes is even by copying the last data block. Any tampering with the data will cause the hash value from the leaf node to the root node to change, so the Merkle tree provides strong data integrity protection. The Merkle tree allows the integrity and consistency of the data to be quickly verified by comparing the root hash value without accessing the entire data set, that is, the Merkle tree allows efficient data verification because only the root hash value of the tree needs to be stored and compared, not the entire data set.

[0064] Based on the cross-chain smart contract Merkle tree, the cross-chain function hash value is used as the bottom-level Merkle book leaf, which is divided into the A-chain cross-chain function hash value and the B-chain cross-chain function hash value. When the A-chain initiates the cross-chain, the A-chain cross-chain function hash value is generated, and when the B-chain completes the cross-chain, the B-chain cross-chain function hash value is generated. The A-chain cross-chain function hash value and the B-chain cross-chain function hash value appear in pairs, and the Merkle tree leaf on the upper layer = sh256 (A-chain cross-chain function hash value + B-chain cross-chain function hash value).

[0065] Dual-stack cross-chain plug-in based on cross-chain smart contract Merkle tree notarization, such as Figure 2 As shown, through the Merkle tree based on cross-chain smart contracts in the notary node, the running status of the cross-chain smart contracts is monitored, cross-chain capabilities and cross-chain transaction mechanisms are supported, and contract calls of isomorphic and heterogeneous chains are supported. For the cross-chain operation between blockchain system A and blockchain system B, two cross-chain stacks, A chain cross-chain stack, B chain cross-chain stack and Merkle tree based on cross-chain smart contracts are built in the notary node.

[0066] Optionally, each cross-chain stack consists of four levels: cross-chain communication module, cross-chain event module, transaction verification module, and cross-chain transaction module. The A-chain cross-chain stack and the B-chain cross-chain stack communicate through inter-chain messages and transaction information.

[0067] Dual-stack cross-chain method based on cross-chain smart contract Merkle tree notarization, such as Figure 2 As shown in the figure, when a business of chain A needs to make a cross-chain call to chain B, the cross-chain proxy contract is called in the A blockchain system and a cross-chain monitoring event is triggered to monitor the current cross-chain event. If the cross-chain call to the B blockchain system is successful, the cross-chain event will return a cross-chain success.

[0068] The cross-chain proxy contract calls the cross-chain business contract of chain A to generate the cross-chain function hash value of chain A. The cross-chain function hash value of chain A is used as the leaf of the Merkle tree in the cross-chain smart contract and recorded in the notary node. At this time, the relevant node of the Merkle tree in the cross-chain smart contract has only one leaf, and chain A locks the contract. After the business contract is locked, the cross-chain stack of chain A is notified to perform cross-chain operations. Optionally, the cross-chain function hash value of chain A = sh256 (the function name of the cross-chain business contract of chain A + the block height when chain A initiates the cross-chain).

[0069] Step S20: send the cross-chain information to the cross-chain stack of the second blockchain, and after receiving the cross-chain success message returned by the cross-chain stack of the second blockchain, access the cross-chain smart contract.

[0070] Optionally, the cross-chain stack of the first blockchain sends cross-chain information to the cross-chain stack of the second blockchain. After the cross-chain stack of the second blockchain stores the cross-chain function hash value of the second blockchain in the cross-chain smart contract, the cross-chain stack of the second blockchain returns a cross-chain success message to the cross-chain stack of the first blockchain to remind the cross-chain stack of the first blockchain to access the cross-chain smart contract to determine whether the cross-chain is successful.

[0071] Alternatively, if Figure 2 As shown, the A-chain cross-chain stack accesses the cross-chain smart contract Merkle tree through the transaction verification module, confirms that the cross-chain business contract of the A-chain is correctly locked, and sends cross-chain information to the B-chain cross-chain stack through the cross-chain event module.

[0072] Step S30: If the first blockchain cross-chain function hash value and the second blockchain cross-chain function hash value are queried in the cross-chain smart contract, it is determined that the first blockchain successfully initiates the cross-chain.

[0073] Optionally, if the Merkle tree query in the cross-chain smart contract finds that the first blockchain cross-chain function hash value and the second blockchain cross-chain function hash value appear in pairs, it is determined that the first blockchain has successfully initiated the cross-chain.

[0074] like Figure 2 As shown, after receiving the successful cross-chain message, the A-chain cross-chain stack accesses the cross-chain smart contract Merkle tree, confirms that the A-chain cross-chain function hash value and the B-chain cross-chain function hash value appear in pairs in the Merkle tree, unlocks the business contract of the A-chain, and notifies the A-chain of the successful cross-chain. The notary node's cross-chain smart contract Merkle tree stores the A-chain cross-chain function hash value and the B-chain cross-chain function hash value as evidence for permanent storage.

[0075] In the technical solution of this embodiment, a cross-chain function hash value of the first blockchain is generated, and the cross-chain function hash value of the first blockchain is stored in a cross-chain smart contract; the cross-chain information is sent to the cross-chain stack of the second blockchain, and after receiving the cross-chain success message returned by the cross-chain stack of the second blockchain, the cross-chain smart contract is accessed; if the cross-chain function hash value of the first blockchain and the cross-chain function hash value of the second blockchain are queried in the cross-chain smart contract, it is determined that the first blockchain successfully initiated the cross-chain. Automatically processing cross-chain calls through cross-chain smart contracts reduces intermediate links, improves the speed and efficiency of call processing, and uses the immutability of hash values ​​and cross-chain smart contracts to ensure the security of cross-chain calls and the integrity of data. Cross-chain calls between two blockchains are realized through a cross-chain stack, allowing direct communication and data exchange between different blockchain networks, greatly enhancing the interoperability of the blockchain ecosystem, and automated cross-chain calls reduce dependence on centralized service providers, thereby reducing call costs.

[0076] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment can refer to the above introduction, and will not be repeated later. Figure 3 , the cross-chain calling method also includes:

[0077] Step S40, determining a target storage node among the storage nodes to be selected;

[0078] Step S50: storing the data of the first blockchain and / or the data of the second blockchain in a target storage node.

[0079] Optionally, the node information of the storage node to be selected is obtained, and the node information includes at least one of the blockchain type, the amount of stored data, the storage speed, and the storage evaluation; the target storage node is determined according to the node information of the storage node to be selected. Optionally, the node information may also include a blockchain ID (Identification), a storage node ID, a storage time, etc. Optionally, the storage speed may be the time taken to complete the storage of a preset amount of data, for example, the time taken to complete the storage of 10G data.

[0080] Optionally, the storage evaluation includes one or more dimensions such as performance indicators, reliability indicators, availability indicators, cost-effectiveness indicators, security indicators, compliance, user feedback and ratings, and technical compatibility. For example, the storage evaluation is 0-100 points. Among them, the performance indicators include: storage speed, the time required to complete the storage of a specific amount of data (such as 10G). The faster the speed, the higher the evaluation may be. Read and write efficiency, the efficiency of the node in processing data read and write requests. Reliability indicators include: failure rate, the frequency of node failure. Data integrity, whether the data stored on the node is complete, whether there is any loss or damage. Availability indicators include: online time, the proportion of time the node is online and available for service; response time, the average time for the node to respond to a request. Cost-effectiveness indicators include: storage cost, the cost of using the node to store data. Energy efficiency, the energy consumption of the node operation. Security indicators include: security events, the security event records in the node's history, such as the number of attacks. Compliance includes: whether the node meets specific security and compliance standards. User feedback and ratings include: user satisfaction ratings for node services; user-reported problems and the efficiency of solutions. Technical compatibility includes: node compatibility with different blockchain types and data formats.

[0081] like Figure 4 As shown, in the BP neural network load balancing module, in the storage node load balancing algorithm based on the BP neural network, the input vector is {blockchain type, blockchain ID, storage node ID, storage data volume, storage time, storage speed, storage evaluation}, and the output vector is a storage node list of a preset length, for example, the preset length is 10, and each stored node is represented by {blockchain ID, storage node ID, storage evaluation}. Optionally, the node with the highest storage evaluation value in the storage node list is selected as the target storage node. Using the self-learning ability of the BP neural network, the best storage node is predicted and selected according to the input parameters, thereby achieving more efficient load distribution.

[0082] The BP neural network consists of multiple neurons, which are connected by connection weights. Each neuron receives an input signal and processes it through an activation function, and then passes the output to the next neuron. Its signal is forward propagated, while the error is back propagated.

[0083] In the technical solution of this embodiment, the target storage node, that is, the optimal storage node, is determined among the storage nodes to be selected. Selecting the optimal storage node can reduce the delay of data storage and retrieval and improve the response speed and throughput of the entire system. By dynamically selecting storage nodes, it is possible to avoid the situation where some nodes are overloaded while other nodes are idle, improve the utilization of the overall storage resources, and achieve load balancing of the storage system.

[0084] In the third embodiment of the present application, the same or similar contents as those in the above embodiment can be referred to the above description, and will not be described in detail later. Figure 5 , the cross-chain calling method includes:

[0085] Step S50, after receiving the cross-chain information, generating a cross-chain function hash value of the second blockchain;

[0086] Step S60: store the cross-chain function hash value of the second blockchain into the cross-chain smart contract, and send a cross-chain success message to the cross-chain stack of the first blockchain.

[0087] Optionally, this embodiment is applied to a second blockchain service system, or a cross-chain stack of a second blockchain, wherein the blockchain service system BaaS (Blockchain as a Service) refers to embedding the blockchain framework into a cloud computing platform, utilizing the deployment and management advantages of cloud service infrastructure, providing developers with a convenient, high-performance blockchain ecological environment and ecological supporting services, and supporting developers' business expansion and operational support for a blockchain open platform. Typically, a complete BaaS solution includes four main links: device access, access control, service monitoring, and blockchain platform. A cross-chain stack refers to a set of technical components and services that work together to achieve interoperability between different blockchains. A cross-chain stack typically includes a series of protocols, interfaces, data structures, and smart contracts that enable different blockchain networks to communicate with each other, exchange data, and perform cross-chain transactions.

[0088] It should be noted that the first blockchain is the current blockchain, and the second blockchain is the blockchain to be cross-chain called. The first blockchain is represented by chain A, and the second blockchain is represented by chain B.

[0089] Optionally, step S40 includes: a cross-chain function hash value is generated according to the cross-chain business contract function name of the second blockchain and a preset hash function.

[0090] Optionally, step S40 includes: obtaining the cross-chain business contract function name of the second blockchain, and obtaining the block height of the second blockchain; determining the cross-chain function hash value of the second blockchain according to the cross-chain business contract function name and block height of the second blockchain. Exemplarily, the cross-chain function hash value of the second blockchain = sh256 (cross-chain business contract function name of the second blockchain + block height of the second blockchain when the cross-chain is completed).

[0091] like Figure 2As shown in the figure, after receiving the cross-chain information, the B-chain cross-chain stack accesses the cross-chain smart contract Merkle tree, confirms that the cross-chain business contract of the A-chain is correctly locked, triggers the cross-chain proxy contract of the B-chain, and performs cross-chain monitoring. The cross-chain proxy contract of the B-chain calls the cross-chain business contract of the B-chain. When the cross-chain business contract operation of the B-chain is completed, the hash value of the cross-chain function of the B-chain is used as the leaf of the cross-chain smart contract Merkle tree and recorded in the notary node. The B-chain cross-chain stack will monitor the completion of the business contract of the B-chain, indicating that the cross-chain is successful. The B-chain cross-chain stack sends the message of cross-chain success to the A-chain cross-chain stack.

[0092] In the technical solution of this embodiment, cross-chain calls are automatically processed through cross-chain smart contracts, which reduces intermediate links, improves the speed and efficiency of call processing, and uses hash values ​​and the immutability of cross-chain smart contracts to ensure the security of cross-chain calls and the integrity of data. Cross-chain calls between two blockchains are realized through a cross-chain stack, allowing direct communication and data exchange between different blockchain networks, greatly enhancing the interoperability of the blockchain ecosystem, and automated cross-chain calls reduce dependence on centralized service providers, thereby reducing call costs.

[0093] In the fourth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above description, and will not be described in detail later. Figure 6 The cross-chain storage service system based on the BP neural network load balancing algorithm selects the optimal storage node list based on the historical storage records of the current cross-chain storage service system, and realizes the load balancing of the storage system. Users can realize data chain storage through the blockchain oracle cross-chain plug-in in the cross-chain plug-in, the dual-stack cross-chain plug-in based on the cross-chain smart contract Merkle tree notarization, and the IBC (Inter-Blockchain Communication) cross-chain plug-in.

[0094] Reference Figure 6The cross-chain storage service system based on the BP neural network load balancing algorithm consists of four layers: business platform layer, multi-architecture interoperability component layer, plug-in system layer, and bottom chain system layer. The core of the cross-chain storage service system based on the BP neural network load balancing algorithm is the cross-chain plug-in in the plug-in system. Load balancing is achieved based on the BP neural network load balancing algorithm module. The blockchain oracle cross-chain plug-in, the dual-stack cross-chain plug-in based on the cross-chain smart contract Merkle tree notarization, and the IBC cross-chain plug-in realize cross-chain access to data and on-chain and off-chain data collaboration services. Focusing on the management of the underlying chain, the construction of general capabilities, and the operation and maintenance security monitoring, a complete blockchain storage business system is built, and the unified calling capability of applications and multi-architecture blockchains is built. A unified and easy-to-use standard interface is provided to support applications to access blockchains of different architectures in a low-cost manner, reduce the dependence of applications on specific underlying chains, and support more business scenarios on the chain.

[0095] The cross-chain storage service system based on the BP neural network load balancing algorithm enables businesses to collaborate on on-chain data and off-chain data, and to conduct governance of on-chain and off-chain collaboration. On-chain data and off-chain data can be requested and called according to actual business needs, allowing the value of on-chain and off-chain data to circulate.

[0096] The bottom chain system layer includes various main chains and sub-chains such as Changan Chain, EOS (Enterprise Operation System) Chain, FABRIC (Hyperledger Fabric) Chain, and other alliance chains. FABRIC chain is an open source blockchain platform designed for enterprise applications. It aims to help enterprises build private or alliance chain networks. Fabric's features include modular design, support for multiple consensus algorithms, smart contracts (chain codes), etc. Due to its flexibility and scalability, Fabric is widely used in enterprise scenarios.

[0097] The plug-in system layer is responsible for the management of the plug-ins of the bottom chain. The BP neural network load balancing module is responsible for selecting storage nodes through the BP neural network load balancing algorithm. The chain plug-in management module manages the Changan chain plug-in, EOS plug-in, FABRIC plug-in and other chain plug-ins. The IPFS (InterPlanetary File System) data storage plug-in is responsible for specific data storage, and the data distribution plug-in is responsible for data distribution. The blockchain oracle cross-chain plug-in, the dual-stack cross-chain plug-in based on the cross-chain smart contract Merkle tree notarization, and the IBC cross-chain plug-in realize cross-chain access to data.

[0098] The blockchain oracle plug-in writes external information into the blockchain to complete the data exchange between the blockchain and the real world. By regularly running general contracts in the oracle, various data are obtained from the EOS, Fabric, IPFS, and Http (HyperText Transfer Protocol) networks to the oracle, and then the oracle calls the contracts of EOS, Fabric and other blockchains according to the consumer contract to write external information to the blockchain, such as Figure 7 shown.

[0099] IBC cross-chain plug-in supports high-security asset cross-chain in an open environment, and completes cross-chain through cross-chain relay, such as Figure 8 shown.

[0100] The multi-architecture interoperability component layer consists of a unified call service interface, a chain call service module, a plug-in management module, an off-chain data distribution module, an off-chain data access module, and a management console module. The unified call service interface is responsible for providing a unified interface to the outside world. The chain call service module is responsible for on-chain and off-chain data interaction and cross-chain data interaction. The plug-in management module is responsible for plug-in registration, plug-in loading, plug-in scheduling, plug-in management, data routing, and other tasks.

[0101] The off-chain data distribution module is responsible for distributing data in accordance with the data distribution protocol and recording the distribution process. The off-chain data access module is responsible for accessing off-chain data. The management console is responsible for chain configuration, cross-chain configuration, operation and maintenance management, audit configuration, system management, and plug-in configuration.

[0102] The business platform layer includes various business systems, Internet billing, quality inspection systems, and settlement systems. The business platform layer is responsible for business services, quality inspection, and billing and settlement.

[0103] In the technical solution of this embodiment, a complete blockchain storage business system is built around the underlying chain management, general capability improvement construction, operation and maintenance security monitoring, etc., to build a unified calling capability between applications and multi-architecture blockchains, provide a unified and easy-to-use standard interface, support applications to access blockchains of different architectures in a low-cost manner, reduce the application's dependence on specific underlying chains, and support more business scenarios on the chain.

[0104] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the cross-chain calling method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0105] This application also provides a cross-chain calling device, please refer to Fig. 9 , the cross-chain calling device includes:

[0106] A generation module 10 is used to generate a cross-chain function hash value of the first blockchain, and store the cross-chain function hash value of the first blockchain in a cross-chain smart contract;

[0107] The receiving module 20 is used to send the cross-chain information to the cross-chain stack of the second blockchain, and access the cross-chain smart contract after receiving the cross-chain success message returned by the cross-chain stack of the second blockchain;

[0108] The determination module 30 is used to determine that the first blockchain successfully initiates the cross-chain if the first blockchain cross-chain function hash value and the second blockchain cross-chain function hash value are queried in the cross-chain smart contract.

[0109] Optionally, the step of generating a cross-chain function hash value of the first blockchain includes:

[0110] Obtain the cross-chain business contract function name of the first blockchain, and obtain the block height when the first blockchain initiates the cross-chain;

[0111] Determine the cross-chain function hash value of the first blockchain according to the cross-chain business contract function name and the block height.

[0112] Optionally, the method comprises:

[0113] Determine a target storage node among the storage nodes to be selected;

[0114] The data of the first blockchain and / or the data of the second blockchain are stored in a target storage node.

[0115] Optionally, the step of determining a target storage node among the storage nodes to be selected includes:

[0116] Obtaining node information of a storage node to be selected, wherein the node information includes at least one of a blockchain type, a storage data volume, a storage speed, and a storage evaluation;

[0117] The target storage node is determined according to the node information of the storage node to be selected.

[0118] The present application also provides a cross-chain calling device, the cross-chain calling device comprising:

[0119] A calculation module, configured to generate a cross-chain function hash value of the second blockchain after receiving the cross-chain information;

[0120] The sending module is used to store the cross-chain function hash value of the second blockchain into the cross-chain smart contract, and send the cross-chain success message to the cross-chain stack of the first blockchain.

[0121] Optionally, the step of generating a cross-chain function hash value of the second blockchain includes:

[0122] Obtain the cross-chain business contract function name of the second blockchain, and obtain the block height of the second blockchain;

[0123] Determine the cross-chain function hash value of the second blockchain according to the cross-chain business contract function name of the second blockchain and the block height.

[0124] The cross-chain calling device provided by this application adopts the cross-chain calling method in the above embodiment, which can solve the technical problem of lack of effective mechanism to realize the flow of cross-chain data and assets. Compared with the prior art, the beneficial effects of the cross-chain calling device provided by this application are the same as the beneficial effects of the cross-chain calling method provided by the above embodiment, and the other technical features in the cross-chain calling device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0125] The present application provides a cross-chain calling device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the cross-chain calling method in the above-mentioned embodiment one.

[0126] Reference below Fig.10 , which shows a schematic diagram of the structure of a cross-chain calling device suitable for implementing the embodiment of the present application. The cross-chain calling device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The cross-chain calling device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0127] like Fig.10As shown, the cross-chain call device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the cross-chain call device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the cross-chain calling device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a cross-chain calling device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0128] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0129] The cross-chain calling device provided by this application adopts the cross-chain calling method in the above embodiment, which can solve the technical problem of lack of effective mechanism to realize the flow of cross-chain data and assets. Compared with the prior art, the beneficial effects of the cross-chain calling device provided by this application are the same as the beneficial effects of the cross-chain calling method provided by the above embodiment, and the other technical features in the cross-chain calling device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0130] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0131] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0132] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the cross-chain calling method in the above-mentioned embodiment.

[0133] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0134] The above-mentioned computer-readable storage medium may be included in the cross-chain calling device; or it may exist independently without being assembled into the cross-chain calling device.

[0135] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the cross-chain calling device, the cross-chain calling device: automatically processes cross-chain calls through cross-chain smart contracts, reduces intermediate links, improves the speed and efficiency of call processing, and uses hash values ​​and the immutability of cross-chain smart contracts to ensure the security of cross-chain calls and the integrity of data. Cross-chain calls between two blockchains are realized through a cross-chain stack, allowing direct communication and data exchange between different blockchain networks, greatly enhancing the interoperability of the blockchain ecosystem, and automated cross-chain calls reduce dependence on centralized service providers, thereby reducing call costs.

[0136] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0137] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0138] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0139] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned cross-chain calling method, and can solve the technical problem of lack of effective mechanisms to realize the flow of cross-chain data and assets. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the cross-chain calling method provided in the above-mentioned embodiment, and will not be repeated here.

[0140] The present application also provides a computer program product, including a computer program, which implements the steps of the cross-chain calling method as described above when executed by a processor.

[0141] The computer program product provided by this application can solve the technical problem of lack of effective mechanism to realize the flow of cross-chain data and assets. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the cross-chain calling method provided by the above embodiment, which will not be repeated here.

[0142] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A cross-chain calling method, characterized in that: The method comprises: Generate a cross-chain function hash value of the first blockchain, and store the cross-chain function hash value of the first blockchain in a cross-chain smart contract; Send the cross-chain information to the cross-chain stack of the second blockchain, and after receiving the cross-chain success message returned by the cross-chain stack of the second blockchain, access the cross-chain smart contract; If the first blockchain cross-chain function hash value and the second blockchain cross-chain function hash value are queried in the cross-chain smart contract, it is determined that the first blockchain has successfully initiated the cross-chain.

2. The method according to claim 1, characterized in that The step of generating a cross-chain function hash value of the first blockchain includes: Obtain the cross-chain business contract function name of the first blockchain, and obtain the block height when the first blockchain initiates the cross-chain; Determine the cross-chain function hash value of the first blockchain according to the cross-chain business contract function name and the block height.

3. The method according to claim 1 or 2, characterized in that The method comprises: Determine a target storage node among the storage nodes to be selected; The data of the first blockchain and / or the data of the second blockchain are stored in a target storage node.

4. The method according to claim 3, characterized in that The step of determining a target storage node among the storage nodes to be selected comprises: Obtaining node information of a storage node to be selected, wherein the node information includes at least one of a blockchain type, a storage data volume, a storage speed, and a storage evaluation; The target storage node is determined according to the node information of the storage node to be selected.

5. A cross-chain calling method, characterized in that: The method comprises: After receiving the cross-chain information, generate a cross-chain function hash value of the second blockchain; The cross-chain function hash value of the second blockchain is stored in the cross-chain smart contract, and a cross-chain success message is sent to the cross-chain stack of the first blockchain.

6. The method according to claim 5, characterized in that The step of generating a cross-chain function hash value of the second blockchain includes: Obtain the cross-chain business contract function name of the second blockchain, and obtain the block height of the second blockchain; Determine the cross-chain function hash value of the second blockchain according to the cross-chain business contract function name of the second blockchain and the block height.

7. A cross-chain calling device, characterized in that: The device comprises: A generation module, used to generate a cross-chain function hash value of the first blockchain, and store the cross-chain function hash value of the first blockchain in a cross-chain smart contract; A receiving module, used to send cross-chain information to the cross-chain stack of the second blockchain, and access the cross-chain smart contract after receiving a cross-chain success message returned by the cross-chain stack of the second blockchain; The determination module is used to determine that the first blockchain successfully initiates the cross-chain if the first blockchain cross-chain function hash value and the second blockchain cross-chain function hash value are queried in the cross-chain smart contract.

8. A cross-chain calling device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the cross-chain calling method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the cross-chain calling method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the cross-chain calling method as claimed in any one of claims 1 to 6 are implemented.