Blockchain-based data processing method, apparatus, device, medium, and product
Patent Information
- Application Number
- CN202411883757.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2044-12-19
AI Technical Summary
但是这种实施方式与区块链最基本的去信任中介特性相违背,而且,需要用户信任中心化的第三方
[0025]本申请提供的基于区块链的数据处理方法、装置、设备、介质及产品,能够在接收到第一预言机发送的区块标识信息之后,根据区块标识信息从第二预言机中获取交易证明信息;然后,根据交易证明信息,确定第一交易证明,并获取第一预言机所发送的第二交易证明。此时,可以通过确认相互独立的两个预言机,分别确定出的第一交易证明和第二交易证明是否匹配,来确定数据传输是否准确。若确定出第一交易证明和第二交易证明匹配,则表示第二预言机中的数据准确,此时,就可以使第一区块链中的第一区块接收第二预言机所发送的交易数据。这种实施方式,能够通过两个预言机,一个用于验证,一个用于传输,从而实现高效、准确、安全、去信任、去中心化的跨链数据传输,从而能够有效保证交易的准确、稳定的进行,从而保证了用户的财产安全。
Smart Images

Figure CN119766413B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular to a data processing method, apparatus, device, medium and product based on blockchain. Background Technology
[0002] With the development of blockchain technology, different blockchain platforms have emerged to support different blockchains. This necessitates data interaction between these different blockchains.
[0003] Generally, secure and accurate data exchange between different blockchains can be achieved through a centralized third party. However, this approach contradicts the fundamental trustless intermediary characteristic of blockchain and requires users to trust the centralized third party.
[0004] Therefore, how to achieve decentralized, trustless, secure, and accurate data interaction between different blockchains has become an urgent technical problem to be solved. Summary of the Invention
[0005] This application provides a blockchain-based data processing method, apparatus, device, medium, and product to achieve decentralized, trustless, secure, and efficient cross-chain data interaction.
[0006] In a first aspect, this application provides a blockchain-based data processing method applied to a computer device, wherein the computer device deploys a first block of a first blockchain; the method includes:
[0007] After receiving the block identifier information sent by the first oracle, transaction proof information is obtained from the second oracle based on the block identifier information; wherein, the block identifier information indicates the second block in the second blockchain that sent data to the first block;
[0008] Based on the transaction proof information, determine the first transaction proof and obtain the second transaction proof sent by the first oracle;
[0009] If the first transaction proof and the second transaction proof are determined to match, then the transaction data sent by the second oracle is received; wherein the transaction data indicates the data sent by the second block to the second oracle.
[0010] Secondly, this application provides another blockchain-based data processing method applied to a computer device, wherein the computer device deploys a second block of a second blockchain; the method includes:
[0011] In response to a transaction processing request initiated by the client corresponding to the second block, determine the data to be verified and the block-related data corresponding to the transaction processing request;
[0012] The block-related data is sent to the first oracle, and the data to be verified is sent to the second oracle; wherein the second oracle is used to send the data to be verified to the first block of the first blockchain.
[0013] Thirdly, this application provides a blockchain-based data processing device applied to a computer device, wherein a first block of a first blockchain is deployed in the computer device; the device includes:
[0014] The acquisition unit is configured to, after receiving the block identifier information sent by the first oracle, acquire transaction proof information from the second oracle based on the block identifier information; wherein the block identifier information indicates the second block in the second blockchain that sent data to the first block;
[0015] The determining unit is configured to determine the first transaction proof based on the transaction proof information, and obtain the second transaction proof sent by the first oracle;
[0016] A receiving unit is configured to receive transaction data sent by a second oracle if it is determined that the first transaction proof and the second transaction proof match; wherein the transaction data indicates the data sent by the second block to the second oracle.
[0017] Fourthly, this application provides another blockchain-based data processing apparatus, applied to a computer device, wherein a second block of a second blockchain is deployed in the computer device; the apparatus includes:
[0018] The response unit is used to respond to a transaction processing request initiated by the client corresponding to the second block and to determine the data to be verified and the block-related data corresponding to the transaction processing request.
[0019] A sending unit is used to send the block-related data to a first oracle and send the data to be verified to a second oracle; wherein the second oracle is used to send the data to be verified to a first block of the first blockchain.
[0020] Fifthly, this application provides a computer device, including: a processor, and a memory communicatively connected to the processor;
[0021] The memory stores computer-executed instructions;
[0022] The processor executes computer execution instructions stored in the memory to implement the method described in the first aspect, or to implement the method described in the second aspect.
[0023] In a sixth aspect, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described in the first aspect, or to implement the method described in the second aspect.
[0024] In a seventh aspect, this application provides a computer program product, characterized in that it includes a computer program that, when executed by a processor, implements the method described in the first aspect, or implements the method described in the second aspect.
[0025] The blockchain-based data processing method, apparatus, device, medium, and product provided in this application can, after receiving block identifier information sent by a first oracle, obtain transaction proof information from a second oracle based on the block identifier information; then, based on the transaction proof information, determine the first transaction proof and obtain the second transaction proof sent by the first oracle. At this point, the accuracy of data transmission can be determined by confirming whether the first and second transaction proofs determined by the two independent oracles match. If the first and second transaction proofs match, it indicates that the data in the second oracle is accurate, and the first block in the first blockchain can then receive the transaction data sent by the second oracle. This implementation method, using two oracles—one for verification and one for transmission—achieves efficient, accurate, secure, trustless, and decentralized cross-chain data transmission, effectively ensuring the accuracy and stability of transactions and thus guaranteeing the security of users' assets. Attached Figure Description
[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0027] Figure 1 This application provides a blockchain-based data processing method.
[0028] Figure 2 Another blockchain-based data processing method provided in this application embodiment;
[0029] Figure 3 A schematic diagram of the architecture of a blockchain-based data processing system provided in this application embodiment;
[0030] Figure 4 A schematic diagram of the structure of a blockchain-based data processing device provided in this application embodiment;
[0031] Figure 5 A schematic diagram of another blockchain-based data processing device provided in this application embodiment;
[0032] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application.
[0033] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0034] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0035] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation portals for users to choose to authorize or refuse.
[0036] It should be noted that the blockchain-based data processing methods, devices, equipment, media, and products provided in this application can be used in the field of blockchain technology, or in any field other than blockchain technology. This application does not limit the application fields of the blockchain-based data processing methods, devices, equipment, media, and products.
[0037] First, the technical terms used in this application will be explained:
[0038] Cross-chain bridge: a cross-chain messaging protocol that enables the transfer of tokens between different blockchains;
[0039] Merkel's proof: Provides a method to prove that a transaction exists in a particular block of a blockchain using all the block header information in the blockchain;
[0040] NFT: short for Non-Fungible Token, refers to a non-fungible token, which is a trusted digital equity certificate with unique characteristics in the blockchain network. It is a data object that can be recorded and processed on the blockchain with multi-dimensional and complex attributes. For example, digital collectibles can be understood as a kind of NFT.
[0041] JSON format: a lightweight data exchange format;
[0042] XML format: Extensible Markup Language, is a simple data storage language.
[0043] With the continuous development of multiple blockchain technologies, how to enable data interaction between different blockchains has become an urgent technical problem to be solved.
[0044] In related technologies, secure and accurate data exchange between different blockchains can be achieved through a centralized third party. However, this approach not only contradicts the fundamental trustless intermediary characteristic of blockchain but also requires users to trust the centralized third party. Furthermore, the lack of transparency of centralized third parties poses certain security risks.
[0045] The inventors also discovered that data interaction between different blockchains can be achieved through decentralized cross-chain bridges. However, this implementation requires users to trust the blockchain network. Furthermore, since cross-chain bridges achieve data interaction by linking different blockchain networks, data transmission errors may occur when the blockchain network is attacked, thus posing certain security risks.
[0046] Therefore, how to achieve decentralized, trustless, secure, and accurate data interaction between different blockchains has become an urgent technical problem to be solved.
[0047] The blockchain-based data processing method provided in this application aims to utilize two oracles, one for verifying data and the other for transmitting data, thereby achieving secure and efficient cross-chain data transmission and solving the aforementioned technical problems of existing technologies.
[0048] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0049] Figure 1 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application. The method is applied to a computer device, which has a first block of a first blockchain deployed in it.
[0050] Optionally, the first block in the first blockchain can be understood as the block that receives cross-chain messages. In this case, the first block in the first blockchain can receive cross-chain messages sent by the second block in the second blockchain. In this embodiment, a transaction processing request can be initiated by the client corresponding to the second block in the second blockchain, and the transaction data corresponding to the transaction processing request can be sent to the first block in the first blockchain corresponding to the transaction processing request through the second block, using the blockchain-based data processing method provided in this embodiment.
[0051] In one example, the initiated transaction processing request may include, but is not limited to: transfer transaction request, status update request, NFT transfer request, etc. The type of transaction processing request is not limited here, as long as it can be implemented.
[0052] Based on this, such as Figure 1 As shown, the method includes the following steps:
[0053] S101. After receiving the block identifier information sent by the first oracle, obtain the transaction proof information from the second oracle based on the block identifier information.
[0054] The block identifier information indicates the second block in the second blockchain that sent data to the first block.
[0055] In one example, the first oracle and the second oracle communicate with the first block in the first blockchain and the second block in the second blockchain, respectively, thereby completing cross-chain data transmission. In this case, the first oracle can be understood as an oracle used to verify data, and the second oracle can be understood as an oracle used to transmit data.
[0056] Optionally, the block identifier information can uniquely indicate the second block. In this case, the block identifier information can be the block hash corresponding to the second block.
[0057] In one example, the first block can obtain transaction proof information from the second oracle based on the block identifier information sent by the first oracle.
[0058] In one example, transaction proof information may include, but is not limited to, transaction identifier information and transaction path information. The transaction identifier information uniquely identifies the transaction data corresponding to the transaction processing request, and the transaction path information includes all transaction data included in the second block. Optionally, the transaction identifier information can be understood as a transaction hash value, and the transaction path information can be understood as a Merkel path.
[0059] In one example, the first oracle and the second oracle can be deployed on the same off-chain node or on different off-chain nodes; this application does not impose any restrictions on this.
[0060] S102. Based on the transaction proof information, determine the first transaction proof and obtain the second transaction proof sent by the first oracle.
[0061] In one example, where the transaction proof information includes the transaction hash and the Merkel path, the first transaction proof can be understood as the Merkel root determined based on the transaction hash and the Merkel path.
[0062] In one example, the second transaction proof is of the same type as the first transaction proof; for instance, if the first transaction proof is Merklegen, the second transaction proof is also Merklegen.
[0063] In one example, the second transaction proof included in the first oracle can be understood as the Merkle root stored in the block header of the second block.
[0064] S103. If it is determined that the first transaction proof and the second transaction proof match, then receive the transaction data sent by the second oracle.
[0065] The transaction data indicates the data sent from the second block to the second oracle.
[0066] In one example, if the first transaction proof and the second transaction proof are the same, it means that the first transaction proof and the second transaction proof match.
[0067] As described above, in this embodiment of the application, the first block in the first blockchain can, after receiving the block identifier information sent by the first oracle, obtain transaction proof information from the second oracle based on the block identifier information; then, based on the transaction proof information, it determines the first transaction proof and obtains the second transaction proof sent by the first oracle. At this point, the accuracy of data transmission can be determined by confirming whether the first and second transaction proofs determined by the two independent oracles match. If the first and second transaction proofs match, it indicates that the data in the second oracle is accurate, and the first block in the first blockchain can then receive the transaction data sent by the second oracle. This implementation method, using two oracles—one for verification and one for transmission—achieves efficient, accurate, secure, trustless, and decentralized cross-chain data transmission, effectively ensuring the accuracy and stability of transactions and thus guaranteeing the security of users' assets.
[0068] Optionally, the transaction proof information includes transaction identifier information and transaction path information. In this case, when determining the first transaction proof based on the transaction proof information, the location of the transaction identifier information in the transaction path information can be determined first; then, starting from the location, a hash operation is performed on each piece of data in the transaction path information according to the transaction path indicated by the transaction path information to obtain the first transaction proof.
[0069] In one example, transaction path information can indicate a Merkel path. In this case, the transaction path information can be represented by a Merkel tree. The transaction path information can include multiple nodes, each node indicating the data of a transaction. The data corresponding to each node is also the transaction hash value corresponding to each transaction data.
[0070] At this point, after performing hash operations on each piece of data included in the transaction path information according to the transaction path information, the Merkle root, also known as the first transaction proof, is obtained.
[0071] In the above implementation, the starting position for hashing can be determined from the transaction path information based on the transaction identifier information obtained from the second oracle. This ensures the matching degree between the obtained first transaction proof and the transaction identifier information, thereby obtaining an accurate first transaction proof and ensuring the accuracy of data verification.
[0072] Optionally, regarding S103 above: if it is determined that the first transaction proof and the second transaction proof match, then the transaction data sent by the second oracle is received, specifically including the following process:
[0073] If the first transaction proof and the second transaction proof are determined to match, the initial transaction data sent by the second oracle is received; wherein, the initial transaction data indicates the data after the contract identification information and transaction data are packaged; the contract identification information indicates the smart contract deployed in the first block stored in the second block; the transaction data indicates the transactions that occurred in the second block; then, the initial transaction data is unpacked to obtain the transaction data, and the transaction data is received.
[0074] In one example, contract identification information may include, but is not limited to, contract name, contract version, contract function, etc. The specific content of the contract identification information is not limited here, as long as it describes the first block in the first blockchain. Transaction data may indicate, but is not limited to, the following types: asset transfer data, data call messages, state synchronization data, etc. The type of transaction data is not limited here, as long as it meets the actual needs.
[0075] In this implementation, the accuracy and security of the transmitted transaction data can be further guaranteed by receiving the initial transaction data after it has been packaged, and accurate and secure transaction data can be obtained after unpacking the initial transaction data.
[0076] Optionally, if it is determined that the first transaction proof and the second transaction proof do not match, a data transmission failure message is generated and sent to the second oracle. At this time, the second oracle can send the data transmission failure message to the second block in the second blockchain, so that the client corresponding to the second block of the second blockchain can resend the transaction data.
[0077] Optionally, in this embodiment of the application, after unpacking the initial transaction data and obtaining the transaction data, before receiving the transaction data, the smart contract indicated by the contract identifier information can be matched with the smart contracts deployed in the first block. If it is determined that the smart contract indicated by the contract identifier is successfully matched with the smart contracts deployed in the first block, the transaction data can be received.
[0078] For example, if the contract identification information includes the contract name, contract version, and contract function, then the contract name, contract version, and contract function of the smart contract deployed in the first block can be matched with the contract identification information. If they are the same, it means that the smart contract indicated by the contract identification is successfully matched with the smart contract deployed in the first block. At this time, the transaction data obtained after unpacking can be received.
[0079] In the above implementation, the consistency of transaction data transmission can be determined by the contract identifier. At the same time, it can also prevent erroneous calls or malicious attacks, thereby helping to further ensure the security and effectiveness of cross-chain transmission of transaction data and help ensure the accuracy of transactions.
[0080] Optionally, if it is determined that the smart contract indicated by the contract identifier does not match the smart contract deployed in the first block, then contract failure information is generated and sent to the second oracle; the second oracle is used to send the contract failure information to the second block.
[0081] In one example, contract failure information may include at least one of the following: failure message, specific failure details, matching time information, smart contract name, smart contract address, etc.
[0082] At this point, after sending the contract failure information to the second oracle, the contract failure information can be sent to the second block through the second oracle, so that the second block can re-acquire the contract identifier of the smart contract deployed in the first block, thereby enabling timely updates / synchronization of smart contract information to ensure smooth and effective cross-chain data interaction.
[0083] Optionally, after the first block in the first blockchain receives the transaction data according to the steps described above, it can generate transaction display information based on the transaction data and display the transaction display information in the client corresponding to the first block.
[0084] In one example, transaction display information can be understood as data obtained after formatting the transaction data, such as converting the transaction data into JSON or XML format. In this case, the corresponding visualization component can be selected in the client corresponding to the first block to display the transaction display information.
[0085] In one example, the corresponding visualization component can be selected based on the data type of the transaction data, and the transaction data can be displayed in the visualization component, thereby displaying the transaction information in the client corresponding to the first block.
[0086] This implementation method can convert the received transaction data into visual data displayed on the client's interface, allowing users to view the transaction data intuitively and clearly.
[0087] Figure 2 Another blockchain-based data processing method provided in this application embodiment is applied to a computer device, in which a second block of a second blockchain is deployed. Optionally, the second block of the second blockchain can be understood as a block for sending cross-chain messages. In this case, the second block of the second blockchain can send cross-chain messages to the first block of the aforementioned first blockchain.
[0088] In one example, the computer device that deploys the second block in the second blockchain and the computer device that deploys the first block in the first blockchain can be the same device or different devices; this is not limited here.
[0089] like Figure 2 As shown, the method includes the following steps:
[0090] S201. In response to the transaction processing request initiated by the client corresponding to the second block, determine the data to be verified and the block-related data corresponding to the transaction processing request.
[0091] In one example, the transaction processing request can be one of the above: transfer transaction request, status update request, NFT transfer request, etc. The type of transaction processing request is not limited here, as long as it can be implemented.
[0092] In one example, the data to be verified can be determined based on the transaction-related data requested to be processed in the transaction processing request. In this case, the data to be verified may include, but is not limited to, transaction data, transaction identification information, contract identification information, etc.
[0093] In one example, block-related data can be determined based on the block-related information corresponding to the second block and the first block, respectively. In this case, the block-related data may include, but is not limited to: the block identifier information of the second block and the smart contract address corresponding to the smart contract deployed in the first block (that is, the data transmission address mentioned below).
[0094] S202. Send the block-related data to the first oracle and send the data to be verified to the second oracle.
[0095] The second oracle is used to send the data to be verified to the first block of the first blockchain.
[0096] At this time, the block-related data sent to the first oracle is used to obtain the accurate second transaction proof stored in the second block, and to accurately transmit the second transaction proof to the first block; the data to be verified sent to the second oracle is used to obtain the transaction proof information stored in the second block, and to send the transaction proof information to the first block, so that the first block can calculate the first transaction proof based on the transaction proof information, thereby verifying the first transaction proof and the second transaction proof to determine whether there is an error in the data transmitted by the second oracle.
[0097] As described above, the second block in the second blockchain of this application embodiment can respond to a transaction processing request initiated by the client corresponding to the second block, determine the data to be verified and the block-related data corresponding to the transaction processing request, thereby identifying data for two purposes and enabling separate data verification and data transmission, which helps to effectively realize data verification and data transmission. At this time, by sending the block-related data to the first oracle and the data to be verified to the second oracle, the first block can simultaneously obtain and calculate the transaction proof. Based on the obtained and calculated transaction proof, it is possible to easily and quickly determine whether there is an error in the data transmission, thus achieving trustless, decentralized, secure, and efficient cross-chain data transmission.
[0098] Optionally, if the transaction processing request includes transaction identifier information and transaction data, then in response to the transaction processing request initiated by the client corresponding to the second block, the data to be verified corresponding to the transaction processing request is determined, specifically including the following process:
[0099] First, in response to a transaction processing request initiated by the client corresponding to the second block, the system retrieves pre-stored contract identifier information corresponding to the first block. This contract identifier information indicates the smart contract deployed within the first block.
[0100] Then, the contract identification information and transaction data are packaged and processed to obtain the initial transaction data.
[0101] This implementation method can package the contract identification information and transaction data that need to be transmitted to the first block, which helps to further ensure the security of cross-chain data.
[0102] Finally, the data to be verified is determined based on the initial transaction data and transaction identification information.
[0103] In one example, the initial transaction data and transaction identifier information can be processed according to the data communication protocol on which cross-chain data interaction depends to determine the data to be verified, so as to ensure that the data to be verified can be accurately transmitted to the second oracle.
[0104] Optionally, the transaction processing request may also include a data transfer address. In this case, in response to the transaction processing request initiated by the client corresponding to the second block, the block identifier information of the second block can be determined; then, based on the block identifier information and the data transfer address, the block-related data can be determined.
[0105] The data transmission address is used to indicate the smart contract address corresponding to the first block.
[0106] This implementation method allows for the addition of data transmission addresses to block-related data, thereby ensuring the accuracy of data transmitted by the first oracle. Simultaneously, it expands the use cases for verifying multiple cross-chain messages via data transmission addresses, thus broadening the application scenarios of the first oracle, improving its utilization and processing performance, and saving costs.
[0107] Optionally, the block-related data may include block identifier information. In this case, after sending the block-related data to the first oracle, the first oracle can accurately obtain the block header information of the block corresponding to the block identifier information from the second block based on the block identifier information. Then, after receiving the block identifier information sent by the first oracle, the second block sends the block header information of the block corresponding to the block identifier information back to the first oracle.
[0108] The block header information includes a second transaction proof.
[0109] Then, the first oracle can send the received block header information and block identifier information to the first block according to the data transmission address for data verification.
[0110] Optionally, the data to be verified may include transaction identifier information. In this case, after sending the data to be verified to the second oracle, the second oracle can obtain the transaction path information corresponding to the transaction identifier information from the second block based on the transaction identifier information. Then, after receiving the transaction identifier information sent by the second oracle, the second block determines the block identifier information corresponding to the transaction identifier information; and then sends the transaction path information corresponding to the block indicated by the block identifier information to the second oracle.
[0111] After receiving the block identifier information sent by the first block, the second oracle can determine the transaction path information and transaction identifier information under the block corresponding to the block identifier information as transaction proof information and send it to the first block so that the first block can generate the first transaction proof based on the transaction proof information for data verification.
[0112] In one possible implementation, assuming that the first oracle and the second oracle in this application embodiment are considered as a set of target oracles, this application embodiment can further deploy multiple sets of target oracles in off-chain nodes and verify cross-chain transaction data based on multiple sets of target oracles. In this case, after all multiple sets of target oracles have passed verification (or after the number of verified target oracles meets the requirement), the first block in the first blockchain can receive the cross-chain transmitted transaction data to further ensure the accuracy of cross-chain data transmission, thereby further ensuring the security of the transaction data.
[0113] Figure 3 This application provides an embodiment of a blockchain-based data processing system architecture diagram, such as... Figure 3 As shown, the blockchain-based data processing system includes at least: a first blockchain, a second blockchain, a first oracle, and a second oracle; cross-chain smart contracts are deployed in both the first and second blockchains, and the first and second oracles are deployed on off-chain nodes.
[0114] The second block in the second blockchain is used to respond to the transaction processing request initiated by the client corresponding to the second block, determine the data to be verified and the block-related data corresponding to the transaction processing request, and send the data to be verified to the second oracle and the block-related data to the first oracle.
[0115] The first block in the first blockchain is used to receive the block identifier information sent by the first oracle, and then obtain transaction proof information from the second oracle based on the block identifier information; then, based on the transaction proof information, determine the first transaction proof and obtain the second transaction proof sent by the first oracle; if the first transaction proof and the second transaction proof are determined to match, then receive the transaction data sent by the second oracle.
[0116] Optionally, such as Figure 3 As shown, the second blockchain may include a data construction module, a first data transmission module, and a first data verification module, while the first blockchain may include a second data construction module, a second data transmission module, and a second data verification module.
[0117] The first data construction module is used to respond to the transaction processing request initiated by the client corresponding to the second block, obtain the pre-stored contract identification information corresponding to the first block, and then package the contract identification information and the transaction data included in the transaction processing request to obtain the initial transaction data.
[0118] The first data verification module is used to identify the initial transaction data and the transaction identification information included in the transaction processing request as the data to be verified and send them to the second oracle; and to send the block identification information corresponding to the second block and the smart contract address (i.e., the data transmission address) of the smart contract deployed in the first block to the data transmission module.
[0119] The first data transmission module is used to identify the smart contract address and block identifier information as block-related data and send them to the first oracle.
[0120] At this point, the second oracle is used to obtain and store the transaction path information from the second block based on the transaction identifier information after receiving the data to be verified.
[0121] At this point, the first oracle, after receiving the block-related data, retrieves and stores the block header information from the second block based on the block identifier information; then, it sends the block identifier information and the block header information to the second data transmission module of the first blockchain.
[0122] The second data transmission module is used to send the block identifier information and the second transaction proof to the second data verification module.
[0123] The second data verification module is used to obtain transaction proof information from the second oracle based on the block identifier information, and calculate the first transaction proof based on the transaction proof information; then, it matches the first transaction proof with the second transaction proof. If they match, it receives the initial transaction data stored in the second oracle and sends the initial transaction data to the second data construction module.
[0124] The second data construction module is used to unpack the initial transaction data, obtain the final transaction data, and then receive it. At this point, the transaction display information determined by the transaction data can also be sent to the client corresponding to the second block.
[0125] The above implementation achieves decentralized, trustless, secure, and efficient cross-chain data interaction processing, ensuring the performance of the blockchain-based data processing system.
[0126] Figure 4 This is a schematic diagram of a blockchain-based data processing device provided in an embodiment of this application. The device is applied to a computer device, and the computer device has a first block of a first blockchain deployed in it.
[0127] like Figure 4 As shown, the blockchain-based data processing device 400 includes:
[0128] The acquisition unit 401 is used to obtain transaction proof information from the second oracle based on the block identifier information after receiving the block identifier information sent by the first oracle; wherein the block identifier information indicates the second block in the second blockchain that sent data to the first block.
[0129] The determining unit 402 is used to determine the first transaction proof based on the transaction proof information and to obtain the second transaction proof sent by the first oracle.
[0130] The receiving unit 403 is configured to receive transaction data sent by the second oracle if it is determined that the first transaction proof and the second transaction proof match; wherein the transaction data indicates the data sent by the second block to the second oracle.
[0131] Optionally, determining unit 402 is used for:
[0132] Determine the location of the transaction identifier information within the transaction path information;
[0133] Starting from the current location, following the transaction path indicated by the transaction path information, perform hash operations on each piece of data included in the transaction path information to obtain the first transaction proof.
[0134] Optionally, the receiving unit 403 is used for:
[0135] If the first transaction proof and the second transaction proof are determined to match, the initial transaction data sent by the second oracle is received; wherein, the initial transaction data indicates the data after the contract identification information and transaction data have been packaged; the contract identification information indicates the smart contract deployed in the first block stored in the second block; and the transaction data indicates the transactions that occurred in the second block.
[0136] The initial transaction data is unpacked to obtain the actual transaction data, which is then received.
[0137] Optionally, the receiving unit 403 is also used for:
[0138] Before receiving transaction data, the smart contract indicated by the contract identifier information is matched with the smart contracts deployed in the first block. If it is determined that the smart contract indicated by the contract identifier is successfully matched with the smart contracts deployed in the first block, the transaction data is received.
[0139] Optionally, the device is also used for:
[0140] If it is determined that the smart contract indicated by the contract identifier does not match the smart contract deployed in the first block, a contract failure message is generated and sent to the second oracle; the second oracle is used to send the contract failure message to the second block.
[0141] Optionally, the device is also used for:
[0142] Based on the transaction data, generate transaction display information and display the transaction display information in the client corresponding to the first block.
[0143] Figure 5 This is a schematic diagram of another blockchain-based data processing device provided in an embodiment of this application. The device is applied to a computer device, in which a second block of a second blockchain is deployed.
[0144] like Figure 5 As shown, the blockchain-based data processing device 500 includes:
[0145] The response unit 501 is used to respond to a transaction processing request initiated by the client corresponding to the second block and to determine the data to be verified and the block-related data corresponding to the transaction processing request.
[0146] The sending unit 502 is used to send block-related data to the first oracle and send data to be verified to the second oracle; wherein, the second oracle is used to send the data to be verified to the first block of the first blockchain.
[0147] Optionally, the transaction processing request includes: transaction identification information and transaction data; in this case, the response unit 501 is used to:
[0148] In response to a transaction processing request initiated by the client corresponding to the second block, the system obtains the pre-stored contract identification information corresponding to the first block; wherein, the contract identification information is used to indicate the smart contract deployed in the first block;
[0149] After packaging the contract identification information and transaction data, the initial transaction data is obtained;
[0150] The data to be verified is determined based on the initial transaction data and transaction identification information.
[0151] Optionally, the transaction processing request includes: a data transfer address; in this case, the response unit 501 is used to:
[0152] In response to a transaction processing request initiated by the client corresponding to the second block, determine the block identifier information of the second block;
[0153] Based on the block identifier information and the data transmission address, the block-related data is determined; whereby the data transmission address is used to indicate the smart contract address corresponding to the first block.
[0154] Optionally, the block-related data includes block identifier information; in this case, the device is also used for:
[0155] After sending the block-related data to the first oracle, and receiving the block identifier information sent by the first oracle, the block header information of the block corresponding to the block identifier information is sent to the first oracle; wherein, the block header information includes the second transaction proof.
[0156] Optionally, the data to be verified includes transaction identification information; in this case, the device is also used for:
[0157] After sending the data to be verified to the second oracle, and receiving the transaction identifier information sent by the second oracle, the block identifier information corresponding to the transaction identifier information is determined;
[0158] Send the transaction proof information corresponding to the block indicated by the block identifier information to the second oracle.
[0159] Figure 6 This application provides a schematic diagram of the structure of a computer device, as shown in the embodiment of the present application. Figure 6 As shown, the computer device 600 includes: a processor 601, and a memory 602 communicatively connected to the processor;
[0160] Memory 602 stores computer-executed instructions;
[0161] The processor 601 executes computer execution instructions stored in the memory 602 to implement any of the methods described above.
[0162] Optionally, the computer device 600 may also include a receiver 603 and a transmitter 604.
[0163] Receiver 603 is used to receive instructions and data sent by external devices, and transmitter 604 is used to send instructions and data to external devices.
[0164] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement any of the methods described above.
[0165] This application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the methods described above.
[0166] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0167] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0168] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0169] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0170] When integrated units / modules are implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, the storage unit can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc.
[0171] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0172] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0173] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0174] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A data processing method based on blockchain, characterized in that, Applied to a computer device, wherein a first block of a first blockchain is deployed in the computer device; the method includes: After receiving the block identifier information sent by the first oracle, transaction proof information is obtained from the second oracle based on the block identifier information; wherein, the block identifier information indicates the second block in the second blockchain that sent data to the first block; the transaction proof information includes transaction identifier information and transaction path information, the transaction identifier information uniquely identifies the transaction data corresponding to the transaction processing request, and the transaction path information includes all transaction data in the second block; Based on the transaction proof information, determine the first transaction proof and obtain the second transaction proof sent by the first oracle; If the first transaction proof and the second transaction proof are determined to match, then the transaction data sent by the second oracle is received; wherein the transaction data indicates the data sent by the second block to the second oracle.
2. The method according to claim 1, characterized in that, Based on the transaction proof information, the first transaction proof is determined, including: Determine the location of the transaction identifier information within the transaction path information; Starting from the location, following the transaction path indicated by the transaction path information, a hash operation is performed on each piece of data included in the transaction path information to obtain the first transaction proof.
3. The method according to claim 1, characterized in that, If the first transaction proof and the second transaction proof are determined to match, then the transaction data sent by the second oracle is received, including: If the first transaction proof and the second transaction proof are determined to match, then the initial transaction data sent by the second oracle is received; wherein, the initial transaction data indicates the data after packaging the contract identification information and transaction data; the contract identification information indicates the smart contract deployed in the first block stored in the second block; the transaction data indicates the transactions that occurred in the second block; The initial transaction data is unpacked to obtain the transaction data, and then the transaction data is received.
4. The method according to claim 3, characterized in that, Before receiving the transaction data, the method further includes: The smart contract indicated by the contract identifier is matched with the smart contracts deployed in the first block, and the transaction data is received if it is determined that the smart contract indicated by the contract identifier is successfully matched with the smart contracts deployed in the first block.
5. The method according to claim 4, characterized in that, The method further includes: If it is determined that the smart contract indicated by the contract identifier does not match the smart contract deployed in the first block, then contract failure information is generated and sent to the second oracle; the second oracle is used to send the contract failure information to the second block.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Based on the transaction data, transaction display information is generated and displayed in the client corresponding to the first block.
7. A data processing method based on blockchain, characterized in that, Applied to a computer device, wherein a second block of a second blockchain is deployed in the computer device; the method includes: In response to a transaction processing request initiated by the client corresponding to the second block, the data to be verified and the block-related data corresponding to the transaction processing request are determined; the transaction processing request includes: transaction identification information and transaction data; the transaction identification information uniquely identifies the transaction data corresponding to the transaction processing request, and the data to be verified includes the transaction identification information and transaction path information, and the transaction path information includes all transaction data in the second block; The block-related data is sent to a first oracle, and the data to be verified is sent to a second oracle. The first oracle is used to obtain the second transaction proof stored in the second block based on the block-related data, and the second oracle is used to send the data to be verified to the first block of the first blockchain, so that the first block determines the first transaction proof based on the transaction path information and the transaction identifier information, and matches and verifies it with the second transaction proof sent by the first oracle.
8. The method according to claim 7, characterized in that, In response to a transaction processing request initiated by the client corresponding to the second block, determine the data to be verified corresponding to the transaction processing request, including: In response to a transaction processing request initiated by the client corresponding to the second block, the pre-stored contract identification information corresponding to the first block is obtained; wherein, the contract identification information is used to indicate the smart contract deployed in the first block; After packaging the contract identification information and the transaction data, initial transaction data is obtained; The data to be verified is determined based on the initial transaction data and the transaction identification information.
9. The method according to claim 7, characterized in that, The transaction processing request includes: a data transmission address; in response to a transaction processing request initiated by the client corresponding to the second block, determining the block-related data corresponding to the transaction processing request, including: In response to a transaction processing request initiated by the client corresponding to the second block, the block identifier information of the second block is determined; Based on the block identifier information and the data transmission address, the block-related data is determined; wherein, the data transmission address is used to indicate the smart contract address corresponding to the first block.
10. The method according to any one of claims 7-9, characterized in that, The block-related data includes block identifier information; after sending the block-related data to the first oracle, the method further includes: After receiving the block identifier information sent by the first oracle, the block header information of the block corresponding to the block identifier information is sent to the first oracle; wherein, the block header information includes the second transaction proof.
11. The method according to any one of claims 7-9, characterized in that, The data to be verified includes transaction identifier information; after sending the data to be verified to the second oracle, the method further includes: After receiving the transaction identifier information sent by the second oracle, determine the block identifier information corresponding to the transaction identifier information; The transaction proof information corresponding to the block indicated by the block identifier information is sent to the second oracle.
12. A data processing device based on blockchain, characterized in that, Applied to a computer device, wherein a first block of a first blockchain is deployed in the computer device; the device includes: The acquisition unit is configured to, after receiving block identifier information sent by the first oracle, acquire transaction proof information from the second oracle based on the block identifier information; wherein, the block identifier information indicates the second block in the second blockchain that sent data to the first block; the transaction proof information includes transaction identifier information and transaction path information, the transaction identifier information uniquely identifies the transaction data corresponding to the transaction processing request, and the transaction path information includes all transaction data in the second block; The determining unit is configured to determine the first transaction proof based on the transaction proof information, and obtain the second transaction proof sent by the first oracle; A receiving unit is configured to receive transaction data sent by a second oracle if it is determined that the first transaction proof and the second transaction proof match; wherein the transaction data indicates the data sent by the second block to the second oracle.
13. A data processing device based on blockchain, characterized in that, Applied to a computer device, wherein a second block of a second blockchain is deployed in the computer device; the device includes: A response unit is used to respond to a transaction processing request initiated by a client corresponding to the second block, and to determine the data to be verified and the block-related data corresponding to the transaction processing request; the transaction processing request includes: transaction identification information and transaction data; the transaction identification information uniquely identifies the transaction data corresponding to the transaction processing request, and the data to be verified includes the transaction identification information and transaction path information, the transaction path information including all transaction data in the second block; A sending unit is configured to send the block-related data to a first oracle and send the data to be verified to a second oracle; wherein, the first oracle is configured to obtain the second transaction proof stored in the second block based on the block-related data, and the second oracle is configured to send the data to be verified to a first block of the first blockchain, so that the first block determines the first transaction proof based on the transaction path information and the transaction identifier information, and matches and verifies it with the second transaction proof sent by the first oracle.
14. A computer device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-6, or to implement the method as described in any one of claims 7-11.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6, or to implement the method as described in any one of claims 7-11.
16. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method of any one of claims 1-6, or implements the method of any one of claims 7-11.
Citation Information
Patent Citations
Block chain data processing method and device, equipment and storage medium
CN116980169A
Transaction data processing method and device based on block chain, server and medium
CN118096157A