CN115442420A - Block chain cross-chain service management method and device - Google Patents

Block chain cross-chain service management method and device Download PDF

Info

Publication number
CN115442420A
CN115442420A CN202110539297.9A CN202110539297A CN115442420A CN 115442420 A CN115442420 A CN 115442420A CN 202110539297 A CN202110539297 A CN 202110539297A CN 115442420 A CN115442420 A CN 115442420A
Authority
CN
China
Prior art keywords
chain
relay
cross
service
determining
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.)
Pending
Application number
CN202110539297.9A
Other languages
Chinese (zh)
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.)
Jingdong Technology Holding Co Ltd
Original Assignee
Jingdong Technology Holding 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 Jingdong Technology Holding Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN202110539297.9A priority Critical patent/CN115442420A/en
Priority to PCT/CN2022/088745 priority patent/WO2022242425A1/en
Publication of CN115442420A publication Critical patent/CN115442420A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1073Registration or de-registration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Abstract

The application discloses a block chain cross-chain service management method and device. One embodiment of the method comprises: in response to the application chain, issuing the cross-chain service to the target relay chain, and distributing the cross-chain service to relay chain clients of relay chains in the relay chain set except the target relay chain through the relay chain clients of the target relay chain; for each relay chain client corresponding to the relay chain set, comparing a relay chain identifier of a relay chain corresponding to the relay chain client with a relay chain identifier in the cross-chain service, and determining a relay chain of the cross-chain service which is not issued by an application chain; determining that no relay chain of the cross-chain service exists in the relay chain of the cross-chain service published by the application chain, and deploying the cross-chain service in the relay chain of the cross-chain service. The application provides a cross-chain service management method under a block chain scene, which realizes cross-chain service discovery and service registration of a service registration center taking a relay chain as a weak center.

Description

Block chain cross-chain service management method and device
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a block chain cross-chain service management method and device.
Background
In the field of micro-service architecture, a single application is split into multiple micro-services. Each microservice often needs to register for service with a centralized registry to notify service callers. A commonly used registration center includes ZooKeeper (a distributed application coordination service), consul (a service discovery and configuration management center service), and Etcd (a highly available key-value pair storage system). When a registry is selected, the registry itself is required to be highly available and support an event mechanism. Undeniably, a richer ecology has emerged around these registries, which are favored in micro-service technology. However, they are not applicable to blockchain cross-chain service management scenarios.
Disclosure of Invention
The embodiment of the application provides a block chain cross-chain service management method and a block chain cross-chain service management device.
In a first aspect, an embodiment of the present application provides a method for managing a blockchain cross-chain service, including: in response to the application chain, issuing the cross-chain service to the target relay chain, and distributing the cross-chain service to relay chain clients of relay chains in the relay chain set except the target relay chain through the relay chain clients of the target relay chain; for each relay chain client corresponding to the relay chain set, comparing the relay chain identifier of the relay chain corresponding to the relay chain client with the relay chain identifier in the cross-chain service, and determining the relay chain of the cross-chain service which is not issued by the application chain; determining that no relay chain of the cross-chain service exists in the relay chain of the cross-chain service published by the application chain, and deploying the cross-chain service in the relay chain of the cross-chain service.
In some embodiments, the determining that no relay chain of the cross-chain service exists in the relay chain of the cross-chain service published by the application chain, and deploying the cross-chain service in the relay chain of the cross-chain service does not exist includes: for each relay chain in the relay chains that is not published by the application chain for cross-chain services, performing the following: determining whether a cross-chain service exists in a cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service; in response to determining that no cross-chain service exists in the relay chain, deploying a cross-chain service in the relay chain.
In some embodiments, the deploying the cross-chain service in the relay chain in response to determining that the cross-chain service does not exist in the relay chain includes: in response to determining that no cross-chain service exists in the relay chain, determining an event type of the cross-chain service; and deploying the cross-chain service in the relay chain according to the interface corresponding to the event type and provided by the cross-chain service management contract of the relay chain.
In some embodiments, the determining whether the cross-chain service exists in the cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service includes: determining an offset of the cross-chain service, wherein the offset is used for representing the block height or the event sequence number corresponding to the cross-chain service; determining a maximum offset for an existing cross-chain service in the relay chain; and in response to determining that the offset of the cross-chain service is greater than the maximum offset, determining whether the cross-chain service exists in a cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service.
In some embodiments, the above method further comprises: and updating the maximum offset of the existing cross-chain service in the relay chain to the offset of the cross-chain service.
In some embodiments, the above method further comprises: determining existing cross-link services in the relay links except for the newly added relay link in the relay link set in response to determining that the newly added relay link exists in the relay link set; and registering the existing cross-link service corresponding to the relay link set to the newly added relay link.
In some embodiments, the determining existing cross-link services in relay links in the relay link set includes: for each relay chain in the relay chain set, determining metadata of existing cross-chain services in the relay chain; and determining the existing cross-link service in the relay chain with the most metadata as the existing cross-link service corresponding to the relay chain set.
In some embodiments, the distributing the cross-link service to the relay link clients of the relay links in the relay link set except the target relay link includes: and distributing the cross-chain service and the interface document representing the interface information of the cross-chain service to the relay chain clients of the relay chains except the target relay chain in the relay chain set.
In a second aspect, an embodiment of the present application provides a block chain cross-chain service management apparatus, including: a distribution unit configured to distribute, by a relay chain client of a target relay chain, a cross-chain service to relay chain clients of relay chains in a relay chain set other than the target relay chain in response to a presence application chain publishing the cross-chain service onto the target relay chain; the determining unit is configured to compare a relay chain identifier of a relay chain corresponding to the relay chain client with a relay chain identifier in the cross-chain service, and determine the relay chain of the cross-chain service which is not issued by the application chain, for each relay chain client corresponding to the relay chain set; the deployment unit is configured to determine that no relay chain of the cross-chain service exists in the relay chain of the cross-chain service which is not published by the application chain, and deploy the cross-chain service in the relay chain of the cross-chain service which does not exist.
In some embodiments, the deployment unit is further configured to: for each of the relay chains for which no cross-chain service is published by an application chain, performing the following: determining whether a cross-chain service exists in a cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service; in response to determining that no cross-chaining services exist in the relay chain, deploying the cross-chaining services in the relay chain.
In some embodiments, the deployment unit is further configured to: in response to determining that no cross-chain service exists in the relay chain, determining an event type of the cross-chain service; and deploying the cross-chain service in the relay chain according to the interface corresponding to the event type and provided by the cross-chain service management contract of the relay chain.
In some embodiments, the deployment unit is further configured to: determining an offset of the cross-chain service, wherein the offset is used for representing the block height or the event sequence number corresponding to the cross-chain service; determining a maximum offset for an existing cross-chain service in the relay chain; and in response to determining that the offset of the cross-chain service is greater than the maximum offset, determining whether the cross-chain service exists in a cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service.
In some embodiments, the above apparatus further comprises: an updating unit configured to update a maximum offset of an existing cross-chain service in the relay chain to an offset of the cross-chain service.
In some embodiments, the above apparatus further comprises: a registration unit configured to determine, in response to determining that a newly added relay link exists in the relay link set, an existing inter-link service in a relay link other than the newly added relay link in the relay link set; and registering the existing cross-link service corresponding to the relay link set to the newly added relay link.
In some embodiments, the registration unit is further configured to: for each relay chain in the relay chain set, determining metadata of existing cross-chain services in the relay chain; and determining the existing cross-link service in the relay chain with the most metadata as the existing cross-link service corresponding to the relay chain set.
In some embodiments, the distribution unit is further configured to: and distributing the cross-chain service and the interface document representing the interface information of the cross-chain service to the relay chain clients of the relay chains except the target relay chain in the relay chain set.
In a third aspect, the present application provides a computer-readable medium, on which a computer program is stored, where the program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement a method as described in any implementation of the first aspect.
According to the block chain cross-chain service management method and device provided by the embodiment of the application, the cross-chain service is issued to the target relay chain by responding to the existing application chain, and the cross-chain service is distributed to the relay chain clients of the relay chains except the target relay chain in the relay chain set through the relay chain clients of the target relay chain; for each relay chain client corresponding to the relay chain set, comparing a relay chain identifier of a relay chain corresponding to the relay chain client with a relay chain identifier in the cross-chain service, and determining a relay chain of the cross-chain service which is not issued by an application chain; the method comprises the steps of determining that no relay chain of the cross-chain service exists in the relay chain of the cross-chain service which is not issued by the application chain, and deploying the cross-chain service in the relay chain of the cross-chain service which does not exist, so that the cross-chain service management method under the block chain scene is provided, and discovery of the cross-chain service and service registration of a service registration center which is weakly centralized by the relay chain are achieved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram according to one embodiment of a blockchain cross-chain service management method of the present application;
fig. 3 is a schematic diagram of an application scenario of the blockchain cross-chain service management method according to the embodiment;
FIG. 4 is a flow diagram of yet another embodiment of a blockchain cross-chain service management method according to the present application;
FIG. 5 is a block diagram of one embodiment of a blockchain cross-chain service management apparatus according to the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary architecture 100 to which the blockchain cross-chain service management method and apparatus of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The communication connections between the terminal devices 101, 102, 103 form a topological network, and the network 104 serves to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The terminal devices 101, 102, 103 may be hardware devices or software that support network connections for data interaction and data processing. When the terminal devices 101, 102, and 103 are hardware, they may be various electronic devices supporting network connection, information acquisition, interaction, display, processing, and the like, including but not limited to smart phones, tablet computers, electronic book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, for example, a background processing server acquiring request information representing a cross-chain service sent by a user through the terminal devices 101, 102, and 103, and executing the request information. The background processing server can actively discover the cross-chain service of the application chain, and register the cross-chain service of the application chain by taking the relay chain as a weakly centralized cross-chain service registry. As an example, the server 105 may be a cloud server.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules for providing distributed services) or as a single piece of software or software module. And is not particularly limited herein.
It should be further noted that the block chain cross-chain service management method provided by the embodiment of the present application may be executed by a server, or may be executed by a terminal device, or may be executed by the server and the terminal device in cooperation with each other. Accordingly, each part (for example, each unit) included in the block chain cross-chain service management apparatus may be entirely disposed in the server, may be entirely disposed in the terminal device, and may be disposed in the server and the terminal device, respectively.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation. When the electronic device on which the blockchain cross-chain service management method operates does not need to perform data transmission with other electronic devices, the system architecture may only include the electronic device (e.g., a server or a terminal device) on which the blockchain cross-chain service management method operates.
With continued reference to fig. 2, a flow 200 of one embodiment of a blockchain cross-chain service management method is shown, comprising the steps of:
step 201, responding to the application chain to publish the cross-link service to the target relay chain, and distributing the cross-link service to the relay chain clients of the relay chains in the relay chain set except the target relay chain through the relay chain clients of the target relay chain.
In this embodiment, an execution subject (for example, a server in fig. 1) of the blockchain cross-chain service management method may issue a cross-chain service onto a target relay chain in response to the existence of an application chain, and distribute, by a relay chain client of the target relay chain, the cross-chain service to relay chain clients of relay chains in a relay chain set other than the target relay chain.
The application chains are independent block chains, applications for realizing various services are deployed on the application chains, cross-chain operations such as information exchange and transaction are carried out between different application chains through the relay chains, and the relay chains also adopt a block chain structure. Cross-chaining between application chains, also known as inter-chain interoperation, generally refers to the interaction of business data of two application chains. The basic form of cross-chain interoperability is intelligent contract interoperability across two application chains.
The embodiment is mainly applicable to a multi-relay-chain scenario, that is, a plurality of relay chains in a relay chain set form a relay chain network. Under the multi-relay-chain scene, a cross-chain client held by an application chain of the cross-chain service to be published is registered to one relay chain in a relay chain set, so that the cross-chain service is published to the relay chain through the cross-chain client. When a relay chain is published by an application chain for a cross-chain service, the relay chain may be considered as a target relay chain of the application chain that publishes the cross-chain service.
A cross-link service management contract on a target relay link issues a cross-link service event, and a relay link client of the target relay link subscribes the cross-link service event; after acquiring the subscribed cross-link service event based on the event mechanism, the relay link client of the target relay link distributes the cross-link service to the relay link clients of the relay links except the target relay link in the relay link set.
The relay chain cross-chain service management contract may provide cross-chain service registration, querying, upgrading, offline, event offset acquisition/setting, etc. The offset is used to characterize the corresponding block height or event sequence number across chain services.
In some optional implementations of this embodiment, the executing main body may execute the step 201 in the following manner: and distributing the cross-chain service and the interface document representing the interface information of the cross-chain service to the relay chain clients of the relay chains except the target relay chain in the relay chain set.
In this implementation, when a cross-link related party performs cross-link, there is not only a need for cross-link service discovery, but also an API (Application Programming Interface) Interface document of the cross-link service needs to be obtained. The interface document determines the APIs included in the cross-chain service, and specifically includes the information of the input type, the meaning of the input type, the return type, the meaning of the return type and the like of each API. The cross-chain service interface document is published as part of the cross-chain service content.
When the cross-chain service is registered and updated, the cross-chain service management contract of the relay chain can check the interface document, and when the cross-chain service is determined to include the corresponding interface document, the cross-chain service is registered and updated. The format of the cross-chain service interface document may be a human-readable information format. For example, JSON (JavaScript Object Notation) and YAML (a format for expressing data serialization with high readability).
Step 202, for each relay chain client corresponding to the relay chain set, comparing the relay chain identifier of the relay chain corresponding to the relay chain client with the relay chain identifier in the cross-chain service, and determining the relay chain which is not published by the application chain for the cross-chain service.
In this embodiment, for each relay chain client corresponding to the relay chain set, the execution main body may compare the relay chain identifier of the relay chain corresponding to the relay chain client with the relay chain identifier in the cross-chain service, and determine that the relay chain of the cross-chain service is not published by the application chain.
The relay link client corresponding to the relay link set refers to a relay link client of each relay link in the relay link set.
In this embodiment, each relay link is provided with a relay link identifier. The relay chain identification may be any identification capable of uniquely identifying the relay chain, including but not limited to characters, images, and the like. Each relay chain client may query for a relay chain identification from a cross-chain service management contract on the bound relay chain. After the relay link identifier is queried for the first time, the query result can be maintained in the memory, so that the relay link identifier is obtained in the memory when the relay link identifier is determined in the subsequent process, and resource consumption is reduced.
After the cross-link service is released by the target relay link, the relay link identifier of the target relay link is set. And comparing the relay chain identification of the relay chain corresponding to each relay chain client with the relay chain identification in the cross-chain service to prevent the cross-chain service from being linked on the target relay chain again.
Specifically, for a relay chain client of each relay chain in the relay chain set, in response to determining that the relay chain identifier of the relay chain corresponding to the relay chain client is different from the relay chain identifier in the cross-chain service, the relay chain corresponding to the relay chain client is determined as a relay chain not published by the application chain for the cross-chain service.
Step 203, determining that no relay chain of the cross-chain service exists in the relay chain of the cross-chain service published by the application chain, and deploying the cross-chain service in the relay chain of the cross-chain service does not exist.
In this embodiment, the execution subject may determine that no relay chain of the cross-chain service exists in a relay chain of the cross-chain service that is not published by the application chain, and deploy the cross-chain service in the relay chain of the cross-chain service that does not exist.
As an example, for each relay chain for which no cross-chain service is published by an application chain, the relay chain client of the relay chain may query from a cross-chain service management contract of the relay chain whether a cross-chain service exists for which the application chain is published to a target relay chain, to determine that no relay chain exists for the cross-chain service, and deploy the cross-chain service in the relay chain for which no cross-chain service exists.
In some optional implementations of this embodiment, the executing main body may execute the step 203 by:
for each of the relay chains for which no cross-chain service is published by an application chain, performing the following:
firstly, according to metadata of a cross-chain service, determining whether the cross-chain service exists in a cross-chain service management contract corresponding to the relay chain.
In this implementation manner, the execution subject may use the name and version number of the cross-chain service as metadata to establish a corresponding relationship between the metadata and the cross-chain service. Therefore, the execution subject may determine whether the cross-chain service exists in the cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service.
Second, in response to determining that no cross-chain services exist in the relay chain, a cross-chain service is deployed in the relay chain.
In this implementation, when the metadata of the issued cross-link service is not included in the cross-link service management contract of the relay link, it is determined that the cross-link service does not exist in the relay link, and the cross-link service is deployed in the relay link.
In some optional implementations of this embodiment, the executing body may execute the first step by:
first, an offset for the cross-chain service is determined.
The offset is used for characterizing the block height or the event sequence number corresponding to the cross-chain service.
In this implementation, a cross-link service management contract of a relay link needs to expose an offset acquisition interface and a setting interface of a cross-link service event. For example, in JD Chain of Chain blocks, the offset is the cross-Chain service event sequence number. The offset of the cross-chain service is the offset of the cross-chain service in the target relay chain.
Second, a maximum offset for existing cross-chain services in the relay chain is determined.
In this embodiment, the existing cross-link service represents the cross-link service deployed in the relay chain, and the maximum offset represents the offset of the cross-link service newly deployed by the relay chain until the current time.
And finally, in response to determining that the offset of the cross-chain service is greater than the maximum offset, determining whether the cross-chain service exists in a cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service.
In this implementation, in response to determining that the offset of the cross-chain service is not greater than the maximum offset, it indicates that the cross-chain service issued by the application chain has been deployed in the relay chain, and the relay chain ignores the cross-chain service.
In some optional implementations of this embodiment, the execution main body may further update the maximum offset of the existing inter-chain service in the relay chain to the offset of the inter-chain service, so as to continuously update the maximum offset in the relay chain.
The current maximum offset may be updated as follows: 1. and calling a setting interface of the cross-chain service management contract, and writing the offset of the currently newly deployed cross-chain service event into the relay chain, wherein the effect of this is that the maximum offset can be updated in real time. 2. The update of the maximum offset is maintained in the memory of the relay chain client until the maximum offset is written onto the relay chain when the cross-chain service is stopped. It is worth mentioning that the maximum offset may be persisted in a database of the cross-link manager managing each relay link client, without being limited to the relay link node.
In some optional implementations of this embodiment, the executing body may execute the second step by:
first, in response to determining that no cross-chain service exists in the relay chain, an event type of the cross-chain service is determined.
In this implementation, the event type includes, but is not limited to, a registered cross-chain service, an updated cross-chain service, and an offline cross-chain service.
The cross-chain service is then deployed in the relay chain according to an interface corresponding to the event type provided by the cross-chain service management contract for the relay chain.
The interfaces provided by the cross-chain service management contract include, but are not limited to, a cross-chain service registration interface, a cross-chain service update interface, and a cross-chain service downline interface.
With continued reference to fig. 3, fig. 3 is a schematic diagram 300 of an application scenario of the blockchain cross-chain service management method according to the present embodiment. In the application scenario of fig. 3, an application chain 301 publishes a cross-chain service 302 in a target relay chain 303. The relay chain set including the target relay chain 303 also includes relay chains 304, 305, and 306. In response to determining that the application chain 301 publishes the cross-chain service 302 onto the target relay chain 303, distributing, by the relay chain client 307 of the target relay chain 303, the cross-chain service to the relay chain clients 308, 309, and 310 of relay chains in the relay chain set other than the target relay chain; for each relay chain client corresponding to the relay chain set, comparing the relay chain identifier of the relay chain corresponding to the relay chain client with the relay chain identifier in the cross-chain service, and determining the relay chain of the cross-chain service which is not issued by the application chain; determining that no relay chain of the cross-chain service exists in the relay chain of the cross-chain service which is not published by the application chain, and deploying the cross-chain service in the relay chain of the cross-chain service which does not exist.
In the method provided by the above embodiment of the present application, the cross-link service is issued to the target relay link in response to the existence of the application link, and the cross-link service is distributed to the relay link clients of the relay links in the relay link set except for the target relay link through the relay link client of the target relay link; for each relay chain client corresponding to the relay chain set, comparing the relay chain identifier of the relay chain corresponding to the relay chain client with the relay chain identifier in the cross-chain service, and determining the relay chain of the cross-chain service which is not issued by the application chain; determining that no relay chain of the cross-chain service exists in the relay chain of the cross-chain service which is not issued by the application chain, and deploying the cross-chain service in the relay chain of the cross-chain service which does not exist, thereby providing a cross-chain service management method under a block chain scene, and realizing cross-chain service discovery and service registration of a service registration center which is weakly centralized by the relay chain.
In some optional implementation manners of this embodiment, the execution main body may be further adapted to be used in a case of creating a new relay link, and actively pull an existing cross-link service from a relay link in the relay link set for registration, with respect to the created new relay link. Specifically, the method comprises the following steps:
first, in response to determining that a newly added relay link exists in the relay link set, existing cross-link services in relay links other than the newly added relay link in the relay link set are determined.
As an example, the executing entity may determine an existing cross-link service in each relay chain in the relay chain set, and obtain the existing cross-link service corresponding to the relay chain set after deduplication.
And secondly, registering the existing cross-link service corresponding to the relay link set to the newly added relay link.
In some optional implementations of this embodiment, the executing body may execute the first step by:
first, for each relay chain in the set of relay chains, metadata of existing cross-chain services in the relay chain is determined.
And then, determining the existing cross-chain service in the relay chain with the most metadata as the existing cross-chain service corresponding to the relay chain set.
As an example, for each relay chain in a relay chain set, initiating a query request to a cross-chain service management contract of the relay chain through a relay chain client corresponding to the relay chain, and acquiring metadata of a cross-chain service deployed in the relay chain; and sequencing the relay chains in a reverse order according to the quantity of the metadata corresponding to each relay chain, and determining the cross-chain service corresponding to the metadata corresponding to the relay chain arranged at the head as the cross-chain service in the existing relay chain.
With continuing reference to FIG. 4, an exemplary flow 400 of one embodiment of a blockchain cross-chain service management method according to the present application is shown, including the steps of:
step 401, in response to the application chain issuing the cross-link service to the target relay chain, distributing the cross-link service to the relay chain clients of the relay chains in the relay chain set except the target relay chain through the relay chain clients of the target relay chain.
Step 402, for each relay chain client corresponding to the relay chain set, comparing the relay chain identifier of the relay chain corresponding to the relay chain client with the relay chain identifier in the cross-chain service, and determining the relay chain which is not published by the application chain for the cross-chain service.
In step 403, for each relay chain in the relay chains not published by the application chain for the cross-chain service, the following operations are performed:
step 4031, determine the offset of the cross-chain service.
Wherein the offset is used to characterize the block height or event sequence number corresponding to the cross-chain service.
Step 4032, determine the maximum offset for existing cross-chain services in the relay chain.
Step 4033, in response to determining that the offset of the cross-link service is greater than the maximum offset, determining whether a cross-link service exists in a cross-link service management contract corresponding to the relay link according to metadata of the cross-link service.
Step 4034, in response to determining that no cross-link service exists in the relay link, determine an event type of the cross-link service.
Step 4035, deploy the cross-link service in the relay chain according to the interface corresponding to the event type provided by the cross-link service management contract of the relay chain.
As can be seen from this embodiment, compared with the embodiment corresponding to fig. 2, the flow 400 of the block chain cross-chain service management method in this embodiment specifically illustrates a process of determining that a relay chain of a cross-chain service does not exist, and a process of deploying the cross-chain service, so that accuracy of a cross-chain service discovery process is improved.
With continuing reference to fig. 5, as an implementation of the method shown in the foregoing figures, the present application provides an embodiment of a block chain cross-chain service management apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the block chain cross-chain service management apparatus includes: a distributing unit 501 configured to distribute, by a relay link client of a target relay link, a cross-link service to relay link clients of relay links other than the target relay link in a relay link set in response to the presence of an application link publishing the cross-link service onto the target relay link; a determining unit 502 configured to, for each relay chain client corresponding to the relay chain set, compare a relay chain identifier of a relay chain corresponding to the relay chain client with a relay chain identifier in the cross-chain service, and determine a relay chain of the cross-chain service that is not published by an application chain; the deployment unit 503 is configured to determine that no relay chain of the cross-chain service exists in the relay chain of the cross-chain service published by the application chain, and deploy the cross-chain service in the relay chain of the cross-chain service does not exist.
In some embodiments, the deployment unit 503 is further configured to: for each relay chain in the relay chains that is not published by the application chain for cross-chain services, performing the following: determining whether a cross-chain service exists in a cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service; in response to determining that no cross-chaining services exist in the relay chain, deploying the cross-chaining services in the relay chain.
In some embodiments, the deployment unit 503 is further configured to: in response to determining that no cross-chain service exists in the relay chain, determining an event type of the cross-chain service; and deploying the cross-chain service in the relay chain according to the interface corresponding to the event type and provided by the cross-chain service management contract of the relay chain.
In some embodiments, the deployment unit 503 is further configured to: determining an offset of the cross-chain service, wherein the offset is used for representing the block height or the event sequence number corresponding to the cross-chain service; determining a maximum offset for an existing cross-chain service in the relay chain; and in response to determining that the offset of the cross-chain service is greater than the maximum offset, determining whether the cross-chain service exists in a cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service.
In some embodiments, the above apparatus further comprises: an updating unit (not shown in the figure) configured to update the maximum offset of the existing cross-chain service in the relay chain to the offset of the cross-chain service.
In some embodiments, the above apparatus further comprises: a registering unit (not shown in the figure) configured to determine existing cross-link services in relay links other than the newly added relay link in the relay link set in response to determining that the newly added relay link exists in the relay link set; and registering the existing cross-link service corresponding to the relay link set to the newly added relay link.
In some embodiments, the registration unit (not shown in the figures) is further configured to: for each relay chain in the relay chain set, determining metadata of existing cross-chain service in the relay chain; and determining the existing cross-link service in the relay chain with the most metadata as the existing cross-link service corresponding to the relay chain set.
In some embodiments, the distribution unit 501 is further configured to: and distributing the cross-chain service and the interface document representing the interface information of the cross-chain service to the relay chain clients of the relay chains except the target relay chain in the relay chain set.
In this embodiment, the distribution unit in the block chain inter-link service management apparatus issues the inter-link service to the target relay chain in response to the existence of the application chain, and distributes the inter-link service to the relay chain clients of the relay chains in the relay chain set except the target relay chain through the relay chain client of the target relay chain; the determining unit compares a relay chain identifier of a relay chain corresponding to the relay chain client with a relay chain identifier in the cross-chain service for each relay chain client corresponding to the relay chain set, and determines the relay chain which is not published by the application chain for the cross-chain service; the deployment unit determines that no relay chain of the cross-chain service exists in the relay chain of the cross-chain service which is not issued by the application chain, and deploys the cross-chain service in the relay chain of the cross-chain service which does not exist, so that the cross-chain service management device under the block chain scene is provided, and discovery of the cross-chain service and service registration of the service registration center which is weakly centered by the relay chain are realized.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing devices of embodiments of the present application (e.g., devices 101, 102, 103, 105 shown in FIG. 1). The apparatus shown in fig. 6 is only an example, and should not bring any limitation to the function and use range of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a processor (e.g., CPU, central processing unit) 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the system 600 are also stored. The processor 601, the ROM602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. Which when executed by the processor 601 performs the above-mentioned functions as defined in the method of the present application.
It should be noted that the computer readable medium of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the client computer, partly on the client computer, as a stand-alone software package, partly on the client computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the client computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a distribution unit, a determination unit, and a deployment unit. The names of the units do not form a definition of the unit itself under certain conditions, for example, the unit for deployment may also be described as a unit for determining that no relay chain of the cross-chain service is published by the application chain, no relay chain of the cross-chain service exists, and the cross-chain service is deployed in the relay chain without the cross-chain service.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the computer device to: in response to the application chain, issuing the cross-chain service to the target relay chain, and distributing the cross-chain service to relay chain clients of relay chains in the relay chain set except the target relay chain through the relay chain clients of the target relay chain; for each relay chain client corresponding to the relay chain set, comparing the relay chain identifier of the relay chain corresponding to the relay chain client with the relay chain identifier in the cross-chain service, and determining the relay chain of the cross-chain service which is not issued by the application chain; determining that no relay chain of the cross-chain service exists in the relay chain of the cross-chain service which is not published by the application chain, and deploying the cross-chain service in the relay chain of the cross-chain service which does not exist.
The foregoing description is only exemplary of the preferred embodiments of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (18)

1. A method for block chain cross-chain service management comprises the following steps:
in response to the presence of an application chain, publishing a cross-chain service onto a target relay chain, distributing the cross-chain service to relay chain clients of relay chains in a relay chain set except the target relay chain through the relay chain clients of the target relay chain;
for each relay chain client corresponding to the relay chain set, comparing the relay chain identifier of the relay chain corresponding to the relay chain client with the relay chain identifier in the cross-chain service, and determining the relay chain which is not published by the application chain for the cross-chain service;
determining that no relay chain of the cross-chain service exists in the relay chain which is not published by the application chain, and deploying the cross-chain service in the relay chain which does not exist in the cross-chain service.
2. The method of claim 1, wherein the determining that no relay chain of the cross-chain service exists in the relay chain for which the application chain publishes the cross-chain service and deploying the cross-chain service in the relay chain for which the cross-chain service does not exist comprises:
for each relay chain in the relay chains for which the cross-chain service is not published by the application chain, performing the following:
determining whether the cross-chain service exists in a cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service;
in response to determining that the cross-chain service does not exist in the relay chain, deploying the cross-chain service in the relay chain.
3. The method of claim 2, wherein the deploying the cross-chain service in the relay chain in response to determining that the cross-chain service is not present in the relay chain comprises:
in response to determining that the cross-chain service does not exist in the relay chain, determining an event type of the cross-chain service;
and deploying the cross-chain service in the relay chain according to an interface corresponding to the event type and provided by a cross-chain service management contract of the relay chain.
4. The method of claim 2, wherein the determining whether the cross-chaining service exists in a cross-chaining service management contract corresponding to the relay chain according to the metadata of the cross-chaining service comprises:
determining an offset of the cross-chain service, wherein the offset is used for representing a block height or an event sequence number corresponding to the cross-chain service;
determining a maximum offset for an existing cross-chain service in the relay chain;
and in response to determining that the offset of the cross-chain service is greater than the maximum offset, determining whether the cross-chain service exists in a cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service.
5. The method of claim 4, further comprising:
and updating the maximum offset of the existing cross-chain service in the relay chain as the offset of the cross-chain service.
6. The method of claim 1, further comprising:
in response to determining that a newly added relay link exists in the relay link set, determining existing cross-link services in relay links in the relay link set except for the newly added relay link;
and registering the existing cross-link service corresponding to the relay link set to the newly added relay link.
7. The method of claim 6, wherein the determining an existing cross-link service in a relay link in the set of relay links comprises:
for each relay chain in the relay chain set, determining metadata of an existing cross-chain service in the relay chain;
and determining the existing cross-link service in the relay chain with the most metadata as the existing cross-link service corresponding to the relay chain set.
8. The method of claim 1, wherein the distributing the cross-chain service to relay chain clients of relay chains in a relay chain set other than the target relay chain comprises:
and distributing the cross-chain service and the interface document representing the interface information of the cross-chain service to the relay chain clients of the relay chains in the relay chain set except the target relay chain.
9. A blockchain cross-chain service management apparatus, comprising:
a distribution unit configured to distribute a cross-chain service to relay chain clients of relay chains in a relay chain set except a target relay chain through a relay chain client of the target relay chain in response to a presence application chain publishing the cross-chain service onto the target relay chain;
a determining unit, configured to compare, for each relay chain client corresponding to the relay chain set, a relay chain identifier of a relay chain corresponding to the relay chain client with a relay chain identifier in the cross-chain service, and determine a relay chain of the cross-chain service that is not published by the application chain;
a deployment unit configured to determine that no relay chain of the cross-chain service exists in the relay chain of the cross-chain service which is not published by the application chain, and deploy the cross-chain service in the relay chain of the cross-chain service which does not exist.
10. The apparatus of claim 9, wherein the deployment unit is further configured to:
for each relay chain in the relay chains for which the cross-chain service is not published by the application chain, performing the following:
determining whether the cross-chain service exists in a cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service; in response to determining that the cross-chain service does not exist in the relay chain, deploying the cross-chain service in the relay chain.
11. The apparatus of claim 10, wherein the deployment unit is further configured to:
in response to determining that the cross-chain service does not exist in the relay chain, determining an event type of the cross-chain service; and deploying the cross-chain service in the relay chain according to an interface corresponding to the event type and provided by a cross-chain service management contract of the relay chain.
12. The apparatus of claim 10, wherein the deployment unit is further configured to:
determining an offset of the cross-chain service, wherein the offset is used for representing a block height or an event sequence number corresponding to the cross-chain service; determining a maximum offset for an existing cross-chain service in the relay chain; and in response to determining that the offset of the cross-chain service is greater than the maximum offset, determining whether the cross-chain service exists in a cross-chain service management contract corresponding to the relay chain according to the metadata of the cross-chain service.
13. The apparatus of claim 12, further comprising:
an updating unit configured to update a maximum offset of an existing cross-chain service in the relay chain to an offset of the cross-chain service.
14. The apparatus of claim 9, further comprising:
a registering unit configured to determine existing cross-link services in relay links except for a newly added relay link in the relay link set in response to determining that the newly added relay link exists in the relay link set; and registering the existing cross-link service corresponding to the relay link set to the newly added relay link.
15. The apparatus of claim 14, wherein the registration unit is further configured to:
for each relay chain in the relay chain set, determining metadata of an existing cross-chain service in the relay chain; and determining the existing cross-link service in the relay chain with the most metadata as the existing cross-link service corresponding to the relay chain set.
16. The apparatus of claim 9, wherein the distribution unit is further configured to:
and distributing the cross-chain service and the interface document representing the interface information of the cross-chain service to the relay chain clients of the relay chains in the relay chain set except the target relay chain.
17. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-8.
18. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method recited in any of claims 1-8.
CN202110539297.9A 2021-05-18 2021-05-18 Block chain cross-chain service management method and device Pending CN115442420A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110539297.9A CN115442420A (en) 2021-05-18 2021-05-18 Block chain cross-chain service management method and device
PCT/CN2022/088745 WO2022242425A1 (en) 2021-05-18 2022-04-24 Blockchain cross-chain service management method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110539297.9A CN115442420A (en) 2021-05-18 2021-05-18 Block chain cross-chain service management method and device

Publications (1)

Publication Number Publication Date
CN115442420A true CN115442420A (en) 2022-12-06

Family

ID=84141103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110539297.9A Pending CN115442420A (en) 2021-05-18 2021-05-18 Block chain cross-chain service management method and device

Country Status (2)

Country Link
CN (1) CN115442420A (en)
WO (1) WO2022242425A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116827957B (en) * 2023-08-30 2023-11-07 腾讯科技(深圳)有限公司 Information processing method, device, equipment and medium based on multi-block chain

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110443704B (en) * 2019-06-28 2021-02-19 创新先进技术有限公司 Method and device for sending resources in cross-link mode
CN111666325B (en) * 2020-05-18 2024-04-19 国网浙江省电力有限公司 Cross-link-port calling validity verification method
CN112446785B (en) * 2020-11-06 2023-09-22 杭州趣链科技有限公司 Cross-chain transaction method, system, device, equipment and storage medium
CN112330326B (en) * 2020-11-27 2023-06-30 中国农业银行股份有限公司 Business processing method and device applied to bank transaction blockchain system

Also Published As

Publication number Publication date
WO2022242425A1 (en) 2022-11-24

Similar Documents

Publication Publication Date Title
CN108846753B (en) Method and apparatus for processing data
CN109697075A (en) File updating method, system and device
CN109582873B (en) Method and device for pushing information
CN109359194B (en) Method and apparatus for predicting information categories
CN112860451A (en) Multi-tenant data processing method and device based on SaaS
CN107104999B (en) Method and device for processing service interface call request
CN110098998B (en) Method and apparatus for processing information
US10055393B2 (en) Distributed version control of orchestration templates
CN111198751A (en) Service processing method and device
CN109104368B (en) Connection request method, device, server and computer readable storage medium
CN111800513A (en) Method and device for pushing information and computer readable medium of electronic equipment
CN107347093B (en) Configuration method and device for distributed server system
CN112817562A (en) Service processing method and device
CN108959102B (en) Method and device for generating test data and testing application to be tested
CN110223179A (en) The data processing method of fund, device, system, medium
CN115442420A (en) Block chain cross-chain service management method and device
CN114064172A (en) Data rendering method and device
CN112948498A (en) Method and device for generating global identification of distributed system
CN111125503B (en) Method and apparatus for generating information
CN111209311A (en) Method and apparatus for processing data
US11614981B2 (en) Handling of metadata for microservices processing
CN110083283B (en) Method, device and system for managing information
CN110971664B (en) Interface service management system
CN111010449B (en) Image information output method, system, device, medium, and electronic apparatus
CN113592646A (en) Intelligent contract execution method, device and system

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