Blockchain transaction method, apparatus, and computer-readable storage medium

By determining the cross-chain contract parameter values ​​with the same format and type on the target blockchain, blockchain transactions can be performed directly, solving the problem of low transaction efficiency when the relay blockchain is busy and achieving efficient cross-chain transactions.

CN116308342BActive Publication Date: 2025-10-24CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211690340.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2025-10-24
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

Cross-chain transactions between different blockchains are inefficient, especially when the relay blockchain is busy. This is mainly because the relay blockchain needs to verify transaction-related data and exchange credentials between the source and target blockchains, which is a large task and leads to reduced transaction efficiency.

Method used

By obtaining the first message of the source blockchain and the first cross-chain contract of the target blockchain, using parameter values ​​of the same format and type, the third cross-chain contract is directly determined on the target blockchain, and the corresponding message is sent for transaction, avoiding the processing steps of the relay blockchain.

Benefits of technology

When the relay blockchain is busy, the transaction efficiency between different blockchains is improved, and direct transactions without the need for relay blockchain processing are realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116308342B_ABST
    Figure CN116308342B_ABST
Patent Text Reader

Abstract

The application provides a blockchain transaction method and device and a computer readable storage medium, relates to the field of data transmission, and can improve the transaction efficiency between different blockchains when the relay blockchain is busy. The method comprises the following steps: acquiring a first message of a source blockchain and a first cross-chain contract of a target blockchain; determining a third cross-chain contract of the target blockchain according to a first parameter and the first cross-chain contract; the third cross-chain contract comprises a second parameter, the format of the third cross-chain contract and the format of the second parameter are the same as the format of the first cross-chain contract, the parameter value of the second parameter is the same as the parameter value of the first parameter, and the type of the second parameter is the same as the type of the first parameter; sending a second message to the target blockchain; the second message is used for instructing the target blockchain to perform target transaction with the source blockchain based on the third cross-chain contract, and the second message comprises the third cross-chain contract.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data transmission, in particular to a blockchain transaction method and device and a computer readable storage medium. BACKGROUND

[0002] Due to the different formats and identity authentication problems between different blockchains, in order to realize cross-chain transactions between different blockchains, an existing blockchain transaction method is that a source blockchain sends transaction-related data to a relay blockchain, the relay blockchain verifies the transaction-related data, sends a verification success voucher to the source blockchain, sends the transaction-related data to a target blockchain, receives a receiving voucher from the target blockchain, receives a receiving success voucher from the target blockchain after the target blockchain completes the transaction with the source blockchain, and notifies the source blockchain that the cross-chain transaction is completed.

[0003] In the existing blockchain transaction method, the relay blockchain needs to verify the transaction-related data of the source blockchain and interact with the source blockchain and the target blockchain for various vouchers, and the task amount of the relay blockchain is large, so when the relay blockchain is busy, the efficiency of transactions between different blockchains is low. SUMMARY

[0004] The present application provides a blockchain transaction method, device and computer readable storage medium, which can improve the efficiency of transactions between different blockchains when the relay blockchain is busy.

[0005] To achieve the above purpose, the present application adopts the following technical solutions:

[0006] In a first aspect, a blockchain transaction method is provided, the method comprising: obtaining a first message of a source blockchain and a first cross-chain contract of a target blockchain; the first message is used to request a target transaction with the target blockchain, the first message includes a first parameter in a second cross-chain contract of the source blockchain, the first parameter is used to indicate a transaction action of the target transaction, the format of the first cross-chain contract is different from the format of the second cross-chain contract, and the format of the first parameter is the same as the format of the second cross-chain contract; determining a third cross-chain contract of the target blockchain according to the first parameter and the first cross-chain contract; the third cross-chain contract includes a second parameter, the format of the third cross-chain contract and the format of the second parameter are the same as the format of the first cross-chain contract, the parameter value of the second parameter is the same as the parameter value of the first parameter, and the type of the second parameter is the same as the type of the first parameter; sending a second message to the target blockchain; the second message is used to instruct the target blockchain to perform the target transaction with the source blockchain based on the third cross-chain contract, and the second message includes the third cross-chain contract.

[0007] According to the scheme, the first message including the first parameter and the first cross-chain contract of the target blockchain are obtained, the third cross-chain contract of the target blockchain is determined according to the first parameter and the first cross-chain contract, and the second message including the third cross-chain contract is sent to the target blockchain, so that the target blockchain performs the target transaction with the source blockchain based on the third cross-chain contract. Compared with the existing blockchain transaction method which needs to be processed by the relay blockchain, in the scheme, the parameter value and type of the second parameter in the third cross-chain contract of the target blockchain are the same as the parameter value and type of the first parameter in the second cross-chain contract of the source blockchain, and the format of each parameter is the same as the format of the respective cross-chain contract, so that the two blockchains can directly perform transactions without the need for the relay blockchain to process, that is, the transaction between the two blockchains can be realized, and the efficiency of the transaction between different blockchains can be improved when the relay blockchain is busy.

[0008] In combination with the first aspect, in some embodiments of the first aspect, determining the third cross-chain contract of the target blockchain according to the first parameter and the first cross-chain contract specifically includes: converting the first parameter into a second parameter; and writing the second parameter into the first cross-chain contract to determine the third cross-chain contract of the target blockchain.

[0009] According to the scheme, the scheme of determining the third cross-chain contract of the target blockchain according to the first parameter and the first cross-chain contract can be realized.

[0010] In combination with the first aspect, in some embodiments of the first aspect, the method further includes: sending a third message to the target blockchain; the third message is used to obtain the transaction state of the target transaction; obtaining a fourth message of the target blockchain; and the fourth message includes the transaction state of the target transaction.

[0011] According to the scheme, by sending the third message used to obtain the transaction state of the target transaction to the target blockchain, and receiving the fourth message including the transaction state of the target transaction, the transaction state of the target transaction can be perceived.

[0012] In combination with the first aspect, in some embodiments of the first aspect, the method further includes: sending a fifth message to the source blockchain; and the fifth message includes the transaction state of the target transaction.

[0013] According to the scheme, by sending the fifth message including the transaction state of the target transaction to the source blockchain, the source blockchain can perceive the transaction state of the target transaction.

[0014] In a second aspect, a blockchain transaction apparatus is provided for implementing the blockchain transaction method of the first aspect. The blockchain transaction apparatus comprises modules, units or means for implementing the corresponding steps of the method, which can be implemented by hardware, software or by hardware executing corresponding software. The hardware or software comprises one or more modules or units corresponding to the above functions.

[0015] With reference to the second aspect, in some embodiments of the second aspect, the blockchain transaction apparatus comprises: a transceiver module and a processing module; the transceiver module is configured to obtain a first message of a source blockchain and a first cross-chain contract of a target blockchain; the first message is used to request a target transaction with the target blockchain, and the first message comprises a first parameter in a second cross-chain contract of the source blockchain, the first parameter being used to indicate a transaction action of the target transaction; the first cross-chain contract has a format different from that of the second cross-chain contract, and the first parameter has a format same as that of the second cross-chain contract; the processing module is configured to determine a third cross-chain contract of the target blockchain according to the first parameter and the first cross-chain contract; the third cross-chain contract comprises a second parameter, the third cross-chain contract and the second parameter have the same format as the first cross-chain contract, the second parameter has a same parameter value as the first parameter, and the second parameter has a same type as the first parameter; and the transceiver module is further configured to send a second message to the target blockchain; the second message is used to instruct the target blockchain to perform the target transaction with the source blockchain based on the third cross-chain contract, and the second message comprises the third cross-chain contract.

[0016] With reference to the second aspect, in some embodiments of the second aspect, the processing module is specifically configured to: convert the first parameter into the second parameter; and write the second parameter into the first cross-chain contract to determine the third cross-chain contract of the target blockchain.

[0017] With reference to the second aspect, in some embodiments of the second aspect, the transceiver module is further configured to: send a third message to the target blockchain; the third message is used to obtain a transaction status of the target transaction; obtain a fourth message of the target blockchain; and the fourth message comprises the transaction status of the target transaction.

[0018] With reference to the second aspect, in some embodiments of the second aspect, the transceiver module is further configured to: send a fifth message to the source blockchain; and the fifth message comprises the transaction status of the target transaction.

[0019] In a third aspect, a blockchain transaction apparatus is provided, comprising: at least one processor, and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method provided by the first aspect and any possible implementation thereof.

[0020] In a fourth aspect, a computer-readable storage medium is provided, which, when instructions in the computer-readable storage medium are executed by a processor of a blockchain transaction device, enables the blockchain transaction device to perform the method provided in the first aspect and any possible implementation thereof.

[0021] In a fifth aspect, a computer program product containing instructions, which, when run on a computer, enables the computer to perform the method provided in the first aspect and any possible implementation thereof.

[0022] In a sixth aspect, a chip system is provided, comprising: a processor and an interface circuit; the interface circuit is configured to receive a computer program or instructions and transmit to the processor; the processor is configured to execute the computer program or instructions, so that the chip system performs the method provided in the first aspect and any possible implementation thereof.

[0023] The technical effects brought by any implementation of the second aspect to the sixth aspect can refer to the technical effects brought by different implementations of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0024] Figure 1 A schematic diagram of the architecture of a blockchain transaction system provided in the present application is shown;

[0025] Figure 2 A schematic diagram of the flow of a blockchain transaction method provided in the present application is shown;

[0026] Figure 3 A schematic diagram of the flow of another blockchain transaction method provided in the present application is shown;

[0027] Figure 4 A schematic diagram of the flow of another blockchain transaction method provided in the present application is shown;

[0028] Figure 5 A schematic diagram of the structure of a blockchain transaction device provided in the present application is shown;

[0029] Figure 6 A schematic diagram of the structure of another blockchain transaction device provided in the present application is shown. DETAILED DESCRIPTION

[0030] In the description of the present application, "a plurality of" means two or more than two, unless otherwise specified. "At least one of the following" or similar expressions means any combination of the items, including any combination of single item or multiple items. For example, at least one of a, b, or c can mean a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.

[0031] In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same or similar items with basically the same function and role. Those skilled in the art can understand that the words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. also do not mean necessarily different.

[0032] Meanwhile, in the embodiments of the present application, the words "exemplary" or "for example" are used to mean as an example, illustration, or description. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design solutions. Rather, the words "exemplary" or "for example" are used in the sense of presenting related concepts in a specific manner, for ease of understanding.

[0033] It can be understood that the "embodiments" mentioned throughout the specification mean that the specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, the various embodiments throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It can be understood that in various embodiments of the present application, the size of the sequence number of each process does not mean the execution order, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0034] It can be understood that in the present application, "when", "if" and "if" all refer to making corresponding processing under certain objective circumstances, not limited to time, and also do not require a judgment action when implementing, nor does it mean that there are other limitations.

[0035] It can be understood that some optional features in the embodiments of the present application can be implemented independently in some scenarios, without relying on other features, such as the scheme currently based on, to solve the corresponding technical problems and achieve the corresponding effects. Also, in some scenarios, it can be combined with other features according to the needs. Correspondingly, the devices given in the embodiments of the present application can also realize these features or functions, which will not be described here.

[0036] In the present application, the same or similar parts between various embodiments can be mutually referred to, unless otherwise specified. In the various embodiments of the present application, and the various implementation methods in the various embodiments, the terms and / or descriptions between different embodiments, and between the various implementation methods in the various embodiments are consistent, and can be mutually referred to, unless otherwise specified and logically conflicted. The technical features in different embodiments, and in the various implementation methods in the various embodiments can be combined to form new embodiments, implementation manners, implementation methods, or implementation methods according to their inherent logical relationship. The following implementation manners of the present application do not constitute a limitation on the protection scope of the present application.

[0037] Figure 1 An architecture schematic diagram of a blockchain transaction system provided in the present application, the technical scheme of the embodiment of the present application can be applied to Figure 1 The blockchain transaction system shown in the figure, as Figure 1 The blockchain transaction system 10 includes a blockchain transaction device 11 and an electronic device 12.

[0038] The blockchain transaction device 11 is directly or indirectly connected to the electronic device 12. In the connection relationship, a wired connection or a wireless connection can be used, which is not limited in the embodiment of the present application.

[0039] The blockchain transaction device 11 can be used to receive data from the electronic device 12.

[0040] The electronic device 12 can be used to send data to the blockchain transaction device 11.

[0041] It should be noted that the blockchain transaction device 11 and the electronic device 12 can be independent devices, or can be integrated into the same device, which is not limited in the present application.

[0042] When the blockchain transaction device 11 and the electronic device 12 are integrated into the same device, the communication mode between the blockchain transaction device 11 and the electronic device 12 is the communication between the internal modules of the device. In this case, the communication process between the two is the same as the communication process between the blockchain transaction device 11 and the electronic device 12 when they are independent of each other.

[0043] In the following embodiments provided in the present application, the blockchain transaction device 11 and the electronic device 12 are independent of each other.

[0044] In practical applications, the blockchain transaction method provided by the embodiment of the present application can be applied to the blockchain transaction device 11, or to the device included in the blockchain transaction device 11.

[0045] With reference to the accompanying drawings, the blockchain transaction method provided by the embodiments of the present application is described below with the blockchain transaction method applied to the blockchain transaction device 11 as an example.

[0046] Figure 2 A flowchart of the blockchain transaction method provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the method comprises the following steps. Figure 2

[0047] S201, the blockchain transaction device acquires a first message of a source blockchain and a first cross-chain contract of a target blockchain.

[0048] The first message is used to request a target transaction with the target blockchain, and the first message comprises a first parameter in a second cross-chain contract of the source blockchain. The first parameter is used to indicate a transaction action of the target transaction. The format of the first cross-chain contract is different from the format of the second cross-chain contract, and the format of the first parameter is the same as the format of the second cross-chain contract.

[0049] It should be noted that the target transaction can be data transmission, which is not limited in the present application.

[0050] The first message can be a cross-chain transaction request message, or the first message can also be a target transaction request message, or the first message can also be a message with other names, and the specific name of the first message is not limited in the present application.

[0051] The format of the first cross-chain contract can be format A, or the format of the first cross-chain contract can also be format B, or the format of the first cross-chain contract can also be other formats, and the specific format of the first cross-chain contract is not limited in the present application.

[0052] For example, the format of the first cross-chain contract can be a smart legal format.

[0053] The format of the second cross-chain contract can be format C, or the format of the second cross-chain contract can also be format D, or the format of the second cross-chain contract can also be other formats, and the specific format of the second cross-chain contract is not limited in the present application.

[0054] For example, the format of the second cross-chain contract can be an application logic format.

[0055] Correspondingly, when the format of the second cross-chain contract is format C, the format of the first parameter is also format C, or when the format of the second cross-chain contract is format D, the format of the first parameter is also format D.

[0056] The first parameter can be a parameter of a cross-chain contract method in the second cross-chain contract.

[0057] ​The transaction action can be an action corresponding to the target transaction. For example, the transaction action can be a certificate action, or the transaction action can be a query action, or the transaction action can be another action. The specific action of the transaction action is not limited in the present application.

[0058] As a possible implementation, in combination with Figure 1 The blockchain transaction device receives a message from the electronic device, the message including the first message of the source blockchain and the first cross-chain contract of the target blockchain, and the blockchain transaction device obtains the first message of the source blockchain and the first cross-chain contract of the target blockchain from the message.

[0059] As another possible implementation, the blockchain transaction device receives a message from the source blockchain, the message including the first message of the source blockchain and the blockchain identifier of the target blockchain, and the blockchain transaction device obtains the first message of the source blockchain from the message and obtains the first cross-chain contract of the target blockchain according to the blockchain identifier of the target blockchain.

[0060] It should be noted that in this possible implementation, the specific implementation scheme of the blockchain transaction device obtaining the first cross-chain contract of the target blockchain according to the blockchain identifier of the target blockchain can refer to the existing scheme, which will not be described herein.

[0061] S202, the blockchain transaction device determines a third cross-chain contract of the target blockchain according to the first parameter and the first cross-chain contract.

[0062] The third cross-chain contract includes a second parameter, the format of the third cross-chain contract and the format of the second parameter are the same as the format of the first cross-chain contract, the parameter value of the second parameter is the same as the parameter value of the first parameter, and the type of the second parameter is the same as the type of the first parameter.

[0063] It should be noted that in the case where the parameter value of the first parameter is E value, the parameter value of the second parameter is also E value, or in the case where the parameter value of the first parameter is F value, the parameter value of the second parameter is also F value.

[0064] In the case where the type of the first parameter is G type, the type of the second parameter is also G type, or in the case where the type of the first parameter is H type, the type of the second parameter is also H type.

[0065] In the case where the format of the first cross-chain contract is A format, the format of the second parameter is also A format, or in the case where the format of the first cross-chain contract is B format, the format of the second parameter is also B format.

[0066] In a case where the format of the first cross-chain contract is the format A, the format of the third cross-chain contract is also the format A, or in a case where the format of the first cross-chain contract is the format B, the format of the third cross-chain contract is also the format B.

[0067] As a possible implementation, the blockchain transaction apparatus determines the second parameter according to the first parameter, and determines the third cross-chain contract of the target blockchain according to the second parameter and the first cross-chain contract.

[0068] It should be noted that the specific description of this possible implementation can refer to the related description in the subsequent part of the specific embodiments of the present application, which will not be described here in detail.

[0069] S203, the blockchain transaction apparatus sends a second message to the target blockchain.

[0070] The second message is used to instruct the target blockchain to perform a target transaction with the source blockchain based on the third cross-chain contract, and the second message includes the third cross-chain contract.

[0071] It should be noted that the second message can be a cross-chain transaction instruction message, or the second message can also be target transaction instruction information, or the second message can also be a message with other names, and the specific name of the second message is not limited in the present application.

[0072] The specific implementation scheme of the target blockchain performing the target transaction with the source blockchain based on the third cross-chain contract can refer to the existing scheme, which will not be described here.

[0073] Based on the scheme, by obtaining the first message including the first parameter and the first cross-chain contract of the target blockchain, the third cross-chain contract of the target blockchain is determined according to the first parameter and the first cross-chain contract, and the second message including the third cross-chain contract is sent to the target blockchain, so that the target blockchain performs a target transaction with the source blockchain based on the third cross-chain contract. Compared with the existing blockchain transaction method which needs to be processed by the relay blockchain, in the scheme of the present application, the parameter value and type of the second parameter in the third cross-chain contract of the target blockchain are the same as the parameter value and type of the first parameter in the second cross-chain contract of the source blockchain, and the format of each parameter is the same as the format of the respective cross-chain contract. Therefore, the two blockchains can directly perform transactions without the need for a relay blockchain to process them, which enables transactions between two blockchains and improves the efficiency of transactions between different blockchains when the relay blockchain is busy.

[0074] The above is a general description of the blockchain transaction method provided by the present application. The blockchain transaction method provided by the present application will be further described below with reference to the accompanying drawings.

[0075] In one design, Figure 3As shown in FIG. 1, the flowchart of another blockchain transaction method provided by the present application is shown in FIG. 2. Figure 3 As shown in FIG. 2, S202 provided by the present application comprises the following steps.

[0076] S301, the blockchain transaction device converts the first parameter into a second parameter.

[0077] As a possible implementation, the blockchain transaction device converts the format of the first parameter into the format of the first cross-chain contract to obtain the second parameter.

[0078] As an example, taking the format of the first parameter as C format and the format of the first cross-chain contract as A format, the blockchain transaction device converts the C format of the first parameter into the A format to obtain the second parameter.

[0079] As another example, taking the format of the first parameter as D format and the format of the first cross-chain contract as B format, the blockchain transaction device converts the D format of the first parameter into the B format to obtain the second parameter.

[0080] It should be noted that in this possible implementation, the specific implementation of the blockchain transaction device converting the format of the first parameter into the format of the first cross-chain contract can refer to the existing related schemes, and the present application will not be described here.

[0081] S302, the blockchain transaction device writes the second parameter into the first cross-chain contract to determine a third cross-chain contract of the target blockchain.

[0082] As a possible implementation, the blockchain transaction device writes the parameter value of the second parameter into the corresponding type of parameter in the first cross-chain contract to obtain the third cross-chain contract of the target blockchain.

[0083] As an example, taking the parameter value of the second parameter as E value and the type of the second parameter as G type, the blockchain transaction device writes the E value into the G type parameter in the first cross-chain contract to obtain the third cross-chain contract of the target blockchain.

[0084] As another example, taking the parameter value of the second parameter as F value and the type of the second parameter as H type, the blockchain transaction device writes the F value into the H type parameter in the first cross-chain contract to obtain the third cross-chain contract of the target blockchain.

[0085] It should be noted that in this possible implementation, the specific implementation of the blockchain transaction device writing the second parameter into the first cross-chain contract can refer to the existing related schemes, and the present application will not be specifically limited.

[0086] Based on this scheme, the scheme of determining the third cross-chain contract of the target blockchain according to the first parameter and the first cross-chain contract can be realized.

[0087] In one design, Figure 4 A flowchart of another blockchain transaction method provided in the present application is shown in Figure 4 The blockchain transaction method provided in the present application further includes the following steps:

[0088] S401. The blockchain transaction device sends a third message to the target blockchain.

[0089] The third message is used to obtain the transaction status of the target transaction.

[0090] It should be noted that the third message can be a transaction status query message, or the third message can be a transaction status query message of the target transaction, or the third message can be a message with another name, which is not limited in the present application.

[0091] The transaction status of the target transaction can be a transaction in progress, or the transaction status of the target transaction can be a transaction failure, or the transaction status of the target transaction can be a transaction completion.

[0092] S402. The blockchain transaction device obtains a fourth message of the target blockchain.

[0093] The fourth message includes the transaction status of the target transaction.

[0094] It should be noted that the fourth message can be a query response message, or the fourth message can be a query response message of the target transaction, or the fourth message can be a message with another name, which is not limited in the present application.

[0095] As a possible implementation, in combination with Figure 1 The blockchain transaction device receives a message of the electronic device, which includes the fourth message of the target blockchain, and the blockchain transaction device obtains the fourth message of the target blockchain from the message.

[0096] As another possible implementation, the blockchain transaction device receives a message of the target blockchain, which includes the fourth message of the target blockchain, and the blockchain transaction device obtains the fourth message of the target blockchain from the message.

[0097] Based on this scheme, by sending the third message for obtaining the transaction status of the target transaction to the target blockchain, and receiving the fourth message including the transaction status of the target transaction, the transaction status of the target transaction can be perceived.

[0098] In one design, the blockchain transaction method provided in the present application further includes the following steps:

[0099] The blockchain transaction apparatus sends a fifth message to the source blockchain.

[0100] The fifth message includes the transaction state of the target transaction.

[0101] It should be noted that the fifth message can also be the same as the fourth message, or the fifth message can also be different from the fourth message.

[0102] In the case where the fifth message is the same as the fourth message, if the fourth message is a query response message, the fifth message is also a query response message, or if the fourth message is a query response message of the target transaction, the fifth message is also a query response message of the target transaction.

[0103] In the case where the fifth message is different from the fourth message, the fifth message can be a query response message, or the fifth message can also be a query response message of the target transaction, or the fifth message can also be a message with other names, which is not limited in the present application.

[0104] Based on the scheme, by sending the fifth message including the transaction state of the target transaction to the source blockchain, the source blockchain can perceive the transaction state of the target transaction.

[0105] The above mainly introduces the scheme provided by the embodiments of the present application from the perspective of the blockchain transaction apparatus executing the blockchain transaction method. In order to realize the above functions, the blockchain transaction apparatus includes the corresponding hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed in the present application, the embodiments of the present application can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is realized in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical scheme. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0106] The embodiments of the present application can divide the functional modules of the blockchain transaction device according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be realized in the form of hardware or in the form of a software functional module. Optionally, the division of the modules in the embodiments of the present application is illustrative, and is only a logical functional division. In actual implementation, another division mode can be used. In addition, the "module" here can refer to a specific application-specific integrated circuit (ASIC), a circuit, a processor and a memory executing one or more software or firmware programs, an integrated logic circuit, and / or other devices that can provide the above functions.

[0107] In the case of functional module division, Figure 5 A structural schematic diagram of a blockchain transaction device is shown. As Figure 5 shown, the blockchain transaction device 50 includes a transceiver module 501 and a processing module 502.

[0108] In some embodiments, the blockchain transaction device 50 can also include a storage module (not shown in the figure) for storing program instructions and data. Figure 5

[0109] The transceiver module 501 is configured to obtain a first message of a source blockchain and a first cross-chain contract of a target blockchain. The first message is used to request a target transaction with the target blockchain. The first message includes a first parameter in a second cross-chain contract of the source blockchain. The first parameter is used to indicate a transaction action of the target transaction. The format of the first cross-chain contract is different from the format of the second cross-chain contract. The format of the first parameter is the same as the format of the second cross-chain contract. The processing module 502 is configured to determine a third cross-chain contract of the target blockchain according to the first parameter and the first cross-chain contract. The third cross-chain contract includes a second parameter. The format of the third cross-chain contract and the format of the second parameter are the same as the format of the first cross-chain contract. The parameter value of the second parameter is the same as the parameter value of the first parameter. The type of the second parameter is the same as the type of the first parameter. The transceiver module 501 is further configured to send a second message to the target blockchain. The second message is used to instruct the target blockchain to perform the target transaction with the source blockchain based on the third cross-chain contract. The second message includes the third cross-chain contract.

[0110] Optionally, the processing module 502 is specifically configured to: convert the first parameter into the second parameter; and write the second parameter into the first cross-chain contract to determine the third cross-chain contract of the target blockchain.

[0111] ​Optionally, the transceiver module 501 is further configured to send a third message to the target blockchain, the third message being used to obtain a transaction state of the target transaction; and obtain a fourth message of the target blockchain, the fourth message comprising the transaction state of the target transaction.

[0112] Optionally, the transceiver module 501 is further configured to send a fifth message to the source blockchain, the fifth message comprising the transaction state of the target transaction.

[0113] All related contents of each step involved in the method embodiments described above can be cited from the function description of the corresponding function module, which will not be repeated here.

[0114] In the case where the functions of the function modules described above are implemented in the form of hardware, Figure 6 A structural schematic diagram of a blockchain transaction device is shown. As Figure 6 shown, the blockchain transaction device 60 comprises a processor 601, a memory 602 and a bus 603. The processor 601 and the memory 602 can be connected through the bus 603.

[0115] The processor 601 is the control center of the blockchain transaction device 60, which can be one processor or a general term of multiple processing elements. For example, the processor 601 can be a general central processing unit (CPU), or other general-purpose processors, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0116] As an embodiment, the processor 601 can include one or more CPUs, such as the CPU 0 and the CPU 1 shown in Figure 6 .

[0117] The memory 602 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this.

[0118] As a possible implementation, the memory 602 can exist independently of the processor 601, and the memory 602 can be connected to the processor 601 through the bus 603, for storing instructions or program codes. When the processor 601 invokes and executes the instructions or program codes stored in the memory 602, the blockchain transaction method provided by the embodiments of the present application can be implemented.

[0119] In another possible implementation, the memory 602 can also be integrated with the processor 601.

[0120] The bus 603 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, and the like. For the sake of presentation, Figure 6 Only one thick line is used to represent the bus in the figure, but it does not mean that there is only one bus or only one type of bus.

[0121] It should be noted that, Figure 6 The structure shown does not constitute a limitation on the blockchain transaction device 60. In addition to Figure 6 the components shown, the blockchain transaction device 60 can include more or fewer components than shown, or combine some components, or different component arrangements.

[0122] As an example, in combination with Figure 5 , the functions implemented by the transceiver module 501 and the processing module 502 in the blockchain transaction device 50 are the same as the functions of the processor 601 in Figure 6 .

[0123] Optionally, as Figure 6 shown, the blockchain transaction device 60 provided by the embodiments of the present application can further include a communication interface 604.

[0124] The communication interface 604 is used to connect with other devices through a communication network. The communication network can be an Ethernet, a wireless access network, a wireless local area network (WLAN), or the like. The communication interface 604 can include a receiving unit for receiving data, and a sending unit for sending data.

[0125] In a possible implementation, the communication interface 604 in the blockchain transaction apparatus 60 provided by the embodiments of the present application can also be integrated in the processor 601, which is not limited herein.

[0126] As a possible product form, the blockchain transaction apparatus provided by the embodiments of the present application can also be implemented by using one or more field programmable gate arrays (FPGA), programmable logic devices (PLD), controllers, state machines, gate logic, discrete hardware components, any other suitable circuit, or any combination of circuits capable of performing the various functions described throughout this application.

[0127] From the above description of the embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units is taken as an example. In actual application, the above functions can be completed by different functional units according to needs, that is, the internal structure of the apparatus is divided into different functional units to complete all or part of the above described functions. The specific working process of the above described system, apparatus and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described here.

[0128] The embodiments of the present application also provide a computer readable storage medium having stored thereon a computer program or instructions, which, when executed by a computer, cause the computer to perform each step in the method flow illustrated by the foregoing method embodiments.

[0129] The embodiments of the present application provide a computer program product containing instructions, which, when executed on a computer, cause the computer to perform each step in the method flow illustrated by the foregoing method embodiments.

[0130] The embodiments of the present application provide a chip system, comprising: a processor and an interface circuit; the interface circuit is used to receive a computer program or instructions and transmit to the processor; the processor is used to execute the computer program or instructions, so that the chip system performs each step in the method flow illustrated by the foregoing method embodiments.

[0131] The computer readable storage medium, for example, can be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a register, a hard disk, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. A tangible, non-transitory computer-readable storage medium can be coupled to the processor such that the processor can read information from the computer-readable storage medium and can write information to the computer-readable storage medium. The tangible, non-transitory computer-readable storage medium can be part of the processor. The processor and the computer-readable storage medium can be located in an ASIC. The computer-readable storage medium of the present embodiment can be any tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.

[0132] Since the blockchain transaction device, the computer readable storage medium, and the computer program product provided by the present embodiment can be applied to the blockchain transaction method provided by the present embodiment, the technical effects obtained by the present embodiment can refer to the method embodiments, and the present embodiment will not be described here.

[0133] Although the present application is described herein in conjunction with various embodiments, those skilled in the art, with the benefit of the drawings, the disclosure, and the appended claims, can understand and implement other variations of the disclosed embodiments in the implementation of the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and the word "a" or "one" does not exclude a plurality. A single processor or other unit can implement several functions listed in the claims. Measures described in mutually different dependent claims can be combined and produce beneficial results.

[0134] Although the present application has been described in connection with certain specific features and embodiments thereof, it is to be understood that it is provided as an exemplification of the application and is not intended to limit the scope of the application, which is defined in the claims. Various modifications and changes can be made thereto without departing from the spirit and scope of the application. Accordingly, it is intended that all such modifications and changes be included within the scope of the application as claimed. Obviously, many modifications and variations of the present application are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A blockchain transaction method, characterized by, The method comprises: obtaining a first message of a source blockchain and a first cross-chain contract of a target blockchain; the first message is used for requesting a target transaction with the target blockchain, the first message comprises a first parameter in a second cross-chain contract of the source blockchain, the first parameter is used for indicating a transaction action of the target transaction, a format of the first cross-chain contract is different from a format of the second cross-chain contract, and a format of the first parameter is same as the format of the second cross-chain contract; determining a third cross-chain contract of the target blockchain according to the first parameter and the first cross-chain contract; the third cross-chain contract comprises a second parameter, a format of the third cross-chain contract and a format of the second parameter are same as the format of the first cross-chain contract, a parameter value of the second parameter is same as a parameter value of the first parameter, and a type of the second parameter is same as a type of the first parameter; sending a second message to the target blockchain; the second message is used for instructing the target blockchain to perform the target transaction with the source blockchain based on the third cross-chain contract, and the second message comprises the third cross-chain contract. The method further comprises: sending a third message to the target blockchain; the third message is used for obtaining a transaction state of the target transaction; obtaining a fourth message of the target blockchain; the fourth message comprises the transaction state of the target transaction.

2. The method of claim 1, wherein, The method further comprises: sending a fifth message to the source blockchain; the fifth message comprises the transaction state of the target transaction. The blockchain transaction device comprises a transceiver module and a processing module.

3. The method of claim 2, wherein, The transceiver module is configured to obtain a first message of a source blockchain and a first cross-chain contract of a target blockchain; the first message is used for requesting a target transaction with the target blockchain, the first message comprises a first parameter in a second cross-chain contract of the source blockchain, the first parameter is used for indicating a transaction action of the target transaction, a format of the first cross-chain contract is different from a format of the second cross-chain contract, and a format of the first parameter is same as the format of the second cross-chain contract. The processing module is configured to determine a third cross-chain contract of the target blockchain according to the first parameter and the first cross-chain contract; the third cross-chain contract comprises a second parameter, a format of the third cross-chain contract and a format of the second parameter are same as the format of the first cross-chain contract, a parameter value of the second parameter is same as a parameter value of the first parameter, and a type of the second parameter is same as a type of the first parameter.

4. A blockchain transaction apparatus, characterized by, The transceiver module is further configured to send a second message to the target blockchain; the second message is used for instructing the target blockchain to perform the target transaction with the source blockchain based on the third cross-chain contract, and the second message comprises the third cross-chain contract. The processing module is specifically configured to: ​ ​ ​ convert the first parameter into the second parameter; write the second parameter into the first cross-chain contract, and determine a third cross-chain contract of the target blockchain.

5. The blockchain transaction apparatus according to claim 4, wherein, The transceiver module is further configured to: send a third message to the target blockchain, the third message being used to obtain a transaction state of the target transaction; obtain a fourth message of the target blockchain, the fourth message including the transaction state of the target transaction.

6. The blockchain transaction apparatus according to claim 5, wherein, The transceiver module is further configured to: send a fifth message to the source blockchain, the fifth message including the transaction state of the target transaction.

7. A blockchain transaction apparatus, characterized by, The blockchain transaction device includes a processor coupled with a memory, the memory being used to store programs or instructions, when the programs or instructions are executed by the processor, the blockchain transaction device performs the method according to any one of claims 1 to 3.

8. A computer readable storage medium having stored thereon a computer program or instructions, characterized in that, The computer programs or instructions, when executed, cause a computer to perform the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Cross-chain interaction method and system based on block chain all-in-one machine

    CN112417049A