The present invention discloses a cross-chain gateway redundant switching method and
system based on
relay chain, which belongs to the field of cross-chain
gateway technology, including: the
relay chain is connected to the application chain through a plurality of cross-chain gateways; a plurality of cross-chain gateways send a master gateway election request to the
relay chain node directly connected to themselves, and determine the master gateway and the slave gateway based on the master gateway election reply of the relay chain node; the master gateway and the slave gateway send
heartbeat information to the relay chain node directly connected to themselves, and the relay chain node replies to the
heartbeat information based on the reply information of the
consensus node; the master gateway maintains the master gateway mode or enters the slave gateway mode based on the
heartbeat information reply; the slave gateway maintains the slave gateway mode or conducts the master gateway election based on the heartbeat information reply. The present invention avoids the
single point failure problem of the cross-chain gateway, ensures that the
blockchain system of the
medical institution can be continuously and stably connected to the relay cross-
chain system, ensures the effective intercommunication of medical resource data and the continuity of
business collaboration, and meets the reliability requirements.