CN112636987B - Cross-chain gateway determination method and system for block chain and terminal equipment - Google Patents

Cross-chain gateway determination method and system for block chain and terminal equipment Download PDF

Info

Publication number
CN112636987B
CN112636987B CN202011594844.5A CN202011594844A CN112636987B CN 112636987 B CN112636987 B CN 112636987B CN 202011594844 A CN202011594844 A CN 202011594844A CN 112636987 B CN112636987 B CN 112636987B
Authority
CN
China
Prior art keywords
chain
cross
node
gateway
link
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011594844.5A
Other languages
Chinese (zh)
Other versions
CN112636987A (en
Inventor
李伟
邱炜伟
蔡亮
汪小益
夏立伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN202011594844.5A priority Critical patent/CN112636987B/en
Publication of CN112636987A publication Critical patent/CN112636987A/en
Application granted granted Critical
Publication of CN112636987B publication Critical patent/CN112636987B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/0836Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability to enhance reliability, e.g. reduce downtime

Abstract

The application is applicable to the technical field of block chains, and provides a method, a system and a terminal device for determining a cross-chain gateway of a block chain, wherein the method comprises the following steps: when a request instruction which is sent by a target node and applies for becoming a cross-link gateway of an application chain is received, whether main node information of the cross-link gateway of the application chain is determined in a relay chain is inquired; when the master node information of the cross-link gateway of the application chain is determined by the relay chain is not inquired, the target node is used as the master node of the cross-link gateway, and a first message is sent to the target node; the main node of the cross-link gateway is used for performing the function of the cross-link gateway; when the master node information of the cross-link gateway of the application chain is determined by the relay chain is inquired, the target node is used as a slave node of the cross-link gateway, and a second message is sent to the target node; and the slave node of the cross-link gateway is an alternative node of the master node of the cross-link gateway. The method and the device for determining the cross-link gateway have the advantage that the reliability of the determined cross-link gateway is high.

Description

Block chain cross-chain gateway determination method, system and terminal equipment
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method, a system, and a terminal device for determining a cross-chain gateway of a blockchain.
Background
The blockchain technology has characteristics of decentralization, tamper resistance, data sharing and the like, and is widely concerned by successful application of blockchain systems such as bitcoin and etherimic in recent years.
The block chains in different application scenarios are more and more, and because the block chains are independent from each other, how to perform data communication and value transfer between different block chains becomes a problem to be solved, currently, interconnection and intercommunication between different block chains are generally realized by using a cross-chain technology of the block chains, in a cross-chain scenario performed through a relay chain, transaction monitoring and encapsulation and forwarding of transactions need to be performed on the block chain to be subjected to cross-chain transaction through a cross-chain gateway, and the reliability of the current cross-chain gateway is low.
Disclosure of Invention
The embodiment of the application provides a method, a system and a terminal device for determining a cross-link gateway of a block link, and aims to solve the problem of low reliability of the conventional cross-link gateway.
In a first aspect, an embodiment of the present application provides a method for determining a inter-link gateway of a block chain, which is applied to any node of a relay chain, where the relay chain is used to establish inter-link communication connection between multiple application chains, and each application chain has a target node with an inter-link gateway function;
the cross-chain gateway determination method comprises the following steps:
when a request instruction which is sent by the target node and applies for becoming a cross-link gateway of an application chain is received, inquiring whether the master node information of the cross-link gateway of the application chain is determined in the relay chain;
when the relay chain does not inquire the main node information of the cross-link gateway of the application chain, taking the target node as the main node of the cross-link gateway, and sending a first message to the target node; wherein the master node of the cross-link gateway is configured to perform the function of the cross-link gateway;
when the relay chain is inquired to determine the master node information of the cross-link gateway of the application chain, the target node is used as a slave node of the cross-link gateway, and a second message is sent to the target node; wherein the slave node of the cross-link gateway is a candidate node of the master node of the cross-link gateway.
In one embodiment, querying whether master node information of a cross-link gateway of the application chain has been determined in the relay chain comprises:
inquiring a local cross-link gateway connection table;
when the main node information of the cross-link gateway of the application chain is not inquired in the local cross-link gateway connection table, broadcasting inquiry information in the relay chain, not receiving the main node information of the cross-link gateway of the determined application chain returned by any node in the relay chain within preset time, and judging that the main node information of the cross-link gateway of the determined application chain of the relay chain is not inquired; wherein the query information is used to query whether a node in the relay chain has determined a master node of a cross-link gateway of the application chain;
when the main node information of the cross-link gateway of the application chain is inquired in the local cross-link gateway connection table, or the main node of the cross-link gateway of the application chain is determined and returned by any node in the relay chain is received, the main node information of the cross-link gateway of the application chain is determined and inquired by the relay chain.
In one embodiment, after the target node is taken as a slave node of the cross-chain gateway, the method comprises the following steps:
and when receiving the heartbeat information sent by the target node, sending the working state of the main node of the cross-link gateway of the application chain to the target node, so that the target node inquires the working state of the main node of the cross-link gateway of the application chain by sending the heartbeat information to the relay chain at a preset time interval.
In one embodiment, after the target node is taken as a slave node of the cross-chain gateway, the method further includes: when the working state of the main node of the cross-link gateway of the application chain is detected to be a fault, the target node is changed into the main node of the cross-link gateway, and a third message for changing the target node into the main node is sent to the target node.
In one embodiment, after the target node is taken as a slave node of a cross-chain gateway, the method comprises the following steps:
and sending the block header of the relay chain and the cross-chain transaction packet encapsulated by the relay chain to the target node so that the target node can be quickly changed into a main node of a cross-chain gateway.
In a second aspect, an embodiment of the present application provides a method for determining a cross-link gateway of a block chain, where the method is applied to a target node having a cross-link gateway function in an application chain, and the method for determining a cross-link gateway includes:
sending a request instruction for applying to become a cross-link gateway of the application chain to a relay chain so that the relay chain queries whether main node information of the cross-link gateway of the application chain is determined according to the request instruction;
when receiving a first message sent by the relay chain, taking the target node as a main node of a cross-link gateway of the application chain; when the relay chain does not inquire the main node information of the cross-link gateway of the determined application chain, the first message is sent to the target node by taking the target node as the main node of the cross-link gateway;
when receiving a second message sent by the relay chain, taking the target node as a slave node of a cross-chain gateway; and when the relay chain inquires the master node information of the cross-link gateway of the determined application chain, the second message is a second message which takes the target node as a slave node of the cross-link gateway and is sent to the target node, and the slave node of the cross-link gateway is a candidate node of the master node of the cross-link gateway.
In one embodiment, after the target node is taken as a slave node of the cross-chain gateway, the method comprises the following steps:
sending heartbeat information to the relay link at a preset time interval, and inquiring the working state of a main node of a cross-link gateway of the application link;
when a third message that the relay chain is sent and changed into a main node is received, the target node is changed into the main node of the cross-link gateway of the application chain; and when the relay chain detects that the working state of the main node of the cross-link gateway of the application chain is a fault, the third message is to take the target node as the main node of the cross-link gateway and send the third message changed into the main node to the target node.
In one embodiment, after the target node is taken as a master node of a cross-link gateway of the application link, the method further includes:
when the current time is detected to be the time of recovery after the fault, sending an instruction for inquiring whether the main node of the cross-link gateway of the application chain is determined again to the relay chain;
and when receiving the master node information returned by the relay chain and re-determining the cross-link gateway of the application chain, changing the target node into the slave node of the cross-link gateway of the application chain.
In a third aspect, an embodiment of the present application provides a system for determining a block chain cross-link gateway, where the system for determining a block chain cross-link gateway includes multiple application chains and a relay chain, where the relay chain is used to establish a cross-link communication connection between the multiple application chains, and each application chain has at least two target nodes with a cross-link gateway function;
any node of the relay chain is configured to execute the inter-chain gateway determination method according to the first aspect;
any target node on the application chain is configured to execute the cross-chain gateway determination method according to the second aspect.
In a fourth aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method for determining a cross-chain gateway of a blockchain according to the first aspect when executing the computer program; or the processor implements the steps of the inter-chain gateway determination method for a blockchain of the second aspect when executing the computer program.
In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for determining a cross-chain gateway of a blockchain according to the first aspect is implemented; or the computer program may be executed by a processor to implement the steps of the inter-chain gateway determination method for a blockchain of the second aspect.
In a sixth aspect, an embodiment of the present application provides a computer program product, which when run on an electronic device, causes the electronic device to perform the steps of the method for determining a cross-chain gateway of a blockchain according to the first aspect described above; or causing the electronic device to perform the steps of the cross-chain gateway determination method of the block chain of the second aspect.
Compared with the prior art, the first aspect of the embodiment of the application has the following beneficial effects: when receiving a cross-link gateway request instruction which is sent by a target node and applies for becoming an application chain, inquiring whether cross-link gateway master node information of the application chain is determined or not in a relay chain, and when the master node information of the cross-link gateway of the application chain is determined by the relay chain is not inquired, taking the target node as a master node of the cross-link gateway, so that the master node of the cross-link gateway of the application chain cannot be determined repeatedly; when the relay chain is inquired to determine the main node information of the cross-link gateway of the application chain, the target node is used as the slave node of the cross-link gateway, and the slave node of the cross-link gateway is an alternative node of the main node of the cross-link gateway, so that the slave node of the cross-link gateway can be automatically upgraded into the main node when the main node of the cross-link gateway fails, and the reliability of the determined cross-link gateway is high.
Compared with the prior art, the second aspect of the embodiment of the application has the following beneficial effects: a target node on an application chain sends a request instruction for applying to become a cross-link gateway of the application chain to a relay chain, so that the relay chain queries whether main node information of the cross-link gateway of the application chain is determined or not according to the request instruction, and when the target node receives a first message sent by the relay chain, the target node is used as a main node of the cross-link gateway of the application chain, and the main node of the cross-link gateway of the application chain cannot be repeatedly determined; the first message is sent to the target node by taking the target node as a main node of the cross-link gateway when the relay link does not inquire the main node information of the cross-link gateway of the determined application link; when the target node receives the second message sent by the relay link, the target node is used as a slave node of the cross-link gateway; the second message is sent to the target node by taking the target node as a slave node of the cross-link gateway when the relay link queries the master node information of the cross-link gateway of the determined application link.
It is to be understood that, for the beneficial effects of the third aspect to the sixth aspect, reference may be made to the description of the first aspect or the second aspect, and details are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is an architecture diagram of a inter-chain gateway determination system of a blockchain according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for determining a inter-chain gateway of a block chain according to an embodiment of the present application;
fig. 3 is another schematic flowchart of a method for determining a inter-chain gateway of a block chain according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a method for determining a inter-chain gateway of a block chain according to an embodiment of the present application;
fig. 5 is a schematic flow chart of a method for determining a inter-chain gateway of a blockchain according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a method for determining a inter-chain gateway of a block chain according to a second embodiment of the present application;
fig. 7 is another schematic flowchart of a method for determining a inter-chain gateway of a block chain according to the second embodiment of the present application;
fig. 8 is a schematic flowchart of a method for determining a inter-chain gateway of a block chain according to a third embodiment of the present application;
fig. 9 is another schematic flowchart of a method for determining a inter-chain gateway of a block chain according to a third embodiment of the present application;
fig. 10 is a schematic flowchart of a method for determining a inter-chain gateway of a block chain according to a third embodiment of the present application;
fig. 11 is a schematic flowchart of a cross-chain gateway determination apparatus for a block chain according to a fourth embodiment of the present application;
fig. 12 is a schematic flowchart of a cross-chain gateway determining apparatus of a block chain according to a fifth embodiment of the present application;
fig. 13 is a schematic structural diagram of a terminal device according to a sixth embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically stated.
Example one
As shown in fig. 1, the system for determining a cross-chain gateway of a block chain according to this embodiment includes a plurality of application chains 10 and a relay chain 20, where the plurality of application chains 10 are at least two application chains 10, the application chain 10 is a block chain having a specific application scenario, and the relay chain is used to establish a cross-chain communication connection between the plurality of application chains, and specifically, the cross-chain communication connection may be established between the plurality of application chains 10 through the cross-chain gateway in the application chain and the relay chain 20.
In one embodiment, at least two nodes with a cross-link gateway function, called target nodes, are set in each application chain 10 in advance, and the target nodes with the cross-link gateway function implement data interaction such as data communication and/or value transfer between multiple application chains with a relay chain, where the target nodes with the cross-link gateway function in the application chain may be nodes registered in the relay chain in advance so as to interact with the relay chain.
In an embodiment, the present embodiment further provides a method for determining a inter-chain gateway of a block chain, which is applied to the inter-chain gateway determination system in the present embodiment, and as shown in fig. 2, the method for determining an inter-chain gateway includes:
step S101, the target node sends a request instruction for applying to become a cross-link gateway of the application chain to the relay chain.
Specifically, a node having a cross-link gateway function in an application chain is called a target node, and at least two target nodes in the application chain send a request instruction for becoming a cross-link gateway of the application chain to respective connection nodes of a relay chain. The target node sends a request instruction of the cross-link gateway becoming the application chain to the relay chain, so as to compete to become the cross-link gateway of the application chain.
Step S102, when the relay link receives a request instruction which is sent by a target node and applies for becoming a cross-link gateway of an application chain, whether the master node information of the cross-link gateway of the application chain is determined in the relay link or not is inquired.
Specifically, when receiving a request instruction sent by a target node and applying for becoming a cross-link gateway of an application chain, any node in the relay chain queries whether the master node information of the cross-link gateway of the application chain is determined or not in the relay chain.
In one embodiment, as shown in fig. 3, querying whether the master node information of the cross-link gateway of the application chain is determined in the relay chain includes steps S1021 to S1023:
step S1021, inquiring the local cross-link gateway connection table.
Specifically, a node receiving the request instruction firstly queries a connection table of a local cross-link gateway of the node, where the connection table of the local cross-link gateway is associated information that is correspondingly stored when the node confirms the cross-link gateway of the application chain, and if the cross-link gateway of the application chain a is determined to be the node a, an identifier of the identifier associated with the node a of the application chain a is stored in the connection table of the local cross-link gateway.
Step S1022, when the master node information of the inter-link gateway of the application chain is not queried in the local inter-link gateway connection table, broadcasting query information in the relay chain, and determining that the master node information of the inter-link gateway of the application chain is not queried, where the master node information of the inter-link gateway of the application chain is determined and is returned by any node in the relay chain and is not received within a preset time.
Specifically, the query information is used to query whether a node in the relay chain has determined a master node of a cross-link gateway of the application chain. Because two different nodes in the relay chain may be connected to two target nodes, it cannot be easily determined whether the master node of the cross-link gateway of the application chain is determined as a single node between the different nodes, and if the master node is determined by a contract or transaction of the relay chain, the performance of the relay chain for processing the cross-link transaction may be affected and the burden of an account book may be increased. Therefore, when the master node information of the inter-link gateway of the application chain is not queried in the local inter-link gateway connection table, the query information is broadcasted in the relay chain, the master node can be confirmed by a method that the broadcast query is independent of a relay chain consensus ledger, specifically, the query information can be broadcasted through a P2P network, the broadcast query information is used for querying whether other nodes except the local node in the relay chain have the master node information of the inter-link gateway which is used for storing and determining the application chain, and the node information determined by the inter-link gateway in each node can be easily synchronized and sensed among the nodes in the relay chain in a broadcast mode. After the query information is broadcasted in the relay chain, the master node information of the cross-link gateway of the application chain determined by the relay chain is not received within the preset time, and the master node information of the cross-link gateway of the application chain determined by the relay chain is not queried.
Step S1023, when the master node information of the inter-link gateway of the application chain is queried in the local inter-link gateway connection table, or the master node of the inter-link gateway of the application chain is determined and returned by any node in the relay chain, it is determined that the master node information of the inter-link gateway of the application chain is determined and queried.
Specifically, the master node information of the cross-link gateway of the application chain is queried in the local cross-link gateway connection table, or when the master node information of the cross-link gateway of the determined application chain returned by any node in the relay chain is received, it is indicated that other target nodes have successfully become the master node of the cross-link gateway, and at this time, it is determined that the master node information of the cross-link gateway of the determined application chain of the relay chain is queried. And meanwhile, updating a local cross-link gateway connection table according to the inquired main node information of the cross-link gateway of the application chain.
Step S103, when the relay chain does not inquire the master node information of the cross-link gateway of the application chain determined by the relay chain, the relay chain takes the target node as the master node of the cross-link gateway and sends a first message to the target node; wherein the master node of the cross-link gateway is configured to perform the cross-link gateway function.
Specifically, when the master node information of the cross-link gateway of the application chain is determined by the relay chain without being queried in the relay chain, it indicates that no other target node successfully becomes the master node of the cross-link gateway, and at this time, the current target node is used as the master node of the cross-link gateway of the application chain, and sends a first message to the target node to prompt that the target node can be used as the master node of the cross-link gateway of the application chain, and meanwhile, a local cross-link gateway connection table is updated according to the master node of the cross-link gateway currently used as the application chain.
Specifically, the master node of the cross-link gateway is to use the node as a cross-link gateway for an application chain. When the master node of the cross-link gateway of the application chain is established, the master node always performs heartbeat maintenance with the relay chain, namely the master node sends the working state of the node to the relay chain every preset time, so that the relay chain can know the health state of the master node, and meanwhile if the slave node of the cross-link gateway of the application chain exists, the slave node can continuously inquire the working state of the relay chain relative to the master node so as to take over the master node at any time.
And step S104, when the target node receives the first message sent by the relay chain, the target node is used as a main node of a cross-link gateway of the application chain.
Specifically, the first message is a first message that the relay chain takes the target node as a master node of a cross-link gateway and sends the target node to the target node when the relay chain does not inquire the master node information of the cross-link gateway of the determined application chain. And when the target node receives the first message sent by the relay chain, the target node uses the cross-chain gateway function of the application chain.
Step S105, when the relay chain queries the master node information of the inter-link gateway of the application chain, the relay chain takes the target node as a slave node of the inter-link gateway, and sends a second message to the target node.
Specifically, when the master node information of the cross-link gateway of the application chain is determined by the relay chain, the master node that other target nodes have successfully become the master node of the cross-link gateway is queried, the target node is used as a slave node of the cross-link gateway, and a second message is sent to the target node to inform that the current target node is used as the slave node of the cross-link gateway of the application chain. And the slave node of the cross-link gateway is an alternative node of the master node of the cross-link gateway.
And step S106, when the target node receives the second message sent by the relay chain, the target node is used as a slave node of the cross-link gateway.
Specifically, when a target node receives a second message sent by a relay chain, the target node may understand that the target node serves as a slave node of a cross-chain gateway to turn on a current target node as a slave node function of the cross-chain gateway, where the second message is a second message sent to the target node when the relay chain queries master node information of the cross-chain gateway of the application chain, the target node serves as a slave node of the cross-chain gateway, and the slave node of the cross-chain gateway is a candidate node of the master node of the cross-chain gateway.
In one embodiment, after the target node is taken as a slave node of the cross-chain gateway, the method comprises the following steps: and sending the block header of the relay chain and the cross-chain transaction packet encapsulated by the relay chain to the target node so that the target node can be quickly changed into a main node of a cross-chain gateway.
Specifically, for some block chains which throw events or use event queues to generate cross-chain transactions, the master node of the cross-chain gateway may directly consume messages in the queues, so that the slave node cannot sense the transactions, and therefore the slave node acquires the block head of the relay chain and the cross-chain transaction packet encapsulated from the relay chain, and thus when the master node is down and restarted, the slave node is upgraded to the master node. In addition to the slave nodes themselves needing to open the cross-chain gateway function of the master node to process cross-chain transactions, the most critical is the need to recover some cross-chain transactions that have not been processed before the master node failed. Therefore, after the master node is upgraded by the slave node, the slave node acquires a block header of the relay chain and a cross-link transaction packet encapsulated by the slave relay chain, compares the block header with an account book of the relay chain, checks which cross-link transactions are lost and not executed due to the fault of the original master node, performs rollback operation according to the cross-link transaction packet, re-executes the cross-link transactions lost or not executed in the account book once, and can solve the problem of inconsistent account books possibly caused by switching of the master node and the slave node.
Specifically, after the target node uses itself as a slave node of the cross-link gateway, the block header of the relay link and the encapsulated cross-link transaction packet are continuously acquired from the relay link.
In one embodiment, as shown in fig. 4, after the target node is taken as a slave node of the cross-link gateway, steps S201 to S204 are included:
step S201, the target node sends heartbeat information to the relay link at a preset time interval, and queries the working state of the master node of the cross-link gateway of the application link.
Specifically, after the target node is used as a slave node of the cross-link gateway, the target node sends heartbeat information to the relay link at a preset time interval, wherein the heartbeat information is used for informing that the relay link slave node is ready to take over the work of the master node at any time and hopes to acquire the work state of the master node.
Step S202, when the relay chain receives the heartbeat information sent by the target node, the working state of the main node of the cross-link gateway of the application chain is sent to the target node.
Specifically, when any node in the relay receives heartbeat information sent by a target node, the working state of a main node of a cross-link gateway corresponding to an application chain is inquired from the relay chain, and the inquired working state of the main node of the gateway of the application chain is sent to the target node, so that the target node sends the heartbeat information to the relay chain at a preset time interval, and the working state of the main node of the cross-link gateway of the application chain is inquired.
Step S203, when the relay chain detects that the working state of the main node of the cross-link gateway of the application chain is failure, the target node is changed into the main node of the cross-link gateway, and a third message for changing the target node into the main node is sent to the target node.
Specifically, the current target node is a slave node, and the current target node and the relay chain keep heartbeat to maintain the working state of the master node of the cross-link gateway of the application chain. The main node of the cross-link gateway can always perform heartbeat maintenance with the relay link to inform the working state of the relay link. And the relay chain does not receive heartbeat information of the main node of the cross-chain gateway after the preset time, detects that the working state of the main node of the cross-chain gateway of the application chain is a fault, changes the target node which is currently used as the slave node into the main node of the cross-chain gateway at the moment, and sends a third message which is changed into the main node to the target node so that the target node starts the function of the cross-chain gateway.
And step S204, when the target node receives the third message of changing the relay chain into the master node, changing the target node into the master node of the cross-link gateway of the application chain.
Specifically, when the target node receives the third message of changing the relay link into the master node, the target node is changed from the slave node of the cross-link gateway to the master node of the cross-link gateway, namely, the function of the target node is changed from the function of the slave node to the function of the cross-link gateway. The third message is that when the relay chain detects that the working state of the main node of the cross-link gateway of the application chain is a fault (if the fault can be that the working state of the main node is not wrong or down), the target node is used as the main node of the cross-link gateway, and the third message for changing the target node into the main node is sent to the target node.
In one embodiment, as shown in fig. 5, after the target node is taken as the master node of the cross-link gateway, steps S301 to S302 are included:
step S301, when detecting that the current time is the time of recovery after failure, sending an instruction to the relay chain to query whether the master node of the cross-link gateway of the application chain has been determined again.
Specifically, when the target node is used as the master node of the inter-link gateway, the target node fails, and when the current time of failure recovery is used as the time of recovery after failure, the relay link may update the master node of the inter-link gateway, so that at this time, an instruction is sent to the relay link to inquire whether the master node of the inter-link gateway of the application link is determined again.
Step S302, when receiving the master node information returned by the relay chain and re-determining the inter-link gateway of the application chain, changing the target node to a slave node of the inter-link gateway of the application chain.
Specifically, when the relay chain has determined that another target node is the master node of the cross-link gateway of the application chain, the relay chain sends the master node information of the cross-link gateway of the application chain that has been re-determined to the target node. When the target node receives the information, the target node changes the target node into a slave node of the cross-chain gateway of the application chain for use.
In the embodiment of the application, when a relay chain receives a cross-chain gateway request instruction which is sent by a target node and applies for becoming an application chain, whether cross-chain gateway master node information of the application chain is determined or not is inquired in the relay chain, and when the relay chain determines the master node information of the cross-chain gateway of the application chain, the target node is used as the master node of the cross-chain gateway, and the master node of the cross-chain gateway of the application chain cannot be repeatedly determined; when the relay chain is inquired to determine the main node information of the cross-link gateway of the application chain, the target node is used as the slave node of the cross-link gateway, and the slave node of the cross-link gateway is an alternative node of the main node of the cross-link gateway, so that the slave node of the cross-link gateway can be automatically upgraded into the main node when the main node of the cross-link gateway fails, and the reliability of the determined cross-link gateway is high.
Example two
This embodiment provides a method for determining a block chain inter-link gateway, which is applied to any node of a relay chain, where the relay chain is used to establish inter-link communication connection between multiple application chains, and each application chain has a target node with an inter-link gateway function, as shown in fig. 6, the method for determining the inter-link gateway includes:
step S401, when receiving a request instruction sent by the target node and applying for becoming a cross-link gateway of an application chain, querying whether master node information of the cross-link gateway of the application chain is determined in the relay chain.
In an embodiment, as shown in fig. 7, the querying whether the master node information of the cross-link gateway of the application chain is determined in the relay chain includes steps S4011 to S4013:
step S4011, inquiring a local cross-link gateway connection table;
step S4012, when the master node information of the inter-link gateway of the application chain is not queried in the local inter-link gateway connection table, broadcasting query information in the relay chain, not receiving the master node information of the inter-link gateway of the determined application chain returned by any node in the relay chain within a preset time, and judging that the master node information of the inter-link gateway of the determined application chain of the relay chain is not queried;
wherein the query information is used to query whether a node in the relay chain has determined a master node of a cross-link gateway of the application chain.
Step S4013, when the master node information of the inter-link gateway of the application chain is queried in the local inter-link gateway connection table, or the master node of the inter-link gateway of the application chain that is determined is received from any node in the relay chain, it is determined that the master node information of the inter-link gateway of the application chain that is determined by the relay chain is queried.
Step S402, when the relay chain does not inquire the master node information of the cross-link gateway of the application chain, the target node is used as the master node of the cross-link gateway, and a first message is sent to the target node; wherein the master node of the cross-link gateway is configured to perform the cross-link gateway function.
Step S403, when the relay chain has determined the master node information of the inter-link gateway of the application chain, using the target node as a slave node of the inter-link gateway, and sending a second message to the target node; and the slave node of the cross-link gateway is an alternative node of the master node of the cross-link gateway.
In one embodiment, after the target node is taken as a slave node of the cross-chain gateway, the method comprises the following steps: and when receiving the heartbeat information sent by the target node, sending the working state of the main node of the cross-link gateway of the application chain to the target node, so that the target node inquires the working state of the main node of the cross-link gateway of the application chain by sending the heartbeat information to the relay chain at a preset time interval.
In one embodiment, after the target node is taken as a slave node of a cross-chain gateway, the method further comprises: when the working state of the main node of the cross-link gateway of the application chain is detected to be a fault, the target node is changed into the main node of the cross-link gateway, and a third message for changing the target node into the main node is sent to the target node.
In one embodiment, after the target node is taken as a slave node of the cross-chain gateway, the method comprises the following steps: and sending the block header of the relay chain and the cross-chain transaction packet encapsulated by the relay chain to the target node so that the target node can be quickly changed into a main node of a cross-chain gateway.
Specifically, the same, corresponding or similar points in the second embodiment as those in the first embodiment may be referred to the related descriptions in the first embodiment, and are not repeated herein. It should be noted that the first embodiment and the second embodiment are different embodiments in terms of implementation, and specific technical contents may be referred to each other.
When receiving a cross-link gateway request instruction which is sent by a target node and applies for becoming an application chain, inquiring whether cross-link gateway master node information of the application chain is determined or not in a relay chain, and when the master node information of the cross-link gateway of the application chain is determined by the relay chain is not inquired, taking the target node as a master node of the cross-link gateway, so that the master node of the cross-link gateway of the application chain cannot be determined repeatedly; when the relay chain is inquired to determine the main node information of the cross-link gateway of the application chain, the target node is used as the slave node of the cross-link gateway, and the slave node of the cross-link gateway is an alternative node of the main node of the cross-link gateway, so that the slave node of the cross-link gateway can be automatically upgraded into the main node when the main node of the cross-link gateway fails, and the reliability of the determined cross-link gateway is high.
EXAMPLE III
The present embodiment provides a method for determining a cross-chain gateway of a blockchain, as shown in fig. 8, which is applied to a target node having a cross-chain gateway function in an application chain, where the method for determining a cross-chain gateway includes:
step S501, a request instruction for applying to become a cross-link gateway of the application chain is sent to the relay chain, so that the relay chain queries whether the master node information of the cross-link gateway of the application chain is determined according to the request instruction.
Step S502, when receiving the first message sent by the relay chain, taking the target node as the main node of the cross-link gateway of the application chain;
the first message is a first message which is sent to the target node by taking the target node as a master node of a cross-link gateway when the relay link does not inquire the master node information of the cross-link gateway of the determined application link.
Step S503, when receiving the second message sent by the relay link, taking the target node as a slave node of the inter-link gateway;
and when the relay chain inquires the master node information of the cross-link gateway of the determined application chain, the second message is a second message which takes the target node as a slave node of the cross-link gateway and is sent to the target node, and the slave node of the cross-link gateway is a candidate node of the master node of the cross-link gateway.
In one embodiment, as shown in fig. 9, after the target node is taken as a slave node of the cross-link gateway, the method includes:
step S601, sending heartbeat information to the relay link at a preset time interval, and inquiring the working state of a main node of a cross-link gateway of the application link;
step S602, when a third message of changing the relay link into a master node is received, changing the target node into the master node of the cross-link gateway of the application link; and when the relay chain detects that the working state of the main node of the cross-link gateway of the application chain is a fault, the third message is to take the target node as the main node of the cross-link gateway and send the third message changed into the main node to the target node.
In one embodiment, as shown in fig. 10, after the target node is taken as a master node of a cross-link gateway of the application chain, the method further includes:
step S701, when detecting that the current time is the time of recovery after failure, sending an instruction for inquiring whether a main node of a cross-link gateway of the application chain is determined again to the relay chain;
step S702, when receiving the master node information returned by the relay chain and re-determining the inter-link gateway of the application chain, change the target node to a slave node of the inter-link gateway of the application chain.
Specifically, the same, corresponding or similar points in the third embodiment as those in the first and second embodiments may be referred to in the description of the first and second embodiments, and are not repeated herein. It should be noted that the first embodiment, the second embodiment and the third embodiment are different embodiments in which the main body is executed, and specific technical contents may be referred to each other.
In the embodiment of the application, a target node on an application chain sends a request instruction for applying to become a cross-chain gateway of the application chain to a relay chain, so that the relay chain queries whether to determine the master node information of the cross-chain gateway of the application chain according to the request instruction, and when receiving a first message sent by the relay chain, the target node is used as a master node of the cross-chain gateway of the application chain, and the master node of the cross-chain gateway of the application chain cannot be repeatedly determined; the first message is sent to the target node by taking the target node as a main node of the cross-link gateway when the relay link does not inquire the main node information of the cross-link gateway of the determined application link; when the target node receives the second message sent by the relay link, the target node is used as a slave node of the cross-link gateway; the second message is sent to the target node by taking the target node as a slave node of the cross-link gateway when the relay link queries the master node information of the cross-link gateway of the determined application link.
Example four
The embodiment of the present application further provides a chain cross-chain gateway determining apparatus, which is applied to any node of a relay chain, where the relay chain is used to establish a cross-chain communication connection between multiple application chains, and each application chain has a target node with a cross-chain gateway function; the inter-chain gateway determination device in this embodiment is used to execute the steps in the second inter-chain gateway determination method in the embodiment. As shown in fig. 11, a cross-chain gateway determining apparatus 800 provided in an embodiment of the present application includes:
an inquiring module 801, configured to, when receiving a request instruction, which is sent by the target node, for applying for becoming a cross-link gateway of an application chain, inquire whether master node information of the cross-link gateway of the application chain is determined in the relay chain;
a first sending module 802, configured to, when the relay chain does not query the master node information of the cross-link gateway of the application chain, use the target node as the master node of the cross-link gateway, and send a first message to the target node; wherein the master node of the cross-link gateway is configured to perform the function of the cross-link gateway;
a second sending module 803, configured to, when the relay chain has determined the master node information of the inter-link gateway of the application chain, regard the target node as a slave node of the inter-link gateway, and send a second message to the target node; wherein the slave node of the cross-link gateway is a candidate node of the master node of the cross-link gateway.
When receiving a cross-link gateway request instruction which is sent by a target node and applies for becoming an application chain, inquiring whether cross-link gateway master node information of the application chain is determined or not in a relay chain, and when the master node information of the cross-link gateway of the application chain is determined by the relay chain is not inquired, taking the target node as a master node of the cross-link gateway, so that the master node of the cross-link gateway of the application chain cannot be determined repeatedly; when the relay chain is inquired to determine the main node information of the cross-link gateway of the application chain, the target node is used as the slave node of the cross-link gateway, and the slave node of the cross-link gateway is an alternative node of the main node of the cross-link gateway, so that the slave node of the cross-link gateway can be automatically upgraded into the main node when the main node of the cross-link gateway fails, and the reliability of the determined cross-link gateway is high.
EXAMPLE five
The present embodiment further provides a chain-crossing gateway determining apparatus, which is applied to a target node having a chain-crossing gateway function in an application chain, and the chain-crossing gateway determining apparatus in the present embodiment is configured to execute the steps in the embodiment of the triple chain-crossing gateway determining method. As shown in fig. 12, the cross-chain gateway determining apparatus 900 provided in the embodiment of the present application includes:
an applying module 901, configured to send a request instruction for applying for becoming a cross-link gateway of the application chain to a relay chain, so that the relay chain queries, according to the request instruction, whether master node information of the cross-link gateway of the application chain has been determined;
a first receiving module 902, configured to, when receiving the first message sent by the relay chain, use the target node as a master node of a cross-link gateway of the application chain; when the relay chain does not inquire the main node information of the cross-link gateway of the determined application chain, the first message is sent to the target node by taking the target node as the main node of the cross-link gateway;
a second receiving module 903, configured to, when receiving the second message sent by the relay link, use the target node as a slave node of a cross-link gateway; and when the relay chain inquires the master node information of the cross-link gateway of the determined application chain, the second message is a second message which takes the target node as a slave node of the cross-link gateway and is sent to the target node, and the slave node of the cross-link gateway is a candidate node of the master node of the cross-link gateway.
In the embodiment of the application, a target node on an application chain sends a request instruction for applying to become a cross-chain gateway of the application chain to a relay chain, so that the relay chain queries whether to determine the master node information of the cross-chain gateway of the application chain according to the request instruction, and when receiving a first message sent by the relay chain, the target node is used as a master node of the cross-chain gateway of the application chain, and the master node of the cross-chain gateway of the application chain cannot be repeatedly determined; the first message is sent to the target node by taking the target node as a main node of the cross-link gateway when the relay link does not inquire the main node information of the cross-link gateway of the determined application link; when the target node receives the second message sent by the relay link, the target node is used as a slave node of the cross-link gateway; the second message is sent to the target node, and the slave node of the cross-link gateway is a standby node of the master node of the cross-link gateway, so that the slave node of the cross-link gateway can be automatically upgraded into the master node when the master node of the cross-link gateway fails, and the reliability of the determined cross-link gateway is high.
EXAMPLE six
As shown in fig. 13, an embodiment of the present application further provides a terminal device 13 including: a processor 131, a memory 132 and a computer program 133 stored in said memory 132 and executable on said processor 131. When the processor 131 executes the computer program 133, the step of the method for determining a cross-link gateway of a block chain in embodiment two is implemented, or when the processor 131 executes the computer program 133, the step of the method for determining a cross-link gateway of a block chain in embodiment three is implemented. The steps in the examples. The processor 131, when executing the computer program 133, implements the functions of the modules in the above device embodiments, such as the functions of embodiment four and/or embodiment five.
Illustratively, the computer program 133 may be divided into one or more modules that are stored in the memory 132 and executed by the processor 131 to accomplish the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 133 in the terminal device 13. For example, the computer program 133 may be divided into an inquiry module, a first sending module and a second sending module, or the computer program 133 may be divided into an application module, a first receiving module and a second receiving module, and specific functions of the modules are described in the foregoing embodiments, which are not described herein again.
The terminal device 13 may be a server, a tablet computer, a wearable device, an in-vehicle device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), a mobile phone, or other computing device. The terminal device may include, but is not limited to, a processor 131, a memory 132. Those skilled in the art will appreciate that fig. 13 is merely an example of a terminal device 13 and does not constitute a limitation of terminal device 13 and may include more or fewer components than shown, or some components may be combined, or different components, for example, the terminal device may also include input output devices, network access devices, buses, etc.
The Processor 131 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 132 may be an internal storage unit of the terminal device 13, such as a hard disk or a memory of the terminal device 13. The memory 132 may also be an external storage device of the terminal device 13, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 13. Further, the memory 132 may also include both an internal storage unit and an external storage device of the terminal device 13. The memory 132 is used for storing the computer programs and other programs and data required by the terminal device. The memory 132 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated module, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer-readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. The method is characterized in that the method is applied to any node of a relay chain, the relay chain is used for establishing cross-chain communication connection among a plurality of application chains, and each application chain is provided with a target node with a cross-chain gateway function;
the cross-chain gateway determination method comprises the following steps:
when a request instruction which is sent by the target node and applies for becoming a cross-link gateway of an application chain is received, inquiring whether the master node information of the cross-link gateway of the application chain is determined in the relay chain;
when the relay chain does not inquire the main node information of the cross-link gateway of the application chain, taking the target node as the main node of the cross-link gateway, and sending a first message to the target node; wherein the main node of the cross-link gateway is used for performing the function of the cross-link gateway;
when the relay chain is inquired to determine the master node information of the cross-link gateway of the application chain, the target node is used as a slave node of the cross-link gateway, and a second message is sent to the target node; wherein the slave node of the cross-link gateway is a candidate node of the master node of the cross-link gateway.
2. The method of claim 1, wherein querying whether master node information of a cross-link gateway of the application link is determined in the relay link comprises:
inquiring a local cross-link gateway connection table;
when the main node information of the cross-link gateway of the application chain is not inquired in the local cross-link gateway connection table, broadcasting inquiry information in the relay chain, not receiving the main node information of the cross-link gateway of the determined application chain returned by any node in the relay chain within preset time, and judging that the main node information of the cross-link gateway of the determined application chain of the relay chain is not inquired; wherein the query information is used to query whether a node in the relay chain has determined a master node of a cross-link gateway of the application chain;
when the main node information of the cross-link gateway of the application chain is inquired in the local cross-link gateway connection table, or the main node of the cross-link gateway of the application chain is determined and returned by any node in the relay chain is received, judging that the main node information of the cross-link gateway of the application chain is confirmed and inquired by the relay chain.
3. The method for determining a cross-chain gateway according to claim 1, wherein after the target node is taken as a slave node of the cross-chain gateway, the method comprises:
and when receiving the heartbeat information sent by the target node, sending the working state of the main node of the cross-link gateway of the application chain to the target node, so that the target node inquires the working state of the main node of the cross-link gateway of the application chain by sending the heartbeat information to the relay chain at a preset time interval.
4. The method for determining a cross-chain gateway according to claim 3, wherein after the target node is taken as a slave node of the cross-chain gateway, the method further comprises:
when the working state of the main node of the cross-link gateway of the application chain is detected to be a fault, the target node is changed into the main node of the cross-link gateway, and a third message for changing the target node into the main node is sent to the target node.
5. The method for determining the cross-chain gateway according to any one of claims 1 to 4, wherein after the target node is taken as a slave node of the cross-chain gateway, the method comprises:
and sending the block header of the relay chain and the cross-chain transaction packet encapsulated by the relay chain to the target node so that the target node can be quickly changed into a main node of a cross-chain gateway.
6. A method for determining a cross-chain gateway of a block chain is applied to a target node with a cross-chain gateway function in an application chain, and comprises the following steps:
sending a request instruction for applying to become a cross-link gateway of the application chain to a relay chain so that the relay chain queries whether main node information of the cross-link gateway of the application chain is determined according to the request instruction;
when receiving a first message sent by the relay chain, taking the target node as a main node of a cross-link gateway of the application chain; when the relay chain does not inquire the main node information of the cross-link gateway of the determined application chain, the first message is sent to the target node by taking the target node as the main node of the cross-link gateway;
when receiving a second message sent by the relay chain, taking the target node as a slave node of a cross-chain gateway; and when the relay chain inquires the master node information of the cross-link gateway of the determined application chain, the second message is a second message which takes the target node as a slave node of the cross-link gateway and is sent to the target node, and the slave node of the cross-link gateway is a candidate node of the master node of the cross-link gateway.
7. The method of claim 6, wherein after the target node is a slave node of the cross-link gateway, the method comprises:
sending heartbeat information to the relay link at a preset time interval, and inquiring the working state of a main node of a cross-link gateway of the application link;
when a third message of changing the relay chain into a main node is received, changing the target node into the main node of the cross-link gateway of the application chain; and when the relay chain detects that the working state of the main node of the cross-link gateway of the application chain is a fault, the third message is to take the target node as the main node of the cross-link gateway and send the third message changed into the main node to the target node.
8. The method of claim 6, wherein the determining the target node as the master node of the cross-link gateway of the application link further comprises:
when the current moment is detected to be the moment recovered after the fault, sending an instruction for inquiring whether the main node of the cross-link gateway of the application chain is determined again to the relay chain;
and when receiving the master node information returned by the relay chain and re-determining the cross-link gateway of the application chain, changing the target node into the slave node of the cross-link gateway of the application chain.
9. The system for determining the cross-link gateway of the block chain is characterized by comprising a plurality of application chains and a relay chain, wherein the relay chain is used for establishing cross-link communication connection among the application chains, and each application chain is provided with at least two target nodes with cross-link gateway functions;
any node of the relay chain is configured to perform the cross-chain gateway determination method according to any one of claims 1 to 5;
each target node on the application chain is configured to perform the cross-chain gateway determination method according to any one of claims 6 to 8.
10. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 5 when executing the computer program; or the processor executing the computer program to implement the method of any of claims 6 to 8.
CN202011594844.5A 2020-12-28 2020-12-28 Cross-chain gateway determination method and system for block chain and terminal equipment Active CN112636987B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011594844.5A CN112636987B (en) 2020-12-28 2020-12-28 Cross-chain gateway determination method and system for block chain and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011594844.5A CN112636987B (en) 2020-12-28 2020-12-28 Cross-chain gateway determination method and system for block chain and terminal equipment

Publications (2)

Publication Number Publication Date
CN112636987A CN112636987A (en) 2021-04-09
CN112636987B true CN112636987B (en) 2022-06-24

Family

ID=75286109

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011594844.5A Active CN112636987B (en) 2020-12-28 2020-12-28 Cross-chain gateway determination method and system for block chain and terminal equipment

Country Status (1)

Country Link
CN (1) CN112636987B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113328997B (en) * 2021-05-10 2023-05-12 东软集团股份有限公司 Alliance chain crossing system and method
CN113342901B (en) * 2021-08-06 2021-11-02 支付宝(杭州)信息技术有限公司 Method and device for registering block chain node to node set

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107888562A (en) * 2017-10-13 2018-04-06 布比(北京)网络技术有限公司 Interconnect serobila architecture
CN109784921A (en) * 2018-12-29 2019-05-21 广州蓝石信息技术有限公司 General across chain communication mechanism based on decentralization gateway
CN111090891A (en) * 2020-03-23 2020-05-01 卓尔智联(武汉)研究院有限公司 Notary selection method and notary selection system based on block chain
CN111431903A (en) * 2020-03-25 2020-07-17 北京创世智链信息技术研究院 Cross-link relay method, device and computer readable storage medium
CN111461889A (en) * 2020-04-20 2020-07-28 同济大学 Cross-chain transaction system, method and storage medium for alliance blockchain

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10915521B2 (en) * 2018-08-21 2021-02-09 Syniverse Technologies, Llc Blockchain gateway device and associated method of use

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107888562A (en) * 2017-10-13 2018-04-06 布比(北京)网络技术有限公司 Interconnect serobila architecture
CN109784921A (en) * 2018-12-29 2019-05-21 广州蓝石信息技术有限公司 General across chain communication mechanism based on decentralization gateway
CN111090891A (en) * 2020-03-23 2020-05-01 卓尔智联(武汉)研究院有限公司 Notary selection method and notary selection system based on block chain
CN111431903A (en) * 2020-03-25 2020-07-17 北京创世智链信息技术研究院 Cross-link relay method, device and computer readable storage medium
CN111461889A (en) * 2020-04-20 2020-07-28 同济大学 Cross-chain transaction system, method and storage medium for alliance blockchain

Also Published As

Publication number Publication date
CN112636987A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
US9753954B2 (en) Data node fencing in a distributed file system
US7518983B2 (en) Proxy response apparatus
CN112636987B (en) Cross-chain gateway determination method and system for block chain and terminal equipment
CN107153660B (en) Fault detection processing method and system for distributed database system
CN111049696B (en) Method, node and computing device for node management of blockchain system
WO2017152860A1 (en) Heartbeat information sending method and device, and heartbeat sending node
CN111046110A (en) Method, node and computing device for node management of blockchain system
CN112217658A (en) Stacking and splitting processing method and device
CN108228812B (en) Self-adaptive main node switching method and device
CN112235370A (en) Equipment information synchronization method, synchronization device, main equipment and storage medium
CN112667601A (en) Block chain identifier management method, terminal device and computer-readable storage medium
CN107547605B (en) message reading and writing method based on node queue and node equipment
CN112667270A (en) Voice processing resource updating method, computer equipment and storage device
US9491132B2 (en) System and method for providing push service for reducing network loads
CN109413118B (en) Method, device, storage medium and program product for realizing session synchronization
CN109005203B (en) Data synchronization method and device, storage medium, processor and terminal
CN114006911B (en) Data processing method and device, terminal equipment and storage medium
CN115514698A (en) Protocol calculation method, switch, cross-device link aggregation system and storage medium
US10795848B2 (en) Dual way communication method, system, and master device thereof
CN107454021B (en) Communication method and device
CN111367885A (en) Database management system, database management method, storage medium, and electronic device
CN111258739A (en) Server process updating method, device, server and medium
CN110704532A (en) Method and device for synchronizing data among databases, computer equipment and storage medium
CN113556373B (en) Proxy service method, device and system
CN112463669B (en) Storage arbitration management method, system, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant