A business data cross-chain method, device and medium of a heterogeneous blockchain system

By monitoring business changes in the blockchain system and using cross-chain smart contracts to determine transaction hashes, cross-chain business data between heterogeneous blockchain systems is achieved, solving the data sharing needs, ensuring data security and isolation, and supporting interoperability between chains.

CN116647554BActive Publication Date: 2026-03-20INSPUR YUNZHOU (SHANDONG) IND INTERNET CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-22
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

The existing blockchain environment cannot achieve cross-chain data sharing, which makes it impossible to meet the business data sharing needs between heterogeneous systems.

Method used

By having the transaction recipient monitor the main chain business system of the heterogeneous blockchain system, obtain business changes, and use cross-chain smart contracts to determine the main chain transaction hash and the sub-chain transaction hash, obtain and return the changed business data, the cross-chain business data is realized.

Benefits of technology

It enables fast and secure business data sharing between heterogeneous blockchain systems, solves the problem of data asynchrony in blockchain silos, has anti-tampering and data isolation properties, and supports interoperability between chains.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116647554B_ABST
    Figure CN116647554B_ABST
Patent Text Reader

Abstract

The embodiment of the specification discloses a business data cross-chain method, equipment and medium of a heterogeneous blockchain system, relates to the technical field of blockchain, and the method comprises the following steps: monitoring the main chain business system of the heterogeneous blockchain system by the transaction receiver to obtain business changes; obtaining the main chain transaction hash corresponding to the business changes through the main chain business system of the heterogeneous blockchain system, wherein the main chain business system comprises a cross-chain smart contract comprising at least one cross-chain channel, and each cross-chain channel comprises a plurality of cross-chain channel members; determining the sub-chain transaction hash corresponding to the business changes and the data acquisition address of the transaction initiator according to the main chain transaction hash and the predetermined specified transaction ID through the cross-chain smart contract; obtaining the change business data corresponding to the business changes through the sub-chain transaction hash corresponding to the business changes and the data acquisition address of the transaction initiator, so as to return the change business data to the transaction receiver through the main chain business system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present specification relates to the technical field of blockchain, and particularly relates to a business data cross-chain method of a heterogeneous blockchain system, equipment and medium. BACKGROUND

[0002] With the development of Internet technology, data interaction between enterprises or different systems of the same enterprise is more and more frequent. Different business systems have their own business and different architecture designs, and realizing data sharing needs to overcome the problem of system heterogeneity. The same is true for the blockchain environment. Each blockchain system represents a unique distributed data ledger. However, in normal business scenarios, multiple heterogeneous blockchain systems may be crossed, and data recorded in one blockchain can be accessed, verified and referenced in a semantically compatible manner by another external transaction. Therefore, data cross-chain cannot be realized in the existing blockchain environment, resulting in the inability to meet the business data sharing needs between heterogeneous systems. SUMMARY

[0003] One or more embodiments of the present specification provide a business data cross-chain method of a heterogeneous blockchain system, equipment and medium, which are used to solve the technical problem that data cross-chain cannot be realized in the existing blockchain environment, resulting in the inability to meet the business data sharing needs between heterogeneous systems.

[0004] One or more embodiments of the present specification adopt the following technical solutions:

[0005] One or more embodiments of the present specification provide a business data cross-chain method of a heterogeneous blockchain system, which is characterized by comprising: monitoring a main chain business system of a heterogeneous blockchain system through a transaction receiver to obtain a business change; obtaining a main chain transaction hash corresponding to the business change through the main chain business system of the heterogeneous blockchain system, wherein the main chain business system comprises a cross-chain smart contract comprising at least one cross-chain channel, and each cross-chain channel comprises a plurality of cross-chain channel members; determining a sub-chain transaction hash corresponding to the business change and a data acquisition address of a transaction initiator through the cross-chain smart contract according to the main chain transaction hash and a predetermined specified transaction ID; obtaining change business data corresponding to the business change through the sub-chain transaction hash corresponding to the business change and the data acquisition address of the transaction initiator, so as to return the change business data to the transaction receiver through the main chain business system, thereby realizing business data cross-chain.

[0006] Further, the transaction initiator writes the business data into the main chain business system of the heterogeneous blockchain system to generate a main chain transaction hash corresponding to the current transaction, specifically including: writing the business data corresponding to the current transaction into a first sub-chain business system of the heterogeneous blockchain system, so as to return a first sub-chain transaction hash corresponding to the current transaction to the transaction initiator through the first sub-chain business system; and writing the first sub-chain transaction hash and a business data hash corresponding to the business data into the main chain business system of the heterogeneous blockchain system through the transaction initiator to generate the main chain transaction hash corresponding to the current transaction.

[0007] Further, before the business change, the method further includes: creating, by the transaction initiator, a current transaction in the cross-chain channel, determining a transaction ID corresponding to the current transaction and business data corresponding to the current transaction; obtaining the business data corresponding to the current transaction, wherein the transaction parties of the current transaction include a transaction initiator and a transaction receiver; and writing, by the transaction initiator, the business data into the main chain business system of the heterogeneous blockchain system to generate a main chain transaction hash corresponding to the current transaction.

[0008] Further, the transaction initiator writes the business data into the main chain business system of the heterogeneous blockchain system to generate a main chain transaction hash corresponding to the current transaction, specifically including: writing the business data corresponding to the current transaction into a first sub-chain business system of the heterogeneous blockchain system, so as to return a first sub-chain transaction hash corresponding to the current transaction to the transaction initiator through the first sub-chain business system; and writing the first sub-chain transaction hash and a business data hash corresponding to the business data into the main chain business system of the heterogeneous blockchain system through the transaction initiator to generate the main chain transaction hash corresponding to the current transaction.

[0009] Further, before the business change, the method further includes: calling, by the transaction receiver, a business data hash corresponding to the business data according to the main chain transaction hash in the main chain business system; processing the business data based on the business data hash to generate business processing result data; and writing, by the transaction receiver, the business processing result data into the main chain business system of the heterogeneous blockchain system.

[0010] Further, the transaction receiver writes the business processing result data into the main chain business system of the heterogeneous blockchain system, specifically including: the transaction receiver writes the business processing result data into the second sub-chain business system of the heterogeneous blockchain system, so as to return the second sub-chain transaction hash corresponding to the current transaction to the transaction receiver through the second sub-chain business system; and the transaction receiver writes the second sub-chain transaction hash and the business processing result hash corresponding to the business processing result data into the main chain business system of the heterogeneous blockchain system.

[0011] Further, the transaction receiver performs business monitoring on the main chain business system of the heterogeneous blockchain system to obtain the business change, and the method further includes: creating the cross-chain channel in the main chain business system to deploy the cross-chain smart contract; and adding a channel member in the cross-chain channel to facilitate the channel member to establish a connection with the main chain business system in the cross-chain channel, wherein the channel member includes the transaction receiver and a transaction initiator.

[0012] Further, the transaction receiver performs business monitoring on the main chain business system of the heterogeneous blockchain system to obtain the business change, and the method further includes: creating the cross-chain channel in the main chain business system to deploy the cross-chain smart contract; and adding a channel member in the cross-chain channel to facilitate the channel member to establish a connection with the main chain business system in the cross-chain channel, wherein the channel member includes the transaction receiver and a transaction initiator.

[0013] One or more embodiments of the present specification provide a business data cross-chain device of a heterogeneous blockchain system, including:

[0014] at least one processor; and

[0015] a memory in communication connection with the at least one processor; wherein

[0016] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:

[0017] The transaction receiving party monitors the main chain business system of the heterogeneous blockchain system to obtain business changes, and obtains a main chain transaction hash corresponding to the business changes through the main chain business system of the heterogeneous blockchain system, wherein the main chain business system includes a cross-chain smart contract including at least one cross-chain channel, and each cross-chain channel includes a plurality of cross-chain channel members; the cross-chain smart contract determines a sub-chain transaction hash corresponding to the business changes and a data acquisition address of a transaction initiator according to the main chain transaction hash and a predetermined specified transaction ID; and the sub-chain transaction hash corresponding to the business changes and the data acquisition address of the transaction initiator are used to obtain change business data corresponding to the business changes, so that the change business data is returned to the transaction receiving party through the main chain business system, thereby realizing cross-chain business data.

[0018] The one or more embodiments of the present specification provide a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are configured to:

[0019] The transaction receiving party monitors the main chain business system of the heterogeneous blockchain system to obtain business changes, and obtains a main chain transaction hash corresponding to the business changes through the main chain business system of the heterogeneous blockchain system, wherein the main chain business system includes a cross-chain smart contract including at least one cross-chain channel, and each cross-chain channel includes a plurality of cross-chain channel members; the cross-chain smart contract determines a sub-chain transaction hash corresponding to the business changes and a data acquisition address of a transaction initiator according to the main chain transaction hash and a predetermined specified transaction ID; and the sub-chain transaction hash corresponding to the business changes and the data acquisition address of the transaction initiator are used to obtain change business data corresponding to the business changes, so that the change business data is returned to the transaction receiving party through the main chain business system, thereby realizing cross-chain business data.

[0020] The at least one technical scheme adopted by the embodiments of the present specification can achieve the following beneficial effects: through the above technical scheme, the main chain in the heterogeneous blockchain system is monitored, the main chain transaction hash corresponding to the business change is obtained, the subchain transaction hash corresponding to the business change is determined, the subchain transaction hash in different heterogeneous blockchain systems is chained to the main chain, the business change data is obtained according to the subchain transaction hash, the subchain data is traceable, more secure and reliable, and has a certain anti-tampering property; the cross-chain channel based on the smart contract is used on the main chain, the data sharing between the heterogeneous systems is realized through the cross-chain channel, only the members in the same channel can share the blockchain data, the channels are relatively independent and do not affect each other, and the isolation of the main chain data is better guaranteed; the business data sharing of different heterogeneous blockchain systems is realized quickly and safely, the problem of asynchronous data of current blockchain island is solved, the value crosses the obstacles between chains and chains, and direct circulation is realized, so as to realize the interoperation between chains and chains. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical schemes in the embodiments of the present specification or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments described in the present specification, and those skilled in the art can also obtain other drawings according to these drawings without creative labor. In the drawings:

[0022] Figure 1 A flowchart of a business data cross-chain method of a heterogeneous blockchain system provided by the embodiments of the present specification;

[0023] Figure 2 An application schematic diagram of a business data cross-chain method of a heterogeneous blockchain system provided by the embodiments of the present specification;

[0024] Figure 3 A structure schematic diagram of a business data cross-chain device of a heterogeneous blockchain system provided by the embodiments of the present specification. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the technical schemes in the present specification, the technical schemes in the embodiments of the present specification will be described clearly and completely in combination with the drawings in the embodiments of the present specification. Obviously, the described embodiments are only some embodiments of the present specification, not all embodiments. Based on the embodiments of the present specification, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present specification.

[0026] With the development of Internet technology, data interaction between enterprises or different systems of the same enterprise is more and more frequent. Different business systems have their own businesses and different architecture designs, and realizing data sharing needs to overcome the problem of system heterogeneity. The same is true for the blockchain environment. Each blockchain system represents a unique distributed data ledger. However, in normal business scenarios, it may span multiple heterogeneous blockchain systems, and the data recorded in one blockchain can be accessed, verified and referenced in a semantically compatible manner by another external transaction. Therefore, data cross-chain cannot be realized in the existing blockchain environment, resulting in the inability to meet the business data sharing needs between heterogeneous systems.

[0027] The embodiment of the present specification provides a business data cross-chain method of a heterogeneous blockchain system. It should be noted that the execution subject in the embodiment of the present specification can be a server or any device with data processing capability. Figure 1 The flowchart of the business data cross-chain method of the heterogeneous blockchain system provided by the embodiment of the present specification is shown in Figure 1 As shown in the figure, the method mainly includes the following steps:

[0028] Step S101, business monitoring of the main chain business system of the heterogeneous blockchain system is performed by the transaction receiver to obtain business changes.

[0029] In an embodiment of the present specification, the heterogeneous blockchain system refers to a blockchain system with different architectures, which can include a main chain business system and multiple sub-chain business systems, or other blockchain systems with different architectures. For example, taking a takeout platform as an example, the takeout application corresponds to the main chain business system, and the merchants and users are sub-chain business systems.

[0030] Before the business monitoring of the main chain business system of the heterogeneous blockchain system is performed by the transaction receiver to obtain business changes, the method further includes: in the main chain business system, creating the cross-chain channel to deploy the cross-chain smart contract; adding a channel member in the cross-chain channel, so that the channel member establishes a connection with the main chain business system in the cross-chain channel, wherein the channel member includes a transaction receiver and a transaction initiator.

[0031] In an embodiment of the present specification, the smart contract is created by the interface on the main chain to create a cross-chain channel, and the business data related to the customer will be chained to the contract. It should be noted that multiple cross-chain channels can be created in the main chain business system to generate a cross-chain channel list, select the corresponding cross-chain channel in the cross-chain channel list, and add the corresponding cross-chain channel member. The cross-chain channel member here mainly includes three parameters: member name, member account and data acquisition uniform resource locator (URL). Among them, the member name refers to the name note of the member, and the member account refers to the login account of the member on the main chain platform, which corresponds to the on-chain user of the main chain. The member in the channel needs to provide an interface as a data acquisition URL for the main chain to acquire business data through the interface.

[0032] The business of the main chain business system of the heterogeneous blockchain system is monitored by the transaction receiver to obtain the business change, specifically including: in the cross-chain channel, according to the pre-acquired API interface verification serial number and API interface key, a Websocket connection is established between the transaction receiver and the main chain business system in the heterogeneous blockchain system; the business of the main chain business system of the heterogeneous blockchain system is monitored through the Websocket connection to obtain the business change.

[0033] In an embodiment of the present specification, a multi-node quorum environment is first built to create an enterprise Ethereum alliance blockchain, the user who needs cross-chain is registered in the main chain business system, and the on-chain user corresponding to the user is created on the main chain, and a white list is set, and the account is transferred enough ether. It should be noted that when creating a cross-chain channel of its own, a certain amount of gas needs to be consumed. On the main chain platform of the main chain business system, the cross-chain channel interface is called using the system account to create a cross-chain channel, that is, to deploy a cross-chain smart contract. After creating the channel, the channel member is added, which essentially calls the smart contract to add the member. The member who needs to cross-chain needs to establish a Websocket connection with the main chain business system through the API interface verification serial number and the API interface key. Any member in the channel can use the API interface verification serial number and the API interface key of the platform to call the interface login interface to obtain the token for identity authentication. The transaction receiver establishes a Websocket connection with the main chain business system in the heterogeneous blockchain system, subscribes to the business data change through the Websocket connection, and monitors the business of the heterogeneous blockchain system. When there is a new business or change, the main chain pushes the change to the transaction receiver.

[0034] The method further comprises: through the transaction initiator, creating a current transaction in the cross-chain channel, determining a transaction ID corresponding to the current transaction and business data corresponding to the current transaction; obtaining the business data corresponding to the current transaction, wherein the transaction parties of the current transaction include the transaction initiator and the transaction receiver; and through the transaction initiator, writing the business data into the main chain business system of the heterogeneous blockchain system to generate a main chain transaction hash corresponding to the current transaction.

[0035] In an embodiment of the present specification, through the transaction initiator, a current transaction is created in the cross-chain channel, and a transaction ID corresponding to the current transaction and business data corresponding to the current transaction are determined. It should be noted that the transaction initiator in the channel creates a transaction, which requires the following parameters: cross-chain channel ID, business data Hash written to the sub-chain, business data transaction Hash written to the sub-chain, and user's IID after on-chain. The business data must be in JSON format, and the data Hash is a 32-bit MD5 value after the business data is converted to a JSON string. Here, MD5 refers to Message Digest Algorithm MD5 (MD5).

[0036] Through the transaction initiator, the business data is written into the main chain business system of the heterogeneous blockchain system to generate a main chain transaction hash corresponding to the current transaction, which specifically includes: writing the business data corresponding to the current transaction into the first sub-chain business system of the heterogeneous blockchain system, so as to return the first sub-chain transaction hash corresponding to the current transaction to the transaction initiator through the first sub-chain business system; and through the transaction initiator, writing the first sub-chain transaction hash and the business data hash corresponding to the business data into the main chain business system of the heterogeneous blockchain system to generate the main chain transaction hash corresponding to the current transaction.

[0037] In an embodiment of the present specification, the transaction initiator creates a transaction and on-chains the business data generated by the transaction. The transaction initiator writes the business data into the first sub-chain business system corresponding to the transaction initiator to generate a first sub-chain transaction hash of the current transaction in the first sub-chain, and returns the first sub-chain transaction hash to the transaction initiator. The transaction initiator writes the first sub-chain transaction hash and the business data hash corresponding to the business data into the main chain of the main chain business system to generate a main chain transaction hash.

[0038] The method further comprises: through the transaction receiver, calling, according to the main chain transaction hash, a business data hash corresponding to the business data in the main chain business system of the heterogeneous blockchain system; processing the business data based on the business data hash to generate business processing result data; and writing, by the transaction receiver, the business processing result data into the main chain business system of the heterogeneous blockchain system.

[0039] The writing of the business processing result data into the main chain business system of the heterogeneous blockchain system by the transaction receiver specifically comprises: writing, by the transaction receiver, the business processing result data into a second sub-chain business system of the heterogeneous blockchain system, so as to return, by the second sub-chain business system, a second sub-chain transaction hash corresponding to the current transaction to the transaction receiver; and writing, by the transaction receiver, the second sub-chain transaction hash and a business processing result hash corresponding to the business processing result data into the main chain business system of the heterogeneous blockchain system.

[0040] In one embodiment of the present specification, the transaction receiver calls, according to the main chain transaction hash, a business data hash corresponding to the business data in the main chain business system. The business data is processed according to the business data hash to generate business processing result data. The transaction receiver writes the business processing result data into a second sub-chain business system corresponding to the transaction receiver to generate a second sub-chain transaction hash. The second sub-chain business system returns the second sub-chain transaction hash corresponding to the current transaction to the transaction receiver. The transaction receiver writes the second sub-chain transaction hash and a business processing result hash corresponding to the business processing result data into the main chain.

[0041] In step S102, a main chain transaction hash corresponding to a business change is obtained through a main chain business system of a heterogeneous blockchain system.

[0042] It should be noted that the main chain of the main chain business system includes a cross-chain smart contract including at least one cross-chain channel, and each cross-chain channel includes a plurality of cross-chain channel members. There can be multiple cross-chain channels in one main chain, each cross-chain channel includes a plurality of cross-chain channel members, and cross-chain channel members interact with each other through the cross-chain channel to which they belong.

[0043] In an embodiment of the present specification, since the transaction initiator of the business change prewrites the subchain transaction hash and the business data hash into the main chain, the main chain transaction hash and the transaction ID corresponding to the transaction are generated, so that the changed business data can be obtained through the main chain transaction hash and the specified transaction ID. The transaction receiver can obtain the business data of the transaction initiator in real time through the Websocket broadcast, and the Websocket broadcast mainly returns the following data: main chain transaction hash, cross-chain channel contract address, transaction ID for uniquely identifying the business process, operator's account address in the main chain, business data hash, subchain transaction hash of the business data written into the subchain, time and user's distributed identity IID.

[0044] In step S103, the subchain transaction hash corresponding to the business change and the data acquisition address of the transaction initiator are determined through the cross-chain smart contract according to the main chain transaction hash and the predetermined specified transaction ID.

[0045] When the business change is monitored, the subchain transaction hash of the business transaction corresponding to the current business change and the data acquisition address of the transaction initiator are determined in the main chain through the transaction ID and the main chain transaction hash of the business transaction corresponding to the business change. Here, the transaction initiator can also be understood as the business change party of the current business transaction corresponding to the business change.

[0046] In step S104, the changed business data corresponding to the business change is obtained through the subchain transaction hash corresponding to the business change and the data acquisition address of the transaction initiator, so that the changed business data is returned to the transaction receiver through the main chain business system, so as to realize cross-chain of business data.

[0047] The changed business data corresponding to the business change is obtained through the subchain transaction hash corresponding to the business change and the data acquisition address of the transaction initiator, specifically including: sending a business data acquisition request to the transaction initiator through the data acquisition address of the transaction initiator; under the triggering of the business data acquisition request, the transaction initiator obtains the changed business data corresponding to the business change in the corresponding subchain business system according to the subchain transaction hash.

[0048] In an embodiment of the present specification, the business data acquisition request is sent to the corresponding transaction initiator through the data acquisition address of the transaction initiator through the corresponding cross-chain channel in the cross-chain smart contract. Under the triggering of the business data acquisition request, the transaction initiator obtains the changed business data corresponding to the business change in the corresponding subchain business system according to the subchain transaction hash. The transaction initiator returns the changed business data to the main chain, and the main chain returns the changed business data to the transaction receiver.

[0049] The technical solution is used for monitoring the main chain in the heterogeneous blockchain system, obtaining the main chain transaction hash corresponding to the business change, determining the sub-chain transaction hash corresponding to the business change, uploading the sub-chain transaction hash in different heterogeneous blockchain systems to the main chain, obtaining the business change data according to the sub-chain transaction hash, making the sub-chain data traceable, more secure and reliable, and having a certain anti-tampering property; the cross-chain channel based on the smart contract is used on the main chain, the data sharing between the heterogeneous systems is realized through the cross-chain channel, only the members in the same channel can share the blockchain data, the channels are relatively independent and do not affect each other, and the isolation of the main chain data is better guaranteed; the business data sharing of different heterogeneous blockchain systems is quickly and safely realized, the problem of asynchronous data of the current blockchain island is solved, the value crosses the obstacles between the chains, and direct circulation is realized, so that the interoperation between the chains is realized.

[0050] Figure 2 An application diagram of a business data cross-chain method of a heterogeneous blockchain system provided by an embodiment of the present specification is shown in FIG. 1. Figure 2 As shown in FIG. 1, the application diagram includes a cross-chain function time sequence diagram and a cross-chain data interaction time sequence diagram. First, the cross-chain function time sequence diagram is shown. Application A writes business data into sub-chain A, sub-chain A returns txHashA, that is, sub-chain A transaction hash, which can also be referred to as transaction HashA, and application A calls an interface to write the business data hash and transaction HashA of the business data into the main chain. Application B subscribes to business data changes through WebSocket, the main chain pushes changes to application B when there is a new business or change, application B processes the business when receiving the business change, and writes the processing result into sub-chain B. Sub-chain B returns txHashB, that is, sub-chain B transaction hash, which can also be referred to as transaction HashB, and application B calls an interface to write the business processing result hash and transaction HashB of the processing result data into the main chain.

[0051] Secondly, the cross-chain data interaction is shown in the cross-chain data interaction time sequence diagram. As can be seen from the cross-chain data interaction time sequence diagram, the business data itself is stored in the application sub-chain. When the business data needs to be obtained, the following process is used: first, the application receives a notification that there is a new business change, and then takes the main chain transaction hash corresponding to the business change as a parameter to request the main chain to obtain the business data. The main chain finds the transaction hash of the corresponding sub-chain, the data acquisition API address of the corresponding on-chain application, and requests data from the data on-chain party (assumed to be application B in the figure). Application B queries sub-chain B through the transaction hash to obtain the written business data, sub-chain B returns the business data to application B, application B returns the business data to the main chain, and the main chain returns the business data to application A. Through the cross-chain channel based on the smart contract, the final sub-chain direct data cross-chain is realized by uploading the sub-chain transaction hash to the main chain.

[0052] Take two applications (denoted as A1, A2) as an example, and take the library book lending and returning business as an application scenario. The smart contract is created by the interface on the main chain to create a cross-chain channel, and the business data related to the customer will be chained into this contract. In the cross-chain channel list, the corresponding cross-chain channel is selected, and the corresponding cross-chain channel member is added. Mainly includes three parameters: member name, that is, the name of the member's note, member account, that is, the member's login account on the main chain platform, and the corresponding on-chain user of the main chain, data URL, that is, the member in the way needs to provide an interface for the main chain to obtain business data. Application A1 as the transaction initiator, initiates a transaction, and starts a business process. The business here is book lending and returning, so creating a transaction is to borrow a book; Application A2 as the transaction receiver, subscribes to the events in the channel through WebSocket, that is, the book lending event; Application A2 calls the business data hash through the event in the transaction hash of the main chain. Who participated in the book lending event can be queried. After application A2 obtains the business data through the interface, the data of the business system can be processed, and the processing result is written into the sub-chain B. Then the transaction Hash of the sub-chain and the business processing result data Hash are written into the main chain.

[0053] Through the above technical solution, the websocket subscription broadcast method is used, the cross-chain channel method of the main chain is used to quickly obtain the business data in the heterogeneous blockchain system of the sub-chain, and the method has the characteristics of obvious speed; the transaction hash in different heterogeneous blockchain systems is chained to the main chain, so that the sub-chain data has a trace, is more secure and reliable, and has a certain anti-tampering property; the cross-chain channel based on the smart contract on the main chain is used, only the members in the same channel can share the blockchain data, the channels are relatively independent, and do not affect each other, so that the isolation of the main chain data is better guaranteed. The cross-chain channel of the smart contract of the main chain is used as an intermediary, and the websocket subscription broadcast feature is used to quickly and safely realize the business data sharing of different heterogeneous blockchain systems, solve the problem of asynchronous data of the current blockchain island, let the value cross the barrier between chains and chains, and directly circulate, so as to realize the interoperation between chains and chains.

[0054] The embodiment of the present application also provides a business data cross-chain device of a heterogeneous blockchain system, as shown in Figure 3 The device includes at least one processor, and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:

[0055] The transaction receiving party monitors the main chain business system of the heterogeneous blockchain system to obtain a business change; the main chain business system of the heterogeneous blockchain system is used to obtain a main chain transaction hash corresponding to the business change, wherein the main chain business system comprises a cross-chain smart contract comprising at least one cross-chain channel, and each cross-chain channel comprises a plurality of cross-chain channel members; the cross-chain smart contract is used to determine, according to the main chain transaction hash and a predetermined specified transaction ID, a sub-chain transaction hash corresponding to the business change and a data acquisition address of a transaction initiator; the sub-chain transaction hash corresponding to the business change and the data acquisition address of the transaction initiator are used to obtain change business data corresponding to the business change, so as to return the change business data to the transaction receiving party through the main chain business system, thereby realizing cross-chain of business data.

[0056] The embodiments of the present specification also provide a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are configured to:

[0057] The transaction receiving party monitors the main chain business system of the heterogeneous blockchain system to obtain a business change; the main chain business system of the heterogeneous blockchain system is used to obtain a main chain transaction hash corresponding to the business change, wherein the main chain business system comprises a cross-chain smart contract comprising at least one cross-chain channel, and each cross-chain channel comprises a plurality of cross-chain channel members; the cross-chain smart contract is used to determine, according to the main chain transaction hash and a predetermined specified transaction ID, a sub-chain transaction hash corresponding to the business change and a data acquisition address of a transaction initiator; the sub-chain transaction hash corresponding to the business change and the data acquisition address of the transaction initiator are used to obtain change business data corresponding to the business change, so as to return the change business data to the transaction receiving party through the main chain business system, thereby realizing cross-chain of business data.

[0058] Each of the embodiments in the present specification is described in a progressive manner, and the same or similar parts of each of the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. Especially, the device, the equipment, and the non-volatile computer storage medium embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.

[0059] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different than the order in the embodiments and still achieve the desired result. In addition, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing can be advantageous or possible.

[0060] The device and medium provided by the embodiments of the present specification are one-to-one corresponding to the method, and therefore the device and medium also have similar beneficial technical effects to the method corresponding thereto. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the device and medium will not be described here again.

[0061] Those skilled in the art should understand that the embodiments of the present specification can be provided as a method, a system, or a computer program product. Therefore, the present specification can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROMs, optical storage devices, etc.) containing computer-usable program code.

[0062] The present specification is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present specification. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the flow Figure 1 one or more flows and / or blocks Figure 1 means for performing the function specified by the flow or flows and / or block or blocks.

[0063] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction means, which implements the flow Figure 1 one or more flows and / or blocks Figure 1 means for performing the function specified by the flow or flows and / or block or blocks.

[0064] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide a process for implementing the flow Figure 1 one or more flows and / or blocks Figure 1 means for performing the function specified by the flow or flows and / or block or blocks.

[0065] In one typical arrangement, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0066] Memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory, etc. Memory is an example of computer readable storage media.

[0067] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile discs (DVDs) or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.

[0068] It should also be noted that the terms "comprising," "including," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements recited, but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that includes the recited element.

[0069] The above description is merely one or more embodiments of the present specification and is not intended to limit the present specification. One or more embodiments of the present specification can have various modifications and changes for one skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of one or more embodiments of the present specification should be included in the scope of the claims of the present specification.

Claims

1. A method for cross-chain business data in a heterogeneous blockchain system, characterized in that, The method includes: By monitoring the main chain business system of the heterogeneous blockchain system through the transaction recipient, business changes can be obtained. The main chain business system of the heterogeneous blockchain system obtains the main chain transaction hash corresponding to the business change. The main chain business system includes a cross-chain smart contract with at least one cross-chain channel, and each cross-chain channel includes multiple cross-chain channel members. Through the cross-chain smart contract, the sub-chain transaction hash and the data acquisition address of the transaction initiator corresponding to the business change are determined based on the main chain transaction hash and the pre-determined specified transaction ID. By using the subchain transaction hash corresponding to the business change and the data acquisition address of the transaction initiator, the changed business data corresponding to the business change is obtained, and the changed business data is returned to the transaction recipient through the main chain business system to realize cross-chain business data. The method further includes monitoring the main chain business system of a heterogeneous blockchain system through the transaction recipient to obtain information prior to business changes: The transaction initiator creates the current transaction within the cross-chain channel and determines the transaction ID and business data corresponding to the current transaction. Obtain the business data corresponding to the current transaction, wherein the two parties to the current transaction include the transaction initiator and the transaction recipient; The transaction initiator writes the business data into the main chain business system of the heterogeneous blockchain system, generating the main chain transaction hash corresponding to the current transaction.

2. The cross-chain method for business data in a heterogeneous blockchain system according to claim 1, characterized in that, By using the subchain transaction hash corresponding to the business change and the data retrieval address of the transaction initiator, the changed business data corresponding to the business change is obtained, specifically including: Send a business data retrieval request to the transaction initiator through the transaction initiator's data retrieval address; Upon triggering the business data acquisition request, the transaction initiator retrieves the change business data corresponding to the business change from the corresponding subchain business system based on the subchain transaction hash.

3. The cross-chain method for business data in a heterogeneous blockchain system according to claim 1, characterized in that, Through the transaction initiator, the business data is written into the main chain business system of the heterogeneous blockchain system to generate the main chain transaction hash corresponding to the current transaction, specifically including: The business data corresponding to the current transaction is written into the first sub-chain business system of the heterogeneous blockchain system, so as to return the first sub-chain transaction hash corresponding to the current transaction to the transaction initiator through the first sub-chain business system; The transaction initiator writes the transaction hash of the first sub-chain and the business data hash corresponding to the business data into the main chain business system of the heterogeneous blockchain system to generate the main chain transaction hash corresponding to the current transaction.

4. The cross-chain method for business data in a heterogeneous blockchain system according to claim 3, characterized in that, The method further includes monitoring the main chain business system of a heterogeneous blockchain system through the transaction recipient to obtain information prior to business changes: The transaction recipient, based on the main chain transaction hash, calls the business data hash corresponding to the business data in the main chain business system. Based on the hash of the business data, the business data is processed to generate business processing result data; The transaction recipient writes the business processing result data into the main chain business system of the heterogeneous blockchain system.

5. The cross-chain method for business data in a heterogeneous blockchain system according to claim 4, characterized in that, The transaction recipient writes the business processing result data into the main chain business system of the heterogeneous blockchain system, specifically including: The transaction recipient writes the business processing result data into the second sub-chain business system of the heterogeneous blockchain system, so that the second sub-chain business system returns the second sub-chain transaction hash corresponding to the current transaction to the transaction recipient. The transaction recipient writes the transaction hash of the second subchain and the business processing result hash corresponding to the business processing result data into the main chain business system of the heterogeneous blockchain system.

6. The method for cross-chain business data in a heterogeneous blockchain system according to claim 1, characterized in that, The method further includes monitoring the main chain business system of a heterogeneous blockchain system through the transaction recipient to obtain information prior to business changes: In the main chain business system, the cross-chain channel is created to deploy the cross-chain smart contract; Channel members are added to the cross-chain channel to facilitate the connection between the channel members and the main chain business system in the cross-chain channel. The channel members include transaction recipients and transaction initiators.

7. The cross-chain method for business data in a heterogeneous blockchain system according to claim 6, characterized in that, By monitoring the main chain business system of a heterogeneous blockchain system through the transaction recipient, changes in business can be detected, specifically including: Within the cross-chain channel, a Websocket connection is established between the transaction recipient and the main chain business system in the heterogeneous blockchain system, based on the pre-acquired API interface verification sequence number and API interface key. The Websocket connection is used to monitor the main chain business system of the heterogeneous blockchain system in order to obtain information on business changes.

8. A cross-chain device for business data in a heterogeneous blockchain system, characterized in that, The device 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 to enable the at least one processor to perform the method as described in any one of claims 1-7.

9. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are configured to perform the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Cross-chain system contract based on a main chain and a plurality of parallel sub-chains, and a transfer flow thereof

    CN109493052A

  • Method and system for collecting operation states of main chain and sub-chain of block chain, and storage medium

    CN113760651A