A Method, Apparatus, Device, and System for Obtaining Off-chain Data

By using a blockchain node and chain-down device to determine off-chain data participants based on transaction information, the method addresses the inflexibility of hardcoded identities in smart contracts, enhancing data access efficiency and management.

CN114297177BActive Publication Date: 2025-07-15ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111587824.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2025-07-15
Estimated Expiration
2041-12-23

AI Technical Summary

Technical Problem

In the prior art, when a smart contract obtains off-chain data, it is necessary to write the identification information of the designated participant in the program code, resulting in poor flexibility and convenience, especially when the participant changes, the code needs to be modified, which is complicated.

Method used

Through the oracle and off-chain equipment in the blockchain network working together, the designated participants are dynamically determined to avoid writing identification information in the smart contract. The off-chain equipment can process transaction information based on transaction information and presets to determine the participants and send data acquisition requests.

Benefits of technology

It improves the flexibility and convenience of smart contracts to obtain off-chain data, reduces the frequency of modifying smart contract codes, and improves management convenience and data acquisition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114297177B_ABST
    Figure CN114297177B_ABST
Patent Text Reader

Abstract

An off-chain data acquisition method, device, equipment and system are disclosed in the embodiments of this specification. The solution may include: after the off-chain device obtains a data acquisition request sent by an oracle in the blockchain network, if the data acquisition request is used to request the acquisition of target off-chain data required for a target smart contract to process a target blockchain transaction, the off-chain device may be made to determine a designated participant for processing the data acquisition request according to the transaction information of the target blockchain transaction and the preset processable transaction information of candidate participants, and send the data acquisition request to the device of the designated participant, so that the device of the designated participant can, in response to the data acquisition request, send the target off-chain data to the blockchain network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular, to a method, apparatus, device, and system for obtaining off-chain data. Background Art

[0002] Blockchain is a distributed shared ledger and database, which has the characteristics of decentralization, immutability, full traceability, traceability, collective maintenance, openness, and transparency. These characteristics make blockchain technology have a broader application prospect. Currently, people can deploy smart contracts in the blockchain to process blockchain transactions based on the smart contracts. Since when a smart contract needs to process a blockchain transaction based on off-chain data at a specified participant, the identification information of the specified participant needs to be written into the program code of the smart contract in hard-coded form, so that when the program code of the smart contract is run later, a data acquisition request for obtaining off-chain data from the specified participant can be sent to the oracle mechanism in the blockchain, and then the off-chain data at the specified participant can be obtained based on the oracle.

[0003] Based on this, how to improve the convenience of smart contracts when obtaining off-chain data has become a technical problem to be solved urgently. Summary of the Invention

[0004] A method, apparatus, device, and system for obtaining off-chain data provided by an embodiment of this specification can improve the convenience of smart contracts when obtaining off-chain data.

[0005] To solve the above technical problem, an embodiment of this specification is implemented as follows:

[0006] An off-chain data acquisition system provided by an embodiment of this specification includes:

[0007] A blockchain node, configured to obtain a data acquisition request based on an oracle in a blockchain network, and send the data acquisition request to an off-chain device based on the oracle, where the data acquisition request is used to request to obtain target off-chain data, and the target off-chain data is off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction;

[0008] The off-chain device is configured to obtain the data acquisition request sent by the oracle, determine a specified participant for processing the data acquisition request from candidate participants according to transaction information of the target blockchain transaction and preset processable transaction information of the candidate participants, and send the data acquisition request to a device of the specified participant;

[0009] The device of the specified participating party is configured to send the target off-chain data to the blockchain network in response to the data acquisition request.

[0010] A method for acquiring off-chain data provided by an embodiment of this specification includes:

[0011] An off-chain device acquires a data acquisition request sent by an oracle in a blockchain network; the data acquisition request is used to request the acquisition of target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction.

[0012] Based on the transaction information of the target blockchain transaction and the preset processable transaction information of candidate participating parties, a specified participating party for processing the data acquisition request is determined from the candidate participating parties.

[0013] Send the data acquisition request to the device of the specified participating party; the device of the specified participating party is configured to send the target off-chain data to the blockchain network in response to the data acquisition request.

[0014] Another method for acquiring off-chain data provided by an embodiment of this specification includes:

[0015] A blockchain node acquires a data acquisition request based on an oracle in a blockchain network, the data acquisition request is used to request the acquisition of target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction.

[0016] Based on the oracle, send the data acquisition request to an off-chain device; the off-chain device is configured to send the data acquisition request to the device of a specified participating party, and the specified participating party is a participating party determined by the off-chain device from the candidate participating parties for processing the data acquisition request according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participating parties.

[0017] An apparatus for acquiring off-chain data provided by an embodiment of this specification includes:

[0018] An acquisition module, configured to enable an off-chain device to acquire a data acquisition request sent by an oracle in a blockchain network; the data acquisition request is used to request the acquisition of target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction.

[0019] A determination module, configured to determine a specified participating party for processing the data acquisition request from the candidate participating parties according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participating parties.

[0020] A sending module, configured to send the data acquisition request to the device of the specified participant; the device of the specified participant is configured to send the target off-chain data to the blockchain network in response to the data acquisition request.

[0021] Another device for acquiring off-chain data provided by an embodiment of this specification includes:

[0022] An acquisition module, configured for a blockchain node to acquire a data acquisition request based on an oracle in a blockchain network, where the data acquisition request is used to request to acquire target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction;

[0023] A sending module, configured to send the data acquisition request to an off-chain device based on the oracle; the off-chain device is configured to send the data acquisition request to the device of a specified participant, and the specified participant is a participant determined from candidate participants by the off-chain device according to transaction information of the target blockchain transaction and preset transaction information that can be processed by the candidate participants for processing the data acquisition request.

[0024] An off-chain data acquisition device provided by an embodiment of this specification, where the device is an off-chain device and includes:

[0025] At least one processor; and,

[0026] A memory communicatively connected to the at least one processor; where,

[0027] The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to:

[0028] Acquire a data acquisition request sent by an oracle in a blockchain network; the data acquisition request is used to request to acquire target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction;

[0029] Determine a specified participant for processing the data acquisition request from the candidate participants according to transaction information of the target blockchain transaction and preset transaction information that can be processed by the candidate participants;

[0030] Send the data acquisition request to the device of the specified participant; the device of the specified participant is configured to send the target off-chain data to the blockchain network in response to the data acquisition request.

[0031] Another off-chain data acquisition device provided by the embodiments of this specification. A blockchain node is deployed at the device, including:

[0032] At least one processor; and,

[0033] A memory communicatively connected to the at least one processor; wherein,

[0034] The memory stores instructions executable by the at least one processor. When the instructions are executed by the at least one processor, the at least one processor is enabled to:

[0035] Obtain a data acquisition request based on an oracle in a blockchain network. The data acquisition request is used to request to obtain target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction;

[0036] Send the data acquisition request to an off-chain device based on the oracle; the off-chain device is used to send the data acquisition request to a device of a specified participant. The specified participant is a participant determined from candidate participants by the off-chain device according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants for processing the data acquisition request.

[0037] At least one embodiment provided in this specification can achieve the following beneficial effects:

[0038] After the off-chain device obtains the data acquisition request sent by the oracle in the blockchain network, if the data acquisition request is used to request to obtain the target off-chain data required for the target smart contract to process the target blockchain transaction, the specified participant for processing the data acquisition request can be determined according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants, and the data acquisition request is sent to the device of the specified participant, so that the device of the specified participant can, in response to the data acquisition request, send the target off-chain data to the blockchain network. In this solution, since the specified participant for providing the target off-chain data required for the target smart contract can be determined by the off-chain device, the identification information of the specified participant does not need to be written into the program code of the smart contract. Subsequently, when the specified participant for providing the target off-chain data changes, the program code of the smart contract does not need to be modified, which can not only improve the management convenience of the smart contract, but also improve the flexibility and convenience when the smart contract obtains off-chain data. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] To more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments recorded in this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0040] Figure 1 Schematic diagram of the application scenario of a system for obtaining off-chain data provided by an embodiment of this specification;

[0041] Figure 2 Schematic flow chart of a method for obtaining off-chain data provided by an embodiment of this specification;

[0042] Figure 3 Schematic flow chart of another method for obtaining off-chain data provided by an embodiment of this specification;

[0043] Figure 4 For the embodiment of this specification corresponding to Figure 2 and Figure 3 Swimlane flow chart of the method for obtaining off-chain data;

[0044] Figure 5 For the embodiment of this specification corresponding to Figure 2 Schematic structural diagram of a device for obtaining off-chain data;

[0045] Figure 6 For the embodiment of this specification corresponding to Figure 3 Schematic structural diagram of a device for obtaining off-chain data;

[0046] Figure 7 For the embodiment of this specification corresponding to Figure 2 Schematic structural diagram of a device for obtaining off-chain data;

[0047] Figure 8 For the embodiment of this specification corresponding to Figure 3 Schematic structural diagram of a device for obtaining off-chain data. Detailed implementation manners

[0048] To make the objectives, technical solutions, and advantages of one or more embodiments of this specification clearer, the following will clearly and completely describe the technical solutions of one or more embodiments of this specification in conjunction with the specific embodiments and corresponding drawings of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope protected by one or more embodiments of this specification.

[0049] The following will, with reference to the drawings, detail the technical solutions provided by each embodiment of this specification.

[0050] In the prior art, a blockchain can be understood as a data chain formed by sequentially storing multiple blocks. The block header of each block contains the timestamp of this block, the hash value of the previous block information, and the hash value of this block information, thereby realizing the mutual verification between blocks and constituting an immutable blockchain. Each block can be understood as a data block (a unit for storing data). As a decentralized database, a blockchain is a series of data blocks generated by being interconnected using cryptographic methods. Each data block contains the information of a network transaction, which is used to verify the validity (anti-counterfeiting) of the information and generate the next block. The chain formed by connecting the blocks end to end is the blockchain. If it is necessary to modify the data within a block, it is necessary to modify the content of all subsequent blocks and modify the data backed up by all nodes in the blockchain network. Therefore, the blockchain has the characteristics of being difficult to tamper with and delete. After the data has been saved to the blockchain, it is reliable as a method for maintaining content integrity.

[0051] A smart contract on the blockchain is a computer protocol designed to disseminate, verify, or execute a contract in an informatized manner. When the blockchain transaction initiated by a user meets the trigger conditions of the smart contract, the program code of the smart contract can automatically run to process the blockchain transaction. Since smart contracts can make blockchain applications more convenient and extensible, smart contracts are widely used in blockchain technology.

[0052] Currently, smart contracts can usually only obtain the data stored in the blockchain (i.e., on-chain data), and cannot directly interact with nodes outside the blockchain to obtain the data not stored in the blockchain (i.e., off-chain data). However, some smart contracts need to run based on off-chain data at a specified participating party. At this time, the smart contract needs to use the oracle mechanism in the blockchain to obtain off-chain data.

[0053] Specifically, people need to write the identification information of the specified participating party into the program code of the smart contract in hard-coded form. Subsequently, when the program code of the smart contract runs, a data acquisition request carrying the identification information of the specified participating party can be generated. The smart contract sends the data acquisition request to the oracle, and the oracle can, based on the identification information of the specified participating party carried in the data acquisition request, send the data acquisition request to the device of the specified participating party, and send the off-chain data fed back by the device of the specified participating party to the smart contract, so that the smart contract can process blockchain transactions based on the acquired off-chain data.

[0054] In this solution, since the identification information of the specified participating party that can provide off-chain data needs to be written into the program code of the smart contract, when the specified participating party that can provide off-chain data changes, the program code of the smart contract needs to be modified, and the modified smart contract needs to be republished. The operation is relatively complex, affecting the flexibility and convenience of the smart contract when acquiring off-chain data.

[0055] To solve the defects in the prior art, the present solution provides the following embodiments:

[0056] Figure 1 It is a schematic diagram of the application scenario of a system for acquiring off-chain data provided in the embodiments of this specification.

[0057] As Figure 1 shown, a blockchain network may include multiple blockchain nodes that can communicate with each other. For example, the first blockchain node 101, the second blockchain node 102, the third blockchain node 103, the fourth blockchain node 104, the fifth blockchain node 105, etc. Outside the blockchain network, there may also be devices of multiple candidate participating parties. For example, the device 106 of the first candidate participating party, the device 107 of the second candidate participating party, the device 108 of the third candidate participating party, the device 109 of the fourth candidate participating party, etc. Each device of the candidate participating parties can communicate with the off-chain device 110, and the off-chain device 110 can also communicate with the oracle in the blockchain network.

[0058] Assume that the device 106 of the first candidate participating party initiates a target blockchain transaction to the fourth blockchain node 104 in the blockchain network, and target off-chain data is required when processing the target blockchain transaction using the target smart contract deployed in the blockchain network. Then the target smart contract can send a data acquisition request for requesting the acquisition of the target off-chain data to the fifth blockchain node 105 where the oracle of the blockchain network is deployed.

[0059] Based on this, the blockchain node (i.e., the fifth blockchain node 105) included in the off-chain data acquisition system can obtain a data acquisition request based on an oracle in the blockchain network, and send the data acquisition request to the off-chain device 110 based on the oracle, where the data acquisition request can be used to request the acquisition of target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction.

[0060] The off-chain device 110 included in the off-chain data acquisition system can obtain the data acquisition request sent by the oracle, determine a designated participant for processing the data acquisition request from the candidate participants according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants, and send the data acquisition request to the device of the designated participant (such as Figure 1 the device 108 of the third candidate participant and the device 109 of the fourth candidate participant shown in

[0061] The device of the designated participant (such as the device 108 of the third candidate participant and the device 109 of the fourth candidate participant) included in the off-chain data acquisition system can send the target off-chain data to the blockchain network in response to the data acquisition request.

[0062] In practical applications, the blockchain network may also include Figure 1 other blockchain nodes not shown in Figure 1 ; the devices of the candidate participants may also include

[0063] Figure 1 other devices not shown in

[0064] The device initiating the blockchain transaction can be either the device of the candidate participant or other devices; the determined device of the designated participant can be either a single device or multiple devices; no specific limitations are made in this regard.

[0065] Figure 2The flowchart of a method for obtaining off-chain data provided by an embodiment of this specification. From a program perspective, the execution subject of this process can be an off-chain device, or an application program installed on the off-chain device. As Figure 2 shown, this process may include the following steps:

[0066] Step 202: The off-chain device obtains a data acquisition request sent by an oracle in the blockchain network; the data acquisition request is used to request the acquisition of target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction.

[0067] In an embodiment of this specification, when processing a target blockchain transaction, a blockchain node may call a target smart contract. If the target smart contract needs to use target off-chain data during operation, the target smart contract may generate a data acquisition request for obtaining the target off-chain data and send it to an oracle in the blockchain network. The oracle may then send the data acquisition request to the off-chain device so that the off-chain device can transmit the data acquisition request to a specified participant.

[0068] In an embodiment of this specification, the oracle may either directly transmit the data acquisition request generated by the target smart contract to the off-chain device, or the oracle may, based on a pre-agreed protocol with the off-chain device, generate a new data acquisition request by processing the data acquisition request generated by the target smart contract and send the newly generated data acquisition request to the off-chain device. There is no specific limitation on this.

[0069] However, since in an embodiment of this specification, the target smart contract may not contain the identification information of the specified participant for generating the target off-chain data, thus, neither the data acquisition request generated by the target smart contract nor the new data acquisition request generated by the oracle usually contains the identification information of the specified participant. Based on this, the target smart contract and the oracle usually cannot determine which specified participants are required to generate the target off-chain data. Therefore, after the off-chain device receives the data acquisition request sent by the oracle for obtaining the target off-chain data, the off-chain device needs to determine the specified participants for generating the target off-chain data.

[0070] Step 204: Determine the specified participant for processing the data acquisition request from the candidate participants according to the transaction information of the target blockchain transaction and the preset transaction information that the candidate participants can process.

[0071] In the embodiments of this specification, when a party needs to provide off-chain data required in the process of blockchain transaction processing, the party can determine the blockchain transaction information that it can process according to the actual situation (i.e., the preset processable transaction information), and send the preset processable transaction information to the off-chain device to become a candidate participating party.

[0072] After receiving the data acquisition request corresponding to the target blockchain transaction sent by the oracle, the off-chain device can determine whether each candidate participating party can process the data acquisition request corresponding to the target blockchain transaction based on the preset processable transaction information of each candidate participating party. If so, the candidate participating party can be determined as the designated participating party; otherwise, the candidate participating party is prohibited from being determined as the designated participating party.

[0073] In the embodiments of this specification, since the off-chain device needs to select the designated participating party based on the transaction information of the target blockchain transaction, before determining the designated participating party from the candidate participating parties, the off-chain device also needs to obtain the transaction information of the target blockchain transaction.

[0074] That is Figure 2 in the method in

[0075] obtaining the transaction information of the target blockchain transaction carried in the data acquisition request; or,

[0076] obtaining the identification information of the target blockchain transaction carried in the data acquisition request. Based on the identification information of the target blockchain transaction, obtain the transaction information of the target blockchain transaction from the blockchain network.

[0077] In the embodiments of this specification, the data acquisition request sent by the oracle to the off-chain device may directly carry the transaction information of the target blockchain transaction to improve the timeliness of the off-chain device to obtain the transaction information of the target blockchain transaction, thereby improving the acquisition efficiency of off-chain data.

[0078] Of course, the data acquisition request sent by the oracle to the off-chain device may not carry the transaction information of the target blockchain transaction, but carry the identification information of the target blockchain transaction, such as the message hash value of the target blockchain transaction, etc., so that the off-chain device can obtain the transaction information of the target blockchain transaction from the blockchain network based on the identification information of the target blockchain transaction carried in the data acquisition request.

[0079] In practical applications, since there is a risk of data acquisition requests being tampered with, and the data in the blockchain network has characteristics such as being immutable and highly credible, the method of the off-chain device obtaining the transaction information of the target blockchain transaction from the blockchain network based on the identification information of the target blockchain transaction can improve the credibility of the transaction information of the target blockchain transaction obtained by the off-chain device. Furthermore, it can improve the processing accuracy of the data acquisition request to ensure the security of the off-chain data at each candidate participating party and the accuracy of the target off-chain data obtained by the target smart contract.

[0080] Step 206: Send the data acquisition request to the device of the specified participating party; the device of the specified participating party is configured to send the target off-chain data to the blockchain network in response to the data acquisition request.

[0081] In the embodiments of this specification, the off-chain device usually needs to pre-establish a communication connection with the devices of each candidate participating party, so that after determining the specified participating party, it can transmit the data acquisition request sent by the oracle to the device of the specified participating party.

[0082] In the embodiments of this specification, since the specified participating party is determined by the off-chain device based on the preset processable transaction information provided by the specified participating party, after the device of the specified participating party receives the data acquisition request sent by the off-chain device, it can process the data acquisition request to extract or generate the target off-chain data requested by the data acquisition request. And the device of the specified participating party usually also needs to feedback the determined target off-chain data to the blockchain network in order for the target smart contract in the blockchain network to obtain the target off-chain data, and then process the target blockchain transaction based on the target off-chain data.

[0083] Among them, there are multiple implementation manners for the device of the specified participating party to send the target off-chain data to the blockchain network. For example, the first implementation manner: initiate a blockchain transaction by itself to send the target off-chain data to the blockchain network; or, the second implementation manner: send the target off-chain data to the blockchain network based on the link of the off-chain device - oracle. When the second implementation manner is adopted, Figure 2 In the method, after step 206: sending the data acquisition request to the device of the specified participating party, it may further include:

[0084] The off-chain device receives the target off-chain data feedback by the device of the specified participating party in response to the data acquisition request.

[0085] Based on the oracle, send the target off-chain data to the blockchain network.

[0086] In the embodiments of this specification, an off-chain device may send target off-chain data to the target smart contract mentioned in step 202 based on an oracle, so that the target smart contract processes the target blockchain transaction based on the target off-chain data. The principle adopted by the off-chain device to send the target off-chain data to the target smart contract based on the oracle may be the same as the principle adopted by the device of a specified participant in the prior art to send the target off-chain data to the target smart contract based on the oracle, and thus will not be elaborated herein.

[0087] Figure 2 In the method in [reference], since the specified participant for providing the target off-chain data required by the target smart contract can be determined by the off-chain device, it is not necessary to write the identification information of the specified participant in the program code of the smart contract. Subsequently, when the specified participant for providing the target off-chain data changes, it is not necessary to modify the program code of the smart contract, which can not only improve the management convenience of the smart contract, but also improve the flexibility and convenience of the smart contract in obtaining off-chain data.

[0088] Of course, to avoid substantially modifying and republishing the smart contract, for the smart contract that already contains the identification information of the specified participant deployed in the blockchain network, it is still possible to obtain off-chain data based on the Figure 2 scheme in [reference]. At this time, although the data acquisition requests generated by the smart contract and the data acquisition requests sent by the oracle to the off-chain device may still contain the identification information of some specified participants, the off-chain device will not determine the specified participant for generating the target off-chain data based on the identification information of the specified participant contained in the data acquisition request, but will determine each specified participant based on the Figure 2 scheme in [reference] to ensure the accuracy of the determined specified participant.

[0089] In addition, in the prior art, each participant can also be made to deploy a blockchain node to join the blockchain network and store the target off-chain data in the blockchain network, so that the smart contract no longer needs to process the blockchain transaction based on the off-chain data. In this scheme, since each participant needs to be made to join the blockchain network, but not all participants have the conditions to join the blockchain network, some participants are unable to participate in the processing of blockchain transactions due to being unable to join the blockchain network, which limits the increase of participants in the blockchain and thus limits the normal processing of blockchain transactions.

[0090] However Figure 2In the method, the participating party can, based on the data acquisition request transmitted by the off-chain device, feedback to the blockchain network the target off-chain data required for processing the target blockchain transaction. Since there is no need for the participating party to deploy a blockchain node to join the blockchain network, the convenience when the number of participating parties in the blockchain increases can be improved, and thus the normal processing of blockchain transactions can be ensured.

[0091] In the prior art, after the initiator of a blockchain transaction initiates a target blockchain transaction, it can also send a data acquisition request to the devices of each designated participating party through an off-chain communication method, so that the devices of the designated participating parties can feedback the target off-chain data to the blockchain network in response to the data acquisition request. In this solution, since communication connections need to be established between the devices of each participating party and the devices of each transaction initiator, the operation is relatively complex and the communication flexibility is greatly reduced. At the same time, since the data acquisition request is generated by the device of the transaction initiator off-chain, the credibility of this data acquisition request will also be reduced.

[0092] However Figure 2 In the method, the devices of each participating party only need to communicate with the off-chain device, thereby improving communication flexibility. Moreover, the data acquisition requests obtained by the devices of each designated participating party are requests sent by the oracle in the blockchain network, thereby ensuring the credibility of the data acquisition request to ensure the security of the off-chain data at each designated participating party. In addition, the accuracy of the target off-chain data feedback by the devices of the designated participating parties based on the data acquisition request can be improved, and thus the accuracy of the smart contract to process the target blockchain transaction based on the target off-chain data can be ensured.

[0093] Based on Figure 2 In the method, the embodiments of the present specification also provide some specific implementation schemes of this method, which will be described below.

[0094] In the embodiments of the present specification, if an enterprise or user needs to be a participating party in the blockchain, it needs to be pre-registered on the off-chain device, and after the registration is completed, it can be a candidate participating party to obtain the possibility of processing the data acquisition request sent by the oracle.

[0095] That is Figure 2 In the method, before step 204 of determining the designated participating party for processing the data acquisition request from the candidate participating parties, it may further include:

[0096] Obtain a registration request carrying preset processable transaction information sent by the device of the candidate participating party. This preset processable transaction information can be used to determine the blockchain transaction information that the candidate participating party can process.

[0097] In response to the registration request, establish a correspondence between the candidate participant and the preset processable transaction information, so that the candidate participant completes registration.

[0098] In the embodiments of this specification, when a new participant in the blockchain occurs, the new participant only needs to register at the off-chain device. Since there is no need to modify the smart contract, nor to establish communication connections between the new participant and each transaction initiation, it is convenient and fast.

[0099] In the embodiments of this specification, step 204: Determine a designated participant for processing the data acquisition request from the candidate participants, which may specifically include:

[0100] For each candidate participant, obtain the preset processable transaction information corresponding to the candidate participant. Among them, this correspondence may be generated based on the registration operation of the candidate participant at the off-chain device.

[0101] Determine whether the transaction information of the target blockchain transaction matches the preset processable transaction information, and obtain a judgment result.

[0102] If the judgment result indicates that the transaction information of the target blockchain transaction matches the preset processable transaction information, determine the candidate participant as the designated participant for processing the data acquisition request.

[0103] In the embodiments of this specification, since the preset processable transaction information of the candidate participant can be used to determine the blockchain transaction information that the candidate participant can process, the off-chain device can perform a matching process on the preset processable transaction information of the candidate participant and the transaction information of the target blockchain transaction. If the two match, it can indicate that the candidate participant can process the target blockchain transaction, and thus the data acquisition request corresponding to the target blockchain transaction can be sent to the candidate participant, so that the candidate participant can feedback the target off-chain data to the blockchain network in response to the data acquisition request; if the two do not match, it can indicate that the candidate participant refuses to process the target blockchain transaction, and thus the data acquisition request corresponding to the target blockchain transaction should not be sent to the candidate participant to reduce waste of device resources.

[0104] In the embodiments of this specification, based on the same principle, each candidate participant can be screened to determine each designated participant for processing the data acquisition request from the candidate participants, which will not be elaborated here.

[0105] In the embodiments of this specification, there may be multiple types of blockchain transactions. For example, at the business level, the types of blockchain transactions may include, but are not limited to, withholding result type, performance result type, contract signing request type, contract termination request type, resource transfer type, etc. Among them, blockchain transactions of the withholding result type can be used to store information indicating the success or failure of withholding for the target user account to the blockchain network, and blockchain transactions of the performance result type can be used to store information indicating the performance result of the target user for the target agreement to the blockchain network. Blockchain transactions of the contract signing request type can be used to request the signing of the target agreement for the first user and the second user, blockchain transactions of the contract termination request type can be used to request the termination of the target agreement signed by the first user and the second user, and blockchain transactions of the resource transfer type can be used to request the transfer of the first user's designated resources to the second user, etc.

[0106] Since some candidate participants can only provide off-chain data for the processing of blockchain transactions of some transaction types, the candidate participants can set the transaction types of blockchain transactions that they can process when registering at the off-chain device. That is, the preset processable transaction information of the candidate participant can include the second transaction type information of the blockchain transactions that the candidate participant can process, and the transaction information of the target blockchain transaction should include the first transaction type information of the target blockchain transaction.

[0107] Based on this, the determining whether the transaction information of the target blockchain transaction matches the preset processable transaction information may specifically include:

[0108] Determine whether the second transaction type information includes the first transaction type information.

[0109] If the second transaction type information includes the first transaction type information, the candidate participant may be determined as the designated participant.

[0110] If the second transaction type information does not include the first transaction type information, it may be prohibited to determine the candidate participant as a designated participant.

[0111] In the embodiment of this specification, when initiating a target blockchain transaction, the transaction initiator needs to specify the transaction type of the target blockchain transaction, so that the transaction message of the target blockchain transaction contains the first transaction type information. In actual applications, the first transaction type information can be written in the data field of the target blockchain transaction message.

[0112] In the embodiments of this specification, some candidate participants may only be able to provide off-chain data for the processing of blockchain transactions initiated by some users to avoid the abuse of off-chain data. Therefore, when a candidate participant registers at an off-chain device, it can also set the identification information of the initiator of the blockchain transactions that it can process. That is, the first preset user identification information can be included in the preset processable transaction information of the candidate participant, and the transaction information of the target blockchain transaction should include the initiator identification information of the target blockchain transaction.

[0113] Based on this, the determination of whether the transaction information of the target blockchain transaction matches the preset processable transaction information may further include:

[0114] Determine whether the initiator identification information is included in the first preset user identification information.

[0115] If the initiator identification information is included in the first preset user identification information, the candidate participant can be determined as a designated participant.

[0116] If the initiator identification information is not included in the first preset user identification information, the candidate participant cannot be determined as a designated participant.

[0117] In the embodiments of this specification, each transaction initiator may also have a unique identity identification information. For example, Decentralized Identifiers (DID) information, etc., and there is a corresponding relationship between the unique identity identification information of each transaction initiator and the blockchain account address information of the transaction initiator. Therefore, the first preset user identification information in the preset processable transaction information of the candidate participant can be either the blockchain account address information of the transaction initiator or the unique identity identification information corresponding to the blockchain account address information of the transaction initiator. Then, the determination of whether the transaction information of the target blockchain transaction matches the preset processable transaction information may further include: determining whether the blockchain account address information corresponding to the first preset user identification information includes the initiator identification information.

[0118] In practical applications, the initiator identification information of the target blockchain transaction included in the transaction information of the target blockchain transaction can be the blockchain account address information in the from field of the target blockchain transaction message.

[0119] In the embodiments of this specification, some candidate participants may only be able to provide off-chain data for the processing of blockchain transactions that some users need to receive. Therefore, when a candidate participant registers at an off-chain device, it can also set the identification information of the recipient of the blockchain transactions that it can process. That is, the preset processable transaction information of the candidate participant may include second preset user identification information, and the transaction information of the target blockchain transaction should include the recipient identification information of the target blockchain transaction.

[0120] Based on this, the determination of whether the transaction information of the target blockchain transaction matches the preset processable transaction information may further include:

[0121] Determine whether the recipient identification information is included in the second preset user identification information.

[0122] If the recipient identification information is included in the second preset user identification information, then this candidate participant can be determined as the designated participant.

[0123] If the recipient identification information is not included in the second preset user identification information, then it can be prohibited from determining this candidate participant as the designated participant.

[0124] In the embodiments of this specification, each transaction recipient may also have unique identity identification information. For example, Decentralized Identifiers (DID) information, etc., and there may also be a corresponding relationship between the unique identity identification information of each transaction recipient and the blockchain account address information of the transaction recipient. Therefore, the second preset user identification information in the preset processable transaction information of the candidate participant can be either the blockchain account address information of the transaction recipient or the unique identity identification information corresponding to the blockchain account address information of the transaction recipient. Then, the determination of whether the transaction information of the target blockchain transaction matches the preset processable transaction information may further include: determining whether the blockchain account address information corresponding to the second preset user identification information includes the recipient identification information.

[0125] In practical applications, the recipient identification information of the target blockchain transaction included in the transaction information of the target blockchain transaction can be the blockchain account address information in the to field of the target blockchain transaction message.

[0126] In the embodiments of this specification, since the blockchain transaction information that a candidate participant can process may change, after a candidate participant completes registration at an off-chain device, it may also be necessary to modify the preset processable transaction information of the candidate participant to update the blockchain transaction information that the candidate participant can process.

[0127] Based on this, after establishing the correspondence between the candidate participant and the preset processable transaction information, the following may further be included:

[0128] Receive a change request for the preset processable transaction information sent by the device of the candidate participant.

[0129] In response to the change request, change the preset processable transaction information corresponding to the candidate participant.

[0130] In the embodiments of this specification, the change request for the preset processable transaction information sent by the device of the candidate participant may include the second transaction type information to be newly added, the first preset user identification information to be newly added, the second preset user identification information to be newly added. Of course, it may also include the second transaction type information to be deleted, the first preset user identification information to be deleted, the second preset user identification information to be deleted, etc., so that the off-chain device can add or delete the preset processable transaction information corresponding to the candidate participant, which is convenient and fast.

[0131] Based on the same idea as the Figure 1 system shown, the embodiments of this specification also provide another method for obtaining off-chain data. Figure 3 It is a schematic flowchart of another method for obtaining off-chain data provided by the embodiments of this specification. The execution subject of this process may be a blockchain node equipped with an oracle, or an application program of the oracle. As Figure 3 shown, this process may include:

[0132] Step 302: The blockchain node obtains a data acquisition request based on the oracle in the blockchain network. The data acquisition request is used to request the acquisition of target off-chain data, and the target off-chain data is the off-chain data required for the target smart contract in the blockchain network to process the target blockchain transaction.

[0133] In the embodiments of this specification, the data acquisition request obtained by the oracle may be generated after the target smart contract is called. The target smart contract may not include the identification information of the specified participant for generating the target off-chain data, so the data acquisition request sent by the target smart contract to the oracle usually does not include the identification information of the specified participant either.

[0134] That is, step 302: Obtaining the data acquisition request based on the oracle in the blockchain network may specifically include:

[0135] Obtain the data acquisition request sent by the called target smart contract to the oracle; the target smart contract does not include the identification information of the specified participant for generating the target off-chain data.

[0136] Step 304: Send the data acquisition request to an off-chain device based on the oracle; the off-chain device is used to send the data acquisition request to the device of a specified participant, and the specified participant is determined from the candidate participants by the off-chain device according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants and is the participant for processing the data acquisition request.

[0137] In the embodiments of this specification, the oracle can directly forward the data acquisition request sent by the smart contract to the off-chain device, or the oracle can also, based on a pre-agreed protocol with the off-chain device, generate a new data acquisition request by processing the data acquisition request sent by the target smart contract and send the newly generated data acquisition request to the off-chain device, and no specific limitation is made thereto.

[0138] In the embodiments of this specification, the data acquisition request sent by the oracle to the off-chain device in step 304 is the Figure 2 data acquisition request obtained by the off-chain device in step 202 in , and details are not described herein again.

[0139] In the embodiments of this specification, since the data acquisition request sent by the target smart contract to the oracle usually does not contain the identification information of the specified participant, the data acquisition request sent by the oracle to the off-chain device usually does not contain the identification information of the specified participant either. Therefore, it is necessary to determine the specified participant for generating the target off-chain data through the off-chain device and send the data acquisition request for requesting the generation of the target off-chain data to the specified participant, so that the specified participant can feedback the target off-chain data to the blockchain network, thereby ensuring the normal processing of the target blockchain transaction.

[0140] Figure 3 In the method in , since the specified participant for providing the target off-chain data required by the target smart contract can be determined through the off-chain device, it is not necessary to write the identification information of the specified participant in the program code of the smart contract. Subsequently, when the specified participant for providing the target off-chain data changes, it is not necessary to modify the program code of the smart contract. Therefore, not only can the management convenience of the smart contract be improved, but also the flexibility and convenience of the smart contract for obtaining off-chain data can be improved. And since the oracle only needs to communicate with the off-chain device and does not need to communicate with the devices of each blockchain participant, the management convenience of the oracle can also be improved.

[0141] Based on Figure 3 the method in , the embodiments of this specification also provide some specific implementation schemes of this method, which are described below.

[0142] In the embodiments of this specification, the data acquisition request obtained by the oracle may carry the transaction information of the target blockchain transaction or the identification information of the target blockchain transaction.

[0143] Therefore, step 304: Sending the data acquisition request to the off-chain device based on the oracle may specifically include:

[0144] Sending the data acquisition request carrying the transaction information of the target blockchain transaction to the off-chain device based on the oracle. Or,

[0145] Sending the data acquisition request carrying the identification information of the target blockchain transaction to the off-chain device based on the oracle; the off-chain device is further configured to obtain the transaction information of the target blockchain transaction from the blockchain network based on the identification information of the target blockchain transaction.

[0146] In the embodiments of this specification, the transaction information of the target blockchain transaction may include at least one of the transaction type information of the target blockchain transaction, the initiator identification information, and the recipient identification information. In practical applications, the transaction type information of the target blockchain transaction may be carried in the data field in the message of the target blockchain transaction. The initiator identification information of the target blockchain transaction may be the blockchain account address information in the from field in the message of the target blockchain transaction. The recipient identification information of the target blockchain transaction may be the blockchain account address information in the to field in the message of the target blockchain transaction.

[0147] In the embodiments of this specification, since the blockchain node may also receive the target off-chain data fed back by the device of the specified participant, therefore, after step 304: Sending the data acquisition request to the off-chain device based on the oracle, it may further include:

[0148] Receiving the target off-chain data sent by the off-chain device based on the oracle; the target off-chain data is the data fed back by the device of the specified participant to the off-chain device in response to the data acquisition request; or,

[0149] Receiving the blockchain transaction initiated by the specified participant and carrying the target off-chain data.

[0150] In the embodiments of this specification, after the blockchain node obtains the target off-chain data, it may also send the target off-chain data to the target smart contract so that the target smart contract processes the target blockchain transaction based on the target off-chain data.

[0151] Figure 4 For the corresponding to the embodiments of this specification Figure 2 and Figure 3Swimlane process diagram of the method for obtaining off-chain data in Figure 4 As shown, the off-chain data acquisition process may involve a target smart contract, an oracle, off-chain devices, participant devices, etc.

[0152] In the stage of adding a new participant to the blockchain, the participant device may generate and send a registration request carrying preset processable transaction information to the off-chain device. Among them, the preset processable transaction information can be used to determine the blockchain transaction information that the candidate participant can process. The off-chain device can, in response to the registration request, establish a correspondence between the participant and the preset processable transaction information, so that the participant can complete registration and become a candidate participant, and then can join the process of processing blockchain transactions.

[0153] In the stage of obtaining off-chain data, after being invoked by a target blockchain transaction, the target smart contract can determine the target off-chain data required to process the target blockchain transaction, generate and send a data acquisition request for requesting the acquisition of the target off-chain data to the oracle. After receiving the data acquisition request for requesting the acquisition of the target off-chain data, the oracle can either directly send the data acquisition request to the off-chain device, or, based on the data acquisition request sent by the target smart contract, generate a new data acquisition request for acquiring the target off-chain data and send the new data acquisition request for acquiring the target off-chain data to the off-chain device.

[0154] After receiving the data acquisition request for requesting the acquisition of the target off-chain data sent by the oracle, the off-chain device can, based on the data acquisition request, acquire the transaction information of the target blockchain transaction and the preset processable transaction information corresponding to the candidate participant, and determine whether the transaction information of the target blockchain transaction matches the preset processable transaction information. If not, the candidate participant is prohibited from being determined as the designated participant. If so, the candidate participant is determined as the designated participant, and the data acquisition request is sent to the device of the designated participant.

[0155] Assume that the participant device mentioned in the stage of adding a new participant to the blockchain is the device of the designated participant. Then, the participant device can generate the target off-chain data in response to the data acquisition request sent by the off-chain device. Subsequently, the participant device can also initiate a blockchain transaction carrying the target off-chain data so that the target smart contract can obtain the target off-chain data. Or, the participant device can send the target off-chain data to the off-chain device, and the off-chain device can send the target off-chain data to the oracle so that the oracle can send the target off-chain data to the target smart contract, thereby also enabling the target smart contract to obtain the target off-chain data.

[0156] Based on the same idea, the embodiments of this specification also provide an apparatus corresponding to the above method. Figure 5 For the embodiment of this specification, it corresponds to Figure 2 a schematic structural diagram of an off-chain data acquisition apparatus. As Figure 5 shown, the apparatus may include:

[0157] An acquisition module 502, configured to acquire, by an off-chain device, a data acquisition request sent by an oracle in a blockchain network; the data acquisition request is used to request to acquire target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction. Among them, the target smart contract may not include the identification information of the specified participant for generating the target off-chain data.

[0158] A determination module 504, configured to determine, according to the transaction information of the target blockchain transaction and the preset processable transaction information of candidate participants, a specified participant for processing the data acquisition request from the candidate participants.

[0159] A sending module 506, configured to send the data acquisition request to the device of the specified participant; the device of the specified participant is configured to send the target off-chain data to the blockchain network in response to the data acquisition request.

[0160] Based on Figure 5 the apparatus, the embodiments of this specification also provide some specific implementation schemes of the apparatus, which will be described below.

[0161] Optionally, Figure 5 in the apparatus, the determination module 504 may include:

[0162] An acquisition unit, configured to acquire, for each candidate participant, the preset processable transaction information corresponding to the candidate participant.

[0163] A judgment unit, configured to judge whether the transaction information of the target blockchain transaction matches the preset processable transaction information, and obtain a judgment result.

[0164] A determination unit, configured to, if the judgment result indicates that the transaction information of the target blockchain transaction matches the preset processable transaction information, determine the candidate participant as the specified participant for processing the data acquisition request.

[0165] Optionally, Figure 5In the device, the transaction information of the target blockchain transaction may include: the initiator identification information of the target blockchain transaction, the recipient identification information, and the first transaction type information, while the preset processable transaction information may include: the first preset user identification information, the second preset user identification information, and the second transaction type information of the blockchain transactions processable by the candidate participant.

[0166] In the judgment unit, it may specifically be used for:

[0167] Judge whether the initiator identification information is included in the first preset user identification information, the recipient identification information is included in the second preset user identification information, and the first transaction type information is included in the second transaction type information.

[0168] Optionally, Figure 5 The device in may further include:

[0169] A registration request acquisition module, configured to acquire a registration request carrying preset processable transaction information sent by the device of the candidate participant.

[0170] A correspondence relationship establishment module, configured to establish a correspondence relationship between the candidate participant and the preset processable transaction information in response to the registration request.

[0171] Optionally, Figure 5 The device in may further include:

[0172] A change request receiving module, configured to receive a change request for the preset processable transaction information sent by the device of the candidate participant.

[0173] A change module, configured to change the preset processable transaction information having a correspondence relationship with the candidate participant in response to the change request.

[0174] Optionally, Figure 5 The device in may further include:

[0175] A target off-chain data receiving module, configured to receive the target off-chain data fed back by the device of the specified participant in response to the data acquisition request.

[0176] A target off-chain data sending module, configured to send the target off-chain data to the blockchain network based on the oracle.

[0177] Optionally, Figure 5 The device in may further include:

[0178] A transaction information acquisition module, configured to acquire the transaction information of the target blockchain transaction carried in the data acquisition request; or, acquire the identification information of the target blockchain transaction carried in the data acquisition request; and based on the identification information of the target blockchain transaction, acquire the transaction information of the target blockchain transaction from the blockchain network.

[0179] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method. Figure 6 For the embodiment of this specification, it provides Figure 3 a schematic structural diagram of a device for acquiring off-chain data corresponding to Figure 6 As shown in the figure, the device may include:

[0180] An acquisition module 602, configured to enable a blockchain node to acquire a data acquisition request based on an oracle in a blockchain network, where the data acquisition request is used to request to acquire target off-chain data, and the target off-chain data is off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction.

[0181] A sending module 604, configured to send the data acquisition request to an off-chain device based on the oracle; the off-chain device is configured to send the data acquisition request to a device of a specified participant, and the specified participant is a participant determined from candidate participants by the off-chain device according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants for processing the data acquisition request.

[0182] Based on Figure 6 the device, the embodiments of this specification also provide some specific implementation solutions of the device, which will be described below.

[0183] Optionally, Figure 6 in the device, the data acquisition request may carry the transaction information of the target blockchain transaction or the identification information of the target blockchain transaction; where the transaction information of the target blockchain transaction includes at least one of the transaction type information of the target blockchain transaction, the initiator identification information, and the recipient identification information.

[0184] Then the sending module 604 may specifically be configured to:

[0185] Send the data acquisition request carrying the transaction information of the target blockchain transaction to the off-chain device based on the oracle; or,

[0186] Send the data acquisition request carrying the identification information of the target blockchain transaction to the off-chain device based on the oracle; the off-chain device is further configured to acquire the transaction information of the target blockchain transaction from the blockchain network based on the identification information of the target blockchain transaction.

[0187] Optionally, Figure 6 the device in may further include a receiving module, configured to:

[0188] receive the target off-chain data sent by the off-chain device based on the oracle; the target off-chain data is the data fed back by the device of the specified participant in response to the data acquisition request to the off-chain device; or,

[0189] receive a blockchain transaction carried by the specified participant and carrying the target off-chain data.

[0190] Optionally, Figure 6 for the device in , the acquisition module 602 may specifically be configured to:

[0191] acquire the data acquisition request sent by the target smart contract called to the oracle; the target smart contract does not contain the identification information of the specified participant for generating the target off-chain data.

[0192] Based on the same idea, an embodiment of this specification further provides a device corresponding to the above method.

[0193] Figure 7 For the corresponding one provided by the embodiment of this specification Figure 2 is a schematic structural diagram of an off-chain data acquisition device. As Figure 7 shown, the device 700 may be an off-chain device, and the device 700 may include:

[0194] at least one processor 710; and,

[0195] a memory 730 communicatively connected to the at least one processor; wherein,

[0196] the memory 730 stores instructions 720 executable by the at least one processor 710, and the instructions are executed by the at least one processor 710 to enable the at least one processor 710 to:

[0197] acquire a data acquisition request sent by an oracle in a blockchain network; the data acquisition request is used to request to acquire target off-chain data, and the target off-chain data is off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction.

[0198] Determine a specified participant for processing the data acquisition request from the candidate participants according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants.

[0199] Send the data acquisition request to the device of the specified participating party; the device of the specified participating party is configured to send the target off-chain data to the blockchain network in response to the data acquisition request.

[0200] Figure 8 This is a schematic structural diagram of an off-chain data acquisition device provided in the embodiments of the present specification corresponding to Figure 3 As shown in Figure 8 As shown, a blockchain node may be deployed at device 800, and device 800 may be an off-chain device. Device 800 may include:

[0201] At least one processor 810; and,

[0202] A memory 830 communicatively connected to the at least one processor; wherein,

[0203] The memory 830 stores instructions 820 executable by the at least one processor 810. The instructions are executed by the at least one processor 810 so that the at least one processor 810 can:

[0204] Obtain a data acquisition request based on an oracle in the blockchain network. The data acquisition request is used to request the acquisition of target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction.

[0205] Send the data acquisition request to an off-chain device based on the oracle; the off-chain device is configured to send the data acquisition request to the device of the specified participating party, and the specified participating party is a participating party determined from candidate participating parties by the off-chain device according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participating parties for processing the data acquisition request.

[0206] Each embodiment in this specification is described in a progressive manner. For the same or similar parts between the embodiments, reference can be made to each other. The key points described in each embodiment are the differences from other embodiments. In particular, for Figure 7 and Figure 8 The described device, since it is basically similar to the method embodiment, is described relatively simply. For related parts, reference can be made to the partial description of the method embodiment.

[0207] In the 1990s, it was obvious to distinguish whether an improvement in a technology was an improvement in hardware (e.g., improvement in circuit structures such as diodes, transistors, switches, etc.) or an improvement in software (improvement in method processes). However, with the development of technology, many improvements in method processes today can be regarded as direct improvements in hardware circuit structures. Almost all designers obtain the corresponding hardware circuit structures by programming the improved method processes into the hardware circuits. Therefore, it cannot be said that an improvement in a method process cannot be implemented with a hardware entity module. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logical function is determined by the user programming the device. Designers can program by themselves to "integrate" a digital character system on a piece of PLD without asking a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development writing. The original code before compilation also has to be written in a specific programming language, which is called a Hardware Description Language (HDL). And there is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that only by slightly logically programming the method process with the above-mentioned several hardware description languages and programming it into the integrated circuit can the hardware circuit implementing the logical method process be easily obtained.

[0208] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to logically program the method steps to enable the controller to be implemented in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. to achieve the same functions. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as the structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or the structures within the hardware component.

[0209] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0210] For the convenience of description, the above devices are described by dividing them into various units according to functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0211] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.

[0212] The present invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each flow and / or block of the flowchart illustrations and / or block diagrams, and combinations of flows and / or blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing apparatus create means for implementing the functions specified in the flow Figure 1 one or more flows and / or blocks Figure 1 or means for implementing the functions specified in a block or blocks.

[0213] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means that implement the functions specified in the flow Figure 1 one or more flows and / or blocks Figure 1 or means for implementing the functions specified in a block or blocks.

[0214] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow Figure 1 one or more flows and / or blocks Figure 1 or means for implementing the functions specified in a block or blocks.

[0215] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0216] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.

[0217] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0218] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0219] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0220] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0221] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims

1. An off-chain data acquisition system, comprising: A blockchain node, configured to obtain a data acquisition request based on an oracle in a blockchain network, and send the data acquisition request to an off-chain device based on the oracle, wherein the data acquisition request is used to request the acquisition of target off-chain data, and the target off-chain data is off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction; the target smart contract does not contain identification information of a specified participant for generating the target off-chain data; The off-chain device is configured to obtain the data acquisition request sent by the oracle, determine the specified participant for processing the data acquisition request from the candidate participants according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants, and send the data acquisition request to the device of the specified participant; the transaction information of the target blockchain transaction includes at least one of the transaction type information, the initiator identification information, and the recipient identification information of the target blockchain transaction; The device of the specified participant is configured to send the target off-chain data to the blockchain network in response to the data acquisition request.

2. An off-chain data acquisition method, comprising: The off-chain device obtains a data acquisition request sent by an oracle in the blockchain network; The data acquisition request is used to request the acquisition of target off-chain data, and the target off-chain data is off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction; The target smart contract does not contain identification information of a specified participant for generating the target off-chain data; Determine the specified participant for processing the data acquisition request from the candidate participants according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants; The transaction information of the target blockchain transaction includes at least one of the transaction type information, the initiator identification information, and the recipient identification information of the target blockchain transaction; Send the data acquisition request to the device of the specified participant; the device of the specified participant is configured to send the target off-chain data to the blockchain network in response to the data acquisition request.

3. The method according to claim 2, wherein the step of determining the specified participant for processing the data acquisition request from the candidate participants according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants specifically comprises: For each candidate participant, obtain the preset processable transaction information corresponding to the candidate participant; Judge whether the transaction information of the target blockchain transaction matches the preset processable transaction information to obtain a judgment result; If the judgment result indicates that the transaction information of the target blockchain transaction matches the preset processable transaction information, determine the candidate participant as the specified participant for processing the data acquisition request.

4. The method according to claim 3, wherein the transaction information of the target blockchain transaction includes: The first transaction type information of the target blockchain transaction, and the preset processable transaction information includes: the second transaction type information of the blockchain transactions processable by the candidate participant; The determination of whether the transaction information of the target blockchain transaction matches the preset processable transaction information specifically includes: Determining whether the first transaction type information is included in the second transaction type information.

5. The method according to claim 4, wherein the transaction information of the target blockchain transaction further includes: The initiator identification information of the target blockchain transaction, and the preset processable transaction information further includes: the first preset user identification information; The determination of whether the transaction information of the target blockchain transaction matches the preset processable transaction information further includes: Determining whether the initiator identification information is included in the first preset user identification information.

6. The method according to claim 5, wherein the transaction information of the target blockchain transaction further includes: The recipient identification information of the target blockchain transaction, and the preset processable transaction information further includes: the second preset user identification information; The determination of whether the transaction information of the target blockchain transaction matches the preset processable transaction information further includes: Determining whether the recipient identification information is included in the second preset user identification information.

7. The method according to claim 3, before obtaining the preset processable transaction information corresponding to the candidate participant, further includes: Obtaining a registration request carrying the preset processable transaction information sent by the device of the candidate participant; In response to the registration request, establishing a corresponding relationship between the candidate participant and the preset processable transaction information.

8. The method according to claim 7, after establishing the corresponding relationship between the candidate participant and the preset processable transaction information, further includes: Receiving a change request for the preset processable transaction information sent by the device of the candidate participant; In response to the change request, changing the preset processable transaction information corresponding to the candidate participant.

9. The method according to claim 2, after sending the data acquisition request to the device of the designated participant, further includes: Receiving the target off-chain data fed back by the device of the designated participant in response to the data acquisition request; Sending the target off-chain data to the blockchain network based on the oracle.

10. The method according to any one of claims 2-9, before determining, according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participant, a designated participant for processing the data acquisition request from the candidate participants, further includes: Obtaining the transaction information of the target blockchain transaction carried in the data acquisition request; Or, Obtaining the identification information of the target blockchain transaction carried in the data acquisition request; Based on the identification information of the target blockchain transaction, obtaining the transaction information of the target blockchain transaction from the blockchain network.

11. The method according to any one of claims 2-9, wherein the target smart contract does not include the identification information of the designated participant for generating the target off-chain data.

12. A method for obtaining off-chain data, including: A blockchain node obtains a data acquisition request based on an oracle in a blockchain network. The data acquisition request is used to request the acquisition of target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction; The target smart contract does not contain the identification information of a specified party for generating the target off-chain data; Based on the oracle, send the data acquisition request to an off-chain device; The off-chain device is used to send the data acquisition request to the device of the specified party. The specified party is a party determined from candidate parties by the off-chain device according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate parties, and is used to process the data acquisition request; The transaction information of the target blockchain transaction includes at least one of the transaction type information, the initiator identification information, and the recipient identification information of the target blockchain transaction.

13. The method according to claim 12, wherein the data acquisition request carries the transaction information of the target blockchain transaction or the identification information of the target blockchain transaction; The sending the data acquisition request to the off-chain device based on the oracle specifically includes: Based on the oracle, send the data acquisition request carrying the transaction information of the target blockchain transaction to the off-chain device; Or, Based on the oracle, send the data acquisition request carrying the identification information of the target blockchain transaction to the off-chain device; the off-chain device is further used to obtain the transaction information of the target blockchain transaction from the blockchain network based on the identification information of the target blockchain transaction.

14. The method according to claim 13, wherein the transaction information of the target blockchain transaction includes: At least one of the transaction type information, the initiator identification information, and the recipient identification information of the target blockchain transaction.

15. The method according to claim 12, after the sending the data acquisition request to the off-chain device based on the oracle, further includes: Receive the target off-chain data sent by the off-chain device based on the oracle; The target off-chain data is the data fed back by the device of the specified party in response to the data acquisition request to the off-chain device; or, Receive a blockchain transaction initiated by the specified party and carrying the target off-chain data.

16. The method according to any one of claims 12-15, the obtaining the data acquisition request based on an oracle in a blockchain network specifically includes: Obtain the data acquisition request sent by the called target smart contract to the oracle; The target smart contract does not contain the identification information of the specified party for generating the target off-chain data.

17. An off-chain data acquisition device, comprising: An acquisition module, configured to enable an off-chain device to obtain a data acquisition request sent by an oracle in a blockchain network; The data acquisition request is used to request the acquisition of target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction; The identity information of the specified participant for generating the target off-chain data is not included in the target smart contract; A determination module, configured to determine, according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants, the specified participant for processing the data acquisition request from the candidate participants; The transaction information of the target blockchain transaction includes at least one of the transaction type information, the initiator identity information, and the recipient identity information of the target blockchain transaction; A sending module, configured to send the data acquisition request to the device of the specified participant; the device of the specified participant is configured to send the target off-chain data to the blockchain network in response to the data acquisition request.

18. The device according to claim 17, wherein the determination module comprises: An acquisition unit, configured to, for each candidate participant, acquire the preset processable transaction information having a corresponding relationship with the candidate participant; A judgment unit, configured to judge whether the transaction information of the target blockchain transaction matches the preset processable transaction information, and obtain a judgment result; A determination unit, configured to, if the judgment result indicates that the transaction information of the target blockchain transaction matches the preset processable transaction information, determine the candidate participant as the specified participant for processing the data acquisition request.

19. The device according to claim 18, wherein the transaction information of the target blockchain transaction includes: The initiator identity information, the recipient identity information, and the first transaction type information of the target blockchain transaction, and the preset processable transaction information includes: the first preset user identity information, the second preset user identity information, and the second transaction type information of the blockchain transaction processable by the candidate participant; The judgment unit is specifically configured to: Judge whether the initiator identity information is included in the first preset user identity information, the recipient identity information is included in the second preset user identity information, and the first transaction type information is included in the second transaction type information.

20. The device according to any one of claims 17-19, wherein the identity information of the specified participant for generating the target off-chain data is not included in the target smart contract.

21. An off-chain data acquisition device, comprising: An acquisition module, configured to acquire, by a blockchain node based on an oracle in a blockchain network, a data acquisition request for requesting acquisition of target off-chain data, where the target off-chain data is off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction; The identity information of the specified participant for generating the target off-chain data is not included in the target smart contract; A sending module, configured to send the data acquisition request to an off-chain device based on the oracle; The off-chain device is configured to send the data acquisition request to the device of the specified participant, where the specified participant is a participant determined by the off-chain device from the candidate participants according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants for processing the data acquisition request; The transaction information of the target blockchain transaction includes at least one of the transaction type information, the initiator identification information, and the recipient identification information of the target blockchain transaction.

22. The device according to claim 21, wherein the transaction information of the target blockchain transaction or the identification information of the target blockchain transaction is carried in the data acquisition request; wherein, The transaction information of the target blockchain transaction includes at least one of the transaction type information, the initiator identification information, and the recipient identification information of the target blockchain transaction; The sending module is specifically configured to: Send the data acquisition request carrying the transaction information of the target blockchain transaction to the off-chain device based on the oracle; or, Send the data acquisition request carrying the identification information of the target blockchain transaction to the off-chain device based on the oracle; the off-chain device is further configured to obtain the transaction information of the target blockchain transaction from the blockchain network based on the identification information of the target blockchain transaction.

23. The device according to any one of claims 21-22, wherein the acquisition module is specifically configured to: Obtain the data acquisition request sent by the called target smart contract to the oracle; the target smart contract does not include the identification information of the specified participant for generating the target off-chain data.

24. An off-chain data acquisition device, the device being an off-chain device, comprising: At least one processor; And, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to: Obtain a data acquisition request sent by an oracle in the blockchain network; the data acquisition request is used to request the acquisition of target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction; the target smart contract does not include the identification information of the specified participant for generating the target off-chain data; Determine the specified participant for processing the data acquisition request from the candidate participants according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants; the transaction information of the target blockchain transaction includes at least one of the transaction type information, the initiator identification information, and the recipient identification information of the target blockchain transaction; Send the data acquisition request to the device of the specified participant; the device of the specified participant is configured to send the target off-chain data to the blockchain network in response to the data acquisition request.

25. An off-chain data acquisition device, where a blockchain node is deployed at the device, comprising: At least one processor; And, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to: Obtain a data acquisition request based on an oracle in a blockchain network. The data acquisition request is used to request the acquisition of target off-chain data, and the target off-chain data is the off-chain data required for a target smart contract in the blockchain network to process a target blockchain transaction; the target smart contract does not contain the identification information of a specified participant for generating the target off-chain data. Based on the oracle, send the data acquisition request to an off-chain device; the off-chain device is used to send the data acquisition request to the device of the specified participant. The specified participant is the participant determined from candidate participants by the off-chain device according to the transaction information of the target blockchain transaction and the preset processable transaction information of the candidate participants, and is used to process the data acquisition request; the transaction information of the target blockchain transaction includes at least one of the following: the transaction type information of the target blockchain transaction, the initiator identification information, and the recipient identification information.

Citation Information

Patent Citations

  • Blockchain message processing method and device, computer and readable storage medium

    CN111401903A

  • Business processing method and system based on block chain oracle machine

    CN113205416A