Cross-chain method and system for realizing service registration and discovery function based on P2P technology

By deploying cross-chain gateway nodes in a P2P network, the service registration and discovery functions of the cross-chain system are realized, which solves the problems of high resource consumption and poor flexibility of existing cross-chain systems, improves cross-chain communication efficiency and reduces network resource waste.

CN120711068BActive Publication Date: 2026-01-27BEIJING MICROCHIP EDGE COMPUTING RES INST
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511204038.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-27
Publication Date
2026-01-27
Estimated Expiration
2045-08-27

AI Technical Summary

Technical Problem

Existing cross-chain systems suffer from poor flexibility, high resource consumption, or waste of network resources in their service registration and discovery functions.

Method used

P2P technology is used to implement service registration and discovery functions. By deploying cross-chain gateway nodes in the P2P network, registration requests from cross-chain adapter services are received, network addresses are cached, and cross-chain data transmission and service discovery are achieved through synchronization and querying via the P2P network.

Benefits of technology

It reduces additional resource overhead, supports dynamic updates and load balancing, improves the efficiency of cross-chain communication, and reduces network transmission resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120711068B_ABST
    Figure CN120711068B_ABST
Patent Text Reader

Abstract

The application discloses a cross-chain method and system for realizing service registration and discovery function based on P2P technology. The method comprises deploying multiple nodes in a cross-chain gateway, establishing a connection through a P2P network, receiving instance registration requests from cross-chain adapter services A and B, caching and synchronizing the network addresses of the instances. Cross-chain adapter services A and B are deployed in different blockchain systems, and are connected and interacted with the corresponding blockchain systems. The instance of cross-chain adapter service A sends cross-chain data to the cross-chain gateway, the gateway queries and obtains the network address of the instance in cross-chain adapter service B through the service discovery function of the P2P network, sends the cross-chain message to the target instance, and completes the cross-chain communication. The application realizes dynamic registration and discovery of services by using P2P network technology, reduces resource consumption, and improves the efficiency and flexibility of cross-chain communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular to a cross-chain method and system for implementing service registration and discovery functions based on P2P technology. Background Technology

[0002] In today's blockchain technology field, cross-chain communication is a key technology for enabling information and value interoperability between different blockchain networks. However, existing cross-chain systems have many shortcomings in service registration and discovery. On the one hand, some systems use configuration files for service registration and discovery, which requires manual modification of the configuration file when the number of services or addresses changes, making dynamic updates impossible and inflexible. On the other hand, some systems achieve service registration and discovery through additional relay chains or services. While the functionality is relatively complete, it requires additional deployment and maintenance, resulting in significant resource overhead. Furthermore, some systems completely ignore service registration and discovery functions, sending cross-chain messages via network-wide broadcast, causing unnecessary waste of network resources. Summary of the Invention

[0003] Based on this, embodiments of this application provide a cross-chain method and system for implementing service registration and discovery functions based on P2P technology. This application utilizes P2P technology to simultaneously implement service registration and discovery functions and cross-chain data transmission functions. Compared to other solutions, this application simultaneously possesses both functions with minimal resource overhead.

[0004] Firstly, a cross-chain method based on P2P technology is provided to implement service registration and discovery functions.

[0005] For use in cross-chain gateways, the method includes:

[0006] Deploy cross-chain gateway nodes in a P2P network to establish network connections with other cross-chain gateway nodes via P2P.

[0007] Receive registration requests from each instance of cross-chain adapter service A and cross-chain adapter service B; wherein cross-chain adapter service A and cross-chain adapter service B are deployed in different blockchain systems, and each instance of the service establishes a connection with the corresponding blockchain system and is able to interact with it;

[0008] Obtain the network addresses of each instance of cross-chain adapter service A and cross-chain adapter service B from the registration request;

[0009] The network address is cached and sent to other cross-chain gateway nodes via a P2P network, so that the other nodes also cache the network address;

[0010] Receive cross-chain data from the blockchain system sent by the instance in cross-chain adapter service A;

[0011] The service discovery function of the P2P network is used to query and obtain the network address of the instance in the cross-chain adapter service B from the cached network addresses.

[0012] Based on the obtained network address, the cross-chain data is encapsulated into a cross-chain message, and the cross-chain message is sent to the corresponding instance of cross-chain adapter service B. The cross-chain communication process is completed by receiving confirmation information returned by the instance of cross-chain adapter service B.

[0013] Optionally, the blockchain system includes blockchain system 1 and blockchain system 2. Blockchain system 1 is connected to and can interact with an instance of cross-chain adapter service A, and blockchain system 2 is connected to and can interact with an instance of cross-chain adapter service B, for performing operations related to cross-chain transactions.

[0014] Optionally, the step of caching the network address includes:

[0015] The network address is stored in a local cache, which includes at least one of memory, Redis, or disk storage.

[0016] Optionally, the network address is sent to other cross-chain gateway nodes via a P2P network, including:

[0017] The network address is sent to other cross-chain gateway nodes via broadcast or multicast.

[0018] Optionally, the network address can be obtained from the registration request, including:

[0019] Verify the legitimacy of the registration request, including verifying the validity of the network address and the identity information of the service instance;

[0020] After successful verification, the network address carried in the registration request is extracted.

[0021] Optionally, the network address of the instance in cross-chain adapter service B can be queried and obtained through the service discovery function of the P2P network, including:

[0022] Based on the preset load balancing strategy, the network address of the corresponding instance in cross-chain adapter service B is selected from the cached network addresses.

[0023] Optionally, the step of encapsulating the cross-chain data into a cross-chain message includes:

[0024] The cross-chain data is encrypted;

[0025] Add message header information to the encrypted cross-chain data. The message header information includes the network address of the target instance and the message type identifier.

[0026] Optionally, the network addresses of each instance of cross-chain adapter service A and cross-chain adapter service B obtained from the registration request include either IP address combined with port or domain name combined with port.

[0027] Secondly, a cross-chain system based on P2P technology to implement service registration and discovery functions is provided. This system includes:

[0028] A cross-chain gateway is used to deploy multiple nodes, each of which establishes a connection through a P2P network. It receives registration requests from instances of cross-chain adapter service A and cross-chain adapter service B, caches the network addresses of the instances, and synchronizes the network addresses to other cross-chain gateway nodes through the P2P network. It is also used to receive cross-chain data sent by instances in cross-chain adapter service A, query and obtain the network addresses of instances in cross-chain adapter service B through the service discovery function of the P2P network, and encapsulate the cross-chain data into cross-chain messages and send them to the corresponding instance of cross-chain adapter service B.

[0029] Cross-chain adapter service A includes multiple instances, each of which establishes a connection with and interacts with the corresponding blockchain system. It is used to register its own network address with any node of the cross-chain gateway and send cross-chain data of blockchain system 1 to any node of the cross-chain gateway.

[0030] Cross-chain adapter service B includes multiple instances, each of which establishes a connection with and interacts with the corresponding blockchain system. It is used to register its own network address with any node of the cross-chain gateway, receive cross-chain messages sent by the cross-chain gateway, and forward the cross-chain messages to blockchain system 2.

[0031] Optionally, the blockchain system includes blockchain system 1 and blockchain system 2. Blockchain system 1 is connected to and can interact with an instance of cross-chain adapter service A, and blockchain system 2 is connected to and can interact with an instance of cross-chain adapter service B, for performing operations related to cross-chain transactions.

[0032] The beneficial effects of the technical solutions provided in this application include at least the following:

[0033] (1) Service registration and discovery functions are realized through P2P network technology, without the need to deploy a dedicated registration center or relay chain, which reduces the occupation and maintenance costs of server resources.

[0034] (2) It supports dynamic registration and discovery of cross-chain adapter service instances, and can update the network address information of service instances in real time, adapt to the dynamic changes of service instances, and enhance the flexibility and scalability of the system.

[0035] (3) By utilizing the high-efficiency transmission characteristics of P2P networks and combining them with load balancing strategies, the transmission path of cross-chain messages is optimized, which improves the efficiency of cross-chain communication and reduces the waste of network transmission resources. Attached Figure Description

[0036] To more clearly illustrate the embodiments of this application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.

[0037] Figure 1 This is a schematic diagram of the system deployment provided in the embodiments of this application;

[0038] Figure 2 The service registration discovery and cross-chain process provided for the embodiments of this application. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0040] In the description of this application, the terms "comprising," "having," and any variations thereof are intended to cover non-exclusive inclusion, such as a process, method, system, product, or apparatus that includes a series of steps or units, not necessarily limited to those steps or units that are expressly listed, but may also include other steps or units that are not expressly listed but are inherent to these processes, methods, products, or apparatuses, or steps or units added based on further optimizations conceived in this application.

[0041] To facilitate understanding of this embodiment, a cross-chain method for implementing service registration and discovery based on P2P technology, as disclosed in this application embodiment, will first be described in detail.

[0042] By leveraging P2P network technology, service registration and discovery functions are implemented in cross-chain systems. This addresses the problems in conventional cross-chain systems where either service registration and discovery functions are too expensive or lack any service registration functionality at all.

[0043] The service registration function of cross-chain systems on the market is mainly implemented in two ways: ① Represented by Chang'an Chain proxy cross-chain: There is no registration center; service registration and discovery are solved using configuration files. ② Represented by Chang'an Chain TCIP relay cross-chain and AntChain Bridge cross-chain: An additional service or relay chain (also known as the main chain or parent chain) is used to realize service registration and discovery, that is, an additional service or blockchain acts as a service registration center (TCIP cross-chain uses a relay chain, and AntChain uses the Blockchain Domain Name System, English name: Blockchain Domain Name System, BCDNS).

[0044] The drawback of the configuration file method is that once the number of services or their addresses change, the configuration file must be modified, and it cannot be dynamically updated. ② An additional service or relay chain is a more elegant approach, but it requires deploying an additional service to act as a registry center, resulting in significant resource overhead (especially in production environments, where a registry center needs to deploy multiple node instances, requiring more servers).

[0045] In addition, there are a few cross-chain systems that completely disregard service registration and discovery. These systems often broadcast every cross-chain message across the entire network, which can lead to unnecessary waste of network transmission resources.

[0046] This application describes a service registration and discovery function implemented using P2P network technology, which has the following advantages: ① dynamic updates and ② no need for additional services or relay chains as a registration center, thereby reducing resource consumption overhead.

[0047] The following are common processing methods in existing technologies:

[0048] Similar Solution 1: (Publication No. CN119182507A) "Blockchain Cross-Chain Network System". This cross-chain system uses p2p for message transmission, but does not use p2p for service registration and discovery. The service registration and discovery functions of this patent are completed by its "cross-chain management platform", which means that this cross-chain management platform has certain service registration and discovery functions.

[0049] Similar Solution 2: (Publication No. CN118573348A) "A Multi-Level Blockchain Parent-Child Chain Cross-Chain Data Processing Method". This method uses P2P for network transmission, lacks a registration center service, and broadcasts each cross-chain transaction across the entire network (see the keyword "third-step broadcast transaction" in another article). It does not apply P2P to service registration and discovery functions.

[0050] Similar Solution 3: (Publication No. CN118101673A) A method for improving blockchain data synchronization efficiency. It uses p2p to implement data synchronization and block synchronization. This solution mainly maps p2p nodes to shards one-to-one, with each p2p node responsible for synchronizing data on one shard. It does not apply p2p to service registration and discovery functions.

[0051] Similar Solution 4: (Publication No. (CN117880299A) Cross-chain computing method, device, and system based on communication networks. This patent uses P2P to achieve network transmission. It includes a blockchain node registration process within the blockchain system, but lacks service discovery functionality. The only mention of discovery is that P2P itself has the ability to discover its own P2P nodes, not to discover other services. In other words, it involves microservice registration but lacks microservice discovery, and it registers service identifiers. My patent, however, registers network addresses, eliminating the need for service identifier registration and simplifying the process.

[0052] Similar Solution 5: (Publication No. CN117596250A) A cross-chain interaction method based on a multi-blockchain network. It uses p2p to implement network connection and message transmission functions, primarily replacing the relay chain with p2p. It does not apply p2p to service registration and discovery functions.

[0053] However, the above methods have the following drawbacks:

[0054] Disadvantages of Option 1: This option uses their self-developed "cross-chain management platform" to implement service registration and discovery functions, which is convenient for unified management but has a relatively high overhead. Implementing this option requires building an additional "cross-chain management platform" service in the project.

[0055] Disadvantages of Option 2: Because this option lacks service registration and discovery functionality, each cross-chain transaction is sent via broadcast, resulting in unnecessary message waste. While the service overhead is low, the network transmission overhead is high. Cross-chain transactions only need to be sent to the designated recipient.

[0056] Disadvantages of Option 3: This option lacks service registration and discovery functionality. It will likely require manual configuration when sharding and connecting to P2P nodes, making dynamic discovery impossible.

[0057] Option 4 has the following drawbacks: It involves registration but lacks service discovery. Furthermore, the registration only establishes the service identifier and primary association. Since registration focuses on primary association rather than load balancing, traffic cannot be evenly distributed.

[0058] Option 5's drawbacks: It replaces the relay chain with P2P. P2P is not applied to service registration and discovery functions, and there is no service registration and discovery functionality.

[0059] The following explains the definitions of concepts used in this application:

[0060] P2P networks, also known as peer-to-peer networks, are distributed application architectures that allocate tasks and workloads among peers. They represent a network structure or form of peer-to-peer computing at the application layer. In a P2P network environment, multiple interconnected computers are equal, each with identical functions, and there is no master-slave distinction.

[0061] Blockchain, also known as a distributed ledger, is a decentralized distributed ledger that is stored in a block-chain format, is immutable, secure, and reliable. It combines technologies such as distributed storage, peer-to-peer transmission, consensus mechanisms, and cryptography to record transactions and information through a continuously growing chain of data blocks, ensuring data security and transparency.

[0062] Cross-chain technology is a key technology for solving the interoperability problem between blockchains. It aims to break the "blockchain silo" phenomenon and enable value and information interoperability between different blockchain networks.

[0063] Service registration: Service registration refers to the process by which a service provider registers its metadata information (usually including host and port numbers, and sometimes authentication information, protocol, version number, and runtime environment information) with a service registry.

[0064] Service discovery: Service discovery refers to the process by which a service consumer (client) retrieves service instance information of a service provider by querying a service registry when it needs to invoke a service. Based on the retrieved list of service instances, the service consumer selects the appropriate service instance to invoke. Service discovery allows service consumers to dynamically obtain service instance information at runtime without needing to know the specific address of the service provider in advance, thus achieving loose coupling between services.

[0065] Cross-chain gateway: In a notary public's cross-chain system, the cross-chain gateway is the module responsible for transmitting cross-chain messages and controlling the main logic. In most systems, it does not directly interact with the blockchain. It is sometimes called a notary public gateway or a cross-chain router, as they have similar functions. In this application, it will be referred to as a cross-chain gateway.

[0066] Cross-chain adapter: A service or module that interacts directly with the blockchain. In a relay chain cross-chain system, the cross-chain gateway of this application is equivalent to the relay gateway, and the cross-chain adapter of this application is equivalent to the cross-chain gateway of the relay cross-chain.

[0067] Please refer to Figure 1 The diagram illustrates a system deployment provided in an embodiment of this application. The method may include the following steps:

[0068] Deploy cross-chain gateway nodes in a P2P network to establish network connections with other cross-chain gateway nodes via P2P.

[0069] Receive registration requests from various instances of cross-chain adapter service A and cross-chain adapter service B; wherein cross-chain adapter service A and cross-chain adapter service B are deployed in different blockchain systems, and each instance of the service establishes a connection with the corresponding blockchain system and can interact with it;

[0070] Obtain the network addresses of each instance of cross-chain adapter service A and cross-chain adapter service B from the registration request;

[0071] The network address is cached and sent to other cross-chain gateway nodes through the P2P network, so that other nodes can also cache the network address;

[0072] Receive cross-chain data from the blockchain system sent by the instance in cross-chain adapter service A;

[0073] The service discovery function of the P2P network is used to query and obtain the network address of the instance in the cross-chain adapter service B from the cached network addresses.

[0074] Based on the obtained network address, the cross-chain data is encapsulated into a cross-chain message, and the cross-chain message is sent to the corresponding instance of cross-chain adapter service B. The cross-chain communication process is completed by receiving the confirmation information returned by the instance of cross-chain adapter service B.

[0075] Specifically, the above implementation process is as follows:

[0076] ① The cross-chain gateway deploys multiple nodes, and each node establishes a network connection using a P2P method.

[0077] ② Cross-chain adapter services A and B are deployed in a distributed manner.

[0078] ③ Cross-chain adapter services A and B establish connections with blockchain systems 1 and 2 respectively.

[0079] ④ All instances of cross-chain adapter services A and B register their own network addresses with any node of the cross-chain gateway.

[0080] ⑤ The cross-chain gateway node that receives the registration request caches the network until it is available, and then sends the network address to other nodes via P2P. The other nodes also cache the network address upon receiving it.

[0081] ⑥ Cross-chain adapter service A sends the cross-chain data of blockchain system 1 to any node of the cross-chain gateway. The cross-chain gateway node obtains the network address of a certain instance in adapter service B through the P2P-based service discovery function.

[0082] ⑦ The cross-chain gateway node sends a cross-chain message to the aforementioned network address of the instance of cross-chain adapter service B.

[0083] like Figure 2 The service registration, discovery, and cross-chain process are described. The following is an optional embodiment of this application:

[0084] 1) The cross-chain gateway deploys i nodes, and each node establishes a network connection using a P2P method.

[0085] 2) Cross-chain adapter services A and B are deployed in a distributed manner. Cross-chain adapter service A has i instances deployed, namely A1, A2...Ai. Cross-chain adapter service B has i instances deployed, namely B1, B2...Bi. There is no network connection between any two instances.

[0086] 3) Cross-chain adapter services A and B establish connections with blockchain systems 1 and 2 respectively. That is, all instances in cross-chain adapter service A establish connections with blockchain system 1 and are able to interact with blockchain system 1; all instances in cross-chain adapter service B establish connections with blockchain system 2 and are able to interact with blockchain system 2.

[0087] 4) All instances of cross-chain adapter services A and B register their network addresses with any node of the cross-chain gateway. These network addresses refer to IP addresses combined with ports or domain names combined with ports, etc., that are capable of communication. That is, A1, A2, all the way to Ai, along with B1, B2, all the way to Bi, register their network addresses with the cross-chain gateway. This completes the service registration process.

[0088] 5) Upon receiving a registration request, the cross-chain gateway node caches and shares the network addresses of instances under cross-chain adapter services A and B via P2P. That is, when a cross-chain gateway node receives the network address of an instance of a cross-chain adapter service, it performs caching (including but not limited to caching to memory, Redis, and disk); and then sends the network addresses of instances under the cross-chain adapter service to other cross-chain gateway nodes via the P2P network. The other cross-chain gateway nodes also perform caching upon receiving these addresses.

[0089] 6) An instance in cross-chain adapter service A sends cross-chain data from blockchain system 1 to any node of the cross-chain gateway. The cross-chain gateway node can obtain the network address of an instance in adapter service B through the P2P-based service discovery function.

[0090] 7) The cross-chain gateway node obtains the network address of a specific instance in adapter service B through the service discovery function, and sends a cross-chain message to that instance's network address in cross-chain adapter service B. After receiving the message, cross-chain adapter service B sends the cross-chain message to blockchain system 2, thereby completing the cross-chain process.

[0091] In summary, the innovation of this application lies in:

[0092] Most cross-chain operations, even those that use P2P, only achieve data communication through P2P, as this is the most basic function of P2P. The most basic function of P2P is to establish peer-to-peer connections and transmit data (directly or broadcast).

[0093] Some cross-chain systems lack service registration and discovery functionality altogether. Others that do employ an additional set of services (relay chains or others) to act as the registry (i.e., to implement service registration and discovery; the registry's function is service registration and discovery). These additional services often incur additional overhead (e.g., requiring more servers to deploy them).

[0094] This application utilizes P2P to not only implement a cross-chain messaging module but also a registration center. This means it can both send and receive messages and provide service registration and discovery for other services. (The phrase "can provide other services" implies that P2P nodes have discovery capabilities, a built-in function of P2P that requires no additional design or development. This application utilizes P2P to discover instances of other services, which involves other services registering with the P2P network; this is fundamentally different from P2P's own discovery function.)

[0095] Therefore, the key point of this application is that a group of P2P nodes simultaneously possesses two functions (basic usage message transmission and P2P-based service registration and discovery). The advantages are: it has a registration center function, with very low overhead and minimal resource usage.

[0096] This application provides a cross-chain system based on P2P technology to implement service registration and discovery functions. The system may include:

[0097] A cross-chain gateway is used to deploy multiple nodes, each of which establishes a connection through a P2P network. It receives registration requests from instances of cross-chain adapter service A and cross-chain adapter service B, caches the network addresses of the instances, and synchronizes the network addresses to other cross-chain gateway nodes through the P2P network. It is also used to receive cross-chain data sent by instances in cross-chain adapter service A, query and obtain the network addresses of instances in cross-chain adapter service B through the service discovery function of the P2P network, and encapsulate the cross-chain data into cross-chain messages and send them to the corresponding instances of cross-chain adapter service B.

[0098] Cross-chain adapter service A includes multiple instances, each of which establishes a connection with and interacts with the corresponding blockchain system. It is used to register its own network address with any node of the cross-chain gateway and send cross-chain data of blockchain system 1 to any node of the cross-chain gateway.

[0099] Cross-chain adapter service B includes multiple instances, each of which establishes a connection with and interacts with the corresponding blockchain system. It is used to register its own network address with any node of the cross-chain gateway, receive cross-chain messages sent by the cross-chain gateway, and forward the cross-chain messages to blockchain system 2.

[0100] The blockchain system includes blockchain system 1 and blockchain system 2. Blockchain system 1 is connected to and can interact with an instance of cross-chain adapter service A, and blockchain system 2 is connected to and can interact with an instance of cross-chain adapter service B, and is used to perform cross-chain transaction-related operations.

[0101] Specific limitations regarding cross-chain systems implementing service registration and discovery based on P2P technology can be found in the above section on limitations of cross-chain methods for implementing service registration and discovery based on P2P technology, and will not be repeated here. Each module in the aforementioned cross-chain system implementing service registration and discovery based on P2P technology can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0102] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0103] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A cross-chain method for implementing service registration and discovery functions based on P2P technology, characterized in that, When applied to cross-chain gateways, the method includes: Deploy cross-chain gateway nodes in a P2P network to establish network connections with other cross-chain gateway nodes via P2P. Receive registration requests from each instance of cross-chain adapter service A and cross-chain adapter service B; wherein cross-chain adapter service A and cross-chain adapter service B are deployed in different blockchain systems, and each instance of the service establishes a connection with the corresponding blockchain system and is able to interact with it; Obtain the network addresses of each instance of cross-chain adapter service A and cross-chain adapter service B from the registration request; The network address is cached and sent to other cross-chain gateway nodes via a P2P network, so that the other nodes also cache the network address; Receive cross-chain data from the blockchain system sent by the instance in cross-chain adapter service A; The service discovery function of the P2P network is used to query and obtain the network address of the instance in cross-chain adapter service B from the cached network addresses. Based on the obtained network address, the cross-chain data is encapsulated into a cross-chain message, and the cross-chain message is sent to the corresponding instance of cross-chain adapter service B. The cross-chain communication process is completed by receiving confirmation information returned by the instance of cross-chain adapter service B.

2. The cross-chain method according to claim 1, characterized in that, The blockchain system includes blockchain system 1 and blockchain system 2. Blockchain system 1 is connected to and can interact with an instance of cross-chain adapter service A, and blockchain system 2 is connected to and can interact with an instance of cross-chain adapter service B, and is used to perform cross-chain transaction-related operations.

3. The cross-chain method according to claim 1, characterized in that, The steps of caching the network address include: The network address is stored in a local cache, which includes at least one of memory, Redis, or disk storage.

4. The cross-chain method according to claim 1, characterized in that, Sending the network address to other cross-chain gateway nodes via a P2P network includes: The network address is sent to other cross-chain gateway nodes via broadcast or multicast.

5. The cross-chain method according to claim 1, characterized in that, Obtain the network address from the registration request, including: Verify the legitimacy of the registration request, including verifying the validity of the network address and the identity information of the service instance; After successful verification, the network address carried in the registration request is extracted.

6. The cross-chain method according to claim 1, characterized in that, The network address of the instance in cross-chain adapter service B is queried and obtained through the service discovery function of the P2P network, including: Based on the preset load balancing strategy, the network address of the corresponding instance in cross-chain adapter service B is selected from the cached network addresses.

7. The cross-chain method according to claim 1, characterized in that, The step of encapsulating the cross-chain data into a cross-chain message includes: The cross-chain data is encrypted; Add message header information to the encrypted cross-chain data. The message header information includes the network address of the target instance and the message type identifier.

8. The cross-chain method according to claim 1, characterized in that, The network addresses obtained from the registration request for each instance of cross-chain adapter service A and cross-chain adapter service B include either IP address combined with port or domain name combined with port.

9. A cross-chain system for implementing service registration and discovery functions based on P2P technology, characterized in that, The system includes: A cross-chain gateway is used to deploy multiple nodes, each of which establishes a connection through a P2P network. It receives registration requests from instances of cross-chain adapter service A and cross-chain adapter service B, caches the network addresses of the instances, and synchronizes the network addresses to other cross-chain gateway nodes through the P2P network. It is also used to receive cross-chain data sent by instances in cross-chain adapter service A, query and obtain the network addresses of instances in cross-chain adapter service B through the service discovery function of the P2P network, and encapsulate the cross-chain data into cross-chain messages and send them to the corresponding instance of cross-chain adapter service B. Cross-chain adapter service A includes multiple instances, each of which establishes a connection with and interacts with the corresponding blockchain system. It is used to register its own network address with any node of the cross-chain gateway and send cross-chain data of blockchain system 1 to any node of the cross-chain gateway. Cross-chain adapter service B includes multiple instances, each of which establishes a connection with and interacts with the corresponding blockchain system. It is used to register its own network address with any node of the cross-chain gateway, receive cross-chain messages sent by the cross-chain gateway, and forward the cross-chain messages to blockchain system 2.

10. The cross-chain system according to claim 9, characterized in that, The blockchain system includes blockchain system 1 and blockchain system 2. Blockchain system 1 is connected to and can interact with an instance of cross-chain adapter service A, and blockchain system 2 is connected to and can interact with an instance of cross-chain adapter service B, and is used to perform cross-chain transaction-related operations.

Citation Information

Patent Citations

  • Cross-chain interaction method based on multi-block chain network

    CN117596250A

  • Cross-chain computing method, device and system based on communication network

    CN117880299A

  • Method for improving block chain data synchronization efficiency

    CN118101673A

  • Block chain cross-chain network system

    CN119182507A

  • Cross-chain transaction system, method and device and storage medium

    CN115708119A