












技术领域technical field
本公开涉及区块链技术领域,尤其涉及一种信息获取方法、装置、设备及存储介质。The present disclosure relates to the technical field of block chain, and in particular to an information acquisition method, device, equipment and storage medium.
背景技术Background technique
在传统互联网技术(internet technology,IT)系统中,金融中心机构如中央银行可以维护管辖域内的了解客户信息(know your customer,KYC)等交易信息。由于不同地区(如不同管辖域)的管理方式不同,各个管辖域分别使用一套独立的交易系统如银行IT系统。In traditional Internet technology (internet technology, IT) systems, financial center institutions such as the central bank can maintain transaction information such as know your customer information (know your customer, KYC) within the jurisdiction. Due to the different management methods in different regions (such as different jurisdictions), each jurisdiction uses an independent set of transaction systems such as bank IT systems.
当一个银行IT系统需要获取其他银行IT系统的信息时,通常需要通过数据库并行处理技术、缓存区技术、分区表技术等多种技术来实现。因此,通用的跨系统进行信息获取的方法对技术要求较高,占用较多的资源,导致跨交易系统进行交易相关信息获取的效率较低。When a bank's IT system needs to obtain information from other bank's IT systems, it usually needs to use multiple technologies such as database parallel processing technology, cache area technology, and partition table technology. Therefore, the general cross-system information acquisition method has high technical requirements and takes up more resources, resulting in low efficiency of cross-system transaction-related information acquisition.
发明内容Contents of the invention
本公开提供一种信息获取方法、装置、设备及存储介质,用于解决通用技术中跨交易系统进行交易相关信息获取的效率较低的问题。The present disclosure provides an information acquisition method, device, equipment, and storage medium, which are used to solve the problem of low efficiency in acquiring transaction-related information across transaction systems in common technologies.
本公开实施例的技术方案如下:The technical scheme of the disclosed embodiment is as follows:
根据本公开实施例的第一方面,提供一种信息获取方法,应用于区块链网络;信息获取方法,包括:接收第一交易系统的目标设备发送的信息获取请求;信息获取请求用于请求获取第二交易系统的交易信息;信息获取请求包括:第二交易系统的标识信息;第一交易系统与第二交易系统为区块链网络中两个不同的交易系统;根据第二交易系统的标识信息,调用预先创建的智能合约,获取第二交易系统的交易信息;向目标设备发送第二交易系统的交易信息。According to the first aspect of the embodiments of the present disclosure, there is provided an information acquisition method applied to a blockchain network; the information acquisition method includes: receiving an information acquisition request sent by the target device of the first transaction system; the information acquisition request is used to request Obtain the transaction information of the second transaction system; the information acquisition request includes: the identification information of the second transaction system; the first transaction system and the second transaction system are two different transaction systems in the block chain network; according to the second transaction system Identification information, calling the pre-created smart contract to obtain the transaction information of the second transaction system; sending the transaction information of the second transaction system to the target device.
可选的,智能合约包括:第二交易系统的秘钥信息;根据第二交易系统的标识信息,调用预先创建的智能合约,获取第二交易系统的交易信息的方法,包括:根据第二交易系统的标识信息,从智能合约中获取第二交易系统的秘钥信息;根据第二交易系统的秘钥信息,对区块链网络中的加密信息进行解密处理,以得到第二交易系统的交易信息。Optionally, the smart contract includes: the secret key information of the second transaction system; according to the identification information of the second transaction system, the method of invoking the pre-created smart contract and obtaining the transaction information of the second transaction system includes: according to the second transaction System identification information, obtain the secret key information of the second transaction system from the smart contract; according to the secret key information of the second transaction system, decrypt the encrypted information in the blockchain network to obtain the transaction of the second transaction system information.
可选的,智能合约还包括:第二交易系统的交易策略信息;信息获取方法,还包括:获取第二交易系统的交易请求;交易请求包括:第二交易系统的标识信息,以及待同步至区块链网络的第二交易系统的交易信息;根据第二交易系统的标识信息,从智能合约中获取第二交易系统的交易策略信息;根据第二交易系统的交易策略信息,执行智能合约的验证操作,以得到第二交易系统的交易信息的第一验证结果;当第一验证结果表示第二交易系统的交易信息在区块链网络中达成共识时,根据第二交易系统的秘钥信息,对第二交易系统的交易信息进行加密处理,以得到加密信息。Optionally, the smart contract also includes: transaction strategy information of the second transaction system; the information acquisition method also includes: obtaining a transaction request of the second transaction system; the transaction request includes: the identification information of the second transaction system, and the information to be synchronized to The transaction information of the second transaction system of the blockchain network; according to the identification information of the second transaction system, obtain the transaction strategy information of the second transaction system from the smart contract; according to the transaction strategy information of the second transaction system, execute the transaction strategy information of the smart contract Verification operation to obtain the first verification result of the transaction information of the second transaction system; when the first verification result indicates that the transaction information of the second transaction system has reached a consensus in the blockchain network, according to the secret key information of the second transaction system , encrypting the transaction information of the second transaction system to obtain the encrypted information.
可选的,信息获取方法,还包括:监听区块链网络中的交易事件;当监听目标交易事件之后,获取目标交易事件对应的目标交易系统的相关信息;相关信息包括:标识信息、交易信息、秘钥信息和交易策略信息;目标交易事件为区块链网络中的任意一个交易事件;在智能合约中存储目标交易系统的相关信息。Optionally, the information acquisition method also includes: monitoring transaction events in the blockchain network; after monitoring the target transaction event, obtaining relevant information of the target transaction system corresponding to the target transaction event; relevant information includes: identification information, transaction information , secret key information and transaction strategy information; the target transaction event is any transaction event in the blockchain network; store relevant information of the target transaction system in the smart contract.
可选的,根据第二交易系统的标识信息,从智能合约中获取第二交易系统的秘钥信息的方法,包括:从智能合约中确定与第二交易系统的标识信息对应的第二交易系统的相关信息;从第二交易系统的相关信息中读取第二交易系统的秘钥信息。Optionally, according to the identification information of the second transaction system, the method for obtaining the key information of the second transaction system from the smart contract includes: determining the second transaction system corresponding to the identification information of the second transaction system from the smart contract relevant information; read the secret key information of the second transaction system from the relevant information of the second transaction system.
可选的,根据第二交易系统的标识信息,调用预先创建的智能合约,获取第二交易系统的交易信息的方法,包括:调用智能合约,确定预先存储的交易信息列表;交易信息列表包括:区块链网络中,任意一个交易系统的标识信息与交易信息的对应关系;将交易信息列表中,与第二交易系统的标识信息对应的交易信息,确定为第二交易系统的交易信息。Optionally, according to the identification information of the second transaction system, the method of invoking a pre-created smart contract to obtain the transaction information of the second transaction system includes: calling the smart contract to determine a pre-stored transaction information list; the transaction information list includes: In the blockchain network, the correspondence between the identification information of any transaction system and the transaction information; the transaction information corresponding to the identification information of the second transaction system in the transaction information list is determined as the transaction information of the second transaction system.
可选的,信息获取方法,还包括:获取任意一个交易系统的标识信息,以及任意一个交易系统的交易信息;创建对应关系,并在历史交易信息列表中存储对应关系,以得到交易信息列表。Optionally, the method for obtaining information further includes: obtaining identification information of any trading system and transaction information of any trading system; creating a corresponding relationship, and storing the corresponding relationship in the historical transaction information list to obtain the transaction information list.
根据本公开实施例的第二方面,提供一种信息获取装置,应用于区块链网络;信息获取装置,包括:通信单元和处理单元;通信单元,用于接收第一交易系统的目标设备发送的信息获取请求;信息获取请求用于请求获取第二交易系统的交易信息;信息获取请求包括:第二交易系统的标识信息;第一交易系统与第二交易系统为区块链网络中两个不同的交易系统;处理单元,用于根据通信单元接收的第二交易系统的标识信息,调用预先创建的智能合约,获取第二交易系统的交易信息;通信单元,还用于向目标设备发送处理单元获取的第二交易系统的交易信息。According to the second aspect of the embodiments of the present disclosure, there is provided an information acquisition device applied to a blockchain network; the information acquisition device includes: a communication unit and a processing unit; the communication unit is used to receive the information sent by the target device of the first transaction system The information acquisition request; the information acquisition request is used to request the transaction information of the second transaction system; the information acquisition request includes: the identification information of the second transaction system; the first transaction system and the second transaction system are two transactions in the blockchain network Different transaction systems; the processing unit is used to call the pre-created smart contract according to the identification information of the second transaction system received by the communication unit, and obtain the transaction information of the second transaction system; the communication unit is also used to send processing information to the target device The transaction information of the second transaction system acquired by the unit.
可选的,智能合约包括:第二交易系统的秘钥信息;处理单元,具体用于:根据第二交易系统的标识信息,从智能合约中获取第二交易系统的秘钥信息;根据第二交易系统的秘钥信息,对区块链网络中的加密信息进行解密处理,以得到第二交易系统的交易信息。Optionally, the smart contract includes: the secret key information of the second transaction system; the processing unit is specifically configured to: obtain the secret key information of the second transaction system from the smart contract according to the identification information of the second transaction system; The secret key information of the transaction system decrypts the encrypted information in the blockchain network to obtain the transaction information of the second transaction system.
可选的,智能合约还包括:第二交易系统的交易策略信息;处理单元,还用于:获取第二交易系统的交易请求;交易请求包括:第二交易系统的标识信息,以及待同步至区块链网络的第二交易系统的交易信息;根据第二交易系统的标识信息,从智能合约中获取第二交易系统的交易策略信息;根据第二交易系统的交易策略信息,执行智能合约的验证操作,以得到第二交易系统的交易信息的第一验证结果;当第一验证结果表示第二交易系统的交易信息在区块链网络中达成共识时,根据第二交易系统的秘钥信息,对第二交易系统的交易信息进行加密处理,以得到加密信息。Optionally, the smart contract further includes: transaction strategy information of the second transaction system; the processing unit is also used to: acquire a transaction request of the second transaction system; the transaction request includes: identification information of the second transaction system, and the information to be synchronized to The transaction information of the second transaction system of the blockchain network; according to the identification information of the second transaction system, obtain the transaction strategy information of the second transaction system from the smart contract; according to the transaction strategy information of the second transaction system, execute the transaction strategy information of the smart contract Verification operation to obtain the first verification result of the transaction information of the second transaction system; when the first verification result indicates that the transaction information of the second transaction system has reached a consensus in the blockchain network, according to the secret key information of the second transaction system , encrypting the transaction information of the second transaction system to obtain the encrypted information.
可选的,处理单元,还用于:监听区块链网络中的交易事件;当监听目标交易事件之后,获取目标交易事件对应的目标交易系统的相关信息;相关信息包括:标识信息、交易信息、秘钥信息和交易策略信息;目标交易事件为区块链网络中的任意一个交易事件;在智能合约中存储目标交易系统的相关信息。Optionally, the processing unit is also used to: monitor transaction events in the blockchain network; after monitoring the target transaction event, obtain relevant information of the target transaction system corresponding to the target transaction event; relevant information includes: identification information, transaction information , secret key information and transaction strategy information; the target transaction event is any transaction event in the blockchain network; store relevant information of the target transaction system in the smart contract.
可选的,处理单元,具体用于:从智能合约中确定与第二交易系统的标识信息对应的第二交易系统的相关信息;从第二交易系统的相关信息中读取第二交易系统的秘钥信息。Optionally, the processing unit is specifically configured to: determine the relevant information of the second transaction system corresponding to the identification information of the second transaction system from the smart contract; read the relevant information of the second transaction system from the relevant information of the second transaction system Key information.
可选的,处理单元,具体用于:调用智能合约,确定预先存储的交易信息列表;交易信息列表包括:区块链网络中,任意一个交易系统的标识信息与交易信息的对应关系;将交易信息列表中,与第二交易系统的标识信息对应的交易信息,确定为第二交易系统的交易信息。Optionally, the processing unit is specifically used to: call the smart contract, and determine the pre-stored transaction information list; the transaction information list includes: in the blockchain network, the correspondence between the identification information of any transaction system and the transaction information; In the information list, the transaction information corresponding to the identification information of the second transaction system is determined as the transaction information of the second transaction system.
可选的,处理单元,还用于:获取任意一个交易系统的标识信息,以及任意一个交易系统的交易信息;创建对应关系,并在历史交易信息列表中存储对应关系,以得到交易信息列表。Optionally, the processing unit is further configured to: obtain the identification information of any transaction system and the transaction information of any transaction system; create a corresponding relationship, and store the corresponding relationship in the historical transaction information list to obtain the transaction information list.
根据本公开实施例的第三方面,提供一种信息获取装置,可以包括:处理器和用于存储处理器可执行指令的存储器;其中,处理器被配置为执行指令,以实现上述第一方面中任一种可选的信息获取方法。According to a third aspect of an embodiment of the present disclosure, there is provided an information acquisition device, which may include: a processor and a memory for storing processor-executable instructions; wherein, the processor is configured to execute instructions to implement the above-mentioned first aspect Any of the optional information acquisition methods.
根据本公开实施例的第四方面,提供一种计算机可读存储介质,计算机可读存储介质上存储有指令,当计算机可读存储介质中的指令由信息获取装置的处理器执行时,使得信息获取装置能够执行上述第一方面中任一种可选的信息获取方法。According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, and instructions are stored on the computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by the processor of the information acquisition device, the information The obtaining device can perform any optional information obtaining method in the first aspect above.
本申请提供的技术方案至少带来以下有益效果:The technical solution provided by the application brings at least the following beneficial effects:
基于上述任一方面,本申请中的信息获取方法,应用于区块链网络。可以接收第一交易系统的目标设备发送的信息获取请求,其中,信息获取请求用于请求获取区块链网络中,第二交易系统的交易信息。然后可以调用预先创建的智能合约,根据信息获取请求包括的第二交易系统的标识信息,获取第二交易系统的交易信息,并向目标设备发送第二交易系统的交易信息。由于区块链网络具有区块链节点之间数据同步的特性、且智能合约可以保障信息获取的可信环境,因此,第一交易系统的目标设备可以通过区块链网络安全获取到第二交易系统的交易信息。相对于通用技术,减少了多种技术的使用,进而有效提高了跨系统进行信息获取的效率。Based on any of the above aspects, the information acquisition method in this application is applied to a blockchain network. An information acquisition request sent by the target device of the first transaction system may be received, wherein the information acquisition request is used to request acquisition of transaction information of the second transaction system in the blockchain network. Then, the pre-created smart contract can be invoked, and the transaction information of the second transaction system can be obtained according to the identification information of the second transaction system included in the information acquisition request, and the transaction information of the second transaction system can be sent to the target device. Since the blockchain network has the characteristics of data synchronization between blockchain nodes and smart contracts can guarantee a trusted environment for information acquisition, the target device of the first transaction system can safely obtain the second transaction through the blockchain network. System transaction information. Compared with general-purpose technology, the use of multiple technologies is reduced, thereby effectively improving the efficiency of cross-system information acquisition.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理,并不构成对本公开的不当限定。The accompanying drawings here are incorporated into the specification and constitute a part of the specification, show embodiments consistent with the disclosure, and are used together with the description to explain the principle of the disclosure, and do not constitute an improper limitation of the disclosure.
图1为本公开实施例提供的一种信息获取系统示意图;FIG. 1 is a schematic diagram of an information acquisition system provided by an embodiment of the present disclosure;
图2示出了本公开实施例提供的一种信息获取方法的流程示意图一;FIG. 2 shows a first schematic flow diagram of an information acquisition method provided by an embodiment of the present disclosure;
图3示出了本公开实施例提供的一种标识信息的示意图;Fig. 3 shows a schematic diagram of identification information provided by an embodiment of the present disclosure;
图4示出了本公开实施例提供的一种智能合约的示意图;Fig. 4 shows a schematic diagram of a smart contract provided by an embodiment of the present disclosure;
图5示出了本公开实施例提供的一种信息获取方法的流程示意图二;FIG. 5 shows a second schematic flow diagram of an information acquisition method provided by an embodiment of the present disclosure;
图6示出了本公开实施例提供的一种信息获取方法的流程示意图三;FIG. 6 shows a third schematic flowchart of an information acquisition method provided by an embodiment of the present disclosure;
图7示出了本公开实施例提供的一种区块链节点的示意图;FIG. 7 shows a schematic diagram of a blockchain node provided by an embodiment of the present disclosure;
图8示出了本公开实施例提供的一种信息获取方法的流程示意图四;FIG. 8 shows a fourth schematic flowchart of an information acquisition method provided by an embodiment of the present disclosure;
图9示出了本公开实施例提供的一种信息获取方法的流程示意图五;FIG. 9 shows the fifth schematic flow diagram of an information acquisition method provided by an embodiment of the present disclosure;
图10示出了本公开实施例提供的一种信息获取方法的流程示意图六;FIG. 10 shows a sixth schematic flow diagram of an information acquisition method provided by an embodiment of the present disclosure;
图11示出了本公开实施例提供的一种信息获取方法的流程示意图七;FIG. 11 shows a schematic flow diagram VII of an information acquisition method provided by an embodiment of the present disclosure;
图12示出了本公开实施例提供的一种信息获取装置的结构示意图一;FIG. 12 shows a first structural schematic diagram of an information acquisition device provided by an embodiment of the present disclosure;
图13示出了本公开实施例提供的一种信息获取装置的结构示意图二。FIG. 13 shows a second schematic structural diagram of an information acquisition device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为了使本领域普通人员更好地理解本公开的技术方案,下面将结合附图,对本公开实施例中的技术方案进行清楚、完整地描述。In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。It should be noted that the terms "first" and "second" in the specification and claims of the present disclosure and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein can be practiced in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present disclosure as recited in the appended claims.
还应当理解的是,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其他特征、整体、步骤、操作、元素和/或组件的存在或添加。It should also be understood that the term "comprising" indicates the presence of described features, integers, steps, operations, elements and/or components, but does not exclude one or more other features, integers, steps, operations, elements and/or The presence or addition of components.
为了便于理解本申请,现对本申请涉及到的相关要素进行描述。In order to facilitate the understanding of the present application, the relevant elements involved in the present application are now described.
区块链技术blockchain technology
区块链技术,也被称为分布式账本技术,是一种由若干台计算设备共同参与“记账”(即记录交易数据),共同维护一份完整的分布式数据库的新兴技术。由于区块链技术具有去中心化(即没有中心节点)、公开透明、每台计算设备可以参与数据库记录、并且各计算设备之间可以快速的进行数据同步的特性,使得区块链技术已在众多的领域中广泛的进行应用。Blockchain technology, also known as distributed ledger technology, is an emerging technology in which several computing devices jointly participate in "bookkeeping" (that is, record transaction data) and jointly maintain a complete distributed database. Since blockchain technology has the characteristics of decentralization (that is, no central node), openness and transparency, each computing device can participate in database records, and fast data synchronization between computing devices, blockchain technology has been used in Widely applied in many fields.
区块链网络可包括多个区块链节点。区块链节点为具有通信功能以及存储功能的设备,如存储有区块链的设备。为了便于描述,本申请采用节点表示区块链节点。也就是说,本申请涉及到的节点均可用于表示区块链节点。A blockchain network may include multiple blockchain nodes. Blockchain nodes are devices with communication functions and storage functions, such as devices that store blockchains. For ease of description, this application uses nodes to represent blockchain nodes. That is to say, all the nodes involved in this application can be used to represent blockchain nodes.
每一个节点既可接收信息,也可生成信息。不同的节点之间通过维护一个共同的区块链来保持通信。具体的,在区块链网络中,任一节点可以根据客户端发送的与交易相关的数据生成新的区块,并以广播的形式通知其他节点,其他节点可以对这个区块进行验证。当区块链网络中的所有节点达成共识后,新的区块就可以被添加到区块链中。Each node can both receive information and generate information. Different nodes maintain communication by maintaining a common blockchain. Specifically, in the blockchain network, any node can generate a new block based on the transaction-related data sent by the client, and notify other nodes in the form of broadcast, and other nodes can verify the block. When all nodes in the blockchain network reach a consensus, new blocks can be added to the blockchain.
节点分为共识节点和普通节点。共识节点具有出块和投票权限,交易由共识节点排序并打包成块,共识完成后即被确认为合法区块。普通节点没有出块和投票权限,其他方面和共识节点相同。可以同步区块链上所有的原始数据,接受交易数据并向其他节点广播。普通节点的管理,是指普通节点的添加与删除,通过修改配置文件中连接的节点列表来实现。新的普通节点接入网络,必须连接已经在区块链网络内的节点。Nodes are divided into consensus nodes and ordinary nodes. Consensus nodes have the authority to produce blocks and vote. Transactions are sorted and packaged into blocks by consensus nodes. After the consensus is completed, they are confirmed as legal blocks. Ordinary nodes do not have block production and voting rights, and are the same as consensus nodes in other respects. All original data on the blockchain can be synchronized, transaction data can be accepted and broadcast to other nodes. The management of ordinary nodes refers to the addition and deletion of ordinary nodes, which is realized by modifying the list of connected nodes in the configuration file. New ordinary nodes accessing the network must connect to nodes already in the blockchain network.
本申请中的节点可以理解为处理单元。在一种实现方式中,节点可以为物理设备,例如服务器或终端设备。在另一种实现方式中,节点可以为虚拟计算机;虚拟计算机为所有类型的虚拟化设备中软件虚拟出来的运行环境的统称,该概念包括虚拟机、容器。在其他实现方式中,节点可以为进程(process)或者线程(thread);线程是操作系统能够进行运算调度的最小单位,线程被包含在进程之中,是进程中的实际运作单位;进程是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位。A node in this application can be understood as a processing unit. In an implementation manner, a node may be a physical device, such as a server or a terminal device. In another implementation manner, the node may be a virtual computer; a virtual computer is a general term for an operating environment virtualized by software in all types of virtualization devices, and the concept includes virtual machines and containers. In other implementations, a node can be a process or a thread; a thread is the smallest unit that the operating system can perform operation scheduling, and a thread is included in a process, which is the actual operating unit in the process; a process is a computer The program in is about a running activity on a data set, and is the basic unit for the system to allocate and schedule resources.
区块链的划分Blockchain division
目前,区块链按照部署方式可以分为:公有链、私有链、联盟链。At present, blockchain can be divided into: public chain, private chain and alliance chain according to the deployment method.
公有链是指全世界任何设备都可读取的区块链,或者是任何设备都能参与交易的共识验证过程的区块链。A public chain refers to a blockchain that can be read by any device in the world, or a blockchain that any device can participate in the consensus verification process of transactions.
私有链是指访问权限控制较为严格的区块链。A private chain refers to a blockchain with strict access control.
联盟链,也称共同体区块链(consortium blockchains),是指其共识过程受到预选节点控制的区块链。在联盟链中,只针对存储有该联盟链的节点开放全部或部分功能,联盟链中的各个节点可以基于需要定制读写权限、查询权限等。Consortium chains, also known as consortium blockchains, refer to blockchains whose consensus process is controlled by pre-selected nodes. In the consortium chain, all or part of the functions are only open to the nodes that store the consortium chain, and each node in the consortium chain can customize read and write permissions, query permissions, etc. based on needs.
智能合约(smart contract)smart contract
智能合约本质是能跑在区块链上的代码,是一种旨在以信息化方式传播、验证或执行合同的计算机协议。智能合约允许在没有第三方的情况下进行可信交易,这些交易可追踪且不可逆转。一个智能合约是一套以数字形式定义的承诺(promises),包括合约参与方可以在上面执行这些承诺的协议。数字形式意味着合约不得不写入计算机可读的代码中。这是必须的,因为只要参与方达成协定,智能合约建立的权利和义务,是由一台计算机或者计算机网络执行的。智能合约建立的具体过程包括:达成协议、合约执行、生成计算机可读的代码。The essence of a smart contract is code that can run on the blockchain. It is a computer protocol designed to spread, verify or execute contracts in an informational manner. Smart contracts allow for trusted transactions without third parties, which are traceable and irreversible. A smart contract is a set of promises defined in digital form, including agreements on which contract participants can implement these promises. The digital form means that contracts have to be written in computer-readable code. This is necessary because as long as the parties reach an agreement, the rights and obligations established by the smart contract are executed by a computer or computer network. The specific process of establishing a smart contract includes: reaching an agreement, contract execution, and generating computer-readable code.
区块(block)block
在区块链技术中,交易数据以电子记录的形式被永久储存下来,存放这些电子记录的文件我们称之为“区块”。In blockchain technology, transaction data is permanently stored in the form of electronic records, and the files storing these electronic records are called "blocks".
区块是按时间顺序一个个先后生成的,每一个区块记录有它在被创建期间发生的所有交易,所有区块汇总起来形成一个链式的记录合集。由于不同区块链网络中,节点的吞吐率不同,因此,在不同区块链网络中,区块的大小可能也不同。Blocks are generated one by one in chronological order, and each block records all transactions that occurred during its creation, and all blocks are aggregated to form a chain record collection. Due to the different throughput rates of nodes in different blockchain networks, the size of blocks may also be different in different blockchain networks.
交易(transaction)transaction
本申请涉及到的交易,是指用户通过任一节点创建,并发布数据至区块链的分布式数据库中的过程。The transaction involved in this application refers to the process that the user creates through any node and publishes the data to the distributed database of the blockchain.
该交易存在狭义的交易以及广义的交易之分。There are transactions in the narrow sense and transactions in the broad sense.
狭义的交易是指用户向区块链发布的一笔价值转移;例如,在传统的比特币区块链网络中,交易可以是用户在区块链中发起的一笔转账。A transaction in a narrow sense refers to a value transfer issued by a user to the blockchain; for example, in the traditional Bitcoin blockchain network, a transaction can be a transfer initiated by a user in the blockchain.
广义的交易是指用户向区块链发布一笔任意的数据:例如,运营方可以基于实际的业务需求搭建一个联盟链,依托于联盟链部署一些在线业务(比如,租房业务、车辆调度业务、保险理赔业务、信用服务、医疗服务等),而在这类联盟链中,交易可以是用户在联盟链中发布的一笔具有业务意图的业务消息或者业务请求;又如,该交易还可以是用户向区块链发送数据(如账户余额等),以使得更改用户的账户状态。A transaction in a broad sense means that the user publishes an arbitrary amount of data to the blockchain: for example, the operator can build an alliance chain based on actual business needs, and rely on the alliance chain to deploy some online services (such as house rental business, vehicle scheduling business, Insurance claims business, credit service, medical service, etc.), and in this type of alliance chain, the transaction can be a business message or business request issued by the user in the alliance chain; for another example, the transaction can also be The user sends data (such as account balance, etc.) to the blockchain to change the user's account status.
因此,只要是用户向区块链的分布式数据库发布任意数据,均可属于本申请所述的“交易”。Therefore, as long as the user publishes any data to the distributed database of the blockchain, it can belong to the "transaction" mentioned in this application.
本公开所涉及的数据可以为经用户授权或者经过各方充分授权的数据。The data involved in the present disclosure may be data authorized by the user or fully authorized by all parties.
如背景技术中所描述,通用的跨系统进行信息获取的方法对技术要求较高,占用较多的资源,导致跨交易系统进行交易相关信息获取的效率较低。As described in the background art, the general cross-system information acquisition method has high technical requirements and takes up more resources, resulting in low efficiency of cross-system transaction-related information acquisition.
基于此,本公开实施例提供一种信息获取方法,应用于区块链网络。可以接收第一交易系统的目标设备发送的信息获取请求,其中,信息获取请求用于请求获取区块链网络中,第二交易系统的交易信息。然后可以调用预先创建的智能合约,根据信息获取请求包括的第二交易系统的标识信息,获取第二交易系统的交易信息,并向目标设备发送第二交易系统的交易信息。由于区块链网络具有区块链节点之间数据同步的特性、且智能合约可以保障信息获取的可信环境,因此,第一交易系统的目标设备可以通过区块链网络安全获取到第二交易系统的交易信息。相对于通用技术,减少了多种技术的使用,进而有效提高了跨系统进行信息获取的效率。Based on this, an embodiment of the present disclosure provides an information acquisition method, which is applied to a blockchain network. An information acquisition request sent by the target device of the first transaction system may be received, wherein the information acquisition request is used to request acquisition of transaction information of the second transaction system in the blockchain network. Then, the pre-created smart contract can be invoked, and the transaction information of the second transaction system can be obtained according to the identification information of the second transaction system included in the information acquisition request, and the transaction information of the second transaction system can be sent to the target device. Since the blockchain network has the characteristics of data synchronization between blockchain nodes and smart contracts can guarantee a trusted environment for information acquisition, the target device of the first transaction system can safely obtain the second transaction through the blockchain network. System transaction information. Compared with general-purpose technology, the use of multiple technologies is reduced, thereby effectively improving the efficiency of cross-system information acquisition.
以下结合附图对本公开实施例提供的信息获取方法进行示例性说明:The information acquisition method provided by the embodiments of the present disclosure is exemplarily described below in conjunction with the accompanying drawings:
图1为本公开实施例提供的一种信息获取系统示意图,如图1所示,该信息获取系统中可以包括:区块链网络中的多个区块链节点(包括多个共识节点和多个普通节点),以及多个服务端(包括与任意一个区块链节点连接的至少一个服务端)。Figure 1 is a schematic diagram of an information acquisition system provided by an embodiment of the present disclosure. As shown in Figure 1, the information acquisition system may include: multiple blockchain nodes (including multiple consensus nodes and multiple blockchain nodes) in the blockchain network ordinary nodes), and multiple servers (including at least one server connected to any blockchain node).
其中,区块链网络包括多个交易系统,每个交易系统包括至少一个共识节点和至少一个普通节点。Wherein, the blockchain network includes multiple transaction systems, and each transaction system includes at least one consensus node and at least one common node.
一种实施例中,普通节点可以与同一交易系统中的共识节点连接,实现与区块链网络建立连接。In one embodiment, ordinary nodes can be connected to consensus nodes in the same transaction system to establish a connection with the blockchain network.
可选的,交易系统,例如可以为银行IT系统、运营商管理系统、各行业系统等任意一种。Optionally, the transaction system may be, for example, any one of a bank IT system, an operator management system, and various industry systems.
当交易系统为银行IT系统时,共识节点可以对应各个管辖域的货币当局,例如,中央银行(central bank)。普通节点可以对应由货币当局管辖的域内参与机构,例如,中央银行管理的各个商业银行。When the transaction system is a bank IT system, the consensus node can correspond to the monetary authority of each jurisdiction, for example, the central bank (central bank). Ordinary nodes can correspond to participating institutions in the domain governed by monetary authorities, for example, various commercial banks managed by the central bank.
可选的,多个区块链节点可以包括共识节点101、共识节点102、共识节点103、共识节点104、普通节点81、普通节点82、普通节点83和普通节点84。Optionally, multiple blockchain nodes may include
多个设备可以包括与共识节点101连接的服务端91、与共识节点102连接的服务端92、与共识节点103连接的服务端93、与共识节点104连接的服务端94、与普通节点81连接的服务端95、与普通节点82连接的服务端96、与普通节点83连接的服务端97、与普通节点84连接的服务端98。Multiple devices may include a server 91 connected to the
一些实施例中,区块链节点为具有通信功能以及存储功能的设备,可以是单独的一个服务器,或者,也可以是由多个服务器构成的服务器集群。部分实施方式中,服务器集群还可以是分布式集群。本申请对区块链节点的具体实现方式也不作限制。In some embodiments, the blockchain node is a device with communication function and storage function, which may be a single server, or may be a server cluster composed of multiple servers. In some implementations, the server cluster may also be a distributed cluster. This application does not limit the specific implementation of blockchain nodes.
一些实施例中,服务端是为用户提供数据服务的设备,可以是单独的一个服务器,或者,也可以是由多个服务器构成的服务器集群。部分实施方式中,服务器集群还可以是分布式集群。本申请对服务端的具体实现方式也不作限制。In some embodiments, the server is a device that provides data services for users, and may be a single server, or may be a server cluster composed of multiple servers. In some implementations, the server cluster may also be a distributed cluster. The present application does not limit the specific implementation manner of the server either.
需要说明的是,上述区块链节点和服务端均可以称为电子设备。It should be noted that both the aforementioned blockchain nodes and servers can be referred to as electronic devices.
本公开实施例提供的信息获取方法可以应用于前述图1所示的应用场景中的第一区块链节点,第一区块链节点为区块链网络中的任意一个区块链节点。如图2所示,该信息获取方法可以包括:The information acquisition method provided by the embodiments of the present disclosure can be applied to the first blockchain node in the application scenario shown in FIG. 1 above, where the first blockchain node is any blockchain node in the blockchain network. As shown in Figure 2, the information acquisition method may include:
S201、第一区块链节点接收第一交易系统的目标设备发送的信息获取请求。S201. The first blockchain node receives an information acquisition request sent by a target device of the first transaction system.
可选的,第一区块链节点即可以是共识节点,也可以是普通节点。Optionally, the first blockchain node can be either a consensus node or an ordinary node.
可选的,第一交易系统的目标设备可以是与第一区块链节点连接的任意一个服务端。Optionally, the target device of the first transaction system may be any server connected to the first blockchain node.
其中,信息获取请求用于请求获取区块链网络中,第二交易系统的交易信息。第一交易系统与第二交易系统为区块链网络中两个不同的交易系统。Wherein, the information acquisition request is used to request acquisition of transaction information of the second transaction system in the blockchain network. The first transaction system and the second transaction system are two different transaction systems in the blockchain network.
可选的,交易信息可以包括:KYC信息、交易事件的输入(input)数据,例如输入地址(address)和输入金额(amount),还可以包括交易事件的输出(output)数据,例如输出地址和输出金额,以及交易事件的交易标识。Optionally, the transaction information may include: KYC information, input data of transaction events, such as input address (address) and input amount (amount), and may also include output data of transaction events, such as output address and Output the amount, and the transaction ID of the transaction event.
可选的,交易标识可以包括:交易事件的交易哈希值(transaction hash,Txhash)、交易事件的交易号、交易事件的交易索引值(transaction index,Tx index)等交易事件的唯一标识。Optionally, the transaction identifier may include: a transaction hash value (transaction hash, Txhash) of the transaction event, a transaction number of the transaction event, a transaction index value (transaction index, Tx index) of the transaction event, and other unique identifiers of the transaction event.
可选的,信息获取请求可以包括:第二交易系统的标识信息和目标设备的标识信息。Optionally, the information acquisition request may include: identification information of the second transaction system and identification information of the target device.
可选的,如图3所示,标识信息可以包括:与第二交易系统对应的金融机构编码、钱包编码、全球用户识别编码(legal entity identifier,LEI)、管辖域或地区标识、机构名称、机构公钥和机构基本信息中的至少一个。Optionally, as shown in Figure 3, the identification information may include: a financial institution code corresponding to the second transaction system, a wallet code, a global user identification code (legal entity identifier, LEI), a jurisdiction or region identifier, an institution name, At least one of the organization's public key and the organization's basic information.
可选的,管辖域或地区标识可以为管辖域或地区的名称或者区号等。Optionally, the jurisdiction domain or region identifier may be the name or area code of the jurisdiction domain or region.
可选的,机构基本信息可以包括:机构详细地址、联系方式、行业代码、用户信息等。Optionally, the basic information of the institution may include: detailed address of the institution, contact information, industry code, user information, etc.
S202、第一区块链节点根据第二交易系统的标识信息,调用预先创建的智能合约,获取第二交易系统的交易信息。S202. The first block chain node invokes a pre-created smart contract according to the identification information of the second transaction system to obtain transaction information of the second transaction system.
可选的,如图4所示,智能合约中存储的数据可以包括:任意一个交易系统中,共识节点的标识信息,以及与共识节点连接的普通节点的标识信息、秘钥信息、交易策略信息、信息获取策略信息等普通节点的相关信息。智能合约的功能可以包括:获取任意一个交易系统的交易信息,以及创建任意一个交易系统的合约交易事件。Optionally, as shown in Figure 4, the data stored in the smart contract may include: in any transaction system, the identification information of the consensus node, as well as the identification information, secret key information, and transaction strategy information of ordinary nodes connected to the consensus node , information acquisition policy information and other related information of ordinary nodes. The functions of the smart contract can include: obtaining transaction information of any trading system, and creating contract transaction events of any trading system.
在一种可以实现的方式中,第一区块链节点可以从智能合约中,确定信息获取策略信息。然后,第一区块链节点可以基于信息获取策略信息,获取第二交易系统的交易信息。In a practicable manner, the first blockchain node can obtain policy information by determining information from the smart contract. Then, the first block chain node can acquire the transaction information of the second transaction system based on the information acquisition strategy information.
可选的,信息获取策略信息包括:第一区块链节点在区块链网络中的信息获取权限、服务等级和优先等级等。Optionally, the information acquisition policy information includes: the information acquisition authority, service level, and priority level of the first blockchain node in the blockchain network.
在一种可以实现的方式中,第一区块链节点根据第二交易系统的标识信息,调用预先创建的智能合约,获取第二交易系统的交易信息的方法可以包括:第一区块链节点调用智能合约,获取预先存储的交易信息列表。其中,交易信息列表中包括多个交易系统的标识信息一一对应的多个交易信息。然后,第一区块链节点可以从交易信息列表中获取与第二交易系统的标识信息对应的交易信息,即第二交易系统的交易信息。In a manner that can be implemented, the first block chain node invokes a pre-created smart contract according to the identification information of the second transaction system, and the method for obtaining transaction information of the second transaction system may include: the first block chain node Call the smart contract to obtain a list of pre-stored transaction information. Wherein, the transaction information list includes a plurality of transaction information in one-to-one correspondence with identification information of a plurality of transaction systems. Then, the first block chain node can obtain the transaction information corresponding to the identification information of the second transaction system from the transaction information list, that is, the transaction information of the second transaction system.
S203、第一区块链节点向目标设备发送第二交易系统的交易信息。S203. The first blockchain node sends the transaction information of the second transaction system to the target device.
上述实施例提供的技术方案至少带来以下有益效果:由S201-S203可知,可以接收第一交易系统的目标设备发送的信息获取请求,其中,信息获取请求用于请求获取区块链网络中,第二交易系统的交易信息。然后可以调用预先创建的智能合约,根据信息获取请求包括的第二交易系统的标识信息,获取第二交易系统的交易信息,并向目标设备发送第二交易系统的交易信息。由于区块链网络具有区块链节点之间数据同步的特性、且智能合约可以保障信息获取的可信环境,因此,第一交易系统的目标设备可以通过区块链网络安全获取到第二交易系统的交易信息。相对于通用技术,减少了多种技术的使用,进而有效提高了跨系统进行信息获取的效率。The technical solutions provided by the above embodiments bring at least the following beneficial effects: It can be seen from S201-S203 that the information acquisition request sent by the target device of the first transaction system can be received, wherein the information acquisition request is used to request the acquisition of the blockchain network, Transaction information of the second transaction system. Then, the pre-created smart contract can be invoked, and the transaction information of the second transaction system can be obtained according to the identification information of the second transaction system included in the information acquisition request, and the transaction information of the second transaction system can be sent to the target device. Since the blockchain network has the characteristics of data synchronization between blockchain nodes and smart contracts can guarantee a trusted environment for information acquisition, the target device of the first transaction system can safely obtain the second transaction through the blockchain network. System transaction information. Compared with general-purpose technology, the use of multiple technologies is reduced, thereby effectively improving the efficiency of cross-system information acquisition.
在一种可选的实施例中,当智能合约包括第二交易系统的秘钥信息时,在图2示出的方法实施例的基础上,如图5所示,S202中,第一区块链节点调用预先创建的智能合约,根据第二交易系统的标识信息,获取第二交易系统的交易信息的方法包括:In an optional embodiment, when the smart contract includes the secret key information of the second transaction system, on the basis of the method embodiment shown in FIG. 2 , as shown in FIG. 5 , in S202, the first block The chain node calls the pre-created smart contract, and according to the identification information of the second transaction system, the method of obtaining the transaction information of the second transaction system includes:
S501、第一区块链节点根据第二交易系统的标识信息,从智能合约中获取第二交易系统的秘钥信息。S501. The first block chain node obtains the secret key information of the second transaction system from the smart contract according to the identification information of the second transaction system.
为了进一步提高区块链网络中的信息安全性,区块链网络中的交易信息可以通过加密处理,以加密信息存储在区块链网络中。当第一区块链节点想要获取第二交易系统的交易信息时,需要先获取与第二交易系统的交易信息对应的秘钥信息。In order to further improve the information security in the blockchain network, the transaction information in the blockchain network can be processed through encryption, and the encrypted information is stored in the blockchain network. When the first block chain node wants to obtain the transaction information of the second transaction system, it needs to first obtain the secret key information corresponding to the transaction information of the second transaction system.
可选的,秘钥信息可以包括:机构公钥、机构私钥、数字证书、加密算法、内容感知、加密格式等。Optionally, the secret key information may include: organization public key, organization private key, digital certificate, encryption algorithm, content awareness, encryption format, etc.
在一种可以实现的方式中,第一区块链节点获取第二交易系统的秘钥信息的方法可以包括:第一区块链节点可以根据第二交易系统的标识信息,从智能合约中确定预先存储的第二交易系统的标识信息对应的第二交易系统的相关信息,然后从相关信息中读取秘钥信息。In a practicable manner, the method for the first blockchain node to obtain the secret key information of the second transaction system may include: the first blockchain node may determine from the smart contract according to the identification information of the second transaction system The pre-stored identification information of the second transaction system corresponds to the relevant information of the second transaction system, and then reads the key information from the relevant information.
在另一种可以实现的方式中,当标识信息包括秘钥信息时,第一区块链节点获取第二交易系统的秘钥信息的方法还可以包括:第一区块链节点读取第二交易系统的标识信息,获取第二交易系统的秘钥信息。In another practicable manner, when the identification information includes secret key information, the method for the first blockchain node to obtain the secret key information of the second transaction system may also include: the first blockchain node reads the second The identification information of the transaction system is used to obtain the secret key information of the second transaction system.
S502、第一区块链节点根据第二交易系统的秘钥信息,对区块链网络中的加密信息进行解密处理,以得到第二交易系统的交易信息。S502. The first blockchain node decrypts the encrypted information in the blockchain network according to the secret key information of the second transaction system, so as to obtain transaction information of the second transaction system.
可选的,解密处理包括公钥解密、私钥解密、数字证书解密等。Optionally, the decryption processing includes public key decryption, private key decryption, digital certificate decryption, and the like.
上述实施例提供的技术方案至少带来以下有益效果:由S501-S502可知,由于区块链技术存在公开透明的特性,因此当需要保证交易信息的安全性时,除了调用智能合约还可以对交易信息进行加密处理,存储处理后的加密信息。当第一区块链节点想要获取第二交易系统的交易信息时,需要先从智能合约中获取第二交易系统的秘钥信息,然后,根据第二交易系统的秘钥信息,对区块链网络中的加密信息进行解密处理,以得到第二交易系统的交易信息。本公开有效提高了区块链网络中的交易信息的安全性。The technical solutions provided by the above embodiments bring at least the following beneficial effects: It can be seen from S501-S502 that due to the open and transparent nature of blockchain technology, when it is necessary to ensure the security of transaction information, in addition to calling the smart contract, the transaction can also be The information is encrypted, and the encrypted information is stored. When the first block chain node wants to obtain the transaction information of the second transaction system, it needs to obtain the secret key information of the second transaction system from the smart contract first, and then, according to the secret key information of the second transaction system, block The encrypted information in the chain network is decrypted to obtain the transaction information of the second transaction system. The disclosure effectively improves the security of transaction information in a blockchain network.
在一种可选的实施例中,在智能合约还包括第二交易系统的交易策略信息的情况下,当第一区块链节点为区块链网络中的共识节点时,在图5示出的方法实施例的基础上,本实施例提供一种可能实现方式。结合图5,如图6所示,该信息获取方法,还包括:In an optional embodiment, in the case where the smart contract also includes the transaction strategy information of the second transaction system, when the first blockchain node is a consensus node in the blockchain network, as shown in Figure 5 Based on the method embodiment, this embodiment provides a possible implementation manner. In conjunction with Figure 5, as shown in Figure 6, the information acquisition method also includes:
S601、第一区块链节点获取第二交易系统的交易请求。S601. The first blockchain node obtains a transaction request from the second transaction system.
其中,交易请求包括:第二交易系统的标识信息,以及待同步至区块链网络的第二交易系统的交易信息。Wherein, the transaction request includes: identification information of the second transaction system, and transaction information of the second transaction system to be synchronized to the blockchain network.
当第二交易系统通过第二区块链节点在区块链网络中发起交易时,需要向区块链网络中的共识节点发送交易请求,共识节点可以对交易请求进行验证。When the second transaction system initiates a transaction in the blockchain network through the second blockchain node, it needs to send a transaction request to a consensus node in the blockchain network, and the consensus node can verify the transaction request.
在一种可以实现的方式中,第二区块链节点向区块链网络中的共识节点发送交易请求的方法可以包括:第二区块链节点向任意一个共识节点发送交易请求。该共识节点对交易请求中包括的第二交易系统的标识信息和待交易的交易信息打包成区块,并向区块链网络中的其他共识节点广播该区块。In a practicable manner, the method for the second blockchain node to send a transaction request to a consensus node in the blockchain network may include: the second blockchain node sends a transaction request to any consensus node. The consensus node packs the identification information of the second transaction system included in the transaction request and the transaction information to be traded into a block, and broadcasts the block to other consensus nodes in the blockchain network.
S602、第一区块链节点根据第二交易系统的标识信息,从智能合约中获取第二交易系统的交易策略信息。S602. The first block chain node obtains the transaction strategy information of the second transaction system from the smart contract according to the identification information of the second transaction system.
可选的,交易策略信息可以包括:第二交易系统在区块链网络中对应的发行注销的参数、交易权限和交易限额等。Optionally, the transaction strategy information may include: the parameters of issuance and deregistration corresponding to the second transaction system in the blockchain network, transaction authority and transaction limit, etc.
S603、第一区块链节点根据第二交易系统的交易策略信息,执行智能合约的验证操作,以得到第二交易系统的交易信息的第一验证结果。S603. The first block chain node executes the verification operation of the smart contract according to the transaction strategy information of the second transaction system, so as to obtain a first verification result of the transaction information of the second transaction system.
可选的,当区块链网络中的多个共识节点中,对第二交易系统的交易信息验证通过的共识节点的数量,与多个共识节点的数量的比值大于或等于预设比值时,第一验证结果表示第二交易系统的交易信息在区块链网络中达成共识。反之,对第二交易系统的交易信息验证通过的共识节点的数量,与多个共识节点的数量的比值小于预设比值时,第一验证结果表示第二交易系统的交易信息在区块链网络中没有达成共识。Optionally, when among multiple consensus nodes in the blockchain network, the ratio of the number of consensus nodes that pass the transaction information verification of the second transaction system to the number of multiple consensus nodes is greater than or equal to the preset ratio, The first verification result indicates that the transaction information of the second transaction system has reached a consensus in the blockchain network. Conversely, when the ratio of the number of consensus nodes that pass the verification of the transaction information of the second transaction system to the number of multiple consensus nodes is less than the preset ratio, the first verification result indicates that the transaction information of the second transaction system is in the blockchain network. No consensus was reached.
在一种可以实现的方式中,当第一验证结果表示第二交易系统的交易信息在区块链网络中没有达成共识时,第一区块链节点可以向第二区块链节点发送指示停止本次交易的指示消息。In a practicable manner, when the first verification result indicates that the transaction information of the second transaction system does not reach a consensus in the blockchain network, the first blockchain node can send an instruction to the second blockchain node to stop The instruction message for this transaction.
S604、当第一验证结果表示第二交易系统的交易信息在区块链网络中达成共识时,第一区块链节点根据第二交易系统的秘钥信息,对第二交易系统的交易信息进行加密处理,以得到加密信息。S604. When the first verification result indicates that the transaction information of the second transaction system has reached a consensus in the blockchain network, the first blockchain node performs the transaction information of the second transaction system according to the secret key information of the second transaction system. Encryption processing to obtain encrypted information.
可选的,加密处理包括公钥加密、私钥加密、数字证书加密等。Optionally, the encryption process includes public key encryption, private key encryption, digital certificate encryption, and the like.
示例性的,如图7所示,区块链网络中的共识节点701预先创建智能合约之后,可以在区块链网络中发布智能合约。然后,区块链网络中区块链节点702想要在区块链网络中同步交易信息时,可以向其他区块链节点广播交易请求,以使得共识节点701获取到上述交易请求。共识节点701与其他共识节点对上述交易请求达成共识后,可以在区块链中发布区块链节点702的交易信息对应的区块。Exemplarily, as shown in FIG. 7 , after the
上述实施例提供的技术方案至少带来以下有益效果:由S601-S604可知,当第二交易系统的交易信息满足第二交易系统的交易策略信息时,表示允许第二交易系统的本次交易,此时,区块链网络中的任意一个共识节点可以将达成共识的第二交易系统的交易信息打包成区块,以实现第二交易系统的交易信息在区块链网络中的共享。为了进一步提高区块链网络中的交易信息的安全性,可以根据预先创建的智能合约中的秘钥信息,对交易信息进行加密处理。The technical solutions provided by the above embodiments bring at least the following beneficial effects: It can be seen from S601-S604 that when the transaction information of the second transaction system satisfies the transaction strategy information of the second transaction system, it means that the current transaction of the second transaction system is allowed, At this point, any consensus node in the blockchain network can package the consensus transaction information of the second transaction system into a block, so as to realize the sharing of transaction information of the second transaction system in the blockchain network. In order to further improve the security of transaction information in the blockchain network, the transaction information can be encrypted according to the secret key information in the pre-created smart contract.
在一种可选的实施例中,在图6示出的方法实施例的基础上,本实施例提供一种可能实现方式。如图8所示,信息获取方法,还包括:In an optional embodiment, on the basis of the method embodiment shown in FIG. 6 , this embodiment provides a possible implementation manner. As shown in Figure 8, the information acquisition method also includes:
S801、第一区块链节点监听区块链网络中的交易事件。S801. The first blockchain node monitors transaction events in the blockchain network.
在一种可以实现的方式中,第一区块链节点监听区块链网络中的交易事件的方法可以包括:第一区块链节点获取区块链网络中的交易请求。In a practicable manner, the method for the first blockchain node to monitor transaction events in the blockchain network may include: the first blockchain node acquires transaction requests in the blockchain network.
S802、当监听目标交易事件之后,第一区块链节点获取目标交易事件对应的目标交易系统的相关信息。S802. After monitoring the target transaction event, the first blockchain node acquires relevant information of the target transaction system corresponding to the target transaction event.
其中,相关信息包括:标识信息、交易信息、秘钥信息和交易策略信息。Wherein, the relevant information includes: identification information, transaction information, secret key information and transaction strategy information.
目标交易事件为区块链网络中的任意一个交易事件。The target transaction event is any transaction event in the blockchain network.
S803、第一区块链节点在智能合约中存储目标交易系统的相关信息。S803. The first blockchain node stores relevant information of the target transaction system in the smart contract.
在一种可选的实施例中,在图8示出的方法实施例的基础上,结合图5,如图9所示,S501中,第一区块链节点根据第二交易系统的标识信息,从智能合约中获取第二交易系统的秘钥信息的方法包括:In an optional embodiment, on the basis of the method embodiment shown in FIG. 8, combined with FIG. 5, as shown in FIG. 9, in S501, the first blockchain node , the method of obtaining the secret key information of the second transaction system from the smart contract includes:
S901、第一区块链节点从智能合约中确定与第二交易系统的标识信息对应的第二交易系统的相关信息。S901. The first block chain node determines the relevant information of the second transaction system corresponding to the identification information of the second transaction system from the smart contract.
S902、第一区块链节点从第二交易系统的相关信息中读取第二交易系统的秘钥信息。S902. The first blockchain node reads the key information of the second transaction system from the relevant information of the second transaction system.
在一种可选的实施例中,在图2示出的方法实施例的基础上,如图10所示,S202中,第一区块链节点调用预先创建的智能合约,根据第二交易系统的标识信息,获取第二交易系统的交易信息的方法包括:In an optional embodiment, on the basis of the method embodiment shown in FIG. 2 , as shown in FIG. 10 , in S202, the first blockchain node invokes a pre-created smart The method for obtaining the transaction information of the second transaction system includes:
S1001、第一区块链节点调用智能合约,确定预先存储的交易信息列表。S1001. The first blockchain node invokes the smart contract to determine a list of pre-stored transaction information.
其中,交易信息列表包括:区块链网络中,任意一个交易系统的标识信息与交易信息的对应关系。Wherein, the transaction information list includes: in the blockchain network, the correspondence between the identification information of any transaction system and the transaction information.
可选的,交易信息列表可以包括至少一个键值(key-value,KV)对。键为一个交易系统的标识信息,值为该区块链节点的交易信息。Optionally, the transaction information list may include at least one key-value (KV) pair. The key is the identification information of a transaction system, and the value is the transaction information of the blockchain node.
S1002、第一区块链节点将交易信息列表中,与第二交易系统的标识信息对应的交易信息,确定为第二交易系统的交易信息。S1002. The first block chain node determines the transaction information corresponding to the identification information of the second transaction system in the transaction information list as the transaction information of the second transaction system.
上述实施例提供的技术方案至少带来以下有益效果:由S1001-S1002可知,第一区块链节点调用智能合约,确定预先存储的交易信息列表。当需要获取第二交易系统的交易信息时,第一区块链节点可以将交易信息列表中,与获取到的第二交易系统的标识信息对应的交易信息,确定为第二交易系统的交易信息。缩短了遍历区块链网络中存储的多个交易信息的过程,有效提高了信息获取的效率。The technical solutions provided by the above embodiments bring at least the following beneficial effects: It can be known from S1001-S1002 that the first blockchain node invokes the smart contract to determine the pre-stored transaction information list. When it is necessary to obtain the transaction information of the second transaction system, the first block chain node can determine the transaction information corresponding to the acquired identification information of the second transaction system in the transaction information list as the transaction information of the second transaction system . The process of traversing multiple transaction information stored in the blockchain network is shortened, and the efficiency of information acquisition is effectively improved.
在一种可选的实施例中,在图10示出的方法实施例的基础上,如图11所示,信息获取方法还包括:In an optional embodiment, on the basis of the method embodiment shown in FIG. 10 , as shown in FIG. 11 , the information acquisition method further includes:
S1101、第一区块链节点获取任意一个交易系统的标识信息,以及任意一个交易系统的交易信息。S1101. The first blockchain node obtains identification information of any transaction system and transaction information of any transaction system.
在一种可以实现的方式中,第一区块链节点获取任意一个交易系统的标识信息,以及任意一个交易系统的交易信息可以包括:第一区块链节点通过监听区块链网络中的交易事件,获取交易事件对应的交易系统的标识信息和交易信息。In a practicable manner, obtaining the identification information of any transaction system by the first blockchain node, and the transaction information of any transaction system may include: the first blockchain node listens to the transaction in the blockchain network Event, to obtain the identification information and transaction information of the transaction system corresponding to the transaction event.
S1102、第一区块链节点创建对应关系,并在历史交易信息列表中存储对应关系,以得到交易信息列表。S1102. The first blockchain node creates a corresponding relationship, and stores the corresponding relationship in the historical transaction information list to obtain the transaction information list.
可选的,历史交易信息列表可以包括历史交易事件中交易系统的标识信息和交易信息的对应关系。Optionally, the historical transaction information list may include a correspondence between the identification information of the transaction system in the historical transaction event and the transaction information.
上述实施例提供的技术方案至少带来以下有益效果:由S1101-S1102可知,第一区块链节点可以根据获取到的任意一个交易事件中的交易系统的标识信息和交易信息,创建标识信息与交易信息的对应关系,并在历史交易信息列表中存储对应关系,可以实现对交易信息列表的实时更新。The technical solutions provided by the above embodiments bring at least the following beneficial effects: From S1101-S1102, it can be known that the first block chain node can create identification information and transaction information based on the acquired identification information and transaction information of the transaction system in any transaction event The corresponding relationship of the transaction information, and storing the corresponding relationship in the historical transaction information list, can realize the real-time update of the transaction information list.
可以理解的,在实际实施时,本公开实施例所述的信息获取装置可以包含有用于实现前述对应信息获取方法的一个或多个硬件结构和/或软件模块,这些执行硬件结构和/或软件模块可以构成一个电子设备。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的算法步骤,本公开能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本公开的范围。It can be understood that, in actual implementation, the information acquisition device described in the embodiments of the present disclosure may include one or more hardware structures and/or software modules for implementing the aforementioned corresponding information acquisition methods, and these hardware structures and/or software modules execute Modules can constitute an electronic device. Those skilled in the art should easily realize that, in combination with the algorithm steps of the examples described in the embodiments disclosed herein, the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementation should not be considered beyond the scope of the present disclosure.
基于这样的理解,本公开实施例还对应提供一种信息获取装置。图12示出了本公开实施例提供的信息获取装置的结构示意图一。如图12所示,该信息获取装置应用于区块链网络中的第一区块链节点,包括:通信单元1201和处理单元1202。Based on this understanding, the embodiments of the present disclosure further provide an information acquisition apparatus. FIG. 12 shows a first schematic structural diagram of an information acquisition device provided by an embodiment of the present disclosure. As shown in FIG. 12 , the information acquisition device is applied to the first blockchain node in the blockchain network, and includes: a
通信单元1201,用于接收第一交易系统的目标设备发送的信息获取请求;信息获取请求用于请求获取第二交易系统的交易信息;信息获取请求包括:第二交易系统的标识信息;第一交易系统与第二交易系统为区块链网络中两个不同的交易系统。The
处理单元1202,用于根据通信单元1201接收的第二交易系统的标识信息,调用预先创建的智能合约,获取第二交易系统的交易信息。The
通信单元1201,还用于向目标设备发送处理单元1202获取的第二交易系统的交易信息。The
可选的,智能合约包括:第二交易系统的秘钥信息;处理单元1202,具体用于:根据第二交易系统的标识信息,从智能合约中获取第二交易系统的秘钥信息;根据第二交易系统的秘钥信息,对区块链网络中的加密信息进行解密处理,以得到第二交易系统的交易信息。Optionally, the smart contract includes: the secret key information of the second transaction system; the
可选的,智能合约还包括:第二交易系统的交易策略信息;处理单元1202,还用于:获取第二交易系统的交易请求;交易请求包括:第二交易系统的标识信息,以及待同步至区块链网络的第二交易系统的交易信息;根据第二交易系统的标识信息,从智能合约中获取第二交易系统的交易策略信息;根据第二交易系统的交易策略信息,执行智能合约的验证操作,以得到第二交易系统的交易信息的第一验证结果;当第一验证结果表示第二交易系统的交易信息在区块链网络中达成共识时,根据第二交易系统的秘钥信息,对第二交易系统的交易信息进行加密处理,以得到加密信息。Optionally, the smart contract further includes: transaction strategy information of the second transaction system; the
可选的,处理单元1202,还用于:监听区块链网络中的交易事件;当监听目标交易事件之后,获取目标交易事件对应的目标交易系统的相关信息;相关信息包括:标识信息、交易信息、秘钥信息和交易策略信息;目标交易事件为区块链网络中的任意一个交易事件;在智能合约中存储目标交易系统的相关信息。Optionally, the
可选的,处理单元1202,具体用于:从智能合约中确定与第二交易系统的标识信息对应的第二交易系统的相关信息;从第二交易系统的相关信息中读取第二交易系统的秘钥信息。Optionally, the
可选的,处理单元1202,具体用于:调用智能合约,确定预先存储的交易信息列表;交易信息列表包括:区块链网络中,任意一个交易系统的标识信息与交易信息的对应关系;将交易信息列表中,与第二交易系统的标识信息对应的交易信息,确定为第二交易系统的交易信息。Optionally, the
可选的,处理单元1202,还用于:获取任意一个交易系统的标识信息,以及任意一个交易系统的交易信息;创建对应关系,并在历史交易信息列表中存储对应关系,以得到交易信息列表。Optionally, the
如上所述,本公开实施例可以根据上述方法示例对区块链节点进行功能模块的划分。其中,上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。另外,还需要说明的是,本公开实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。As mentioned above, the embodiments of the present disclosure can divide the block chain nodes into functional modules according to the above method examples. Wherein, the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. In addition, it should be noted that the division of modules in the embodiment of the present disclosure is schematic, and is only a logical function division, and there may be another division manner in actual implementation. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
关于上述实施例中的信息获取装置,其中各个模块执行操作的具体方式、以及具备的有益效果,均已经在前述方法实施例中进行了详细描述,此处不再赘述。With regard to the information acquisition device in the above embodiments, the specific manner of performing operations of each module and the beneficial effects possessed have been described in detail in the foregoing method embodiments, and will not be repeated here.
本公开实施例还提供一种信息获取装置。图13示出了本公开实施例提供的信息获取装置的结构示意图二。该信息获取装置可以包括至少一个处理器221,通信总线222,存储器223以及至少一个通信接口224。The embodiment of the present disclosure also provides an information acquisition device. FIG. 13 shows a second schematic structural diagram of an information acquisition device provided by an embodiment of the present disclosure. The information acquiring device may include at least one
处理器221可以是一个处理器(central processing units,CPU),微处理单元,ASIC,或一个或多个用于控制本公开方案程序执行的集成电路。结合图12,处理器221用于执行处理单元1202执行的操作。The
通信总线222可包括一通路,在上述组件之间传送信息。Communication bus 222 may include a path for communicating information between the components described above.
通信接口224,使用任何收发器一类的装置,用于与其他设备或通信网络通信,如电子设备、以太网,无线接入网(radio access network,RAN),无线局域网(wirelesslocal area networks,WLAN)等。结合图12,通信接口224用于执行通信单元1201执行的操作。The
存储器223可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electricallyerasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理单元相连接。存储器也可以和处理单元集成在一起。The
其中,存储器223用于存储执行本公开方案的应用程序代码,并由处理器221来控制执行。处理器221用于执行存储器223中存储的应用程序代码,从而实现本公开方法中的功能。Wherein, the
在具体实现中,作为一种实施例,处理器221可以包括一个或多个CPU,例如图13中的处理器0和处理器1。In a specific implementation, as an embodiment, the
在具体实现中,作为一种实施例,信息获取装置可以包括多个处理器,例如图13中的处理器221和处理器225。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an example, the information acquiring apparatus may include multiple processors, for example, the
在具体实现中,作为一种实施例,信息获取装置还可以包括输入设备226和输出设备227。输入设备226和输出设备227通信,可以以多种方式接受用户的输入。例如,输入设备226可以是鼠标、键盘、触摸屏设备或传感设备等。输出设备227和处理器221通信,可以以多种方式来显示信息。例如,输出设备227可以是液晶显示器(liquid crystal display,LCD),发光二级管(light emitting diode,LED)显示设备等。In a specific implementation, as an example, the information acquisition apparatus may further include an
本领域技术人员可以理解,图13中示出的结构并不构成对信息获取装置的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。Those skilled in the art can understand that the structure shown in FIG. 13 does not constitute a limitation on the information acquisition device, and may include more or less components than shown in the figure, or combine certain components, or adopt different component arrangements.
本公开还提供了一种包括指令的计算机可读存储介质,所述计算机可读存储介质上存储有指令,当所述计算机可读存储介质中的指令由信息获取装置的处理器执行时,使得信息获取装置能够执行上述所示实施例提供的信息获取方法。例如,计算机可读存储介质可以为包括指令的存储器223,上述指令可由信息获取装置的处理器221执行以完成上述方法。The present disclosure also provides a computer-readable storage medium including instructions, the computer-readable storage medium stores instructions, and when the instructions in the computer-readable storage medium are executed by the processor of the information acquisition device, the The information acquisition device can execute the information acquisition method provided in the above-mentioned embodiments. For example, the computer-readable storage medium can be the
可选的,计算机可读存储介质可以是非临时性计算机可读存储介质,例如,所述非临时性计算机可读存储介质可以是ROM、RAM、CD-ROM、磁带、软盘和光数据存储设备等。Optionally, the computer-readable storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. The present disclosure is intended to cover any modification, use or adaptation of the present disclosure. These modifications, uses or adaptations follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. . The specification and examples are to be considered exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the precise constructions which have been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211716769.4ACN115860953A (en) | 2022-12-29 | 2022-12-29 | Information acquisition method, device, equipment and storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211716769.4ACN115860953A (en) | 2022-12-29 | 2022-12-29 | Information acquisition method, device, equipment and storage medium |
| Publication Number | Publication Date |
|---|---|
| CN115860953Atrue CN115860953A (en) | 2023-03-28 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211716769.4APendingCN115860953A (en) | 2022-12-29 | 2022-12-29 | Information acquisition method, device, equipment and storage medium |
| Country | Link |
|---|---|
| CN (1) | CN115860953A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114119021A (en)* | 2021-11-30 | 2022-03-01 | 中国工商银行股份有限公司 | Image file security multi-party computing method and system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114119021A (en)* | 2021-11-30 | 2022-03-01 | 中国工商银行股份有限公司 | Image file security multi-party computing method and system |
| CN114119021B (en)* | 2021-11-30 | 2024-12-24 | 中国工商银行股份有限公司 | Image file secure multi-party computing method and system |
| Publication | Publication Date | Title |
|---|---|---|
| JP7454616B2 (en) | DAG-based transaction processing method and system in distributed ledger | |
| JP7502393B2 (en) | SYSTEM AND METHOD FOR SUPPORTING SQL-BASED RICH QUERIES IN A HYPERLEGGIA FABRIC BLOCKCHAIN | |
| US11544254B2 (en) | System and method for managing a blockchain cloud service | |
| CN111090876B (en) | Contract calling method and device | |
| CN113711536B (en) | Extracting data from a blockchain network | |
| CN113168622B (en) | Field-based peer-to-peer admission in blockchain networks | |
| JP7626562B2 (en) | Low Trust Privileged Access Management | |
| US12093407B2 (en) | Systems and methods for virtual distributed ledger networks | |
| CN109492419B (en) | Method, device and storage medium for acquiring data in block chain | |
| CN112154434B (en) | Automatic data projection of smart contract groups on blockchain | |
| CN102170440B (en) | Method suitable for safely migrating data between storage clouds | |
| CN110580412B (en) | Permission query configuration method and device based on chain codes | |
| JP7228322B2 (en) | Auto-commit transaction management in blockchain networks | |
| WO2021017444A1 (en) | Blockchain-based data authorization method and device | |
| US11822538B2 (en) | Systems and methods of transaction identification generation for transaction-based environment | |
| US20200092114A1 (en) | Membership compiler for applications | |
| US11763298B2 (en) | Systems and methods for hybrid synchronization in virtual distributed ledger networks | |
| CN114579585B (en) | Method and system for selectively updating a blockchain's world state database | |
| CN115118434A (en) | Blockchain-based key management method and device | |
| CN115860953A (en) | Information acquisition method, device, equipment and storage medium | |
| US12425186B2 (en) | Reducing transaction aborts in execute-order-validate blockchain models | |
| JP2019068327A (en) | User management device, user management system | |
| CN114358771A (en) | Information sharing system based on block chain | |
| CN118473684A (en) | Block link point access method, device, equipment and storage medium | |
| CN117271468A (en) | Merchant information maintenance method and system based on trusted data frame |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |