CN116186749A - Block chain-based service processing method and device, electronic equipment and readable medium - Google Patents

Block chain-based service processing method and device, electronic equipment and readable medium Download PDF

Info

Publication number
CN116186749A
CN116186749A CN202111437323.3A CN202111437323A CN116186749A CN 116186749 A CN116186749 A CN 116186749A CN 202111437323 A CN202111437323 A CN 202111437323A CN 116186749 A CN116186749 A CN 116186749A
Authority
CN
China
Prior art keywords
transaction
blockchain
result
chain
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111437323.3A
Other languages
Chinese (zh)
Inventor
朱耿良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202111437323.3A priority Critical patent/CN116186749A/en
Publication of CN116186749A publication Critical patent/CN116186749A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Abstract

Based on the technical problems, the application provides a block chain-based service processing method, a block chain-based service processing device, electronic equipment and a readable medium. The method comprises the following steps: receiving a transaction notification sent by a relay server; performing cross-chain data processing according to the cross-chain transaction data in the transaction notification to obtain a data processing result, and packaging the data processing result and the pre-validation state information of the data processing result to generate a transaction block and uplink the transaction block in a second block chain; according to the transaction block, sending a transaction response to the relay server; and receiving a transaction completion message sent by the relay server, packaging the data processing result and the validation information of the data processing result into a receiving result block according to the transaction completion message, and uploading the receiving result block in a second block chain. The method does not need to arrange a transaction protocol of a relay chain and additional blockchain operation in the blockchain, reduces the complexity of the transaction process and improves the execution efficiency of the transaction process.

Description

Block chain-based service processing method and device, electronic equipment and readable medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, an electronic device, and a readable medium for processing a service based on a blockchain.
Background
Blockchains are application modes of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like, and are used for concatenating and protecting serial transaction records (also called blocks) of content by means of cryptography. The distributed ledgers concatenated with blockchains enable multiple parties to effectively record transactions and permanently verify the transaction (non-tamperable).
In the related art, when conducting a cross-chain transaction between blockchains, one relay blockchain is typically employed to relay the transaction between two blockchains.
However, to use a relay blockchain requires the deployment of a related relay protocol in the blockchain of both parties involved in the transaction, and the introduction of additional blockchain operations in the computation of the cross-chain transaction process increases the complexity of the overall cross-chain transaction process, reducing the execution efficiency of the transaction process.
Disclosure of Invention
Based on the technical problems, the application provides a business processing method, a business processing device, electronic equipment and a readable medium based on a blockchain, so that data transaction of a cross-chain is carried out between two blockchains through a relay server, a transaction protocol of the relay chain is not required to be deployed in the blockchain, additional blockchain operation is not required, the complexity of a transaction process is reduced, and the execution efficiency of the transaction process is improved.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned in part by the practice of the application.
According to an aspect of the embodiments of the present application, there is provided a method for processing a block chain based service, including:
receiving a transaction notification sent by a relay server, wherein the transaction notification comprises cross-chain transaction data from a first blockchain, and the transaction notification is generated by the relay server in response to a transaction request from the first blockchain;
performing cross-chain data processing according to the cross-chain transaction data in the transaction notification to obtain a data processing result, and packaging the data processing result and the pre-validation state information of the data processing result to generate a transaction block and uplink the transaction block in a second block chain;
according to the transaction block, sending a transaction response to the relay server so that the relay server generates a transaction completion message according to the transaction response;
and receiving a transaction completion message sent by the relay server, packaging the data processing result and the validation information of the data processing result into a receiving result block according to the transaction completion message, and uploading the receiving result block in a second block chain.
According to an aspect of the embodiments of the present application, there is provided a method for processing a block chain based service, including:
Packaging cross-chain transaction data and pre-validation state information of the cross-chain transaction data into blocks to be transacted and uplinking the blocks to be transacted in a first blockchain;
generating a transaction request according to the blockchain information of the block to be transacted and the second blockchain and sending the transaction request to the relay server;
receiving a transaction result notice sent by the relay server, wherein the transaction result notice is generated according to a data processing result in the second blockchain, and the data processing result is obtained by performing cross-chain data processing according to cross-chain transaction data according to the second blockchain;
in response to the transaction result notification, sending a result confirmation message to the relay server, so that the relay server generates a transaction completion message according to the result confirmation message;
and receiving a transaction completion message sent by the relay server, packaging the cross-chain transaction data and the confirmation effect information of the cross-chain transaction data into a sending result block according to the transaction completion message, and uploading the sending result block in the first blockchain.
According to an aspect of the embodiments of the present application, there is provided a method for processing a block chain based service, including:
receiving a transaction request sent by a first blockchain, wherein the transaction request comprises cross-chain transaction data from the first blockchain and blockchain information of a second blockchain;
In response to the transaction request, generating a transaction notification according to the cross-chain transaction data, and sending the transaction notification to the second blockchain according to the blockchain information;
receiving a transaction response sent by the second blockchain, and sending a transaction result notification to the first blockchain according to the transaction response, wherein the transaction response comprises data processing according to cross-chain transaction data to obtain a data processing result;
receiving a result confirmation message from the first blockchain, the result confirmation message generated in response to the transaction result notification;
and generating a transaction completion message and sending the transaction completion message to the first blockchain and the second blockchain according to the transaction response and the result confirmation message.
According to an aspect of the embodiments of the present application, there is provided a block chain based service processing apparatus, including: the system comprises a transaction notification receiving module, a cross-chain data processing module, a transaction response sending module and a first completion message receiving module.
The transaction notification receiving module is used for receiving a transaction notification sent by the relay server, wherein the transaction notification comprises cross-chain transaction data from a first blockchain, and the transaction notification is generated by the relay server in response to a transaction request from the first blockchain; the cross-chain data processing module is used for performing cross-chain data processing according to cross-chain transaction data in the transaction notification to obtain a data processing result, and packaging the data processing result and pre-validation state information of the data processing result to generate a transaction block and uploading the transaction block in a second block chain; the transaction response sending module is used for sending a transaction response to the relay server according to the transaction block so that the relay server generates a transaction completion message according to the transaction response; the first completion message receiving module is used for receiving the transaction completion message sent by the relay server, packaging the data processing result and the confirmation effect information of the data processing result into a receiving result block according to the transaction completion message, and uploading the receiving result block in the second block chain.
In one embodiment of the present application, based on the foregoing scheme, the transaction response sending module is configured to: signing the data processing result in the transaction block to obtain a receiving confirmation signature; a transaction response is generated based on the receipt of the validation signature and the data processing result, and the transaction response is sent to the relay server.
In one embodiment of the present application, based on the foregoing scheme, the transaction completion message includes a relay signature, the relay signature being a signature generated by the relay server from a transmission acknowledgement signature of the first blockchain and a reception acknowledgement signature of the second blockchain; the first completion message receiving module is configured to: acquiring a relay signature from the transaction completion message; the relay signature is packaged to generate a received result block, and the received result block is uplinked in a second blockchain.
In one embodiment of the present application, based on the foregoing solution, the first completion message receiving module is configured to: detecting a time interval from the transmission of the transaction response to the receipt of the transaction completion message from the relay server; discarding the transaction completion message if the time interval exceeds the time threshold; if the time interval is less than the time threshold, saving the transaction completion message.
According to an aspect of the embodiments of the present application, there is provided a block chain based service processing apparatus, including: the system comprises a transaction data packaging module, a transaction request sending module, a result notification receiving module, a confirmation message sending module and a second completion message receiving module.
The transaction data packaging module is used for packaging cross-chain transaction data and pre-validation state information of the cross-chain transaction data into blocks to be transacted and enabling the blocks to be transacted to be uplink in a first blockchain; the transaction request sending module is used for generating a transaction request according to the blockchain information of the block to be transacted and the second blockchain and sending the transaction request to the relay server; the result notification receiving module is used for receiving a transaction result notification sent by the relay server, wherein the transaction result notification is generated according to a data processing result in the second blockchain, and the data processing result is obtained by performing cross-chain data processing according to cross-chain transaction data by the second blockchain; the confirmation message sending module is used for responding to the transaction result notification and sending a result confirmation message to the relay server so that the relay server generates a transaction completion message according to the result confirmation message; the second completion message receiving module is used for receiving the transaction completion message sent by the relay server, packaging the cross-chain transaction data and the confirmation effect information of the cross-chain transaction data into a sending result block according to the transaction completion message, and uplinking the sending result block in the first blockchain.
In one embodiment of the present application, based on the foregoing scheme, the acknowledgement message sending module is configured to: responding to the transaction result notice, signing the cross-chain transaction data in the block to be transacted to obtain a sending confirmation signature; a result confirmation message is generated from the transmission confirmation signature and transmitted to the relay server.
In one embodiment of the present application, based on the foregoing scheme, the transaction completion message includes a relay signature, the relay signature being a signature generated by the relay server from a transmission acknowledgement signature of the first blockchain and a result acknowledgement signature of the second blockchain; the second completion message receiving module is configured to: acquiring a relay signature from the transaction completion message; the relay signature is packaged to generate a transmit result block, and the transmit result block is uplinked in the first blockchain.
In one embodiment of the present application, based on the foregoing solution, the second completion message receiving module is configured to: detecting a time interval when a transaction completion message from the relay server is received from the transmission result confirmation message; discarding the transaction completion message if the time interval exceeds the time threshold; if the time interval is less than the time threshold, saving the transaction completion message.
In one embodiment of the present application, based on the foregoing scheme, the first blockchain and the second blockchain are sub-chains derived from blocks of different heights in the master blockchain; the transaction request transmitting module is configured to: querying server information of a relay server and blockchain information of a second blockchain from a main blockchain; generating a transaction request according to the blockchain information of the second blockchain and the blockinformation of the block to be transacted; and sending a transaction request to the relay server according to the server information.
According to an aspect of the embodiments of the present application, there is provided a block chain based service processing apparatus, including: the system comprises a transaction request receiving module, a transaction notification generating module, a transaction response receiving module, a confirmation message receiving module and a completion message sending module.
The transaction request receiving module is used for receiving a transaction request sent by a first blockchain, wherein the transaction request comprises cross-chain transaction data from the first blockchain and blockchain information of a second blockchain; the transaction notification generation module is used for responding to the transaction request, generating a transaction notification according to the cross-chain transaction data and sending the transaction notification to the second blockchain according to the blockchain information; the transaction response receiving module is used for receiving a transaction response sent by the second blockchain and sending a transaction result notification to the first blockchain according to the transaction response, wherein the transaction response comprises data processing according to cross-chain transaction data to obtain a data processing result; a confirmation message receiving module for receiving a result confirmation message from the first block link, the result confirmation message being generated in response to the transaction result notification; and the completion message sending module is used for generating a transaction completion message according to the transaction response and the result confirmation message and sending the transaction completion message to the first blockchain and the second blockchain.
In one embodiment of the present application, based on the foregoing solution, the blockchain-based service processing device further includes: the session starting module is used for starting a transaction session and monitoring the session duration of the transaction session according to the transaction request; the state updating module is used for updating the state of the transaction session to an ending state when the session duration exceeds the session duration threshold; and the message discarding module is used for discarding the received message when receiving the message related to the cross-chain transaction data and the data processing result.
In one embodiment of the present application, based on the foregoing, the transaction response includes a result confirmation signature, and the result confirmation message includes a send confirmation signature; the completion message sending module is configured to: checking the status of the transaction session; if the transaction session is in an active state, updating the transaction session to a completed state and generating a relay result signature according to the transaction request, the transaction response and the result confirmation message; and generating a transaction completion message according to the relay result signature.
In one embodiment of the present application, based on the foregoing scheme, the first blockchain and the second blockchain are sub-chains derived from blocks of different heights in the master blockchain; the block chain based service processing device further comprises: the registration request module is used for sending a registration request to the main blockchain so that the main blockchain generates a registration block based on the registration request, wherein the registration request comprises server information of the relay server; and the relay service starting module is used for receiving the registration response sent by the main blockchain and starting the relay service for receiving the transaction request according to the registration response.
According to an aspect of the embodiments of the present application, there is provided an electronic device including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the blockchain-based service processing method as in the above technical solution via execution of executable instructions.
According to an aspect of the embodiments of the present application, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a blockchain-based service processing method as in the above technical solution.
According to an aspect of embodiments of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions are read from the computer-readable storage medium by a processor of a computer device, and executed by the processor, cause the computer device to perform the various alternative implementations described above to provide a blockchain-based business processing method.
In an embodiment of the present application, the consensus node of the blockchain receives a transaction notification sent by a relay server, wherein the transaction notification includes cross-chain transaction data from a first blockchain, the transaction notification being generated by the relay server in response to a transaction request from the first blockchain; performing cross-chain data processing according to the cross-chain transaction data in the transaction notification to obtain a data processing result, and packaging the data processing result and the pre-validation state information of the data processing result to generate a transaction block and uplink the transaction block in a second block chain; according to the transaction block, sending a transaction response to the relay server so that the relay server generates a transaction completion message according to the transaction response; and receiving a transaction completion message sent by the relay server, packaging the data processing result and the validation information of the data processing result into a receiving result block according to the transaction completion message, and uploading the receiving result block in a second block chain. By adopting the mode, the data transaction of the cross-chain is carried out between the two blockchains through the relay server, so that a transaction protocol of the relay chain is not required to be deployed in the blockchain, additional blockchain operation is not required, the complexity of the transaction process is reduced, and the execution efficiency of the transaction process is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
In the drawings:
fig. 1 shows a schematic diagram of a blockchain network.
Fig. 2 to 4 show architecture diagrams of a blockchain system to which embodiments of the present application are applied.
FIG. 5 shows a schematic diagram of an electronic invoice system according to one embodiment of the application.
Fig. 6 shows a schematic diagram of a multi-chain scenario according to one embodiment of the present application.
FIG. 7 illustrates a flow chart of a blockchain-based business processing method in accordance with an embodiment of the present application;
FIG. 8 illustrates a schematic diagram of a cross-chain transaction between sub-chains according to one embodiment of the present application;
FIG. 9 illustrates a block diagram of a blockchain-based business processing device in accordance with an embodiment of the present application;
fig. 10 shows a schematic diagram of a computer system suitable for use in implementing the electronic device of the embodiments of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present application. One skilled in the relevant art will recognize, however, that the aspects of the application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the application.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
Blockchain (Blockchain) is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like. Blockchains are essentially a de-centralized database, which is a series of data blocks (i.e., blocks) that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeiting) of the information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
The blockchain underlying platform may include processing modules for user management, basic services, smart contracts, operation monitoring, and the like. The user management module is responsible for identity information management of all blockchain participants, including maintenance of public and private key generation (account management), key management, maintenance of corresponding relation between the real identity of the user and the blockchain address (authority management) and the like, and under the condition of authorization, supervision and audit of transaction conditions of certain real identities, and provision of rule configuration (wind control audit) of risk control; the basic service module is deployed on all block chain node devices, is used for verifying the validity of a service request, recording the service request on a storage after the effective request is identified, for a new service request, the basic service firstly analyzes interface adaptation and authenticates the interface adaptation, encrypts service information (identification management) through an identification algorithm, and transmits the encrypted service information to a shared account book (network communication) in a complete and consistent manner, and records and stores the service information; the intelligent contract module is responsible for registering and issuing contracts, triggering contracts and executing contracts, a developer can define contract logic through a certain programming language, issue the contract logic to a blockchain (contract registering), invoke keys or other event triggering execution according to the logic of contract clauses to complete the contract logic, and simultaneously provide a function of registering contract upgrading; the operation monitoring module is mainly responsible for deployment in the product release process, modification of configuration, contract setting, cloud adaptation and visual output of real-time states in product operation, for example: alarms, monitoring network conditions, monitoring node device health status, etc.
The platform product service layer provides basic capabilities and implementation frameworks of typical applications, and developers can complete the blockchain implementation of business logic based on the basic capabilities and the characteristics of the superposition business. The application service layer provides the application service based on the block chain scheme to the business participants for use.
Referring to the blockchain network shown in fig. 1, a plurality of nodes 101 may be included in the blockchain network, and the plurality of nodes 101 may be individual clients forming the blockchain network. Each node 101 may receive input information while operating normally and maintain shared data within the blockchain network based on the received input information. In order to ensure information intercommunication in the blockchain network, information connection can exist between every two nodes in the blockchain network, and information transmission can be carried out between the nodes through the information connection. For example, when any node in the blockchain network receives input information, other nodes in the blockchain network acquire the input information according to a consensus algorithm, and store the input information as shared data, so that the data stored on all nodes in the blockchain network are consistent.
For each node in the blockchain network, there is a node identification corresponding thereto, and each node in the blockchain network may store the node identifications of other nodes for subsequent broadcasting of the generated blocks to other nodes in the blockchain network based on the node identifications of the other nodes. Each node can maintain a node identification list, and the node names and the node identifications are correspondingly stored in the node identification list. The node identifier may be an IP (Internet Protocol, protocol interconnecting between networks) address, or any other information that can be used to identify the node.
Each node in the blockchain network stores one and the same blockchain. The block chain consists of a plurality of blocks, the starting block comprises a block head and a block main body, the block head stores an input information characteristic value, a version number, a time stamp, a difficulty value and the like, and the block main body stores input information; the next block of the starting block takes the starting block as a father block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value, the version number, the timestamp, the difficulty value and the like of the father block, and the like, so that the block data stored in each block in the block chain are associated with the block data stored in the father block, and the safety of the input information in the block is ensured.
When each block in the blockchain is generated, when the node where the blockchain is positioned receives input information, checking the input information, after the checking is finished, storing the input information into a memory pool, and updating a hash tree used for recording the input information; and updating the update time stamp to the time of receiving the input information, trying different random numbers, calculating the characteristic value for a plurality of times, and when the random numbers meeting the conditions are calculated, correspondingly storing the information to generate a block head and a block main body to obtain the current block. And then, the node where the blockchain is located sends the newly generated blocks to other nodes in the data sharing system where the newly generated blocks are located according to the node identification of other nodes in the data sharing system, the other nodes verify the newly generated blocks, and the newly generated blocks are added into the blockchain stored by the newly generated blocks after the verification is completed. Wherein, the node can perform consensus verification on the newly generated block through a consensus algorithm, and the consensus algorithm can comprise but is not limited to: pow (Proof of Work), pos (Proof of equity), DPos (Delegated Proof of Stake Proof of equity) share authorization Proof mechanism, PBFT (Practical Byzantine Fault Tolerance, bayer fault tolerance algorithm), paxos (a distributed algorithm) algorithm, and Raft (a distributed consensus algorithm) algorithm. Wherein Pow (Proof of Work): workload certification refers to a metric set by a system (such as the blockchain network system described above) to achieve a certain goal. Pos (proof of interest): pos equity proof is an upgrade consensus mechanism for Pow workload proof; specifically, the longer the time who holds an electronic resource (the length of time that an electronic resource is held=the number of electronic resources that are held) the more the who has the opportunity to acquire the billing right for the block. DPos (Delegated Proof of Stake, delegated rights proving) share authorization proving mechanism: the DPos share authorization proof mechanism is similar to a board vote, where the object holding the electronic resource selects a certain number of nodes by voting, brokering them for checksum accounting. PBFT (Practical Byzantine Fault Tolerance, bayer fault tolerance algorithm): the PBFT bayer fault tolerance algorithm is a message transfer based consistency algorithm that agrees with three phases that may be repeated due to failure. Paxos (a distributed algorithm) algorithm: the Paxos algorithm is a two-stage algorithm with three main roles, proposer, accept, learner. Proposer issues agreement, acceptance or rejection, and learner obtains the final value after consensus. Raft (a distributed consensus algorithm) algorithm: the Raft algorithm contains three roles, respectively: all nodes of the follower (follower), candidate (leader) and leader (leader) are initially in the state of the follower, the follower which does not receive the heartbeat packet after time-out changes body of the follower and broadcasts a voting request, the node which obtains the majority vote takes the avatar leader, the process of voting is who gives advantage first, and each node only gives one vote.
Alternatively, each node in the blockchain network may be a server or a terminal device. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a Cloud server providing Cloud services, cloud databases, cloud Computing (Cloud Computing), cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content distribution networks), basic Cloud Computing services such as big data and artificial intelligent platforms, and the like. The terminal device may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart home, a vehicle-mounted terminal, and the like. The nodes may be directly or indirectly connected through wired or wireless communication, which is not limited herein.
The cloud computing refers to a delivery and use mode of an IT infrastructure, and specifically refers to obtaining required resources in an on-demand and easily-expandable manner through a network; generalized cloud computing refers to the delivery and usage patterns of services, meaning that the required services are obtained in an on-demand, easily scalable manner over a network. Such services may be IT, software, internet related, or other services. Cloud Computing is a product of fusion of traditional computer and network technology developments such as Grid Computing (Grid Computing), distributed Computing (Distributed Computing), parallel Computing (Parallel Computing), utility Computing (Utility Computing), network storage (Network Storage Technologies), virtualization (Virtualization), load balancing (Load balancing), and the like. With the development of the internet, real-time data flow and diversification of connected devices, and the promotion of demands of search services, social networks, mobile commerce, open collaboration and the like, cloud computing is rapidly developed. Unlike the previous parallel distributed computing, the generation of cloud computing will promote the revolutionary transformation of the whole internet mode and enterprise management mode in concept.
Based on the blockchain technology, the embodiment of the application provides an architecture of a blockchain system. As shown in fig. 2, the blockchain system includes a network of accounting nodes 2 and a network of traffic nodes 1. The accounting node network 2 comprises accounting nodes 21 that agree on the data blocks and record the data blocks onto the blockchain. The service node network 1 comprises a service node 11, which service node 11 may verify the data blocks recorded by the accounting node onto the blockchain or may request corresponding transaction data from the accounting node.
Specifically, the service node 11 may verify the data block recorded by the accounting node onto the blockchain, which may include the following steps: a billing node 21 in the billing node network generates a signature based on transaction information to be included in a data chunk to be added to the blockchain using a key specific to the billing node; accounting node 21 adds the transaction information and the generated signature to the data block, adding to the blockchain; the accounting node 21 sends the signature to a service node in the service node network, which verifies the signature based on a key specific to the accounting node to enable the service node 11 to verify the data blocks recorded by the accounting node onto the blockchain. The accounting nodes in the accounting node network are responsible for recording the data blocks to the blockchain and the service nodes in the service node network are responsible for witnessing the results of the accounting node records. Specifically, the accounting node generates a signature based on transaction information to be included in one data chunk to be added to the blockchain, and then adds the transaction information and the generated signature to the data chunk for uplink. And transmitting the signature to a service node in the service node network, causing the service node to verify the signature based on a key specific to the accounting node. Service nodes in the service node network can witnesse the transaction data of the whole network by verifying the accounting node signature on the block. The accounting node network, while possessing monopolizing accounting rights, is publicly traceable in all acts because the data block has a digital signature representing the identity of the accounting party. If the accounting nodes act in aggregate, then all nodes in the service node network will retain evidence of the particular accounting node acting. Compared with the traditional centralized system and the private chain, the system in the embodiment of the application runs more transparently; compared with the traditional decentralization scheme, the scheme is more controllable and more convenient to monitor.
In one embodiment of the present application, the accounting node network 2 and the service node network 1 may be connected by means of a proxy node 12, the proxy node 12 may be a service node of the service node network 1, which is responsible for transferring information to be transferred by the accounting node 21 to the service node 11. The service node 11 is a terminal of a transaction party generating various transaction data to be uplinked, or a terminal of inquiring transaction data from the accounting node network 2. Transaction data generated by the service node 11 is transmitted to the accounting node 21 through the proxy node 12 and then recorded on the blockchain after being commonly recognized, so that unified processing and supervision of the transaction data are facilitated, and the service node 11 can also conduct uplink supervision and witness of the transaction data through information sent by the accounting node 21 through the proxy node 12, which is of great significance in certain scenes that nodes which need unified supervision and are afraid of supervision are cheated collectively, and therefore supervision is needed.
In the architecture shown in fig. 1, the service node network 1 adopts a P2P (Peer to Peer) network mode. P2P networks are a distributed application architecture that distributes tasks and workloads among peers, a form of networking or network that peer-to-peer computing models form at the application layer, i.e., a "point-to-point" or "end-to-end" network. It can be defined as: participants in the network share a portion of the hardware resources (processing power, storage power, network connectivity, printers, etc.) they own, which provide services and content through the network that can be accessed directly by other peer nodes without going through intermediate entities. The participants in this network are both providers of resources, services and content and acquisitors of resources, services and content. Therefore, in the service node network 1, when the proxy node 12 receives the message transmitted from the accounting node 21, the message propagates to the surrounding service nodes 11, and the surrounding service nodes 11 receive the message and then transmit the message to the surrounding service nodes 11, so that the message propagates between each service node 11 of the service node network 1.
FIG. 3 illustrates an architecture of another blockchain system used in the embodiments of the present application. The architecture differs from the architecture shown in fig. 2 in that: the P2P network mode is not adopted in the service node network 1, but the mode of the broadcast network is adopted. Specifically, the proxy node 12, upon receiving the message delivered from the accounting node 21, broadcasts the message to the other service nodes 11 in the service node network 1. In this way, propagation of the message between each service node 11 of the service node network 1 is also achieved.
FIG. 4 illustrates an architecture of another blockchain system to which embodiments of the present invention are applied. The architecture differs from the architecture shown in fig. 2 in that: the network of accounting nodes 2 is divided into a plurality of branched accounting node networks. Each branch billing node network may be responsible for the recording of some type of transaction information. For example, an enterprise may have a supply chain financial business, and may need to record information such as contract information, credit, etc. generated during the supply and distribution process to the blockchain, and also issue an invoice, and record information such as issue invoice, reimbursement invoice, etc. to the blockchain. At this time, in order to facilitate the need for the accounting node to be administered by the same department, the accounting node that records the supply chain financial business transaction and the accounting node that records the transaction during the invoice flow may be separate departments. For example, the accounting node that records supply chain financial transactions is a bank-set accounting terminal, and the accounting node that records transactions during invoice flows is a national tax office-set accounting terminal. And the supply chain financial business transactions and transactions during the recording invoice flows may also eventually be recorded on a different branch of the billing node network. At this time, the proxy node 12 transmits the transaction information to the branch accounting node network corresponding to the transaction type according to the transaction type carried in the transaction information transmitted from the service node 11.
It should be noted that, in the architecture of the blockchain system shown in fig. 2 to 4, the proxy node 12 is located in the service node network 1, and in other embodiments of the present application, the proxy node 12 may also be located in the consensus node network 2, or be independent from the service node network 1 and the consensus node network 2.
The architecture of the blockchain system shown in fig. 2 to 6 may be applied in the application scenario of electronic invoices, and is described in detail below:
in one embodiment of the present application, the accounting nodes in the accounting node network may be respective tax administration terminals, for example, the accounting node network is formed by tax administration terminals deployed in a plurality of regions as one accounting node respectively. Each service node in the service node network may be a local tax office terminal, an invoicing proxy server terminal, an invoicing enterprise terminal, a personal user terminal, etc.
Specifically, in the electronic invoice system shown in fig. 5, a service layer, a routing agent layer, and a consensus network (i.e., a billing node network, hereinafter referred to as a billing network) layer may be included. The service layer is a service node network, and includes each service node, for example, a local tax office in a tax private network; billing service providers, reimbursement service providers, enterprises, etc. in public cloud; payment facilitators, circulation facilitators, businesses, etc. in the private cloud.
The routing proxy layer comprises proxy nodes, the proxy nodes provide functions of routing service, certificate caching and authentication service, P2P service and the like, and the routing proxy layer plays a role in isolating a service layer and a consensus network layer, and the technical scheme of the embodiment is specifically referred to. Alternatively, the agent nodes in the routing agent layer may be in a tax private network. The consensus network (accounting network) layer is an accounting node network, which includes a plurality of blockchains, although in other embodiments of the present application, the consensus network (accounting network) layer may also include one blockchain.
In one embodiment of the present application, a consensus network (accounting network) in an electronic invoice system may include multiple blockchains that may be time-sequential, such as time-sequential, for example, with the same business being identical for the business participants and both blockchains employing the same CA (Certificate Authority, authentication authority) center as the authentication and authorization party for the invoice business system. Of course, in an embodiment of the present application, the splitting may be performed according to different services, for example, service a corresponds to one blockchain, service B corresponds to one blockchain, and inter-link interaction may also be performed between services.
Alternatively, as shown in fig. 6, in an exemplary embodiment, the consensus network (the consensus network may be the consensus network shown in fig. 2 to 5, or may be a separate consensus network, that is, a consensus network obtained by not dividing a service network and a consensus network) may include a plurality of blockchains, specifically, a main chain 801, and N subchains derived from the main chain 801 at a block height, where N is a positive integer, and each time a new subchain is derived, a new chain identifier needs to be generated for the new subchain. For example, in fig. 6, backbone 801 may derive a sub-chain 802, a sub-chain 803, and a sub-chain 804. One sub-chain can correspond to one service, for example, in the tax service field, so that different transaction services can be effectively distinguished, so that the specificity of data stored by a single service branched chain can be kept, and specific services can be bill service, credit investigation service, import and export service, enterprise qualification service, tax refund service and the like.
In one embodiment of the present application, the main chain 801 in the consensus network may include registration information of a sub-chain corresponding to each service, where the registration information may include a chain identifier of the sub-chain, service configuration information corresponding to the service, a derivative condition corresponding to the chain identifier, and so on. Optionally, after each sub-link is generated, registration is required in a main chain, and an intelligent contract for managing registration of the sub-link is arranged in the main chain, and when the sub-link is registered, a link identifier can be allocated to the sub-link and registration information of the sub-link can be recorded.
Alternatively, the service configuration information corresponding to the service (e.g., ticket service) may include basic information of the service (i.e., description of the ticket service) and node configuration information (including service node configuration information and consensus node configuration information). The service node configuration information may include a node identifier configured by a common node with administrative authority (e.g., node 120a with administrative authority) for a corresponding service branch (e.g., a service branch corresponding to a ticket service), where the node identifier corresponds to a service node that may be used to execute the ticket service. The consensus node configuration information here may include a consensus node having administrative authority configured for the sub-chain for participating in consensus of the sub-chain.
Alternatively, the generation block of each sub-chain may be the block corresponding to the generation of the main chain, for example, as shown in fig. 6, the sub-chain 802 is derived from the block A1 in the main chain 801, where the generation block is A1; the subchain 803 is derived from block A2 in the main chain 801, which creates block A2; the sub-chain 804 is derived from block A3 in the main chain 801, which creates block A3. When verifying the sub-chain blocks, the A chain can be found from the generated blocks of the sub-chain, and then verified to the generated blocks of the A chain (such as the Merker tree), so that the verification reliability is improved. Of course, if the local of the consensus node has synchronized the A-chain, then the verification of the sub-chain block may only verify its creation block on the A-chain.
Alternatively, if the configuration information of the blockchain node system (e.g., tax blockchain system) corresponding to the entire blockchain network changes, the consensus nodes in the consensus network need to be suspended. If the configuration information with information changes is referred to as configuration change information, the configuration change information may refer to regulatory rules for tax domain categories, computing regulatory changes, important block link point changes, chain certificate issuing node rotations, and the like. The common node with the supervision authority in the common network can generate a configuration change block based on the configuration change information, and further uplink the configuration change block to the main chain 801 in the common network and synchronize to all sub-chains, at this time, other common nodes in the common network can resume operation. As shown in fig. 6, assuming that the configuration information is changed, a configuration change block A3 is generated in the main chain 801, and then synchronization is performed in the sub-chain, such as a block B5 in the sub-chain 802, and a block C4 in the sub-chain 803.
Alternatively, for the system architecture shown in fig. 2 to 5, M chain identifiers may be configured for any service node in the service network, where the M chain identifiers belong to the chain identifiers of the N service branches registered in the consensus network. Wherein M is a positive integer less than or equal to N. The number of the chain identifiers configured for each service node may be the same or different, and will not be limited herein.
For example, if the number of sub-links derived from the main chain in the consensus network is 3, and the link identifiers of the 3 sub-links are respectively a link identifier 1s corresponding to a service 1X (e.g., a ticket service), a link identifier 2s corresponding to a service 2X (e.g., a credit sign service), and a link identifier 3s corresponding to a service 3X (e.g., an import/export service), 2 link identifiers (e.g., a link identifier 1s and a link identifier 3 s) may be dynamically configured for one service node in the service network, and 3 link identifiers (e.g., a link identifier 1s, a link identifier 2s, and a link identifier 3 s) may be dynamically configured for another service node in the service network. It can be understood that if a service node is configured with multiple chain identifiers, the service node can participate in executing services corresponding to the sub-chains by the multiple chain identifiers, so that control over the service node can be effectively ensured.
Alternatively, although the backbone chain is derived from different sub-chains, the sub-chains and the backbone chain may still be subjected to a common-knowledge uplink process by the same common-knowledge node, the transaction information may be distinguished according to the chain identity, and the unused sub-chains may be respectively and concurrently common-knowledge.
Of course, some sub-chains may also be configured to be commonly recognized by independent commonly recognized nodes, but these independent commonly recognized nodes must synchronize the data of the backbone. Specifically, for example, the consensus nodes that independently consensus a sub-chain may form a sub-chain independent consensus network, and the consensus nodes that independently consensus a main chain may form a main chain independent consensus network.
Meanwhile, the agent node needs to record the information of the independent consensus network, and if a request for transmitting transaction information or synchronous data to the independent consensus network is met, the information is forwarded to the independent consensus network; otherwise, the request is checked according to the basic configuration and then forwarded to the consensus node of the core network, and the consensus node is independently processed according to the sub-chain ID of the request.
Alternatively, in order to reduce the waste of the storage space of the service node, the service node in the embodiment of the present application may take a lightweight node (Simplified Payment Verification, abbreviated as SPV) as an example, where the service node does not need to store complete transaction data, but obtains the block header data and the block data with visible partial authorization (such as the service transaction associated with the service node itself) from the consensus network through the proxy node. An SPV node may dynamically configure multiple sub-chain IDs to participate in the services of multiple sub-chains, and multiple sub-chains may participate with the same SPV node identifier and address, where the SPV node identifier and address must be registered on the main chain in advance, and block data of each sub-chain may be independently synchronized back to the SPV node and stored independently locally at the SPV node.
For the multi-chain scenario introduced in the foregoing embodiment, a service processing method based on a blockchain is also provided in the embodiment of the present application, which is specifically introduced as follows:
FIG. 7 illustrates a flow chart of a method of blockchain-based transaction processing to which other blockchains initiate a cross-chain transaction in response to which nodes in the blockchain execute the methods described herein, in accordance with an embodiment of the present application. Specifically, the scheme of the present application may be applied to the blockchain system shown in fig. 6, where the blockchain system includes at least two sub-chains. The sub-chain 802 may initiate a cross-chain transaction to the sub-chain 803, and the scheme of the present application is executed by the sub-chain 803 to perform the cross-chain transaction initiated by the sub-chain 802. The blockchain-based service processing method shown in fig. 7 may be performed by a blockchain consensus node, and referring to fig. 7, the blockchain-based service processing method at least includes steps S910 to S940, which are described in detail as follows:
in step S910, a transaction notification sent by a relay server is received, where the transaction notification includes cross-chain transaction data from a first blockchain, and the transaction notification is generated by the relay server in response to a transaction request from the first blockchain.
In particular, relay servers are typically network devices in a trusted environment with respect to blockchains on which services for conducting cross-chain transactions are deployed. The relay server can verify the states of the block and the data in the process of performing cross-chain transaction, and nodes of the block chain transmit the verification and tracking process to the relay server, so that the data volume and the calculation volume of the block chain are reduced. In this embodiment, the consensus node of the second blockchain receives a transaction notification sent by the relay server, wherein the transaction notification includes cross-chain transaction data from the first blockchain, the transaction notification being generated by the relay server in response to a transaction request from the first blockchain.
Step S920, performing cross-chain data processing according to the cross-chain transaction data in the transaction notification to obtain a data processing result, and packaging the data processing result and the pre-validation state information of the data processing result to generate a transaction block for uplink in the second blockchain.
And the consensus node of the second blockchain performs cross-chain data processing according to the cross-chain transaction data in the transaction notification to obtain a data processing result, and packages the data processing result and the pre-validation state information of the data processing result to generate a transaction block and uplinks the transaction block in the second blockchain. The pre-validation state information is a state in which the data processing result is not validated by the first blockchain although it is uplink. In a subsequent process, the second blockchain switches the data processing result to an effective state according to the confirmation of the data processing result by the first blockchain.
In step S930, according to the transaction block, a transaction response is sent to the relay server, so that the relay server generates a transaction completion message according to the transaction response.
The consensus node of the second blockchain sends a transaction response to the relay server according to the transaction block. The transaction response triggers the relay server to notify each of the first and second blockchains participating in the transaction to complete the cross-chain transaction process.
In one embodiment of the present application, based on the foregoing scheme, the process of sending the transaction response to the relay server according to the transaction block may include: signing the data processing result in the transaction block to obtain a receiving confirmation signature; a transaction response is generated based on the receipt of the validation signature and the data processing result, and the transaction response is sent to the relay server.
Step S940, receiving the transaction completion message sent by the relay server, and packaging the data processing result and the validation information of the data processing result into a received result block according to the transaction completion message, and uplinking the received result block in the second blockchain.
The consensus node of the second blockchain receives a transaction completion message sent by the relay server. The transaction completion message is a message sent by the relay node after both processes involving the cross-chain transaction are performed, thereby notifying the first and second blockchains that the marking data in the respective blockchains is valid.
The consensus node packages the data processing result and the validation information of the data processing result into a receiving result block according to the transaction completion message, and uplinks the receiving result block in the second blockchain. And confirming that the validation information and the pre-validation state information are corresponding relations, wherein the correspondence relation indicates that the data processing result in the pre-validation state is formally validated. The received result block upper chain shows that the cross-chain transaction process of the second block chain side is formally completed, and the data processing result in the second block chain is formally effective. Thus, there are two chunks in the second blockchain that are related to the data processing result, where the transaction chunk represents the pre-validation of the cross-chain transaction data and the received result chunk represents the formal validation of the cross-chain transaction data. It will be appreciated that if there is only a transaction block without a corresponding received result block, indicating that the cross-chain transaction failed, the data processing results in the transaction block will not be effective.
In one embodiment of the present application, based on the foregoing scheme, the process of receiving the transaction completion message sent by the relay server includes: a time interval from the time the transaction response was sent to the time the transaction completion message received from the relay server was detected. In particular, the time interval may be implemented in the form of a session being established or in the form of a timer. Discarding the transaction completion message if the time interval exceeds the time threshold; if the time interval is less than the time threshold, saving the transaction completion message.
In one embodiment of the present application, based on the foregoing scheme, the transaction completion message includes a relay signature, the relay signature being a signature generated by the relay server from a transmission acknowledgement signature of the first blockchain and a reception acknowledgement signature of the second blockchain; the process of uplink receiving the result block in the second blockchain in accordance with the transaction complete message may include: acquiring a relay signature from the transaction completion message; the relay signature is packaged to generate a received result block, and the received result block is uplinked in a second blockchain.
In one embodiment of the present application, a blockchain-based business processing method is provided for initiating cross-chain transactions to other blockchains. Specifically, the scheme of the present application may be applied to the blockchain system shown in fig. 6, where the blockchain system includes at least two sub-chains. The sub-chain 802 may initiate a cross-chain transaction to the sub-chain 803, while the aspects of the present application initiate a cross-chain transaction by the sub-chain 802. The blockchain-based service processing method may be performed by a blockchain consensus node, and the blockchain-based service processing method at least includes steps S1010 to S1050, which are described in detail below:
Step S1010, packaging the cross-chain transaction data and the pre-validation status information of the cross-chain transaction data into blocks to be transacted and uplinking the blocks to be transacted in the first blockchain.
In the solution of the present embodiment, a first blockchain initiates a cross-chain transaction to a second blockchain, and a common node of the first blockchain packages cross-chain transaction data and pre-validation status information of the cross-chain transaction data into blocks to be transacted and uplinks the blocks to be transacted in the first blockchain. The pre-validation state information is a state in which cross-chain transaction data is not validated by the second blockchain, but is not yet validated, although it is uplink. In a subsequent process, the first blockchain switches the cross-chain transaction data to an active state based on the validation of the cross-chain transaction data by the second blockchain.
Step S1020, generating a transaction request according to the blockchain information of the to-be-transacted block and the second blockchain and sending the transaction request to the relay server.
And the consensus node of the first blockchain generates a transaction request according to the blockchain information of the block to be transacted and the second blockchain and sends the transaction request to the relay server. Before proceeding with the transaction, the relay server registers, allowing the consensus node of the blockchain to obtain relevant information. The consensus node is transacting a request to the relay server to initiate a cross-chain transaction to a node of the second blockchain through the relay server. The relay server forwards the cross-chain transaction data and the pre-validation state information of the cross-chain transaction data in the block to be transacted to the node of the second blockchain according to the blockchain information of the second blockchain.
In one embodiment of the present application, based on the foregoing scheme, the first blockchain and the second blockchain are sub-chains derived from blocks of different heights in the master blockchain; the process of generating a transaction request and transmitting the transaction request to the relay server according to the blockchain information of the block to be transacted and the second blockchain may include: querying server information of a relay server and blockchain information of a second blockchain from a main blockchain; generating a transaction request according to the blockchain information of the second blockchain and the blockinformation of the block to be transacted; and sending a transaction request to the relay server according to the server information.
Step S1030, receiving a transaction result notification sent by the relay server, where the transaction result notification is generated according to a data processing result in the second blockchain, and the data processing result is obtained by performing cross-chain data processing according to the cross-chain transaction data according to the second blockchain.
The consensus node of the first blockchain receives a transaction result notification sent by the relay server. The transaction outcome notification is generated by the relay server. And the second blockchain processes the cross-chain transaction data to obtain a data processing result and feeds the data processing result back to the relay server. The relay server generates a transaction outcome notification based on the return and sends it to the first blockchain.
In step S1040, in response to the transaction result notification, a result confirmation message is sent to the relay server, so that the relay server generates a transaction completion message according to the result confirmation message.
The consensus node of the first blockchain sends a result confirmation message to the relay server in response to the transaction result notification, so that the relay server generates a transaction completion message according to the result confirmation message. The acknowledgment message indicates that the first blockchain acknowledges receipt of the data processing result of the second blockchain. The relay server determines that the transaction process of the first blockchain is completed according to the result confirmation message.
In one embodiment of the present application, based on the foregoing solution, in response to the transaction result notification, the process of sending the result confirmation message to the relay server includes: responding to the transaction result notice, signing the cross-chain transaction data in the block to be transacted to obtain a sending confirmation signature; a result confirmation message is generated from the transmission confirmation signature and transmitted to the relay server. The transmit validation signature represents a validation of the transaction result by the first blockchain.
In one embodiment of the present application, based on the foregoing scheme, the transaction completion message includes a relay signature, the relay signature being a signature generated by the relay server from a transmission acknowledgement signature of the first blockchain and a result acknowledgement signature of the second blockchain; the process of linking the send result block in the first blockchain includes: acquiring a relay signature from the transaction completion message; the relay signature is packaged to generate a transmit result block, and the transmit result block is uplinked in the first blockchain.
Step S1050, receiving a transaction completion message sent by the relay server, packaging the cross-chain transaction data and the confirmation validity information of the cross-chain transaction data into a sending result block according to the transaction completion message, and uploading the sending result block in a second blockchain.
The consensus node of the first blockchain receives a transaction completion message sent by the relay server and packages the cross-chain transaction data and validation information of the cross-chain transaction data into a sending result block according to the transaction completion message. The validation information and the pre-validation state information are corresponding relations, and represent that the cross-chain transaction data in the pre-validation state is formally validated. The transaction confirmation block upper chain indicates that the cross-chain transaction process of the first blockchain side is formally completed, and the cross-chain transaction data in the first blockchain is formally validated. Thus, there are two chunks in the second blockchain that are related to cross-chain transaction data, where the chunk to be transacted represents the pre-validation of cross-chain transaction data and the transaction validation chunk represents the formal validation of cross-chain transaction data. It will be appreciated that if only transaction blocks exist without corresponding transaction confirmation blocks, indicating that the cross-chain transaction failed, the cross-chain transaction data in the transaction block will not be validated. The common node of the first blockchain will then forward the resulting block to be uplink in the second blockchain.
In one embodiment of the present application, based on the foregoing scheme, the process of receiving the transaction completion message sent by the relay server includes the following steps: detecting a time interval when a transaction completion message from the relay server is received from the transmission result confirmation message; discarding the transaction completion message if the time interval exceeds the time threshold; if the time interval is less than the time threshold, saving the transaction completion message. Wherein the time threshold represents the timeout time of the current transaction.
In one embodiment of the present application, a blockchain-based business processing method is provided for servicing cross-chain transactions between blockchains. Specifically, the scheme of the present application may be applied to the blockchain system shown in fig. 6, where the blockchain system includes at least two sub-chains. The sub-chain 802 may initiate a cross-chain transaction to the sub-chain 803, which is then executed by a server in a trusted execution environment (Trusted Execution Environment, TEE) to complete the cross-chain transaction between the sub-chain 802 and the sub-chain 803. The block chain based service processing method at least comprises steps S1060 to S1100, and is described in detail as follows:
in step S1060, a transaction request sent by the first blockchain is received, wherein the transaction request includes cross-chain transaction data from the first blockchain and blockchain information of the second blockchain.
The relay server receives a transaction request sent by a node in the first blockchain. The transaction request is sent by a node in the first blockchain at or after the time of the uplink cross-chain transaction data in the first blockchain. The transaction request also includes blockchain information of a second blockchain that is a target of the transaction.
In an embodiment of the present application, based on the foregoing solution, the service processing method further includes: according to the transaction request, starting a transaction session and monitoring the session duration of the transaction session; when the session duration exceeds the session duration threshold, updating the state of the transaction session to an ending state; when a message associated with cross-chain transaction data and data processing results is received, the received message is discarded. A communication channel is provided for the process of the cross-chain transaction by establishing a session and controlling the duration of the cross-chain transaction based on the session.
Step S1070, in response to the transaction request, generating a transaction notification according to the cross-chain transaction data and transmitting the transaction notification to the second blockchain according to the blockchain information.
In response to the transaction request, the relay server generates a transaction notification based on the cross-chain transaction data in the request and sends the transaction notification to the second blockchain based on the blockchain information. The transaction notification is used to notify the second blockchain that the first blockchain initiates a cross-chain transaction request.
Step S1080, receiving a transaction response sent by the second blockchain, and sending a transaction result notification to the first blockchain according to the transaction response, wherein the transaction response comprises data processing according to cross-chain transaction data to obtain a data processing result.
The relay server receives the transaction response sent by the second blockchain and sends a transaction result notification to the first blockchain according to the transaction response. The transaction response is a transaction response issued by a node in the second blockchain after cross-chain data processing. The transaction response comprises data processing according to the cross-chain transaction data to obtain a data processing result. The relay server sends a transaction result notification to the first blockchain. The transaction outcome notification may include the data processing outcome. Before sending the transaction result notification, the relay server can also perform data verification according to the received transaction request and transaction response, for example, verify the data states of both parties, the states of blocks in the block chain, the consistency of the data and other information related to cross-chain transactions, so as to ensure the accuracy of the transmitted data.
In step S1090, a result confirmation message is received from the first blockchain, the result confirmation message being generated in response to the transaction result notification.
The relay server receives a result confirmation message from the first blockchain, the result confirmation message being generated in response to the transaction result notification. After receiving the transaction result notification, the node of the first blockchain may acquire and store data in the notification and send result confirmation information in response to the transaction result notification to confirm receipt of the information from the second blockchain.
Step S1100, generating a transaction completion message and sending the transaction completion message to the first blockchain and the second blockchain according to the transaction response and the result confirmation message.
The relay server generates a transaction completion message according to the transaction response and the result confirmation message. Specifically, based on the transaction response and the result confirmation message, the relay server may confirm that the transaction process in both blockchains has been completed, at which time the relay server verifies the result of the cross-chain transaction, e.g., the integrity of both data, the consistency of the received data with the data in the blockchain, etc., based on the transaction response and the result confirmation message. After the verification passes, a transaction completion message is sent to the first and second blockchains, triggering the first and second blockchains to end the cross-chain transaction process and causing the respective data to be marked as valid in the blockchains.
In one embodiment of the present application, based on the foregoing, the transaction response includes a result confirmation signature, and the result confirmation message includes a send confirmation signature; the process of generating a transaction completion message based on the transaction response and the result confirmation message includes: checking the status of the transaction session; if the transaction session is in an active state, updating the transaction session to a completed state and generating a relay result signature according to the transaction request, the transaction response and the result confirmation message; and generating a transaction completion message according to the relay result signature. The relay server indicates that the transaction between the blockchains is normally performed by providing the signature, and the transaction result can be conformed according to the signature, so that the follow-up fault detection is facilitated.
In one embodiment of the present application, based on the foregoing scheme, the first blockchain and the second blockchain are sub-chains derived from blocks of different heights in the master blockchain; the service processing method further comprises the following steps: sending a registration request to a main blockchain so that the main blockchain generates a registration block based on the registration request, wherein the registration request comprises server information of a relay server; and receiving a registration response sent by the main blockchain, and starting a relay service for receiving the transaction request according to the registration response. The relay server needs to register with the main blockchain first to provide formal relay service, so that the environment of the relay server can be verified, and the reliability of the system is improved.
The implementation details of the technical solution of the embodiments of the present application are described in detail below with reference to fig. 8, and as shown in fig. 8, the blockchain system includes a main chain 801, a sub-chain 802, a sub-chain 803, and a TEE cross-chain relay service 804.
TEE cross-chain relay service 804 registers with backbone 801 as a cross-chain relay prior to proceeding with the service. When a sub-chain 802 needs to conduct a cross-chain transaction with a sub-chain 803, the backbone 801 may be queried for a valid TEE cross-chain relay service 804. Wherein a valid service may refer to a relay service that has registered but does not provide services for other blockchains. Thereafter, the sub-chain 802 uplinks block B6 according to the cross-chain transaction data and its corresponding pre-validation state information X and submits a transaction request PrePutX to the TEE cross-chain relay service 804. At this point, the TEE cross-chain relay service 804 will create a session for the cross-chain transaction. The TEE cross-chain relay service 804 notifies the information of the block B6 to the sub-chain 803, and after receiving the notification message, the sub-chain 803 performs cross-chain processing to obtain a data processing result and corresponding pre-validation state information Y thereof, and uplinks the corresponding block C7 in the sub-chain 803. While the sub-chain 803 replies a transaction confirmation message PrePutY to the TEE cross-chain relay service 804. Upon receiving the transaction confirmation message PrePutY, the TEE cross-chain relay service 804 notifies the sub-chain 802 of the information of the transaction confirmation message PrePutY.
After the sub-chain 802 and the sub-chain 803 each acquire the transaction request PrePutX and the transaction confirmation message PrePutY submitted by the counterpart from the TEE cross-chain relay service 804, each confirms the signature of the transaction and transmits the TEE cross-chain relay service 804. And the TEE cross-chain relay service 804 sets the session state to cross done after receiving the acknowledgement from both parties.
The sub-chains 802 and 803 start timing after sending acknowledgement signatures until a cross done message of session and a signature of the TEE cross-chain relay service 804 are received from the TEE cross-chain relay service 804, then a new block is uplink in the respective blockchain, including acknowledgement validation information corresponding to the pre-validation state information X and Y and the signature of the TEE cross-chain relay service 804. Indicating completion across chains, i.e., B7 and C8.
If the Session of TEE cross-chain relay service 804 times out, the Session state will be set to Session Over and no cross done message will be sent out, whereas if either the timing of sub-chain 802 and sub-chain 803 times out, both will not process the received cross done message. At this point, the blocks containing the corresponding validation information will not be uplinked in the sub-chains 802 and 803, nor will the data in the previously uplinked blocks containing the pre-validation state information.
It should be noted that although the steps of the methods in the present application are depicted in the accompanying drawings in a particular order, this does not require or imply that the steps must be performed in that particular order, or that all illustrated steps be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
In the specific embodiments of the present application, related data such as user information, transaction data in blocks, etc., when the embodiments of the present application are applied to specific products or technologies, user permissions or agreements need to be obtained, and the collection, use and processing of related data need to comply with related laws and regulations and standards of related countries and regions.
Fig. 9 illustrates a block diagram of a blockchain-based traffic processing device, which the blockchain-based traffic processing device shown in fig. 9 may be disposed within a consensus node, in accordance with an embodiment of the present application.
Referring to fig. 9, a block chain based service processing apparatus 1100 according to an embodiment of the present application includes: a transaction notification reception module 1102, a cross-chain data processing module 1104, a transaction response transmission module 1106, and a first completion message reception module 1108.
The transaction notification receiving module 1102 is configured to receive a transaction notification sent by the relay server, where the transaction notification includes cross-chain transaction data from the first blockchain, and the transaction notification is generated by the relay server in response to a transaction request from the first blockchain; the cross-chain data processing module 1104 is configured to perform cross-chain data processing according to cross-chain transaction data in the transaction notification, obtain a data processing result, and package the data processing result and pre-validation state information of the data processing result to generate a transaction block for uplink in the second blockchain; a transaction response sending module 1106, configured to send a transaction response to the relay server according to the transaction block, so that the relay server generates a transaction completion message according to the transaction response; the first completion message receiving module 1108 is configured to receive a transaction completion message sent by the relay server, package the data processing result and the validation information of the data processing result into a receiving result block according to the transaction completion message, and uplink the receiving result block in the second blockchain.
In one embodiment of the present application, based on the foregoing scheme, the transaction response transmitting module 1106 is configured to: signing the data processing result in the transaction block to obtain a receiving confirmation signature; a transaction response is generated based on the receipt of the validation signature and the data processing result, and the transaction response is sent to the relay server.
In one embodiment of the present application, based on the foregoing scheme, the transaction completion message includes a relay signature, the relay signature being a signature generated by the relay server from a transmission acknowledgement signature of the first blockchain and a reception acknowledgement signature of the second blockchain; the first completion message receiving module 1108 is configured to: acquiring a relay signature from the transaction completion message; the relay signature is packaged to generate a received result block, and the received result block is uplinked in a second blockchain.
In one embodiment of the present application, based on the foregoing scheme, the first completion message receiving module 1108 is configured to: detecting a time interval from the transmission of the transaction response to the receipt of the transaction completion message from the relay server; discarding the transaction completion message if the time interval exceeds the time threshold; if the time interval is less than the time threshold, saving the transaction completion message.
In one embodiment, a blockchain-based service processing device according to the present application includes: the system comprises a transaction data packaging module, a transaction request sending module, a result notification receiving module, a confirmation message sending module and a second completion message receiving module.
The transaction data packaging module is used for packaging cross-chain transaction data and pre-validation state information of the cross-chain transaction data into blocks to be transacted and enabling the blocks to be transacted to be uplink in a first blockchain; the transaction request sending module is used for generating a transaction request according to the blockchain information of the block to be transacted and the second blockchain and sending the transaction request to the relay server; the result notification receiving module is used for receiving a transaction result notification sent by the relay server, wherein the transaction result notification is generated according to a data processing result in the second blockchain, and the data processing result is obtained by performing cross-chain data processing according to cross-chain transaction data by the second blockchain; the confirmation message sending module is used for responding to the transaction result notification and sending a result confirmation message to the relay server so that the relay server generates a transaction completion message according to the result confirmation message; the second completion message receiving module is used for receiving the transaction completion message sent by the relay server, packaging the cross-chain transaction data and the confirmation effect information of the cross-chain transaction data into a sending result block according to the transaction completion message, and uplinking the sending result block in the first blockchain.
In one embodiment of the present application, based on the foregoing scheme, the acknowledgement message sending module is configured to: responding to the transaction result notice, signing the cross-chain transaction data in the block to be transacted to obtain a sending confirmation signature; a result confirmation message is generated from the transmission confirmation signature and transmitted to the relay server.
In one embodiment of the present application, based on the foregoing scheme, the transaction completion message includes a relay signature, the relay signature being a signature generated by the relay server from a transmission acknowledgement signature of the first blockchain and a result acknowledgement signature of the second blockchain; the second completion message receiving module is configured to: acquiring a relay signature from the transaction completion message; the relay signature is packaged to generate a transmit result block, and the transmit result block is uplinked in the first blockchain.
In one embodiment of the present application, based on the foregoing solution, the second completion message receiving module is configured to: detecting a time interval when a transaction completion message from the relay server is received from the transmission result confirmation message; discarding the transaction completion message if the time interval exceeds the time threshold; if the time interval is less than the time threshold, saving the transaction completion message.
In one embodiment of the present application, based on the foregoing scheme, the first blockchain and the second blockchain are sub-chains derived from blocks of different heights in the master blockchain; the transaction request transmitting module is configured to: querying server information of a relay server and blockchain information of a second blockchain from a main blockchain; generating a transaction request according to the blockchain information of the second blockchain and the blockinformation of the block to be transacted; and sending a transaction request to the relay server according to the server information.
In one embodiment, a blockchain-based service processing device according to the present application includes: the system comprises a transaction request receiving module, a transaction notification generating module, a transaction response receiving module, a confirmation message receiving module and a completion message sending module.
The transaction request receiving module is used for receiving a transaction request sent by a first blockchain, wherein the transaction request comprises cross-chain transaction data from the first blockchain and blockchain information of a second blockchain; the transaction notification generation module is used for responding to the transaction request, generating a transaction notification according to the cross-chain transaction data and sending the transaction notification to the second blockchain according to the blockchain information; the transaction response receiving module is used for receiving a transaction response sent by the second blockchain and sending a transaction result notification to the first blockchain according to the transaction response, wherein the transaction response comprises data processing according to cross-chain transaction data to obtain a data processing result; a confirmation message receiving module for receiving a result confirmation message from the first block link, the result confirmation message being generated in response to the transaction result notification; and the completion message sending module is used for generating a transaction completion message according to the transaction response and the result confirmation message and sending the transaction completion message to the first blockchain and the second blockchain.
In one embodiment of the present application, based on the foregoing solution, the blockchain-based service processing device further includes: the session starting module is used for starting a transaction session and monitoring the session duration of the transaction session according to the transaction request; the state updating module is used for updating the state of the transaction session to an ending state when the session duration exceeds the session duration threshold; and the message discarding module is used for discarding the received message when receiving the message related to the cross-chain transaction data and the data processing result.
In one embodiment of the present application, based on the foregoing, the transaction response includes a result confirmation signature, and the result confirmation message includes a send confirmation signature; the completion message sending module is configured to: checking the status of the transaction session; if the transaction session is in an active state, updating the transaction session to a completed state and generating a relay result signature according to the transaction request, the transaction response and the result confirmation message; and generating a transaction completion message according to the relay result signature.
In one embodiment of the present application, based on the foregoing scheme, the first blockchain and the second blockchain are sub-chains derived from blocks of different heights in the master blockchain; the block chain based service processing device further comprises: the registration request module is used for sending a registration request to the main blockchain so that the main blockchain generates a registration block based on the registration request, wherein the registration request comprises server information of the relay server; and the relay service starting module is used for receiving the registration response sent by the main blockchain and starting the relay service for receiving the transaction request according to the registration response.
It should be noted that, the apparatus provided in the foregoing embodiments and the method provided in the foregoing embodiments belong to the same concept, and a specific manner in which each module performs an operation has been described in detail in the method embodiment, which is not described herein again.
Fig. 10 shows a schematic diagram of a computer system suitable for use in implementing the electronic device of the embodiments of the present application.
It should be noted that, the computer system 1200 of the electronic device shown in fig. 10 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 10, the computer system 1200 includes a central processing unit (Central Processing Unit, CPU) 1201, which can perform various appropriate actions and processes according to a program stored in a Read-Only Memory (ROM) 1202 or a program loaded from a storage section 1208 into a random access Memory (Random Access Memory, RAM) 1203. In the RAM 1203, various programs and data required for the system operation are also stored. The CPU 1201, ROM 1202, and RAM 1203 are connected to each other through a bus 1204. An Input/Output (I/O) interface 1205 is also connected to bus 1204.
The following components are connected to the I/O interface 1205: an input section 1206 including a keyboard, a mouse, and the like; an output portion 1207 including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and a speaker, etc.; a storage section 1208 including a hard disk or the like; and a communication section 1209 including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section 1209 performs communication processing via a network such as the internet. The drive 1210 is also connected to the I/O interface 1205 as needed. A removable medium 1211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 1210 so that a computer program read out therefrom is installed into the storage section 1208 as needed.
In particular, according to embodiments of the present application, the processes described in the various method flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion 1209, and/or installed from the removable media 1211. When executed by a Central Processing Unit (CPU) 1201, performs the various functions defined in the system of the present application.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), flash Memory, an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, in accordance with embodiments of the present application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a usb disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (19)

1. A method for processing a block chain based service, comprising:
receiving a transaction notification sent by a relay server, wherein the transaction notification comprises cross-chain transaction data from a first blockchain, and the transaction notification is generated by the relay server in response to a transaction request from the first blockchain;
performing cross-chain data processing according to the cross-chain transaction data in the transaction notification to obtain a data processing result, and packaging the data processing result and the pre-validation state information of the data processing result to generate a transaction block for being up-linked in a second block chain;
transmitting a transaction response to the relay server according to the transaction block, so that the relay server generates a transaction completion message according to the transaction response;
and receiving a transaction completion message sent by the relay server, packaging the data processing result and the confirmation verification information of the data processing result into a receiving result block according to the transaction completion message, and uplinking the receiving result block in the second blockchain.
2. The method of claim 1, wherein said sending a transaction response to said relay server in accordance with said transaction block comprises:
Signing the data processing result in the transaction block to obtain a receiving confirmation signature;
generating the transaction response according to the receipt confirmation signature and the data processing result, and sending the transaction response to the relay server.
3. The method of claim 2, wherein the transaction completion message includes a relay signature, the relay signature being a signature generated by the relay server from a transmit acknowledgement signature of the first blockchain and a receive acknowledgement signature of the second blockchain; the uplink receiving result block in the second blockchain according to the transaction completion message includes:
acquiring the relay signature from the transaction completion message;
the relay signature is packaged to generate the received result chunk, and the received result chunk is uplinked in the second blockchain.
4. The method of claim 1, wherein the receiving the transaction completion message sent by the relay server comprises:
detecting a time interval from the transmission of the transaction response to the receipt of a transaction completion message from the relay server;
discarding the transaction completion message if the time interval exceeds a time threshold;
And if the time interval is smaller than the time threshold, saving the transaction completion message.
5. A method for processing a block chain based service, comprising:
packaging cross-chain transaction data and pre-validation state information of the cross-chain transaction data into blocks to be transacted and uplinking the blocks to be transacted in a first blockchain;
generating a transaction request according to the blockchain information of the to-be-transacted block and the second blockchain and sending the transaction request to a relay server;
receiving a transaction result notification sent by the relay server, wherein the transaction result notification is generated according to a data processing result in the second blockchain, and the data processing result is obtained by performing cross-chain data processing according to the second blockchain and the cross-chain transaction data;
in response to the transaction result notification, sending a result confirmation message to the relay server, so that the relay server generates a transaction completion message according to the result confirmation message;
and receiving a transaction completion message sent by the relay server, packaging the cross-chain transaction data and the validation information of the cross-chain transaction data into a sending result block according to the transaction completion message, and uploading the sending result block in the first blockchain.
6. The method of claim 5, wherein the sending a result confirmation message to the relay server in response to the transaction result notification comprises:
responding to the transaction result notice, signing the cross-chain transaction data in the block to be transacted, and obtaining a sending confirmation signature;
generating the result confirmation message according to the transmission confirmation signature, and transmitting the result confirmation message to the relay server.
7. The method of claim 6, wherein the transaction completion message includes a relay signature, the relay signature being a signature generated by the relay server from a transmit validation signature of the first blockchain and a result validation signature of the second blockchain; the step of uplinking the transmission result block in the first blockchain includes:
acquiring the relay signature from the transaction completion message;
the relay signature is packaged to generate the transmit result chunk, and the transmit result chunk is uplinked in the first blockchain.
8. The method of claim 5, wherein receiving the transaction completion message sent by the relay server comprises:
Detecting a time interval when a transaction completion message from the relay server is received from sending the result confirmation message;
discarding the transaction completion message if the time interval exceeds a time threshold;
and if the time interval is smaller than the time threshold, saving the transaction completion message.
9. The method of claim 5, wherein the first blockchain and the second blockchain are sub-chains derived from blocks of different heights in the master blockchain; the generating a transaction request according to the blockchain information of the to-be-transacted block and the second blockchain and sending the transaction request to the relay server comprises the following steps:
querying server information of the relay server and blockchain information of the second blockchain from the master blockchain;
generating the transaction request according to the blockchain information of the second blockchain and the blockinformation of the block to be transacted;
and sending the transaction request to the relay server according to the server information.
10. A method for processing a block chain based service, comprising:
receiving a transaction request sent by a first blockchain, wherein the transaction request comprises cross-chain transaction data from the first blockchain and blockchain information of a second blockchain;
Generating a transaction notification according to the cross-chain transaction data in response to the transaction request, and sending the transaction notification to the second blockchain according to the blockchain information;
receiving a transaction response sent by the second blockchain, and sending a transaction result notification to the first blockchain according to the transaction response, wherein the transaction response comprises data processing according to the cross-chain transaction data to obtain a data processing result;
receiving a result confirmation message from the first block link, the result confirmation message generated in response to the transaction result notification;
and generating a transaction completion message according to the transaction response and the result confirmation message and sending the transaction completion message to the first blockchain and the second blockchain.
11. The method of claim 10, wherein after receiving the transaction request sent by the first blockchain, the method further comprises:
according to the transaction request, starting a transaction session and monitoring the session duration of the transaction session;
when the session duration exceeds a session duration threshold, updating the state of the transaction session to an ending state;
When a message associated with the cross-chain transaction data and the data processing results is received, the received message is discarded.
12. The method of claim 11, wherein the transaction response includes a result confirmation signature, the result confirmation message including a send confirmation signature; the generating a transaction completion message according to the transaction response and the result confirmation message includes:
checking the status of the transaction session;
if the transaction session is in an active state, updating the transaction session to a completed state and generating a relay result signature according to the transaction request, the transaction response and the result confirmation message;
and generating a transaction completion message according to the relay result signature.
13. The method of claim 10, wherein the first blockchain and the second blockchain are sub-chains derived from blocks of different heights in the master blockchain; the method further comprises the steps of:
sending a registration request to the master blockchain so that the master blockchain generates a registration block based on the registration request, wherein the registration request comprises server information of a relay server;
And receiving a registration response sent by the main blockchain, and starting a relay service for receiving the transaction request according to the registration response.
14. A blockchain-based service processing device, comprising:
a transaction notification receiving module, configured to receive a transaction notification sent by a relay server, where the transaction notification includes cross-chain transaction data from a first blockchain, and the transaction notification is generated by the relay server in response to a transaction request from the first blockchain;
the cross-link data processing module is used for performing cross-link data processing according to the cross-link transaction data in the transaction notification to obtain a data processing result, and packaging the data processing result and the pre-validation state information of the data processing result to generate a transaction block and uploading the transaction block in a second block chain;
the transaction response sending module is used for sending a transaction response to the relay server according to the transaction block so that the relay server generates a transaction completion message according to the transaction response;
and the first completion message receiving module is used for receiving the transaction completion message sent by the relay server, packaging the data processing result and the validation information of the data processing result into a receiving result block according to the transaction completion message, and uploading the receiving result block in the second block chain.
15. A blockchain-based service processing device, comprising:
the transaction data packaging module is used for packaging cross-chain transaction data and pre-validation state information of the cross-chain transaction data into blocks to be transacted and enabling the blocks to be transacted to be uplink in a first blockchain;
the transaction request sending module is used for generating a transaction request according to the blockchain information of the block to be transacted and the second blockchain and sending the transaction request to the relay server;
the result notification receiving module is used for receiving a transaction result notification sent by the relay server, wherein the transaction result notification is generated according to a data processing result in the second blockchain, and the data processing result is obtained by performing cross-chain data processing according to the second blockchain and the cross-chain transaction data;
a confirmation message sending module, configured to send a result confirmation message to the relay server in response to the transaction result notification, so that the relay server generates a transaction completion message according to the result confirmation message;
and the second completion message receiving module is used for receiving the transaction completion message sent by the relay server, packaging the cross-chain transaction data and the confirmation effect information of the cross-chain transaction data into a sending result block according to the transaction completion message, and uplinking the sending result block in the first blockchain.
16. A blockchain-based service processing device, comprising:
a transaction request receiving module, configured to receive a transaction request sent by a first blockchain, where the transaction request includes cross-chain transaction data from the first blockchain and blockchain information of a second blockchain;
a transaction notification generation module, configured to generate a transaction notification according to the cross-chain transaction data in response to the transaction request, and send the transaction notification to the second blockchain according to the blockchain information;
the transaction response receiving module is used for receiving the transaction response sent by the second blockchain and sending a transaction result notification to the first blockchain according to the transaction response, wherein the transaction response comprises data processing according to the cross-chain transaction data to obtain a data processing result;
a confirmation message receiving module for receiving a result confirmation message from the first block link, the result confirmation message generated in response to the transaction result notification;
and the completion message sending module is used for generating a transaction completion message according to the transaction response and the result confirmation message and sending the transaction completion message to the first blockchain and the second blockchain.
17. A computer readable medium having stored thereon a computer program, which when executed by a processor implements a blockchain based service processing method according to any of claims 1 to 13.
18. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs that, when executed by the one or more processors, cause the electronic device to implement the blockchain-based business processing method of any of claims 1 to 13.
19. A computer program product, characterized in that it comprises computer instructions stored in a computer readable storage medium, from which computer instructions are read and executed by a processor of a computer device, such that the computer device performs the blockchain-based service processing method according to any of claims 1 to 13.
CN202111437323.3A 2021-11-29 2021-11-29 Block chain-based service processing method and device, electronic equipment and readable medium Pending CN116186749A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111437323.3A CN116186749A (en) 2021-11-29 2021-11-29 Block chain-based service processing method and device, electronic equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111437323.3A CN116186749A (en) 2021-11-29 2021-11-29 Block chain-based service processing method and device, electronic equipment and readable medium

Publications (1)

Publication Number Publication Date
CN116186749A true CN116186749A (en) 2023-05-30

Family

ID=86431222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111437323.3A Pending CN116186749A (en) 2021-11-29 2021-11-29 Block chain-based service processing method and device, electronic equipment and readable medium

Country Status (1)

Country Link
CN (1) CN116186749A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116886444A (en) * 2023-09-05 2023-10-13 腾讯科技(深圳)有限公司 Cross-chain data processing method, device, computer, storage medium and program product

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116886444A (en) * 2023-09-05 2023-10-13 腾讯科技(深圳)有限公司 Cross-chain data processing method, device, computer, storage medium and program product
CN116886444B (en) * 2023-09-05 2023-12-05 腾讯科技(深圳)有限公司 Cross-chain data processing method, device, computer, storage medium and program product

Similar Documents

Publication Publication Date Title
CN111598566A (en) Network payment system based on mixed cross-chain
CN112232823B (en) Transaction processing method, device, medium and electronic equipment of block chain system
CN112000976B (en) Authentication management method, device, medium and electronic equipment for block chain system
CN109658097B (en) Authentication management method, device, medium and electronic equipment of block chain system
CN112231741B (en) Data processing method, device, medium and electronic equipment based on block chain system
CN109741068B (en) Online banking cross-row signing method, device and system
CN108876669B (en) Course notarization system and method applied to multi-platform education resource sharing
US20230037932A1 (en) Data processing method and apparatus based on blockchain network, and computer device
CN116150260A (en) Data processing method, device, medium and electronic equipment of block chain system
CN112287031B (en) Data synchronization method and device of block chain system, readable medium and electronic equipment
CN113256297B (en) Data processing method, device and equipment based on block chain and readable storage medium
CN114567643B (en) Cross-blockchain data transfer method, device and related equipment
CN112532753B (en) Data synchronization method, device, medium and electronic equipment of block chain system
CN112615838B (en) Extensible block chain cross-chain communication method
CN116186749A (en) Block chain-based service processing method and device, electronic equipment and readable medium
CN116827957B (en) Information processing method, device, equipment and medium based on multi-block chain
CN116186786A (en) Block chain-based service processing method and device, electronic equipment and readable medium
CN116233139A (en) Data processing method, device, medium and electronic equipment of block chain system
CN112565104B (en) Flow control method, device, medium and electronic equipment of block chain system
CN113689216A (en) Cross-chain transaction processing method and device, equipment, storage medium and program product
CN117061538A (en) Consensus processing method and related device based on block chain network
CN116186750A (en) Business processing method, device, equipment and readable medium based on block chain system
CN112950180A (en) Community certificate method and system based on alliance chain, electronic device and storage medium
CN116232625A (en) Block chain system-based account management method, device, equipment and readable medium
CN115021990B (en) Union-chain-oriented universal asynchronous cross-chain transaction method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40089256

Country of ref document: HK