CN110517145B - Data transaction method based on multi-block chain and related equipment - Google Patents

Data transaction method based on multi-block chain and related equipment Download PDF

Info

Publication number
CN110517145B
CN110517145B CN201910810030.1A CN201910810030A CN110517145B CN 110517145 B CN110517145 B CN 110517145B CN 201910810030 A CN201910810030 A CN 201910810030A CN 110517145 B CN110517145 B CN 110517145B
Authority
CN
China
Prior art keywords
blockchain
client
transaction
address
block chain
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.)
Active
Application number
CN201910810030.1A
Other languages
Chinese (zh)
Other versions
CN110517145A (en
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.)
Shenzhen Onething Technology Co Ltd
Original Assignee
Shenzhen Onething Technology 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 Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN201910810030.1A priority Critical patent/CN110517145B/en
Publication of CN110517145A publication Critical patent/CN110517145A/en
Application granted granted Critical
Publication of CN110517145B publication Critical patent/CN110517145B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities

Abstract

A method for data transaction based on inter-blockchain, the method comprising: receiving a transaction request triggered on a first blockchain; judging whether the first client joins the second blockchain or not; if yes, broadcasting the transaction request on the first block chain; after the transaction request is verified to be valid, sending the transaction request to the second block chain, initiating transaction between the first address and the second address on the second block chain to obtain a transaction result, and returning the transaction result to the first block chain through the second block chain; broadcasting a validation request for the transaction result over the first blockchain; counting a first number of passes of verification of the transaction result by the second client; and if so, determining that the transaction result is effective. The invention also provides a data transaction device, a first client and a computer readable storage medium. The invention can realize data transaction among a plurality of block chains.

Description

Data transaction method based on multi-block chain and related equipment
Technical Field
The invention relates to the technical field of blockchains, in particular to a data transaction method based on multi-blockchain and related equipment.
Background
Blockchains are intelligent peer-to-peer networks that use distributed databases to identify, disseminate, and document information, also known as value internet. The block chain has the technical advantages of decentralization, tamper resistance, data consistency storage, transparent and traceable process and the like, and is considered to have wide application prospects in numerous fields of finance, credit investigation, internet of things, economic trade settlement, asset management and the like.
At present, many organizations or organizations have issued public, private, and alliance chains, but each chain is independent, and the exchange of information among various block chain networks is realized through offline exchange and other ways, which is difficult to meet the requirement of cross-chain data interaction.
Therefore, how to implement data transfer among a plurality of block chains is a technical problem to be solved.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a data transaction method based on multiple blockchains and related apparatus, which can implement data transaction between multiple blockchains.
A first aspect of the present invention provides a data transaction method based on multi-blockchain, which is applied to a first client, where the first client has a function of adding multiple different blockchains, and the method includes:
receiving a transaction request triggered on a first blockchain, the transaction request requesting initiation of a transaction between a first address and a second address on a second blockchain;
judging whether the first client joins the second blockchain or not;
if the first client joins the second blockchain, broadcasting the transaction request on the first blockchain;
after the transaction request is verified to be valid, sending the transaction request to the second blockchain, initiating a transaction between the first address and the second address on the second blockchain to obtain a transaction result, and transmitting the transaction result back to the first blockchain through the second blockchain;
broadcasting a verification request aiming at the transaction result on the first blockchain, wherein the transaction result is verified by a second client on the first blockchain, and the second client is a client except the first client in the clients simultaneously joining the first blockchain and the second blockchain;
counting a first number of verification passes of the second client to the transaction result;
and if the first quantity exceeds a preset threshold value, determining that the transaction result is effective.
In a possible implementation manner, a third client joining the first blockchain and the second blockchain at the same time authenticates the transaction request, the third client determines whether the first address and the second address exist in the second blockchain at the same time, if the first address and the second address exist in the second blockchain at the same time, determines whether total data on the first address is greater than or equal to transaction data required by the transaction request, if the total data on the first address is greater than or equal to the transaction data required by the transaction request, it is determined that the transaction request is authenticated, and if a second amount that is authenticated exceeds the preset threshold, it is determined that the transaction request is authenticated.
In one possible implementation, the method further includes:
and if the first client does not join the second blockchain, broadcasting the transaction request on the first blockchain.
In one possible implementation, before the receiving the transaction request triggered on the first blockchain, the method further includes:
generating account information for each blockchain the first client is to join.
In one possible implementation, the method further includes:
receiving a blockchain selection instruction input on a blockchain list, wherein the blockchain list comprises a plurality of blockchains which can be added by the first client;
and responding to the block chain selection instruction, and adding the selected at least one block chain to the first client.
A second aspect of the present invention provides a data transaction apparatus, operating on a first client, where the first client has a function of adding multiple different blockchains, and the data transaction apparatus includes:
a receiving module, configured to receive a transaction request triggered on a first blockchain, where the transaction request is used to request that a transaction be initiated between a first address and a second address on a second blockchain;
the judging module is used for judging whether the first client is added into the second block chain or not;
a broadcasting module, configured to broadcast the transaction request on the first blockchain if the first client joins the second blockchain;
the transmission module is used for sending the transaction request to the second block chain after the transaction request is verified to be effective, initiating transaction between the first address and the second address on the second block chain to obtain a transaction result, and transmitting the transaction result back to the first block chain through the second block chain;
the broadcast module is further configured to broadcast a verification request for the transaction result on the first blockchain, where a second client on the first blockchain verifies the transaction result, and the second client is a client, except the first client, of clients joining the first blockchain and the second blockchain at the same time;
the statistic module is used for counting a first number of the second clients passing the verification of the transaction result;
and the determining module is used for determining that the transaction result is effective if the first quantity exceeds a preset threshold value.
In a possible implementation manner, the broadcasting module is further configured to broadcast the transaction request on the first blockchain if the first client does not join the second blockchain.
In a possible implementation manner, the receiving module is further configured to receive a blockchain selection instruction input on a blockchain list, where the blockchain list includes a plurality of blockchains that the first client can join;
the data transaction apparatus further includes:
and the joining module is used for responding to the block chain selection instruction and joining the selected at least one block chain to the first client.
A third aspect of the present invention provides a first client, where the first client includes a processor and a memory, and the processor is configured to implement the method for data transaction based on multi-blockchain when executing a computer program stored in the memory.
A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, where the computer program, when executed by a processor, implements the method for data transaction between multiblock chains.
By the technical scheme, the method and the device can receive a transaction request triggered on a first block chain, wherein the transaction request is used for requesting to initiate transaction between a first address and a second address on a second block chain, and judging whether a first client is added to the second block chain or not; if the first client is added into the second block chain, the transaction request is broadcast on the first block chain, after the transaction request is verified to be valid, the transaction request is sent to the second block chain, a transaction is initiated between the first address and the second address on the second block chain, a transaction result is obtained, and the transaction result is transmitted back to the first block chain through the second block chain; further, a verification request for the transaction result is broadcasted on the first blockchain, wherein the transaction result is verified by a second client on the first blockchain, and the second client is a client except the first client in the clients joining the first blockchain and the second blockchain at the same time; finally, a first number of verifications of the transaction result by the second client may be counted; and if the first quantity exceeds a preset threshold value, determining that the transaction result is effective. Therefore, in the invention, after the verification of the transaction request in the whole network takes effect, the client capable of working on a plurality of block chains at the same time is selected to serve as a medium among the plurality of block chains, the transaction request triggered on the first block chain is transferred to the second block chain, and after the transaction is completed on the second block chain, the client working on the plurality of block chains at the same time carries out the verification of the whole network on the transaction result, thereby not only realizing the cross-chain communication, but also ensuring the reliability of the transaction result.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a preferred embodiment of a method for data transaction between blockchains according to the present invention.
FIG. 2 is a functional block diagram of a data transaction apparatus according to a preferred embodiment of the present disclosure.
FIG. 3 is a schematic structural diagram of a first client implementing a data transaction method based on multi-blockchain according to a preferred embodiment of the present invention.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a detailed description of the present invention will be given below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and features of the embodiments may be combined with each other without conflict.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
The client comprises an electronic device capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware of the electronic device comprises a microprocessor, an Application Specific Integrated Circuit (ASIC), a programmable gate array (FPGA), a Digital Signal Processor (DSP), an embedded device and the like. The client may include, but is not limited to, any electronic product capable of interacting with a user through a keyboard, a mouse, a remote controller, a touch pad, a voice control device, and the like, for example, a personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), and the like.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for data transaction between multiple blockchains according to a preferred embodiment of the present invention. The data transaction method based on the multi-block chain is applied to a first client, the first client has the function of adding a plurality of different block chains, the sequence of steps in the flow chart can be changed according to different requirements, and some steps can be omitted.
S11, the first client receives a transaction request triggered on the first block chain.
When a plurality of block chains authorized mutually exist, the client sides corresponding to the plurality of block chains can be packaged, integrated and authorized, namely, the multi-functionalization of the client sides is realized, so that the client sides capable of adding the plurality of block chains are obtained, namely, the obtained client sides have the function of adding the plurality of block chains. The method includes the steps that clients corresponding to a plurality of block chains are packaged and integrated, and belongs to the prior art, and the authorization is not repeated herein, namely, the use permission of a merchant corresponding to the block chains is obtained, if the merchant develops an internal interface, the internal interface can be used for calling the plurality of block chains, and mutual authorization of the plurality of block chains is achieved.
In the embodiment of the present invention, the first client has a function of adding multiple different blockchains, that is, the first client can add at least two blockchains, and the specific amount of addition is determined by a user. The first client is any one client on the block chain network.
In an embodiment of the present invention, when data transaction needs to be performed at two addresses on the second blockchain, for example, the address X is transferred to the address Y by 100token, the first client may receive a transaction request triggered on the first blockchain, where the transaction request is used to request that a transaction be initiated between the first address and the second address on the second blockchain. The first address and the second address are both addresses for storing tokens. The first client may only add the first blockchain, or the first client may add the first blockchain and the second blockchain at the same time, or the first client may add more than three blockchains at the same time, which is not limited in the embodiment of the present invention.
As an optional implementation manner, before step S11, the method further includes:
generating account information for each blockchain the first client is to join.
In this alternative embodiment, since the first client is obtained after encapsulating, integrating and authorizing the multiple clients, and the blockchain addresses of the multiple clients are no longer applicable to the first client before processing, for the first client, account information needs to be generated for each blockchain to which the first client is to join, for example, address information of an account on which token is stored on the first client. The generated address information may be an address used in multiple block chains, or an address generated for each block chain. When the user uses the address list for the first time, the user can select to create a plurality of address lists which are used together, or can select to create a single address, and each address can only be used on the own chain. Generally, if multiple block chains use the same address format, one address may be used for multiple block chains, and when different address formats are used, only one block chain may correspond to one address.
As an optional implementation, the method further comprises:
receiving a blockchain selection instruction input on a blockchain list, wherein the blockchain list comprises a plurality of blockchains which can be added by the first client;
and responding to the block chain selection instruction, and adding the selected at least one block chain to the first client.
In this alternative embodiment, although the first client has the function of being able to join multiple blockchains, the joining of the multiple blockchains by the first client is determined by the selection of the user, and the user can select and input a blockchain selection instruction on a blockchain list, where the blockchain list includes the multiple blockchains that the first client can join; the first client may respond to the block chain selection instruction, and add the selected at least one block chain to the first client, that is, the first client may add only one block chain or add multiple block chains.
And S12, the first client judges whether the first client joins the second block chain, if so, the step S13 is executed, and if not, the process is ended.
In the embodiment of the present invention, the first client needs to first determine whether the first client joins the second blockchain, and if the first client joins the second blockchain, the first client may respond to the transaction request by itself. If the first client does not join the second blockchain, the transaction request needs to be responded by other clients simultaneously joining the first blockchain and the second blockchain.
As an optional implementation, the method further comprises:
and if the first client does not join the second blockchain, broadcasting the transaction request on the first blockchain.
In this optional embodiment, the first client only joins the first blockchain, and when the first client receives a triggered transaction request on the first blockchain, the first client needs to broadcast the transaction request on the first blockchain, and the client joining the first blockchain and the second blockchain at the same time on the first blockchain verifies the transaction request, and the client not joining the first blockchain and the second blockchain at the same time discards the broadcasted transaction request; after the transaction request is verified to be effective, the first blockchain and the second blockchain are added at the same time, the client which responds to the transaction request most quickly responds to the transaction request, the transaction is carried out between the first address and the second address on the second blockchain, a transaction result is obtained, and the transaction result is transmitted back to the first blockchain through the second blockchain, so that the transaction request is completed through the client which is added to the first blockchain and the client which is added to the second blockchain at the same time.
And S13, the first client broadcasts the transaction request on the first block chain.
In this embodiment of the present invention, the first client joins the first blockchain and the second blockchain at the same time, and when the first client receives a triggered transaction request on the first blockchain, the first client needs to broadcast the transaction request on the first blockchain.
And S14, after the transaction request is verified to be effective, the first client sends the transaction request to the second block chain, initiates a transaction between the first address and the second address on the second block chain to obtain a transaction result, and the transaction result is transmitted back to the first block chain through the second block chain.
In this embodiment of the present invention, other clients (such as a third client) joining the first blockchain and the second blockchain at the same time on the first blockchain verify the transaction request, and a client not joining the first blockchain and the second blockchain at the same time discards the broadcasted transaction request; after the verification is valid, the first client sends the transaction request to the second block chain, and initiates a transaction between the first address and the second address on the second block chain to obtain a transaction result, that is, data on the account of the first address is transferred to the account of the second address, and the transaction result is transmitted back to the first block chain through the second block chain. The transaction result is the data change condition of the accounts with two addresses, namely the data reduction amount on the account with the first address, the data increase amount on the account with the second address and the data change amount.
The specific process of the third client for verifying the transaction request is as follows:
the third client side is used for verifying the transaction request, judging whether the first address and the second address exist in the second block chain at the same time, if so, judging whether total data on the first address is larger than or equal to transaction data required by the transaction request, and if so, determining that the transaction request is verified, namely, the necessary condition that the second block chain needs to exist the first address and the second address at the same time, and the total data on the first address is larger than or equal to the transaction data required by the transaction request. Further, a second number of validated transactions needs to be counted, and if the second number of validated transactions exceeds the preset threshold, it is determined that the transaction request is validated.
S15, the first client broadcasts a verification request aiming at the transaction result on the first block chain.
And verifying the transaction result by a second client on the first blockchain, wherein the second client is a client except the first client in the clients simultaneously joining the first blockchain and the second blockchain.
Specifically, whether the data change of the account with the first address is matched with the data change of the account with the second address is verified, namely whether the data reduction amount of the account with the first address is equal to the data increase amount of the account with the second address and whether the number of the data changes is equal to the transaction data of the transaction result. Finally, the number of the second client end passing the verification of the transaction result can be counted, and if the number exceeds the preset threshold value, the transaction result can be determined to be valid, so that the client end can be prevented from doing harm, and the reliability of data transaction is ensured.
S16, the first client side counts the first number of the second client side for passing the verification of the transaction result.
The number of the second clients is multiple, in order to verify the reliability of the transaction result, the whole network verification is required, and the first client can count the first number of the second clients which pass the verification of the transaction result.
And S17, if the first quantity exceeds a preset threshold value, the first client determines that the transaction result takes effect.
A preset threshold may be preset, for example, a number of the second clients is a, and the preset threshold may be set to a/2, that is, if the counted first number exceeds half, it may be determined that the transaction result is valid, that is, the data transaction is successful.
In the method flow described in fig. 1, a transaction request triggered on a first blockchain may be received, where the transaction request is used to request that a transaction be initiated between a first address and a second address on a second blockchain, and whether the first client joins the second blockchain may be determined; if the first client side is added into the second block chain, the transaction request is broadcasted on the first block chain, after the transaction request is verified to be valid, the transaction request is sent to the second block chain, transaction is initiated between the first address and the second address on the second block chain, a transaction result is obtained, and the transaction result is transmitted back to the first block chain through the second block chain; further, a verification request for the transaction result is broadcasted on the first blockchain, wherein the transaction result is verified by a second client on the first blockchain, and the second client is a client except the first client in the clients joining the first blockchain and the second blockchain at the same time; finally, a first number of verifications of the transaction result by the second client may be counted; and if the first quantity exceeds a preset threshold value, determining that the transaction result is effective. Therefore, in the invention, after the verification of the transaction request in the whole network takes effect, the client capable of working on a plurality of block chains at the same time is selected to serve as a medium among the plurality of block chains, the transaction request triggered on the first block chain is transferred to the second block chain, and after the transaction is completed on the second block chain, the client working on the plurality of block chains at the same time carries out the verification of the whole network on the transaction result, thereby not only realizing the cross-chain communication, but also ensuring the reliability of the transaction result.
The above description is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and it will be apparent to those skilled in the art that modifications may be made without departing from the inventive concept of the present invention, and these modifications are within the scope of the present invention.
Referring to fig. 2, fig. 2 is a functional block diagram of a data transaction apparatus according to a preferred embodiment of the present invention.
In some embodiments, the data trafficking device operates in the first client. The data trafficking device may include a plurality of function modules composed of program code segments. The program codes of the program segments in the data transaction apparatus may be stored in the memory and executed by the at least one processor to perform part or all of the steps in the data transaction method based on the multi-blockchain described in fig. 1, which may be specifically described with reference to fig. 1, and are not described herein again.
In this embodiment, the data transaction device may be divided into a plurality of functional modules according to the functions performed by the data transaction device. The functional module may include: a receiving module 201, a judging module 202, a broadcasting module 203, a transmitting module 204, a counting module 205 and a determining module 206. The module referred to herein is a series of computer program segments capable of being executed by at least one processor and capable of performing a fixed function and is stored in memory. In some embodiments, the functionality of the modules will be described in greater detail in subsequent embodiments.
A receiving module 201, configured to receive a transaction request triggered on a first blockchain, where the transaction request is used to request that a transaction is initiated between a first address and a second address on a second blockchain.
When a plurality of block chains authorized mutually exist, the client sides corresponding to the plurality of block chains can be packaged, integrated and authorized, namely, the multi-functionalization of the client sides is realized, so that the client sides capable of adding the plurality of block chains are obtained, namely, the obtained client sides have the function of adding the plurality of block chains. The method includes the steps that a client corresponding to a plurality of block chains is packaged and integrated, the packaging and the integration belong to the prior art, and are not repeated herein, authorization refers to obtaining the use permission of a merchant corresponding to the block chains, and if the merchant develops an internal interface, the internal interface can be used for calling the plurality of block chains, so that mutual authorization of the plurality of block chains is achieved.
In the embodiment of the present invention, the first client has a function of adding multiple different blockchains, that is, the first client can add at least two blockchains, and the specific amount of addition is determined by a user. The first client is any one client on the block chain network.
In an embodiment of the present invention, when data transaction needs to be performed at two addresses on the second blockchain, for example, the address X is transferred to the address Y by 100token, the first client may receive a transaction request triggered on the first blockchain, where the transaction request is used to request that a transaction be initiated between the first address and the second address on the second blockchain. The first address and the second address are both addresses for storing tokens. The first client may only add the first blockchain, or the first client may add the first blockchain and the second blockchain at the same time, or the first client may add more than three blockchains at the same time, which is not limited in the embodiment of the present invention.
A determining module 202, configured to determine whether the first client joins the second blockchain.
In the embodiment of the present invention, the first client needs to first determine whether the first client joins the second blockchain, and if the first client joins the second blockchain, the first client may respond to the transaction request. If the first client does not join the second blockchain, the transaction request needs to be responded by other clients simultaneously joining the first blockchain and the second blockchain.
A broadcasting module 203, configured to broadcast the transaction request on the first blockchain if the first client joins the second blockchain.
In this embodiment of the present invention, the first client joins the first blockchain and the second blockchain at the same time, and when the first client receives a triggered transaction request on the first blockchain, the first client needs to broadcast the transaction request on the first blockchain.
The transmission module 204 is configured to send the transaction request to the second blockchain after the transaction request is verified to be valid, initiate a transaction between the first address and the second address on the second blockchain, obtain a transaction result, and return the transaction result to the first blockchain through the second blockchain.
In the embodiment of the present invention, other clients (for example, a third client) joining the first blockchain and the second blockchain at the same time on the first blockchain validate the transaction request, and a client not joining the first blockchain and the second blockchain at the same time discards the broadcasted transaction request; after the verification is effective, the first client sends the transaction request to the second block chain, and initiates a transaction between the first address and the second address on the second block chain, obtains a transaction result, that is, transfers the data on the account of the first address to the account of the second address, and returns the transaction result to the first block chain through the second block chain. The transaction result is the data change condition of the accounts with two addresses, namely the data reduction amount on the account with the first address, the data increase amount on the account with the second address and the data change amount.
The specific process of the third client for verifying the transaction request is as follows:
the third client side is used for verifying the transaction request, judging whether the first address and the second address exist in the second block chain at the same time, if so, judging whether total data on the first address is larger than or equal to transaction data required by the transaction request, and if so, determining that the transaction request is verified, namely, the necessary condition that the second block chain needs to exist the first address and the second address at the same time, and the total data on the first address is larger than or equal to the transaction data required by the transaction request. Further, a second number of validated transactions needs to be counted, and if the second number of validated transactions exceeds the preset threshold, it is determined that the transaction request is validated.
The broadcasting module 203 is further configured to broadcast a verification request for the transaction result on the first blockchain, where a second client on the first blockchain verifies the transaction result, and the second client is a client, except the first client, of clients joining the first blockchain and the second blockchain at the same time.
Specifically, whether the data change of the account with the first address is matched with the data change of the account with the second address is verified, namely whether the data reduction amount of the account with the first address is equal to the data increase amount of the account with the second address and whether the number of the data changes is equal to the transaction data of the transaction result. Finally, the number of the second client for passing the verification of the transaction result can be counted, and if the number exceeds the preset threshold, the transaction result can be determined to be valid, so that the client can be prevented from doing harm, and the reliability of data transaction is ensured.
A counting module 205, configured to count a first number of verifications of the transaction result by the second client.
The number of the second clients is multiple, in order to verify the reliability of the transaction result, the whole network verification is required, and the first client can count the first number of the second clients which pass the verification of the transaction result.
A determining module 206, configured to determine that the first transaction result is valid if the first quantity exceeds a preset threshold.
A preset threshold may be preset, for example, a number of the second clients is a, and the preset threshold may be set to a/2, that is, if the counted first number exceeds half, it may be determined that the transaction result is valid, that is, the data transaction is successful.
The transaction request is verified by a third client joining the first block chain and the second block chain at the same time, the third client judges whether the first address and the second address exist in the second block chain at the same time, if the first address and the second address exist in the second block chain at the same time, whether total data on the first address is larger than or equal to transaction data required by the transaction request is judged, if the total data on the first address is larger than or equal to the transaction data required by the transaction request, the transaction request is determined to pass verification, and if the second number passing verification exceeds the preset threshold value, the transaction request is determined to be verified to be valid.
Optionally, the broadcasting module 203 is further configured to broadcast the transaction request on the first blockchain if the first client does not join the second blockchain.
In this optional embodiment, the first client only joins the first blockchain, and when the first client receives a triggered transaction request on the first blockchain, the first client needs to broadcast the transaction request on the first blockchain, and the client joining the first blockchain and the second blockchain at the same time on the first blockchain verifies the transaction request, and the client not joining the first blockchain and the second blockchain at the same time discards the broadcasted transaction request; after the transaction request is verified to be valid, the first block chain and the second block chain are added at the same time, the client which responds to the transaction request with the fastest speed responds to the transaction request, the transaction is carried out between the first address and the second address on the second block chain, a transaction result is obtained, and the transaction result is transmitted back to the first block chain through the second block chain, so that the transaction request is completed through the client which is added to the first block chain and the second block chain at the same time.
Optionally, the data transaction apparatus further includes:
a generating module, configured to generate account information for each blockchain to which the first client is to join before the receiving module 201 receives the transaction request triggered on the first blockchain.
In this alternative embodiment, since the first client is obtained after encapsulating, integrating and authorizing the multiple clients, and the blockchain addresses of the multiple clients are no longer applicable to the first client before processing, for the first client, account information needs to be generated for each blockchain to which the first client is to join, for example, address information of an account on which token is stored on the first client. The generated address information may be an address used in multiple block chains, or an address generated for each block chain. When the user uses the address list for the first time, the user can select to create a plurality of address lists which are used together, or can select to create a single address, and each address can only be used on the own chain. Generally, if multiple block chains use the same address format, one address may be used for multiple block chains, and when different address formats are used, only one block chain may correspond to one address.
Optionally, the receiving module 201 is further configured to receive a blockchain selection instruction input on a blockchain list, where the blockchain list includes a plurality of blockchains that the first client can join;
the data transaction apparatus further includes:
and the joining module is used for responding to the block chain selection instruction and joining the selected at least one block chain to the first client.
In this alternative embodiment, although the first client has the function of being able to join multiple blockchains, the joining of the multiple blockchains by the first client is determined by the selection of the user, and the user can select and input a blockchain selection instruction on a blockchain list, where the blockchain list includes the multiple blockchains that the first client can join; the first client may respond to the block chain selection instruction and add the selected at least one block chain to the first client, that is, the first client may add only one block chain or add multiple block chains.
In the data transaction apparatus described in fig. 2, a transaction request triggered on a first blockchain may be received, where the transaction request is used to request that a transaction is initiated between a first address and a second address on a second blockchain, and it is determined whether the first client joins the second blockchain; if the first client is added into the second block chain, the transaction request is broadcast on the first block chain, after the transaction request is verified to be valid, the transaction request is sent to the second block chain, a transaction is initiated between the first address and the second address on the second block chain, a transaction result is obtained, and the transaction result is transmitted back to the first block chain through the second block chain; further, a verification request for the transaction result is broadcasted on the first blockchain, wherein the transaction result is verified by a second client on the first blockchain, and the second client is a client except the first client in the clients joining the first blockchain and the second blockchain at the same time; finally, a first number of verifications of the transaction result by the second client may be counted; and if the first quantity exceeds a preset threshold value, determining that the transaction result is effective. Therefore, in the invention, after the verification of the transaction request in the whole network takes effect, the client capable of working on a plurality of block chains at the same time is selected to serve as a medium among the plurality of block chains, the transaction request triggered on the first block chain is transferred to the second block chain, and after the transaction is completed on the second block chain, the client working on the plurality of block chains at the same time carries out the verification of the whole network on the transaction result, thereby not only realizing the cross-chain communication, but also ensuring the reliability of the transaction result.
As shown in fig. 3, fig. 3 is a schematic structural diagram of a first client for implementing a data transaction method based on multi-blockchain according to a preferred embodiment of the present invention. The first client 3 comprises a memory 31, at least one processor 32, a computer program 33 stored in the memory 31 and executable on the at least one processor 32, and at least one communication bus 34.
Those skilled in the art will appreciate that the schematic diagram shown in fig. 3 is merely an example of the first client 3, and does not constitute a limitation of the first client 3, and may include more or less components than those shown, or combine some components, or different components, for example, the first client 3 may further include an input-output device, a network access device, and the like.
The first client 3 further includes, but is not limited to, any electronic product capable of performing human-computer interaction with a user through a keyboard, a mouse, a remote controller, a touch panel, or a voice control device, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), and the like. The Network where the first client 3 is located includes, but is not limited to, the internet, a wide area Network, a metropolitan area Network, a local area Network, a Virtual Private Network (VPN), and the like.
The at least one Processor 32 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The processor 32 may be a microprocessor or the processor 32 may be any conventional processor or the like, and the processor 32 is a control center of the first client 3 and connects various parts of the whole first client 3 by using various interfaces and lines.
The memory 31 may be used to store the computer program 33 and/or the module/unit, and the processor 32 implements various functions of the first client 3 by running or executing the computer program and/or the module/unit stored in the memory 31 and calling data stored in the memory 31. The memory 31 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data) created according to the use of the first client 3, and the like. Further, the memory 31 may include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other non-volatile solid state storage device.
With reference to fig. 1, the memory 31 in the first client 3 stores a plurality of instructions to implement a method for data transaction based on multi-blockchain, and the processor 32 can execute the plurality of instructions to implement:
receiving a transaction request triggered on a first blockchain, the transaction request requesting initiation of a transaction between a first address and a second address on a second blockchain;
judging whether the first client joins the second blockchain or not;
if the first client does not join the second blockchain, broadcasting the transaction request on the first blockchain, wherein after the transaction request is verified to be valid, a second client on the first blockchain responds to the transaction request, the second client transfers the data to be transferred of the first address to the second address on the second blockchain to obtain a first transaction result, and the first transaction result is transmitted back to the first blockchain through the second blockchain, and the second client is the client which joins the first blockchain and the second blockchain at the same time and has the fastest response;
receiving the first transaction result returned by the second client on the first blockchain;
broadcasting a verification request aiming at the first transaction result on the first blockchain, wherein a third client on the first blockchain verifies the first transaction result, and the third client is a client except the second client in the clients simultaneously joining the first blockchain and the second blockchain;
counting a first number of the verification of the third client to the first transaction result;
and if the first quantity exceeds a preset threshold value, determining that the first transaction result is effective.
In an optional implementation manner, a fourth client joining the first block chain and the second block chain at the same time authenticates the transaction request, the fourth client determines whether the first address and the second address exist in the second block chain at the same time, if the first address and the second address exist in the second block chain at the same time, determines whether total data on the first address is greater than or equal to the data to be transferred, if the total data on the first address is greater than or equal to the data to be transferred, it is determined that the transaction request is authenticated, and if a second amount of authenticated data exceeds the preset threshold, it is determined that the transaction request is validated.
In an alternative embodiment, the processor 32 may execute the plurality of instructions to:
if the first client joins the second blockchain, broadcasting the transaction request on the first blockchain;
after the transaction request is verified to be valid, sending the transaction request to the second blockchain, transferring the data to be transferred of the first address to the second address on the second blockchain to obtain a second transaction result, and returning the second transaction result to the first blockchain through the second blockchain;
broadcasting a verification request aiming at the second transaction result on the first blockchain, wherein a fifth client on the first blockchain verifies the second transaction result, and the fifth client is a client except the first client in the clients simultaneously joining the first blockchain and the second blockchain;
counting a third number of verification passes of the fifth client to the second transaction result;
and if the third quantity exceeds the preset threshold value, determining that the second transaction result is effective.
In an alternative embodiment, prior to receiving the transaction request triggered on the first blockchain, the processor 32 may execute the plurality of instructions to:
generating account information for each blockchain the first client is to join.
In an alternative embodiment, the processor 32 may execute the plurality of instructions to implement:
receiving a blockchain selection instruction input on a blockchain list, wherein the blockchain list comprises a plurality of blockchains which can be added by the first client;
and responding to the block chain selection instruction, and adding the selected at least one block chain to the first client.
Specifically, the processor 32 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the instruction, which is not described herein again.
In the first client 3 depicted in fig. 3, a transaction request triggered on a first blockchain may be received, where the transaction request is used to request that a transaction is initiated between a first address and a second address on a second blockchain, and it is determined whether the first client joins the second blockchain; if the first client is added into the second block chain, the transaction request is broadcast on the first block chain, after the transaction request is verified to be valid, the transaction request is sent to the second block chain, a transaction is initiated between the first address and the second address on the second block chain, a transaction result is obtained, and the transaction result is transmitted back to the first block chain through the second block chain; further, a verification request for the transaction result is broadcasted on the first blockchain, wherein the transaction result is verified by a second client on the first blockchain, and the second client is a client except the first client in the clients joining the first blockchain and the second blockchain at the same time; finally, a first number of verifications of the transaction result by the second client may be counted; and if the first quantity exceeds a preset threshold value, determining that the transaction result is effective. Therefore, in the invention, after the verification of the transaction request in the whole network takes effect, the client capable of working on a plurality of block chains at the same time is selected to serve as a medium among the plurality of block chains, the transaction request triggered on the first block chain is transferred to the second block chain, and after the transaction is completed on the second block chain, the client working on the plurality of block chains at the same time carries out the verification of the whole network on the transaction result, thereby not only realizing the cross-chain communication, but also ensuring the reliability of the transaction result.
The modules/units integrated by the first client 3 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM).
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A data transaction method based on multi-block chains is applied to a first client side, and the first client side has a function of adding a plurality of different block chains, and is characterized in that the method comprises the following steps:
receiving a transaction request triggered on a first blockchain, the transaction request requesting initiation of a transaction between a first address and a second address on a second blockchain;
judging whether the first client joins the second blockchain or not;
if the first client side is added into the second block chain, the transaction request is broadcasted on the first block chain;
after the transaction request is verified to be valid, sending the transaction request to the second blockchain, initiating a transaction between the first address and the second address on the second blockchain to obtain a transaction result, and transmitting the transaction result back to the first blockchain through the second blockchain;
broadcasting a verification request aiming at the transaction result on the first blockchain, wherein the transaction result is verified by a second client on the first blockchain, and the second client is a client except the first client in the clients simultaneously joining the first blockchain and the second blockchain;
counting a first number of passes of verification of the transaction result by the second client;
and if the first quantity exceeds a preset threshold value, determining that the transaction result is effective.
2. The method of claim 1, wherein the transaction request is verified by a third client joining the first blockchain and the second blockchain at the same time, wherein the third client determines whether the first address and the second address exist in the second blockchain at the same time, and if the first address and the second address exist in the second blockchain at the same time, determines whether total data on the first address is greater than or equal to transaction data required by the transaction request, and if the total data on the first address is greater than or equal to the transaction data required by the transaction request, determines that the transaction request is verified, and if a second amount of verification exceeds the preset threshold, determines that the transaction request is verified.
3. The method of claim 1, further comprising:
and if the first client does not join the second blockchain, broadcasting the transaction request on the first blockchain.
4. The method of any of claims 1 to 3, wherein prior to receiving a transaction request triggered on a first blockchain, the method further comprises:
generating account information for each blockchain the first client is to join.
5. The method of claim 4, further comprising:
receiving a blockchain selection instruction input on a blockchain list, wherein the blockchain list comprises a plurality of blockchains which can be added by the first client;
and responding to the block chain selection instruction, and adding the selected at least one block chain to the first client.
6. A data transaction device, run in the first customer end, the said first customer end possesses the function of joining the many different block chains, characterized by that, the said data transaction device includes:
a receiving module, configured to receive a transaction request triggered on a first blockchain, where the transaction request is used to request that a transaction be initiated between a first address and a second address on a second blockchain;
the judging module is used for judging whether the first client is added into the second block chain or not;
a broadcasting module, configured to broadcast the transaction request on the first blockchain if the first client joins the second blockchain;
the transmission module is used for sending the transaction request to the second block chain after the transaction request is verified to be effective, initiating transaction between the first address and the second address on the second block chain to obtain a transaction result, and transmitting the transaction result back to the first block chain through the second block chain;
the broadcast module is further configured to broadcast a verification request for the transaction result on the first blockchain, where a second client on the first blockchain verifies the transaction result, and the second client is a client, except the first client, of clients joining the first blockchain and the second blockchain at the same time;
the statistic module is used for counting a first number of the second clients passing the verification of the transaction result;
and the determining module is used for determining that the first transaction result takes effect if the first quantity exceeds a preset threshold value.
7. The data transaction apparatus of claim 6, wherein the broadcasting module is further configured to broadcast the transaction request on the first blockchain if the first client does not join the second blockchain.
8. The data transaction apparatus according to claim 6 or 7, wherein the receiving module is further configured to receive a blockchain selection instruction input on a blockchain list, where the blockchain list includes a plurality of blockchains that the first client can join;
the data transaction apparatus further includes:
and the joining module is used for responding to the block chain selection instruction and joining the selected at least one block chain to the first client.
9. A first client, characterized in that the first client comprises a processor and a memory, the processor is configured to execute a computer program stored in the memory to implement the method for data transaction based on multi-blockchain according to any one of claims 1 to 5.
10. A computer-readable storage medium storing at least one instruction which, when executed by a processor, implements the method for data transaction between multiblock chains according to any of claims 1 to 5.
CN201910810030.1A 2019-08-29 2019-08-29 Data transaction method based on multi-block chain and related equipment Active CN110517145B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910810030.1A CN110517145B (en) 2019-08-29 2019-08-29 Data transaction method based on multi-block chain and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910810030.1A CN110517145B (en) 2019-08-29 2019-08-29 Data transaction method based on multi-block chain and related equipment

Publications (2)

Publication Number Publication Date
CN110517145A CN110517145A (en) 2019-11-29
CN110517145B true CN110517145B (en) 2023-02-24

Family

ID=68628115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910810030.1A Active CN110517145B (en) 2019-08-29 2019-08-29 Data transaction method based on multi-block chain and related equipment

Country Status (1)

Country Link
CN (1) CN110517145B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866085B (en) * 2020-06-28 2021-12-14 北京沃东天骏信息技术有限公司 Data storage method, system and device based on block chain
CN112001800B (en) * 2020-10-28 2024-04-16 支付宝(杭州)信息技术有限公司 Method and device for processing business in block chain system
CN112632544B (en) * 2020-12-30 2022-06-17 宁夏希望信息产业股份有限公司 Block chain information data security management system and block chain dynamic anchoring method
CN113518103A (en) * 2021-03-01 2021-10-19 唐芮 Industrial Internet of things networking control method and system
CN113382018A (en) * 2021-06-29 2021-09-10 深圳市高德信通信股份有限公司 Multi-chain management method and system based on block chain

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018175540A1 (en) * 2017-03-24 2018-09-27 Alibaba Group Holding Limited Method and apparatus for consensus verification
CN109345387A (en) * 2018-09-04 2019-02-15 湖南宸瀚信息科技有限责任公司 Across the chain method of commerce of block chain, across chain communication device and storage medium
CN109447631A (en) * 2018-09-19 2019-03-08 平安科技(深圳)有限公司 Client, server, method of commerce and storage medium based on block chain
CN109934592A (en) * 2019-03-22 2019-06-25 深圳市网心科技有限公司 A kind of across the chain communication means of block chain, system, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018175540A1 (en) * 2017-03-24 2018-09-27 Alibaba Group Holding Limited Method and apparatus for consensus verification
CN109345387A (en) * 2018-09-04 2019-02-15 湖南宸瀚信息科技有限责任公司 Across the chain method of commerce of block chain, across chain communication device and storage medium
CN109447631A (en) * 2018-09-19 2019-03-08 平安科技(深圳)有限公司 Client, server, method of commerce and storage medium based on block chain
CN109934592A (en) * 2019-03-22 2019-06-25 深圳市网心科技有限公司 A kind of across the chain communication means of block chain, system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110517145A (en) 2019-11-29

Similar Documents

Publication Publication Date Title
CN110517145B (en) Data transaction method based on multi-block chain and related equipment
US10922772B2 (en) Copyright authorization management method and system
TWI713840B (en) Digital certificate management method, device and electronic equipment
CN108462724B (en) Data sharing method, device, system, member node and readable storage medium
CN109815657B (en) Identity authentication method and device based on alliance chain, computer readable storage medium and terminal equipment
CN108197944B (en) Resource transaction method and device based on block chain technology
KR101950912B1 (en) Verification system and method for transaction based block chain
CN109214818B (en) Cross-chain transaction method and device
CN110599213B (en) Article management method and device based on blockchain network and electronic equipment
CN113537984A (en) Content verification method and device based on block chain and electronic equipment
WO2020119536A1 (en) Alliance chain information release control method and terminal device
CN111612600B (en) Block chain auction method, equipment, storage medium and block chain system
CN111414373A (en) Consensus method and consensus system
CN109388957B (en) Block chain-based information transfer method, device, medium and electronic equipment
CN110400217B (en) Rule change processing method and device for intelligent contract
CN112087502B (en) Method, device and equipment for processing request and storage medium
CN114730421A (en) Trading using private and public blockchains
CN111985007A (en) Contract signing and executing method and device based on block chain
CN112036878A (en) Data processing method and device
CN113890739B (en) Cross-blockchain authentication method and device, electronic equipment and medium
CN111476640A (en) Authentication method, system, storage medium and big data authentication platform
CN112037055A (en) Transaction processing method and device, electronic equipment and readable storage medium
CN112788555B (en) Cross-operator telephone charge transfer settlement method, device and computing equipment
WO2023045532A1 (en) Blockchain-based transaction processing
WO2020103573A1 (en) Block chain-based network transaction signature method and device, and terminal equipment

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
GR01 Patent grant
GR01 Patent grant