Cross-chain event delivery method, system and device and electronic equipment

By using the gateway plug-in to acquire and compare cross-chain events in a cross-chain gateway, the problem of cross-chain events being lost during network jitter or flash breaks is solved, and reliable delivery of cross-chain events and efficiency guarantee of cross-chain interaction is achieved.

CN119603187APending Publication Date: 2025-03-11AISINO CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411655588.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

When cross-chain events are sent from the application chain to the cross-chain gateway, messages are lost due to network jitter or flash breaks, which in turn leads to cross-chain interaction failure. How to ensure the reliability of cross-chain event delivery has become a key issue.

Method used

By using the gateway plug-in in the cross-chain gateway, you can obtain cross-chain events from the application chain and compare them with historical cross-chain event records. If the event is not recorded, it is recorded and forwarded to the target chain gateway to ensure reliable delivery of the event.

Benefits of technology

It improves the reliability of application chain delivery of cross-chain events, ensuring that missing events can still be recorded and delivered during network jitter or flash breaks, thereby ensuring the efficiency of cross-chain interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603187A_ABST
    Figure CN119603187A_ABST
Patent Text Reader

Abstract

The invention provides a cross-chain event delivery method, system and device and electronic equipment, and the method is applied to a cross-chain gateway, and comprises the steps: obtaining a cross-chain event from an application chain through a gateway plug-in; comparing the cross-chain event with a historical cross-chain event record; and if the cross-chain event is not recorded in the historical cross-chain event record, recording the cross-chain event in the historical cross-chain event record, and forwarding the cross-chain event to a target chain gateway.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a method, system, device and electronic device for delivering cross-chain events. Background Art

[0002] Blockchain technology has unique technical features such as decentralization, openness, immutability, autonomy, and anonymity. It has been widely used in many fields such as finance, transportation, health care, supply, and industrial Internet.

[0003] Due to the various types of blockchain networks, each network has its own ledger, consensus mechanism and smart contract platform, which limits the interoperability of data between these networks. Users and enterprises increasingly need to transfer assets, share information and execute cross-chain contracts between different blockchains. This demand has promoted the development of cross-chain interaction technology. At present, the mainstream cross-chain technologies include notaries, relay chains, side chains, etc. Cross-chain transaction execution requires interoperability between two blockchain networks. Inter-chain messaging is the basic element of cross-chain interaction. When cross-chain events are sent from the application chain to the cross-chain gateway, once the network jitters or the network is disconnected, the message will be lost, which will eventually lead to the failure of cross-chain interaction. How to ensure the reliability of cross-chain event delivery has become a key part of cross-chain interaction and transaction control. Summary of the invention

[0004] The embodiments of the present application provide a method, system, device and electronic device for delivering cross-chain events, which are used to improve the reliability of application chain delivering cross-chain events and ensure the efficiency of subsequent cross-chain interactions. The relevant technical solutions of the embodiments of the present application are as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for delivering a cross-chain event, which is applied to a cross-chain gateway, including:

[0006] Obtain cross-chain events from the application chain through the gateway plug-in;

[0007] Compare the cross-chain event with historical cross-chain event records;

[0008] If the cross-chain event is not recorded in the historical cross-chain event record, the cross-chain event is recorded in the historical cross-chain event record, and the cross-chain event is forwarded to the target chain gateway.

[0009] In one possible implementation, obtaining the cross-chain event from the application chain through the gateway plug-in includes:

[0010] The application chain is monitored by the gateway plug-in, and the nodes of the application chain are actively polled to determine the incremental blocks other than the blocks that have been checked from the corresponding blocks of the nodes;

[0011] The incremental block is parsed to obtain the cross-chain event.

[0012] In one possible implementation, monitoring the application chain through the gateway plug-in, actively polling the nodes of the application chain, and determining the incremental blocks other than the checked blocks from the corresponding blocks of the nodes, including:

[0013] Registering a monitoring mechanism at the node of the application chain through the gateway plug-in and monitoring the application chain;

[0014] Receive a query request from the gateway plug-in, and return the checked block number queried based on the query request to the gateway plug-in, so that the gateway plug-in queries the blocks of the specified block number range determined based on the checked block number and a preset query step from the corresponding blocks of the node; the specified block number range is the block number range between the checked block number and the target block number, and the target block number is the sum of the checked block number and the preset query step; the block corresponding to the checked block number is the checked block;

[0015] The blocks in the specified block number range returned by the application chain are received through the gateway plug-in, and the blocks in the specified block number range are used as the incremental blocks.

[0016] In one possible implementation, after comparing the cross-chain event with the historical cross-chain event record, the method further includes:

[0017] If the cross-chain event matches one of the events in the historical cross-chain event record, the cross-chain event is identified as a redundant cross-chain event and the redundant cross-chain event is discarded.

[0018] In a second aspect, an embodiment of the present application provides a cross-chain event delivery system, including:

[0019] An application chain, a cross-chain gateway, a gateway plug-in that is communicatively connected to the application chain and the cross-chain gateway, and a target chain gateway that is communicatively connected to the cross-chain gateway; wherein:

[0020] The gateway plug-in is configured to obtain cross-chain events from the application chain;

[0021] The cross-chain gateway is configured to compare the cross-chain event with the historical cross-chain event record; if the cross-chain event is not recorded in the historical cross-chain event record, the cross-chain event is recorded in the historical cross-chain event record, and the cross-chain event is forwarded to the target chain gateway;

[0022] The target chain gateway is configured to receive the cross-chain event.

[0023] In one possible implementation, the cross-chain gateway is further configured as follows:

[0024] The application chain is monitored by the gateway plug-in, and the nodes of the application chain are actively polled to determine the incremental blocks other than the blocks that have been checked from the corresponding blocks of the nodes;

[0025] The incremental block is parsed to obtain the cross-chain event.

[0026] In one possible implementation, the cross-chain gateway is further configured as follows:

[0027] Registering a monitoring mechanism at the node of the application chain through the gateway plug-in and monitoring the application chain;

[0028] Receive a query request from the gateway plug-in, and return the checked block number queried based on the query request to the gateway plug-in, so that the gateway plug-in queries the blocks of the specified block number range determined based on the checked block number and a preset query step from the corresponding blocks of the node; the specified block number range is the block number range between the checked block number and the target block number, and the target block number is the sum of the checked block number and the preset query step; the block corresponding to the checked block number is the checked block;

[0029] The blocks in the specified block number range returned by the application chain are received through the gateway plug-in, and the blocks in the specified block number range are used as the incremental blocks.

[0030] In one possible implementation, after the cross-chain gateway compares the cross-chain event with the historical cross-chain event record, the cross-chain gateway is further configured to:

[0031] If the cross-chain event matches one of the events in the historical cross-chain event record, the cross-chain event is identified as a redundant cross-chain event and the redundant cross-chain event is discarded.

[0032] In a third aspect, an embodiment of the present application provides a cross-chain event delivery device, which is applied to a cross-chain gateway, including:

[0033] The acquisition unit is used to obtain cross-chain events from the application chain through the gateway plug-in;

[0034] A comparison unit, used to compare the cross-chain event with historical cross-chain event records;

[0035] A processing unit is used to record the cross-chain event in the historical cross-chain event record if the cross-chain event is not recorded in the historical cross-chain event record, and forward the cross-chain event to the target chain gateway.

[0036] In one possible implementation manner, the acquiring unit is specifically configured to:

[0037] The application chain is monitored by the gateway plug-in, and the nodes of the application chain are actively polled to determine the incremental blocks other than the blocks that have been checked from the corresponding blocks of the nodes;

[0038] The incremental block is parsed to obtain the cross-chain event.

[0039] In one possible implementation manner, the acquiring unit is specifically configured to:

[0040] Registering a monitoring mechanism at the node of the application chain through the gateway plug-in and monitoring the application chain;

[0041] Receive a query request from the gateway plug-in, and return the checked block number queried based on the query request to the gateway plug-in, so that the gateway plug-in queries the blocks of the specified block number range determined based on the checked block number and a preset query step from the corresponding blocks of the node; the specified block number range is the block number range between the checked block number and the target block number, and the target block number is the sum of the checked block number and the preset query step; the block corresponding to the checked block number is the checked block;

[0042] The blocks in the specified block number range returned by the application chain are received through the gateway plug-in, and the blocks in the specified block number range are used as the incremental blocks.

[0043] In one possible implementation, after the comparison unit compares the cross-chain event with the historical cross-chain event record, the processing unit is further configured to:

[0044] If the cross-chain event matches one of the events in the historical cross-chain event record, the cross-chain event is identified as a redundant cross-chain event and the redundant cross-chain event is discarded.

[0045] In a fourth aspect, an embodiment of the present application further provides an electronic device, including:

[0046] Memory, used to store computer programs;

[0047] The processor is used to implement the method steps described in any one of the above items when executing the computer program stored in the memory.

[0048] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute the method steps described in any one of the above items.

[0049] In a sixth aspect, an embodiment of the present application further provides a computer program product, which includes: a computer program code, and when the computer program code runs on a computer, the computer executes any of the methods described above.

[0050] The beneficial effects of the embodiments of the present application are as follows:

[0051] The embodiments of the present application provide a method, system, device and electronic device for delivering a cross-chain event. First, the cross-chain gateway obtains the cross-chain event from the application chain through the gateway plug-in; then, the cross-chain event is compared with the historical cross-chain event record; if the cross-chain event is not recorded in the historical cross-chain event record, the cross-chain event is recorded in the historical cross-chain event record, and the cross-chain event is forwarded to the target chain gateway. In other words, the cross-chain event that has not been recorded can be recorded and recorded through the cross-chain gateway. In this way, the reliability of the cross-chain events missed due to network jitter or network disconnection can still be delivered to the cross-chain gateway, thereby improving the reliability of the application chain delivering cross-chain events and ensuring the efficiency of subsequent cross-chain interactions. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 A schematic diagram of one of the structures of a plug-in connection mechanism through a gateway plug-in in a method for delivering a cross-chain event provided in an embodiment of the present application;

[0053] Figure 2 A flow chart of one of the methods for delivering cross-chain events provided in an embodiment of the present application;

[0054] Figure 3 for Figure 2 A method flow chart of step S101 in FIG.

[0055] Figure 4 for Figure 3 A method flow chart of step S201;

[0056] Figure 5 A schematic diagram of the execution of the checkpoint mechanism based on the cross-chain event delivery method provided in an embodiment of the present application;

[0057] Figure 6 A schematic diagram of one structure of a cross-chain event delivery system provided in an embodiment of the present application;

[0058] Figure 7 A schematic diagram of one structure of a cross-chain event delivery device provided in an embodiment of the present application;

[0059] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0061] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0062] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0063] In the technical solution of this application, the acquisition, transmission, storage, and use of data are in compliance with the requirements of relevant national laws and regulations.

[0064] Before introducing the cross-chain event delivery method provided in the embodiment of the present application, for ease of understanding, the technical background of the embodiment of the present application is briefly described below.

[0065] The cross-chain interaction process is generally carried out by application chains, cross-chain gateways, cross-chain contracts, relay chains, etc. to exchange information and control transactions between chains. In order to ensure the reliability of cross-chain interaction processing, the routing and delivery process of cross-chain events should ensure reliability.

[0066] In the related technologies, the cross-chain gateway technology does not explain how to reliably deliver the cross-chain events of the blockchain to the cross-chain gateway in the cross-chain interaction. In this case, in the case of network jitter or flash interruption, it is very easy to cause the loss of cross-chain events, and ultimately lead to the failure of cross-chain interaction.

[0067] In view of this, the present application provides a method, system, device and electronic device for delivering a cross-chain event, which are used to improve the reliability of cross-chain event delivery to a cross-chain gateway.

[0068] In order to more clearly illustrate the specific implementation process of the cross-chain event delivery method of the embodiment of the present application, Figure 1 As shown, the plug-in connection mechanism of the embodiment of the present application through the gateway plug-in 10 is explained. Among them, the gateway plug-in 10 is respectively connected to the application chain 11 and the cross-chain gateway 12 (i.e., the application chain gateway). The gateway plug-in 10 is a plug-in developed by the inventor based on an open connection method (SDK) provided by the application chain 11 to the outside. In one of the exemplary embodiments, the gateway plug-in 10 is integrated in the cross-chain gateway 12. In one of the exemplary embodiments, the gateway plug-in 10 can also be independently set between the cross-chain gateway 12. In the specific implementation process, the cross-chain gateway 12 can be connected to the application chain 11 and message interaction through the gateway plug-in 10. Accordingly, the embodiment of the present application provides a plug-in mechanism for a cross-chain gateway 12, through which the application chain 11 and the cross-chain gateway 12 can be connected. The gateway plug-in 10 can obtain cross-chain events through two mechanisms: an event monitoring mechanism and a checkpoint mechanism. Among them, cross-chain events from the application chain 11 can be obtained through event monitoring, and missed cross-chain events can be screened out through the checkpoint mechanism. In other words, the checkpoint mechanism serves as a supplementary guarantee mechanism for event monitoring, ensuring that cross-chain events missed in event monitoring can also be obtained by the gateway plug-in 10.

[0069] In addition, the cross-chain event in the embodiment of the present application is actually generated by the cross-chain contract 13. Specifically, in the process of executing the cross-chain, the cross-chain contract 13 and the cross-chain gateway 12 are required to help the application chain 11 complete the cross-chain; first, call the cross-chain contract 13; then, call the business contract 14 through the cross-chain contract 13; then, generate the cross-chain event through the cross-chain contract 13.

[0070] like Figure 2 As shown, the embodiment of the present application provides a method for delivering a cross-chain event, which is applied to a cross-chain gateway, including:

[0071] S101: Obtain cross-chain events from the application chain through the gateway plug-in;

[0072] In the specific implementation process, the gateway plug-in can be integrated into the cross-chain gateway, and the gateway plug-in can also be set independently from the cross-chain gateway. In the cross-chain process, a cross-chain event is generated through a cross-chain contract. The application chain can obtain the cross-chain event. The gateway plug-in obtains the cross-chain event by monitoring the application chain.

[0073] S102: Compare the cross-chain event with historical cross-chain event records;

[0074] In the specific implementation process, the cross-chain gateway compares the obtained cross-chain event with the historical cross-chain event record. Among them, the historical cross-chain event record is stored in the cross-chain gateway. Exemplarily, the historical cross-chain event record includes a record for at least one cross-chain event.

[0075] S103: If the cross-chain event is not recorded in the historical cross-chain event record, the cross-chain event is recorded in the historical cross-chain event record, and the cross-chain event is forwarded to the target chain gateway.

[0076] In the specific implementation process, if the cross-chain event is not recorded in the historical cross-chain event record, that is, the cross-chain event cannot be found in the historical cross-chain event record. In this case, the cross-chain event can be recorded in the historical cross-chain event record and forwarded to the target chain gateway. In this way, when the cross-chain event is missed due to network jitter or network disconnection, the missed event can still be recorded and forwarded to the target chain gateway, thereby improving the reliability of the cross-chain event delivery to the cross-chain gateway, and then ensuring the successful implementation of the cross-chain interaction.

[0077] In the embodiments of the present application, Figure 3 As shown, step S101: obtaining cross-chain events from the application chain through the gateway plug-in, including:

[0078] S201: monitoring the application chain through the gateway plug-in, actively polling the nodes of the application chain, and determining the incremental blocks other than the checked blocks from the corresponding blocks of the nodes;

[0079] S202: Parse the incremental block to obtain the cross-chain event.

[0080] In the specific implementation process, the specific implementation process of step S201 to step S202 is as follows:

[0081] First, the application chain is monitored through the gateway plug-in, and the nodes of the application chain are actively polled; the incremental blocks other than the blocks that have been checked are determined from the corresponding blocks of the nodes. Exemplarily, the gateway plug-in can monitor the application chain through the event monitoring mechanism. In the specific implementation process of obtaining cross-chain events from the application chain through the event monitoring mechanism, the application chain can save the cross-chain events in the form of receipts (Recipt) in the block (Block), and the gateway plug-in obtains the corresponding cross-chain events by parsing the Recipt of the block. In addition, the gateway plug-in can register cross-chain event monitoring on the nodes of the application chain, thereby ensuring that the gateway plug-in can obtain the cross-chain events of the application chain in real time.

[0082] Exemplarily, while the gateway plug-in monitors the application chain through the event monitoring mechanism, it can also screen out the events missed in the event monitoring through the checkpoint mechanism. Among them, the checkpoint mechanism is a supplementary mechanism for cross-chain event monitoring, and can actively perform incremental checks on the cross-chain events of the application chain through active polling. Specifically, the gateway plug-in can query and analyze the cross-chain events in the corresponding blocks of the nodes by actively polling the nodes of the application chain, and mark the checked blocks by recording savepoints. In this way, the cross-chain gateway can determine the incremental blocks other than the checked blocks from the corresponding blocks of the nodes of the application chain; the incremental blocks can be parsed later to obtain cross-chain events. Among them, since only the incremental blocks other than the checked blocks are checked, efficient screening of events missed in the screening event monitoring is achieved. In addition, since the entire processing process does not increase the additional write operations of the application chain, the application chain that requires GAS for write operations can avoid more GAS fees.

[0083] In the embodiments of the present application, Figure 4 As shown, step S201: monitoring the application chain through the gateway plug-in, actively polling the nodes of the application chain, and determining the incremental blocks other than the checked blocks from the corresponding blocks of the nodes, including:

[0084] S301: registering a monitoring mechanism at a node of the application chain through the gateway plug-in, and monitoring the application chain;

[0085] S302: receiving a query request from the gateway plug-in, and returning the checked block number queried based on the query request to the gateway plug-in, so that the gateway plug-in queries the blocks of the specified block number range determined based on the checked block number and the preset query step from the corresponding blocks of the node; the specified block number range is the block number range between the checked block number and the target block number, and the target block number is the sum of the checked block number and the preset query step; the block corresponding to the checked block number is the checked block;

[0086] S303: Receive the blocks in the specified block number range returned by the application chain through the gateway plug-in, and use the blocks in the specified block number range as the incremental blocks.

[0087] In the specific implementation process, the specific implementation process of step S301 to step S303 is as follows:

[0088] The gateway plug-in registers a monitoring mechanism in the node of the application chain and monitors the application chain, so that the cross-chain gateway can obtain the cross-chain events of the application chain in real time through the gateway plug-in. Specifically, the cross-chain gateway receives a query request from the gateway plug-in, and determines the checked block number based on the query request; then, the checked block number is returned to the gateway plug-in. In this way, the gateway plug-in can query the blocks of the specified block number range determined based on the checked block number and the preset query step from the corresponding blocks of the node of the application chain. Among them, the preset query step is a step pre-set according to the actual application needs, and is not limited here. The specified block number range is the block number range between the checked block number and the target block number, and the target block number is the sum of the checked block number and the preset query step. Exemplarily, if the checked block number is point and the preset query step is x, the target block number is (point+x), and the specified block number range is the block number corresponding to point to (point+x). The block corresponding to the checked block number is the checked block. Exemplarily, savepoint can be used to mark the checked blocks. After the gateway plug-in queries the blocks in the specified block number range, the application chain returns the blocks in the specified block number range to the gateway plug-in, that is, returns the incremental blocks to the gateway plug-in. In this way, the gateway plug-in can screen the cross-chain events in the incremental blocks, providing a guarantee for subsequent cross-chain interactions.

[0089] In the embodiment of the present application, after step S102: comparing the cross-chain event with the historical cross-chain event record, the method further includes:

[0090] If the cross-chain event matches one of the events in the historical cross-chain event record, the cross-chain event is identified as a redundant cross-chain event and the redundant cross-chain event is discarded.

[0091] In the specific implementation process, after comparing the cross-chain event with the historical cross-chain event record, if the cross-chain event matches one of the events in the historical cross-chain event record, that is, the cross-chain event has been recorded in the historical cross-chain event record, the cross-chain event will be identified as a redundant cross-chain event and discarded. In this way, the efficiency of cross-chain interaction is improved.

[0092] Combine the following Figure 5 The execution diagram based on the checkpoint mechanism shown in FIG. 1 is used to explain in detail the specific implementation process of the cross-chain event delivery method provided in the embodiment of the present application:

[0093] S1: query the current checked block number; illustratively, mark the current checked block number as point;

[0094] S2: Returns the current checked block number; illustratively, returns the current point;

[0095] S3: Query blocks in a specified block number range; illustratively, the specified block number range is the block number corresponding to point to (point+x), where x represents a preset query step length;

[0096] S4: Returns the blocks in the specified block number range;

[0097] S5: Parse cross-chain events in blocks within a specified block number range;

[0098] S6: Send cross-chain events to the cross-chain gateway;

[0099] S7: Filter out unrecorded cross-chain events;

[0100] S8: Record unrecorded cross-chain events; accordingly, mark the blocks in the specified block number range as checked blocks, and use the block numbers corresponding to the specified block number range as checked block numbers;

[0101] S9: Send unrecorded cross-chain events to the target chain gateway;

[0102] It should be noted that after executing step S8, the following steps may also be performed:

[0103] S10: Update the current checked block number; illustratively, update the current checked block number to (point+x).

[0104] Based on the same inventive concept, Figure 6As shown, the embodiment of the present application also provides a cross-chain event delivery system, including:

[0105] An application chain 11, a cross-chain gateway 12, a gateway plug-in 10 respectively connected to the application chain 11 and the cross-chain gateway 12, and a target chain gateway 15 connected to the cross-chain gateway 12; wherein:

[0106] The gateway plug-in 10 is configured to obtain cross-chain events from the application chain 11;

[0107] The cross-chain gateway 12 is configured to compare the cross-chain event with the historical cross-chain event record; if the cross-chain event is not recorded in the historical cross-chain event record, the cross-chain event is recorded in the historical cross-chain event record, and the cross-chain event is forwarded to the target chain gateway 15;

[0108] The target chain gateway 15 is configured to receive the cross-chain event.

[0109] Of course, the cross-chain event delivery system provided in the embodiment of the present application also includes a cross-chain contract 13 for generating cross-chain events, and a business contract 14 that interacts with the cross-chain contract 13.

[0110] In addition, in one of the exemplary embodiments, taking the cross-chain interaction scenario of direct connection through the cross-chain gateway 12 as an example, the target chain gateway 15 is directly connected to the cross-chain gateway 12, and the delivery system also includes another application chain that is communicatively connected to the target chain gateway 15; in this way, the cross-chain event can interact cross-chain with another application chain through the application chain.

[0111] In one of the exemplary embodiments, taking the cross-chain interaction scenario through the relay chain as an example, the delivery system also includes a relay chain that is communicatively connected to the cross-chain gateway 12, and another application chain that is communicatively connected to the target chain gateway 15; wherein the target chain gateway 15 is communicatively connected to the relay chain; in this way, cross-chain events can be used to perform cross-chain interactions between the application chain and another application chain through the relay chain.

[0112] Of course, the specific implementation process of each module in the delivery system can refer to the description of the aforementioned relevant parts, and will not be repeated here. Of course, the delivery system of the embodiment of the present application can also be set according to actual application needs, and will not be limited here.

[0113] Based on the same inventive concept, Figure 7 As shown, the embodiment of the present application provides a cross-chain event delivery device, which is applied to a cross-chain gateway, including:

[0114] An acquisition unit 20 is used to acquire cross-chain events from the application chain through a gateway plug-in;

[0115] A comparison unit 21, used to compare the cross-chain event with the historical cross-chain event record;

[0116] The processing unit 22 is used to record the cross-chain event in the historical cross-chain event record if the cross-chain event is not recorded in the historical cross-chain event record, and forward the cross-chain event to the target chain gateway.

[0117] In the embodiment of the present application, the acquisition unit 20 is specifically used for:

[0118] The application chain is monitored by the gateway plug-in, and the nodes of the application chain are actively polled to determine the incremental blocks other than the blocks that have been checked from the corresponding blocks of the nodes;

[0119] The incremental block is parsed to obtain the cross-chain event.

[0120] In the embodiment of the present application, the acquisition unit 20 is specifically used for:

[0121] Registering a monitoring mechanism at the node of the application chain through the gateway plug-in and monitoring the application chain;

[0122] Receive a query request from the gateway plug-in, and return the checked block number queried based on the query request to the gateway plug-in, so that the gateway plug-in queries the blocks of the specified block number range determined based on the checked block number and a preset query step from the corresponding blocks of the node; the specified block number range is the block number range between the checked block number and the target block number, and the target block number is the sum of the checked block number and the preset query step; the block corresponding to the checked block number is the checked block;

[0123] The blocks in the specified block number range returned by the application chain are received through the gateway plug-in, and the blocks in the specified block number range are used as the incremental blocks.

[0124] In the embodiment of the present application, after the comparison unit 21 compares the cross-chain event with the historical cross-chain event record, the processing unit 22 is further configured to:

[0125] If the cross-chain event matches one of the events in the historical cross-chain event record, the cross-chain event is identified as a redundant cross-chain event and the redundant cross-chain event is discarded.

[0126] Based on the same inventive concept, an electronic device is also provided in the embodiment of the present application, and the electronic device can realize the function of the aforementioned delivery device, referring to Figure 8 , the electronic device comprises:

[0127] Memory 100, used for storing computer programs;

[0128] The processor 200 is used to implement the steps of the cross-chain event delivery method as described in any of the above items when executing the computer program stored in the memory.

[0129] The specific connection medium between the processor 200 and the memory 100 is not limited in the embodiment of the present application. Figure 8 In the example, the processor 200 and the memory 100 are connected via the bus 300. The bus 300 is connected to the memory 100 via the bus 300. Figure 8 The bus 300 is represented by a bold line, and the connection between other components is only for schematic illustration and is not intended to be limiting. The bus 300 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the figure, but it does not mean that there is only one bus 300 or one type of bus 300. Alternatively, the processor 200 may also be called a controller, and there is no limitation on the name.

[0130] In the embodiment of the present application, the memory 100 stores instructions that can be executed by the processor 200. When the processor 200 executes the computer program stored in the memory 100, the cross-chain event delivery method discussed above can be executed. The processor 200 can implement Figure 8 The functions of each module are shown in the figure.

[0131] Among them, the processor 200 is the control center of the device, and can use various interfaces and lines to connect various parts of the entire control device, and through running or executing computer programs stored in the memory 100 and calling data stored in the memory 100, the various functions of the device and process data, thereby monitoring the device as a whole.

[0132] In one possible design, the processor 200 may include one or more processing units, and the processor 200 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. In some embodiments, the processor 200 and the memory 100 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.

[0133] The memory 100, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 100 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. Alternatively, the memory 100 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 100 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0134] By designing and programming the processor, the code corresponding to the cross-chain event delivery method described in the above embodiment can be fixed into the chip, so that the chip can execute the steps of the cross-chain event delivery method discussed above when running. How to design and program the processor is a technology well known to those skilled in the art and will not be described here.

[0135] Based on the same inventive concept, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and the computer program is used to enable a computer to execute the steps of the cross-chain event delivery method discussed above.

[0136] In some possible implementations, various aspects of the cross-chain event-based delivery method provided in the present application can also be implemented in the form of a program product, which includes a program code. When the program product is run on the device, the program code is used to enable the control device to execute the steps of the cross-chain event delivery method according to various exemplary embodiments of the present application described above in this specification.

[0137] The embodiments of the present application provide a method, system, device and electronic device for delivering a cross-chain event. First, the cross-chain gateway obtains the cross-chain event from the application chain through the gateway plug-in; then, the cross-chain event is compared with the historical cross-chain event record; if the cross-chain event is not recorded in the historical cross-chain event record, the cross-chain event is recorded in the historical cross-chain event record, and the cross-chain event is forwarded to the target chain gateway. In other words, the cross-chain event that has not been recorded can be recorded and recorded through the cross-chain gateway. In this way, the reliability of the cross-chain events missed due to network jitter or network disconnection can still be delivered to the cross-chain gateway, thereby improving the reliability of the application chain delivering cross-chain events and ensuring the efficiency of subsequent cross-chain interactions.

[0138] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0139] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0140] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0141] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0142] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A cross-chain event delivery method, applied to a cross-chain gateway, characterized in that: include: Obtain cross-chain events from the application chain through the gateway plug-in; Compare the cross-chain event with historical cross-chain event records; If the cross-chain event is not recorded in the historical cross-chain event record, the cross-chain event is recorded in the historical cross-chain event record, and the cross-chain event is forwarded to the target chain gateway.

2. The method according to claim 1, characterized in that The cross-chain events obtained from the application chain through the gateway plug-in include: The application chain is monitored by the gateway plug-in, and the nodes of the application chain are actively polled to determine the incremental blocks other than the blocks that have been checked from the corresponding blocks of the nodes; The incremental block is parsed to obtain the cross-chain event.

3. The method according to claim 2, characterized in that The method of monitoring the application chain through the gateway plug-in and actively polling the nodes of the application chain to determine the incremental blocks other than the checked blocks from the corresponding blocks of the nodes includes: Registering a monitoring mechanism at the node of the application chain through the gateway plug-in and monitoring the application chain; Receive a query request from the gateway plug-in, and return the checked block number queried based on the query request to the gateway plug-in, so that the gateway plug-in queries the blocks of the specified block number range determined based on the checked block number and a preset query step from the corresponding blocks of the node; the specified block number range is the block number range between the checked block number and the target block number, and the target block number is the sum of the checked block number and the preset query step; the block corresponding to the checked block number is the checked block; The blocks in the specified block number range returned by the application chain are received through the gateway plug-in, and the blocks in the specified block number range are used as the incremental blocks.

4. The method according to any one of claims 1 to 3, characterized in that: After comparing the cross-chain event with the historical cross-chain event records, the method further includes: If the cross-chain event matches one of the events in the historical cross-chain event record, the cross-chain event is identified as a redundant cross-chain event and the redundant cross-chain event is discarded.

5. A cross-chain event delivery system, characterized in that: include: An application chain, a cross-chain gateway, a gateway plug-in that is communicatively connected to the application chain and the cross-chain gateway, and a target chain gateway that is communicatively connected to the cross-chain gateway; wherein: The gateway plug-in is configured to obtain cross-chain events from the application chain; The cross-chain gateway is configured to compare the cross-chain event with the historical cross-chain event record; if the cross-chain event is not recorded in the historical cross-chain event record, the cross-chain event is recorded in the historical cross-chain event record, and the cross-chain event is forwarded to the target chain gateway; The target chain gateway is configured to receive the cross-chain event.

6. A cross-chain event delivery device, applied to a cross-chain gateway, characterized in that: include: The acquisition unit is used to obtain cross-chain events from the application chain through the gateway plug-in; A comparison unit, used to compare the cross-chain event with historical cross-chain event records; A processing unit is used to record the cross-chain event in the historical cross-chain event record if the cross-chain event is not recorded in the historical cross-chain event record, and forward the cross-chain event to the target chain gateway.

7. The device according to claim 6, characterized in that The acquisition unit is specifically used for: The application chain is monitored by the gateway plug-in, and the nodes of the application chain are actively polled to determine the incremental blocks other than the blocks that have been checked from the corresponding blocks of the nodes; The incremental block is parsed to obtain the cross-chain event.

8. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to implement the method steps as described in any one of claims 1 to 4 when executing the computer program stored in the memory.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute the method steps according to any one of claims 1 to 4.

10. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 4.