Request processing method and apparatus, storage medium, and electronic device

By splitting cross-chain operation requests into sub-transactions and performing signature verification and rollback processing, the problem of sub-transaction processing affecting reliability in cross-chain scenarios is solved, and the reliability and atomicity of cross-chain operations are guaranteed.

CN123184880APending Publication Date: 2026-11-27TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611222248.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-12
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In cross-chain scenarios, the independent processing of sub-transactions within cross-chain distributed transactions affects the reliability of cross-chain operations, a problem that existing technologies have not been able to effectively address.

Method used

Cross-chain operation requests are split into multiple sub-transactions, and each sub-transaction is signed to generate a cross-chain proof, which is then sent to the target blockchain for compliance verification. Upon successful verification, the execution result is sent, and upon failure, a rollback is performed to ensure the atomicity and reliability of cross-chain operations.

Benefits of technology

By effectively decomposing cross-chain distributed transactions, the reliability of the target blockchain executing sub-transactions is improved, the risk of data inconsistency between heterogeneous blockchains is reduced, and the reliability of cross-chain operations is guaranteed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123184880A_ABST
    Figure CN123184880A_ABST
Patent Text Reader

Abstract

The application discloses a request processing method and device, a storage medium and an electronic device. It relates to the field of blockchains. The method comprises the following steps: in the case that a cross-chain operation request of a source blockchain is received, the cross-chain operation request is split into multiple sub-transactions; each sub-transaction is signed to obtain a first cross-chain proof corresponding to each sub-transaction; the first cross-chain proof corresponding to each sub-transaction is sent to a target blockchain corresponding to the sub-transaction; in the case that a target sub-transaction in the multiple sub-transactions is successfully executed by the target blockchain, the execution results of all the sub-transactions are sent to the source blockchain and the multiple target blockchains respectively; in the case that there is a target sub-transaction that fails to be executed by the target blockchain, the multiple sub-transactions are rolled back. Through the application, the problem that the related art affects the reliability of cross-chain operations by independently processing the sub-transactions in cross-chain distributed transactions in a cross-chain scenario is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain, and more specifically, to a request processing method, apparatus, storage medium, and electronic device. Background Technology

[0002] With the large-scale deployment of blockchain technology in scenarios such as finance and supply chain, cross-system data interoperability and asset interoperability have become practical needs. However, different blockchains use different consensus mechanisms, smart contract models, and data encoding formats, making it impossible for chains to directly complete cross-chain transaction calls. Specialized cross-chain interoperability mechanisms are required.

[0003] Currently, the cross-chain interoperability mechanisms of related technologies process sub-transactions in cross-chain distributed transactions independently in cross-chain scenarios, ignoring the atomicity guarantee of cross-chain transactions, thus affecting the reliability of cross-chain operations.

[0004] There is currently no effective solution to the aforementioned problems in the relevant technologies. Summary of the Invention

[0005] The main objective of this application is to provide a request processing method, apparatus, storage medium, and electronic device to address the problem that related technologies in cross-chain scenarios independently process sub-transactions in cross-chain distributed transactions, thereby affecting the reliability of cross-chain operations.

[0006] To achieve the above objectives, according to one aspect of this application, a request processing method is provided. This method is applied to a cross-chain gateway node cluster and includes: upon receiving a cross-chain operation request from a source blockchain, splitting the cross-chain operation request into multiple sub-transactions, wherein the cross-chain operation request is used to request multiple target blockchains to perform a corresponding operation, and each sub-transaction is used to request one of the multiple target blockchains to perform the corresponding operation; signing each sub-transaction to obtain a first cross-chain proof corresponding to each sub-transaction; sending the first cross-chain proof corresponding to each sub-transaction to the target blockchain corresponding to that sub-transaction, wherein the target blockchain performs compliance verification on the first cross-chain proof, and if the compliance verification passes, the target blockchain executes the operation indicated by the sub-transaction; if it is determined that a target sub-transaction among the multiple sub-transactions has been successfully executed by the target blockchain, sending the execution results of all sub-transactions to the source blockchain and the multiple target blockchains respectively; if it is determined that a target sub-transaction has failed to be executed by the target blockchain, rolling back the multiple sub-transactions.

[0007] Optionally, the request processing method may further include: obtaining the request identifier in the cross-chain operation request; determining whether the cross-chain operation request is a processed or being processed request based on the request identifier; and if the cross-chain operation request is not a processed or being processed request, splitting the cross-chain operation request into multiple sub-transactions.

[0008] Optionally, the request processing method may further include: determining the chain identifier of the source blockchain to which the cross-chain operation request belongs and the contract name of the source blockchain contract to which the cross-chain operation request belongs; determining the processing queue to which the cross-chain operation request belongs based on the chain identifier and the contract name; and splitting the cross-chain operation request into multiple sub-transactions if the cross-chain operation request is at the head of the processing queue.

[0009] Optionally, the request processing method further includes: for each sub-transaction, generating first information based on the sub-transaction's execution status information, execution stage identifier, and transaction information; signing the first information using the private keys of each slave authentication node to obtain the signature value corresponding to each slave authentication node; generating a signature entry for the sub-transaction based on the signature value and identity identifier of the slave authentication node; and determining the first cross-chain proof corresponding to the sub-transaction through the master authentication node based on the generated signature entries corresponding to the sub-transaction if the number of generated signature entries for the sub-transaction is greater than or equal to a preset number.

[0010] Optionally, the request processing method further includes: generating second information based on the execution status information, completion stage identifier, and transaction information of all sub-transactions, wherein the execution status information is used to determine the execution result of the sub-transactions; signing the second information to obtain a second cross-chain proof; sending the second cross-chain proof to multiple target blockchains respectively; and sending the execution results of all sub-transactions to the source blockchain after determining that the compliance verification of the second cross-chain proof has passed by all target blockchains.

[0011] Optionally, the request processing method further includes: for each sub-transaction, generating third information based on the sub-transaction's execution status information, rollback phase identifier, and transaction information; signing the third information to obtain the third cross-chain proof corresponding to the sub-transaction; sending the third cross-chain proof corresponding to each sub-transaction to the target blockchain corresponding to the sub-transaction, wherein the target blockchain performs compliance verification on the third cross-chain proof, and if the compliance verification passes, the target blockchain performs a rollback operation.

[0012] Optionally, the request processing method further includes: after sending the execution results of all sub-transactions to the source blockchain and multiple target blockchains respectively, or after rolling back multiple sub-transactions, determining the request status of the cross-chain operation request through the master authentication node, wherein the request status is one of the following: processed, rolled back; and synchronizing the request status to multiple slave authentication nodes through the master authentication node.

[0013] To achieve the above objectives, according to another aspect of this application, a request processing apparatus is provided. The apparatus includes: a splitting module, configured to split a cross-chain operation request from a source blockchain into multiple sub-transactions upon receiving such a request, wherein the cross-chain operation request requests multiple target blockchains to perform a corresponding operation, and each sub-transaction requests one of the multiple target blockchains to perform the corresponding operation; a signing module, configured to sign each sub-transaction to obtain a first cross-chain proof corresponding to each sub-transaction; a first sending module, configured to send the first cross-chain proof corresponding to each sub-transaction to the target blockchain corresponding to that sub-transaction, wherein the target blockchain performs compliance verification on the first cross-chain proof, and if the compliance verification passes, the target blockchain executes the operation indicated by the sub-transaction; a second sending module, configured to send the execution results of all sub-transactions to the source blockchain and the multiple target blockchains respectively, if it is determined that a target sub-transaction among the multiple sub-transactions has been successfully executed by the target blockchain; and a first processing module, configured to roll back the multiple sub-transactions if it is determined that a target sub-transaction has failed to be executed by the target blockchain.

[0014] To achieve the above objectives, according to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the above-described request processing method.

[0015] To achieve the above objectives, according to another aspect of this application, an electronic device is provided, the electronic device including a memory storing an executable program; and a processor for running the program, wherein the program executes the above-described request processing method when it runs.

[0016] To achieve the above objectives, according to another aspect of this application, a computer program product is provided, including computer instructions that, when executed by a processor, implement the steps of the request processing method described above.

[0017] In this embodiment, upon receiving a cross-chain operation request from the source blockchain, the cross-chain operation request is split into multiple sub-transactions, thus achieving effective decomposition of the cross-chain distributed transaction. By sending the first cross-chain proof corresponding to each sub-transaction to the target blockchain corresponding to that sub-transaction, the reliability of the target blockchain executing the sub-transaction is improved. By retaining the execution result when it is determined that the target sub-transaction among the multiple sub-transactions is successfully executed by the target blockchain, and by performing a rollback when it is determined that the target sub-transaction is failed to be executed by the target blockchain, the risk of data inconsistency between heterogeneous blockchains is reduced, and the atomicity of cross-heterogeneous blockchain transactions is guaranteed, thereby improving the reliability of cross-chain operations.

[0018] Therefore, the method provided in this application achieves the goal of determining the processing mode of a cross-chain distributed transaction based on the execution status of multiple sub-transactions in the cross-chain distributed transaction, thereby improving the reliability of cross-chain operations and solving the technical problem that related technologies process sub-transactions in cross-chain distributed transactions independently in cross-chain scenarios, thus affecting the reliability of cross-chain operations. Attached Figure Description

[0019] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0020] Figure 1 This is a hardware structure block diagram of a computer terminal provided according to an embodiment of this application;

[0021] Figure 2 This is a flowchart of the request processing method provided in the embodiments of this application. Figure 1 ;

[0022] Figure 3 This is a schematic diagram of the operation of a cross-chain gateway node cluster according to an embodiment of this application;

[0023] Figure 4 This is a flowchart of the request processing method provided in the embodiments of this application. Figure 2 ;

[0024] Figure 5 This is a schematic diagram of a request processing apparatus provided according to an embodiment of this application;

[0025] Figure 6 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] It should be noted that the information collected in this application (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with relevant regulations and standards, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse. For example, interfaces are set up between this system and relevant users or organizations, providing users with corresponding operation entry points for them to choose to agree to or refuse automated decision results; if the user chooses to refuse, the process proceeds to the expert decision-making process.

[0029] Example 1

[0030] According to an embodiment of this application, an embodiment of a request processing method is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0031] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a request processing method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor (MCU) or a field-programmable gate array (FPGA), etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output (I / O) interface, a Universal Serial Bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0032] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0033] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the request processing method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-mentioned request processing method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0034] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0035] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0036] Under the aforementioned operating environment, this application provides the following: Figure 2 The request handling method shown. Figure 2 This is a flowchart of a request processing method according to Embodiment 1 of this application. This method is applied to a cross-chain gateway node cluster, such as... Figure 2 As shown, the method includes the following steps:

[0037] Step S201: Upon receiving a cross-chain operation request from the source blockchain, the cross-chain operation request is split into multiple sub-transactions. The cross-chain operation request is used to request multiple target blockchains to perform corresponding operations, and each sub-transaction is used to request one of the multiple target blockchains to perform the corresponding operation.

[0038] In some implementations, the source blockchain described above can be simply referred to as the source chain, and the target blockchain can be simply referred to as the target chain. A cross-chain operation request originates from event or transaction data on the source chain and is intended to trigger business logic on the target chain.

[0039] In some implementations, cross-chain operation requests are cross-chain distributed transactions, meaning that a cross-chain operation request is used to request multiple target blockchains to perform corresponding operations. A cross-chain operation request can be split into multiple sub-transactions, and each sub-transaction is used to request one of the multiple target blockchains to perform the corresponding operation.

[0040] In some implementations, when a cross-chain gateway node cluster receives a cross-chain operation request from the source blockchain, it breaks the request down into multiple sub-transactions. A sub-transaction can be understood as an atomic operation unit corresponding to a single target blockchain. For example, when the cross-chain gateway node cluster detects a cross-chain transfer event (i.e., a cross-chain operation request) on the source blockchain, it breaks down the single request into two independent sub-transactions targeting target chain A and target chain B. One sub-transaction instructs target chain A to perform the transfer operation, and the other sub-transaction instructs target chain B to perform the transfer operation.

[0041] In some implementations, each sub-transaction includes information such as source chain information, target chain information, calling method and parameters, and can generate a transaction identifier based on the source transaction hash, event index and event configuration identifier to ensure idempotency of cross-node processing.

[0042] For example, a cross-chain gateway node cluster is explained. A cross-chain gateway node cluster can adopt a master-slave topology, where one master authentication node is responsible for transaction commits, and multiple slave authentication nodes are responsible for signing and broadcasting. The cross-chain gateway node cluster includes multiple authentication nodes, which can also be called notary nodes. The aforementioned master authentication node refers to the authentication node acting as the master node, and the aforementioned slave authentication node refers to the authentication node acting as the slave node. Therefore, the master authentication node and slave authentication node can also be simply referred to as master node and slave node.

[0043] The cross-chain gateway node cluster receives on-chain events (i.e. cross-chain operation requests) generated by the source blockchain and initiates calls to target chain A and target chain B.

[0044] Figure 3 This is a schematic diagram of the operation of a cross-chain gateway node cluster according to an embodiment of this application, such as... Figure 3 As shown, the master node in a cross-chain gateway node cluster can include: an event orchestration module, a serial scheduling module, a Byzantine fault-tolerant multi-signature aggregation module, a TCC (Try-Confirm-Cancel) transaction coordination module, a peer-to-peer network communication module, a final state replication module, a chain adapter / verification contract interface, and a persistent storage module. The functions of each module are as follows:

[0045] (1) Event orchestration module: Subscribes to on-chain events from the source chain and performs state-aware deduplication based on the event record identifier (chain identifier: transaction hash: event index), and supports CAS (Compare-And-Swap) atomic state transition; where CAS is an atomic state transition primitive, which is used in this application for concurrent and secure updates of event states.

[0046] (2) Serial scheduling module: Establish an independent first-in-first-out distribution queue according to the contract dimension (chain identifier: contract name) to ensure that cross-chain events within the same contract dimension are processed in the order of arrival, and set a safety valve timeout mechanism to prevent permanent blocking.

[0047] (3) Byzantine fault-tolerant multi-signature aggregation module: collects the signature values ​​of multiple slave nodes and determines the aggregation is complete based on the Byzantine fault tolerance threshold, where n represents the total number of certified nodes in the cross-chain gateway node cluster.

[0048] (4) TCC Transaction Coordination Module: Performs three-stage cross-chain transaction lifecycle management of Try / Confirm / Cancel, including deterministic transaction identifier generation, concurrent sub-transaction execution of multiple target chains, stage advancement based on decision strategy, and source chain callback with error context; among them, TCC is a distributed transaction mode that splits a transaction into three stages: Try (resource reservation), Confirm (confirmation and submission), and Cancel (cancellation and rollback); this application introduces it into the cross-chain scenario to ensure the atomicity of cross-heterogeneous blockchain transactions.

[0049] (5) Point-to-point network communication module: Based on topic subscription broadcast protocol, it handles signed message broadcasting, master node election, node discovery and configuration synchronization.

[0050] (6) Final state replication module: The final state replication of transactions from master node to slave node is realized through a hybrid mechanism of “message broadcast push + periodic HTTP (Hypertext Transfer Protocol) pull”, and the risk of expired messages and data loss is reduced by combining master node term counter and composite cursor level; among them, final state replication refers to the mechanism of reliably replicating the final state (completed / failed) transaction state on master node to each slave node.

[0051] (7) Chain adapter / verification contract interface: Unified encapsulation of event subscription, invocation and retry logic for different types of blockchains. When adding a new chain type, only the corresponding adapter implementation needs to be added.

[0052] (8) Persistent storage module: Persist the transaction state, sub-transaction state, event records and block height checkpoints to the key-value storage engine, and support recovery from the checkpoints after node restart.

[0053] like Figure 3 As shown, the slave nodes in the cross-chain gateway node cluster can include a local signature module, a transaction initialization message sending module, and a final state receiving / pulling module. The local signature module is responsible for local signing, the transaction initialization message sending module is responsible for broadcasting the event context to the master node, and the final state receiving / pulling module is responsible for receiving the transaction final state.

[0054] In some implementations, both master nodes and slave nodes can listen for cross-chain operation requests from the source blockchain. When any node (master node or slave node) listens for a cross-chain operation request, it can send a notification to nodes other than itself to inform these nodes that a new cross-chain operation request has arrived.

[0055] Step S202: Sign each sub-transaction to obtain the first cross-chain proof corresponding to each sub-transaction.

[0056] In some implementations, for each sub-transaction, multiple authentication nodes within the cluster independently sign the sub-transaction and aggregate these signatures to form a first cross-chain proof that proves the consensus of the entire cluster and corresponds to the sub-transaction.

[0057] For example, after each slave node receives the transaction initialization message for the cross-chain operation request broadcast by the master node, its local signature module uses an algorithm to sign the cross-chain call payload (which may include the transaction content of the sub-transaction and the current TCC stage). Subsequently, the peer-to-peer network communication module can broadcast the signature to the master node through a protocol. The master node's Byzantine fault-tolerant multi-signature aggregation module collects signatures from multiple slave nodes, and when a preset Byzantine fault-tolerant threshold is reached, the aggregation is considered complete. The master node combines the signature list (including the signature values ​​sent by multiple slave nodes), the original payload, and the proof identifier to generate the first cross-chain proof.

[0058] Optionally, slave nodes can sign cross-chain call payloads using ECDSA (Elliptic Curve Digital Signature Algorithm) (explicitly excluding error context and timestamp fields during signing to maintain the stability of the proof of identity).

[0059] In some implementations, a first cross-chain proof is generated for each sub-transaction.

[0060] Step S203: Send the first cross-chain proof corresponding to each sub-transaction to the target blockchain corresponding to the sub-transaction. The target blockchain performs compliance verification on the first cross-chain proof. If the compliance verification is successful, the target blockchain executes the operation indicated by the sub-transaction.

[0061] In some implementations, the target blockchain corresponding to a sub-transaction is the target blockchain indicated in the sub-transaction.

[0062] In some implementations, the target blockchain stores the public key from the authentication node, or the target blockchain can obtain the public key from the authentication node from a trusted storage area. After receiving the first cross-chain proof, the target blockchain can verify the validity of the signature in the first cross-chain proof based on the public key from the authentication node. If the valid signature in the first cross-chain proof reaches the cluster's preset Byzantine fault tolerance threshold, the first cross-chain proof is determined to have passed compliance verification; otherwise, if the valid signature in the first cross-chain proof does not reach the cluster's preset Byzantine fault tolerance threshold, the first cross-chain proof is determined to have failed compliance verification.

[0063] In some implementations, if compliance verification is passed, the target blockchain executes the operation indicated by the sub-transaction. For example, if the sub-transaction indicates a transfer operation, the target blockchain contract executes the corresponding transfer operation.

[0064] In some implementations, the target blockchain does not execute the sub-transaction instructions if the compliance verification fails.

[0065] Step S204: If it is determined that the target sub-transaction among the multiple sub-transactions has been successfully executed by the target blockchain, the execution results of all sub-transactions are sent to the source blockchain and the multiple target blockchains respectively.

[0066] In some implementations, the target blockchain can report its execution status to the master node after completing a sub-transaction, or if the target blockchain determines not to execute the sub-transaction. The execution status can include: execution success and execution failure. Specifically, if the target blockchain executes a sub-transaction but the sub-transaction fails, or if the target blockchain determines not to execute the sub-transaction, the execution status is "execution failure"; if the target blockchain executes a sub-transaction and the sub-transaction succeeds, the execution status is "execution success". The master node can determine whether the target sub-transaction was successfully executed based on the execution status reported by the target blockchain.

[0067] In some implementations, the target sub-transaction is the sub-transaction corresponding to the operation that needs to maintain atomic consistency as indicated in the cross-chain operation request. For example, if the cross-chain operation request indicates that a cross-chain operation be performed on the target chain AC, and the operation corresponding to the target chain AB needs to maintain atomic consistency, then the target sub-transaction is determined to be the sub-transaction corresponding to the target chain AB.

[0068] In some implementations, all sub-transactions in the cross-chain operation request are directly identified as the target sub-transaction, which means that all sub-transactions corresponding to the cross-chain operation request need to maintain atomic consistency.

[0069] If the target sub-transaction among multiple sub-transactions is successfully executed by the target blockchain, the execution results of all sub-transactions are sent to the source blockchain and the multiple target blockchains respectively.

[0070] In this application, the TCC model is introduced into cross-chain scenarios to ensure the atomicity of transactions across heterogeneous blockchains. Step S203 is equivalent to the Try phase in the TCC model. After the Try phase, the Confirm or Cancel phase is determined based on the Try results of all sub-transactions (i.e., the execution status of the sub-transactions) and the decision strategy (a strategy of full execution success or a strategy of partial execution success). Step S204 is equivalent to the Confirm phase, and step S205 is equivalent to the Cancel phase.

[0071] Step S205: If it is determined that a target sub-transaction has failed to be executed by the target blockchain, rollback processing is performed on multiple sub-transactions.

[0072] If it is determined that a target sub-transaction failed to execute on the target blockchain, multiple sub-transactions are rolled back. Optionally, successful sub-transactions can be rolled back to undo their executed operations. For example, a rollback can be performed on completed sub-transactions, and the error context of the first failed sub-transaction can be collected.

[0073] In this embodiment, upon receiving a cross-chain operation request from the source blockchain, the cross-chain operation request is split into multiple sub-transactions, thus achieving effective decomposition of the cross-chain distributed transaction. By sending the first cross-chain proof corresponding to each sub-transaction to the target blockchain corresponding to that sub-transaction, the reliability of the target blockchain executing the sub-transaction is improved. By retaining the execution result when it is determined that the target sub-transaction among the multiple sub-transactions is successfully executed by the target blockchain, and by performing a rollback when it is determined that the target sub-transaction is failed to be executed by the target blockchain, the risk of data inconsistency between heterogeneous blockchains is reduced, and the atomicity of cross-heterogeneous blockchain transactions is guaranteed, thereby improving the reliability of cross-chain operations.

[0074] Therefore, the method provided in this application achieves the goal of determining the processing mode of a cross-chain distributed transaction based on the execution status of multiple sub-transactions in the cross-chain distributed transaction, thereby improving the reliability of cross-chain operations. It also solves the technical problem that related technologies in cross-chain scenarios process sub-transactions in cross-chain distributed transactions independently, thus affecting the reliability of cross-chain operations.

[0075] Optionally, in the request processing method provided in this application embodiment, the cross-chain operation request is split into multiple sub-transactions, including: obtaining the request identifier in the cross-chain operation request; determining whether the cross-chain operation request is a processed or being processed request based on the request identifier; if the cross-chain operation request is not a processed or being processed request, then splitting the cross-chain operation request into multiple sub-transactions.

[0076] In some implementations, the request identifier is used to uniquely identify a cross-chain operation request. For example, the request identifier consists of a triple of "chain identifier: transaction hash: event index".

[0077] For example, when the master node detects a new cross-chain transfer event (i.e., a cross-chain operation request) on the source blockchain through the chain adapter / verification contract interface, or when the master node receives a broadcast from a slave node informing it of the new cross-chain transfer event, the event orchestration module in the master node extracts key information from the on-chain data structure of the event. Specifically, the module reads the blockchain network ID (i.e., chain identifier), the specific transaction hash value that triggered the event (i.e., transaction hash), and the index position of the event contained in the transaction within the block or transaction (i.e., event index). The module combines these three parts of information to generate a globally unique string, i.e., the event record identifier (i.e., the request identifier). For example, if the source chain is Chain-A, the transaction hash is 0xabc..., and the event index is 0, the generated request identifier might be in the form of "Chain-A:0xabc...:0".

[0078] The master node can store request identifiers for processed or currently being processed requests. If an event record exists in the master node that corresponds to the request identifier in the cross-chain operation request, the cross-chain operation request is determined to be a processed or currently being processed request; otherwise, the cross-chain operation request is determined not to be a processed or currently being processed request.

[0079] If a cross-chain operation request is not a processed or being processed request, it will be split into multiple sub-transactions; if a cross-chain operation request is a processed or being processed request, it will be discarded.

[0080] It should be noted that by using the above methods, the same event can be submitted multiple times due to network retransmission, node failure recovery, or message broadcasting, thereby preventing repeated cross-chain asset transfers or state errors, and thus improving the reliability of cross-chain operations.

[0081] Optionally, in the request processing method provided in this application embodiment, if the cross-chain operation request is not a processed or being processed request, the cross-chain operation request is split into multiple sub-transactions, including: determining the chain identifier of the source blockchain to which the cross-chain operation request belongs and the contract name of the source blockchain contract to which the cross-chain operation request belongs; determining the processing queue to which the cross-chain operation request belongs based on the chain identifier and the contract name; and splitting the cross-chain operation request into multiple sub-transactions if the cross-chain operation request is at the head of the processing queue.

[0082] In some implementations, the chain identifier is a string or code used to uniquely identify the source blockchain network. The contract name refers to the name or address identifier of the source chain smart contract that triggers the cross-chain operation, used to distinguish business logic triggered by different contracts on the same blockchain.

[0083] In some implementations, the master node can maintain a queue mapping table or hash structure, where key-value pairs are formed using a combination of chain identifier and contract name as keys and processing queue names as values. The master node can then determine the processing queue to which a cross-chain operation request belongs based on the key-value pair mapping logic and the chain identifier and contract name.

[0084] In some implementations, if a cross-chain operation request is at the head of the processing queue, it is split into multiple sub-transactions. If the cross-chain operation request is not at the head of the processing queue, it is not split into multiple sub-transactions temporarily.

[0085] In some implementations, after the master node splits the cross-chain operation request into multiple sub-transactions, the master node can notify each slave node to split the cross-chain operation request into multiple sub-transactions locally. Alternatively, the master node can send the split sub-transactions to the slave nodes.

[0086] For example, according to Figure 3 The process of local TCC transaction coordination in this application is illustrated by example:

[0087] (1) The event orchestration module in the master node subscribes to on-chain events (i.e. cross-chain operation requests) from the source blockchain through the chain adapter / verification contract interface. This interface uniformly encapsulates the event subscription operations for different types of blockchains. The event orchestration module performs state-aware deduplication based on the event record identifier (chain identifier: transaction hash: event index) and supports Compare and Exchange (CAS) atomic state transitions. The states include: received, signed, triggered, successful and failed.

[0088] (2) The serial scheduling module in the master node creates an independent first-in-first-out distribution queue according to the contract dimension (chain identifier: contract name). Each queue is driven by an independent concurrent execution unit. The serial lock mechanism ensures that events within the same contract dimension are processed in the order of arrival, and a safety valve timeout mechanism is set to prevent permanent blocking.

[0089] (3) The signature module in the node uses ECDSA to sign the cross-chain call payload. The cross-chain call payload includes source chain information, target chain information, call method and parameters, and TCC stage identifier. When signing, the error context field and timestamp field are explicitly excluded to maintain the stability of the cross-chain proof identity identifier.

[0090] (4) Proof generation module: Based on the signature result, a cross-chain proof is generated. The cross-chain proof includes the cross-chain call payload, the signature list and the proof identifier.

[0091] (5) The TCC transaction coordination module in the master node performs three-stage lifecycle management: Try / Confirm / Cancel. In the Try stage, cross-chain proofs are generated for each sub-transaction of the target chain. The verification contract in the target chain performs the corresponding operation after the cross-chain proof is verified. In the decision stage, the target chain determines whether to enter the Confirm or Cancel stage based on the Try results of all sub-transactions and the decision strategy (either the strategy of executing all successful transactions or the strategy of executing some successful transactions). In the Confirm stage, the target chain confirms the sub-transactions. After all confirmations are successful, the source chain confirmation callback is executed. In the Cancel stage, the completed sub-transactions are rolled back. The error context of the first failed sub-transaction (failure stage, error message, target chain identifier, target chain transaction hash) is collected. The source chain cancellation callback is executed with the error context to achieve differentiated compensation. The transaction identifier is generated based on the source transaction hash, event index and event configuration identifier. A globally unique identifier is generated deterministically through a hash algorithm to ensure idempotency across nodes.

[0092] (6) The persistent storage module in the master node persists the transaction state, sub-transaction state, event records and block height checkpoints to the key-value storage engine to support the recovery of incomplete transactions from the checkpoints after the node restarts.

[0093] The local TCC transaction coordination process in this application may include the following steps: (1) The event orchestration module responds to the received source chain event (i.e., cross-chain operation request) by performing deduplication checks and submitting the events that pass the checks to the serial scheduling module for queuing; (2) The signature module signs the sub-transactions of the event, and the proof generation module generates a cross-chain proof (i.e., the first cross-chain proof) based on the signature result; (3) The TCC transaction coordination module creates the main transaction and sub-transaction records, and the main transaction enters the Try phase; (4) The Try operations of all sub-transactions are executed concurrently (i.e., verify the compliance of the first cross-chain proof, and execute the operation indicated by the sub-transaction if the compliance verification is passed) and wait for all to be completed; (5) The decision is made to enter the Confirm phase or the Cancel phase according to the decision strategy; (6) The corresponding phase operation is executed and the transaction is updated to the final state; (7) The serial scheduling module releases the serial lock and allows the next event to enter the processing flow.

[0094] It should be noted that by adopting first-in-first-out serial scheduling and dividing queues according to chain identifiers and contract names, it is helpful to ensure the causal order of events within the same contract dimension while allowing parallel processing across contracts. This helps to reduce business errors caused by out-of-order execution and improve the reliability of cross-chain operations.

[0095] Optionally, in the request processing method provided in this application embodiment, the cross-chain gateway node cluster includes a master authentication node and multiple slave authentication nodes. The signing of each sub-transaction to obtain a first cross-chain proof corresponding to each sub-transaction includes: for each sub-transaction, generating first information based on the sub-transaction's execution status information, execution stage identifier, and transaction information; signing the first information using the private keys of each slave authentication node to obtain a signature value corresponding to each slave authentication node; generating a signature entry for the sub-transaction based on the signature value and identity identifier of the slave authentication node; and determining the first cross-chain proof corresponding to the sub-transaction through the master authentication node based on the generated signature entries corresponding to the sub-transaction if the number of generated signature entries for the sub-transaction is greater than or equal to a preset number.

[0096] In some implementations, the first information refers to the original data payload to be signed, for example, it may be the cross-chain call payload mentioned above.

[0097] In some implementations, the execution status indicates the current processing stage of a subtransaction, such as compliance pending verification, execution completed and successful, execution completed but failed, or compliance verification failed (no execution). The execution stage identifier indicates that the current stage is the Try stage of the TCC transaction. Transaction information refers to information that may include the source chain identifier, target chain identifier, called method, parameters, etc., corresponding to the subtransaction; transaction information may also include a transaction identifier. For each subtransaction, the first information of the subtransaction is generated based on its execution status information, execution stage identifier, and transaction information.

[0098] After determining the first information corresponding to a certain sub-transaction, the first information is signed using the private keys of each slave authentication node to obtain the signature value (also called the first signature value) of each slave authentication node for that sub-transaction. For example, using the ECDSA algorithm, the first information is signed based on the private key to obtain the signature value.

[0099] After obtaining the signature value of a certain authentication node for the sub-transaction, a signature entry (also known as the first signature entry) for the sub-authentication node for the sub-transaction is generated based on the signature value of the corresponding authentication node and the identity of the authentication node.

[0100] If the number of generated signature entries corresponding to a sub-transaction is greater than or equal to a preset number, the primary authentication node determines the first cross-chain proof corresponding to the sub-transaction based on the generated signature entries. The preset number can be a Byzantine fault tolerance threshold. For example, if the number of generated signature entries corresponding to a sub-transaction is greater than or equal to the preset number, the generated signature entries are combined to obtain the first cross-chain proof corresponding to the sub-transaction.

[0101] For example, according to Figure 3 This application describes the process of Byzantine fault-tolerant signature aggregation and transaction coordination in the cross-chain gateway node cluster:

[0102] In this embodiment, the cross-chain gateway node cluster is deployed in a multi-node mode, using a master-slave topology consisting of master nodes and slave nodes.

[0103] The peer-to-peer network communication module in the master node establishes network connections between nodes based on the peer-to-peer network communication framework. It includes: a node discovery submodule (which realizes automatic node discovery through a bootstrap node list and a local area network multicast discovery protocol); a message broadcasting submodule (which broadcasts signed messages, call results, transaction initialization messages, and transaction finality messages through a topic subscription-based broadcasting protocol, with each type of message corresponding to an independent topic channel); and a master node election submodule (which realizes master node election based on a distributed consensus election protocol and supports dynamic member management).

[0104] The Byzantine fault-tolerant multi-signature aggregation module in the master node collects multi-node ECDSA signatures from the peer-to-peer network and determines aggregation completion based on the Byzantine fault tolerance threshold. This includes: a signature threshold calculation submodule (calculating the required number of signatures using a formula, where n is the total number of authentication nodes); a signature verification submodule (verifying the authenticity and validity of child node signatures); a Byzantine detection submodule (tracking inconsistent signature behavior of nodes and marking the corresponding node when Byzantine behavior is detected within a configurable detection window); and a timeout management submodule (employing an exponential backoff retry strategy – base interval × ...). + Random jitter, triggering the recovery process when signature aggregation times out; Signature caching submodule (local signature cache based on time-to-live, used to support signature recovery during master node switching).

[0105] The final state replication module in the master node implements transaction final state replication from the master node to the slave nodes through a hybrid push-pull mechanism. In other words, the transaction states between different nodes may be different. This module implements a compensation mechanism to ensure that the final result of cross-chain events for each node is consistent: Message broadcast push path (the master node responds to the transaction reaching the final state by publishing a transaction final state message via a dedicated broadcast topic. The message carries an ECDSA signature envelope and node compliance list verification; the slave node only overwrites local non-final state transactions with the final state message, and the final state record is idempotently skipped; when the node compliance list is empty, a fail-closed strategy is adopted to reject all); Periodic HTTP pull path (the slave node pulls the latest transaction state from the master node at configurable time intervals via an internal interface, and uses a composite cursor "update time, transaction identifier" to achieve water level safety advancement. The cursor is advanced only when the response is marked as water level safe, in order to avoid data loss due to partial failures); Master node switchover recovery (in response to the new master node taking office, the slave node rebroadcasts the initialization message of all incomplete transactions, and the rebroadcast uses the event configuration version of the snapshot when the transaction was created, in order to ensure configuration consistency). The aforementioned transaction final state refers to the final execution state of the cross-chain distributed transaction corresponding to the cross-chain operation request, such as failure, all sub-transactions successfully executed, or some sub-transactions successfully executed. The aforementioned conforming cursor refers to a pull watermark consisting of a "update time, transaction identifier" tuple, used to safely advance the final state replication progress.

[0106] Slave nodes can perform the following actions: "Subscribe to source chain events - sign locally and broadcast the signature over the peer-to-peer network - wait for the master node to broadcast the transaction's final state." Master nodes can perform the following actions: "Receive new transactions by listening or receiving notifications from slave nodes - Check the consistency between the master node's term counter and the configuration version - Execute the complete TCC lifecycle - Broadcast the transaction's final state." The term counter is a monotonically increasing counter that identifies the master node's term. It is used to discard residual messages from expired master nodes. The master node term expiration prevention mechanism ensures that each cluster message carries the master node's term counter, and the receiver discards messages with terms lower than the current term to prevent residual messages from expired master nodes from interfering with the current transaction state.

[0107] It should be noted that by using multiple slave nodes to independently sign and aggregate the same information (e.g., the first information containing transaction information), the risk of trust concentration caused by a single node signing is avoided, thereby further improving the reliability of cross-chain operations.

[0108] Optionally, in the request processing method provided in this application embodiment, sending the execution results of all sub-transactions to the source blockchain and multiple target blockchains respectively includes: generating second information based on the execution status information, completion stage identifier, and transaction information of all sub-transactions, wherein the execution status information is used to determine the execution result of the sub-transactions; signing the second information to obtain a second cross-chain proof; sending the second cross-chain proof to multiple target blockchains respectively; and sending the execution results of all sub-transactions to the source blockchain if it is determined that the compliance verification of the second cross-chain proof is passed by all target blockchains.

[0109] In some implementations, a unique second piece of information is generated based on the execution status information of all sub-transactions, the completion stage identifier, and the transaction information of all sub-transactions. The completion stage identifier indicates that the current stage is Confirm, and the second piece of information is equivalent to the cross-chain call payload of the Confirm stage.

[0110] After obtaining the second information, the second information is signed using the private key of each slave authentication node to obtain the second signature value corresponding to each slave authentication node; then, based on the second signature value corresponding to the slave authentication node, the identity identifier of the slave authentication node, and the plaintext second information, a second signature entry for the slave authentication node for the sub-transaction is generated.

[0111] If the number of generated second signature entries is greater than or equal to a preset number, the master authentication node determines the second cross-chain proof based on the generated second signature entries. The second cross-chain proof is then sent to multiple target blockchains. Upon receiving the second cross-chain proof, each target blockchain performs compliance verification on the first cross-chain proof. If the compliance verification passes, it can report this information to the master node, informing the master node that the target blockchain has successfully obtained the execution status and current stage of each sub-transaction. If the compliance verification fails, it can report this information to the master node, informing the master node that the target blockchain has not successfully obtained the execution status and current stage of each sub-transaction.

[0112] Once the master node confirms that all target blockchains have passed the compliance verification of the second cross-chain proof, it sends the execution results of all sub-transactions to the source blockchain so that the source blockchain is aware of the execution results of each sub-transaction, which triggers the source blockchain's confirmation callback.

[0113] If the master node determines that the target blockchain has failed to verify the compliance of the second cross-chain proof, it can either regenerate the second cross-chain proof and send it to the target blockchain, or generate an alert message.

[0114] In some implementations, the target blockchain verifies the second cross-chain proof in the same way it verifies the first cross-chain proof, so it will not be described again here.

[0115] It should be noted that, using the above method, the source chain is only notified of transaction completion if all target chains have successfully confirmed the transaction. This prevents the source chain from being incorrectly notified due to the failure of some target chains to confirm, thus helping to ensure the eventual consistency of the global transaction.

[0116] Optionally, in the request processing method provided in this application embodiment, multiple sub-transactions are rolled back, including: for each sub-transaction, generating third information based on the execution status information of the sub-transaction, the rollback stage identifier, and the transaction information of the sub-transaction; signing the third information to obtain the third cross-chain proof corresponding to the sub-transaction; sending the third cross-chain proof corresponding to each sub-transaction to the target blockchain corresponding to the sub-transaction, wherein the target blockchain performs compliance verification on the third cross-chain proof, and if the compliance verification is passed, the target blockchain performs a rollback operation.

[0117] In some implementations, for each sub-transaction, third information is generated based on the sub-transaction's execution status information, rollback phase identifier, and sub-transaction transaction information. The rollback phase identifier indicates that the current state is in the Cancel phase of the TCC transaction. The third information is equivalent to the cross-chain call payload of the Cancel phase.

[0118] After determining the third information corresponding to a certain sub-transaction, the third information is signed using the private keys of each slave authentication node to obtain the third signature value corresponding to that sub-transaction for each slave authentication node. For example, using the ECDSA algorithm, the third information is signed based on the private key to obtain the third signature value.

[0119] After obtaining the third signature value of a certain authentication node for the sub-transaction, the third signature entry of the slave authentication node for the sub-transaction is generated based on the third signature value of the slave authentication node and the identity of the slave authentication node.

[0120] If the number of generated third signature entries corresponding to a sub-transaction is greater than or equal to a preset number, the primary authentication node determines the third cross-chain proof corresponding to the sub-transaction based on these generated third signature entries. The preset number can be a Byzantine fault tolerance threshold. For example, if the number of generated third signature entries corresponding to a sub-transaction is greater than or equal to the preset number, the generated third signature entries are combined to obtain the third cross-chain proof corresponding to the sub-transaction.

[0121] The third cross-chain proof corresponding to each sub-transaction is sent to the target blockchain corresponding to that sub-transaction. The target blockchain performs compliance verification on the third cross-chain proof. If the compliance verification passes, the target blockchain performs a rollback operation; if the compliance verification fails, no rollback operation is performed. The target blockchain can then feed back the execution result of the rollback operation to the master node.

[0122] It should be noted that strict signature verification and consensus mechanisms help ensure that only revocation instructions authorized by the cluster can be executed for rollback, thereby preventing malicious nodes or erroneous instructions from causing resources to be released illegally or unable to be released, and further improving the reliability of cross-chain operations.

[0123] Optionally, in the request processing method provided in this application embodiment, the cross-chain gateway node cluster includes a master authentication node and multiple slave authentication nodes. The method further includes: after sending the execution results of all sub-transactions to the source blockchain and multiple target blockchains respectively, or after performing rollback processing on multiple sub-transactions, determining the request status of the cross-chain operation request through the master authentication node, wherein the request status is one of the following: processed, rolled back; and synchronizing the request status to multiple slave authentication nodes through the master authentication node.

[0124] In some implementations, after sending the execution results of all sub-transactions to the source blockchain and multiple target blockchains respectively, or after rolling back multiple sub-transactions, the master node can update the final state of the request (i.e., the request state) in the TCC transaction coordination module to the corresponding state. Then, the master authentication node can push / pull the final state of the transaction to each slave node through the final state replication module to ensure eventual consistency of the cluster.

[0125] It's important to note that by centrally determining the final state and synchronizing it with all slave nodes through the master node, potential state discrepancies in a distributed environment are eliminated. Whether the state has been processed or rolled back, consensus can be reached across all nodes, thus improving the reliability of cross-chain operations.

[0126] In some embodiments, the configuration of a highly available cross-chain gateway with adaptive hot reload and chain recovery is described exemplary. This embodiment can add hot reload and adaptive chain fault recovery capabilities to the foregoing content to achieve uninterrupted operation and maintenance and automatic disaster recovery.

[0127] Both master and slave nodes can be configured with a hot reload module. This module includes a configuration change monitoring submodule (which listens for change events in the node's configuration file, parses the changed items, and performs a differential comparison with the current runtime configuration); an incremental application submodule (which performs hot updates only on changed configuration items, including log levels, bootstrap node list, signature thresholds, timeout parameters, and retry intervals; unchanged items and running transactions are unaffected); and a configuration version management submodule (which generates an incrementing configuration version number in response to each configuration change, allowing each business component to detect changes and determine whether reinitialization is needed).

[0128] Both master and slave nodes can be configured with a cluster configuration synchronization module. This module is used for the push path (the master node publishes a digitally signed configuration synchronization message via a dedicated broadcast topic, the message carrying the operation type—chain addition / update / deletion, event configuration addition / update / deletion—synchronization version number and master node term counter; slave nodes verify the signature and the node compliance list and then apply the changes in a monotonically increasing order of version); and the pull path (slave nodes compare the local configuration checksum with the master node's configuration at configurable time intervals via an internal interface, and if an inconsistency is detected, they pull a complete configuration snapshot, calculate the difference, and apply it incrementally; if the version jump exceeds a preset threshold, a full synchronization is triggered); the synchronized version is persisted independently of the runtime configuration version to prevent version semantic confusion between the push path and the pull path.

[0129] Both master and slave nodes can be configured with a chain health monitoring and adaptive recovery module. This module includes a health check submodule (performs health probes on each connected chain at configurable intervals, marking the chain status as faulty when consecutive failures exceed a preset threshold); a chain recovery detection submodule (after a chain in a faulty state passes the health check again, it sends a recovery event to the event orchestration module via an asynchronous notification channel); and an adaptive resubscription submodule (in response to the chain recovery notification, the event orchestration module performs idempotent resubscription to all enabled event configurations associated with that chain, resuming event listening from the persistent block height checkpoint to avoid missing on-chain events generated during the failure; each chain's recovery task uses a cancellation and replacement strategy for deduplication to prevent concurrent recovery task conflicts).

[0130] Both master and slave nodes can be configured with error classification and adaptive retry modules. This module can include an error classifier (which classifies errors returned by on-chain calls into transient errors—network timeouts, connection interruptions—and persistent errors—contract logic errors, insufficient permissions; transient errors trigger exponential backoff retries, while persistent errors directly mark the sub-transaction as failed); and an adaptive retry submodule (which dynamically adjusts the retry strategy in response to changes in chain health—pausing retries when the chain is in an error state and automatically resuming retries after the chain recovers to an active state).

[0131] The coordinated process for configuring hot reload and chain recovery in this application may include the following steps:

[0132] (1) In response to changes in the event configuration in the configuration file, the configuration hot reload module detects the changes and generates a new configuration version number.

[0133] (2) The event orchestration module responds to the notification of the configuration change channel by creating subscriptions for newly added event configurations, unsubscribing from deleted events, and performing migration operations on modified events.

[0134] (3) The cluster configuration synchronization module pushes the changes to all slave nodes, and the slave nodes perform the same subscription adjustment.

[0135] (4) In response to a failure of an access chain, the health monitoring module marks it as an error state and the relevant event subscription enters a degraded state.

[0136] (5) In response to chain recovery, the adaptive resubscription module re-establishes event listeners from the checkpoint height, and the TCC transaction coordination module automatically recovers the incomplete transactions on the chain.

[0137] In some embodiments, exemplarily Figure 4 This is a flowchart of the request processing method provided in the embodiments of this application. Figure 2 ,according to Figure 4 An optional application process of this application is described below. For example... Figure 4 As shown, the cross-chain gateway node cluster can perform the following steps:

[0138] (1) Event access and deduplication: The event orchestration module subscribes to events (cross-chain operation requests) from the source chain, performs deduplication based on the event record identifier, and only allows the first occurrence of the event.

[0139] (2) Serial queuing: Events that pass the deduplication check enter the corresponding queue of the serial scheduling module according to "chain identifier: contract name" to ensure orderly processing within the same contract.

[0140] (3) Signature and proof generation: Each slave node signs the cross-chain call payload with ECDSA (explicitly excluding error context and timestamp fields during signing to maintain the stability of the proof identity), generating a signature entry consisting of the payload, signature list and proof identifier.

[0141] (4) Multi-signature aggregation: The Byzantine fault-tolerant multi-signature aggregation module collects signatures from multiple nodes. Once the threshold is reached, the aggregation is considered complete, and the corresponding cross-chain proof is obtained (e.g., the first cross-chain proof).

[0142] (5) Try phase: The TCC transaction coordination module generates cross-chain proofs for each target chain sub-transaction and concurrently calls the target chain verification contract for processing.

[0143] (6) Decision-making stage: Based on the Try results of all sub-transactions and the decision-making strategy (full success strategy or partial success strategy), determine whether to enter Confirm or Cancel.

[0144] (7) Confirm phase: Confirm the sub-transactions. After all confirmations are successful, execute the source chain confirmation callback.

[0145] (8) Cancel phase: Roll back the completed sub-transaction, collect the error context of the first failed sub-transaction, and carry its execution source chain cancellation callback to achieve differentiated compensation.

[0146] (9) Final state replication: After the master node reaches the final state, the final state is pushed / pulled to each slave node through the final state replication module to ensure the eventual consistency of the cluster.

[0147] In this application, cross-chain transaction atomicity, Byzantine fault-tolerant signature aggregation, master-slave final state replication, contract-level first-in-first-out scheduling, and differentiated compensation are organically unified in the same cross-chain gateway node cluster, thereby effectively improving the reliability of cross-chain operations.

[0148] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0149] Example 2

[0150] This application also provides a request processing apparatus. It should be noted that the request processing apparatus of this application can be used to execute the request processing method provided in this application. The request processing apparatus provided in this application is described below.

[0151] According to embodiments of this application, an apparatus for implementing the above-described request processing method is also provided, such as... Figure 5 As shown, the device includes:

[0152] The splitting module 501 is used to split the cross-chain operation request into multiple sub-transactions when a cross-chain operation request is received from the source blockchain. The cross-chain operation request is used to request multiple target blockchains to perform corresponding operations, and each sub-transaction is used to request one of the multiple target blockchains to perform the corresponding operation.

[0153] The signature module 502 is used to sign each sub-transaction to obtain the first cross-chain proof corresponding to each sub-transaction;

[0154] The first sending module 503 is used to send the first cross-chain proof corresponding to each sub-transaction to the target blockchain corresponding to the sub-transaction. The target blockchain performs compliance verification on the first cross-chain proof. If the compliance verification is successful, the target blockchain executes the operation indicated by the sub-transaction.

[0155] The second sending module 504 is used to send the execution results of all sub-transactions to the source blockchain and the multiple target blockchains respectively, when it is determined that the target sub-transaction in the multiple sub-transactions has been successfully executed by the target blockchain.

[0156] The first processing module 505 is used to roll back multiple sub-transactions if it is determined that a target sub-transaction has failed to be executed by the target blockchain.

[0157] Optionally, in the request processing apparatus provided in this application embodiment, the splitting module further includes: an acquisition submodule, used to acquire the request identifier in the cross-chain operation request; a judgment submodule, used to determine whether the cross-chain operation request is a processed or being processed request based on the request identifier; and a splitting submodule, used to split the cross-chain operation request into multiple sub-transactions if the cross-chain operation request is not a processed or being processed request.

[0158] Optionally, in the request processing apparatus provided in this application embodiment, the splitting submodule further includes: a first determining unit, used to determine the chain identifier of the source blockchain to which the cross-chain operation request belongs and the contract name of the source blockchain contract to which the cross-chain operation request belongs; a second determining unit, used to determine the processing queue to which the cross-chain operation request belongs based on the chain identifier and the contract name; and a splitting unit, used to split the cross-chain operation request into multiple sub-transactions when the cross-chain operation request is at the head of the processing queue.

[0159] Optionally, in the request processing apparatus provided in this application embodiment, the signature module further includes: a first generation submodule, used to generate first information for each sub-transaction based on the execution status information, execution stage identifier, and transaction information of the sub-transaction; a first signature submodule, used to sign the first information using the private key of each slave authentication node to obtain the signature value corresponding to each slave authentication node; a second generation submodule, used to generate a signature entry for the sub-transaction by the slave authentication node based on the signature value corresponding to the slave authentication node and the identity identifier of the slave authentication node; and a first determination submodule, used to determine the first cross-chain proof corresponding to the sub-transaction by the master authentication node based on the generated signature entries corresponding to the sub-transaction when the number of generated signature entries corresponding to the sub-transaction is greater than or equal to a preset number.

[0160] Optionally, in the request processing apparatus provided in this application embodiment, the second sending module further includes: a third generation submodule, used to generate second information based on the execution status information, completion stage identifier, and transaction information of all sub-transactions, wherein the execution status information is used to determine the execution result of the sub-transaction; a second signing submodule, used to sign the second information to obtain a second cross-chain proof; a first sending submodule, used to send the second cross-chain proof to multiple target blockchains respectively; and a second sending submodule, used to send the execution results of all sub-transactions to the source blockchain if it is determined that the compliance verification of the second cross-chain proof has passed by all target blockchains.

[0161] Optionally, in the request processing apparatus provided in this application embodiment, the first processing module further includes: a fourth generation submodule, used to generate third information for each sub-transaction based on the execution status information of the sub-transaction, the rollback stage identifier, and the transaction information of the sub-transaction; a third signature submodule, used to sign the third information to obtain the third cross-chain proof corresponding to the sub-transaction; and a third sending submodule, used to send the third cross-chain proof corresponding to each sub-transaction to the target blockchain corresponding to the sub-transaction, wherein the target blockchain performs compliance verification on the third cross-chain proof, and if the compliance verification is passed, the target blockchain performs a rollback operation.

[0162] Optionally, in the request processing apparatus provided in this application embodiment, the request processing apparatus further includes: a second processing module, used to determine the request status of the cross-chain operation request through the master authentication node after sending the execution results of all sub-transactions to the source blockchain and multiple target blockchains respectively, or after performing rollback processing on multiple sub-transactions, wherein the request status is one of the following: processed, rolled back; and a synchronization module, used to synchronize the request status to multiple slave authentication nodes through the master authentication node.

[0163] It should be noted that the splitting module 501, signature module 502, first sending module 503, second sending module 504, and first processing module 505 mentioned above correspond to steps S201 to S205 in Embodiment 1. The five modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.

[0164] Example 3

[0165] Embodiments of this application may provide an electronic device. Figure 6This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 6 As shown, the electronic device may include: one or more ( Figure 6 (Only one is shown) Processor 1002, memory 1004, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0166] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0167] The processor can access the information and application programs stored in the memory via the transmission device to execute the steps described in the above embodiments.

[0168] Those skilled in the art will understand that Figure 6 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 6 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 6 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 6 The different configurations shown.

[0169] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0170] Example 4

[0171] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the request processing method provided in Embodiment 1.

[0172] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0173] This application also provides a computer program product that, when executed on a data processing device, is adapted to perform request processing method steps.

[0174] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0175] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0176] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.

[0177] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0178] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0179] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0180] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A request processing method, characterized in that, The method, applied to a cross-chain gateway node cluster, includes: Upon receiving a cross-chain operation request from the source blockchain, the cross-chain operation request is split into multiple sub-transactions. The cross-chain operation request is used to request multiple target blockchains to perform corresponding operations, and each sub-transaction is used to request one of the multiple target blockchains to perform the corresponding operation. Sign each sub-transaction to obtain the first cross-chain proof corresponding to each sub-transaction; The first cross-chain proof corresponding to each sub-transaction is sent to the target blockchain corresponding to the sub-transaction. The target blockchain performs compliance verification on the first cross-chain proof. If the compliance verification is successful, the target blockchain executes the operation indicated by the sub-transaction. If it is determined that the target sub-transaction among the plurality of sub-transactions was successfully executed by the target blockchain, the execution results of all sub-transactions are sent to the source blockchain and the plurality of target blockchains respectively; If it is determined that a target sub-transaction has failed to be executed by the target blockchain, the multiple sub-transactions are rolled back.

2. The method according to claim 1, characterized in that, The cross-chain operation request is split into multiple sub-transactions, including: Obtain the request identifier from the cross-chain operation request; Based on the request identifier, determine whether the cross-chain operation request is a processed or being processed request; If the cross-chain operation request is not a processed or being processed request, then the cross-chain operation request is split into multiple sub-transactions.

3. The method according to claim 2, characterized in that, If the cross-chain operation request is not a processed or being processed request, then the cross-chain operation request is split into multiple sub-transactions, including: Determine the chain identifier of the source blockchain to which the cross-chain operation request belongs, and the contract name of the source blockchain contract to which the cross-chain operation request belongs; The processing queue to which the cross-chain operation request belongs is determined based on the chain identifier and the contract name; If the cross-chain operation request is at the head of the processing queue, the cross-chain operation request is split into multiple sub-transactions.

4. The method according to claim 1, characterized in that, The cross-chain gateway node cluster includes a master authentication node and multiple slave authentication nodes. Each sub-transaction is signed to obtain a first cross-chain proof corresponding to each sub-transaction, including: For each sub-transaction, first information is generated based on the execution status information, execution stage identifier, and transaction information of the sub-transaction; The first information is signed using the private key of each authentication node to obtain the signature value corresponding to each authentication node. The signature entry for the sub-transaction is generated by the slave authentication node based on the signature value corresponding to the slave authentication node and the identity identifier of the slave authentication node; If the number of generated signature entries corresponding to the sub-transaction is greater than or equal to a preset number, the primary authentication node determines the first cross-chain proof corresponding to the sub-transaction based on the generated signature entries corresponding to the sub-transaction.

5. The method according to claim 1, characterized in that, Sending the execution results of all sub-transactions to the source blockchain and the plurality of target blockchains respectively, including: The second information is generated based on the execution status information, completion stage identifier, and transaction information of all sub-transactions, wherein the execution status information is used to determine the execution result of the sub-transaction; Sign the second piece of information to obtain the second cross-chain proof; The second cross-chain proof is sent to the multiple target blockchains respectively; Once it is confirmed that all target blockchains have passed the compliance verification of the second cross-chain proof, the execution results of all sub-transactions are sent to the source blockchain.

6. The method according to claim 1, characterized in that, Rollback processing of the multiple sub-transactions includes: For each sub-transaction, third information is generated based on the execution status information of the sub-transaction, the rollback phase identifier, and the transaction information of the sub-transaction; The third information is signed to obtain the third cross-chain proof corresponding to the sub-transaction; The third cross-chain proof corresponding to each sub-transaction is sent to the target blockchain corresponding to that sub-transaction. The target blockchain performs compliance verification on the third cross-chain proof. If the compliance verification is successful, the target blockchain performs a rollback operation.

7. The method according to claim 1, characterized in that, The cross-chain gateway node cluster includes a master authentication node and multiple slave authentication nodes, and the method further includes: After sending the execution results of all sub-transactions to the source blockchain and the multiple target blockchains respectively, or after rolling back the multiple sub-transactions, the request status of the cross-chain operation request is determined by the main authentication node, wherein the request status is one of the following: processed or rolled back; The request status is synchronized to the multiple slave authentication nodes through the master authentication node.

8. A request processing apparatus, characterized in that, The device, applied to a cross-chain gateway node cluster, includes: The splitting module is used to split the cross-chain operation request into multiple sub-transactions when a cross-chain operation request is received from the source blockchain. The cross-chain operation request is used to request multiple target blockchains to perform corresponding operations, and each sub-transaction is used to request one of the multiple target blockchains to perform the corresponding operation. The signature module is used to sign each sub-transaction and obtain the first cross-chain proof corresponding to each sub-transaction; The first sending module is used to send the first cross-chain proof corresponding to each sub-transaction to the target blockchain corresponding to the sub-transaction, wherein the target blockchain performs compliance verification on the first cross-chain proof, and if the compliance verification is passed, the target blockchain executes the operation indicated by the sub-transaction; The second sending module is used to send the execution results of all sub-transactions to the source blockchain and the multiple target blockchains respectively, when it is determined that the target sub-transaction among the multiple sub-transactions has been successfully executed by the target blockchain. The first processing module is used to roll back the multiple sub-transactions if it is determined that a target sub-transaction has failed to be executed by the target blockchain.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the request processing method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the request processing method according to any one of claims 1 to 7.