Multi-chain scene-oriented cross-chain method, cross-chain gateway and electronic equipment

By creating an adapter for each blockchain in the cross-chain gateway and dividing it into a base chain and a business chain, it solves the problem that existing technology cannot support many-to-many cross-chain scenarios and realizes blockchain data in multi-chain scenarios. Interoperability and management improve processing efficiency and data security.

CN118784261APending Publication Date: 2024-10-15ACADEMY OF BROADCASTING SCI STATE ADMINISTATION OF PRESS PUBLICATION RADIO FILM & TELEVISION +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310974153.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-04-06
Filing Date
2023-08-03
Publication Date
2024-10-15

Smart Images

  • Figure CN118784261A_ABST
    Figure CN118784261A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-chain scene-oriented cross-chain method, a cross-chain gateway and electronic equipment, the method is applied to the cross-chain gateway, and the method comprises the following steps: adding an adapter corresponding to a to-be-registered block chain in the cross-chain gateway; acquiring information of a to-be-registered block chain; according to the information of the to-be-registered block chain, registering the to-be-registered block chain to the cross-chain gateway through an adapter corresponding to the to-be-registered block chain; generating an account ID and a public and private key pair corresponding to the block chain registered to the cross-chain gateway; and performing cross-chain access according to the account ID and the public and private key pair of the block chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and more specifically, to a cross-chain method, a cross-chain gateway, and an electronic device for multi-chain scenarios. Background Art

[0002] Most of the current blockchain alliance chain systems are independent and closed systems. In order to achieve intercommunication between various blockchains, many cross-chain and multi-chain technologies have been proposed to solve the communication and collaboration between different blockchains. At present, cross-chain technologies and implementation methods are cross-chain connection methods between two blockchains. There is no multi-chain cross-chain technology implementation for complex multi-to-many cross-chain scenarios, and it is unable to support complex cross-chain business and management needs. Summary of the invention

[0003] One object of the present invention is to provide a new technical solution for cross-chain implementation in a multi-chain scenario.

[0004] According to a first aspect of the present invention, a cross-chain method for a multi-chain scenario is provided, the method being applied to a cross-chain gateway, the method comprising:

[0005] Adding an adapter corresponding to the blockchain to be registered in the cross-chain gateway;

[0006] Get the information of the blockchain to be registered;

[0007] According to the information of the blockchain to be registered, register the blockchain to be registered to the cross-chain gateway through an adapter corresponding to the blockchain to be registered;

[0008] Generate an account ID and a public-private key pair corresponding to the blockchain registered to the cross-chain gateway;

[0009] Cross-chain access is performed based on the account ID and public-private key pair of the blockchain.

[0010] Optionally, registering the blockchain to be registered to the cross-chain gateway through an adapter corresponding to the blockchain to be registered according to the information of the blockchain to be registered includes:

[0011] Registering the blockchain to be registered as a base chain or a business chain according to the information of the blockchain to be registered;

[0012] Among them, the base chain is used to realize the management of each business chain and inter-chain collaboration, and the business chain is used for blockchain evidence storage, verification and smart contract functions of specific businesses. Different business chains correspond to different business functions.

[0013] Optionally, the method further comprises:

[0014] After the business chain generates a block, the cross-chain gateway reads the block header and Merkle tree of the business chain;

[0015] The cross-chain gateway sends the block header and Merkle tree of the business chain to the base chain in the form of a transaction request, so that the base chain verifies the operation of the business chain.

[0016] Optionally, after generating an account ID and a public-private key pair corresponding to the blockchain registered to the cross-chain gateway, the method further includes:

[0017] Get the account ID of the registered target blockchain;

[0018] Binding the blockchain to the target blockchain according to the account ID of the registered target blockchain and the account ID of the blockchain.

[0019] Optionally, the method further comprises:

[0020] Monitor and process events of preset types, where the preset events include transaction requests, contract execution, and block completion;

[0021] Return event information to the blockchain corresponding to the event.

[0022] Optionally, the method further comprises:

[0023] When the business chain generates a new block, receiving a verification data packaging request initiated by the business chain;

[0024] In response to the verification data packaging request, obtaining the block transaction information of the business chain, the block transaction information including the block height, block hash value, previous block hash value, timestamp, Merkle tree, and account ID of the business chain;

[0025] Verify the block transaction information of the business chain;

[0026] If the verification is successful, the block transaction information is stored in the base chain.

[0027] Optionally, storing the block transaction information to the base chain when the verification is passed includes:

[0028] When an abnormality is detected in the base chain, the block transaction information of the service chain is stored in the cross-chain gateway;

[0029] After detecting that the base chain has returned to normal, the block transaction information of the business chain stored in the cross-chain gateway is synchronized to the base chain.

[0030] Optionally, the blockchain to be registered is a blockchain isomorphic to the registered blockchain in the cross-chain gateway;

[0031] Alternatively, the blockchain to be registered is a blockchain that is heterogeneous with the blockchain registered in the cross-chain gateway.

[0032] According to a second aspect of the present invention, there is provided a cross-chain gateway, comprising an adapter and a cross-chain bus;

[0033] The cross-chain bus is used to add an adapter corresponding to the blockchain to be registered in the cross-chain gateway;

[0034] The adapter is used to obtain information of the blockchain to be registered, and register the blockchain to be registered to the cross-chain gateway according to the information of the blockchain to be registered;

[0035] The cross-chain bus is also used to generate an account ID and a public-private key pair corresponding to the blockchain registered to the cross-chain gateway, and perform cross-chain access based on the account ID and the public-private key pair of the blockchain.

[0036] According to a third aspect of the present invention, there is provided an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and wherein the programs or instructions, when executed by the processor, implement the steps of the cross-chain method for multi-chain scenarios as described in the first aspect of the present invention.

[0037] According to one embodiment of the present invention, the present invention creates a corresponding adapter for each blockchain in the cross-chain gateway, connects with the blockchain through the adapter, manages and registers the blockchain in the same way in a multi-chain scenario, and realizes data intercommunication between chains.

[0038] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0040] Figure 1 It is a schematic diagram of the hardware configuration of an electronic device for implementing a cross-chain method for multi-chain scenarios provided in accordance with an embodiment of the present application.

[0041] Figure 2 It is a flow chart of a cross-chain method for multi-chain scenarios in an embodiment of the present invention.

[0042] Figure 3 Schematic diagram of a cross-chain gateway in an embodiment of the present invention.

[0043] Figure 4 Schematic diagram of the blockchain registration process in an embodiment of the present invention. DETAILED DESCRIPTION

[0044] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.

[0045] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0046] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0047] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0048] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0049] Figure 1 It is a block diagram of the hardware configuration of an electronic device for implementing a cross-chain method for multi-chain scenarios provided in accordance with an embodiment of the present application.

[0050] The electronic device 1000 may be a terminal or a server. Further, the terminal may be a head mounted device, a portable computer, a tablet computer, a palm computer, etc. The server may be a cloud server, etc.

[0051] The electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. The processor 1100 may be a central processing unit CPU, a microprocessor MCU, and the like. The memory 1200 may include, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, and the like. The interface device 1300 may include, for example, a USB interface, an earphone interface, and the like. The communication device 1400 may, for example, be capable of wired or wireless communication. The display device 1500 may be, for example, a liquid crystal display screen, a touch display screen, and the like. The input device 1600 may include, for example, a touch screen, a keyboard, and the like. The user may input / output voice information through the speaker 1700 and the microphone 1800.

[0052] Despite Figure 1 Multiple devices are shown for the electronic device 1000, but the present application may only involve some of the devices, for example, the electronic device 1000 only involves the memory 1200 and the processor 1100.

[0053] In the embodiment of the present application, the memory 1200 of the electronic device 1000 is used to store instructions, which are used to control the processor 1100 to execute the cross-chain method for multi-chain scenarios provided in the embodiment of the present application.

[0054] In the above description, the technician can design instructions according to the scheme disclosed in this application. How instructions control the processor to operate is well known in the art, so it will not be described in detail here.

[0055] like Figure 2 As shown, this embodiment introduces a cross-chain method for a multi-chain scenario, where the multi-chain scenario includes multiple blockchains, which can be isomorphic blockchains or heterogeneous blockchains. The method is applied to a cross-chain gateway, and the method includes steps 2100-2500.

[0056] Step 2100: Add an adapter corresponding to the blockchain to be registered in the cross-chain gateway.

[0057] In a multi-chain scenario, each blockchain needs to be registered on the cross-chain gateway, and there is a corresponding adapter for each cross-chain in the cross-chain gateway. The adapter can be connected to the corresponding blockchain through system configuration. When a new blockchain needs to be registered, a new adapter is added to the cross-chain gateway to connect the new adapter to the new blockchain.

[0058] like Figure 3 As shown, the cross-chain gateway includes a cross-chain system kernel and a cross-chain management background. The multi-chain system includes blockchain 1, blockchain 2 and blockchain 3. The adapter of blockchain 1, the adapter of blockchain 2 and the adapter of blockchain 3 are set in the cross-chain gateway.

[0059] Step 2200: Obtain information of the blockchain to be registered.

[0060] The information of the blockchain to be registered is obtained through an adapter corresponding to the blockchain to be registered, and the information of the blockchain to be registered includes the type of the blockchain to be registered, the genesis unit information of the blockchain to be registered, and the anchor node information of the blockchain to be registered.

[0061] Step 2300: According to the information of the blockchain to be registered, register the blockchain to be registered to the cross-chain gateway through an adapter corresponding to the blockchain to be registered.

[0062] The information of the blockchain to be registered is obtained through the adapter corresponding to the blockchain to be registered, and the information of the blockchain to be registered is saved in the cross-chain gateway. Figure 4 As shown, during the registration process of blockchain 1, the information of blockchain 1 is obtained through the adapter of blockchain 1, and the information of blockchain 1 is written into the cross-chain bus.

[0063] In one embodiment, step 2300 includes: registering the blockchain to be registered as a base chain or a business chain according to the information of the blockchain to be registered; wherein the base chain is used to implement the management of each of the business chains and inter-chain collaboration, and the business chain is used for blockchain evidence storage, verification and smart contract functions of specific businesses, and different business chains correspond to different business functions.

[0064] The blockchain in the multi-chain scenario is divided into a base chain and a business chain, where only one blockchain is the base chain and the rest are business chains. Figure 3 As shown, for example, blockchain 1 is the base chain, and blockchain 2 and blockchain 3 are both business chains.

[0065] The base chain is only responsible for the management and coordination of the business chain and does not participate in specific business services. The base chain stores the block headers and transaction Merkle trees of each business chain.

[0066] The business chain is responsible for the service of specific business, and the business data is stored on the business chain. Different business chains are responsible for different businesses. For example, business chain 1 is responsible for digital copyright services, and business chain 2 is responsible for financial transaction services. Then the relevant data of digital copyright is stored on business chain 1, and the relevant data of financial transactions is stored on business chain 2.

[0067] Step 2400: Generate an account ID and a public-private key pair corresponding to the blockchain registered to the cross-chain gateway.

[0068] Step 2500: Perform cross-chain access based on the account ID and public-private key pair of the blockchain.

[0069] After the blockchain is registered, the account ID and public-private key pair corresponding to the blockchain are generated. The account ID is used for cross-chain access between different blockchains. The public-private key pair is used to sign and authenticate the transaction data of the blockchain to improve the credibility of the transaction data.

[0070] This embodiment creates a corresponding adapter for each blockchain in the cross-chain gateway, connects with the blockchain through the adapter, manages and registers the blockchain in the same way in the multi-chain scenario, and realizes data intercommunication between chains in the multi-chain scenario. Different blockchains are registered as base chains or business chains, and different business chains are responsible for different businesses. By dividing the blockchain according to function, the processing efficiency of the blockchain is improved and the concurrency pressure is reduced.

[0071] In this embodiment, the method further includes steps 3100-3400.

[0072] Step 3100: When the business chain generates a new block, receive a verification data packaging request initiated by the business chain.

[0073] Step 3200: In response to the verification data packaging request, obtain the block transaction information of the business chain, the block transaction information includes block height, block hash value, previous block hash value, timestamp, Merkle tree, and account ID of the business chain.

[0074] Step 3300: Verify the block transaction information of the business chain.

[0075] Step 3400: If the verification is successful, the block transaction information is stored in the base chain.

[0076] When a new transaction is generated on the business chain, the business chain will generate a new block. The business chain will initiate a verification data packaging request and send the transaction information in the newly generated block to the cross-chain gateway, which will verify the transaction information. After the verification is passed, the transaction information will be stored in the base chain to achieve synchronization of transaction information. When other business chains need to use the transaction information, they can obtain it from the base chain.

[0077] In one embodiment, step 3400 includes steps 3410-3420.

[0078] Step 3410: When an abnormality is detected in the base chain, the block transaction information of the business chain is stored in the cross-chain gateway.

[0079] Step 3420: After detecting that the base chain has returned to normal, synchronize the block transaction information of the business chain stored in the cross-chain gateway to the base chain.

[0080] The cross-chain gateway will monitor the status of the base chain in real time. If the status of the base chain is abnormal, data loss or leakage may occur. To ensure data security and accuracy, data cannot be stored in the base chain at this time. When the cross-chain gateway detects an abnormality in the base chain, if the cross-chain gateway receives the block transaction information of the business chain, it will first store the block transaction information of the business chain in the cross-chain gateway, and then store the block transaction information of the business chain in the base chain after the status of the base chain returns to normal.

[0081] For example, after the cross-chain gateway obtains the block transaction information of blockchain 1, the cross-chain gateway detects that the base chain is in an abnormal state, and then stores the block transaction information of blockchain 1 in the cross-chain gateway. The cross-chain gateway continues to monitor the state of the base chain, and after the base chain returns to a normal state, the cross-chain gateway stores the block transaction information of blockchain 1 in the base chain.

[0082] This embodiment monitors the status of the base chain in real time, and only stores the block transaction information of the business chain in the base chain when the base chain is in a normal state, thereby improving data security and accuracy.

[0083] In this embodiment, the method also includes: after the business chain generates a block, the cross-chain gateway reads the block header and Merkle tree of the business chain; the cross-chain gateway sends the block header and Merkle tree of the business chain to the base chain in the form of a transaction request, so that the base chain verifies the operation of the business chain.

[0084] In this embodiment, after generating an account ID and a public-private key pair corresponding to the blockchain registered to the cross-chain gateway, the method further includes: obtaining the account ID of the registered target blockchain; and binding the blockchain to the target blockchain according to the account ID of the registered target blockchain and the account ID of the blockchain.

[0085] When registering a business chain, you can specify the account ID of another blockchain, and then the business chain will be bound to the specified blockchain. You can specify the account ID of one blockchain for binding, or you can specify the account IDs of multiple blockchains for binding. For the two bound blockchains, you do not need to specify the account ID of the blockchain during data exchange, which improves efficiency.

[0086] For example, when business chain 3 is registered, the account ID of business chain 1 is specified, then the cross-chain gateway will bind business chain 3 to business chain 1. When business chain 3 accesses data in business chain 1, it is no longer necessary to specify the account ID of business chain 1 during the data access process. Business chain 3 can access directly to improve efficiency.

[0087] In this embodiment, the method also includes: monitoring and processing events of preset types, wherein the events of preset types include transaction requests, contract execution, and block completion; and returning event information to the blockchain corresponding to the event.

[0088] You can register events of a specified type on the cross-chain gateway, and the cross-chain gateway will monitor whether the registered events appear on each blockchain. For registered events, the cross-chain gateway can monitor whether the event runs successfully and return the results of the event. The cross-chain gateway can also filter registered events. For filtered events, the cross-chain gateway will not monitor them. When registering an event, you can specify that the event is an event that needs to be monitored, or you can specify that the event is an event that needs to be filtered.

[0089] For example, when registering an event, specify that the contract execution event is the event that needs to be monitored, and specify that the transaction request event is the event that needs to be filtered. Then the cross-chain gateway will monitor the contract execution events on each blockchain, but will not monitor the transaction request events on each blockchain.

[0090] This embodiment introduces a cross-chain gateway, including an adapter and a cross-chain bus;

[0091] The cross-chain bus is used to add an adapter corresponding to the blockchain to be registered in the cross-chain gateway;

[0092] The adapter is used to obtain information of the blockchain to be registered, and register the blockchain to be registered to the cross-chain gateway according to the information of the blockchain to be registered;

[0093] The cross-chain bus is also used to generate an account ID and a public-private key pair corresponding to the blockchain registered to the cross-chain gateway, and perform cross-chain access based on the account ID and the public-private key pair of the blockchain.

[0094] This embodiment creates a corresponding adapter for each blockchain in the cross-chain gateway, connects with the blockchain through the adapter, manages and registers the blockchain in a unified manner in a multi-chain scenario, and realizes data intercommunication between chains in a multi-chain scenario.

[0095] Optionally, the adapter is further used for:

[0096] Registering the blockchain to be registered as a base chain or a business chain according to the information of the blockchain to be registered;

[0097] Among them, the base chain is used to realize the management of each business chain and inter-chain collaboration, and the business chain is used for blockchain evidence storage, verification and smart contract functions of specific businesses. Different business chains correspond to different business functions.

[0098] Optionally, the adapter is further used for:

[0099] After the business chain generates a block, read the block header and Merkle tree of the business chain;

[0100] The block header and Merkle tree of the business chain are sent to the base chain in the form of a transaction request, so that the base chain verifies the operation of the business chain.

[0101] Optionally, the cross-chain bus is also used for:

[0102] Get the account ID of the registered target blockchain;

[0103] Binding the blockchain to the target blockchain according to the account ID of the registered target blockchain and the account ID of the blockchain.

[0104] Optionally, the cross-chain bus is also used for:

[0105] Monitor and process events of preset types, where the preset events include transaction requests, contract execution, and block completion;

[0106] Return event information to the blockchain corresponding to the event.

[0107] Optionally, the adapter is further used to: when the business chain generates a new block, receive a verification data packaging request initiated by the business chain, and in response to the verification data packaging request, obtain block transaction information of the business chain, wherein the block transaction information includes block height, block hash value, previous block hash value, timestamp, Merkle tree, and account ID of the business chain;

[0108] The cross-chain bus is also used to verify the block transaction information of the business chain, and store the block transaction information in the base chain if the verification passes.

[0109] Optionally, the cross-chain bus is also used for:

[0110] When an abnormality is detected in the base chain, the block transaction information of the service chain is stored in the cross-chain gateway;

[0111] After detecting that the base chain has returned to normal, the block transaction information of the business chain stored in the cross-chain gateway is synchronized to the base chain.

[0112] Optionally, the blockchain to be registered is a blockchain isomorphic to the registered blockchain in the cross-chain gateway;

[0113] Alternatively, the blockchain to be registered is a blockchain that is heterogeneous with the blockchain registered in the cross-chain gateway.

[0114] This embodiment introduces an electronic device, including a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the cross-chain method for multi-chain scenarios as described in any embodiment of the present invention are implemented.

[0115] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0116] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: 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), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0117] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0118] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, 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 via 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., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.

[0119] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.

[0120] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0121] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0122] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, and a part of the module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes 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 box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.

[0123] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.

Claims

1. A cross-chain method for multi-chain scenarios, characterized in that: The method is applied to a cross-chain gateway, and the method includes: Adding an adapter corresponding to the blockchain to be registered in the cross-chain gateway; Get the information of the blockchain to be registered; According to the information of the blockchain to be registered, register the blockchain to be registered to the cross-chain gateway through an adapter corresponding to the blockchain to be registered; Generate an account ID and a public-private key pair corresponding to the blockchain registered to the cross-chain gateway; Cross-chain access is performed based on the account ID and public-private key pair of the blockchain.

2. The method according to claim 1, characterized in that The step of registering the blockchain to be registered to the cross-chain gateway through an adapter corresponding to the blockchain to be registered according to the information of the blockchain to be registered includes: Registering the blockchain to be registered as a base chain or a business chain according to the information of the blockchain to be registered; Among them, the base chain is used to realize the management of each business chain and inter-chain collaboration, and the business chain is used for blockchain evidence storage, verification and smart contract functions of specific businesses. Different business chains correspond to different business functions.

3. The method according to claim 2, characterized in that The method further comprises: After the business chain generates a block, the cross-chain gateway reads the block header and Merkle tree of the business chain; The cross-chain gateway sends the block header and Merkle tree of the business chain to the base chain in the form of a transaction request, so that the base chain verifies the operation of the business chain.

4. The method according to claim 1, characterized in that: After generating an account ID and a public-private key pair corresponding to the blockchain registered to the cross-chain gateway, the method further includes: Get the account ID of the registered target blockchain; Binding the blockchain to the target blockchain according to the account ID of the registered target blockchain and the account ID of the blockchain.

5. The method according to claim 1, characterized in that The method further comprises: Monitor and process events of preset types, where the preset events include transaction requests, contract execution, and block completion; Return event information to the blockchain corresponding to the event.

6. The method according to claim 2, characterized in that The method further comprises: When the business chain generates a new block, receiving a verification data packaging request initiated by the business chain; In response to the verification data packaging request, obtaining the block transaction information of the business chain, the block transaction information including the block height, block hash value, previous block hash value, timestamp, Merkle tree, and account ID of the business chain; Verify the block transaction information of the business chain; If the verification is successful, the block transaction information is stored in the base chain.

7. The method according to claim 6, characterized in that The storing the block transaction information to the base chain when the verification is passed includes: When an abnormality is detected in the base chain, the block transaction information of the service chain is stored in the cross-chain gateway; After detecting that the base chain has returned to normal, the block transaction information of the business chain stored in the cross-chain gateway is synchronized to the base chain.

8. The method according to claim 1, characterized in that The blockchain to be registered is a blockchain that is isomorphic to the blockchain registered in the cross-chain gateway; Alternatively, the blockchain to be registered is a blockchain that is heterogeneous with the blockchain registered in the cross-chain gateway.

9. A cross-chain gateway, characterized in that: Includes adapters and cross-chain buses; The cross-chain bus is used to add an adapter corresponding to the blockchain to be registered in the cross-chain gateway; The adapter is used to obtain information of the blockchain to be registered, and register the blockchain to be registered to the cross-chain gateway according to the information of the blockchain to be registered; The cross-chain bus is also used to generate an account ID and a public-private key pair corresponding to the blockchain registered to the cross-chain gateway, and perform cross-chain access based on the account ID and the public-private key pair of the blockchain.

10. An electronic device, characterized in that: It includes a processor and a memory, the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the cross-chain method for multi-chain scenarios as described in any one of claims 1 to 8 are implemented.