WO2020024904A1 - 用于搜索区块链数据的方法、设备及可读存储介质 - Google Patents

用于搜索区块链数据的方法、设备及可读存储介质 Download PDF

Info

Publication number
WO2020024904A1
WO2020024904A1 PCT/CN2019/098190 CN2019098190W WO2020024904A1 WO 2020024904 A1 WO2020024904 A1 WO 2020024904A1 CN 2019098190 W CN2019098190 W CN 2019098190W WO 2020024904 A1 WO2020024904 A1 WO 2020024904A1
Authority
WO
WIPO (PCT)
Prior art keywords
index
search request
blockchain data
search
blockchain
Prior art date
Application number
PCT/CN2019/098190
Other languages
English (en)
French (fr)
Inventor
肖诗源
Original Assignee
上海点融信息科技有限责任公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海点融信息科技有限责任公司 filed Critical 上海点融信息科技有限责任公司
Publication of WO2020024904A1 publication Critical patent/WO2020024904A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions

Definitions

  • the present invention belongs to the technical field of blockchain, and particularly relates to a method for searching for blockchain data, a device for searching for blockchain data, and a corresponding computer-readable storage medium.
  • Blockchain is an intelligent peer-to-peer network that uses a distributed database to identify, disseminate, and record information, also known as the Internet of Value.
  • Blockchain has technical advantages such as decentralization, anti-tampering, data consistent storage, and transparent and traceable processes.
  • the blockchain is jointly maintained by all participating blockchain nodes, and each participating blockchain node can obtain a complete copy of the blockchain data and independently verify it.
  • the blockchain uses cryptographic technology to ensure that the blockchain can only add new data and cannot tamper with existing data.
  • Blockchains are generally divided into public chains, alliance chains, and private chains based on access rights.
  • the public chain refers to the blockchain that anyone can access and participate in consensus according to the protocol;
  • the alliance chain refers to the blockchain whose consensus process is controlled by pre-selected blockchain nodes;
  • the private chain refers to all permissions in one A blockchain in an organization that is arbitrarily controlled by that organization.
  • Embodiments of the present invention provide a method, a device, and a computer-readable storage medium for searching for blockchain data.
  • the blockchain data can be searched using an index created based on the blockchain data, thereby achieving Blockchain search service.
  • a first aspect of the present invention proposes a method for searching blockchain data, the method comprising:
  • A. Receive a search request via a Hypertext Transfer Protocol interface
  • a second aspect of the present invention provides a device for searching for blockchain data, the device including: a processor; and a memory for storing instructions that cause the processing when the instructions are executed
  • the processor does the following:
  • A. Receive a search request via a Hypertext Transfer Protocol interface
  • a third aspect of the present invention provides a computer-readable storage medium having computer-readable program instructions stored thereon, the computer-readable program instructions for performing the operations according to the first aspect described above.
  • Method for searching blockchain data Method for searching blockchain data.
  • the method, device and corresponding computer-readable storage medium for searching blockchain data according to the present invention can implement the following functions:
  • the blockchain data can be retrieved to generate an index and stored in the database; then, when a user's search request is received via the Hypertext Transfer Protocol interface, Search the above database.
  • FIG. 1 is a flowchart of a first embodiment of a method for searching blockchain data according to the present disclosure
  • FIG. 3 is a flowchart of a second embodiment of a method for searching blockchain data according to the present disclosure
  • FIG. 4 is a schematic diagram of an exemplary apparatus for implementing a method for searching blockchain data according to the present disclosure
  • FIG. 5 is a schematic diagram of a first embodiment of a device for searching blockchain data according to the present disclosure.
  • FIG. 6 is a schematic diagram of a first exemplary embodiment of an apparatus for searching blockchain data according to the present disclosure.
  • each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of the code may include one or more components for implementing various embodiments.
  • Executable instructions for a specified logical function may also occur in a different order than those marked in the drawings.
  • each block in the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams can be implemented using a dedicated hardware-based system that performs the specified function or operation , Or it can be implemented using a combination of dedicated hardware and computer instructions.
  • connection between the units in the drawing is only for the convenience of description, which means that at least the units at both ends of the connection are in communication with each other, and it is not intended to limit the communication between the units that are not connected.
  • uniform resource location address refers to the address of a standard resource on the Internet, also known as a Uniform Resource Locator (URL) or a web page address.
  • URL Uniform Resource Locator
  • public data in the context of the present invention refers to data that can be accessed without requiring authentication
  • privacy data refers to data that requires authentication to be accessible.
  • first and second in this summary are only used to describe a reference, purpose, or something, and cannot be understood as indicating or implying relative importance, or implicitly indicating the number of technical features indicated. .
  • retrieving refers to the process of crawling, processing, indexing, and traversing of blockchain data by a search engine through a web crawler program
  • search refers to a search engine receiving a search for content of a webpage that has been previously indexed after a user enters a keyword on a search engine page.
  • segmentation processing in the context of the present invention refers to a processing method of cutting blockchain data written in Chinese or other languages without separators into individual words or words.
  • first attribute is used to mark blockchain data as private or public in the context of the present invention
  • second attribute is used to identify the owner who created the blockchain data.
  • public area in the context of the present invention refers to the storage area of the index corresponding to the public data in the blockchain, and the term “privacy area” refers to the index corresponding to the private data in the blockchain. Storage area in the database.
  • authentication credential in the context of the present invention refers to the verification information required by a blockchain user to access the corresponding blockchain.
  • the blockchain data is obtained in real time on at least one node in the blockchain (ie, the blockchain node referred to herein).
  • the obtained blockchain data includes both data generated from other blockchain nodes of the blockchain and data generated by various applications in the blockchain node.
  • the obtained blockchain data is stored in the block that is being generated, and existing or future developed technologies can be used to implement the storage of the obtained blockchain data in the block that is being generated.
  • At least one index is created based on the blockchain data.
  • Step 110 Convert the blockchain data into a web page.
  • Step 120 Obtain one or more keywords by performing word segmentation processing on the webpage.
  • blockchain data can be stored in, but not limited to, a key / value format, and keywords generated by tokenizing the blockchain data are also data with a key-value format.
  • Step 130 Generate a corresponding index for each of the one or more keywords, a content summary of the blockchain data, and a uniform resource location address corresponding to the blockchain data.
  • the generated index is stored in the database used to store the index.
  • the database for storing indexes is set in the blockchain node.
  • Table 1 shows an exemplary index generated after the blockchain data is tokenized.
  • the key word in the index is KW1
  • the actual storage address of the blockchain data is URL1
  • the The content summary is content_URL1.
  • each blockchain data can be segmented to generate one or more keywords
  • each blockchain data can correspond to one or more indexes with the same URL.
  • different blockchain data may Word segmentation generates multiple indexes with the same keywords. It can be seen that the database for storing indexes can store multiple indexes with the same keywords and different URLs and multiple indexes with the same URL and different keywords. .
  • the storage of the index specifically includes:
  • the blockchain data in the case where the blockchain data is stored in a key-value format, the blockchain data also includes a first attribute and a second attribute as defined above.
  • any blockchain data can include a first attribute that distinguishes public data from private data. For example, when the first attribute is 0, it means that the blockchain data is public data, and when the first attribute is 1 A binary value indicates that the blockchain data is private data.
  • any blockchain data can also contain a second attribute that identifies the owner of the blockchain data. The combination of the second attribute and the first attribute can control the access rights to the blockchain data. This allows administrators to dynamically adjust in real-time during the operation of the blockchain, thereby improving the dynamic maintainability of the data.
  • an index associated with the blockchain data is stored in a public area in a database for storing the index.
  • an index associated with the blockchain data is stored in a privacy area in the database for storing the index.
  • all indexes associated with the blockchain data are stored in a public area of a database for storing the indexes.
  • the first attribute of the blockchain data is 1, all indexes associated with the blockchain data are stored in a privacy area of a database for storing the indexes.
  • step 210 a search request is received via a hypertext transfer protocol interface.
  • a user initiates a search request for blockchain data directly on a blockchain node.
  • the method 200 further includes: searching for an index matching the search request in the cache of the blockchain node, which specifically includes:
  • a cache is searched for an index matching the search request, where the cache is set on the blockchain node and the search is stored Index
  • step 230 when an index matching the search request is searched, in the case where it is determined that the blockchain data associated with the index is public data, or the user's authentication credentials in the search request and the key in the index If the second attribute of the word matches, step 230 is performed;
  • Step 220 searches an index matching the search request in a database of the blockchain node for storing the index.
  • the present invention can adopt the above steps to avoid repeated search of blockchain data, thereby improving the search efficiency of searching for blockchain data, and reducing the reading pressure on the database used to store the index during the search.
  • step 220 is performed.
  • step 220 an index matching a search request is searched in a database of a blockchain node for storing an index. details as follows:
  • an index matching the search request is searched in the public area.
  • the search request includes authentication credentials of a user who initiated the search request.
  • the authentication credentials of the user may include, but are not limited to, a client certificate or a user name and password of the user.
  • one or more indexes matching the authentication credentials of the user are searched in the privacy area. Specifically, first, the user's authentication credentials are matched with a second attribute of a keyword in each of the indexes in the privacy area; second, the user's authentication credentials are compared with one or more indexes. When the second attribute of the keyword matches, one or more indexes matching the authentication credentials of the user are searched.
  • one or more indexes matching the user's authentication credentials are searched for an index matching the search request.
  • the above-mentioned embodiments disclosed herein can realize the retrieval of blockchain data to generate a corresponding index, so that users can use the index to search for blockchain data, and also realize the control of the user's search authority, thereby ensuring that only Blockchain users can search for private data created by themselves, which improves the security of the search.
  • the method disclosed in the present disclosure further includes step 230: generating a search result webpage based on the uniform resource location address in the searched index.
  • Step 230 may be specifically implemented by using the example shown in FIG. 3:
  • Step 231 Generate a corresponding search result by searching the uniform resource location address in each index and the content summary of the corresponding blockchain data;
  • Step 232 Generate all search results associated with the search request to the search result webpage.
  • step 240 returning a search result webpage associated with the search request.
  • the keyword "artificial intelligence” can be obtained in the word segmentation processing of a large number of different blockchain data in the blockchain, but for different blockchain data, different indexes on “artificial intelligence” include different URL.
  • search request for “artificial intelligence” to the blockchain matches the “artificial intelligence” index in the cache
  • the “artificial intelligence” in the cache corresponds to different URLs to obtain different blockchain data ;
  • return to the user a search results page with one or more "artificial intelligence” keywords When a user ’s search request for “artificial intelligence” to the blockchain fails to search for a matching index in the cache, the user can search for a matching index in the database used to store the index.
  • the "AI" in the database used to store the index can be used to obtain different blockchain data; then the user is returned with one or more "AI" keys Word search results webpage.
  • the user can select one or more search results in the search result webpage that he / she thinks meet the conditions.
  • the user clicks the URL corresponding to the search result the user can select the search result from the blockchain data corresponding to the URL.
  • the data format name of the data parsing method representing the blockchain data is used to parse the blockchain data at the URL; or, the data representing the blockchain data may be based on the blockchain data corresponding to the URL.
  • the data format parsing function name, data format parsing service address, or data format parsing smart contract address of the parsing method parses the blockchain data at the URL.
  • users can realize a fast and effective search of the internal data of the blockchain, and this embodiment can also implement permissions control on users, so that users with permissions (ie , Users with authentication credentials) can search the private data created by them and the public data of the blockchain, while other users without permissions (that is, users without authentication credentials) can only search the public data of the blockchain , Which can not only expand the search scope and improve the search effectiveness for users with permissions, but also improve the protection of the internal data of the blockchain to prevent users without permissions from obtaining private data on the blockchain or users with permissions Obtain private data not created by you.
  • permissions ie , Users with authentication credentials
  • the device 400 includes a data synchronization module 410, a data processing module 420, a data retrieval engine 430, a database 440 for storing indexes, a cache 450, and a search interface unit 460.
  • the data processing module 420 obtains the blockchain data via the data synchronization module 410; the data retrieval engine 430 creates one or more indexes according to the blockchain data and stores the one or more indexes in a storage index
  • the data retrieval engine 430 can also receive a search request through the search interface unit 460, and search the database 440 or the cache 450 for an index matching the search request, and finally Return a search result webpage associated with the search request; wherein a database 440 for storing the index is used to store the created index, and a cache 450 is used to store the searched index.
  • the data synchronization module 410 further includes a data synchronization interface unit 411 and a data access interface unit 412.
  • the data synchronization interface unit 411 obtains data generated by other blockchain nodes of the blockchain
  • the data access interface unit 412 obtains data generated from various applications in the blockchain node.
  • the user sends a search request to the device 400 through the search interface unit 460, and the search interface unit 460 (for example, the search interface unit 460 has a function of a hypertext transfer protocol interface) sends the search request to the data retrieval engine 430; the data retrieval engine 430 is in use
  • the database 440 or cache 450 storing the index is searched for an index matching the search request.
  • the working principle of the apparatus 400 shown in FIG. 4 can be implemented by referring to the steps shown in FIG. 1 to FIG. 3, as follows:
  • the data processing module 420 obtains the blockchain data via the data synchronization module 410, and stores the obtained blockchain data in the block being generated.
  • the data retrieval engine 430 processes the above blockchain data to create at least one index, which specifically includes: first, converting the blockchain data into a web page; second, Web page segmentation is processed into one or more keywords; third, each of the one or more keywords, a content summary of the blockchain data, and a unified resource corresponding to the blockchain data Locating the address generates the corresponding index.
  • the above-mentioned blockchain data can be word-processed into multiple different keywords, so that multiple keywords correspond to the same URL, and accordingly, the above-mentioned blockchain data can generate multiple indexes.
  • the data retrieval engine 430 then stores the generated index in a database 440 for storing the index.
  • the blockchain data in the case where the blockchain data is stored in a key-value format, the blockchain data also includes a first attribute and a second attribute as defined herein.
  • an index associated with the blockchain data is stored in a public area in a database 440 for storing an index;
  • an index associated with the blockchain data is stored in a privacy area in the database 440 for storing indexes.
  • the data retrieval engine 430 searches the cache 450 for the search request based on the matching relationship between the keywords in the index and the search request.
  • the matching index may be implemented by using the implementation manner described above to search the cache for an index matching a search request.
  • the data retrieval engine 430 uses The same manner as the above step 220 is implemented to search an index matching the search request in the database 440 of the blockchain node for storing the index.
  • the data retrieval engine 430 After one or more indexes matching the search request are searched, the data retrieval engine 430 generates a search result webpage based on the uniform resource location address in the searched index in the same manner as step 230 in FIG. 2 described above, and The data retrieval engine 430 stores one or more indexes matching the search request in the cache 450; finally, the data retrieval engine 430 returns the generated search result webpage to the user who initiated the search request via the search interface unit 460.
  • the device 400 disclosed in this embodiment is set on any blockchain node of the blockchain, so that a direct, fast, and accurate search of the blockchain data can be realized, which solves the need to use a search function in the prior art Blockchain application to search for blockchain data, resulting in a slow search speed and inaccurate search results; in addition, the disclosed device 400 can also allow only authorized users (i.e., users with authentication credentials) The user) searches the private data related to the user in the blockchain, that is, sets a permission control on the search request, improving the search security.
  • the above method can be implemented by a computer program product, that is, a computer-readable storage medium.
  • the computer program product may include a computer-readable storage medium having computer-readable program instructions for carrying out various aspects of the present disclosure.
  • the computer-readable storage medium may be a tangible device that can hold and store instructions used by the instruction execution device.
  • the computer-readable storage medium may be, for example, but not limited to, an electric storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Non-exhaustive list of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanical encoding device, such as a printer with instructions stored thereon A protruding structure in the hole card or groove, and any suitable combination of the above.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory flash memory
  • SRAM static random access memory
  • CD-ROM compact disc read only memory
  • DVD digital versatile disc
  • memory stick floppy disk
  • mechanical encoding device such as a printer with instructions stored thereon A protruding structure in the hole card or groove, and any suitable combination of the above.
  • Computer-readable storage media used herein are not to be interpreted as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or transmission through electrical wires Electrical signal.
  • FIG. 5 shows a schematic diagram of a device 500 for searching blockchain data. It should be understood that the device 500 may implement the functions of the method for searching for blockchain data in Figs. 1-3. It can be seen from FIG. 5 that the device 500 for searching for blockchain data includes a processor 501 and a memory 502, where the memory 502 is used to store instructions, and when the instructions in the memory 502 are executed, the processor 501 performs the following operations:
  • A. Receive a search request via a Hypertext Transfer Protocol interface
  • the index includes at least a uniform resource location address corresponding to the blockchain data.
  • step of creating an index according to the blockchain data in step B further includes:
  • a corresponding index is generated for each of the one or more keywords, a content summary of the blockchain data, and a uniform resource location address corresponding to the blockchain data.
  • generating the search result webpage based on the uniform resource location address in the searched index in the step C further includes:
  • the search result webpage is generated from all search results associated with the search request.
  • the blockchain data further includes a first attribute
  • the database is further configured to:
  • the first attribute of the blockchain data indicates that the blockchain data is public data, storing an index associated with the blockchain data in a public area in the database;
  • an index associated with the blockchain data is stored in a privacy area in the database.
  • searching for an index matching the search request in the database in the step B further includes:
  • step B2 based on the matching relationship between the keywords in the index and the search request, search in the privacy area for a match with the search request.
  • the index further includes:
  • the search request includes the authentication credentials of the user, searching in the privacy area for one or more indexes matching the authentication credentials of the user;
  • the blockchain data further includes a second attribute.
  • the privacy Searching in the area for one or more indexes matching the user's authentication credentials further includes:
  • one or more indexes matching the authentication credentials of the user are searched.
  • the processor 501 when the instruction is executed, the processor 501 performs the following operations after the step A and before the step B:
  • the cache is used to store the searched index.
  • the embodiments disclosed above can retrieve the blockchain data to generate an index on the one hand, and store the generated index in a database, and then can use the index in the database to search the blockchain data; It can also control the permissions of the user who initiated the search request, so that users with authentication credentials can search not only the public data in the blockchain but also private data created by themselves. Conversely, users without authentication credentials can only The public data in the blockchain is searched, thereby realizing precise control of searching the blockchain data.
  • FIG. 6 shows a schematic diagram of a device 600 for searching blockchain data.
  • the device 600 may implement the functions of the method 200 for searching for blockchain data in FIG. 2.
  • the device 600 for searching for blockchain data includes a central processing unit (CPU) 601 (for example, a processor), which can be based on computer program instructions stored in a read-only memory (ROM) 602 or Computer program instructions loaded from a storage unit 608 into a random access memory (RAM) 603 to perform various appropriate actions and processes.
  • ROM read-only memory
  • RAM random access memory
  • various programs and data required for the operation of the device 600 can also be stored.
  • the CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604.
  • An input / output (I / O) interface 605 is also connected to the bus 604.
  • the I / O interface 605 including: an input unit 606, such as a keyboard, a mouse, etc .; an output unit 607, such as various types of displays, speakers, etc .; a storage unit 608, such as a magnetic disk, an optical disk, etc And a communication unit 609, such as a network card, a modem, a wireless communication transceiver, and the like.
  • the communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
  • the method 200 for searching blockchain data may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 608.
  • part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609.
  • the computer program is loaded into the RAM 603 and executed by the CPU 601, one or more actions or steps in the method 200 described above may be performed.
  • the various example embodiments of the invention may be implemented in hardware or special purpose circuits, software, firmware, logic, or any combination thereof. Some aspects may be implemented in hardware, while other aspects may be implemented in firmware or software which may be executed by a controller, microprocessor, or other computing device.
  • aspects of embodiments of the invention are illustrated or described as a block diagram, a flowchart, or using some other graphical representation, it will be understood that the blocks, devices, systems, techniques, or methods described herein may serve as non-limiting examples. Implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers, or other computing devices, or some combination thereof.
  • the computer-readable program instructions or computer program products used to execute the various aspects of the present invention can also be stored in the cloud. When it is required to be called, the user can access the stored cloud for execution through the mobile Internet, fixed network or other networks.
  • the computer-readable program instructions of an aspect of the present invention implement the technical solutions disclosed according to the various aspects of the present invention.
  • the method for searching for blockchain data can use an index created based on the blockchain data to implement a direct search of the blockchain data by the user and reduce the search pressure;
  • the aspect can control the user's permissions, so that users with permissions can search both the private data created by themselves and the public data of the blockchain, thereby expanding the search scope and improving the effectiveness of searches for users with permissions.
  • users without permissions are prevented from obtaining private data on the blockchain, thereby improving the security of searching for blockchain data.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明内容公开了一种用于搜索区块链数据的方法,所述方法包括:A.经由超文本传输协议接口接收搜索请求;B.在区块链节点的用于存储索引的数据库中搜索与所述搜索请求相匹配的索引,其中,所述数据库中存储的索引是根据区块链数据所创建的索引;C.基于搜索到的索引中的统一资源定位地址生成搜索结果网页;D.返回与所述搜索请求相关联的搜索结果网页。本发明内容能够基于在区块链节点上实现内置的搜索功能来对区块链内部的数据进行搜索。

Description

用于搜索区块链数据的方法、设备及可读存储介质 技术领域
本发明内容属于区块链技术领域,尤其涉及一种用于搜索区块链数据的方法、一种用于搜索区块链数据的设备以及一种相应的计算机可读存储介质。
背景技术
区块链(Blockchain)是用分布式数据库识别、传播和记载信息的智能化对等网络,也称为价值互联网。区块链具有去中心化、反篡改、数据一致性存储、过程透明可追踪等技术优势,其在金融、征信、物联网、经济贸易结算、资产管理等众多领域都拥有广泛的应用前景。区块链由所有参加的区块链节点共同维护,每一个参与维护的区块链节点都可以获得一份区块链数据的完整拷贝并独立进行验证。区块链采用了密码技术来保证区块链只能添加新数据而不能篡改已经存在的数据。
区块链根据访问权限通常分为公有链、联盟链和私有链。其中,公有链是指任何人都可以根据协议接入并且参与共识的区块链;联盟链是指其共识过程受到预选区块链节点控制的区块链;私有链是指所有权限都在一个组织中,并受该组织任意控制的区块链。
随着各种区块链应用程序的普及,用于不同领域的联盟链和私有链上都存储了大量的、不可篡改的数据,这些数据对于区块链用户而言都具有重要意义。
发明内容
本发明的实施例提供了一种用于搜索区块链数据的方法、设备和计算机可读存储介质,能够利用根据区块链数据所创建的索引对区块链数据进行搜索,从而实现了针对区块链的搜索服务。
为此,本发明内容的第一方面提出了一种用于搜索区块链数据的方法,所述方法包括:
A.经由超文本传输协议接口接收搜索请求;
B.在区块链节点的用于存储索引的数据库中搜索与所述搜索请求相匹配的索引,其中,所述数据库中存储的索引是根据区块链数据所创建的索引;
C.基于搜索到的索引中的统一资源定位地址生成搜索结果网页;以及
D.返回与所述搜索请求相关联的搜索结果网页。
此外,本发明内容的第二方面提出了一种用于搜索区块链数据的设备,所述设备包括:处理器;以及存储器,其用于存储指令,当所述指令执行时使得所述处理器执行以下操作:
A.经由超文本传输协议接口接收搜索请求;
B.在区块链节点的用于存储索引的数据库中搜索与所述搜索请求相匹配的索引,其中,所述数据库中存储的索引是根据区块链数据所创建的索引;
C.基于搜索到的索引中的统一资源定位地址生成搜索结果网页;以及
D.返回与所述搜索请求相关联的搜索结果网页。
最后,本发明内容的第三方面提出了一种计算机可读存储介质,其具有存储在其上的计算机可读程序指令,所述计算机可读程序指令用于执行根据上述第一方面所述的用于搜索区块链数据的方法。
依据本发明内容的用于搜索区块链数据的方法、设备以及相对应的计算机可读存储介质能够实现如下功能:
基于在区块链节点上实现内置的搜索功能,能够对区块链数据进行检索生成索引并且将该索引存储在数据库中;然后,在经由超文本传输协议接口接收到用户的搜索请求时,能够对上述的数据库进行搜索。本发明的其他优势将在下文中进一步说明。
附图说明
结合附图并参考以下详细说明,本发明的各实施例的特征、优点及其他方面将变得更加明显,在此以示例性而非限制性的方式示出了本发明的若干实施例,在附图中:
图1为依据本发明内容的用于搜索区块链数据的方法的第一实施例的 流程图;
图2为依据本发明内容的用于搜索区块链数据的方法的流程图;
图3为依据本发明内容的用于搜索区块链数据的方法的第二实施例的流程图;
图4为用于实现依据本发明内容的用于搜索区块链数据的方法的示例性装置的示意图;
图5为依据本发明内容的用于搜索区块链数据的设备的第一实施例的示意图;以及
图6为依据本发明内容的另一个示例性用于搜索区块链数据的设备的第一实施例的示意图。
具体实施方式
以下参考附图详细描述本发明的各个示例性实施例。附图中的流程图和框图示出了根据本发明的各种实施例的方法和系统的可能实现的体系架构、功能和操作。应当注意,流程图或框图中的每一个方框可以代表一个模块、程序段、或代码的一部分,所述模块、程序段、或代码的一部分可以包括一个或多个用于实现各个实施例中所规定的逻辑功能的可执行指令。也应当注意,在有些作为备选的实现中,方框中所标注的功能也可以按照不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,或者它们有时也可以按照相反的顺序执行,这取决于所涉及的功能。同样应当注意的是,流程图和/或框图中的每一个方框、以及流程图和/或框图中的方框的组合,可以使用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以使用专用硬件与计算机指令的组合来实现。
本文所使用的术语"包括"、"包含"及类似术语是开放性的术语,即"包括/包含但不限于",表示还可以包括其他内容。术语"基于"是"至少部分地基于"。术语"一个实施例"表示"至少一个实施例";术语"另一个实施例"表示"至少一个另外的实施例",等等。
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨 论,但在适当情况下,所述技术、方法和设备应当视为说明书的一部分。对于附图中的各单元之间的连线,仅仅是为了便于说明,其表示至少连线两端的单元是相互通信的,并非旨在限制未连线的单元之间无法通信。
为了便于描述,下面对本发明内容中出现的一些术语进行说明,应当理解,本申请所使用的术语应解释为具有与其在本申请说明书的上下文及有关领域中的意义一致的意义。
本发明内容中的术语"统一资源定位地址"是指因特网上标准的资源的地址,又称统一资源定位符(URL:Uniform Resource Locator)或网页地址。
本发明内容中的术语"公开数据"是指不需要身份验证即可访问的数据,而"隐私数据"是指需要身份验证才可访问的数据。
本发明内容中的术语"第一"、"第二"仅用于描述指代、目的或某具体事物,而不能理解为指示或暗示相对重要性,或者隐含指明所指示的技术特征的数量。
本发明内容中的术语"多个"是指两个或两个以上。
本发明内容中出现了术语"检索"和"搜索",其中,术语"检索"是指搜索引擎通过网络爬虫程序对于区块链数据的抓取、处理、建立索引和遍历的过程,而术语"搜索"是指搜索引擎接收用户在搜索引擎页面上输入关键词后对于之前的建立过索引的网页内容的查找。
本发明内容中的术语"分词处理"是指将使用中文或其他不存在分隔符的语言书写的区块链数据切分成单独的字或词的处理方式。
本发明内容中的术语"第一属性"用于标记区块链数据为隐私或者公开;而术语"第二属性"用于标识创建区块链数据的所有者。
本发明内容中的术语"公开区域"是指区块链中的公开数据所对应的索引在数据库中的存储区域,而术语"隐私区域"是指区块链中的隐私数据所对应的索引在数据库中的存储区域。
本发明内容中的术语"认证凭证"是指区块链用户访问相应的区块链所需要的验证信息。
为了解决现有技术中缺乏区块链内建的搜索机制使得区块链用户无法 对区块链数据进行快速、精确、高效搜索的问题,本发明内容所公开的用于搜索区块链数据的技术方案将在下文中进行详细描述,来说明如何在区块链的任一区块链节点上实现对区块链数据的高效搜索。
为了实现图2所公开的用于搜索区块链数据的方法200的实施例,本发明内容首先需要进行以下具体操作:
首先,在区块链中的至少一个节点(也即,本文中指代的区块链节点)上实时获得区块链数据。其中,所获得的区块链数据既包括来自区块链的其他区块链节点生成的数据也包括来自该区块链节点中的各种应用程序所生成的数据。
然后,将所获得的区块链数据存储在正在生成的区块中,可以采用现有的或将来开发的技术来实现将所获得的区块链数据存储在正在生成的区块。
同时地或随后地,根据该区块链数据创建至少一条索引。
具体地,还需如图1所示示例的具体步骤来实现根据该区块链数据创建至少一条索引:
步骤110:将所述区块链数据转换成网页。
步骤120:通过对所述网页进行分词处理来获得一个或多个关键词。
作为示例,区块链数据可以采用但不仅限于采用键值(key/value)格式进行存储,则对区块链数据进行分词处理生成的关键词也是具有键值格式的数据。
步骤130:将所述一个或多个关键词中的每一个关键词、所述区块链数据的内容摘要以及与所述区块链数据相对应的统一资源定位地址生成相应的索引。
接下来,将所生成的索引存储在用于存储索引的数据库中。其中,该用于存储索引的数据库设置在该区块链节点中。
由此可知,每当区块链节点获得区块链数据时,即对该区块链数据进行处理以生成相应的索引,并将所生成的索引存储在用于存储索引的数据库中,进而可以确保能够搜索到的区块链数据的全面性。
由此,当关键词是具有键值格式的数据时,用于存储索引的数据库接 收到的每一条索引的格式如下表所示:
关键词 内容摘要 对应的统一资源定位地址
KW1 content_URL1 URL1
表一
表一示出了在区块链数据被分词处理后生成的示例性索引,其中,该索引中的关键词为KW1,该区块链数据的实际存储地址为URL1,并且该区块链数据的内容摘要为content_URL1。
在具体实现中,由于每一个区块链数据可以分词生成一个或多个关键词,因此每一个区块链数据可以对应一条或多条具有相同URL的索引,此外,不同的区块链数据可能分词生成多个具有相同的关键词的索引,由此可知,所述用于存储索引的数据库中可以存储多条具有相同关键词、不同URL的索引以及多条具有相同URL、不同关键词的索引。
在目前主流的区块链平台中公有链完全不对区块链数据的访问设置限制,而比如Fabric、Corda等联盟链对所有区块链数据中的全部的数据都做访问权限控制。一般而言,企业级区块链通常使用联盟链平台,对全部数据均做了访问权限。举例来说,一个使用区块链实现的保险销售系统,区块链中的保险价格、条款等信息是希望能够检索查询的、无需授权的;但是其他信息,例如用户信息、交易信息、理赔记录等信息是需要进行访问权限控制的,否则既不利于保护客户隐私也不利于保护保险公司的商业秘密。
因此,针对联盟链类型的区块链中数据的不同类型而言,对索引的存储具体包括:
如所公开的实施例所示,在区块链数据采用键值格式进行存储的情况下,该区块链数据还包括如上面所定义的第一属性和第二属性。
例如任一区块链数据能够包含一个区分公开数据与隐私数据的第一属性,例如,该第一属性为0时表示该区块链数据为公开数据,而当该第一属性为1的第二值时表示该区块链数据为隐私数据。另外,任一区块链数据还能够包含一个标识区块链数据的所有者的第二属性,该第二属性与第 一属性的配合使用可以控制对区块链数据的访问权限。由此,允许管理员在区块链运行过程之中实时动态地进行调整,从而提高了数据的动态维护性。
在区块链数据的第一属性表明该区块链数据是公开数据的情况下,将与该区块链数据相关联的索引存储在用于存储索引的数据库中的公开区域中。
在区块链数据的第一属性表明该区块链数据是隐私数据的情况下,将与该区块链数据相关联的索引存储在该用于存储索引的数据库中的隐私区域中。
在本实施例中,当区块链数据的第一属性为0时,将与该区块链数据相关联的所有索引存储在用于存储索引的数据库的公开区域中。当区块链数据的第一属性为1时,将与该区块链数据相关联的所有索引存储在用于存储索引的数据库的隐私区域中。
由此实现了对于索引的区分存储,进而有助于实现对区块链数据的访问控制。
如图2所示,公开了用于搜索区块链数据的方法200的具体实现方式:
在步骤210中,经由超文本传输协议接口接收搜索请求。
具体地,用户直接在区块链节点上发起对区块链数据的搜索请求。
在步骤210之后,方法200还包括:在该区块链节点的缓存中搜索与搜索请求相匹配的索引,具体包括:
首先,基于所述索引中的关键词与所述搜索请求之间的匹配关系,在缓存中搜索与所述搜索请求相匹配的索引,其中,该缓存设置在该区块链节点上并存储搜索过的索引;
其次,当搜索到与该搜索请求相匹配的索引时,在确定与该索引相关联的区块链数据是公开数据的情况下,或者在该搜索请求中的用户的认证凭证与该索引中关键词的第二属性相匹配的情况下,执行步骤230;
或者,在未搜索到与该搜索请求相匹配的索引的情况下,或者在该搜索请求中的用户的认证凭证与搜索到的索引中关键词的第二属性不匹配的情况下,转向所述步骤220在区块链节点的用于存储索引的数据库中搜索 与该搜索请求相匹配的索引。
本发明内容可以采用上述步骤来避免对区块链数据的重复搜索,由此提高了搜索区块链数据的搜索效率,并且能够减少搜索时对用于存储索引的数据库的读取压力。
在该区块链节点的缓存中未搜索到与该搜索请求相匹配的索引的情况下执行步骤220。
在步骤220中,在区块链节点的用于存储索引的数据库中搜索与所述搜索请求相匹配的索引。具体如下:
首先,基于所述索引中的关键词与所述搜索请求之间的匹配关系,在所述公开区域中搜索与所述搜索请求相匹配的索引。
然后,基于所述索引中的关键词与所述搜索请求之间的匹配关系,在所述隐私区域中搜索与所述搜索请求相匹配的索引,具体步骤如下:
第一,确定所述搜索请求中是否包括发起所述搜索请求的用户的认证凭证。在本实施例中,所述用户的认证凭证可以包括但不限于客户证书或者用户的用户名及密码等形式。
第二,在确定所述搜索请求中包括所述用户的认证凭证的情况下,在所述隐私区域中搜索与所述用户的认证凭证相匹配的一条或多条索引。具体地,首先,将所述用户的认证凭证与所述隐私区域中的每一条所述索引中关键词的第二属性进行匹配;其次,在所述用户的认证凭证与一条或多条索引中关键词的第二属性匹配的情况下,搜索到与所述用户的认证凭证相匹配的一条或多条索引。
第三,基于所述索引中的关键词与所述搜索请求之间的匹配关系,在与所述用户的认证凭证相匹配的一条或多条索引中搜索与所述搜索请求相匹配的索引。
在上述步骤中,在确定该搜索请求中不包括所述用户的认证凭证、或者尽管该搜索请求中包括了所述用户的认证凭证但是不存在与所述用户的认证凭证相关联的一条或多条索引、或者与所述用户的认证凭证相关联的一条或多条索引中不存在与该搜索请求相匹配的索引的情况下,表明在该用于存储索引的数据库的隐私区域中未能够找到与该搜索请求相匹配的索 引。
本文所公开的上述实施例能够实现对区块链数据进行检索以生成相应的索引,以便于用户利用索引搜索到区块链数据,并且还实现了对用户的搜索权限控制,由此能够保证仅区块链用户能够搜索到其自己创建的隐私数据,提高了搜索的安全性。
另外,如图2所示,本发明内容所公开的方法还包括步骤230:基于搜索到的索引中的统一资源定位地址生成搜索结果网页。步骤230可以采用如图3所示的示例具体实现:
步骤231:将搜索到的每一条索引中的统一资源定位地址以及相应的区块链数据的内容摘要生成相应的搜索结果;
步骤232:将与所述搜索请求相关联的所有搜索结果生成所述搜索结果网页。
接下来,如图2所示,本发明内容所公开的方法还包括步骤240:返回与所述搜索请求相关联的搜索结果网页。
例如,关键词“人工智能”可以在对区块链中大量不同的区块链数据进行分词处理中分别得到,但是针对不同的区块链数据,不同的关于“人工智能”的索引中包括不同的URL。当用户向区块链发起的有关“人工智能”的搜索请求与缓存中的“人工智能”索引相匹配时,可以利用缓存中的“人工智能”对应不同的URL来获得不同的区块链数据;然后向用户返回具有一个或多个“人工智能”关键词的搜索结果网页。当用户向区块链发起的有关“人工智能”的搜索请求在缓存中未能搜索相匹配的索引时,可以在用于存储索引的数据库中搜索相匹配的索引,如果在用于存储索引的数据库搜索到相匹配的索引时,可以利用用于存储索引的数据库中的“人工智能”对应不同的URL来获得不同的区块链数据;然后向用户返回具有一个或多个“人工智能”关键词的搜索结果网页。
最后,用户可以在所呈现的搜索结果网页中选择一个或多个其认为符合条件的搜索结果,当用户点击该搜索结果所对应的URL时,可以根据该URL所对应的区块链数据中的表示区块链数据的数据解析方法的数据格式名来解析在该URL处的区块链数据;或者,可以根据该URL所对应的区 块链数据中的用于表示该区块链数据的数据解析方法的数据格式解析函数名、数据格式解析服务地址、或数据格式解析智能合约地址来解析在该URL处的区块链数据。
结合图1-图3所阐述的上述实施例,能够实现用户对区块链内部数据的快速、有效的搜索,并且该实施例还能够实现对用户的权限控制,使得具有权限的用户(也即,具有认证凭证的用户)能够搜索到自己创建的隐私数据以及区块链的公开数据,而其他不具有权限的用户(也即,没有认证凭证的用户)仅能够搜索到区块链的公开数据,从而既能够为具有权限的用户扩大搜索范围并提高搜索的有效性,也能够提高对区块链内部数据的保护以避免不具有权限的用户获得区块链上的隐私数据或具有权限的用户获得非其自己创建的隐私数据。
此外,如图4所示,本文还公开了用于实现用于搜索区块链数据的方法的示例性装置400,其中,装置400可以设置在区块链中的任一区块链节点上。如图4所示,装置400包括:数据同步模块410、数据处理模块420、数据检索引擎430、用于存储索引的数据库440、缓存450以及搜索接口单元460。
具体地,数据处理模块420经由数据同步模块410获得区块链数据;数据检索引擎430根据所述区块链数据创建一条或多条索引并将所述一条或多条索引存储在用于存储索引的数据库440中,此外,数据检索引擎430还能够通过搜索接口单元460接收搜索请求,并在所述用于存储索引的数据库440或所述缓存450中搜索与该搜索请求相匹配的索引,最后返回与所述搜索请求相关联的搜索结果网页;其中,用于存储索引的数据库440用于存储所创建的索引,缓存450用于存储搜索过的索引。
如图4所示,数据同步模块410进一步包括:数据同步接口单元411和数据接入接口单元412。其中,数据同步接口单元411获得区块链的其他区块链节点生成的数据,数据接入接口单元412获得来自该区块链节点中的各种应用程序所生成的数据。用户通过搜索接口单元460向装置400发送搜索请求,搜索接口单元460(例如,搜索接口单元460具有超文本传输协议接口的功能)将该搜索请求发送到数据检索引擎430;数据检索引擎 430在用于存储索引的数据库440或缓存450中查找与该搜索请求相匹配的索引。
图4示出的装置400的工作原理可以参考图1-图3所示的步骤实现,具体如下:
首先,数据处理模块420经由数据同步模块410获得区块链数据,并将所获得的区块链数据存储在正在生成的区块中。
其次,类似于图1所示的示例,数据检索引擎430对上述区块链数据进行处理以创建至少一条索引,具体包括:第一、将该区块链数据转换成网页;第二、将该网页分词处理成一个或多个关键词;第三、将所述一个或多个关键词中的每一个关键词、该区块链数据的内容摘要以及与该区块链数据相对应的统一资源定位地址生成相应的索引。
作为示例,上述区块链数据可以分词处理成多个不同的关键词,使得多个关键词都对应同一个URL,相应地上述区块链数据可以生成多条索引。
然后,数据检索引擎430将所生成的索引存储在用于存储索引的数据库440中。
如所公开的实施例所示,在区块链数据采用键值格式进行存储的情况下,该区块链数据还包括如本文所定义的第一属性和第二属性。
接下来,在区块链数据的第一属性表明该区块链数据是公开数据的情况下,在用于存储索引的数据库440中的公开区域中存储与该区块链数据相关联的索引;其次,在区块链数据的第一属性表明该区块链数据是隐私数据的情况下,在该用于存储索引的数据库440中的隐私区域中存储与该区块链数据相关联的索引。
当数据检索引擎430从搜索接口单元460中接收到搜索请求时,首先,数据检索引擎430基于所述索引中的关键词与所述搜索请求之间的匹配关系在缓存450中搜索与搜索请求相匹配的索引,可以采用上文所描述的如何在缓存中搜索与搜索请求相匹配的索引的实现方式来实现。当未在缓存中搜索到与该搜索请求相匹配的索引时或者在该搜索请求中的用户的认证凭证与搜索到的索引中关键词的第二属性不匹配的情况下,数据检索引擎430采用与上述步骤220相同的方式实现在区块链节点的用于存储索引的 数据库440中搜索与该搜索请求相匹配的索引。
然后在搜索到与搜索请求相匹配的一条或多条索引之后,数据检索引擎430采用与上述图2中的步骤230相同的方式基于搜索到的索引中的统一资源定位地址生成搜索结果网页,并且数据检索引擎430将搜索到与搜索请求相匹配的一条或多条索引存储在缓存450中;最后数据检索引擎430将所生成的搜索结果网页经由搜索接口单元460返回给发起搜索请求的用户。
本实施例所公开的装置400设置在区块链的任一区块链节点上,从而能够实现对区块链数据的直接、快速、精确的搜索,解决了现有技术中需要利用具有搜索功能的区块链应用程序来实现搜索区块链数据而导致的搜索速度慢、搜索结果不够准确的问题;此外,所公开的装置400还能够实现仅允许具有权限的用户(即,具有认证凭证的用户)搜索区块链中与该用户相关的隐私数据,也即,对搜索请求设置了权限控制,提高了搜索安全性。
此外,上述方法能够通过计算机程序产品,即计算机可读存储介质来实现。计算机程序产品可以包括计算机可读存储介质,其上载有用于执行本发明内容的各个方面的计算机可读程序指令。计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是但不限于电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。
图5示出了用于搜索区块链数据的设备500的示意图。应当理解,设 备500可以实现图1-3中的用于搜索区块链数据的方法的功能。从图5中可以看出用于搜索区块链数据的设备500包括处理器501、存储器502,其中,存储器502用于存储指令,当存储器502中的指令执行时使得处理器501执行以下操作:
A.经由超文本传输协议接口接收搜索请求;
B.在区块链节点的用于存储索引的数据库中搜索与所述搜索请求相匹配的索引,其中,所述数据库中存储的索引是根据区块链数据所创建的索引;
C.基于搜索到的索引中的统一资源定位地址生成搜索结果网页;以及
D.返回与所述搜索请求相关联的搜索结果网页。
在依据本发明内容的一个实施例中,所述索引至少包括与所述区块链数据相对应的统一资源定位地址。
在依据本发明内容的一个实施例中,所述步骤B中根据区块链数据创建索引进一步包括:
将所述区块链数据转换成网页;
通过对所述网页进行分词处理来获得一个或多个关键词;以及
将所述一个或多个关键词中的每一个关键词、所述区块链数据的内容摘要以及与所述区块链数据相对应的统一资源定位地址生成相应的索引。
在依据本发明内容的一个实施例中,所述步骤C中基于搜索到的索引中的统一资源定位地址生成搜索结果网页进一步包括:
将搜索到的每一条索引中的统一资源定位地址以及相应的区块链数据的内容摘要生成相应的搜索结果;以及
将与所述搜索请求相关联的所有搜索结果生成所述搜索结果网页。
在依据本发明内容的一个实施例中,所述区块链数据还包括第一属性,所述数据库进一步用于:
在所述区块链数据的第一属性表明所述区块链数据是公开数据的情况下,在所述数据库中的公开区域中存储与所述区块链数据相关联的索引;
在所述区块链数据的第一属性表明所述区块链数据是隐私数据的情况下,在所述数据库中的隐私区域中存储与所述区块链数据相关联的索引。
在依据本发明内容的一个实施例中,所述步骤B中在所述数据库中搜索与所述搜索请求相匹配的索引进一步包括:
B1.基于所述索引中的关键词与所述搜索请求之间的匹配关系,在所述公开区域中搜索与所述搜索请求相匹配的索引;以及
B2.基于所述索引中的关键词与所述搜索请求之间的匹配关系,在所述隐私区域中搜索与所述搜索请求相匹配的索引。
在依据本发明内容的一个实施例中,所述步骤B2中基于所述索引中的关键词与所述搜索请求之间的匹配关系,在所述隐私区域中搜索与所述搜索请求相匹配的索引进一步包括:
B21.确定所述搜索请求中是否包括发起所述搜索请求的用户的认证凭证;
B22.在确定所述搜索请求中包括所述用户的认证凭证的情况下,在所述隐私区域中搜索与所述用户的认证凭证相匹配的一条或多条索引;以及
B23.基于所述索引中的关键词与所述搜索请求之间的匹配关系,在与所述用户的认证凭证相匹配的一条或多条索引中搜索与所述搜索请求相匹配的索引。
在依据本发明内容的一个实施例中,所述区块链数据还包括第二属性,所述步骤B22中在确定所述搜索请求中包括所述用户的认证凭证的情况下,在所述隐私区域中搜索与所述用户的认证凭证相匹配的一条或多条索引进一步包括:
将所述用户的认证凭证与所述隐私区域中的每一条所述索引中关键词的第二属性进行匹配;以及
在所述用户的认证凭证与一条或多条索引中关键词的第二属性匹配的情况下,搜索到与所述用户的认证凭证相匹配的一条或多条索引。
在依据本发明内容的一个实施例中,当所述指令执行时使得所述处理器501在所述步骤A之后、所述步骤B之前还执行以下操作:
X.基于所述索引中的关键词与所述搜索请求之间的匹配关系,在缓存中搜索与所述搜索请求相匹配的索引。
在依据本发明内容的一个实施例中,所述缓存用于存储搜索过的索引。
上面所公开的实施例一方面能够对区块链数据进行检索来生成索引,并将所生成的索引存储在数据库中,进而能够利用数据库中的索引实现对区块链数据的搜索;另一方面也能够控制发起搜索请求的用户的权限,使得具有认证凭证的用户不仅能够搜索到区块链中的公开数据也能够搜索到其自身创建的隐私数据,相反,使得不具有认证凭证的用户仅能够搜索到区块链中的公开数据,由此实现了对搜索区块链数据的精确控制。
图6示出了用于搜索区块链数据的设备600的示意图。应当理解的是,设备600可以实现图2中的用于搜索区块链数据的方法200的功能。从图6中可以看出用于搜索区块链数据的设备600包括中央处理单元(CPU)601(例如,处理器),其可以根据存储在只读存储器(ROM)602中的计算机程序指令或者从存储单元608加载到随机访问存储器(RAM)603中的计算机程序指令,来执行各种适当的动作和处理。在RAM 603中,还可存储该设备600操作所需的各种程序和数据。CPU 601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
设备600中的多个部件连接至I/O接口605,包括:输入单元606,例如键盘、鼠标等;输出单元607,例如各种类型的显示器、扬声器等;存储单元608,例如磁盘、光盘等;以及通信单元609,例如网卡、调制解调器、无线通信收发机等。通信单元609允许该设备600通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。
上文所描述的各种方法,例如用于搜索区块链数据的方法能够由CPU601执行。例如,在一些实施例中,用于搜索区块链数据的方法200可以实现为计算机软件程序,其有形地包含于机器可读介质,例如存储单元608。在一些实施例中,计算机程序的部分或者全部可以经由ROM 602和/或通信单元609而载入和/或安装到该设备600上。当计算机程序加载到RAM603并由CPU 601执行时,可以执行上文描述的方法200中的一个或多个动作或步骤。
一般而言,本发明的各种示例实施例可以在硬件或专用电路、软件、固件、逻辑,或其任何组合中实施。某些方面可以在硬件中实施,而其他方面可以在可以由控制器、微处理器或其他计算设备执行的固件或软件中 实施。当本发明的实施例的各方面图示或描述为框图、流程图或使用某些其他图形表示时,将理解此处描述的方框、装置、系统、技术或方法可以作为非限制性的示例在硬件、软件、固件、专用电路或逻辑、通用硬件或控制器或其他计算设备,或其某些组合中实施。
用于执行本发明内容的各个方面的计算机可读程序指令或者计算机程序产品也能够存储在云端,在需要调用时,用户能够通过移动互联网、固网或者其他网络访问存储在云端上的用于执行本发明内容的一方面的计算机可读程序指令,从而实施依据本发明内容的各个方面所公开的技术方案。
综上所述,本发明内容所提出的用于搜索区块链数据的方法一方面能够利用根据区块链数据创建的索引实现用户对区块链数据的直接搜索并减少了搜索压力;另一方面能够控制用户的权限,使得具有权限的用户既能够搜索到自己创建的隐私数据又能够搜索到区块链的公开数据,从而实现了为具有权限的用户扩大搜索范围并提高搜索的有效性,同时避免不具备权限的用户获得区块链上的隐私数据,由此提高了对区块链数据进行搜索的安全性。
以上所述仅为所公开的实施例可选实施例,并不用于限制所公开的实施例,对于本领域的技术人员来说,所公开的实施例可以有各种更改和变化。凡在所公开的实施例的精神和原则之内,所作的任何修改、等效替换、改进等,均应包含在所公开的实施例的保护范围之内。
虽然已经参考若干具体实施例描述了所公开的实施例,但是应该理解,所公开的实施例并不限于所公开的具体实施例。所公开的实施例旨在涵盖在所附权利要求的精神和范围内所包括的各种修改和等同布置。所附权利要求的范围符合最宽泛的解释,从而包含所有这样的修改及等同结构和功能。

Claims (21)

  1. 一种用于搜索区块链数据的方法,所述方法包括:
    A.经由超文本传输协议接口接收搜索请求;
    B.在区块链节点的用于存储索引的数据库中搜索与所述搜索请求相匹配的索引,其中,所述数据库中存储的索引是根据区块链数据所创建的索引;
    C.基于搜索到的索引中的统一资源定位地址生成搜索结果网页;以及
    D.返回与所述搜索请求相关联的搜索结果网页。
  2. 根据权利要求1所述的方法,其中,所述索引至少包括与所述区块链数据相对应的统一资源定位地址。
  3. 根据权利要求1所述的方法,其中,所述步骤B中根据区块链数据创建索引进一步包括:
    将所述区块链数据转换成网页;
    通过对所述网页进行分词处理来获得一个或多个关键词;以及
    将所述一个或多个关键词中的每一个关键词、所述区块链数据的内容摘要以及与所述区块链数据相对应的统一资源定位地址生成相应的索引。
  4. 根据权利要求3所述的方法,其中,所述步骤C中基于搜索到的索引中的统一资源定位地址生成搜索结果网页进一步包括:
    将搜索到的每一条索引中的统一资源定位地址以及相应的区块链数据的内容摘要生成相应的搜索结果;以及
    将与所述搜索请求相关联的所有搜索结果生成所述搜索结果网页。
  5. 根据权利要求3所述的方法,其中,所述区块链数据还包括第一属性,所述数据库进一步用于:
    在所述区块链数据的第一属性表明所述区块链数据是公开数据的情况下,在所述数据库中的公开区域中存储与所述区块链数据相关联的索引;
    在所述区块链数据的第一属性表明所述区块链数据是隐私数据的情况下,在所述数据库中的隐私区域中存储与所述区块链数据相关联的索引。
  6. 根据权利要求5所述的方法,其中,所述步骤B中在所述数据库中搜索与所述搜索请求相匹配的索引进一步包括:
    B1.基于所述索引中的关键词与所述搜索请求之间的匹配关系,在所述公开区域中搜索与所述搜索请求相匹配的索引;以及
    B2.基于所述索引中的关键词与所述搜索请求之间的匹配关系,在所述隐私区域中搜索与所述搜索请求相匹配的索引。
  7. 根据权利要求6所述的方法,其中,所述步骤B2中基于所述索引中的关键词与所述搜索请求之间的匹配关系,在所述隐私区域中搜索与所述搜索请求相匹配的索引进一步包括:
    B21.确定所述搜索请求中是否包括发起所述搜索请求的用户的认证凭证;
    B22.在确定所述搜索请求中包括所述用户的认证凭证的情况下,在所述隐私区域中搜索与所述用户的认证凭证相匹配的一条或多条索引;以及
    B23.基于所述索引中的关键词与所述搜索请求之间的匹配关系,在与所述用户的认证凭证相匹配的一条或多条索引中搜索与所述搜索请求相匹配的索引。
  8. 根据权利要求7所述的方法,其中,所述区块链数据还包括第二属性,所述步骤B22中在确定所述搜索请求中包括所述用户的认证凭证的情况下,在所述隐私区域中搜索与所述用户的认证凭证相匹配的一条或多条索引进一步包括:
    将所述用户的认证凭证与所述隐私区域中的每一条所述索引中关键词的第二属性进行匹配;以及
    在所述用户的认证凭证与一条或多条索引中关键词的第二属性匹配的情况下,搜索到与所述用户的认证凭证相匹配的一条或多条索引。
  9. 根据权利要求7所述的方法,其中,在所述步骤A之后、所述步骤B之前,所述方法进一步包括:
    X.基于所述索引中的关键词与所述搜索请求之间的匹配关系,在缓存中搜索与所述搜索请求相匹配的索引。
  10. 根据权利要求9所述的方法,其中,所述缓存用于存储搜索过的索引。
  11. 一种用于搜索区块链数据的设备,所述设备包括:
    处理器;以及
    存储器,其用于存储指令,当所述指令执行时使得所述处理器执行以 下操作:
    A.经由超文本传输协议接口接收搜索请求;
    B.在区块链节点的用于存储索引的数据库中搜索与所述搜索请求相匹配的索引,其中,所述数据库中存储的索引是根据区块链数据所创建的索引;
    C.基于搜索到的索引中的统一资源定位地址生成搜索结果网页;以及
    D.返回与所述搜索请求相关联的搜索结果网页。
  12. 根据权利要求11所述的设备,其中,所述索引至少包括与所述区块链数据相对应的统一资源定位地址。
  13. 根据权利要求11所述的设备,其中,所述步骤B中根据区块链数据创建索引进一步包括:
    将所述区块链数据转换成网页;
    通过对所述网页进行分词处理来获得一个或多个关键词;以及
    将所述一个或多个关键词中的每一个关键词、所述区块链数据的内容摘要以及与所述区块链数据相对应的统一资源定位地址生成相应的索引。
  14. 根据权利要求13所述的设备,其中,所述步骤C中基于搜索到的索引中的统一资源定位地址生成搜索结果网页进一步包括:
    将搜索到的每一条索引中的统一资源定位地址以及相应的区块链数据的内容摘要生成相应的搜索结果;以及
    将与所述搜索请求相关联的所有搜索结果生成所述搜索结果网页。
  15. 根据权利要求13所述的设备,其中,所述区块链数据还包括第一属性,所述数据库进一步用于:
    在所述区块链数据的第一属性表明所述区块链数据是公开数据的情况下,在所述数据库中的公开区域中存储与所述区块链数据相关联的索引;
    在所述区块链数据的第一属性表明所述区块链数据是隐私数据的情况下,在所述数据库中的隐私区域中存储与所述区块链数据相关联的索引。
  16. 根据权利要求15所述的设备,其中,所述步骤B中在所述数据库中搜索与所述搜索请求相匹配的索引进一步包括:
    B1.基于所述索引中的关键词与所述搜索请求之间的匹配关系,在所述公开区域中搜索与所述搜索请求相匹配的索引;以及
    B2.基于所述索引中的关键词与所述搜索请求之间的匹配关系,在所 述隐私区域中搜索与所述搜索请求相匹配的索引。
  17. 根据权利要求16所述的设备,其中,所述步骤B2中基于所述索引中的关键词与所述搜索请求之间的匹配关系,在所述隐私区域中搜索与所述搜索请求相匹配的索引进一步包括:
    B21.确定所述搜索请求中是否包括发起所述搜索请求的用户的认证凭证;
    B22.在确定所述搜索请求中包括所述用户的认证凭证的情况下,在所述隐私区域中搜索与所述用户的认证凭证相匹配的一条或多条索引;以及
    B23.基于所述索引中的关键词与所述搜索请求之间的匹配关系,在与所述用户的认证凭证相匹配的一条或多条索引中搜索与所述搜索请求相匹配的索引。
  18. 根据权利要求17所述的设备,其中,所述区块链数据还包括第二属性,所述步骤B22中在确定所述搜索请求中包括所述用户的认证凭证的情况下,在所述隐私区域中搜索与所述用户的认证凭证相匹配的一条或多条索引进一步包括:
    将所述用户的认证凭证与所述隐私区域中的每一条所述索引中关键词的第二属性进行匹配;以及
    在所述用户的认证凭证与一条或多条索引中关键词的第二属性匹配的情况下,搜索到与所述用户的认证凭证相匹配的一条或多条索引。
  19. 根据权利要求17所述的设备,其中,当所述指令执行时使得所述处理器在所述步骤A之后、所述步骤B之前还执行以下操作:
    X.基于所述索引中的关键词与所述搜索请求之间的匹配关系,在缓存中搜索与所述搜索请求相匹配的索引。
  20. 根据权利要求19所述的设备,其中,所述缓存用于存储搜索过的索引。
  21. 一种计算机可读存储介质,其具有存储在其上的计算机可读程序指令,所述计算机可读程序指令用于执行根据权利要求1至10中任一项所述的用于搜索区块链数据的方法。
PCT/CN2019/098190 2018-08-03 2019-07-29 用于搜索区块链数据的方法、设备及可读存储介质 WO2020024904A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810878377.5A CN109086413A (zh) 2018-08-03 2018-08-03 用于搜索区块链数据的方法、设备及可读存储介质
CN201810878377.5 2018-08-03

Publications (1)

Publication Number Publication Date
WO2020024904A1 true WO2020024904A1 (zh) 2020-02-06

Family

ID=64833533

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/098190 WO2020024904A1 (zh) 2018-08-03 2019-07-29 用于搜索区块链数据的方法、设备及可读存储介质

Country Status (2)

Country Link
CN (1) CN109086413A (zh)
WO (1) WO2020024904A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11269863B2 (en) * 2020-01-23 2022-03-08 International Business Machines Corporation Index structure for blockchain ledger

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086413A (zh) * 2018-08-03 2018-12-25 上海点融信息科技有限责任公司 用于搜索区块链数据的方法、设备及可读存储介质
CN109981657B (zh) * 2019-03-29 2021-09-17 浙江数值跳跃网络科技有限公司 一种基于区块链系统的爬虫技术
CN110008756A (zh) * 2019-04-04 2019-07-12 浙江数值跳跃网络科技有限公司 一种区块链系统与智能硬件设备相结合的数据校验方法
CN110442622A (zh) * 2019-08-07 2019-11-12 北京艾摩瑞策科技有限公司 涉及区块链的搜索数据处理方法及其装置
CN111310137B (zh) * 2020-03-23 2022-08-26 杭州溪塔科技有限公司 一种区块链关联数据存证方法、装置及电子设备
CN111597190A (zh) * 2020-05-15 2020-08-28 中国人民大学 一种区块链数据存储和检索方法、装置、设备及存储介质
CN113806357A (zh) * 2020-06-15 2021-12-17 支付宝(杭州)信息技术有限公司 一种基于中心化块链式账本的交易存储、查询方法
CN112015964B (zh) * 2020-08-22 2021-06-04 上海大象金泰科技有限公司 基于区块链和数字金融的业务数据处理方法及系统
CN112163207B (zh) * 2020-10-30 2023-11-21 深圳平安智汇企业信息管理有限公司 基于动态权限的业务数据查询方法及相关设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106227833A (zh) * 2016-07-26 2016-12-14 宁圣金融信息服务(上海)有限公司 区块链搜索引擎方法、系统和装置
CN106445993A (zh) * 2016-07-11 2017-02-22 天津米游科技有限公司 一种基于区块链的数据指纹查询方法及装置
US20180129955A1 (en) * 2016-11-09 2018-05-10 Cognitive Scale, Inc. Hybrid Blockchain Data Architecture for use Within a Cognitive Environment
CN109086413A (zh) * 2018-08-03 2018-12-25 上海点融信息科技有限责任公司 用于搜索区块链数据的方法、设备及可读存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10691763B2 (en) * 2016-11-11 2020-06-23 International Business Machines Corporation Trustable web searching verification in a blockchain
CN106682530A (zh) * 2017-01-10 2017-05-17 杭州电子科技大学 一种基于区块链技术的医疗信息共享隐私保护方法及装置
CN107426170B (zh) * 2017-05-24 2019-08-09 阿里巴巴集团控股有限公司 一种基于区块链的数据处理方法及设备
CN107943951B (zh) * 2017-11-24 2020-08-11 中钞信用卡产业发展有限公司杭州区块链技术研究院 一种区块链业务信息的检索方法及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106445993A (zh) * 2016-07-11 2017-02-22 天津米游科技有限公司 一种基于区块链的数据指纹查询方法及装置
CN106227833A (zh) * 2016-07-26 2016-12-14 宁圣金融信息服务(上海)有限公司 区块链搜索引擎方法、系统和装置
US20180129955A1 (en) * 2016-11-09 2018-05-10 Cognitive Scale, Inc. Hybrid Blockchain Data Architecture for use Within a Cognitive Environment
CN109086413A (zh) * 2018-08-03 2018-12-25 上海点融信息科技有限责任公司 用于搜索区块链数据的方法、设备及可读存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11269863B2 (en) * 2020-01-23 2022-03-08 International Business Machines Corporation Index structure for blockchain ledger

Also Published As

Publication number Publication date
CN109086413A (zh) 2018-12-25

Similar Documents

Publication Publication Date Title
WO2020024904A1 (zh) 用于搜索区块链数据的方法、设备及可读存储介质
WO2020024908A1 (zh) 用于在区块链即服务平台搜索数据的方法、设备及存储介质
US20210385087A1 (en) Zero-knowledge identity verification in a distributed computing system
Wang et al. Searchable encryption over feature-rich data
WO2020207233A1 (zh) 一种区块链的权限控制方法及装置
Grolinger et al. Data management in cloud environments: NoSQL and NewSQL data stores
US9646166B2 (en) Masking query data access pattern in encrypted data
US10108645B1 (en) Database monitoring for online migration optimization
CN101441688B (zh) 一种用户权限分配方法和一种用户权限控制方法
US9852306B2 (en) Conjunctive search in encrypted data
US7299171B2 (en) Method and system for processing grammar-based legality expressions
Gao et al. Neighborhood-privacy protected shortest distance computing in cloud
WO2020024895A1 (zh) 用于搜索区块链数据的方法、装置及存储介质
WO2020024896A1 (zh) 用于搜索区块链数据的方法、装置及存储介质
TW202025020A (zh) 基於區塊鏈的內容管理系統及方法、裝置、電子設備
WO2020024898A1 (zh) 用于搜索区块链数据的方法、装置及存储介质
Zheng Database as a service-current issues and its future
Singh et al. Privacy-preserving multi-keyword hybrid search over encrypted data in cloud
Zou et al. Verifiable keyword-based semantic similarity search on social data outsourcing
Le et al. Distributed secure search in the personal cloud
WO2023103928A1 (zh) 基于esop系统的数据查询方法、装置、介质及设备
WO2021051569A1 (zh) 一种数据隔离方法、装置、计算机设备及存储介质
US20230171083A1 (en) Using automatic homomorphic encryption in a multi-cloud environment to support translytical data computation using an elastic hybrid memory cube
CN115203138A (zh) 数据检索方法、装置及存储介质
US20170220656A1 (en) Information Access System

Legal Events

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

Ref document number: 19845480

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19845480

Country of ref document: EP

Kind code of ref document: A1