CN110874365B - Information query method and related equipment thereof - Google Patents
Information query method and related equipment thereof Download PDFInfo
- Publication number
- CN110874365B CN110874365B CN201911142940.3A CN201911142940A CN110874365B CN 110874365 B CN110874365 B CN 110874365B CN 201911142940 A CN201911142940 A CN 201911142940A CN 110874365 B CN110874365 B CN 110874365B
- Authority
- CN
- China
- Prior art keywords
- information
- data interaction
- target
- query
- interaction information
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
- G06F16/2255—Hash tables
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
- G06F21/6227—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Databases & Information Systems (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Marketing (AREA)
- General Business, Economics & Management (AREA)
- Technology Law (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Strategic Management (AREA)
- Economics (AREA)
- Computational Linguistics (AREA)
- Development Economics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域Technical field
本发明涉及数据交互技术领域,尤其涉及一种信息查询方法,还涉及一种信息查询装置、系统、计算机可读存储介质、计算机程序产品以及一种信息存储方法和系统。The present invention relates to the field of data interaction technology, and in particular to an information query method, an information query device, a system, a computer-readable storage medium, a computer program product, and an information storage method and system.
背景技术Background technique
请参考图1,图1为现有技术中的一种区块链中跨分区交易的流程示意图,当数据交互双方部署于区块链网络的不同分区,即交易双方按照账户地址在区块链上分区分布时,其所进行的交易在FROM分区(交易中的转出账户地址所在分区)和TO分区(交易中的接收账户地址所在分区)上属于同一笔交易,进一步,当一笔跨分区交易产生退费交易(RefundTx)时,可以为RefundTx生成指针originHash指向父交易(产生RefundTx的交易),由此,当进行交易信息查询时,对于一笔子交易,基于其对应的指针即可快速查出父交易,但是,对于一笔父交易,却无法快速查出其是否有子交易产生,更无法查出其产生了哪几笔子交易,如合约调用产生的子交易ContractTx。可见,基于现有的查询方法进行交易信息查询,其所获得的查询结果存在严重的不完整性。Please refer to Figure 1. Figure 1 is a schematic flow chart of a cross-partition transaction in a blockchain in the prior art. When the data interaction parties are deployed in different partitions of the blockchain network, that is, both parties to the transaction are in the blockchain according to their account addresses. When the upper partition is distributed, the transaction it performs belongs to the same transaction in the FROM partition (the partition where the transfer-out account address in the transaction is located) and the TO partition (the partition where the receiving account address in the transaction is located). Furthermore, when a cross-partition When a transaction generates a refund transaction (RefundTx), the pointer originHash can be generated for RefundTx to point to the parent transaction (the transaction that generated RefundTx). Therefore, when querying transaction information, for a sub-transaction, based on its corresponding pointer, it can be quickly Find out the parent transaction. However, for a parent transaction, it is impossible to quickly find out whether it has sub-transactions, let alone which sub-transactions it has generated, such as the sub-transaction ContractTx generated by the contract call. It can be seen that when querying transaction information based on existing query methods, the query results obtained are seriously incomplete.
因此,如何基于特定的交易信息查询到与其相关的所有交易信息,以提高信息完整性是本领域技术人员亟待解决的问题。Therefore, how to query all transaction information related to specific transaction information to improve information integrity is an urgent problem for those skilled in the art to solve.
发明内容Contents of the invention
本发明的主要目的在于提供一种信息查询方法、装置、系统、计算机可读存储介质、计算机程序产品以及一种信息存储方法和系统,旨在解决已有技术中交易信息查询结果不完整的问题。The main purpose of the present invention is to provide an information query method, device, system, computer-readable storage medium, computer program product and an information storage method and system, aiming to solve the problem of incomplete transaction information query results in the prior art. .
为实现上述目的,本发明提供了一种信息查询方法,所述方法包括:To achieve the above objectives, the present invention provides an information query method, which method includes:
当接收到查询指令时,对所述查询指令进行解析,获得目标Hash;When a query instruction is received, the query instruction is parsed to obtain the target Hash;
利用所述目标Hash调取对应的目标数据交互信息;Use the target Hash to retrieve the corresponding target data interaction information;
获取所述目标数据交互信息对应的目标索引信息;其中,所述目标索引信息包括数据交互来源标识和下层数据交互标识;Obtain target index information corresponding to the target data interaction information; wherein the target index information includes a data interaction source identifier and a lower-layer data interaction identifier;
利用所述数据交互来源标识和所述下层数据交互标识进行查询,获得与所述目标数据交互信息相关的所有数据交互信息。Query is performed using the data interaction source identifier and the lower-layer data interaction identifier to obtain all data interaction information related to the target data interaction information.
优选的,所述利用所述目标Hash调取对应的目标数据交互信息,包括:Preferably, using the target Hash to retrieve corresponding target data interaction information includes:
利用所述目标Hash在KV存储数据库中调取所述目标数据交互信息。The target Hash is used to retrieve the target data interaction information in the KV storage database.
优选的,所述利用所述目标Hash在KV存储数据库中调取所述目标数据交互信息,包括:Preferably, using the target Hash to retrieve the target data interaction information in the KV storage database includes:
对所述查询指令进行解析,获得所述目标数据交互信息的目标交互类型;Parse the query instruction to obtain the target interaction type of the target data interaction information;
在所述KV存储数据库中,利用所述目标Hash在所述目标交互类型对应的目标存储路径下调取所述目标数据交互信息。In the KV storage database, the target Hash is used to retrieve the target data interaction information under the target storage path corresponding to the target interaction type.
优选的,产生各所述数据交互信息的各数据交互终端均为组成区块链网络的节点,各所述数据交互终端部署于所述区块链网络的不同分区。Preferably, each data interaction terminal that generates each of the data interaction information is a node that constitutes a blockchain network, and each of the data interaction terminals is deployed in different partitions of the blockchain network.
为实现上述目的,本发明提供了一种信息存储方法,所述方法包括:To achieve the above objectives, the present invention provides an information storage method, which method includes:
当获得数据交互信息时,为所述数据交互信息建立索引信息;其中,所述索引信息包括数据交互来源标识和下层数据交互标识;When the data interaction information is obtained, index information is established for the data interaction information; wherein the index information includes a data interaction source identifier and a lower-layer data interaction identifier;
获取所述数据交互信息的Hash,将所述数据交互信息、所述索引信息和所述Hash对应存储至预设存储空间。Obtain the Hash of the data interaction information, and store the data interaction information, the index information and the Hash correspondingly in a preset storage space.
为实现上述目的,本发明提供了一种信息查询装置,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的信息查询程序,所述信息查询程序被所述处理器执行时实现如上述任意一种所述的信息查询方法的步骤。In order to achieve the above object, the present invention provides an information query device. The device includes a memory and a processor. The memory stores an information query program that can be run on the processor. The information query program is used by the processor. When the processor is executed, the steps of any one of the above information query methods are implemented.
为实现上述目的,本发明提供了一种信息查询系统,所述系统包括:To achieve the above objectives, the present invention provides an information query system, which includes:
指令解析模块,用于当接收到查询指令时,对所述查询指令进行解析,获得目标Hash;The instruction parsing module is used to parse the query instruction when receiving the query instruction to obtain the target Hash;
信息调取模块,用于利用所述目标Hash调取对应的目标数据交互信息;An information retrieval module, used to retrieve the corresponding target data interaction information using the target Hash;
索引获取模块,用于获取所述目标数据交互信息对应的目标索引信息;其中,所述目标索引信息包括数据交互来源标识和下层数据交互标识;An index acquisition module, configured to acquire target index information corresponding to the target data interaction information; wherein the target index information includes a data interaction source identifier and a lower-layer data interaction identifier;
信息查询模块,用于利用所述数据交互来源标识和所述下层数据交互标识进行查询,获得与所述目标数据交互信息相关的所有数据交互信息。An information query module, configured to query using the data interaction source identifier and the lower-layer data interaction identifier to obtain all data interaction information related to the target data interaction information.
为实现上述目的,本发明提供了一种信息存储系统,所述系统包括:To achieve the above objectives, the present invention provides an information storage system, which includes:
索引建立模块,用于当获得数据交互信息时,为所述数据交互信息建立索引信息;其中,所述索引信息包括数据交互来源标识和下层数据交互标识;An index creation module, configured to create index information for the data interaction information when the data interaction information is obtained; wherein the index information includes a data interaction source identifier and a lower-layer data interaction identifier;
信息存储模块,用于获取所述数据交互信息的Hash,将所述数据交互信息、所述索引信息和所述Hash对应存储至预设存储空间。An information storage module is used to obtain the Hash of the data interaction information, and store the data interaction information, the index information and the Hash in a preset storage space.
为实现上述目的,本发明提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有信息查询程序,所述信息查询程序可被一个或多个处理器执行,以实现如上任一种所述的信息查询方法的步骤。In order to achieve the above object, the present invention provides a computer-readable storage medium. An information query program is stored on the computer-readable storage medium. The information query program can be executed by one or more processors to achieve any of the above. The steps of the information query method.
为实现上述目的,本发明提供了一种计算机程序产品,所述计算机程序产品包括计算机指令,当其在计算机上运行时,使得计算机可以执行上述任一种所述的信息查询方法的步骤。To achieve the above object, the present invention provides a computer program product, which includes computer instructions that, when run on a computer, enable the computer to execute the steps of any one of the above information query methods.
本发明所提供的一种信息查询方法,包括当接收到查询指令时,对所述查询指令进行解析,获得目标Hash;利用所述目标Hash调取对应的目标数据交互信息;获取所述目标数据交互信息对应的目标索引信息;其中,所述目标索引信息包括数据交互来源标识和下层数据交互标识;利用所述数据交互来源标识和所述下层数据交互标识进行查询,获得与所述目标数据交互信息相关的所有数据交互信息。可见,本发明所提供的技术方案,预先在数据交互信息产生的同时建立相应的索引信息,加之每条数据交互信息在产生时均会生成相应的Hash,当进行信息存储时,可将三者相互对应存储,由此,当进行信息查询时,即可基于指定的Hash查询到对应的数据交互信息,进而获取到索引信息,由于该索引信息中包括数据交互信息对应的数据交互来源标识和下层数据交互标识,由此,根据数据交互来源标识和下层数据交互标识即可查询到与该数据交互信息相关的所有数据交互信息;进一步,当基于该信息查询方法进行交易信息查询时,即可基于指定的交易信息查询到与该交易信息相关联的所有交易信息,包括产生该交易信息的父交易信息和该交易信息产生的子交易信息,有效保证了交易信息查询结果的完整性。An information query method provided by the present invention includes: when receiving a query instruction, parsing the query instruction to obtain a target Hash; using the target Hash to retrieve corresponding target data interaction information; and obtaining the target data. Target index information corresponding to the interaction information; wherein, the target index information includes a data interaction source identifier and a lower-layer data interaction identifier; use the data interaction source identifier and the lower-layer data interaction identifier to perform a query to obtain the interaction with the target data All data interaction information related to the information. It can be seen that the technical solution provided by the present invention establishes corresponding index information in advance when the data interaction information is generated. In addition, each piece of data interaction information will generate a corresponding Hash when it is generated. When the information is stored, the three can be Stored correspondingly to each other, therefore, when performing information query, the corresponding data interaction information can be queried based on the specified Hash, and then the index information can be obtained, because the index information includes the data interaction source identifier corresponding to the data interaction information and the lower layer Data interaction identifier, therefore, all data interaction information related to the data interaction information can be queried based on the data interaction source identifier and the underlying data interaction identifier; further, when transaction information is queried based on this information query method, it can be queried based on The specified transaction information is queried to find all transaction information associated with the transaction information, including the parent transaction information that generated the transaction information and the child transaction information generated by the transaction information, effectively ensuring the integrity of the transaction information query results.
本发明所提供的一种信息查询装置、系统、计算机可读存储介质、计算机程序产品以及一种信息存储方法和系统,均具有上述有益效果,在此不再赘述。The information query device, system, computer-readable storage medium, computer program product, and information storage method and system provided by the present invention all have the above beneficial effects, which will not be described again here.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without exerting creative efforts.
图1为现有技术中的一种区块链中跨分区交易的流程示意图;Figure 1 is a schematic flow chart of cross-partition transactions in a blockchain in the prior art;
图2为本发明第一实施例的流程示意图;Figure 2 is a schematic flow chart of the first embodiment of the present invention;
图3为本发明第二实施例的流程示意图;Figure 3 is a schematic flow chart of the second embodiment of the present invention;
图4为本发明所提供的一种区块链中跨分区交易的流程示意图;Figure 4 is a schematic flow chart of cross-partition transactions in a blockchain provided by the present invention;
图5为本发明第一实施例揭露的信息查询装置的内部结构示意图;Figure 5 is a schematic diagram of the internal structure of the information query device disclosed in the first embodiment of the present invention;
图6为本发明第三实施例的结构框图;Figure 6 is a structural block diagram of the third embodiment of the present invention;
图7为本发明第四实施例的结构框图。Figure 7 is a structural block diagram of the fourth embodiment of the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose, functional features and advantages of the present invention will be further described with reference to the embodiments and the accompanying drawings.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if present) in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects without necessarily using Used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus that encompasses a series of steps or units and need not be limited to those explicitly listed. Those steps or elements may instead include other steps or elements not expressly listed or inherent to the process, method, product or apparatus.
需要说明的是,在本发明中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本发明要求的保护范围之内。It should be noted that descriptions involving “first”, “second”, etc. in the present invention are for descriptive purposes only and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of indicated technical features. . Therefore, features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In addition, the technical solutions in various embodiments can be combined with each other, but it must be based on the realization by those of ordinary skill in the art. When the combination of technical solutions is contradictory or cannot be realized, it should be considered that such a combination of technical solutions does not exist. , nor within the protection scope required by the present invention.
本发明提供的一种信息查询方法。The invention provides an information query method.
参照图2,图2为本发明第一实施例的流程示意图。Referring to Figure 2, Figure 2 is a schematic flow chart of the first embodiment of the present invention.
在第一实施例中,该方法可以包括:In a first embodiment, the method may include:
S10:当接收到查询指令时,对查询指令进行解析,获得目标Hash;S10: When receiving the query command, parse the query command and obtain the target Hash;
本步骤旨在实现查询指令的解析,以获得目标Hash。具体的,当用户需要进行数据交互信息查询时,可基于相应的终端设备输入查询指令,该查询指令中附加有用户需要查询的数据交互信息的Hash值,即上述目标Hash。其中,该目标Hash是在数据交互双方进行数据交互产生数据交互信息的同时生成的,每条数据交互信息均有其唯一对应的Hash,相当于数据交互信息的唯一标识,因此,可基于Hash实现相应数据交互信息的查询。进一步,通过对获得的查询指令进行解析,即可获得目标Hash,其中,对于解析操作的具体实现过程,参照已有技术即可,本申请在此不再赘述。This step aims to parse the query instructions to obtain the target Hash. Specifically, when the user needs to query data interaction information, he or she can input a query instruction based on the corresponding terminal device. The query instruction is appended with the Hash value of the data interaction information that the user needs to query, that is, the above-mentioned target Hash. Among them, the target Hash is generated when both parties perform data interaction to generate data interaction information. Each piece of data interaction information has its unique corresponding Hash, which is equivalent to the unique identification of the data interaction information. Therefore, it can be implemented based on Hash Query corresponding data interaction information. Furthermore, by parsing the obtained query instructions, the target Hash can be obtained. For the specific implementation process of the parsing operation, please refer to the existing technology, which will not be described in detail here.
S11:利用目标Hash调取对应的目标数据交互信息;S11: Use the target Hash to retrieve the corresponding target data interaction information;
本步骤旨在实现目标数据交互信息的获取,该目标数据交互信息即为用户需要查询的数据交互信息,也即目标Hash对应的数据交互信息,由于每条数据交互信息有且只有一个对应的Hash,因此,可基于目标Hash获取到对应的目标数据交互信息。具体的,当数据交互双方进行数据交互,产生目标数据交互信息时,可将该目标数据交互信息与对应生成的目标Hash一同存储至相应的存储空间,由此,在基于查询指令获取到目标Hash后,即可根据该目标Hash从存储空间中查询到对应的目标数据交互信息。其中,数据交互信息的具体类型并不影响本技术方案的实施,本申请对此不做具体限定,例如,可以为区块链上一笔退款交易过程中所产生的交易信息等。This step aims to obtain the target data interaction information. The target data interaction information is the data interaction information that the user needs to query, that is, the data interaction information corresponding to the target Hash. Since each piece of data interaction information has and has only one corresponding Hash , therefore, the corresponding target data interaction information can be obtained based on the target Hash. Specifically, when the two parties perform data interaction and generate target data interaction information, the target data interaction information can be stored in the corresponding storage space together with the corresponding generated target Hash. Thus, the target Hash is obtained based on the query instruction. Then, the corresponding target data interaction information can be queried from the storage space according to the target Hash. The specific type of data interaction information does not affect the implementation of this technical solution. This application does not specifically limit this. For example, it can be transaction information generated during a refund transaction on the blockchain, etc.
优选的,上述利用目标Hash调取对应的目标数据交互信息,可以包括:利用目标Hash在KV存储数据库(Key-Value,键值存储数据库)中调取目标数据交互信息。Preferably, the above method of using the target Hash to retrieve the corresponding target data interaction information may include: using the target Hash to retrieve the target data interaction information in a KV storage database (Key-Value, key-value storage database).
本申请实施例提供了一种较为具体的关于各类数据信息的存储方式,即基于KV存储数据库的数据存储,即将各个数据交互信息及其对应的Hash、索引信息对应存储至KV存储数据库中。其中,KV存储数据库是一种NoSQL(非关系型数据库)模型,其中的数据信息可以按照键值对的形式进行组织、索引和存储,具有较高的读写性能。The embodiment of this application provides a more specific storage method for various types of data information, that is, data storage based on KV storage database, that is, each data interaction information and its corresponding hash and index information are correspondingly stored in the KV storage database. Among them, the KV storage database is a NoSQL (non-relational database) model, in which data information can be organized, indexed and stored in the form of key-value pairs, and has high read and write performance.
优选的,上述利用目标Hash在KV存储数据库中调取目标数据交互信息,可以包括:对查询指令进行解析,获得目标数据交互信息的目标交互类型;在KV存储数据库中,利用目标Hash在目标交互类型对应的目标存储路径下调取目标数据交互信息。Preferably, the above-mentioned use of the target Hash to retrieve the target data interaction information in the KV storage database may include: parsing the query instructions to obtain the target interaction type of the target data interaction information; in the KV storage database, using the target Hash to retrieve the target data interaction information in the KV storage database. The target data interaction information is retrieved from the target storage path corresponding to the type.
具体的,各类数据信息在KV存储数据库中可以分类存储,例如转账数据信息和退款数据信息分别存储于不同的存储路径下,或不同类型的客户的数据交互信息分别存储于不同的存储路径下,进一步,用户输入的查询指令还可以包括目标交互类型信息,以便通过数据解析确定目标数据交互信息对应的目标交互类型,进而从对应的目标存储路径下调取目标数据交互信息。Specifically, various types of data information can be classified and stored in the KV storage database. For example, transfer data information and refund data information are stored in different storage paths respectively, or data interaction information of different types of customers are stored in different storage paths respectively. Next, further, the query command input by the user may also include target interaction type information, so as to determine the target interaction type corresponding to the target data interaction information through data analysis, and then retrieve the target data interaction information from the corresponding target storage path.
S12:获取目标数据交互信息对应的目标索引信息;其中,目标索引信息包括数据交互来源标识和下层数据交互标识;S12: Obtain the target index information corresponding to the target data interaction information; wherein, the target index information includes the data interaction source identifier and the lower-layer data interaction identifier;
本步骤旨在实现目标索引信息的获取,该目标索引信息对应于目标数据交互信息。具体而言,可以在目标数据交互信息产生时,为其创建目标索引信息,其中包括目标数据交互信息对应的数据交互来源标识和下层数据交互标识;进一步,在信息存储过程中,将目标索引信息与目标数据交互信息、目标Hash一同对应存储至存储空间,由此,在获得目标数据交互信息后,即可快速方便的获取到其对应的目标索引信息。其中,数据交互来源标识为目标数据交互信息对应的上层数据交互信息的相关标识信息,下层数据交互标识为目标数据交互信息对应的下层数据交互信息的相关标识信息,基于该标识可以方便快捷的查询到与目标数据交互信息相关的其他数据交互信息。This step aims to achieve the acquisition of target index information, which corresponds to the target data interaction information. Specifically, when the target data interaction information is generated, target index information can be created for it, including the data interaction source identifier and the underlying data interaction identifier corresponding to the target data interaction information; further, during the information storage process, the target index information The target data interaction information and the target Hash are correspondingly stored in the storage space. Therefore, after obtaining the target data interaction information, the corresponding target index information can be obtained quickly and conveniently. Among them, the data interaction source identifier is the relevant identification information of the upper-layer data interaction information corresponding to the target data interaction information, and the lower-layer data interaction identifier is the relevant identification information of the lower-layer data interaction information corresponding to the target data interaction information. Based on this identification, it can be conveniently and quickly queried. to other data interaction information related to the target data interaction information.
S13:利用数据交互来源标识和下层数据交互标识进行查询,获得与目标数据交互信息相关的所有数据交互信息。S13: Use the data interaction source identifier and the underlying data interaction identifier to query to obtain all data interaction information related to the target data interaction information.
本步骤旨在实现数据交互信息的查询,即基于数据交互来源标识和下层数据交互标识查询获得与目标数据交互信息相关的所有数据交互信息。以交易信息查询为例,通过指定Hash获得目标交易信息,并获得对应的目标索引信息后,即可基于其中的数据交互来源标识获得产生该目标交易信息的父交易信息(对应于产生目标数据交互信息的上层数据交互信息),基于其中的下层数据交互标识获得该目标交易信息产生的子交易信息(对应于目标数据交互信息产生的下层数据交互信息),由此,即可获得所有与目标交易信息相关的所有交易信息,保证了交易信息的完整性。This step aims to implement the query of data interaction information, that is, to obtain all data interaction information related to the target data interaction information based on the query of the data interaction source identifier and the underlying data interaction identifier. Taking transaction information query as an example, after obtaining the target transaction information by specifying the Hash and obtaining the corresponding target index information, the parent transaction information that generated the target transaction information (corresponding to the target data interaction generated) can be obtained based on the data interaction source identifier. The upper-layer data interaction information of the information), based on the lower-layer data interaction identifier, the sub-transaction information generated by the target transaction information is obtained (corresponding to the lower-layer data interaction information generated by the target data interaction information), thus, all transactions with the target can be obtained All transaction information related to the information ensures the integrity of the transaction information.
作为一种优选实施例,产生各数据交互信息的各数据交互终端均为组成区块链网络的节点,各数据交互终端部署于区块链网络的不同分区。As a preferred embodiment, each data interaction terminal that generates each data interaction information is a node that forms a blockchain network, and each data interaction terminal is deployed in different partitions of the blockchain network.
具体的,数据交互信息由数据交互终端进行数据交互产生,在本申请实施例中,各个数据交互终端均可以为组成区块链网络的节点,用以实现区块链链上的数据交互;进一步,各个数据交互终端在区块链网络中可部署于区块链网络的不同分区,具体可根据自身的地址信息等实现区域划分,由此,即可实现分区内部数据交互和跨分区数据交互,其中,跨分区数据交互可以分为跨入数据交互和跨出数据交互,从而实现基于数据交互终端的多种形式的数据交互。Specifically, the data interaction information is generated by the data interaction terminal. In the embodiment of the present application, each data interaction terminal can be a node that forms a blockchain network to realize data interaction on the blockchain chain; further , each data interaction terminal can be deployed in different partitions of the blockchain network in the blockchain network. Specifically, the regions can be divided according to their own address information, etc., thus enabling intra-partition data interaction and cross-partition data interaction. Among them, cross-partition data interaction can be divided into cross-in data interaction and cross-out data interaction, thereby realizing various forms of data interaction based on data interaction terminals.
本实施例所提供的信息查询方法,预先在数据交互信息产生的同时建立相应的索引信息,加之每条数据交互信息在产生时均会生成相应的Hash,当进行信息存储时,可将三者相互对应存储,由此,当进行信息查询时,即可基于指定的Hash查询到对应的数据交互信息,进而获取到索引信息,由于该索引信息中包括数据交互信息对应的数据交互来源标识和下层数据交互标识,由此,根据数据交互来源标识和下层数据交互标识即可查询到与该数据交互信息相关的所有数据交互信息;进一步,当基于该信息查询方法进行交易信息查询时,即可基于指定的交易信息查询到与该交易信息相关联的所有交易信息,包括产生该交易信息的父交易信息和该交易信息产生的子交易信息,有效保证了交易信息查询结果的完整性。The information query method provided by this embodiment establishes corresponding index information in advance when the data interaction information is generated. In addition, each piece of data interaction information will generate a corresponding Hash when it is generated. When storing the information, the three can be Stored correspondingly to each other, therefore, when performing information query, the corresponding data interaction information can be queried based on the specified Hash, and then the index information can be obtained, because the index information includes the data interaction source identifier corresponding to the data interaction information and the lower layer Data interaction identifier, therefore, all data interaction information related to the data interaction information can be queried based on the data interaction source identifier and the underlying data interaction identifier; further, when transaction information is queried based on this information query method, it can be queried based on The specified transaction information is queried to find all transaction information associated with the transaction information, including the parent transaction information that generated the transaction information and the child transaction information generated by the transaction information, effectively ensuring the integrity of the transaction information query results.
本发明提供的一种信息存储方法。The invention provides an information storage method.
参照图3,图3为本发明第二实施例的流程示意图。Referring to Figure 3, Figure 3 is a schematic flow chart of a second embodiment of the present invention.
在第二实施例中,该方法可以包括:In a second embodiment, the method may include:
S20:当获得数据交互信息时,为数据交互信息建立索引信息;其中,索引信息包括数据交互来源标识和下层数据交互标识;S20: When the data interaction information is obtained, index information is established for the data interaction information; where the index information includes a data interaction source identifier and a lower-layer data interaction identifier;
S21:获取数据交互信息的Hash,将数据交互信息、索引信息和Hash对应存储至预设存储空间。S21: Obtain the Hash of the data interaction information, and store the data interaction information, index information and Hash correspondingly to the preset storage space.
基于上一实施例的信息查询方法,本申请实施例对各个数据交互信息的存储过程进行了详细介绍。Based on the information query method of the previous embodiment, this embodiment of the present application introduces in detail the storage process of each data interaction information.
具体的,在数据交互终端进行数据交互产生数据交互信息后,可直接为其建立对应的索引信息,同时生成其对应的Hash,进而将数据交互信息、索引信息以及Hash一同对应存储至预先建立的存储空间中,即上述预设存储空间。其中,上述为数据交互信息建立的索引信息可包括数据交互来源标识和下层数据交互标识,进一步,在进行后续信息查询时,即可根据数据交互来源标识在预设存储空间中查询到产生某一数据交互信息的各类上层数据交互信息,以及根据下层数据交互标识查询到该数据交互信息产生的各类下层数据交互信息,由此,基于数据交互信息的索引信息即可查询到所有与该数据交互信息相关的所有数据交互信息。Specifically, after the data interaction terminal generates data interaction information through data interaction, corresponding index information can be directly established for it, and its corresponding Hash can be generated at the same time, and then the data interaction information, index information and Hash can be correspondingly stored in a pre-established In the storage space, that is, the above-mentioned default storage space. Among them, the above-mentioned index information established for the data interaction information may include a data interaction source identifier and a lower-layer data interaction identifier. Furthermore, during subsequent information query, a certain generated data can be queried in the preset storage space based on the data interaction source identifier. Various types of upper-layer data interaction information of data interaction information, and various types of lower-layer data interaction information generated by querying the data interaction information according to the lower-layer data interaction identification. Therefore, all the data related to the data can be queried based on the index information based on the data interaction information. All data interaction information related to interaction information.
进一步,基于上述信息存储方法实现交易信息的存储,可以利用索引信息很方便的查询到具有关联关系的所有交易信息,达到交易信息查询的高效性,同时也更加方便后期对账的进行。Furthermore, based on the above information storage method, transaction information is stored, and all transaction information with associated relationships can be easily queried using index information, achieving high efficiency in transaction information query, and making later reconciliation more convenient.
本发明提供的一种更为具体的信息查询方法,该实施例以交易信息的存储与查询为例,其具体的实现流程如下:The present invention provides a more specific information query method. This embodiment takes the storage and query of transaction information as an example. The specific implementation process is as follows:
首先,对于交易双方所产生的每一笔交易信息,即上述数据交互信息,可建立相应的索引信息,举例来说,该索引信息的结构可以为如下类型(并不唯一):First, for each transaction information generated by both parties to the transaction, that is, the above-mentioned data interaction information, corresponding index information can be established. For example, the structure of the index information can be of the following type (not unique):
其中,TxEntry即为索引信息,该索引信息包括区块Hash、区块高度、交易来源、交易所在分区、交易在区块中的排序位置以及子交易数组,其中,子交易数组ChildTxs即为上述下层数据交互标识,可能包括一个或多个子交易ChildTx;Among them, TxEntry is the index information. The index information includes block Hash, block height, transaction source, transaction partition, transaction sorting position in the block, and sub-transaction array. Among them, the sub-transaction array ChildTxs is the above The underlying data interaction identifier may include one or more sub-transactions ChildTx;
其中,交易来源TxRole即为上述数据交互来源标识,具体可包括:本分区发起TxLocal、其他分区跨入TxCrossIn、本分区跨到其他分区TxCrossOut;Among them, the transaction source TxRole is the above-mentioned data interaction source identifier, which can specifically include: this partition initiates TxLocal, other partitions cross into TxCrossIn, and this partition crosses into other partitions TxCrossOut;
其中,交易所在分区ZoneID具体为:跨出交易为To地址所在分区ID,跨入交易为父交易所在分区ID,本地交易为From地址所在分区ID;Among them, the Zone ID of the exchange is specifically: the outgoing transaction is the zone ID where the To address is located, the incoming transaction is the zone ID where the parent exchange is located, and the local transaction is the zone ID where the From address is located;
其中,ChildTx具体可包含如下信息:Among them, ChildTx can specifically include the following information:
TxType(子交易类型,标识RefundTx,ContractTx等类型子交易)TxType (sub-transaction type, identifying RefundTx, ContractTx and other types of sub-transactions)
TxHash(子交易Hash)TxHash (sub-transaction Hash)
ZoneID(子交易所在分区ID)ZoneID (the zone ID where the sub-exchange is located)
另外,对于上述TxRole,如果一笔交易Tx,其转出地址(From地址)被划分到当前分区(假设为Zone0),接收地址(To地址)被划分到另外一个分区(假设为Zone1),则可将该交易Tx打包成一个新交易Tx1(Hash不同于Tx的Hash)转发到Zone1,在Zone0上Tx的TxRole为TxLocal,产生的Tx1的TxRole为TxCrossOut,表示Tx1是要跨到Zone1上去执行,在Zone1上的Tx1的TxRole为TxCrossIn,表示Tx1是从Zone0分区跨到Zone1上来执行;如果一笔交易的From地址和To地址都是当前分区,则TxRole为TxLocal,不产生额外的跨分区交易。In addition, for the above TxRole, if a transaction Tx, its transfer address (From address) is divided into the current zone (assumed to be Zone0), and the receiving address (To address) is divided into another partition (assumed to be Zone1), then The transaction Tx can be packaged into a new transaction Tx1 (the Hash is different from the Hash of Tx) and forwarded to Zone1. The TxRole of Tx in Zone0 is TxLocal, and the TxRole of the generated Tx1 is TxCrossOut, which means that Tx1 is to be executed in Zone1. The TxRole of Tx1 on Zone1 is TxCrossIn, which means that Tx1 is executed from the Zone0 partition to Zone1; if the From address and To address of a transaction are both in the current partition, the TxRole is TxLocal, and no additional cross-partition transactions are generated.
进一步,还可以根据交易的TxHash构造索引信息的TxEntryHash,进而将索引信息进行KV存储(TxEntryHash->TxEntry)。当然,同时将对应的交易信息及其Hash存储至KV存储数据库中即可。Furthermore, you can also construct the TxEntryHash of the index information based on the TxHash of the transaction, and then store the index information in KV (TxEntryHash->TxEntry). Of course, just store the corresponding transaction information and its hash in the KV storage database at the same time.
进一步,请参考图4,图4为本发明所提供的一种区块链中跨分区交易的流程示意图,具体的,zone0上的一笔交易Tx01(打包在zone0的区块Block0中)需要跨到zone1上执行,在zone0上转为Tx发到zone1上去执行(打包在zone1的区块Block1中),Tx的originHash为Hash(Tx01);Tx执行完毕后将未消耗完的gas返回给Tx01交易的发起者,生成一笔退gas的RefundTx到zone0上去执行,该RefundTx的originHash为Hash(Tx)。对应的,在各自分区上为相应的交易建立索引信息:Further, please refer to Figure 4. Figure 4 is a flow diagram of a cross-zone transaction in a blockchain provided by the present invention. Specifically, a transaction Tx01 on zone0 (packaged in block Block0 of zone0) needs to be cross-zone. Execute on zone1, convert it to Tx on zone0 and send it to zone1 for execution (packaged in Block1 of zone1). The originHash of Tx is Hash (Tx01); after the execution of Tx, the unconsumed gas will be returned to the Tx01 transaction. The initiator generates a RefundTx for gas refund and executes it on zone0. The originHash of the RefundTx is Hash(Tx). Correspondingly, index information is created for the corresponding transactions on the respective partitions:
1、Zone0上的交易索引:1. Transaction index on Zone0:
(1)Tx01的TxEntry:(1) TxEntry of Tx01:
{TxRole:TxRoleLocal,ZoneID:0,ChildTx:{TxHash:Hash(Tx),ZoneID:1}}{TxRole:TxRoleLocal, ZoneID:0, ChildTx:{TxHash:Hash(Tx), ZoneID:1}}
可见,其主要索引信息为Block0Hash,Block0Height,ZoneID为0,TxRole=TxLocal,产生一笔子交易Tx的信息为:TxHash=Hash(Tx),ZoneID=1,具体表示Tx01是被打包在分区0上的区块Block0中,且包含一笔要跨出到分区1去执行的交易Tx;It can be seen that the main index information is Block0Hash, Block0Height, ZoneID is 0, TxRole=TxLocal, and the information that generates a sub-transaction Tx is: TxHash=Hash(Tx), ZoneID=1, which specifically means that Tx01 is packaged in partition 0 Block0 of Block0 contains a transaction Tx that needs to be executed in partition 1;
(2)Tx的TxEntry:(2) TxEntry of Tx:
{TxRole:TxRoleCrossOut,ZoneID:1,ChildTx:[]}{TxRole:TxRoleCrossOut, ZoneID:1, ChildTx:[]}
可见,其主要索引信息为Block0Hash,Block0Height,ZoneID为1,TxRole=TxCrossOut,具体表示Tx是需要跨出到分区1去执行的;It can be seen that the main index information is Block0Hash, Block0Height, ZoneID is 1, TxRole = TxCrossOut, which specifically means that Tx needs to go out to partition 1 for execution;
(3)RefundTx的TxEntry:(3)TxEntry of RefundTx:
{TxRole:TxRoleCrossIn,ZoneID:1,ChildTx:[]}{TxRole:TxRoleCrossIn, ZoneID:1, ChildTx:[]}
可见,其主要索引信息为ZoneID为1,TxRole=TxCrossIn,具体表示RefundTx是从分区1跨入到分区0上的;It can be seen that the main index information is that ZoneID is 1 and TxRole=TxCrossIn, which specifically means that RefundTx crosses from partition 1 to partition 0;
2、Zone1上的交易索引:2. Transaction index on Zone1:
(1)Tx的TxEntry:(1) TxEntry of Tx:
{TxRole:TxRoleCrossIn,ZoneID:0,ChildTx:{TxHash:Hash(RefundTx),ZoneID:0}}{TxRole:TxRoleCrossIn, ZoneID:0, ChildTx:{TxHash:Hash(RefundTx), ZoneID:0}}
可见,其主要索引信息为Block1Hash,Block1Height,ZoneID为0,TxRole=TxCrossIn,产生一笔子交易RefundTx的信息为:TxHash=Hash(RefundTx),ZoneID=0,具体表示Tx是从分区0跨入到分区1的,且被打包在分区1的Block1中,且该交易产生了一笔需要跨回到分区0的RefundTx;It can be seen that the main index information is Block1Hash, Block1Height, ZoneID is 0, TxRole=TxCrossIn, and the information that generates a sub-transaction RefundTx is: TxHash=Hash (RefundTx), ZoneID=0, specifically indicating that Tx is entered from partition 0. Partition 1, and is packaged in Block 1 of partition 1, and the transaction generates a RefundTx that needs to be crossed back to partition 0;
(2)RefundTx的TxEntry:(2) TxEntry of RefundTx:
{TxRole:TxRoleCrossOut,ZoneID:0,ChildTx:[]}{TxRole:TxRoleCrossOut, ZoneID:0, ChildTx:[]}
可见,其主要索引信息为Block1Hash,Block1Height,ZoneID为0,TxRole=TxCrossOut,具体表示RefundTx是从分区1跨出到分区0上的。It can be seen that the main index information is Block1Hash, Block1Height, ZoneID is 0, TxRole=TxCrossOut, which specifically means that RefundTx crosses from partition 1 to partition 0.
如此,在后续进行交易信息查询时,在不改变原始交易的情况下,可以根据交易类型及交易Hash快速获取交易信息以及该交易的索引信息,进而根据索引信息查出该交易信息对应的父交易信息、交易来源分区、所在分区的区块信息、产生的子交易信息等,也即推导出跟这一笔交易相关的所有的交易信息,更加方便开发、测试及满足生产环境对交易的对账、查询等需求。In this way, when querying transaction information later, without changing the original transaction, the transaction information and the index information of the transaction can be quickly obtained based on the transaction type and transaction Hash, and then the parent transaction corresponding to the transaction information can be found based on the index information. Information, transaction source partition, block information of the partition, generated sub-transaction information, etc., that is, all transaction information related to this transaction is deduced, which is more convenient for development, testing and reconciliation of transactions in the production environment. , query and other needs.
可见,本实施例所提供的信息查询方法,预先在数据交互信息产生的同时建立相应的索引信息,加之每条数据交互信息在产生时均会生成相应的Hash,当进行信息存储时,可将三者相互对应存储,由此,当进行信息查询时,即可基于指定的Hash查询到对应的数据交互信息,进而获取到索引信息,由于该索引信息中包括数据交互信息对应的数据交互来源标识和下层数据交互标识,由此,根据数据交互来源标识和下层数据交互标识即可查询到与该数据交互信息相关的所有数据交互信息;进一步,当基于该信息查询方法进行交易信息查询时,即可基于指定的交易信息查询到与该交易信息相关联的所有交易信息,包括产生该交易信息的父交易信息和该交易信息产生的子交易信息,有效保证了交易信息查询结果的完整性。It can be seen that the information query method provided by this embodiment establishes corresponding index information in advance when the data interaction information is generated. In addition, each piece of data interaction information will generate a corresponding Hash when it is generated. When the information is stored, it can be The three are stored corresponding to each other. Therefore, when performing information query, the corresponding data interaction information can be queried based on the specified Hash, and then the index information can be obtained, because the index information includes the data interaction source identifier corresponding to the data interaction information. and the lower-layer data interaction identifier. Therefore, all data interaction information related to the data interaction information can be queried according to the data interaction source identifier and the lower-layer data interaction identifier; further, when the transaction information is queried based on this information query method, that is All transaction information associated with the transaction information can be queried based on the specified transaction information, including the parent transaction information that generated the transaction information and the child transaction information generated by the transaction information, effectively ensuring the integrity of the transaction information query results.
本发明提供的一种信息查询装置。The invention provides an information query device.
参照图5,图5为本发明第一实施例揭露的信息查询装置的内部结构示意图。Referring to FIG. 5 , FIG. 5 is a schematic diagram of the internal structure of the information query device disclosed in the first embodiment of the present invention.
在本实施例中,信息查询装置1可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、掌上电脑、便携计算机、智能路由器、矿机、网络存储设备、终端设备。In this embodiment, the information query device 1 may be a PC (Personal Computer), or may be a smartphone, tablet computer, handheld computer, portable computer, smart router, mining machine, network storage device, or terminal device.
该信息查询装置1可以包括存储器11、处理器12和总线13。The information query device 1 may include a memory 11, a processor 12 and a bus 13.
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是信息查询装置1的内部存储单元,例如该信息查询装置1的硬盘。存储器11在另一些实施例中也可以是信息查询装置1的外部存储设备,例如信息查询装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括信息查询装置1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于信息查询装置1的应用软件及各类数据,例如信息查询程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。The memory 11 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the information query device 1 , such as a hard disk of the information query device 1 . In other embodiments, the memory 11 can also be an external storage device of the information query device 1, such as a plug-in hard disk, a smart media card (SMC), a secure digital (Secure Digital, etc.) equipped on the information query device 1. SD) card, Flash Card, etc. Further, the memory 11 may also include both an internal storage unit of the information query device 1 and an external storage device. The memory 11 can not only be used to store application software installed in the information query device 1 and various types of data, such as codes of information query programs, etc., but can also be used to temporarily store data that has been output or is to be output.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行信息查询程序等。In some embodiments, the processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chips for running program codes or processes stored in the memory 11 Data, such as executing information query programs, etc.
该总线13可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图5中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 13 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one thick line is used in Figure 5, but it does not mean that there is only one bus or one type of bus.
进一步地,信息查询装置1还可以包括网络接口,网络接口可选的可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该信息查询装置1与其他电子设备之间建立通信连接。Further, the information query device 1 may also include a network interface. The network interface may optionally include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to connect the information query device 1 with other devices. Establish communication connections between electronic devices.
可选地,该信息查询装置1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在信息查询装置1中处理的信息以及用于显示可视化的用户界面。Optionally, the information query device 1 may also include a user interface, which may include a display (Display) and an input unit such as a keyboard (Keyboard). Optional user interfaces may also include standard wired interfaces and wireless interfaces. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, or the like. The display may also be appropriately called a display screen or a display unit, and is used for displaying information processed in the information query device 1 and for displaying a visualized user interface.
图5仅示出了具有组件11-13以及信息查询程序的信息查询装置1,本领域技术人员可以理解的是,图5示出的结构并不构成对信息查询装置1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。Figure 5 only shows the information query device 1 with the components 11-13 and the information query program. Those skilled in the art can understand that the structure shown in Figure 5 does not constitute a limitation on the information query device 1, and may include other components. The figures illustrate fewer or more components, or combinations of certain components, or different arrangements of components.
本发明提供的一种信息查询系统。The invention provides an information query system.
参照图6,图6为本发明所提供的第三实施例的结构框图。Referring to Figure 6, Figure 6 is a structural block diagram of a third embodiment provided by the present invention.
在第三实施例中,该信息查询系统可以包括:In a third embodiment, the information query system may include:
指令解析模块20,用于当接收到查询指令时,对查询指令进行解析,获得目标Hash;The instruction parsing module 20 is used to parse the query instruction when receiving the query instruction to obtain the target Hash;
信息调取模块21,用于利用目标Hash调取对应的目标数据交互信息;The information retrieval module 21 is used to retrieve the corresponding target data interaction information using the target Hash;
索引获取模块22,用于获取目标数据交互信息对应的目标索引信息;其中,目标索引信息包括数据交互来源标识和下层数据交互标识;The index acquisition module 22 is used to obtain target index information corresponding to the target data interaction information; wherein the target index information includes a data interaction source identifier and a lower-layer data interaction identifier;
信息查询模块23,用于利用数据交互来源标识和下层数据交互标识进行查询,获得与目标数据交互信息相关的所有数据交互信息。The information query module 23 is used to query using the data interaction source identifier and the lower-layer data interaction identifier to obtain all data interaction information related to the target data interaction information.
对于本申请提供的系统的介绍请参照上述方法实施例,本申请在此不做赘述。For an introduction to the system provided by this application, please refer to the above method embodiments, and this application will not elaborate here.
本发明提供的一种信息存储系统。The invention provides an information storage system.
参照图7,图7为本发明所提供的第四实施例的结构框图。Referring to Figure 7, Figure 7 is a structural block diagram of a fourth embodiment provided by the present invention.
在第四实施例中,该信息存储系统可以包括:In a fourth embodiment, the information storage system may include:
索引建立模块30,用于当获得数据交互信息时,为数据交互信息建立索引信息;其中,索引信息包括数据交互来源标识和下层数据交互标识;The index creation module 30 is configured to create index information for the data interaction information when the data interaction information is obtained; wherein the index information includes a data interaction source identifier and a lower-layer data interaction identifier;
信息存储模块31,用于获取数据交互信息的Hash,将数据交互信息、索引信息和Hash对应存储至预设存储空间。The information storage module 31 is used to obtain the Hash of data interaction information, and store the data interaction information, index information and Hash in a preset storage space.
对于本申请提供的系统的介绍请参照上述方法实施例,本申请在此不做赘述。For an introduction to the system provided by this application, please refer to the above method embodiments, and this application will not elaborate here.
本发明实施例还提供一种计算机可读存储介质,该计算机可读存储介质上信息查询程序,该信息查询程序可被一个或者多个处理器执行,以实现如以上任一实施例所述的信息查询方法的步骤。Embodiments of the present invention also provide a computer-readable storage medium, and an information query program on the computer-readable storage medium. The information query program can be executed by one or more processors to implement the steps described in any of the above embodiments. Steps of the information query method.
本发明实施例还提供一种计算机程序产品,该计算机程序产品包括计算机指令,当其在计算机上运行时,使得计算机可以执行上述任一实施例所述的信息查询方法的步骤。An embodiment of the present invention also provides a computer program product, which includes computer instructions that, when run on a computer, enable the computer to execute the steps of the information query method described in any of the above embodiments.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store, or a data storage device such as a server or data center integrated with one or more available media. The available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), etc.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的设备和系统的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described equipment and systems can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,系统和方法,可以通过其它的方式实现。例如,以上所描述的系统实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices, systems and methods can be implemented in other ways. For example, the system embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code.
需要说明的是,上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It should be noted that the above serial numbers of the embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. and the terms "comprises," "comprises" or any other variations thereof herein are intended to cover a non-exclusive inclusion such that a process, apparatus, article or method that includes a list of elements includes not only those elements, but also includes not expressly other elements listed, or may also include elements inherent to the process, apparatus, article or method. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, apparatus, article or method that includes that element.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the description and drawings of the present invention may be directly or indirectly used in other related technical fields. , are all similarly included in the scope of patent protection of the present invention.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911142940.3A CN110874365B (en) | 2019-11-20 | 2019-11-20 | Information query method and related equipment thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911142940.3A CN110874365B (en) | 2019-11-20 | 2019-11-20 | Information query method and related equipment thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110874365A CN110874365A (en) | 2020-03-10 |
CN110874365B true CN110874365B (en) | 2023-11-17 |
Family
ID=69718124
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911142940.3A Active CN110874365B (en) | 2019-11-20 | 2019-11-20 | Information query method and related equipment thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110874365B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111339106B (en) * | 2020-05-18 | 2020-08-28 | 杭州趣链科技有限公司 | Block chain data indexing method |
CN112560112B (en) * | 2020-12-15 | 2022-09-02 | 杭州趣链科技有限公司 | Block chain based information shielding method, device, equipment and readable storage medium |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106445993A (en) * | 2016-07-11 | 2017-02-22 | 天津米游科技有限公司 | Data fingerprint query method and device based on block chain |
CN108897758A (en) * | 2018-05-15 | 2018-11-27 | 深圳市网心科技有限公司 | A kind of block chain Transaction Inquiries method, apparatus, system and storage medium |
CN108984662A (en) * | 2018-06-28 | 2018-12-11 | 杭州复杂美科技有限公司 | A kind of block chain method of data synchronization |
CN109063016A (en) * | 2018-07-11 | 2018-12-21 | 物数(上海)信息科技有限公司 | Block chain data storage method, device, electronic equipment, storage medium |
CN109086325A (en) * | 2018-06-29 | 2018-12-25 | 阿里巴巴集团控股有限公司 | Data processing method and device based on block chain |
CN109165224A (en) * | 2018-08-24 | 2019-01-08 | 东北大学 | A kind of indexing means being directed to keyword key on block chain database |
CN109242500A (en) * | 2018-09-20 | 2019-01-18 | 百度在线网络技术(北京)有限公司 | Block chain transaction validation verification method, apparatus and storage medium |
CN109255056A (en) * | 2018-08-16 | 2019-01-22 | 北京京东尚科信息技术有限公司 | Data referencing processing method, device, equipment and the storage medium of block chain |
CN109325039A (en) * | 2018-06-07 | 2019-02-12 | 海南新软软件有限公司 | A kind of block chain browser and block chain information browsing method |
CN109741060A (en) * | 2018-12-29 | 2019-05-10 | 北京金山安全软件有限公司 | Information inquiry system, method, device, electronic equipment and storage medium |
CN109886694A (en) * | 2019-03-26 | 2019-06-14 | 阿里巴巴集团控股有限公司 | Data processing method and device and electronic equipment based on block chain |
CN109934592A (en) * | 2019-03-22 | 2019-06-25 | 深圳市网心科技有限公司 | A blockchain cross-chain communication method, system, electronic device and storage medium |
CN110135844A (en) * | 2019-04-28 | 2019-08-16 | 阿里巴巴集团控股有限公司 | Credit record, querying method and device and electronic equipment based on block chain |
CN110473104A (en) * | 2019-08-20 | 2019-11-19 | 深圳市网心科技有限公司 | A kind of transaction processing method and relevant device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112767158B (en) * | 2018-02-27 | 2024-11-08 | 蚂蚁链技术有限公司 | Transaction execution method and device based on blockchain, and electronic device |
-
2019
- 2019-11-20 CN CN201911142940.3A patent/CN110874365B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106445993A (en) * | 2016-07-11 | 2017-02-22 | 天津米游科技有限公司 | Data fingerprint query method and device based on block chain |
CN108897758A (en) * | 2018-05-15 | 2018-11-27 | 深圳市网心科技有限公司 | A kind of block chain Transaction Inquiries method, apparatus, system and storage medium |
CN109325039A (en) * | 2018-06-07 | 2019-02-12 | 海南新软软件有限公司 | A kind of block chain browser and block chain information browsing method |
CN108984662A (en) * | 2018-06-28 | 2018-12-11 | 杭州复杂美科技有限公司 | A kind of block chain method of data synchronization |
CN109086325A (en) * | 2018-06-29 | 2018-12-25 | 阿里巴巴集团控股有限公司 | Data processing method and device based on block chain |
CN109063016A (en) * | 2018-07-11 | 2018-12-21 | 物数(上海)信息科技有限公司 | Block chain data storage method, device, electronic equipment, storage medium |
CN109255056A (en) * | 2018-08-16 | 2019-01-22 | 北京京东尚科信息技术有限公司 | Data referencing processing method, device, equipment and the storage medium of block chain |
CN109165224A (en) * | 2018-08-24 | 2019-01-08 | 东北大学 | A kind of indexing means being directed to keyword key on block chain database |
CN109242500A (en) * | 2018-09-20 | 2019-01-18 | 百度在线网络技术(北京)有限公司 | Block chain transaction validation verification method, apparatus and storage medium |
CN109741060A (en) * | 2018-12-29 | 2019-05-10 | 北京金山安全软件有限公司 | Information inquiry system, method, device, electronic equipment and storage medium |
CN109934592A (en) * | 2019-03-22 | 2019-06-25 | 深圳市网心科技有限公司 | A blockchain cross-chain communication method, system, electronic device and storage medium |
CN109886694A (en) * | 2019-03-26 | 2019-06-14 | 阿里巴巴集团控股有限公司 | Data processing method and device and electronic equipment based on block chain |
CN110135844A (en) * | 2019-04-28 | 2019-08-16 | 阿里巴巴集团控股有限公司 | Credit record, querying method and device and electronic equipment based on block chain |
CN110473104A (en) * | 2019-08-20 | 2019-11-19 | 深圳市网心科技有限公司 | A kind of transaction processing method and relevant device |
Non-Patent Citations (3)
Title |
---|
一种支持区块链交易溯源的混合索引机制;尤瑶;孔兰菊;肖宗水;郑永清;李庆忠;;计算机集成制造系统(第04期);全文 * |
王千阁 ; 何蒲 ; 聂铁铮 ; 申德荣 ; 于戈 ; ."区块链系统的数据存储与查询技术综述".《计算机科学》.2018,第45卷(第12期),全文. * |
面向混合索引的区块链系统的可查询性优化;郑浩瀚;申德荣;聂铁铮;寇月;;计算机科学(第10期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110874365A (en) | 2020-03-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11310066B2 (en) | Method and apparatus for pushing information | |
CN107463693A (en) | A kind of data processing method, device, terminal and computer-readable recording medium | |
CN109669980B (en) | Cross-database access method and device for data | |
CN109359237B (en) | Method and equipment for searching hosted program | |
CN110442773B (en) | Node caching method, system, device and computer medium in distributed system | |
CN109408507B (en) | Multi-attribute data processing method, apparatus, device and readable storage medium | |
CN102902763B (en) | The method of association, retrieving information process data and process information task and device | |
CN110162537A (en) | Data query method and device, storage medium and electronic equipment | |
CN111651296A (en) | Intercept backup method, device, device and storage medium for data deletion operation | |
CN111277635B (en) | Method, equipment, device and computer medium for accessing external node to block chain | |
WO2021129379A1 (en) | Information sharing chain generation method and apparatus, electronic device, and storage medium | |
CN110874365B (en) | Information query method and related equipment thereof | |
CN108959294B (en) | Method and device for accessing search engine | |
CN113157731A (en) | Symbol analysis method, device, equipment and storage medium | |
CN110019444B (en) | Operation request processing method, device, equipment and system | |
CN110096501A (en) | Data search method, device, medium and electronic equipment based on label | |
CN110851334A (en) | Flow statistical method, electronic device, system and medium | |
CN114356991A (en) | Data query method, data aggregation method, device, equipment and medium | |
CN107341105A (en) | Information processing method, terminal and server | |
CN114296696B (en) | Business function operation method and device, storage medium and electronic device | |
CN110855525A (en) | Flow statistical method, electronic device, system and medium | |
CN107301192A (en) | A kind of terminal identification method and identification server | |
CN112100285B (en) | Topology analysis method, device and storage medium of power distribution network model | |
CN113434508B (en) | Method and apparatus for storing information | |
CN114840372B (en) | Interface testing method, device, electronic device and computer readable storage medium |
Legal Events
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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20210910 Address after: 518000 21 / f-23 / F, block B, building 12, Shenzhen Bay science and technology ecological park, No. 18, South Keji Road, high tech community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province Applicant after: Xunlei Networking Technologies, Ltd. Applicant after: SHENZHEN ONETHING TECHNOLOGIES Co.,Ltd. Address before: 518052 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.) Applicant before: SHENZHEN ONETHING TECHNOLOGIES Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20240620 Address after: 518000 Port Building 0610-E13, Maritime Center, No. 59, Linhai Avenue, Nanshan Street, Qianhai Shenzhen Hong Kong Cooperation Zone, Shenzhen, Guangdong Patentee after: SHENZHEN ONETHING TECHNOLOGIES Co.,Ltd. Country or region after: China Address before: 518000 21 / f-23 / F, block B, building 12, Shenzhen Bay science and technology ecological park, No. 18, South Keji Road, high tech community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province Patentee before: Xunlei Networking Technologies, Ltd. Country or region before: China Patentee before: SHENZHEN ONETHING TECHNOLOGIES Co.,Ltd. |