WO2022048589A1 - Data acquisition method, apparatus and device, and medium - Google Patents

Data acquisition method, apparatus and device, and medium Download PDF

Info

Publication number
WO2022048589A1
WO2022048589A1 PCT/CN2021/116184 CN2021116184W WO2022048589A1 WO 2022048589 A1 WO2022048589 A1 WO 2022048589A1 CN 2021116184 W CN2021116184 W CN 2021116184W WO 2022048589 A1 WO2022048589 A1 WO 2022048589A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
data query
query
chain
request
Prior art date
Application number
PCT/CN2021/116184
Other languages
French (fr)
Chinese (zh)
Inventor
何朔
许玉壮
周钰
杨洁
Original Assignee
中国银联股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202010914632.4A external-priority patent/CN112084234B/en
Application filed by 中国银联股份有限公司 filed Critical 中国银联股份有限公司
Publication of WO2022048589A1 publication Critical patent/WO2022048589A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

A data acquisition method, apparatus and device, and a medium. The method comprises: a blockchain node constructing a data query request on the basis of acquired data query information and by means of an intelligent contract, wherein the data query request carries the data query information; the blockchain node directly sending the data query request to an out-of-chain data source associated with the data query information; the out-of-chain data source receiving the data query request sent by the blockchain node, and the out-of-chain data source obtaining a data query result on the basis of the data query request; the out-of-chain data source sending the data query result to the blockchain node; and the blockchain node receiving the data query result sent by the out-of-chain data source. The complexity of accessing out-of-chain data by a blockchain node is reduced.

Description

数据获取方法、装置、设备和介质Data acquisition method, apparatus, device and medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求享有于2020年09月03日提交的名称为“数据获取方法、装置、设备和介质”的中国专利申请202010914632.4的优先权,该申请的全部内容通过引用并入本文中。This application claims the priority of Chinese Patent Application No. 202010914632.4 filed on September 3, 2020, entitled "Data Acquisition Method, Apparatus, Equipment and Medium", the entire content of which is incorporated herein by reference.
技术领域technical field
本申请涉及数据业务领域,尤其涉及一种数据获取方法、装置、设备和介质。The present application relates to the field of data services, and in particular, to a data acquisition method, apparatus, device and medium.
背景技术Background technique
区块链技术(也被称之为,分布式账本技术)是一种去中心化的分布式数据库技术,具有去中心化、公开透明、不可篡改、可信任等多种特点,适用于诸多对数据可靠性具有高需求的应用场景中。Blockchain technology (also known as distributed ledger technology) is a decentralized distributed database technology, which has the characteristics of decentralization, openness, transparency, non-tampering, and trustworthiness. In application scenarios with high demands on data reliability.
在一些应用场景下,区块链节点需要访问链外数据。目前,区块链节点若想要访问链外数据,需要在链外单独部署预言机客户端或者预言机网络,复杂度较高。In some application scenarios, blockchain nodes need to access off-chain data. At present, if a blockchain node wants to access off-chain data, it needs to deploy an oracle client or an oracle network separately outside the chain, which is highly complex.
发明内容SUMMARY OF THE INVENTION
本申请提供一种数据获取方法、装置、设备和介质,能够解决区块链节点想要访问链外数据时复杂度较高的问题。The present application provides a data acquisition method, device, device and medium, which can solve the problem of high complexity when a blockchain node wants to access data outside the chain.
第一方面,本申请提供一种数据获取方法,应用于区块链节点,包括:In the first aspect, the present application provides a data acquisition method, which is applied to a blockchain node, including:
基于获取的数据查询信息,通过智能合约构建数据查询请求,数据查询请求携带有数据查询信息;Based on the obtained data query information, a data query request is constructed through a smart contract, and the data query request carries the data query information;
直接向与数据查询信息关联的链外数据源发送数据查询请求,以使链外数据源基于数据查询请求得到数据查询结果;Send a data query request directly to the off-chain data source associated with the data query information, so that the off-chain data source can obtain the data query result based on the data query request;
接收链外数据源发送的数据查询结果。Receive data query results sent by data sources outside the chain.
第二方面,本申请提供了一种数据获取方法,应用于链外数据源,包括:In the second aspect, the present application provides a data acquisition method, which is applied to an off-chain data source, including:
接收区块链节点发送的数据查询请求,数据查询请求是区块链节点基于获取的数据查询信息,通过智能合约构建的,数据查询请求携带有数据查询信息;Receive the data query request sent by the blockchain node. The data query request is constructed by the blockchain node based on the acquired data query information through smart contracts, and the data query request carries the data query information;
基于数据查询请求,得到数据查询结果;Based on the data query request, obtain the data query result;
向区块链节点发送数据查询结果。Send data query results to blockchain nodes.
第三方面,本申请提供了一种数据获取装置,应用于区块链节点,包括:In a third aspect, the present application provides a data acquisition device, which is applied to a blockchain node, including:
数据查询请求构建模块,用于基于获取的数据查询信息,通过智能合约构建数据查询请求,数据查询请求携带有数据查询信息;The data query request building module is used to construct a data query request through a smart contract based on the acquired data query information, and the data query request carries the data query information;
数据查询请求发送模块,用于直接向与数据查询信息关联的链外数据源发送数据查询请求,以使链外数据源基于数据查询请求得到数据查询结果;The data query request sending module is used to directly send a data query request to the off-chain data source associated with the data query information, so that the off-chain data source can obtain the data query result based on the data query request;
数据查询结果接收模块,用于接收链外数据源发送的数据查询结果。The data query result receiving module is used to receive the data query result sent by the data source outside the chain.
第四方面,本申请提供了一种数据获取装置,应用于链外数据源,包括:In a fourth aspect, the present application provides a data acquisition device, which is applied to an off-chain data source, including:
数据查询请求接收模块,用于接收区块链节点发送的数据查询请求,数据查询请求是区块链节点基于获取的数据查询信息,通过智能合约构建的,数据查询请求携带有数据查询信息;The data query request receiving module is used to receive the data query request sent by the blockchain node. The data query request is constructed by the blockchain node based on the acquired data query information through smart contracts, and the data query request carries the data query information;
数据查询结果确定模块,用于基于数据查询请求,得到数据查询结果;The data query result determination module is used to obtain the data query result based on the data query request;
数据查询结果发送模块,用于向区块链节点发送数据查询结果。The data query result sending module is used to send the data query result to the blockchain node.
第五方面,本申请提供了一种数据获取设备,设备包括:包括:处理器以及存储有计算机程序指令的存储器;In a fifth aspect, the present application provides a data acquisition device, the device includes: a processor and a memory storing computer program instructions;
处理器执行计算机程序指令时实现上述第一方面或第二方面提供的数据获取方法。When the processor executes the computer program instructions, the data acquisition method provided in the first aspect or the second aspect is implemented.
第六方面,本申请提供了一种计算机存储介质,计算机存储介质上存储有计算机程序指令,计算机程序指令被处理器执行时实现如上述第一方面或第二方面提供的数据获取方法。In a sixth aspect, the present application provides a computer storage medium, where computer program instructions are stored thereon, and when the computer program instructions are executed by a processor, the data acquisition method provided in the first or second aspect above is implemented.
根据本申请实施例的数据获取方法、装置、设备及计算机存储介质,区块链节点能够通过智能合约,基于获取的数据查询信息构建数据查询请求,并可以直接向与数据查询信息关联的链外数据源发送数据查询请求,以获取数据查询结果,不需要单独建立预言机客户端或者预言机网络,而是通过区块链节点与链外数据源的直接通信,获取需要的数据,从而降低了区块链节点访问链外数据的复杂性。According to the data acquisition method, device, device, and computer storage medium of the embodiments of the present application, the blockchain node can construct a data query request based on the acquired data query information through a smart contract, and can directly send out-of-chain requests related to the data query information. The data source sends a data query request to obtain the data query result. It does not need to establish a separate oracle client or oracle network, but obtain the required data through direct communication between the blockchain node and the off-chain data source, thereby reducing the cost of The complexity of blockchain nodes accessing off-chain data.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单地介绍,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings that need to be used in the embodiments of the present application. For those of ordinary skill in the art, without creative work, the Additional drawings can be obtained from these drawings.
图1是本申请提供的数据获取系统的一示例的架构图;1 is an architecture diagram of an example of a data acquisition system provided by the present application;
图2是本申请提供的数据获取方法的一实施例的流程示意图;2 is a schematic flowchart of an embodiment of a data acquisition method provided by the present application;
图3是本申请提供的数据获取方法的另一实施例的流程示意图;3 is a schematic flowchart of another embodiment of the data acquisition method provided by the present application;
图4是本申请提供的数据获取方法的又一实施例的流程示意图;4 is a schematic flowchart of another embodiment of a data acquisition method provided by the present application;
图5是本申请提供的数据获取方法的再一实施例的流程示意图;5 is a schematic flowchart of still another embodiment of a data acquisition method provided by the present application;
图6是本申请提供的数据获取装置的一实施例的结构示意图;6 is a schematic structural diagram of an embodiment of a data acquisition device provided by the present application;
图7是本申请提供的数据获取装置的另一实施例的结构示意图;7 is a schematic structural diagram of another embodiment of a data acquisition device provided by the present application;
图8是本申请提供的数据获取设备的一实施例的硬件结构示意图。FIG. 8 is a schematic diagram of a hardware structure of an embodiment of a data acquisition device provided by the present application.
具体实施方式detailed description
下面将详细描述本申请的各个方面的特征和示例性实施例,为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细描述。应理解,此处所描述的具体实施例仅被配置 为解释本申请,并不被配置为限定本申请。对于本领域技术人员来说,本申请可以在不需要这些具体细节中的一些细节的情况下实施。下面对实施例的描述仅仅是为了通过示出本申请的示例来提供对本申请更好的理解。The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present application, and are not configured to limit the present application. It will be apparent to those skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present application by illustrating examples of the present application.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any relationship between these entities or operations. any such actual relationship or sequence exists. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element defined by the phrase "comprises" does not preclude the presence of additional identical elements in a process, method, article, or device that includes the element.
为了更好的理解本申请,下面将结合附图,详细描述本申请实施例提供的数据获取方法、装置和系统,应注意,这些实施例并不是用来限制本申请公开的范围。For a better understanding of the present application, the data acquisition method, device and system provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that these embodiments are not intended to limit the scope of the disclosure of the present application.
预言机就是一个能将链外数据真实输入到区块链内,保障区块链链上数据真实性的工具。目前,预言机等技术正快速引起技术和产业各方的注意,其中,预言机技术打通链内和链外空间,能极大程度上为区块链赋能,促进区块链各个方面的落地。但是,目前,区块链节点若想要访问链外数据,需要在链外单独部署预言机客户端或者预言机网络,复杂度较高。An oracle is a tool that can truly input off-chain data into the blockchain and ensure the authenticity of the data on the blockchain. At present, technologies such as oracles are rapidly attracting the attention of all parties in the technology and industry. Among them, the oracle technology opens up the space inside and outside the chain, which can greatly empower the blockchain and promote the implementation of all aspects of the blockchain. . However, at present, if blockchain nodes want to access off-chain data, they need to deploy the oracle client or oracle network separately outside the chain, which is highly complex.
基于此,本申请提供的数据获取方法、装置、设备和介质,通过直接建立区块链节点和链外数据源之间的通信,减少了区块链节点从链外获取数据的复杂度。下面结合附图和实施例进行详细介绍。Based on this, the data acquisition method, device, device and medium provided by this application reduce the complexity of the blockchain node acquiring data from outside the chain by directly establishing the communication between the blockchain node and the data source outside the chain. The following describes in detail with reference to the accompanying drawings and embodiments.
图1是本申请提供的数据获取系统的一示例的架构图。如图1所示,本申请提供的数据获取系统包括客户端11、区块链节点12和链外数据源13。FIG. 1 is an architecture diagram of an example of a data acquisition system provided by the present application. As shown in FIG. 1 , the data acquisition system provided by this application includes a client 11 , a blockchain node 12 and an off-chain data source 13 .
在本申请的实施例,客户端11发送数据查询信息至区块链节点12。在一些实施例中,数据查询信息可以包括需要查询的数据在链外数据源13 中的查询索引。区块链节点12接收数据查询信息后,基于获取的数据查询信息,通过智能合约构建数据查询请求。其中,数据查询请求携带有数据查询信息。区块链节点12直接向与数据查询信息关联的链外数据源13发送数据查询请求。链外数据源13接收区块链节点12发送的数据查询请求。链外数据源13基于接收的数据查询请求进行查询,得到数据查询结果。链外数据源13向区块链节点12发送数据查询结果,实现区块链节点12从链外读取数据。In the embodiment of the present application, the client 11 sends data query information to the blockchain node 12 . In some embodiments, the data query information may include the query index of the data to be queried in the off-chain data source 13 . After receiving the data query information, the blockchain node 12 constructs a data query request through a smart contract based on the obtained data query information. The data query request carries data query information. The blockchain node 12 directly sends a data query request to the off-chain data source 13 associated with the data query information. The off-chain data source 13 receives the data query request sent by the blockchain node 12 . The off-chain data source 13 performs a query based on the received data query request to obtain a data query result. The off-chain data source 13 sends the data query result to the blockchain node 12, so that the blockchain node 12 can read data from outside the chain.
在本申请的实施例中,链外数据源13可以为提供链外数据的服务器。In the embodiment of the present application, the off-chain data source 13 may be a server that provides off-chain data.
在本申请的实施例中,区块链节点12能够通过智能合约,基于获取的数据查询信息构建数据查询请求,并可以直接向与数据查询信息关联的链外数据源13发送数据查询请求,以获取数据查询结果,不需要单独建立预言机客户端11或者预言机网络,而是通过区块链节点12与链外数据源13的直接通信,获取需要的数据,从而降低了区块链节点12访问链外数据的复杂性。In the embodiment of the present application, the blockchain node 12 can construct a data query request based on the acquired data query information through a smart contract, and can directly send the data query request to the off-chain data source 13 associated with the data query information to To obtain the data query results, it is not necessary to establish the oracle client 11 or the oracle network separately, but to obtain the required data through the direct communication between the blockchain node 12 and the off-chain data source 13, thereby reducing the number of blockchain nodes 12. The complexity of accessing off-chain data.
图2是本申请提供的数据获取方法的一实施例的流程示意图。本申请提供的数据获取方法200可以由图1中所示的区块链节点12执行。FIG. 2 is a schematic flowchart of an embodiment of a data acquisition method provided by the present application. The data acquisition method 200 provided in this application may be executed by the blockchain node 12 shown in FIG. 1 .
如图2所示,该数据获取方法200包括如下步骤:As shown in Figure 2, the data acquisition method 200 includes the following steps:
步骤210,基于获取的数据查询信息,通过智能合约构建数据查询请求,数据查询请求携带有数据查询信息; Step 210, based on the acquired data query information, construct a data query request through a smart contract, and the data query request carries the data query information;
步骤220,直接向与数据查询信息关联的链外数据源发送数据查询请求,以使链外数据源基于数据查询请求得到数据查询结果; Step 220, directly sending a data query request to an off-chain data source associated with the data query information, so that the off-chain data source obtains a data query result based on the data query request;
步骤230,接收链外数据源发送的数据查询结果。Step 230: Receive the data query result sent by the data source outside the chain.
在本申请的实施例中,区块链节点12能够通过智能合约,基于获取的数据查询信息构建数据查询请求,并可以直接向与数据查询信息关联的链外数据源13发送数据查询请求,以获取数据查询结果,不需要单独建立预言机客户端11或者预言机网络,而是通过区块链节点12与链外数据源13的直接通信,获取需要的数据,从而降低了区块链节点12访问链外数据的复杂性。In the embodiment of the present application, the blockchain node 12 can construct a data query request based on the acquired data query information through a smart contract, and can directly send the data query request to the off-chain data source 13 associated with the data query information to To obtain the data query results, it is not necessary to establish the oracle client 11 or the oracle network separately, but to obtain the required data through the direct communication between the blockchain node 12 and the off-chain data source 13, thereby reducing the number of blockchain nodes 12. The complexity of accessing off-chain data.
下面分别对步骤210~步骤230的具体实现方式进行介绍。The specific implementation manners of steps 210 to 230 are respectively introduced below.
涉及步骤210,在一些实施例中,数据查询信息包括在链外数据源13中的查询索引。例如,查询索引包括查询条件或在链外数据源13的存储地址。Referring to step 210 , in some embodiments, the data query information includes a query index in the off-chain data source 13 . For example, the query index includes the query condition or the storage address of the data source 13 outside the chain.
在本申请的实施例中,由于数据查询信息包括在链外数据源13中的查询索引,因此可以直接向链外数据源13发送通过该数据查询信息构建的数据查询请求,从而实现链外数据源13和区块链节点12之间的直接通信。In the embodiment of the present application, since the data query information includes the query index in the off-chain data source 13, the data query request constructed by the data query information can be directly sent to the off-chain data source 13, so as to realize the off-chain data Direct communication between source 13 and blockchain node 12.
在一些实施例中,区块链节点12可以在线进行模型训练,因此需要训练样本数据。但是,若将训练样本数据存储在区块链节点12中,则会占用大量的存储空间,而且也会为数据安全留下隐患。因此,可以预先将训练数据存储在链外数据源13中。在需要进行模型训练时,区块链节点12可以响应于客户端11发送的数据查询信息,从链外数据源13查询训练数据。在一些实施例中,客户端11可以预先获取每个训练数据在链外数据源13中的存储地址,并将该存储地址作为数据查询信息。In some embodiments, the blockchain nodes 12 can perform model training online, thus requiring training sample data. However, if the training sample data is stored in the blockchain node 12, it will take up a lot of storage space, and it will also leave hidden dangers for data security. Therefore, the training data can be stored in the off-chain data source 13 in advance. When model training is required, the blockchain node 12 can query the training data from the off-chain data source 13 in response to the data query information sent by the client 11 . In some embodiments, the client 11 may obtain the storage address of each training data in the off-chain data source 13 in advance, and use the storage address as data query information.
在本申请的一些实施例中,由于训练数据是预先采集的数据,因此,基于客户端11上传的训练数据的存储地址查询的是可信数据。In some embodiments of the present application, since the training data is pre-collected data, trusted data is queried based on the storage address of the training data uploaded by the client 11 .
在一些实施例中,链外数据源13可按照超文本传输安全协议(Hyper Text Transfer Protocol over SecureSocket Layer,HTTPS)的方式提供数据访问服务。因此,通过智能合约可以基于数据查询请求中的存储地址构建数据查询请求,该数据查询请求可以是一个携带该存储地址的HTTPS请求地址。In some embodiments, the off-chain data source 13 may provide data access services in the manner of Hyper Text Transfer Protocol over SecureSocket Layer (HTTPS). Therefore, a data query request can be constructed based on the storage address in the data query request through a smart contract, and the data query request can be an HTTPS request address carrying the storage address.
在另一些实施例中,假设智能合约需要根据目标数据触发下一步的动作,但是通过客户端11直接发送目标数据可能是不可信的。例如,智能合约需要根据支付结果触发下一步的动作,但是通过交易发送者直接发送的支付结果是不可信的,而链外数据源13的数据才是较为可信的。因此,数据查询信息包括在链外数据源13的查询条件。例如,数据查询信息包括支付流水号,即,查询条件为支付流水号。In other embodiments, it is assumed that the smart contract needs to trigger the next action according to the target data, but sending the target data directly through the client 11 may not be trusted. For example, the smart contract needs to trigger the next action according to the payment result, but the payment result directly sent by the transaction sender is not credible, while the data from the off-chain data source 13 is more credible. Therefore, the data query information includes the query conditions of the data source 13 outside the chain. For example, the data query information includes the payment serial number, that is, the query condition is the payment serial number.
在本申请的一些实施例中,若查询索引包括查询条件,则步骤210包括:基于获取的查询条件和预先存储的链外数据源13的查询地址,通过智能合约构建数据查询请求。In some embodiments of the present application, if the query index includes query conditions, step 210 includes: constructing a data query request through a smart contract based on the obtained query conditions and the pre-stored query address of the off-chain data source 13 .
在本申请的实施例中,若需要从链外数据源13查询可信数据,且查询索引是需要查询的数据的查询条件的情况下,还需要获取链外数据源13的查询地址,才能实现链外数据的查询。In the embodiment of the present application, if the trusted data needs to be queried from the off-chain data source 13, and the query index is the query condition of the data to be queried, the query address of the off-chain data source 13 needs to be obtained to realize the Query of off-chain data.
在一些实施例中,若需要查询银行支付结果,则链外数据源13的查询地址可以为预先在区块链节点12中登记的银行支付结果查询地址。则智能合约可以基于接收的支付流水账号以及预先登记的银行支付结果查询地址构建数据查询请求。In some embodiments, if the bank payment result needs to be inquired, the inquiry address of the off-chain data source 13 may be the bank payment result inquiry address pre-registered in the blockchain node 12 . The smart contract can construct a data query request based on the received payment account and the pre-registered bank payment result query address.
在本申请的另一些实施例中,数据查询信息还包括查询授权签名。其中,查询授权签名用于链外数据源13在对查询授权签名验证通过的情况下,基于数据查询请求得到数据查询结果。In other embodiments of the present application, the data query information further includes a query authorization signature. The query authorization signature is used for obtaining the data query result based on the data query request when the off-chain data source 13 passes the verification of the query authorization signature.
在本申请的实施例中,客户端11可以基于预先从链外数据源13获取的公私秘钥对数据查询信息进行签名,则可以得到查询授权签名。In the embodiment of the present application, the client 11 can sign the data query information based on the public and private keys obtained from the off-chain data source 13 in advance, and then the query authorization signature can be obtained.
在本申请的实施例中,数据查询信息中包括的查询授权签名是为了链外数据源13进行验证。只有当链外数据源13在对查询授权签名验证通过的情况下,才会基于数据查询请求进行查询,可以提高数据查询的安全性。In the embodiment of the present application, the query authorization signature included in the data query information is for verification by the off-chain data source 13 . Only when the off-chain data source 13 passes the verification of the query authorization signature, will the query be performed based on the data query request, which can improve the security of the data query.
需要说明的是,若数据查询信息包括在链外数据源13中的查询索引和查询授权签名,则智能合约则会基于查询索引和查询授权签名构建数据查询请求。It should be noted that, if the data query information includes the query index and the query authorization signature in the off-chain data source 13, the smart contract will construct a data query request based on the query index and the query authorization signature.
作为一些示例,若查询索引包括在链外数据源13中的存储地址,则智能合约可以在基于该存储地址生成的HTTPS请求地址中携带查询授权签名。As some examples, if the query index includes a storage address in the off-chain data source 13, the smart contract may carry a query authorization signature in the HTTPS request address generated based on the storage address.
下面介绍步骤220的具体实现方式。The specific implementation manner of step 220 is described below.
在步骤210中,数据查询信息包括在链外数据源13中的查询索引。即数据查询信息自身即为与链外数据源13相关的信息。因此,通过数据查询信息则可以获取需要发送数据查询请求的链外数据源13。In step 210 , the data query information is included in the query index in the off-chain data source 13 . That is, the data query information itself is the information related to the off-chain data source 13 . Therefore, through the data query information, the off-chain data source 13 that needs to send the data query request can be obtained.
作为一些示例,若数据查询信息包括在链外数据源13的存储地址,则基于该数据查询信息可以获取与该信息关联的链外数据源13。As some examples, if the data query information includes the storage address of the off-chain data source 13, the off-chain data source 13 associated with the information can be acquired based on the data query information.
作为另外一些示例,若数据查询信息包括查询条件,则基于与该查询条件关联的预先登记的查询地址,则可以获取链外数据源13的地址。As another example, if the data query information includes a query condition, then based on the pre-registered query address associated with the query condition, the address of the off-chain data source 13 can be obtained.
当获取数据查询请求之后,区块链节点12可以直接向与数据查询信息关联的链外数据源13发送数据查询请求。After acquiring the data query request, the blockchain node 12 may directly send the data query request to the off-chain data source 13 associated with the data query information.
涉及步骤230,当链外数据源13基于数据查询请求得到数据查询结果之后,可以向区块链节点12发送数据查询结果。区块链节点12可以接收链外数据源13发送的数据查询结果,从而实现了区块链读取链外数据。Involving step 230, after the off-chain data source 13 obtains the data query result based on the data query request, it can send the data query result to the blockchain node 12. The blockchain node 12 can receive the data query result sent by the off-chain data source 13, so that the blockchain can read off-chain data.
在本申请的一些实施例中,在步骤220之前,本申请提供的数据获取方法300还包括:接收客户端发送的数据查询信息。In some embodiments of the present application, before step 220, the data acquisition method 300 provided by the present application further includes: receiving data query information sent by the client.
在本申请的一些实施例中,区块链平台可以为Hyperledger Fabric。则客户端11可以调Fabric SDK将数据查询信息发送到区块链节点12。In some embodiments of the present application, the blockchain platform may be Hyperledger Fabric. Then the client 11 can adjust the Fabric SDK to send the data query information to the blockchain node 12.
需要说明的是,区块链节点12可以根据智能合约中的规则,可以在获取一个数据查询信息之后,立刻构建数据查询请求进行查询数据,还可以在获取一定数量的数据查询信息之后,再向链外数据源13查询数据。例如,若要进行在线模型训练,则需要一定量的训练数据。因此,可以在获取一定量的训练数据的数据查询信息之后,再统一向链外数据源13进行查询。It should be noted that, according to the rules in the smart contract, the blockchain node 12 can construct a data query request to query data immediately after obtaining a data query information, and can also send a certain amount of data query information to the data query information. The off-chain data source 13 queries the data. For example, online model training requires a certain amount of training data. Therefore, after a certain amount of data query information of the training data is acquired, the off-chain data source 13 can be queried uniformly.
在本申请的一些实施例中,为了提高查询数据的安全性,在步骤220之前,本申请提供的数据获取方法200还包括:对数据查询请求进行加密,得到加密后的数据查询请求;在此基础上,步骤220包括:直接向与数据查询信息关联的链外数据源发送加密后的数据查询请求。In some embodiments of the present application, in order to improve the security of the query data, before step 220, the data acquisition method 200 provided by the present application further includes: encrypting the data query request to obtain the encrypted data query request; here Basically, step 220 includes: directly sending an encrypted data query request to an off-chain data source associated with the data query information.
在本申请的实施例中,通过对数据查询请求进行加密,可以防止数据被攻击,提高数据的安全性。In the embodiment of the present application, by encrypting the data query request, the data can be prevented from being attacked, and the security of the data can be improved.
在一些实施例中,可以通过安全传输层协议加密通信通道,直接向与数据查询信息关联的链外数据源发送加密后的数据查询请求。In some embodiments, the encrypted communication channel may be encrypted by using a secure transport layer protocol, and the encrypted data query request may be sent directly to the off-chain data source associated with the data query information.
在本申请的实施例中,安全传输层协议用于在两个通信应用程序之间提供保密性和数据完整性。安全传输层协议安全强度高、计算量小且加解 密速度快、效率高,因此,在提高数据安全性的同时还可以提高数据查询效率。In embodiments of the present application, a secure transport layer protocol is used to provide confidentiality and data integrity between two communication applications. The secure transport layer protocol has high security strength, small calculation amount, fast encryption and decryption speed, and high efficiency. Therefore, it can improve data security and data query efficiency at the same time.
在本申请的一些实施例中,为了进一步提高数据的安全性,数据查询信息还包括需要查询的目标数据的数据指纹。其中,目标数据的数据指纹是利用预设哈希算法对目标数据哈希之后得到的数据。在此基础上,本申请提供的数据获取方法200还包括:通过智能合约,利用预设哈希算法对数据查询结果进行哈希,得到数据查询结果的数据指纹;在通过智能合约确定目标数据的数据指纹和数据查询结果的数据指纹一致的情况下,通过智能合约对数据查询结果执行预设处理。In some embodiments of the present application, in order to further improve data security, the data query information further includes a data fingerprint of the target data to be queried. The data fingerprint of the target data is data obtained after hashing the target data by using a preset hashing algorithm. On this basis, the data acquisition method 200 provided by the present application further includes: hashing the data query result by using a preset hash algorithm through a smart contract to obtain a data fingerprint of the data query result; If the data fingerprint and the data fingerprint of the data query result are consistent, the smart contract will execute the preset processing on the data query result.
在本申请的实施例中,目标数据可以为链外数据源13中存储的任一数据。客户端11可以利用预设哈希算法对链外数据源13中存储的数据进行哈希,得到该数据的数据指纹。然后客户端11将目标数据的数据指纹发送至区块链节点12。In the embodiment of the present application, the target data may be any data stored in the off-chain data source 13 . The client 11 can use a preset hash algorithm to hash the data stored in the off-chain data source 13 to obtain a data fingerprint of the data. The client 11 then sends the data fingerprint of the target data to the blockchain node 12 .
在本申请的实施例中,通过验证目标数据的数据指纹和数据查询结果的数据指纹是否一致,可以确定需要查询的数据是否正确,提高了数据查询的准确性。In the embodiment of the present application, by verifying whether the data fingerprint of the target data is consistent with the data fingerprint of the data query result, it can be determined whether the data to be queried is correct, and the accuracy of the data query is improved.
在本申请的实施例中,预设处理与智能合约中预先定义的处理规则有关。例如,预设处理可以为开始模型训练。In the embodiment of the present application, the preset processing is related to the processing rules predefined in the smart contract. For example, the preset process may be to start model training.
在本申请的一些实施例中,数据查询结果为加密后的数据查询结果,在步骤230之后,本申请提供的数据获取方法200还包括:对加密后的数据查询结果进行解密,得到数据查询结果。In some embodiments of the present application, the data query result is an encrypted data query result. After step 230, the data acquisition method 200 provided by the present application further includes: decrypting the encrypted data query result to obtain the data query result .
在本申请的实施例中,若为了提高数据的安全性,链外数据源13对数据查询结果进行加密,则链外数据源13发送给区块链节点12的数据查询结果是加密后的数据查询结果。则区块链节点12可以利用与加密算法对应的解密算法对加密后的数据查询结果进行解密,以得到最终的数据查询结果。In the embodiment of the present application, if the off-chain data source 13 encrypts the data query result in order to improve data security, the data query result sent by the off-chain data source 13 to the blockchain node 12 is the encrypted data search result. Then, the blockchain node 12 can use the decryption algorithm corresponding to the encryption algorithm to decrypt the encrypted data query result to obtain the final data query result.
在本申请的实施例中,由于链外数据源13发送至区块链节点12的是加密后的数据查询结果,因此,可以防止外来攻击,提高数据查询结果的安全性。In the embodiment of the present application, since the off-chain data source 13 sends the encrypted data query result to the blockchain node 12, external attacks can be prevented and the security of the data query result can be improved.
图3是本申请提供的数据获取方法的另一实施例的流程示意图。本申请提供的数据获取方法300可以由图1中所示的链外数据源13执行。FIG. 3 is a schematic flowchart of another embodiment of the data acquisition method provided by the present application. The data acquisition method 300 provided by this application may be executed by the off-chain data source 13 shown in FIG. 1 .
如图3所示,该数据获取方法300包括如下步骤:As shown in Figure 3, the data acquisition method 300 includes the following steps:
步骤310,接收区块链节点发送的数据查询请求,数据查询请求是区块链节点基于获取的数据查询信息,通过智能合约构建的,数据查询请求携带有数据查询信息;Step 310: Receive a data query request sent by the blockchain node, the data query request is constructed by the blockchain node based on the acquired data query information and constructed through a smart contract, and the data query request carries the data query information;
步骤320,基于数据查询请求,得到数据查询结果; Step 320, based on the data query request, obtain a data query result;
步骤330,向区块链节点发送数据查询结果。Step 330: Send the data query result to the blockchain node.
在本申请的实施例中,链外数据源基于数据查询请求中的信息,可以从自身存储的数据进行查询,查询到与数据查询请求对应的数据查询结果。In the embodiment of the present application, the off-chain data source can query the data stored by itself based on the information in the data query request, and obtain the data query result corresponding to the data query request.
在本申请的实施例中,区块链节点12能够通过智能合约,基于获取的数据查询信息构建数据查询请求,并可以直接向与数据查询信息关联的链外数据源13发送数据查询请求,以获取数据查询结果,不需要单独建立预言机客户端11或者预言机网络,而是通过区块链节点12与链外数据源13的直接通信,获取需要的数据,从而降低了区块链节点12访问链外数据的复杂性。In the embodiment of the present application, the blockchain node 12 can construct a data query request based on the acquired data query information through a smart contract, and can directly send the data query request to the off-chain data source 13 associated with the data query information to To obtain the data query results, it is not necessary to establish the oracle client 11 or the oracle network separately, but to obtain the required data through the direct communication between the blockchain node 12 and the off-chain data source 13, thereby reducing the number of blockchain nodes 12. The complexity of accessing off-chain data.
在本申请的一些实施例中,参考图2中数据获取方法200的相关叙述,图3中的数据获取方法300中,数据查询信息可以包括在链外数据源13中的查询索引和查询授权签名,在此基础上,步骤320包括:在对数据查询请求中携带的查询授权签名验证通过的情况下,基于数据查询请求中携带的查询索引,得到与查询索引匹配的数据查询结果。In some embodiments of the present application, referring to the relevant description of the data acquisition method 200 in FIG. 2 , in the data acquisition method 300 in FIG. 3 , the data query information may include the query index and the query authorization signature in the off-chain data source 13 , and on this basis, step 320 includes: obtaining a data query result matching the query index based on the query index carried in the data query request under the condition that the query authorization signature carried in the data query request passes the verification.
在本申请的实施例中,通过对查询授权签名进行验证,可以提高数据查询的安全性。In the embodiments of the present application, the security of data query can be improved by verifying the query authorization signature.
在一些实施例中,对数据查询请求中携带的查询授权签名验证通过,包括:确定查询授权签名在预设有效期内,和/或,携带有查询授权签名的数据请求的请求次数小于预设次数阈值。In some embodiments, the verification of the query authorization signature carried in the data query request includes: determining that the query authorization signature is within a preset validity period, and/or, the number of requests for the data request carrying the query authorization signature is less than the preset number of times threshold.
在一些实施例中,可以为查询授权签名预先设定有效期,若查询授权签名在预设有效期内,则确定查询授权签名验证通过。若查询授权签名不在预设有效期内,则确定查询授权签名验证不通过。In some embodiments, a validity period may be preset for the query authorization signature, and if the query authorization signature is within the preset validity period, it is determined that the query authorization signature has passed the verification. If the query authorization signature is not within the preset validity period, it is determined that the query authorization signature verification fails.
在另一些实施例中,若携带有查询授权签名的数据请求的请求次数小于预设次数阈值,则确定查询授权签名验证通过。若携带有查询授权签名的数据请求的请求次数大于或等于预设次数阈值,则确定查询授权签名验证不通过。In other embodiments, if the number of requests for the data request carrying the query authorization signature is less than the preset number of times threshold, it is determined that the query authorization signature is verified as passed. If the number of requests of the data request carrying the query authorization signature is greater than or equal to the preset number of times threshold, it is determined that the query authorization signature verification fails.
在又一些实施例中,也可以综合查询授权签名在预设有效期内,以及,携带有查询授权签名的数据请求的请求次数小于预设次数阈值对查询授权签名进行验证。In still other embodiments, the query authorization signature may also be verified comprehensively if the query authorization signature is within the preset validity period, and the number of requests for data requests carrying the query authorization signature is less than the preset number of times threshold.
在本申请的一些实施例中,在步骤330之前,本申请提供的数据获取方法300还包括:对数据查询结果进行加密,得到加密后的数据查询结果;其中,步骤330包括:向区块链节点发送加密后的数据查询结果。In some embodiments of the present application, before step 330, the data acquisition method 300 provided by the present application further includes: encrypting the data query result to obtain the encrypted data query result; wherein, step 330 includes: sending the data to the blockchain The node sends the encrypted data query result.
在本申请的实施例中,若为了提高数据的安全性,链外数据源13对数据查询结果进行加密。区块链节点12可以利用与加密算法对应的解密算法对加密后的数据查询结果进行解密,以得到最终的数据查询结果。In the embodiment of the present application, in order to improve the security of the data, the off-chain data source 13 encrypts the data query result. The blockchain node 12 can decrypt the encrypted data query result by using the decryption algorithm corresponding to the encryption algorithm to obtain the final data query result.
在一些示例中,可以通过安全传输层协议加密通信通道,向区块链节点12发送加密后的数据查询结果。In some examples, the encrypted data query result may be sent to the blockchain node 12 through a secure transport layer protocol encrypted communication channel.
在本申请的实施例中,安全传输层协议安全强度高、计算量小且加解密速度快、效率高,因此在提高数据安全性的同时,还可以提高数据查询效率。In the embodiment of the present application, the secure transport layer protocol has high security strength, small computational load, fast encryption and decryption speed, and high efficiency. Therefore, while data security is improved, data query efficiency can also be improved.
图4是本申请提供的数据获取方法的又一实施例的流程示意图。如图4所示,本申请提供的数据获取方法应用于从链下获取训练数据的应用场景中。FIG. 4 is a schematic flowchart of another embodiment of the data acquisition method provided by the present application. As shown in FIG. 4 , the data acquisition method provided by the present application is applied to the application scenario of acquiring training data from off-chain.
在使用智能合约实现在线训练模型的场景下,如果将训练数据以交易的形式发送给至区块链节点,则会使用大量的区块存储。因此,为了减少数据存储量以及减少从链外获取数据的复杂度,可以使用本申请提供的数据获取方法。In the scenario of using smart contracts to implement online training models, if training data is sent to blockchain nodes in the form of transactions, a large amount of block storage will be used. Therefore, in order to reduce the amount of data storage and the complexity of acquiring data from outside the chain, the data acquisition method provided in this application can be used.
在本申请的一些实施例中,可以在链外开发一个数据源服务,即链外 数据源,该链外数据源以HTTPS的方式提供数据访问服务。区块链平台以Hyperledger Fabric为例,用链码实现在线训练模型的算法,部署在区块链上。In some embodiments of the present application, a data source service may be developed outside the chain, that is, an off-chain data source, and the off-chain data source provides a data access service in the form of HTTPS. The blockchain platform takes Hyperledger Fabric as an example, and uses chain code to implement the algorithm of online training model and deploy it on the blockchain.
步骤401,客户端预先组建数据查询信息。其中,数据查询信息包括训练数据的数据指纹、训练数据在链外数据源中的存储地址以及查询授权签名。Step 401, the client pre-assembles data query information. The data query information includes the data fingerprint of the training data, the storage address of the training data in the off-chain data source, and the query authorization signature.
客户端利用预设哈希算法对每个训练数据哈希,得到每个训练数据的数据指纹。客户端可以从链外数据源预先获取训练数据在链外数据源中的存储地址。客户端利用从来链外数据源获取的授权秘钥对数据查询信息进行授权签名,得到查询授权签名。The client uses a preset hash algorithm to hash each training data to obtain the data fingerprint of each training data. The client can obtain the storage address of the training data in the off-chain data source in advance from the off-chain data source. The client uses the authorization key obtained from the data source outside the chain to authorize the signature of the data query information, and obtain the query authorization signature.
步骤402,客户端调用Fabric SDK向区块链节点发送数据查询信息(也可称之为交易)。Step 402, the client invokes the Fabric SDK to send data query information (also referred to as a transaction) to the blockchain node.
步骤403,区块链节点接收数据查询信息。Step 403, the blockchain node receives the data query information.
步骤404,区块链节点中的智能合约读取数据查询信息,并基于数据查询信息构建数据查询请求。Step 404, the smart contract in the blockchain node reads the data query information, and constructs a data query request based on the data query information.
步骤405,区块链节点通过安全传输层协议加密通信通道向链外数据源发送数据查询请求,该请求带有查询授权签名。Step 405 , the blockchain node sends a data query request to the off-chain data source through the secure transport layer protocol encrypted communication channel, and the request carries a query authorization signature.
步骤406,链外数据源接收数据查询请求。Step 406, the off-chain data source receives the data query request.
步骤407,当链外数据源接收到数据查询请求之后,对查询授权签名进行验证。Step 407 , after the data query request is received by the off-chain data source, the query authorization signature is verified.
步骤408,若链外数据源对查询授权签名验证通过,则基于数据查询请求得到数据查询结果。Step 408, if the off-chain data source passes the verification of the query authorization signature, a data query result is obtained based on the data query request.
步骤409,链外数据源对数据查询结果进行加密,得到加密后的数据查询结果。In step 409, the off-chain data source encrypts the data query result to obtain the encrypted data query result.
步骤410,通过安全传输层协议加密通信通道,直接向区块链节点发送加密后的数据查询结果。Step 410 , encrypt the communication channel through the secure transport layer protocol, and directly send the encrypted data query result to the blockchain node.
步骤411,区块链节点接收加密后的数据查询结果。Step 411, the blockchain node receives the encrypted data query result.
步骤412,区块链节点对加密后的数据查询结果进行解密,得到数据查询结果。Step 412, the blockchain node decrypts the encrypted data query result to obtain the data query result.
步骤413,区块链节点中的智能合约可以调用数据查询结果,并对数据查询结果进行哈希,得到数据查询结果的数据指纹。In step 413, the smart contract in the blockchain node can call the data query result, and hash the data query result to obtain a data fingerprint of the data query result.
步骤414,区块链节点中的智能合约判断数据查询信息中需要查询的训练数据的数据指纹是否与数据查询结果的数据指纹的一致。Step 414, the smart contract in the blockchain node determines whether the data fingerprint of the training data to be queried in the data query information is consistent with the data fingerprint of the data query result.
步骤415,若数据查询信息中需要查询的训练数据的数据指纹是否与数据查询结果的数据指纹一致,则智能合约利用数据查询结果进行模型训练。Step 415, if the data fingerprint of the training data to be queried in the data query information is consistent with the data fingerprint of the data query result, the smart contract uses the data query result to perform model training.
步骤416,若数据查询信息中需要查询的训练数据的数据指纹是否与数据查询结果的数据指纹的不一致,则向客户端返回查询失败的反馈信息。Step 416 , if the data fingerprint of the training data to be queried in the data query information is inconsistent with the data fingerprint of the data query result, return the query failure feedback information to the client.
图5是本申请提供的数据获取方法的再一实施例的流程示意图。如图5所示,本申请提供的数据获取方法应用于基于银行查询接口查询支付结果的应用场景中。FIG. 5 is a schematic flowchart of still another embodiment of the data acquisition method provided by the present application. As shown in FIG. 5 , the data acquisition method provided by the present application is applied to an application scenario of querying payment results based on a bank query interface.
在区块链上有一个智能合约,需要根据支付结果出发下一步的动作的场景下,为了提高数据的可靠性,可以从链外的银行的支付结果数据库中进行查询。为了减少从链外获取支付结果的复杂度,可以使用本申请提供的数据获取方法。In the scenario where there is a smart contract on the blockchain and the next action needs to be initiated according to the payment result, in order to improve the reliability of the data, it can be queried from the payment result database of the bank outside the chain. In order to reduce the complexity of acquiring payment results from outside the chain, the data acquisition method provided in this application can be used.
在本申请的一些实施例中,在区块链上部署智能合约时,将银行的支付结果查询地址登记到区块链上,并获得合约参与方的认可。In some embodiments of the present application, when deploying a smart contract on the blockchain, the bank's payment result query address is registered on the blockchain and approved by the contract participants.
步骤501,客户端预先组建数据查询信息。其中,数据查询信息包括支付流水号以及查询授权签名。Step 501, the client pre-assembles data query information. The data query information includes the payment serial number and the query authorization signature.
步骤502,客户端向区块链节点发送数据查询信息。Step 502, the client sends data query information to the blockchain node.
步骤503,区块链节点接收数据查询信息。Step 503, the blockchain node receives the data query information.
步骤504,区块链节点中的智能合约读取数据查询信息,并基于支付流水号、查询授权签名以及预先登记的银行支付结果查询地址构建数据查询请求。Step 504, the smart contract in the blockchain node reads the data query information, and constructs a data query request based on the payment serial number, the query authorization signature and the pre-registered bank payment result query address.
步骤505,区块链节点通过安全传输层协议加密通信通道向链外数据源(即银行支付结果查询接口)发送数据查询请求,该请求带有查询授权签名。Step 505, the blockchain node sends a data query request to an off-chain data source (ie, a bank payment result query interface) through a secure transport layer protocol encrypted communication channel, and the request has a query authorization signature.
步骤506,链外数据源接收数据查询请求。Step 506, the off-chain data source receives the data query request.
步骤507,当链外数据源接收到数据查询请求之后,对查询授权签名进行验证。Step 507: After the data query request is received by the off-chain data source, the query authorization signature is verified.
步骤508,若链外数据源对查询授权签名验证通过,则查询与支付流水号对应的支付结果。Step 508, if the off-chain data source passes the verification of the query authorization signature, query the payment result corresponding to the payment serial number.
步骤509,链外数据源对支付结果进行加密,得到加密后的支付结果。Step 509, the off-chain data source encrypts the payment result to obtain the encrypted payment result.
步骤510,通过安全传输层协议加密通信通道,直接向区块链节点发送加密后的支付结果。Step 510, encrypt the communication channel through the secure transport layer protocol, and directly send the encrypted payment result to the blockchain node.
步骤511,区块链节点接收加密后的支付结果。Step 511, the blockchain node receives the encrypted payment result.
步骤512,区块链节点对加密后的支付结果进行解密,得到支付结果。Step 512, the blockchain node decrypts the encrypted payment result to obtain the payment result.
步骤513,区块链节点中的智能合约利用查询到的支付结果进行下一步处理。Step 513, the smart contract in the blockchain node uses the queried payment result to perform the next step.
图6是本申请提供的数据获取装置的一实施例的结构示意图。如图6所示,本申请提供的数据获取装置600包括:FIG. 6 is a schematic structural diagram of an embodiment of a data acquisition apparatus provided by the present application. As shown in FIG. 6, the data acquisition device 600 provided by the present application includes:
数据查询请求构建模块610,用于基于获取的数据查询信息,通过智能合约构建数据查询请求,数据查询请求携带有数据查询信息;The data query request construction module 610 is configured to construct a data query request through a smart contract based on the acquired data query information, and the data query request carries the data query information;
数据查询请求发送模块620,用于直接向与数据查询信息关联的链外数据源发送数据查询请求,以使链外数据源基于数据查询请求得到数据查询结果;a data query request sending module 620, configured to directly send a data query request to an off-chain data source associated with the data query information, so that the off-chain data source obtains a data query result based on the data query request;
数据查询结果接收模块630,用于接收链外数据源发送的数据查询结果。The data query result receiving module 630 is configured to receive the data query result sent by the data source outside the chain.
在本申请的实施例中,区块链节点12能够通过智能合约,基于获取的数据查询信息构建数据查询请求,并可以直接向与数据查询信息关联的链外数据源13发送数据查询请求,以获取数据查询结果,不需要单独建立预言机客户端11或者预言机网络,而是通过区块链节点12与链外数据源13的直接通信,获取需要的数据,从而降低了区块链节点12访问链外数据的复杂性。In the embodiment of the present application, the blockchain node 12 can construct a data query request based on the acquired data query information through a smart contract, and can directly send the data query request to the off-chain data source 13 associated with the data query information to To obtain the data query results, it is not necessary to establish the oracle client 11 or the oracle network separately, but to obtain the required data through the direct communication between the blockchain node 12 and the off-chain data source 13, thereby reducing the number of blockchain nodes 12. The complexity of accessing off-chain data.
在本申请的一些实施例中,数据查询信息包括在链外数据源13中的查询索引。In some embodiments of the present application, the data query information includes a query index in the off-chain data source 13 .
在本申请的一些实施例中,查询索引包括查询条件或在链外数据源13的存储地址。In some embodiments of the present application, the query index includes a query condition or a storage address of the data source 13 outside the chain.
在本申请的一些实施例中,若查询索引包括查询条件,数据查询请求构建模块610具体可以用于基于获取的查询条件和预先存储的链外数据源13的查询地址,通过智能合约构建数据查询请求。In some embodiments of the present application, if the query index includes query conditions, the data query request building module 610 can be specifically configured to construct a data query through a smart contract based on the obtained query conditions and the pre-stored query address of the off-chain data source 13 ask.
在本申请的一些实施例中,数据查询信息还包括查询授权签名,查询授权签名用于链外数据源13在对查询授权签名验证通过的情况下,基于数据查询请求得到数据查询结果。In some embodiments of the present application, the data query information further includes a query authorization signature, and the query authorization signature is used by the off-chain data source 13 to obtain a data query result based on the data query request when the query authorization signature is verified.
在本申请的一些实施例中,数据获取装置600还包括:In some embodiments of the present application, the data acquisition apparatus 600 further includes:
接收模块,用于接收客户端11发送的数据查询信息。The receiving module is used to receive the data query information sent by the client 11 .
在本申请的一些实施例中,数据获取装置600还包括:In some embodiments of the present application, the data acquisition apparatus 600 further includes:
第一加密模块,用于对数据查询请求进行加密,得到加密后的数据查询请求。The first encryption module is used for encrypting the data query request to obtain the encrypted data query request.
根据本申请的实施例,数据查询请求发送模块620具体用于:According to the embodiment of the present application, the data query request sending module 620 is specifically configured to:
直接向与数据查询信息关联的链外数据源13发送加密后的数据查询请求。The encrypted data query request is directly sent to the off-chain data source 13 associated with the data query information.
在本申请的一些实施例中,数据查询请求发送模块620具体用于:In some embodiments of the present application, the data query request sending module 620 is specifically configured to:
通过安全传输层协议加密通信通道,直接向与数据查询信息关联的链外数据源13发送加密后的数据查询请求。The encrypted communication channel is encrypted by the secure transport layer protocol, and the encrypted data query request is directly sent to the off-chain data source 13 associated with the data query information.
在本申请的一些实施例中,数据查询信息还包括需要查询的目标数据的数据指纹;目标数据的数据指纹是利用预设哈希算法对目标数据哈希之后得到的数据。In some embodiments of the present application, the data query information further includes a data fingerprint of the target data to be queried; the data fingerprint of the target data is data obtained after hashing the target data by using a preset hash algorithm.
根据本申请的实施例,数据获取装置600还包括:According to the embodiment of the present application, the data acquisition apparatus 600 further includes:
数据指纹确定模块,用于通过智能合约,利用预设哈希算法对数据查询结果进行哈希,得到数据查询结果的数据指纹;The data fingerprint determination module is used for hashing the data query result by using the preset hash algorithm through the smart contract to obtain the data fingerprint of the data query result;
处理模块,用于在通过智能合约确定目标数据的数据指纹和数据查询结果的数据指纹一致的情况下,通过智能合约对数据查询结果执行预设处理。The processing module is configured to perform preset processing on the data query result through the smart contract when the data fingerprint of the target data is determined to be consistent with the data fingerprint of the data query result through the smart contract.
在本申请的一些实施例中,数据查询结果为加密后的数据查询结果,数据获取装置600还包括:In some embodiments of the present application, the data query result is an encrypted data query result, and the data acquisition device 600 further includes:
解密模块,用于对加密后的数据查询结果进行解密,得到数据查询结果。The decryption module is used to decrypt the encrypted data query result to obtain the data query result.
本申请实施例的数据获取装置600的其他细节与以上结合图2描述的数据获取方法200类似,在此不再赘述。Other details of the data acquisition apparatus 600 in this embodiment of the present application are similar to the data acquisition method 200 described above with reference to FIG. 2 , and are not repeated here.
图7是本申请提供的数据获取装置的另一实施例的结构示意图。如图7所示,本申请提供的数据获取装置700包括:FIG. 7 is a schematic structural diagram of another embodiment of the data acquisition apparatus provided by the present application. As shown in FIG. 7 , the data acquisition device 700 provided by the present application includes:
数据查询请求接收模块710,用于接收区块链节点12发送的数据查询请求,数据查询请求是区块链节点12基于获取的数据查询信息,通过智能合约构建的,数据查询请求携带有数据查询信息;The data query request receiving module 710 is configured to receive a data query request sent by the blockchain node 12. The data query request is constructed by the blockchain node 12 based on the acquired data query information through a smart contract, and the data query request carries the data query. information;
数据查询结果确定模块720,用于基于数据查询请求,得到数据查询结果;a data query result determination module 720, configured to obtain a data query result based on the data query request;
数据查询结果发送模块730,用于向区块链节点12发送数据查询结果。The data query result sending module 730 is configured to send the data query result to the blockchain node 12 .
在本申请的实施例中,区块链节点12能够通过智能合约,基于获取的数据查询信息构建数据查询请求,并可以直接向与数据查询信息关联的链外数据源13发送数据查询请求,以获取数据查询结果,不需要单独建立预言机客户端11或者预言机网络,而是通过区块链节点12与链外数据源13的直接通信,获取需要的数据,从而降低了区块链节点12访问链外数据的复杂性。In the embodiment of the present application, the blockchain node 12 can construct a data query request based on the acquired data query information through a smart contract, and can directly send the data query request to the off-chain data source 13 associated with the data query information to To obtain the data query results, it is not necessary to establish the oracle client 11 or the oracle network separately, but to obtain the required data through the direct communication between the blockchain node 12 and the off-chain data source 13, thereby reducing the number of blockchain nodes 12. The complexity of accessing off-chain data.
在本申请的一些实施例中,数据查询信息包括在链外数据源13中的查询索引和查询授权签名。In some embodiments of the present application, the data query information includes a query index and a query authorization signature in the off-chain data source 13 .
根据本申请的实施例,数据查询结果确定模块720具体用于:According to the embodiment of the present application, the data query result determination module 720 is specifically configured to:
在对数据查询请求中携带的查询授权签名验证通过的情况下,基于数据查询请求中携带的查询索引,得到与查询索引匹配的数据查询结果。In the case where the verification of the query authorization signature carried in the data query request is passed, a data query result matching the query index is obtained based on the query index carried in the data query request.
在本申请的一些实施例中,对数据查询请求中携带的查询授权签名验证通过,包括:In some embodiments of the present application, the verification of the query authorization signature carried in the data query request is passed, including:
确定查询授权签名在预设有效期内,和/或,携带有查询授权签名的数据请求的请求次数小于预设次数阈值。It is determined that the query authorization signature is within the preset validity period, and/or the number of requests for data requests carrying the query authorization signature is less than the preset number of times threshold.
在本申请的一些实施例中,数据获取装置700还包括:In some embodiments of the present application, the data acquisition apparatus 700 further includes:
第二加密模块,用于对数据查询结果进行加密,得到加密后的数据查询结果。The second encryption module is used for encrypting the data query result to obtain the encrypted data query result.
根据本申请的实施例,数据查询结果发送模块730被配置用于:According to the embodiment of the present application, the data query result sending module 730 is configured to:
向区块链节点12发送加密后的数据查询结果。Send the encrypted data query result to the blockchain node 12.
在本申请的一些实施例中,数据查询结果发送模块730具体用于:In some embodiments of the present application, the data query result sending module 730 is specifically configured to:
通过安全传输层协议加密通信通道,向区块链节点12发送加密后的数据查询结果。The encrypted communication channel is encrypted by the secure transport layer protocol, and the encrypted data query result is sent to the blockchain node 12 .
根据本申请实施例的数据获取装置700的其他细节与以上结合图3描述的根据本申请实施例的数据获取方法300类似,在此不再赘述。Other details of the data acquisition apparatus 700 according to the embodiment of the present application are similar to the data acquisition method 300 according to the embodiment of the present application described above with reference to FIG. 3 , and are not repeated here.
结合图2至图5描述的根据本申请实施例的数据获取方法和装置可以由数据获取设备来实现。图8是本申请提供的数据获取设备的一实施例的硬件结构示意图。The data acquisition method and apparatus according to the embodiments of the present application described in conjunction with FIG. 2 to FIG. 5 may be implemented by a data acquisition device. FIG. 8 is a schematic diagram of a hardware structure of an embodiment of a data acquisition device provided by the present application.
数据获取设备800可以包括处理器801以及存储有计算机程序指令的存储器802。The data acquisition device 800 may include a processor 801 and a memory 802 storing computer program instructions.
具体地,上述处理器801可以包括中央处理器(CPU),或者特定集成电路(Application Specific Integrated Circuit,ASIC),或者可以被配置成实施本申请实施例的一个或多个集成电路。Specifically, the above-mentioned processor 801 may include a central processing unit (CPU), or a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
存储器802可以包括用于数据或指令的大容量存储器。举例来说而非限制,存储器802可包括硬盘驱动器(Hard Disk Drive,HDD)、软盘驱动器、闪存、光盘、磁光盘、磁带或通用串行总线(Universal Serial Bus,USB)驱动器或者两个或更多个以上这些的组合。在合适的情况下,存储器802可包括可移除或不可移除(或固定)的介质。在合适的情况下,存储器802可在数据获取设备800的内部或外部。在特定实施例中,存储器802是非易失性固态存储器。 Memory 802 may include mass storage for data or instructions. By way of example and not limitation, memory 802 may include a Hard Disk Drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a Universal Serial Bus (USB) drive or two or more A combination of more than one of the above. Memory 802 may include removable or non-removable (or fixed) media, where appropriate. Memory 802 may be internal or external to data acquisition device 800, where appropriate. In certain embodiments, memory 802 is non-volatile solid state memory.
在特定实施例中,存储器802包括只读存储器(ROM)。在合适的情况下,该ROM可以是掩模编程的ROM、可编程ROM(PROM)、可擦除PROM(EPROM)、电可擦除PROM(EEPROM)、电可改写ROM(EAROM)或闪存或者两个或更多个以上这些的组合。In certain embodiments, memory 802 includes read only memory (ROM). Where appropriate, the ROM may be a mask programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), electrically rewritable ROM (EAROM) or flash memory or A combination of two or more of the above.
存储器可包括只读存储器(ROM),随机存取存储器(RAM),磁盘存储介质设备,光存储介质设备,闪存设备,电气、光学或其他物理/有形的存储器存储设备。因此,通常,存储器包括一个或多个编码有包括计算机可执行指令的软件的有形(非暂态)计算机可读存储介质(例如,存储器设备),并且当该软件被执行(例如,由一个或多个处理器)时,其可操作来执行参考根据本公开的数据获取方法所描述的操作。Memory may include read only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical/tangible memory storage devices. Thus, typically, a memory includes one or more tangible (non-transitory) computer-readable storage media (eg, memory devices) encoded with software including computer-executable instructions, and when the software is executed (eg, by a or multiple processors), it is operable to perform the operations described with reference to the data acquisition method according to the present disclosure.
处理器801通过读取并执行存储器802中存储的计算机程序指令,以实现上述实施例中的任意一种数据获取方法。The processor 801 reads and executes the computer program instructions stored in the memory 802 to implement any one of the data acquisition methods in the foregoing embodiments.
在一个示例中,数据获取设备800还可包括通信接口803和总线810。其中,如图8所示,处理器801、存储器802、通信接口803通过总线810连接并完成相互间的通信。In one example, the data acquisition device 800 may also include a communication interface 803 and a bus 810 . Among them, as shown in FIG. 8 , the processor 801 , the memory 802 , and the communication interface 803 are connected through the bus 810 and complete the mutual communication.
通信接口803,主要用于实现本申请实施例中各模块、装置、单元和/或设备之间的通信。The communication interface 803 is mainly used to implement communication between modules, apparatuses, units and/or devices in the embodiments of the present application.
总线810包括硬件、软件或两者,将数据获取设备的部件彼此耦接在一起。举例来说而非限制,总线810可包括加速图形端口(AGP)或其他图形总线、增强工业标准架构(EISA)总线、前端总线(FSB)、超传输(HT)互连、工业标准架构(ISA)总线、无限带宽互连、低引脚数(LPC)总线、存储器总线、微信道架构(MCA)总线、外围组件互连(PCI)总线、PCI-Express(PCI-X)总线、串行高级技术附件(SATA)总线、视频电子标准协会局部(VLB)总线或其他合适的总线或者两个或更多个以上这些的组合。在合适的情况下,总线810可包括一个或多个总线。尽管本申请实施例描述和示出了特定的总线,但本申请考虑任何合适的总线或互连。The bus 810 includes hardware, software, or both, coupling the components of the data acquisition device to each other. By way of example and not limitation, bus 810 may include Accelerated Graphics Port (AGP) or other graphics bus, Enhanced Industry Standard Architecture (EISA) bus, Front Side Bus (FSB), HyperTransport (HT) interconnect, Industry Standard Architecture (ISA) ) bus, Infiniband Interconnect, Low Pin Count (LPC) bus, Memory Bus, Microchannel Architecture (MCA) bus, Peripheral Component Interconnect (PCI) bus, PCI-Express (PCI-X) bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association Local (VLB) bus or other suitable bus or a combination of two or more of the above. Bus 810 may include one or more buses, where appropriate. Although embodiments of this application describe and illustrate a particular bus, this application contemplates any suitable bus or interconnect.
另外,结合上述实施例中的数据获取方法,本申请实施例可提供一种计算机存储介质来实现。该计算机存储介质上存储有计算机程序指令;该 计算机程序指令被处理器执行时实现上述实施例中的任意一种数据获取方法。所示的计算机可读存储介质的示例包括非暂态计算机可读存储介质,如只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。In addition, in combination with the data acquisition method in the foregoing embodiment, the embodiment of the present application may provide a computer storage medium for implementation. Computer program instructions are stored on the computer storage medium; when the computer program instructions are executed by the processor, any one of the data acquisition methods in the foregoing embodiments is implemented. Examples of computer-readable storage media shown include non-transitory computer-readable storage media, such as read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc. .
需要明确的是,本申请并不局限于上文所描述并在图中示出的特定配置和处理。为了简明起见,这里省略了对已知方法的详细描述。在上述实施例中,描述和示出了若干具体的步骤作为示例。但是,本申请的方法过程并不限于所描述和示出的具体步骤,本领域的技术人员可以在领会本申请的精神后,作出各种改变、修改和添加,或者改变步骤之间的顺序。To be clear, the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above-described embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the sequence of steps after comprehending the spirit of the present application.
以上所述的结构框图中所示的功能块可以实现为硬件、软件、固件或者它们的组合。当以硬件方式实现时,其可以例如是电子电路、专用集成电路(ASIC)、适当的固件、插件、功能卡等等。当以软件方式实现时,本申请的元素是被用于执行所需任务的程序或者代码段。程序或者代码段可以存储在机器可读介质中,或者通过载波中携带的数据信号在传输介质或者通信链路上传送。“机器可读介质”可以包括能够存储或传输信息的任何介质。机器可读介质的例子包括电子电路、半导体存储器设备、ROM、闪存、可擦除ROM(EROM)、软盘、CD-ROM、光盘、硬盘、光纤介质、射频(RF)链路,等等。代码段可以经由诸如因特网、内联网等的计算机网络被下载。The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an application specific integrated circuit (ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, elements of the present application are programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted over a transmission medium or communication link by a data signal carried in a carrier wave. A "machine-readable medium" may include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and the like. The code segments may be downloaded via a computer network such as the Internet, an intranet, or the like.
还需要说明的是,本申请中提及的示例性实施例,基于一系列的步骤或者装置描述一些方法或系统。但是,本申请不局限于上述步骤的顺序,也就是说,可以按照实施例中提及的顺序执行步骤,也可以不同于实施例中的顺序,或者若干步骤同时执行。It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps may be performed in the order mentioned in the embodiment, or may be different from the order in the embodiment, or several steps may be performed simultaneously.
上面参考根据本申请的实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各方面。应当理解,流程图和/或框图中的每个方框以及流程图和/或框图中各方框的组合可以由计算机程序指令实现。这些计算机程序指令可被提供给通用计算机、专用计算机、或其它可编程数据处理装置的处理器,以产生一种机器,使得经由计算机或其它可编程数据处理装置的处理器执行的这些指令使能对流程图和/或框图的 一个或多个方框中指定的功能/动作的实现。这种处理器可以是但不限于是通用处理器、专用处理器、特殊应用处理器或者现场可编程逻辑电路。还可理解,框图和/或流程图中的每个方框以及框图和/或流程图中的方框的组合,也可以由执行指定的功能或动作的专用硬件来实现,或可由专用硬件和计算机指令的组合来实现。Aspects of the present disclosure are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of 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, or other programmable data processing apparatus to produce a machine such that execution of the instructions via the processor of the computer or other programmable data processing apparatus enables the Implementation of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams. Such processors may be, but are not limited to, general purpose processors, special purpose processors, application specific processors, or field programmable logic circuits. It will also be understood that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can also be implemented by special purpose hardware for performing the specified functions or actions, or by special purpose hardware and/or A combination of computer instructions is implemented.
以上所述,仅为本申请的具体实施方式,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的系统、模块和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。应理解,本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。The above are only specific implementations of the present application. Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the above-described systems, modules and units may refer to the foregoing method embodiments. The corresponding process in , will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should all cover within the scope of protection of this application.

Claims (19)

  1. 一种数据获取方法,应用于区块链节点,包括:A data acquisition method applied to blockchain nodes, including:
    基于获取的数据查询信息,通过智能合约构建数据查询请求,所述数据查询请求携带有所述数据查询信息;Based on the acquired data query information, a data query request is constructed through a smart contract, and the data query request carries the data query information;
    直接向与所述数据查询信息关联的链外数据源发送所述数据查询请求,以使所述链外数据源基于所述数据查询请求得到数据查询结果;directly sending the data query request to an off-chain data source associated with the data query information, so that the off-chain data source obtains a data query result based on the data query request;
    接收所述链外数据源发送的数据查询结果。Receive the data query result sent by the off-chain data source.
  2. 根据权利要求1所述的方法,其中,所述数据查询信息包括在所述链外数据源中的查询索引。The method of claim 1, wherein the data query information includes a query index in the off-chain data source.
  3. 根据权利要求2所述的方法,其中,所述查询索引包括查询条件或在所述链外数据源的存储地址。The method according to claim 2, wherein the query index includes a query condition or a storage address of the data source outside the chain.
  4. 根据权利要求3所述的方法,其中,若所述查询索引包括查询条件,所述基于获取的数据查询信息,通过智能合约构建数据查询请求,包括:The method according to claim 3, wherein, if the query index includes query conditions, the data query request constructed through a smart contract based on the acquired data query information includes:
    基于获取的所述查询条件和预先存储的所述链外数据源的查询地址,通过智能合约构建所述数据查询请求。Based on the obtained query conditions and the pre-stored query address of the off-chain data source, the data query request is constructed through a smart contract.
  5. 根据权利要求2所述的方法,其中,所述数据查询信息还包括查询授权签名,所述查询授权签名用于所述链外数据源在对所述查询授权签名验证通过的情况下,基于所述数据查询请求得到所述数据查询结果。The method according to claim 2, wherein the data query information further includes a query authorization signature, and the query authorization signature is used by the off-chain data source to verify the query authorization signature based on the The data query request is obtained to obtain the data query result.
  6. 根据权利要求1所述的方法,其中,所述基于获取的数据查询信息,通过智能合约构建数据查询请求之前,所述方法还包括:The method according to claim 1, wherein, before the data query request is constructed through a smart contract based on the acquired data query information, the method further comprises:
    接收客户端发送的所述数据查询信息。The data query information sent by the client is received.
  7. 根据权利要求1所述的方法,其中,在所述直接向与所述数据查询信息关联的链外数据源发送所述数据查询请求之前,所述方法还包括:The method according to claim 1, wherein before the data query request is directly sent to an off-chain data source associated with the data query information, the method further comprises:
    对所述数据查询请求进行加密,得到加密后的数据查询请求;Encrypting the data query request to obtain an encrypted data query request;
    其中,所述直接向与所述数据查询信息关联的链外数据源发送所述数据查询请求,包括:The directly sending the data query request to the off-chain data source associated with the data query information includes:
    直接向与所述数据查询信息关联的链外数据源发送所述加密后的数据 查询请求。The encrypted data query request is directly sent to the off-chain data source associated with the data query information.
  8. 根据权利要求7所述的方法,其中,所述直接向与所述数据查询信息关联的链外数据源发送所述加密后的数据查询请求,包括:The method according to claim 7, wherein the directly sending the encrypted data query request to an off-chain data source associated with the data query information comprises:
    通过安全传输层协议加密通信通道,直接向与所述数据查询信息关联的链外数据源发送所述加密后的数据查询请求。The encrypted data query request is directly sent to the off-chain data source associated with the data query information by encrypting the communication channel through the secure transport layer protocol.
  9. 根据权利要求1所述的方法,其中,所述数据查询信息还包括需要查询的目标数据的数据指纹;所述目标数据的数据指纹是利用预设哈希算法对所述目标数据哈希之后得到的数据;The method according to claim 1, wherein the data query information further includes a data fingerprint of the target data to be queried; the data fingerprint of the target data is obtained after hashing the target data with a preset hash algorithm The data;
    其中,在所述接收所述链外数据源发送的数据查询结果之后,所述方法还包括:Wherein, after receiving the data query result sent by the off-chain data source, the method further includes:
    通过所述智能合约,利用所述预设哈希算法对所述数据查询结果进行哈希,得到所述数据查询结果的数据指纹;Through the smart contract, the data query result is hashed by the preset hash algorithm to obtain a data fingerprint of the data query result;
    在通过所述智能合约确定所述目标数据的数据指纹和所述数据查询结果的数据指纹一致的情况下,通过所述智能合约对所述数据查询结果执行预设处理。When it is determined by the smart contract that the data fingerprint of the target data is consistent with the data fingerprint of the data query result, preset processing is performed on the data query result by the smart contract.
  10. 根据权利要求1所述的方法,其中,所述数据查询结果为加密后的数据查询结果,所述方法还包括:The method according to claim 1, wherein the data query result is an encrypted data query result, and the method further comprises:
    对所述加密后的数据查询结果进行解密,得到所述数据查询结果。Decrypt the encrypted data query result to obtain the data query result.
  11. 一种数据获取方法,应用链外数据源,包括:A data acquisition method, applying off-chain data sources, including:
    接收区块链节点发送的数据查询请求,所述数据查询请求是所述区块链节点基于获取的数据查询信息通过智能合约构建的,所述数据查询请求携带有所述数据查询信息;receiving a data query request sent by a blockchain node, where the data query request is constructed by the blockchain node through a smart contract based on the acquired data query information, and the data query request carries the data query information;
    基于所述数据查询请求,得到数据查询结果;obtaining a data query result based on the data query request;
    向所述区块链节点发送所述数据查询结果。Send the data query result to the blockchain node.
  12. 根据权利要求11所述的方法,其中,所述数据查询信息包括在所述链外数据源中的查询索引和查询授权签名;The method of claim 11, wherein the data query information includes a query index and a query authorization signature in the off-chain data source;
    其中,所述基于所述数据查询请求,得到数据查询结果,包括:Wherein, obtaining a data query result based on the data query request includes:
    在对所述数据查询请求中携带的所述查询授权签名验证通过的情况下,基于所述数据查询请求中携带的所述查询索引,得到与所述查询索引 匹配的数据查询结果。In the case of passing the verification of the query authorization signature carried in the data query request, a data query result matching the query index is obtained based on the query index carried in the data query request.
  13. 根据权利要求12所述的方法,其中,对所述数据查询请求中携带的所述查询授权签名验证通过,包括:The method according to claim 12, wherein the verification of the query authorization signature carried in the data query request is passed, comprising:
    确定所述查询授权签名在预设有效期内,和/或,携带有所述查询授权签名的数据请求的请求次数小于预设次数阈值。It is determined that the query authorization signature is within a preset validity period, and/or the number of requests for data requests carrying the query authorization signature is less than a preset number of times threshold.
  14. 根据权利要求11所述的方法,其中,所述向所述区块链节点发送所述数据查询结果之前,所述方法还包括:The method according to claim 11, wherein before the sending the data query result to the blockchain node, the method further comprises:
    对所述数据查询结果进行加密,得到加密后的数据查询结果;Encrypting the data query result to obtain an encrypted data query result;
    其中,所述向所述区块链节点发送所述数据查询结果,包括:Wherein, the sending the data query result to the blockchain node includes:
    向所述区块链节点发送所述加密后的数据查询结果。Send the encrypted data query result to the blockchain node.
  15. 根据权利要求14所述的方法,其中,所述向所述区块链节点发送所述加密后的数据查询结果,包括:The method according to claim 14, wherein the sending the encrypted data query result to the blockchain node comprises:
    通过安全传输层协议加密通信通道,向所述区块链节点发送所述加密后的数据查询结果。The encrypted communication channel is encrypted by the secure transport layer protocol, and the encrypted data query result is sent to the blockchain node.
  16. 一种数据获取装置,应用于区块链节点,包括:A data acquisition device, applied to a blockchain node, includes:
    数据查询请求构建模块,用于基于获取的数据查询信息,通过智能合约构建数据查询请求,所述数据查询请求携带有所述数据查询信息;a data query request building module, configured to construct a data query request through a smart contract based on the acquired data query information, where the data query request carries the data query information;
    数据查询请求发送模块,用于直接向与所述数据查询信息关联的链外数据源发送所述数据查询请求,以使所述链外数据源基于所述数据查询请求得到数据查询结果;a data query request sending module, configured to directly send the data query request to an off-chain data source associated with the data query information, so that the off-chain data source obtains a data query result based on the data query request;
    数据查询结果接收模块,用于接收所述链外数据源发送的数据查询结果。The data query result receiving module is configured to receive the data query result sent by the off-chain data source.
  17. 一种数据获取方法,应用于链外数据源,包括:A data acquisition method applied to off-chain data sources, including:
    数据查询请求接收模块,用于接收区块链节点发送的数据查询请求,所述数据查询请求是所述区块链节点基于获取的数据查询信息,通过智能合约构建的,所述数据查询请求携带有所述数据查询信息;The data query request receiving module is used to receive the data query request sent by the blockchain node. The data query request is constructed by the blockchain node based on the acquired data query information through a smart contract, and the data query request carries have the data query information;
    数据查询结果确定模块,用于基于所述数据查询请求,得到数据查询结果;a data query result determination module, configured to obtain a data query result based on the data query request;
    数据查询结果发送模块,用于向所述区块链节点发送所述数据查询结 果。A data query result sending module, configured to send the data query result to the blockchain node.
  18. 一种数据获取设备,包括:处理器以及存储有计算机程序指令的存储器;A data acquisition device, comprising: a processor and a memory storing computer program instructions;
    所述处理器执行所述计算机程序指令时实现如权利要求1-15任意一项所述的数据获取方法。When the processor executes the computer program instructions, the data acquisition method according to any one of claims 1-15 is implemented.
  19. 一种计算机存储介质,所述计算机存储介质上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现如权利要求1-15任意一项所述的数据获取方法。A computer storage medium, where computer program instructions are stored thereon, and when the computer program instructions are executed by a processor, the data acquisition method according to any one of claims 1-15 is implemented.
PCT/CN2021/116184 2020-09-03 2021-09-02 Data acquisition method, apparatus and device, and medium WO2022048589A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010914632.4A CN112084234B (en) 2020-09-03 Data acquisition method, device, equipment and medium
CN202010914632.4 2020-09-03

Publications (1)

Publication Number Publication Date
WO2022048589A1 true WO2022048589A1 (en) 2022-03-10

Family

ID=73731893

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/116184 WO2022048589A1 (en) 2020-09-03 2021-09-02 Data acquisition method, apparatus and device, and medium

Country Status (2)

Country Link
TW (1) TWI797738B (en)
WO (1) WO2022048589A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115567312A (en) * 2022-10-13 2023-01-03 佛山众陶联供应链服务有限公司 Alliance chain data authority management system and method capable of meeting multiple scenes
CN116055493A (en) * 2023-03-31 2023-05-02 北京比格大数据有限公司 Cross-architecture data acquisition method, gateway node and cross-architecture platform

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107507005A (en) * 2017-08-01 2017-12-22 众安信息技术服务有限公司 Data access method and system outside a kind of chain based on alliance's chain
CN110009494A (en) * 2019-03-18 2019-07-12 阿里巴巴集团控股有限公司 A kind of method and device monitoring the transaction content in block chain
CN110474903A (en) * 2019-08-15 2019-11-19 广州蚁比特区块链科技有限公司 Trust data acquisition methods, device and block chain node
CN111045812A (en) * 2019-12-24 2020-04-21 山东爱城市网信息技术有限公司 Block chain intelligent contract reverse calling method, equipment and medium
CN111429134A (en) * 2018-12-21 2020-07-17 北京京东尚科信息技术有限公司 Data transaction method and device based on block chain
CN112084234A (en) * 2020-09-03 2020-12-15 中国银联股份有限公司 Data acquisition method, apparatus, device and medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111782725A (en) * 2018-02-27 2020-10-16 阿里巴巴集团控股有限公司 Cross-block-chain interaction method, device, system and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107507005A (en) * 2017-08-01 2017-12-22 众安信息技术服务有限公司 Data access method and system outside a kind of chain based on alliance's chain
CN111429134A (en) * 2018-12-21 2020-07-17 北京京东尚科信息技术有限公司 Data transaction method and device based on block chain
CN110009494A (en) * 2019-03-18 2019-07-12 阿里巴巴集团控股有限公司 A kind of method and device monitoring the transaction content in block chain
CN110474903A (en) * 2019-08-15 2019-11-19 广州蚁比特区块链科技有限公司 Trust data acquisition methods, device and block chain node
CN111045812A (en) * 2019-12-24 2020-04-21 山东爱城市网信息技术有限公司 Block chain intelligent contract reverse calling method, equipment and medium
CN112084234A (en) * 2020-09-03 2020-12-15 中国银联股份有限公司 Data acquisition method, apparatus, device and medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115567312A (en) * 2022-10-13 2023-01-03 佛山众陶联供应链服务有限公司 Alliance chain data authority management system and method capable of meeting multiple scenes
CN115567312B (en) * 2022-10-13 2023-07-18 佛山众陶联供应链服务有限公司 Alliance chain data authority management system and method capable of meeting various scenes
CN116055493A (en) * 2023-03-31 2023-05-02 北京比格大数据有限公司 Cross-architecture data acquisition method, gateway node and cross-architecture platform
CN116055493B (en) * 2023-03-31 2023-06-23 北京比格大数据有限公司 Cross-architecture data acquisition method, gateway node and cross-architecture platform

Also Published As

Publication number Publication date
TW202211047A (en) 2022-03-16
CN112084234A (en) 2020-12-15
TWI797738B (en) 2023-04-01

Similar Documents

Publication Publication Date Title
US11356280B2 (en) Personal device security using cryptocurrency wallets
CN109347835B (en) Information transmission method, client, server, and computer-readable storage medium
KR102493744B1 (en) Security Verification Method Based on Biometric Characteristics, Client Terminal, and Server
US20190173873A1 (en) Identity verification document request handling utilizing a user certificate system and user identity document repository
CN117579281A (en) Method and system for ownership verification using blockchain
WO2022048589A1 (en) Data acquisition method, apparatus and device, and medium
US9647842B2 (en) Dual-party session key derivation
KR101739203B1 (en) Password-based user authentication method using one-time private key-based digital signature and homomorphic encryption
WO2016054905A1 (en) Method for processing data
CN106576047B (en) Make Password Operations from the method and apparatus of malicious modification
EP3433997B1 (en) Activation of mobile devices in enterprise mobile management
EP2922236B1 (en) Authentication by use of symmetric and asymmetric cryptography
EP3133791B1 (en) Double authentication system for electronically signed documents
Sarvabhatla et al. A secure and light weight authentication service in hadoop using one time pad
CN110572392A (en) Identity authentication method based on HyperLegger network
CN114143312A (en) Block chain-based edge computing terminal authentication method, system and equipment
KR101856530B1 (en) Encryption system providing user cognition-based encryption protocol and method for processing on-line settlement, security apparatus and transaction approval server using thereof
US20170330177A1 (en) Payment terminal authentication
CN106961417B (en) Identity verification method based on ciphertext
CN114238915A (en) Digital certificate adding method and device, computer equipment and storage medium
CN112084234B (en) Data acquisition method, device, equipment and medium
KR102094606B1 (en) Apparatus and method for authentication
CN110555029B (en) Ticket management method, device and storage medium based on block chain
CN117592990B (en) Block chain transaction authentication method and device, computing equipment and storage medium
CN117728976A (en) Data transmission method, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21863653

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21863653

Country of ref document: EP

Kind code of ref document: A1