CN116225730A - Method and device for inter-block chain communication and electronic equipment - Google Patents
Method and device for inter-block chain communication and electronic equipment Download PDFInfo
- Publication number
- CN116225730A CN116225730A CN202211504426.1A CN202211504426A CN116225730A CN 116225730 A CN116225730 A CN 116225730A CN 202211504426 A CN202211504426 A CN 202211504426A CN 116225730 A CN116225730 A CN 116225730A
- Authority
- CN
- China
- Prior art keywords
- chain
- transaction
- target
- transaction data
- relay service
- 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
Links
- 238000004891 communication Methods 0.000 title claims abstract description 67
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000012545 processing Methods 0.000 claims abstract description 36
- 238000012544 monitoring process Methods 0.000 claims abstract description 23
- 238000012216 screening Methods 0.000 claims abstract description 23
- 238000012795 verification Methods 0.000 claims description 24
- 238000004590 computer program Methods 0.000 claims description 14
- 238000006243 chemical reaction Methods 0.000 claims description 8
- 238000012790 confirmation Methods 0.000 claims description 6
- 230000004044 response Effects 0.000 claims description 3
- 238000005516 engineering process Methods 0.000 abstract description 3
- 230000007547 defect Effects 0.000 abstract description 2
- 239000004744 fabric Substances 0.000 description 9
- 238000010586 diagram Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000007480 spreading Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2379—Updates performed during online database operations; commit processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/258—Data format conversion from or to a database
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Debugging And Monitoring (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention relates to the field of blockchain technologies, and in particular, to a method, an apparatus, and an electronic device for communication between blockchains. A method of inter-blockchain communication, comprising: monitoring the transaction of the source chain to obtain a plurality of transaction data; screening the transaction data based on the cross-link condition to obtain target transaction data representing the cross-link transaction; the target transaction data at least comprises a transaction hash value, a source chain ID, a target chain ID and transaction information; invoking a relay service to convert the parameter format of the source chain of the transaction information into the parameter format of a target chain; and calling a relay service to send the target transaction data to the adapter tool matched with the target chain for transaction processing. The embodiment of the invention is used for solving the defect that the communication efficiency between different bottom layer block chains is poor in the existing method.
Description
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a method, an apparatus, and an electronic device for communication between blockchains.
Background
Blockchain (Blockchain) is an emerging technology based on mechanisms such as cryptography, distributed storage, point-to-point transmission, consensus algorithms, etc.
The technical implementation, transaction format, information transmission mode and the like of different bottom layer blockchains are different, so that the communication interaction of the different bottom layer blockchains is a difficult problem. If a relay service is used, maintenance of the relay service is difficult and frequent upgrades are required. The existing method is poor in efficiency of realizing communication among different bottom layer block chains.
Disclosure of Invention
The invention provides a method, a device and electronic equipment for communication among block chains, which are used for solving the defect of poor efficiency of the existing method for realizing communication among different bottom layer block chains.
The invention provides a method for communication between block chains, which comprises the following steps:
monitoring the transaction of the source chain to obtain a plurality of transaction data;
screening the transaction data based on the cross-link condition to obtain target transaction data representing the cross-link transaction; the target transaction data at least comprises a transaction hash value, a source chain ID, a target chain ID and transaction information;
invoking a relay service to convert the parameter format of the source chain of the transaction information into the parameter format of a target chain;
and calling a relay service to send the target transaction data to the adapter tool matched with the target chain for transaction processing.
According to the method for inter-blockchain communication provided by the invention, the multiple transaction data are screened based on the cross-chain piece to obtain target transaction data representing the cross-chain transaction, and the method comprises the following steps:
and determining that the transaction data comprises the target chain ID or the target chain association information, and determining that the transaction data is target transaction data needing to carry out cross-chain transaction.
According to the method for inter-blockchain communication provided by the invention, before the relay service is called to convert the parameter format of the source chain of the transaction information into the parameter format of the target chain, the method further comprises the following steps:
invoking a relay service to determine a source chain type of the target transaction data;
controlling the relay service to determine a verification rule based on the source chain type;
controlling the relay service to verify the target transaction data based on the verification rule; and if the verification is successful, executing the step of calling a relay service to convert the parameter format of the source chain of the transaction information into the parameter format of a target chain.
According to the method for inter-block chain communication provided by the invention, the method for inter-block chain communication further comprises the following steps:
and in response to the inquiry instruction, calling a relay service to inquire the transaction hash value and a transaction execution result of the transaction processing by the adapter tool.
According to the method for inter-block chain communication provided by the invention, the method for inter-block chain communication further comprises the following steps:
and calling a relay service to send a transaction execution result of the transaction processing performed by the adapter tool to the source chain so that the source chain performs a confirmation operation or a rollback operation.
According to the method for inter-blockchain communication provided by the invention, the transaction of the monitoring source chain obtains a plurality of transaction data, and the method comprises the following steps:
and obtaining a plurality of transaction data based on the transactions of the WebSocket monitoring source chain.
The invention also provides a device for communication between block chains, which comprises:
the monitoring module is used for monitoring the transaction of the source chain to obtain a plurality of transaction data;
the screening module is used for screening the transaction data based on the chain crossing piece to obtain target transaction data representing the cross-chain transaction; the target transaction data at least comprises a transaction hash value, a source chain ID, a target chain ID and transaction information;
the conversion module is used for calling a relay service to convert the parameter format of the source chain of the transaction information into the parameter format of a target chain;
and the transaction processing module is used for calling a relay service to send the target transaction data to the adapter tool matched with the target chain for transaction processing.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a method of inter-blockchain communication as described in any of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of inter-blockchain communication as described in any of the above.
The present invention also provides a computer program product comprising a computer program which when executed by a processor implements a method of inter-blockchain communication as described in any of the above.
According to the method, the device and the electronic equipment for inter-blockchain communication, provided by the invention, the target transaction data which characterize the cross-chain transaction is obtained by screening the transaction data based on the cross-chain condition; invoking a relay service to convert the parameter format of the source chain of the transaction information into the parameter format of a target chain; and then, the relay service is called to send the target transaction data to the adapter tool matched with the target chain for transaction processing. Therefore, the embodiment of the invention provides the unified relay service of the cross-region block chain based on the screening and conversion of the target transaction data and the transaction processing of the adapter tool sent to the target chain, and realizes the communication and the interoperation between isomorphic or heterogeneous chains. The blockchains participating in the cross-chain communication in the embodiment of the invention do not need to be modified or upgraded, can be quickly accessed into a cross-chain network with low cost, and improves the communication efficiency and compatibility between different bottom blockchains.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for inter-blockchain communication provided by the present invention;
FIG. 2 is a second flow chart of a method for inter-block chain communication provided by the present invention;
FIG. 3 is a third flow chart of a method for inter-blockchain communication provided by the present invention;
FIG. 4 is a flow chart of a method of inter-blockchain communication provided by the present invention;
FIG. 5 is a schematic diagram of an apparatus for inter-blockchain communication provided by the present invention;
fig. 6 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, the method for inter-blockchain communication of the present invention is described below with reference to fig. 1 to 4, and includes:
Wherein the source chain is a blockchain of a different architecture than the target chain. For example, the source chain and the target chain may be a block chain of Fabric architecture, a block chain of ethernet architecture, a block chain of EOS network architecture, a block chain of fsco BCOS architecture, and the like, respectively. So long as the source chain is a blockchain of a different architecture than the target chain.
Various transactions are conducted on the source chain, including transactions between homogeneous blockchains and heterogeneous blockchains. The target chain obtains a plurality of transaction data by listening to transactions of the source chain. Specifically, the embodiment of the invention can obtain a plurality of transaction data based on the transaction of the monitoring source chain of the monitoring service. The transaction of the snoop source chain is implemented by a snoop service of, for example, servletContextListener, httpSessionListener and servletrequestListener, to obtain a plurality of transaction data. Specifically, the transaction data includes a transaction hash value, a block ID, a block age, a source chain ID, a destination chain ID, a transaction fee, and the like.
In one embodiment, listening to transactions of a source chain for a plurality of transaction data specifically includes: and obtaining a plurality of transaction data based on the transactions of the WebSocket monitoring source chain. The message sent by the server monitoring the source chain can be realized by monitoring the transaction of the source chain through the WebSocket and only opening a WebSocket service on the target chain. The embodiment of the invention can realize the monitoring of a plurality of transaction data of the source chain more simply and efficiently through the WebSocket.
In addition, when the node of the source chain changes, the original monitoring is stopped, the address is updated, and the monitoring is restarted.
The target chain screens the transaction data based on the cross-chain piece to obtain target transaction data representing the transaction needing to be performed with the cross-chain, and shields the transaction which does not need to be performed with the cross-chain transaction.
The target transaction data at least comprises a transaction hash value, a source chain ID, a target chain ID and transaction information.
The transaction hash value is a transaction number on the blockchain that can be queried over the blockchain network if the transaction is successful. The source chain ID represents the identity of the source chain. The target chain ID represents an identification of the target chain ID. Wherein the source chain ID and the destination chain ID may be represented by a combination of letters and numbers, respectively. For example, the source strand ID is 0gd9fgdh052 and the target strand ID is 0rh9tjn063. The transaction information includes transaction value, transaction status (success or failure), transaction work fee, and transaction remarks. The transaction remarks may record information about the transaction via text information, such as the sender, receiver, and value of the transaction, etc. of the transaction remarks.
Specifically, screening the plurality of transaction data based on the cross-link condition to obtain target transaction data representing the cross-link transaction, including: and determining that the transaction data comprises the target chain ID or the target chain association information, and determining that the transaction data is the target transaction data which needs to carry out the cross-chain transaction.
When the monitored transaction data includes the target link ID, which indicates that the transaction is to be performed to the target link, the monitored transaction data is the target transaction data for which the cross-link transaction is required. Alternatively, when the transaction remark description included in the monitored transaction data is a transaction to be transacted to the target chain, for example, the transaction remark includes "transaction to target chain ID is 0rh9tjn 063" in the transaction remark, then the monitored transaction data is target transaction data for which a cross-chain transaction is required. And identifying target transaction data requiring transaction to the target chain for cross-chain transaction in the source chain by identifying the target chain ID or target chain association information in the transaction data.
After the transaction screening, the obtained target transaction data needing to be subjected to cross-chain transaction is subjected to target chain call relay service interface and is submitted to relay service for processing. The parameter format of the source chain is converted into the parameter format of the target chain. For example, the source chain is a block chain based on Fabric architecture and the target chain is a block chain based on ethernet architecture. At this time, the format of the parameters of the blockchain of the Fabric architecture needs to be converted into the format of the parameters of the blockchain of the ethernet architecture, so that the cross-chain transaction can be performed.
And 500, calling a relay service to send the target transaction data to an adapter tool matched with the target chain for transaction processing.
After the step of converting the parameter format of the source chain of transaction information into the parameter format of the target chain, the target chain invokes the relay service to send the target transaction data to the target chain-matched adapter tool for transaction processing.
It should be noted that, the adapter tool corresponding to the target chain is preconfigured. The blockchains of different architectures have matched developer Tools, such as Fabric has corresponding Fabric-sdk Tools, ethernet has corresponding web3.js Tools, EOS network has corresponding EOS Tools, fsco BCOS has corresponding BCOS-sdk, etc. For example, when the target chain is an ethernet type blockchain, the corresponding adapter tool is a web3.js tool. And the target chain calls the relay service to send the target transaction data to the adapter tool matched with the target chain for transaction processing.
Screening a plurality of transaction data based on the cross-chain piece to obtain target transaction data representing the cross-chain transaction; calling a relay service to convert the parameter format of a source chain of transaction information into the parameter format of a target chain; and then, the relay service is called to send the target transaction data to the adapter tool matched with the target chain for transaction processing. Therefore, the embodiment of the invention provides the unified relay service of the cross-region block chain based on the screening and conversion of the target transaction data and the transaction processing of the adapter tool sent to the target chain, and realizes the communication and the interoperation between isomorphic or heterogeneous chains. The blockchains participating in the cross-chain communication in the embodiment of the invention do not need to be modified or upgraded, can be quickly accessed into a cross-chain network with low cost, and improves the communication efficiency and compatibility between different bottom blockchains.
In other aspects of the embodiments of the present invention, referring to fig. 2, before step 400, calling the relay service to convert the parameter format of the source chain of the transaction information into the parameter format of the target chain, the method further includes:
Under the condition that the verification function is started, the target chain calls a relay service to determine the source chain type of the target transaction data; invoking a relay service to determine the source chain type of the target transaction data; and then controlling the relay service to verify the target transaction data based on the verification rule.
Specifically, the target chain stores verification rules corresponding to blockchains of different architectures. For example, the target chain stores verification rules corresponding to the blockchain of Fabric architecture, the blockchain of ethernet architecture, the blockchain of EOS network architecture, the blockchain of fsco BCOS architecture, and the like. The verification rule specifically comprises verification of transaction signature, block information, consensus information and the like by the block chain infrastructure.
For example, verifying the transaction signature of the cross-chain transaction based on the pre-stored corresponding certificate of the source chain, and also verifying whether the state information and the consensus information in the block are correct; an intelligent contract for authentication may also be invoked for authentication.
Specifically, the source chain ID in the target transaction data represents a blockchain of which the type is Fabric, and is based on a verification rule corresponding to the blockchain of which the Fabric is stored in the target chain. The target chain verifies the transaction signature, verifies whether the state information in the block is correct or not and verifies whether the consensus information is correct or not based on a block chain corresponding certificate of a pre-stored Fabric architecture; or by a special validation contract corresponding to the blockchain of the Fabric architecture.
In the embodiment of the invention, the subsequent parameter conversion operation is executed through the verification rule. The verification rule is determined based on the source chain type to verify the transaction information in the target transaction data, so that the data accuracy and the safety in the target transaction data are improved, and the success rate of cross-chain communication is improved.
It should be noted that when verification fails, the cross-chain transaction is stopped.
In other aspects of embodiments of the present invention, referring to fig. 3, the method for inter-blockchain communication further includes: step 600, in response to the inquiry command, the relay service is called to inquire the transaction hash value and the transaction execution result of the transaction processing by the adapter tool.
The embodiment also comprises the functions of inquiring the transaction hash value and the transaction execution result. The embodiment of the invention provides an interface for the relay service, a user sends out a query instruction through electronic equipment (keyboard, mouse or touch operation), and the target chain responds to the query instruction and calls the relay service to query the transaction hash value and the transaction execution result of the transaction processing by the adapter tool. For example, in the embodiment of the present invention, the source chain a will read the state and information of the target chain B, and the state and information of the B chain is used as the trigger condition for execution. And carrying out private key signature by using the address of the source chain A to obtain a signature, combining the signature with the transaction, carrying out hash value operation to obtain a transaction hash value, then spreading the transaction hash value to the target chain, and inquiring the transaction hash value through an inquiry instruction if the transaction is successful. In addition, the transaction hash value and the transaction execution result of the transaction processing can be queried by calling the relay service. The transaction execution results include success and failure.
It should be noted that, the transaction hash value and the transaction execution result of the transaction processing performed by the adapter tool may be displayed in a visual manner, for example, by an electronic device display.
In other aspects of embodiments of the present invention, referring to fig. 4, the method for inter-blockchain communication further includes: step 700, calling the relay service to send the transaction execution result of the transaction processing performed by the adapter tool to the source chain so that the source chain performs a confirmation operation or a rollback operation.
And sending a transaction execution result of the transaction processing performed by the adapter tool to the source chain through the relay service so that the source chain performs a confirmation operation or a rollback operation. Specifically, when the transaction execution result is that the cross-chain transaction is successful, the source chain performs a confirmation operation; and when the transaction execution result is that the cross-chain transaction fails, the source chain carries out rollback operation. Therefore, the embodiment of the invention calls the relay service to send the transaction execution result of the transaction processing by the adapter tool to the source chain, executes the source chain callback transaction and realizes the source chain checking cross-chain transaction.
The apparatus for inter-block chain communication provided by the present invention is described below, and the apparatus for inter-block chain communication described below and the method for inter-block chain communication described above may be referred to correspondingly.
Referring to fig. 5, an apparatus for inter-blockchain communication includes:
a monitoring module 201, configured to monitor a transaction of a source chain to obtain a plurality of transaction data;
the screening module 202 is configured to screen the plurality of transaction data based on the chain crossing members, so as to obtain target transaction data that characterizes a cross-chain transaction; the target transaction data at least comprises a transaction hash value, a source chain ID, a target chain ID and transaction information;
the conversion module 203 is configured to invoke the relay service to convert a parameter format of a source chain of transaction information into a parameter format of a target chain;
the transaction processing module 204 is configured to invoke the relay service to send the target transaction data to the adapter tool matched with the target chain for transaction processing.
According to the device for inter-block-chain communication, disclosed by the embodiment of the invention, a screening module is used for screening a plurality of transaction data based on a cross-chain condition to obtain target transaction data representing a cross-chain transaction; the relay service is called through the conversion module to convert the parameter format of the source chain of the transaction information into the parameter format of the target chain; and then, the transaction processing module calls the relay service to send the target transaction data to the adapter tool matched with the target chain for transaction processing. Therefore, the embodiment of the invention provides the unified relay service of the cross-block chain based on the screening and conversion of the target transaction data and the transaction processing of the adapter tool sent to the target chain, and realizes the communication and the interoperation between heterogeneous chains. The blockchains participating in the cross-chain communication in the embodiment of the invention do not need to be modified or upgraded, can be quickly accessed into a cross-chain network with low cost, and improves the communication efficiency and compatibility between different bottom blockchains.
In one embodiment, the screening module specifically includes: and determining that the transaction data comprises the target chain ID or the target chain association information, and determining that the transaction data is the target transaction data which needs to carry out the cross-chain transaction.
In one embodiment, the apparatus for inter-blockchain communication further comprises:
the source chain type determining module is used for calling the relay service to determine the source chain type of the target transaction data;
the verification rule determining module is used for controlling the relay service to determine a verification rule based on the source chain type;
the verification module is used for controlling the relay service to verify the target transaction data based on the verification rule; and if the verification is successful, the step of calling the relay service to convert the parameter format of the source chain of the transaction information into the parameter format of the target chain is executed.
In one embodiment, the apparatus for inter-blockchain communication further comprises:
and the query module is used for responding to the query instruction and calling the relay service to query the transaction hash value and the transaction execution result of the transaction processing performed by the adapter tool.
In one embodiment, the apparatus for inter-blockchain communication further comprises:
and the callback module is used for calling the relay service to send the transaction execution result of the transaction processing performed by the adapter tool to the source chain so as to ensure that the source chain performs the confirmation operation or rollback operation.
In one embodiment, the listening module comprises:
and obtaining a plurality of transaction data based on the transactions of the WebSocket monitoring source chain.
Fig. 6 illustrates a physical schematic diagram of an electronic device, as shown in fig. 6, which may include: processor 610, communication interface (Communications Interface) 620, memory 630, and communication bus 640, wherein processor 610, communication interface 620, and memory 630 communicate with each other via communication bus 640. The processor 610 may invoke logic instructions in the memory 630 to perform a method of inter-blockchain communication, the method comprising: monitoring the transaction of the source chain to obtain a plurality of transaction data; screening the transaction data based on the chain crossing pieces to obtain target transaction data representing the cross-chain transaction; the target transaction data at least comprises a transaction hash value, a source chain ID, a target chain ID and transaction information; calling a relay service to convert the parameter format of a source chain of transaction information into the parameter format of a target chain; and calling the relay service to send the target transaction data to the adapter tool matched with the target chain for transaction processing.
Further, the logic instructions in the memory 630 may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method of the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product comprising a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of performing the method of inter-blockchain communication provided by the methods described above, the method comprising: monitoring the transaction of the source chain to obtain a plurality of transaction data; screening the transaction data based on the chain crossing pieces to obtain target transaction data representing the cross-chain transaction; the target transaction data at least comprises a transaction hash value, a source chain ID, a target chain ID and transaction information; calling a relay service to convert the parameter format of a source chain of transaction information into the parameter format of a target chain; and calling the relay service to send the target transaction data to the adapter tool matched with the target chain for transaction processing.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform a method of inter-blockchain communication provided by the methods described above, the method comprising: monitoring the transaction of the source chain to obtain a plurality of transaction data; screening the transaction data based on the chain crossing pieces to obtain target transaction data representing the cross-chain transaction; the target transaction data at least comprises a transaction hash value, a source chain ID, a target chain ID and transaction information; calling a relay service to convert the parameter format of a source chain of transaction information into the parameter format of a target chain; and calling the relay service to send the target transaction data to the adapter tool matched with the target chain for transaction processing.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. A method of inter-blockchain communication, the method comprising:
monitoring the transaction of the source chain to obtain a plurality of transaction data;
screening the transaction data based on the cross-link condition to obtain target transaction data representing the cross-link transaction; the target transaction data at least comprises a transaction hash value, a source chain ID, a target chain ID and transaction information;
invoking a relay service to convert the parameter format of the source chain of the transaction information into the parameter format of a target chain;
and calling a relay service to send the target transaction data to the adapter tool matched with the target chain for transaction processing.
2. The method of inter-blockchain communication of claim 1, wherein the screening the plurality of transaction data based on the cross-chain member to obtain target transaction data characterizing a need for cross-chain transactions comprises:
and determining that the transaction data comprises the target chain ID or the target chain association information, and determining that the transaction data is target transaction data needing to carry out cross-chain transaction.
3. The method of inter-blockchain communication of claim 1, wherein before the invoking a relay service to convert the parameter format of the source chain of transaction information to the parameter format of a target chain, further comprising:
invoking a relay service to determine a source chain type of the target transaction data;
controlling the relay service to determine a verification rule based on the source chain type;
controlling the relay service to verify the target transaction data based on the verification rule; and if the verification is successful, executing the step of calling a relay service to convert the parameter format of the source chain of the transaction information into the parameter format of a target chain.
4. The method of inter-blockchain communication of claim 1, further comprising:
and in response to the inquiry instruction, calling a relay service to inquire the transaction hash value and a transaction execution result of the transaction processing by the adapter tool.
5. The method of inter-blockchain communication of claim 1, further comprising:
and calling a relay service to send a transaction execution result of the transaction processing performed by the adapter tool to the source chain so that the source chain performs a confirmation operation or a rollback operation.
6. The method of inter-blockchain communication of claim 1, wherein the listening for transactions from the source chain results in a plurality of transaction data, comprising:
and obtaining a plurality of transaction data based on the transactions of the WebSocket monitoring source chain.
7. An apparatus for inter-blockchain communication, comprising:
the monitoring module is used for monitoring the transaction of the source chain to obtain a plurality of transaction data;
the screening module is used for screening the transaction data based on the chain crossing piece to obtain target transaction data representing the cross-chain transaction; the target transaction data at least comprises a transaction hash value, a source chain ID, a target chain ID and transaction information;
the conversion module is used for calling a relay service to convert the parameter format of the source chain of the transaction information into the parameter format of a target chain;
and the transaction processing module is used for calling a relay service to send the target transaction data to the adapter tool matched with the target chain for transaction processing.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of inter-blockchain communication of any of claims 1 to 6 when the program is executed.
9. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the method of inter-blockchain communication of any of claims 1 to 6.
10. A computer program product comprising a computer program which when executed by a processor implements the method of inter-blockchain communication of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211504426.1A CN116225730A (en) | 2022-11-28 | 2022-11-28 | Method and device for inter-block chain communication and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211504426.1A CN116225730A (en) | 2022-11-28 | 2022-11-28 | Method and device for inter-block chain communication and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116225730A true CN116225730A (en) | 2023-06-06 |
Family
ID=86589865
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211504426.1A Pending CN116225730A (en) | 2022-11-28 | 2022-11-28 | Method and device for inter-block chain communication and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116225730A (en) |
-
2022
- 2022-11-28 CN CN202211504426.1A patent/CN116225730A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109558748B (en) | Data processing method and device, electronic equipment and storage medium | |
CN110569251B (en) | Data processing method, related equipment and computer readable storage medium | |
US20070158404A1 (en) | Method and system for management of terminal devices | |
CN112672357B (en) | Method and device for processing user account in service system and computer equipment | |
CN110601896B (en) | Data processing method and equipment based on block chain nodes | |
JP7672499B2 (en) | Cross-chain transaction processing method and device, electronic device, and computer program | |
CN113872828B (en) | State monitoring method for block chain prediction machine | |
CN113395310A (en) | Micro-service calling method, device, equipment and medium | |
CN111679968A (en) | Detecting method, device, computer equipment and storage medium for abnormal interface call | |
CN110908812A (en) | Business data processing method and device, readable storage medium and computer equipment | |
US20220368697A1 (en) | Method and system for synchronously generated security waiver interface | |
CN111367934A (en) | Data consistency checking method, device, server and medium | |
CN112699136B (en) | Cross-link certificate storage method and related device | |
CN110995756A (en) | Method and device for calling service | |
CN111932326B (en) | Data processing method based on block chain network and related equipment | |
CN116225730A (en) | Method and device for inter-block chain communication and electronic equipment | |
CN116962053A (en) | Efficient provable block chain data storage verification method, device and system | |
CN111988202B (en) | Node switching method, device and storage medium | |
CN114745216A (en) | Dynamic access method and device | |
CN111010391A (en) | Vulnerability repairing method, device and related equipment | |
CN119172074B (en) | A cross-chain business processing method, device, equipment and storage medium | |
CN115361274B (en) | Alarm message processing method and device | |
CN116366585B (en) | Message sending flow monitoring method and device, equipment and medium thereof | |
CN111400161B (en) | Method, device and system for authenticating a mobile terminal | |
US20240104558A1 (en) | Blockchain transaction execution method and apparatus, program product, device, and medium |
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 |