Blockchain cross-chain method and system
By shifting the focus of cross-chain operations from the blockchain layer to the application layer, using microservice architecture and multi-blockchain models, efficient cross-chain between multiple blockchains is achieved, and inter-blockchain between multiple blockchains in the existing technology is solved The problem of low cross-chain interoperability ensures safe and efficient business collaboration.
Patent Information
- Application Number
- CN202410892697.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-07-04
AI Technical Summary
The existing technology cannot achieve efficient cross-chain between multiple blockchains, which affects the secure and efficient business collaboration between multiple blockchains. Traditional cross-chain solutions focus on the blockchain layer and cannot effectively achieve efficient cross-chain between multiple blockchains. Cross-chain interoperability.
By shifting the focus of cross-chain operations from the blockchain layer to the application layer, adopting microservice architecture and multi-blockchain model, matching microservice architecture and multi-blockchain model based on cross-chain interactive network, splitting the transaction chain into multiple Each application chain service is used, and cross-chain instructions are output through cross-chain supervision services, and cross-chain operations are performed at the application layer of the multi-blockchain model.
It realizes efficient cross-chain between multiple blockchains, ensures secure and efficient business collaboration between multiple blockchains, and improves the efficiency and consistency of cross-chain transactions.
Smart Images

Figure CN118631882B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blockchain, and in particular to a cross-chain method and system of blockchain. Background Art
[0002] With the development of science and technology, blockchain has become one of the important driving forces for the development of information technology in my country with its core characteristics of open, transparent, traceable and tamper-proof data. With the widespread application of blockchain technology and the complexity of business scenarios, the demand for integration between various blockchain projects is growing. At this time, the traditional single-blockchain business architecture has gradually developed into a multi-blockchain business architecture. In the existing technology, their cross-chain solutions are all focused on the blockchain layer, and cannot achieve efficient cross-chain between multiple blockchains, which affects the safe and efficient business collaboration between multiple blockchains. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art. The present invention provides a cross-chain method and system of blockchain. The focus of cross-chain intercommunication between multiple blockchains is shifted from the blockchain layer to the application layer, so as to perform cross-chain operations between multiple application chains based on cross-chain instructions, and perform cross-chain operations at the application layer of the multi-blockchain model, thereby realizing efficient cross-chain between multiple blockchains, thereby realizing safe and efficient business collaboration between multiple blockchains.
[0004] In order to solve the above technical problems, an embodiment of the present invention provides a cross-chain method of blockchain, which is applied to the cross-chain scenario of blockchain; the cross-chain method of blockchain includes:
[0005] Collect microservice architecture and multi-blockchain models, and match microservice architecture and multi-blockchain models based on cross-chain interactive networks;
[0006] In the cross-chain interactive network, the transaction chain is collected and split into multiple application chain services based on the transaction chain; multiple application chain services correspond to multiple blockchains in the multi-blockchain model;
[0007] Based on multiple application chain services, cross-chain supervision services are triggered respectively, and cross-chain instructions are output;
[0008] Cross-chain operations between multiple application chains are executed based on cross-chain instructions, and cross-chain operations are performed at the application layer of the multi-blockchain model.
[0009] Optionally, the acquisition of microservice architecture and multi-blockchain model, and matching of microservice architecture and multi-blockchain model based on a cross-chain interactive network, includes:
[0010] Collect microservice architecture and multi-blockchain model;
[0011] Based on microservice architecture and multi-blockchain model, communication connection is carried out, and signal interaction is carried out under communication;
[0012] The microservice architecture and the multi-blockchain model are matched, and the microservice architecture and the multi-blockchain model are matched according to the cross-chain interactive network. At this time, the microservice architecture is combined with the multi-blockchain model.
[0013] Optionally, in the cross-chain interactive network, the transaction chain is collected and split into multiple application chain services based on the transaction chain; the multiple application chain services correspond to multiple blockchains of the multi-blockchain model, including:
[0014] In the cross-chain interactive network, collect transaction chains;
[0015] Split the transaction chain into multiple application chain services.
[0016] Multiple application chain services are associated and relatively independent; multiple application chain services correspond to multiple blockchains in the multi-blockchain model.
[0017] Optionally, in the cross-chain interactive network, the transaction chain is collected and split into multiple application chain services based on the transaction chain; the multiple application chain services correspond to multiple blockchains of the multi-blockchain model respectively, and also include:
[0018] Each application chain service stores the business data of the corresponding link separately to ensure the isolation of business data in different links.
[0019] Optionally, the triggering of cross-chain supervision services based on multiple application chain services respectively and output of cross-chain instructions include:
[0020] Freeze multiple application chain services;
[0021] Link multiple application chain services and cross-chain supervision services;
[0022] The cross-chain supervision service is triggered according to multiple application chain services and is controlled by the cross-chain supervision service;
[0023] Output cross-chain instructions based on cross-chain supervision services.
[0024] Optionally, the method of triggering cross-chain supervision services based on multiple application chain services respectively and outputting cross-chain instructions also includes:
[0025] After receiving the cross-chain request, the cross-chain supervision service decrypts it using the corresponding shared key to obtain the plain text of the cross-chain instruction. According to the cross-chain request, the cross-chain instruction is split into instructions A and B, which are then encrypted using the shared key and sent to application chain service A and application chain service B respectively.
[0026] Optionally, the cross-chain operation between multiple application chains is performed based on the cross-chain instruction, and the cross-chain operation is performed at the application layer of the multi-blockchain model, including:
[0027] Collect cross-chain instructions;
[0028] Based on cross-chain instructions, cross-chain operations between multiple application chains are executed. At this time, each application chain service that needs to initiate a cross-chain transaction sends a cross-chain request to the cross-chain supervision service to indicate that this operation is a cross-chain operation.
[0029] Optionally, the cross-chain operation between multiple application chains is performed based on the cross-chain instruction, and the cross-chain operation is performed at the application layer of the multi-blockchain model, and further includes:
[0030] Cross-chain operations are performed at the application layer of the multi-blockchain model. At this time, the cross-chain focus is shifted from the blockchain layer to the application layer, and the integration and interoperability of multiple blockchains are achieved from the perspective of the application layer.
[0031] Optionally, the cross-chain method of the blockchain further includes:
[0032] Collect cross-chain management contracts, which include five operations: registration, update, query, review and cancellation of application chain services;
[0033] During the registration and review of the application chain service, the application chain service joins the cross-chain network registration center and needs to provide registration information and submit a registration application; when the qualification review of the application chain service is passed, the cross-chain supervision service will issue a user certificate to the application chain service through its node, and the cross-chain supervision service will upload the specific information of the application chain service to the chain through the cross-chain management contract;
[0034] During the application chain service update, when some basic information of the application chain service changes, the application chain service administrator needs to initiate an update information request, which will be reviewed and approved by the cross-chain supervision service administrator and updated on the blockchain ledger of the cross-chain supervision service through the cross-chain management contract;
[0035] In the deregistration of the application chain service, when the application chain service wants to exit the cross-chain interactive network, the application chain service administrator needs to submit a deregistration request, and the cross-chain regulatory service administrator agrees to its deregistration, and the application chain service will be deleted in the cross-chain interactive network;
[0036] In the application chain service query, the cross-chain supervision service queries the world state on the supervision chain ledger based on EnrollId.
[0037] Optionally, a cross-chain system of blockchain, the cross-chain system of blockchain is applied to the cross-chain method of blockchain, and the cross-chain system of blockchain includes:
[0038] The association module is used to collect microservice architectures and multi-blockchain models, and match microservice architectures and multi-blockchain models based on a cross-chain interactive network;
[0039] The application chain service module is used to collect transaction chains in the cross-chain interactive network and split them into multiple application chain services based on the transaction chains; multiple application chain services correspond to multiple blockchains in the multi-blockchain model respectively;
[0040] The cross-chain instruction module is used to trigger cross-chain supervision services based on multiple application chain services and output cross-chain instructions;
[0041] The execution module is used to execute cross-chain operations between multiple application chains based on cross-chain instructions. The cross-chain operations are executed at the application layer of the multi-blockchain model.
[0042] In an embodiment of the present invention, through the method in the embodiment of the present invention, microservice architecture and multi-blockchain model are collected, and the microservice architecture and multi-blockchain model are matched based on a cross-chain interactive network; in the cross-chain interactive network, the transaction chain is collected, and is split into multiple application chain services based on the transaction chain; the multiple application chain services correspond to the multiple blockchains of the multi-blockchain model respectively; the cross-chain supervision service is triggered respectively based on the multiple application chain services, and cross-chain instructions are output; based on the cross-chain instructions, cross-chain operations between multiple application chains are executed, and the cross-chain operations are executed at the application layer of the multi-blockchain model. At this time, the focus of cross-chain intercommunication between multiple blockchains shifts from the blockchain layer to the application layer, so as to execute cross-chain operations between multiple application chains based on cross-chain instructions, and execute cross-chain operations at the application layer of the multi-blockchain model, so as to realize efficient cross-chain between multiple blockchains, thereby realizing safe and efficient business collaboration between multiple blockchains. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 It is a flowchart of the cross-chain method of blockchain in an embodiment of the present invention;
[0045] Figure 2 It is a flowchart of S11 in the cross-chain method of blockchain in an embodiment of the present invention;
[0046] Figure 3 It is a flowchart of S12 in the cross-chain method of blockchain in an embodiment of the present invention;
[0047] Figure 4 It is a flowchart of S13 in the cross-chain method of blockchain in an embodiment of the present invention;
[0048] Figure 5 It is a flowchart of S14 in the cross-chain method of blockchain in an embodiment of the present invention;
[0049] Figure 6 It is a schematic diagram of the structural composition of the cross-chain system of the blockchain in an embodiment of the present invention;
[0050] Figure 7 The figure is a hardware diagram of an electronic device according to an exemplary embodiment.
[0051] Reference numerals
[0052] 21. Association module; 22. Application chain service module; 23. Cross-chain instruction module; 24. Execution module;
[0053] 40. Electronic device; 41. Processing unit; 42. Storage unit; 421. Random access storage unit; 422. Cache storage unit; 423. Read-only storage unit (ROM); 424. Program / utility; 425. Program module; 43. Bus; 44. Input / output (I / O) interface; 45. Network adapter. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] Method Embodiment
[0056] See also Figures 1 to 7 , a cross-chain method of blockchain, applied to the cross-chain scenario of blockchain; the cross-chain method of blockchain includes:
[0057] Step S11: Collecting microservice architecture and multi-blockchain model, and matching microservice architecture and multi-blockchain model based on cross-chain interactive network;
[0058] Step S12: In the cross-chain interactive network, the transaction chain is collected and split into multiple application chain services based on the transaction chain; the multiple application chain services correspond to multiple blockchains of the multi-blockchain model respectively;
[0059] Step S13: triggering cross-chain supervision services based on multiple application chain services respectively, and outputting cross-chain instructions;
[0060] Step S14: Execute cross-chain operations between multiple application chains based on cross-chain instructions. The cross-chain operations are performed at the application layer of the multi-blockchain model.
[0061] In an embodiment of the present invention, through the method in the embodiment of the present invention, the focus of cross-chain intercommunication between multiple blockchains is shifted from the blockchain layer to the application layer, so as to perform cross-chain operations between multiple application chains based on cross-chain instructions, and perform cross-chain operations at the application layer of the multi-blockchain model, thereby achieving efficient cross-chain between multiple blockchains, thereby achieving safe and efficient business collaboration between multiple blockchains.
[0062] In step S11, the microservice architecture and the multi-blockchain model are collected, and the microservice architecture and the multi-blockchain model are matched based on the cross-chain interactive network;
[0063] In the specific implementation process of the present invention, the specific steps may be:
[0064] S111: Collection microservice architecture and multi-blockchain model;
[0065] S112: Communication connection based on microservice architecture and multi-blockchain model, and signal interaction under communication;
[0066] S113: Match the microservice architecture and the multi-blockchain model, and match the microservice architecture and the multi-blockchain model according to the cross-chain interactive network. At this time, the microservice architecture is combined with the multi-blockchain model.
[0067] In an embodiment of the present application, a microservice architecture and a multi-blockchain model are collected, and a communication connection is established between the microservice architecture and the multi-blockchain model to facilitate signal interaction under communication, thereby interacting communication signals based on the microservice architecture and the multi-blockchain model, thereby achieving matching between the microservice architecture and the multi-blockchain model.
[0068] At the same time, the microservice architecture and the multi-blockchain model are matched, and the microservice architecture and the multi-blockchain model are matched according to the cross-chain interactive network. At this time, the microservice architecture is combined with the multi-blockchain model. The multi-blockchain integration from the microservice perspective is to combine the microservice architecture with the multi-blockchain model, and correspond the multiple services in the microservice architecture to the blockchains in the multi-blockchain model one by one, so as to realize the integration and interoperability between multiple blockchains from the application layer perspective.
[0069] At this time, the cross-chain interactive network was introduced. The cross-chain interactive network is mainly responsible for the registration and search of application chain services within the network. It is equivalent to a directory service. The services that different blockchain platforms that need to participate in cross-chain transactions rely on can be registered on this cross-chain interactive network. After that, the microservice remote call method is used to conduct information interaction between the cross-chain supervision service (acting as a notary for a cross-chain transaction) and the application chain service (the role participating in a cross-chain transaction).
[0070] In step S12, in the cross-chain interactive network, the transaction chain is collected and split into multiple application chain services based on the transaction chain; the multiple application chain services correspond to multiple blockchains of the multi-blockchain model respectively;
[0071] In the specific implementation process of the present invention, the specific steps may be:
[0072] S121: Collect transaction chains in a cross-chain interactive network;
[0073] S122: split the tasks of the transaction chain into multiple application chain services;
[0074] S123: multiple application chain services are associated and relatively independent; multiple application chain services correspond to multiple blockchains in the multi-blockchain model.
[0075] In an embodiment of the present application, in a cross-chain interactive network, transaction chains are collected and task-split, thereby deeply decomposing the transaction chains and further splitting them into multiple application chain services to facilitate independent management and control of multiple application chain services. At this time, each application chain service separately stores the business data of the corresponding link to ensure the isolation of business data of different links.
[0076] Therefore, multiple application chain services are associated and relatively independent; multiple application chain services correspond to multiple blockchains in the multi-blockchain model. At this time, the application chain service, as an important component of the entire multi-blockchain fusion model, is a mapping of each common business module in the microservice. In a complex business scenario, multiple links are often involved. For example, in the mechanical equipment transaction chain, it can be divided into four links: sales / rental, purchase / leasing, equipment recycling, and transportation logistics. Each link in the transaction chain is maintained by a specific enterprise.
[0077] In this model, these links are divided into multiple application chain services. Each application chain service corresponds to a separate blockchain platform, which is called an application chain. It should be noted that the application chains in this model must support smart contracts. Each application chain stores the business data of the corresponding link separately, ensuring the isolation of business data in different links.
[0078] In step S13, cross-chain supervision services are triggered based on multiple application chain services respectively, and cross-chain instructions are output;
[0079] In the specific implementation process of the present invention, the specific steps may be:
[0080] S131: freeze multiple application chain services;
[0081] S132: Link multiple application chain services and cross-chain supervision services;
[0082] S133: Cross-chain supervision services are triggered separately according to multiple application chain services and are controlled by the cross-chain supervision services.
[0083] In an embodiment of the present application, multiple application chain services are frozen to facilitate associating multiple application chain services and cross-chain supervision services, so as to perform overall management and control based on multiple application chain services and cross-chain supervision services. At this time, the cross-chain supervision service is triggered separately according to multiple application chain services and is controlled by the cross-chain supervision service.
[0084] In addition, after receiving the cross-chain request, the cross-chain supervision service decrypts it using the corresponding shared key to obtain the plain text of the cross-chain instruction. According to the cross-chain request, the cross-chain instruction is split into instructions A and B, which are then encrypted using the shared key and sent to application chain service A and application chain service B respectively.
[0085] S14: Execute cross-chain operations between multiple application chains based on cross-chain instructions. The cross-chain operations are executed at the application layer of the multi-blockchain model.
[0086] In the specific implementation process of the present invention, the specific steps may be:
[0087] S141: Collect cross-chain instructions;
[0088] S142: Execute cross-chain operations between multiple application chains based on cross-chain instructions. At this time, each application chain service that needs to initiate a cross-chain transaction sends a cross-chain request to the cross-chain supervision service to indicate that this operation is a cross-chain operation;
[0089] S143: The cross-chain operation is performed at the application layer of the multi-blockchain model. At this time, the cross-chain focus is shifted from the blockchain layer to the application layer, and the integration and interoperability between multiple blockchains is achieved from the perspective of the application layer.
[0090] In the embodiment of the present application, cross-chain instructions are collected to facilitate the introduction of cross-chain instructions, and cross-chain operations between multiple application chains are performed based on cross-chain instructions. At this time, the focus of cross-chain intercommunication between multiple blockchains is shifted from the blockchain layer to the application layer, so as to facilitate the execution of cross-chain operations between multiple application chains based on cross-chain instructions, and perform cross-chain operations at the application layer of the multi-blockchain model, so as to achieve efficient cross-chain between multiple blockchains, thereby achieving safe and efficient business collaboration between multiple blockchains. Optionally, each application chain service that needs to initiate a cross-chain transaction sends a cross-chain request to the cross-chain supervision service to indicate that this operation is a cross-chain operation.
[0091] In the multi-blockchain fusion model, each application chain service that needs to initiate a cross-chain transaction must send a cross-chain request to the cross-chain supervision service to indicate that its operation is a cross-chain operation. In order to address the problem of difficult information interaction caused by differences in data structures, interface parameters and underlying implementations between different blockchain platforms, this article specifically designs a request format CCIR (Cross Chain Interaction Request) for initiating cross-chain transactions.
[0092] CCIR is a request format designed in this paper to address the problem that different blockchain layer structures may be different. It is different from general non-cross-chain requests and is used exclusively when cross-chain operations are required. In order to ensure the universality and flexibility of cross-chain requests, the main request fields of CCIR are shown in Table 1.
[0093] Table 1 CCIR request fields
[0094]
[0095] The cross-chain method of the blockchain also includes:
[0096] Collect cross-chain management contracts, which include five operations: registration, update, query, review and cancellation of application chain services;
[0097] During the registration and review of the application chain service, the application chain service joins the cross-chain network registration center and needs to provide registration information and submit a registration application; when the qualification review of the application chain service is passed, the cross-chain supervision service will issue a user certificate to the application chain service through its node, and the cross-chain supervision service will upload the specific information of the application chain service to the chain through the cross-chain management contract;
[0098] During the application chain service update, when some basic information of the application chain service changes, the application chain service administrator needs to initiate an update information request, which will be reviewed and approved by the cross-chain supervision service administrator and updated on the blockchain ledger of the cross-chain supervision service through the cross-chain management contract;
[0099] In the deregistration of the application chain service, when the application chain service wants to exit the cross-chain interactive network, the application chain service administrator needs to submit a deregistration request, and the cross-chain regulatory service administrator agrees to its deregistration, and the application chain service will be deleted in the cross-chain interactive network;
[0100] In the application chain service query, the cross-chain supervision service queries the world state on the supervision chain ledger based on EnrollId.
[0101] In order to realize cross-chain network management, the present invention designs a cross-chain management contract CCMC (Cross Chain Management Chaincode). CCMC mainly includes five operations of registration, update, query, review and cancellation of application chain services. Five smart contract functions are designed for this part of the functional logic. The main functional meanings of the five functions are shown in Table 2.
[0102] Table 2 CCMC function table
[0103]
[0104] In addition, in order to solve the problem of cross-chain transactions, we need to ensure the atomicity and consistency of cross-chain transactions and keep the blockchain ledger data of the cross-chain transaction initiating chain and the cross-chain transaction destination chain consistent before and after the cross-chain operation. This section proposes a cross-chain transaction solution based on a multi-stage commit protocol.
[0105] This solution divides the services involved in cross-chain transactions into two roles: cross-chain supervision services and application chain services. The cross-chain supervision service is responsible for receiving cross-chain requests from application chain services and acts as a manager of cross-chain transactions; the initiating chain service and destination chain service of cross-chain transactions are application chain services, acting as participants in cross-chain transactions.
[0106] This solution divides a complete cross-chain transaction process into the preparation stage and the submission stage. The preparation stage is mainly divided into the following steps:
[0107] The cross-chain supervision service sends a "Prepare" instruction to all application chain services involved in the cross-chain transaction process and waits for the application chain service to respond.
[0108] After receiving the "Prepare" instruction, the application chain service starts to perform local operations. At this time, the updated data is written to a third-party cache such as Redis as a transaction pre-operation, and the transaction is not committed.
[0109] If the local pre-operation is successful, a "YES" message is sent to the cross-chain supervision service to indicate that it is ready, otherwise a "NO" message is sent. Then the submission phase begins.
[0110] The submission phase is mainly divided into the following steps:
[0111] When the cross-chain supervision service receives all “Yes”:
[0112] The cross-chain supervision service sends a "Commit" instruction to all application chain services involved in the cross-chain transaction process, indicating that the application chain service can formally submit the transaction.
[0113] After receiving "Commit", the application chain service updates the application chain blockchain ledger by obtaining the value of the third-party cache, and returns an "ACK" message after the update is successful.
[0114] When the cross-chain supervision service receives all the "ACK" messages, the entire cross-chain transaction is initially completed, but the assets involved in the cross-chain transaction are frozen at this time, and cannot be used to participate in other transactions. It is necessary to verify whether the transaction of the corresponding application chain is executed correctly through the light client verification technology after ten blocks, that is, to verify whether a certain event on a chain occurs through the Merkle tree. When the verification is passed, the cross-chain supervision service will unfreeze the part involved in the cross-chain transaction and allow the part to be traded.
[0115] When the cross-chain supervision service receives "NO":
[0116] Since only operations were performed on the third-party cache during the preparation phase and no modification of the local blockchain ledger was involved, no additional undo modification operations were required. At this time, the cross-chain transaction failed and ended directly.
[0117] For cross-chain transaction process
[0118] Now, let’s take the example of application chain service A and application chain service B performing cross-chain interaction operations. The following is the specific process of cross-chain interaction between application chains:
[0119] Application chain service A first initiates a cross-chain request CCIR. The cross-chain regulatory service verifies the identity of application chain service A based on the Initiator field value of CCIR and the cross-chain verification package. If the identity review passes, it proceeds to the next step. If it fails, the cross-chain process ends.
[0120] After the cross-chain supervision service receives the cross-chain request CCIR, it decrypts it using the corresponding shared key to obtain the plain text of the cross-chain instruction. According to the CCIR, the cross-chain instruction is split into instructions A and B, which are then encrypted using the shared key and sent to application chain service A and application chain service B respectively.
[0121] Application chain services A and B decrypt instructions A and B respectively through their own shared keys. After confirmation, they perform corresponding local pre-operations according to the instructions. At this time, the ledger data of the blockchain is not actually updated.
[0122] After completing the local pre-operation, application chain services A and B return the operation information results to the cross-chain supervision service.
[0123] The cross-chain supervision service collects the pre-operation information returned by the application chain service. If all are executed successfully, a formal submission instruction is sent to the application chain services A and B. If one of the executions fails or the waiting time exceeds the Timeout expiration time, the process ends and the cross-chain operation is canceled.
[0124] After receiving the formal submission instructions from the cross-chain supervision service, application chain services A and B will actually execute the chain operation and then send an ACK response message to the cross-chain supervision service. At this time, the blockchain ledger data will be truly updated.
[0125] After the cross-chain supervision service receives the ACK message from the application chain, the cross-chain transaction is basically completed. However, in order to determine whether the application chain services A and B have completed the correct update operation, the assets involved in the transaction are frozen, that is, they cannot be used. If the ACK message is not received after waiting for more than the Timeout time, the cross-chain operation will be cancelled.
[0126] After ten blocks, the cross-chain supervision service verifies whether the cross-chain transaction between application chains A and B is executed correctly. If it is executed correctly, the corresponding asset status will be unfrozen. If it fails, the cross-chain transaction will be terminated.
[0127] When the cross-chain transaction is completed, the cross-chain supervision service will store the information involved in the cross-chain transaction (cross-chain transaction ID, initiating chain name, destination chain name, initiating user chain address, receiving user chain address, transaction content, transaction status, transaction time) on the chain.
[0128] At this time, the functional solution of multi-blockchain integration from the perspective of microservices can well realize cross-chain operations between multiple blockchains, and the average delay of cross-chain transactions in the scenario of concurrent numbers of 25, 50, 75, 100 and 200 is not much different from the average delay of non-cross-chain transactions. The delay difference between cross-chain transactions and non-cross-chain transactions comes from the communication overhead of receiving, distributing instructions and verifying transactions. The delay required for transactions is within a completely acceptable range in system application development. Based on this, there is no significant impact on the performance of cross-chain transactions. The processing delays of cross-chain transactions and non-cross-chain transactions at the blockchain layer are relatively close, which can well meet the needs of real applications and users.
[0129] In an embodiment of the present invention, through the method in the embodiment of the present invention, microservice architecture and multi-blockchain model are collected, and the microservice architecture and multi-blockchain model are matched based on a cross-chain interactive network; in the cross-chain interactive network, the transaction chain is collected, and is split into multiple application chain services based on the transaction chain; the multiple application chain services correspond to the multiple blockchains of the multi-blockchain model respectively; the cross-chain supervision service is triggered respectively based on the multiple application chain services, and cross-chain instructions are output; based on the cross-chain instructions, cross-chain operations between multiple application chains are executed, and the cross-chain operations are executed at the application layer of the multi-blockchain model. At this time, the focus of cross-chain intercommunication between multiple blockchains shifts from the blockchain layer to the application layer, so as to execute cross-chain operations between multiple application chains based on cross-chain instructions, and execute cross-chain operations at the application layer of the multi-blockchain model, so as to realize efficient cross-chain between multiple blockchains, thereby realizing safe and efficient business collaboration between multiple blockchains.
[0130] In this article, a blockchain cross-chain technology based on a microservice framework is proposed. This technology combines the microservice architecture with the blockchain technology from the perspective of cross-chain at the application layer, and minimizes the impact on cross-chain transaction performance. The experimental results based on this invention show that the processing delays of cross-chain transactions and non-cross-chain transactions at the blockchain layer are relatively close, which can well meet the needs of real applications and users.
[0131] In addition, through the concept of microservices, complex systems can be split into multiple independent service units. Each service unit relies on an independent application chain to run, and cross-chain interactive network autonomous management is achieved through smart contracts. This solution can adapt to cross-chain scenarios of both homogeneous and heterogeneous blockchains.
[0132] A cross-chain transaction solution is implemented based on a multi-phase commit protocol, which divides cross-chain transactions into two stages. The transaction manager is used to coordinate transaction management to ensure the final consistency of cross-chain transactions.
[0133] The cross-chain supervision service splits, distributes and monitors cross-chain transaction instructions, which is simple to implement, greatly improves the efficiency of cross-chain transactions, and can achieve a higher level of cross-chain interoperability and collaboration.
[0134] The present invention is of great significance for the practical application of cross-chain. This solution of realizing cross-chain at the application layer can provide flexible and scalable solutions for different business scenarios, and achieve a higher level of cross-chain interoperability and collaboration.
[0135] System Example
[0136] See also Figure 6 , Figure 6 It is a schematic diagram of the structural composition of the cross-chain system of the blockchain in an embodiment of the present invention.
[0137] like Figure 6As shown, a cross-chain system of blockchain, the cross-chain system of blockchain includes:
[0138] An association module 21, for collecting microservice architectures and multi-blockchain models, and matching microservice architectures and multi-blockchain models based on a cross-chain interactive network;
[0139] The application chain service module 22 is used to collect the transaction chain in the cross-chain interactive network, and split it into multiple application chain services based on the transaction chain; the multiple application chain services correspond to multiple blockchains of the multi-blockchain model respectively;
[0140] The cross-chain instruction module 23 is used to trigger the cross-chain supervision service based on multiple application chain services and output the cross-chain instruction;
[0141] The execution module 24 is used to execute cross-chain operations between multiple application chains based on cross-chain instructions. The cross-chain operations are executed at the application layer of the multi-blockchain model.
[0142] Example
[0143] See also Figure 7 , refer to the following Figure 7 The electronic device 40 according to this embodiment of the present invention will be described. Figure 7 The electronic device 40 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0144] like Figure 7 As shown, the electronic device 40 is in the form of a general computing device. The components of the electronic device 40 may include but are not limited to: at least one processing unit 41, at least one storage unit 42, and a bus 43 connecting different system components (including the storage unit 42 and the processing unit 41).
[0145] The storage unit stores program codes, which can be executed by the processing unit 41, so that the processing unit 41 executes the steps according to various exemplary embodiments of the present invention described in the above “Embodiment Method” section of this specification.
[0146] The storage unit 42 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit 421 and / or a cache storage unit 422 , and may further include a read-only storage unit (ROM) 423 .
[0147] The storage unit 42 may also include a program / utility 424 having a set (at least one) of program modules 425, such program modules 425 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0148] Bus 43 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0149] The electronic device 40 may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 40, and / or any device that enables the electronic device 40 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 44. Furthermore, the electronic device 40 may also communicate with one or more networks (e.g., local area networks, wide area networks, and / or public networks, such as the Internet) via a network adapter 45. Figure 7 As shown, the network adapter 45 communicates with other modules of the electronic device 40 via the bus 43. It should be understood that although Figure 7 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, tape drives, and data backup planning systems.
[0150] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0151] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: a read-only memory, a random access memory, a disk or an optical disk, etc. In addition, it stores computer program instructions, and when the computer program instructions are executed by a computer, the computer executes the above method.
[0152] In addition, the cross-chain method and system of the blockchain provided by the embodiments of the present invention are introduced in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A cross-chain method of blockchain, characterized in that: Applied to cross-chain scenarios of blockchain; The cross-chain method of the blockchain includes: Collect microservice architecture and multi-blockchain models, and match microservice architecture and multi-blockchain models based on cross-chain interactive networks; In the cross-chain interactive network, the transaction chain is collected and split into multiple application chain services based on the transaction chain; multiple application chain services correspond to multiple blockchains in the multi-blockchain model; Based on multiple application chain services, cross-chain supervision services are triggered respectively, and cross-chain instructions are output; Execute cross-chain operations between multiple application chains based on cross-chain instructions. Cross-chain operations are performed at the application layer of the multi-blockchain model. The collecting of microservice architecture and multi-blockchain model, and matching of microservice architecture and multi-blockchain model based on cross-chain interactive network, includes: collecting microservice architecture and multi-blockchain model; making communication connection based on microservice architecture and multi-blockchain model, and performing signal interaction under communication; matching microservice architecture and multi-blockchain model, and matching microservice architecture and multi-blockchain model according to cross-chain interactive network, at this time, combining microservice architecture with multi-blockchain model; In the cross-chain interactive network, the transaction chain is collected and split into multiple application chain services based on the transaction chain; the multiple application chain services correspond to multiple blockchains of the multi-blockchain model respectively, including: in the cross-chain interactive network, the transaction chain is collected; the task is split for the transaction chain and split into multiple application chain services; multiple application chain services are associated and relatively independent; the multiple application chain services correspond to multiple blockchains of the multi-blockchain model respectively.
2. The cross-chain method of blockchain according to claim 1, characterized in that: In the cross-chain interactive network, the transaction chain is collected and split into multiple application chain services based on the transaction chain; Multiple application chain services correspond to multiple blockchains in the multi-blockchain model, including: Each application chain service stores the business data of the corresponding link separately to ensure the isolation of business data in different links.
3. The cross-chain method of blockchain according to claim 2, characterized in that: The cross-chain supervision service is triggered based on multiple application chain services respectively, and cross-chain instructions are output, including: Freeze multiple application chain services; Link multiple application chain services and cross-chain supervision services; The cross-chain supervision service is triggered according to multiple application chain services and is controlled by the cross-chain supervision service; Output cross-chain instructions based on cross-chain supervision services.
4. The cross-chain method of blockchain according to claim 3, characterized in that: The method triggers cross-chain supervision services based on multiple application chain services respectively and outputs cross-chain instructions, and also includes: After receiving the cross-chain request, the cross-chain supervision service decrypts it using the corresponding shared key to obtain the plain text of the cross-chain instruction. According to the cross-chain request, the cross-chain instruction is split into instructions A and B, which are then encrypted using the shared key and sent to application chain service A and application chain service B respectively.
5. The cross-chain method of blockchain according to claim 4, characterized in that: The cross-chain operation between multiple application chains is performed based on the cross-chain instruction, and the cross-chain operation is performed at the application layer of the multi-blockchain model, including: Collect cross-chain instructions; Based on cross-chain instructions, cross-chain operations between multiple application chains are executed. At this time, each application chain service that needs to initiate a cross-chain transaction sends a cross-chain request to the cross-chain supervision service to indicate that this operation is a cross-chain operation.
6. The cross-chain method of blockchain according to claim 5, characterized in that: The cross-chain operation between multiple application chains is performed based on the cross-chain instruction, and the cross-chain operation is performed at the application layer of the multi-blockchain model, and also includes: Cross-chain operations are performed at the application layer of the multi-blockchain model. At this time, the cross-chain focus is shifted from the blockchain layer to the application layer, and the integration and interoperability of multiple blockchains are achieved from the perspective of the application layer.
7. The cross-chain method of blockchain according to claim 6, characterized in that: The cross-chain method of the blockchain also includes: Collect cross-chain management contracts, which include five operations: registration, update, query, review and cancellation of application chain services; During the registration and review of the application chain service, the application chain service joins the cross-chain network registration center. At this time, provide registration information and submit a registration application. When the qualification review of the application chain service is passed, the cross-chain supervision service will issue a user certificate to the application chain service through its node. The cross-chain supervision service uploads the specific information of the application chain service to the chain through the cross-chain management contract; During the application chain service update, when some basic information of the application chain service changes, the application chain service administrator needs to initiate an update information request, which will be reviewed and approved by the cross-chain supervision service administrator and updated on the blockchain ledger of the cross-chain supervision service through the cross-chain management contract; In the deregistration of the application chain service, when the application chain service wants to exit the cross-chain interactive network, the application chain service administrator needs to submit a deregistration request, and the cross-chain regulatory service administrator agrees to its deregistration, and the application chain service will be deleted in the cross-chain interactive network; In the application chain service query, the cross-chain supervision service queries the world state on the supervision chain ledger based on EnrollId.
8. A cross-chain system of blockchain, characterized in that: The cross-chain system of the blockchain is applied to the cross-chain method of the blockchain as described in any one of claims 1 to 7, and the cross-chain system of the blockchain includes: The association module is used to collect microservice architectures and multi-blockchain models, and match microservice architectures and multi-blockchain models based on a cross-chain interactive network; The application chain service module is used to collect transaction chains in the cross-chain interactive network and split them into multiple application chain services based on the transaction chains; multiple application chain services correspond to multiple blockchains in the multi-blockchain model respectively; The cross-chain instruction module is used to trigger cross-chain supervision services based on multiple application chain services and output cross-chain instructions; An execution module is used to execute cross-chain operations between multiple application chains based on cross-chain instructions. The cross-chain operations are executed at the application layer of the multi-blockchain model. The collecting of microservice architecture and multi-blockchain model, and matching of microservice architecture and multi-blockchain model based on cross-chain interactive network, includes: collecting microservice architecture and multi-blockchain model; making communication connection based on microservice architecture and multi-blockchain model, and performing signal interaction under communication; matching microservice architecture and multi-blockchain model, and matching microservice architecture and multi-blockchain model according to cross-chain interactive network, at this time, combining microservice architecture with multi-blockchain model; In the cross-chain interactive network, the transaction chain is collected and split into multiple application chain services based on the transaction chain; the multiple application chain services correspond to multiple blockchains of the multi-blockchain model respectively, including: in the cross-chain interactive network, the transaction chain is collected; the task is split for the transaction chain and split into multiple application chain services; multiple application chain services are associated and relatively independent; the multiple application chain services correspond to multiple blockchains of the multi-blockchain model respectively.
