WO2020024903A1 - Method and device for searching for blockchain data, and computer readable storage medium - Google Patents

Method and device for searching for blockchain data, and computer readable storage medium Download PDF

Info

Publication number
WO2020024903A1
WO2020024903A1 PCT/CN2019/098186 CN2019098186W WO2020024903A1 WO 2020024903 A1 WO2020024903 A1 WO 2020024903A1 CN 2019098186 W CN2019098186 W CN 2019098186W WO 2020024903 A1 WO2020024903 A1 WO 2020024903A1
Authority
WO
WIPO (PCT)
Prior art keywords
blockchain data
resource location
location address
uniform resource
data
Prior art date
Application number
PCT/CN2019/098186
Other languages
French (fr)
Chinese (zh)
Inventor
肖诗源
Original Assignee
上海点融信息科技有限责任公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海点融信息科技有限责任公司 filed Critical 上海点融信息科技有限责任公司
Publication of WO2020024903A1 publication Critical patent/WO2020024903A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Definitions

  • the present invention relates to a blockchain search technology, and more particularly, to a method for searching for blockchain data, a device for searching for blockchain data, and a corresponding computer-readable storage medium.
  • a search engine refers to a system that automatically collects information from the World Wide Web and provides it to users for query after a certain sorting. In the process of collecting information by search engines, it uses what is called a spider to connect to hyperlinks on each web page.
  • the web crawler program based on the hyperlinks to the webpage links, is like "one pass ten, ten pass 100 " in daily life, starting from a few web pages and connecting to all other web pages on the web. In theory, a web crawler can traverse most web pages if there are appropriate hyperlinks on the web pages.
  • 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.It is considered to have a wide range of applications in many fields such as finance, credit reporting, the Internet of Things, economic and trade settlement, and asset management. prospect.
  • Embodiments of the present invention provide a method, a device, and a computer-readable storage medium for searching for blockchain data, which can collect information from the retrieved index, thereby improving the search efficiency for the blockchain data.
  • a first aspect of the present invention proposes a method for searching blockchain data, the method comprising:
  • An index associated with the first uniform resource location address exists in the cache, and if the first time information is earlier than the second time information in the index, via the The hypertext transfer protocol interface returns a webpage associated with the first uniform resource location address.
  • a second aspect of the present invention proposes 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:
  • An index associated with the first uniform resource location address exists in the cache, and if the first time information is earlier than the second time information in the index, via the The hypertext transfer protocol interface returns a webpage associated with the first uniform resource location address.
  • 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 first aspect according to the present invention The method for searching blockchain data.
  • the method, device and corresponding computer-readable storage medium for searching for blockchain data can determine whether the same search has been performed based on the retrieved index stored in the cache, and it is determined that the same search has been performed.
  • the same index is returned in the case of the same retrieval, thereby improving the search efficiency of the blockchain data.
  • FIG. 1 is a schematic diagram of a network structure of a blockchain according to the present invention.
  • 2A is a flowchart of a method for searching blockchain data according to the present disclosure
  • FIG. 2B is a schematic diagram of a first embodiment of an index stored in a cache according to the present invention.
  • FIG. 3 is a flowchart of a first embodiment of a method for searching blockchain data according to the present disclosure
  • 4A is a flowchart of a second embodiment of a method for searching blockchain data according to the present disclosure
  • 4B is a schematic diagram of a second embodiment of an index stored in a cache 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 second embodiment of a device 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.
  • search node in the context of the present invention refers to a type of blockchain node that is independent of other nodes in the blockchain.
  • a hypertext transfer protocol interface is provided on the search node to process web pages sent by search engines or user equipment.
  • the read request has a cache to store the index, and the search node can only synchronize the public data on the blockchain.
  • read in the term “webpage read request” includes crawling a webpage by a search engine and obtaining a webpage by a user through a user device, where obtaining a webpage by the user device specifically refers to the user's Device to query or browse web pages generated by blockchain data.
  • user equipment in the context of the present invention refers to smart terminals including, but not limited to, smart phones, tablet computers, desktops, and notebook computers.
  • uniform resource location address in the present invention refers to the address of a standard resource on the Internet, also known as a Uniform Resource Locator (URL) or a web page address.
  • first uniform resource location address in the content of the present invention refers to the uniform resource location address at the current level when the method for searching for blockchain data according to the present invention is executed, that is, the URL at the current level;
  • second uniform resource location address in the content of the present invention refers to a uniform resource location address at a lower level when the method for searching for blockchain data according to the present invention is executed, that is, a secondary URL.
  • first blockchain data in the summary of the present invention refers to the blockchain data at the first uniform resource location address in the blockchain; correspondingly, the term “second block” in the present disclosure "Chain data” refers to the blockchain data at the second uniform resource location address in the blockchain.
  • public data in the context of the present invention refers to data that can be accessed without authentication
  • privacy data refers to data that requires authentication to be accessible.
  • first time information in the context of the present invention refers to the modification time of the last time a user device or search engine visited a webpage related to a uniform resource location address; the term “second time information” refers to a block at the uniform resource location address The time when the chain data was updated.
  • 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.
  • the expression "the second blockchain data at the at least one second uniform resource location address is associated with the first blockchain data” means that the first blockchain data includes The hierarchical attribute and the predetermined hierarchical relationship tree indicate whether there is an association relationship of the second blockchain data at the second uniform resource location address.
  • Hierarchical relationship tree in the present invention refers to a predetermined logical relationship tree indicating a hierarchical structure of a webpage generated by the accessed blockchain data.
  • hierarchical attribute in the content of the present invention refers to information indicating to which layer of the above hierarchical relationship tree the uniform resource location address associated with the read webpage belongs.
  • first attribute in the context of the present invention is used to mark blockchain data as private or public.
  • public ledger in the present context refers to a blockchain ledger in which only public data that can be accessed without authentication is stored.
  • privacy ledger in the context of the present invention refers to a blockchain ledger in which only private data that requires access to authentication is stored.
  • public area of the ledger in the present context refers to an area in the ledger for storing public data.
  • privacy area of the ledger in the context of the present invention refers to the area in the ledger for storing private data.
  • the embodiments of the present invention mainly focus on the following technical issues: first, the current blockchain nodes cannot process the hypertext transfer protocol requests sent by search engines; second, the current web search engines use web crawlers to crawl web pages. Iterate over the information in the network, but the current search engine cannot traverse the blockchain data in the blockchain network; again, when retrieving the data in the existing blockchain, due to the amount of data in the blockchain It is easy to cause the burden of the blockchain nodes responsible for retrieval, the retrieval speed is slow, the retrieval efficiency is low, and it may interfere with the normal operation of the blockchain. In addition, there may be risks of obtaining protected data (that is, private data). In addition, the current search engine should search for public data, and the blockchain network may store both public data and private data. During the search process, these two types of data should be distinguished.
  • an embodiment of the present invention first provides a hypertext transfer protocol interface.
  • the hypertext transfer protocol interface is, for example, located in a search node of a blockchain, so that the search node Ability to process Hypertext Transfer Protocol requests sent by search engines or user devices.
  • a cache is set in the search node, so that the cache can store indexes retrieved by the search engine or user equipment within a predetermined period of time.
  • the embodiment of the present invention adds the uniform resource location address of other webpages as information to the webpage, so that the search engine can link to other webpages through the webpage, and implements the webpage crawling function for the blockchain network.
  • the embodiments of the present invention also distinguish between public data and private data in the blockchain network. For more specific implementation methods and other advantages of the present invention, please refer to the description below.
  • FIG. 1 shows a schematic diagram of a blockchain network structure 100 according to the present invention.
  • the blockchain network structure 100 includes blockchain nodes 111, 112, 113, 114, 115, 116, and search.
  • Blockchain nodes 111-116 and search nodes 117 can synchronize data through a network, which can be any wired and / or wireless network.
  • the search node 117 can only synchronize public data, and cannot synchronize private data. It should be noted that, in the content of the present invention, existing or future developed synchronization technologies can be used to implement data synchronization.
  • the cache set in the search node 117 can store one or more indexes retrieved within a set period of time, each index including the retrieved uniform resource location address, a webpage associated with the uniform resource location address, and Second time information.
  • FIG. 2B shows an exemplary index stored in the cache, which includes URL1 and its corresponding webpage html_1, second time information STAMP1, URLn and its corresponding webpage html_n, second time information STAMPn.
  • the set time period ends, all indexes in the cache will be deleted to achieve real-time updating of the indexes in the cache.
  • FIG. 2A shows a flowchart of a method 200 for searching for blockchain data.
  • the search node 117 in the blockchain network 100 shown in FIG. 1 may implement the method 200 shown in FIG. 2A. details as follows:
  • Step 210 Receive a webpage read request via a hypertext transfer protocol interface, where the webpage read request includes a first uniform resource location address and first time information.
  • the search engine can add the following functions, that is, the search engine can access the entry address of the blockchain (for example: http: //test.com.homepage), so that the search engine can access the block chain.
  • the user can use a browser to access the entrance address of the blockchain (for example: http: //test.com.homepage), so that the user can access the blockchain.
  • Step 220 Determine whether an index associated with the first uniform resource location address exists in the cache.
  • this step it is determined whether an index associated with the first uniform resource location address exists in the cache according to the first uniform resource location address in the webpage read request, and the cache is stored and retrieved within a predetermined period of time.
  • Step 230 An index associated with the first uniform resource location address exists in the cache, and if the first time information is earlier than the second time information in the index, The hypertext transfer protocol interface returns a webpage associated with the first uniform resource location address; the specific implementation is as follows:
  • the specific modification time ie, first time information
  • the modification time of the corresponding webpage stored in the cache ie, the second time representing the update time of the blockchain data
  • the webpage associated with the first uniform resource location address in the index will be returned to the search engine or the user via the Hypertext Transfer Protocol interface. This ensures that search engines or users get the latest search results.
  • the blockchain data pointed to by the first uniform resource location address can be generated in a webpage.
  • the second uniform resource location address if there is at least one second uniform resource location address, that is, the second uniform resource location address, the second uniform resource location address It can also be presented on the webpage, so the webpage can include both the data of the blockchain and the uniform resource location address. In the case where there are multiple uniform resource location addresses, these uniform resource location addresses can be sequentially arranged on the webpage. It can also be implemented by generating a logical search tree diagram associated with the data in the blockchain data according to its logical relationship.
  • the webpage is returned to the user device or search engine.
  • the user equipment or search engine can either directly extract the blockchain data and its access address, or initiate a further webpage read request to the blockchain network side to capture the subsequent Blockchain data.
  • the interface returns an identifier indicating that the web page has not been modified. Specifically, if it is determined that an index associated with the first uniform resource location address exists in the cache and the first time information is equal to the second time information in the corresponding index, it indicates that the webpage that the user or search engine has searched for has not changed, that is, There is no need to provide search results to the user or search engine, so an identifier indicating that the web page has not been modified is returned via a hypertext transfer protocol interface. In a specific implementation, the HTTP status code '304' may be returned to indicate the above situation.
  • the method 200 further includes the following steps:
  • first blockchain data at the first uniform resource location address is obtained.
  • the at least one second uniform resource location address exists, generating the association with the first uniform resource location address according to the first blockchain data and the at least one second uniform resource location address Or a webpage associated with the first uniform resource location address according to the first blockchain data when the at least one second uniform resource location address does not exist.
  • a webpage associated with the first uniform resource location address is returned via the hypertext transfer protocol interface.
  • the first uniform resource location address, the webpage associated with the first uniform resource location address, and the second time information are stored in the cache as a new index.
  • obtaining the first blockchain data at the first unified resource location address specifically includes: determining whether to obtain the first unified data according to the ledger storage location of the first blockchain data.
  • the first blockchain data at the resource location address specifically, if the first blockchain data or the second blockchain data is public data, the first blockchain data or Said second blockchain data is stored in a public ledger; and in a case where said first blockchain data or said second blockchain data is private data, said first blockchain data or said The second blockchain data is stored in the privacy ledger; in the case where the first blockchain data is stored in the public ledger, the first blockchain data at the first uniform resource location address is obtained .
  • acquiring the first blockchain data at the first uniform resource location address may further include: determining whether to acquire the first blockchain data according to a location of the storage area of the first blockchain data.
  • the first blockchain data at the uniform resource location address specifically, in a case where the first blockchain data or the second blockchain data is public data, the first blockchain data or The second blockchain data is stored in a public area of the ledger; and in a case where the first blockchain data or the second blockchain data is private data, the first blockchain data Or the second blockchain data is stored in the privacy area of the ledger; in the case where the first blockchain data is stored in the public area of the ledger, it is obtained at the first uniform resource location address Of the first blockchain data.
  • determining whether there is at least one second uniform resource location address further includes: determining whether the at least one first resource exists according to a hierarchical attribute included in the first blockchain data and a predetermined hierarchical relationship tree. Second, the uniform resource location address.
  • the hierarchical attributes included in the blockchain data can also play a very important role. It includes a hierarchical attribute and a predetermined hierarchical relationship tree to determine whether there is at least one second uniform resource location address.
  • the hierarchical attribute of the blockchain data A is "insurance”
  • the predetermined hierarchical relationship tree indicates that there exists the blockchain data B whose hierarchical attribute is "insurance / blockchain insurance”
  • the blockchain data B It is the next level of blockchain data of blockchain data A.
  • the uniform resource location address pointing to the blockchain data B whose hierarchical attribute is "insurance / blockchain insurance” is also generated in On the webpage, the generated webpage contains a uniform resource location address pointing to the blockchain data B whose hierarchical attribute is "insurance / blockchain insurance”.
  • the provided method for searching for blockchain data further includes a first embodiment 300 as shown in FIG. 3 to facilitate updating the index in the cache, and specifically includes the following steps:
  • Step 310 Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index.
  • Step 320 Compare the blockchain data with data corresponding to a webpage stored in the index to determine whether the blockchain data at the uniform resource location address is updated.
  • Step 330 In the case that the blockchain data at the uniform resource location address is updated, update the webpage associated with the uniform resource location address in the index to be generated based on the updated blockchain data And update the second time information to the update time of the blockchain data.
  • the present invention can use this embodiment to update the corresponding index in the cache.
  • the present invention may also use the following embodiments to implement real-time updating of indexes in the cache:
  • the blockchain data at the corresponding uniform resource location address in the blockchain is determined based on the uniform resource location address stored in each index.
  • the modification time information of the blockchain data is compared with the second time information in the index to determine whether the blockchain data at the uniform resource location address is updated.
  • the modification time information of the blockchain data is not later than the second time information in the index, it indicates that the blockchain data at the uniform resource location address has not been updated.
  • the modification time of the blockchain data is When the information is later than the second time information in the index, it indicates that the blockchain data at the uniform resource location address has been updated.
  • the webpage associated with the uniform resource location address is updated in the index to be based on the update A webpage generated by the blockchain data and updates the second time information to the update time of the blockchain data.
  • the present invention can also use the above embodiments to update the corresponding indexes in the cache in real time.
  • the present invention provides The method for searching for blockchain data to also use the second embodiment 400 shown in FIG. 4A to achieve the above purpose.
  • the webpage read request further includes a first indicator indicating that it is allowed to return the difference webpages
  • each index in the cache further includes one or more difference webpages and corresponding data to each difference webpage. Corresponding time period information.
  • Step 410 Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index.
  • Step 420 Compare the blockchain data with data corresponding to a webpage stored in the index to determine whether the blockchain data at the uniform resource location address is updated.
  • the blockchain data is compared with the data corresponding to the webpage stored in the index to determine whether there is a data difference.
  • a data difference it is determined that the blockchain at the uniform resource location address has been updated. data.
  • Step 430 When the blockchain data at the uniform resource location address in the index is updated, use the data between the updated blockchain data and the data corresponding to the webpage stored in the index. The difference generates a corresponding difference webpage, and uses the second time information and the update time of the blockchain data as the time period information corresponding to the difference webpage.
  • Step 440 Update the webpage associated with the uniform resource location address to a webpage generated according to the updated blockchain data, and update the second time information to the update time of the blockchain data.
  • the updated index includes a uniform resource location address, a webpage associated with the uniform resource location address, second time information, one or more difference webpages associated with the uniform resource location address, and each difference Information about the time period corresponding to the web page.
  • the method for searching for blockchain data further includes:
  • the first indicator when the first indicator is present, it indicates that the search engine or the browser used by the user that issued the read request of the webpage is allowed to return the difference webpage.
  • the first indicator exists in the received webpage reading request, based on the time difference between the first time information and the second time information, it is determined that there is a time difference between the cache and the time.
  • the corresponding one or more difference webpages are returned, one or more of the difference webpages corresponding to the time difference are returned via the hypertext transfer protocol interface.
  • the search engine when the search engine sends a webpage read request including the first uniform resource location address URLx, the first time information (for example, 18:30), and the first indicator to the search node 117, the search node 117 looks for the existence in the cache
  • the index associated with URLx An example of the index associated with URLx in the cache is shown in FIG. 4B, and specifically includes URLx and its corresponding web page html_x, second time information (for example, 19:00), and obtained according to URLx within a predetermined time period.
  • Multiple different difference pages for example, ⁇ html_1, ⁇ html_2, ⁇ html_3
  • the time period information corresponding to these difference pages for example, 18: 45-19: 00, 18: 30-18: 45, 18: 10-18: 30).
  • the search node 117 is based on the time difference (18: 30-19: 00) between the first time information (e.g., 18:30) and the second time information (e.g., 19:00), and selects from a plurality of times in the index In the time period information (for example, 18: 10-18: 30, 18: 30-18: 45, 18: 45-19: 00), it is determined that there are two difference webpages in the cache (that is, respectively corresponding to 18:45 -1html, ⁇ html_1, ⁇ html_2 of 19:00, 18: 30-18: 45), the search node 117 returns the two difference web pages via the hypertext transfer protocol interface.
  • the search engine when the search engine sends a webpage read request including the first uniform resource location address URLx, the first time information (for example, 08:20), and the first indicator to the search node 117, the search node 117 looks for whether in the cache There is an index associated with URLx.
  • the second time information (for example, 19:00) corresponding to URLx is viewed, and URLx is also found Corresponding multiple time period information (for example, 18: 10-18: 30, 18: 30-18: 45, 18: 45-19: 00), but given the first time information (for example, 08:20) and The time difference between the second time information (e.g., 19:00) far exceeds the predetermined time period (e.g., two hours), then the search node 117 will change the webpage (e.g., html_x) associated with URLx from The cache is returned to the search engine via the Hypertext Transfer Protocol interface.
  • the webpage e.g., html_x
  • the present invention proposes to configure the blockchain data to specify the analysis method of the blockchain data.
  • Attributes For example, the attribute includes a data format name for a data analysis method representing the blockchain data.
  • Robots protocol is also known as the crawler protocol, robot protocol, etc., and its full name is "Robots Exclusion Protocol".
  • the website tells search engines which pages can be crawled and which pages cannot be crawled through the Robots protocol.
  • the link addresses that the search engine is allowed to traverse are also notified through the Robots protocol.
  • the present invention utilizes the properties of the blockchain data itself (for example, the disclosed blockchain data includes public data and privacy data) to control the search behavior of the search engine, where the public data and privacy data are stored
  • the public data and the private data have different marks at different locations on the blockchain.
  • Fabric, Corda and other alliance chains control access to all data in all blockchain data. It can be seen that the blockchain platform has the same access control for data with different requirements without having different access control capabilities. Generally speaking, the enterprise-level blockchain usually uses the alliance chain platform to control access to all data, which makes it impossible for external search engines to retrieve the information that needs to be disclosed.
  • the present invention can distinguish multiple ledgers, such as marking the first ledger as a public ledger, that is, only the above-mentioned public data is stored on it, and other ledgers are marked as private ledgers, on which only privacy data.
  • ledgers such as marking the first ledger as a public ledger, that is, only the above-mentioned public data is stored on it, and other ledgers are marked as private ledgers, on which only privacy data.
  • the number of public ledgers and privacy ledgers can be dynamically configured according to the ratio of data to be disclosed and privacy data on the blockchain. In this way, the data on the blockchain network can be treated differently, thereby providing guarantee for subsequent search services for data on the blockchain.
  • the first blockchain data at the first uniform resource location address is obtained.
  • the first blockchain data at the first uniform resource location address is stored in the privacy ledger, the first blockchain data cannot be obtained.
  • first ledger into two different areas, for example, to store public data in the first area, and to store private data in the second area.
  • the data on the blockchain is treated differently, thereby providing guarantee for subsequent search services for data on the blockchain.
  • the first blockchain data is stored in the public area of the ledger
  • the first blockchain data at the first uniform resource location address is obtained; the first blockchain data is stored in the private area of the ledger In this case, the first blockchain data cannot be obtained.
  • the blockchain data is stored in a key / value manner, where the blockchain data also includes a first attribute.
  • the first attribute indicates that the blockchain data is public data
  • the blockchain data can be retrieved; when the first attribute indicates that the blockchain data is private data, the blockchain data cannot be retrieved.
  • the inventor of the present invention innovatively realizes that the The attributes of the data are adapted to the search engine, so as to achieve the purpose of searching the data on the blockchain network based on the search engine.
  • it can also satisfy the privacy protection of the blockchain for some data that needs privacy protection.
  • the above method for searching for blockchain data can, on the one hand, enable retrieval of only public data on the blockchain and avoid the acquisition of private data on the blockchain; on the other hand, it can use the index in the cache to determine whether it has been performed Passing the same search facilitates fast response to web page read requests, and reduces the pressure on search nodes to process web page read requests, thereby improving the search efficiency of open data on the blockchain.
  • the solution provided by the present invention can also reduce the burden and interference on the blockchain during the search process, to avoid direct access by search engines to other nodes in the blockchain, and thus reduce the search engine's access to blocks.
  • the risk of private data on the chain enhances the security of the blockchain and the traditional Internet interconnection process.
  • the solution provided by the present invention can realize the interconnection and interconnection of the blockchain and Internet information, and further exert the great value of the blockchain.
  • 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 (for example, light pulses through fiber optic cables), or via electrical wires Electrical signal transmitted.
  • FIG. 5 shows a block diagram of a device 500 for searching for blockchain data according to a first embodiment of the present disclosure.
  • the device 500 for searching for blockchain data includes a processor 501 and a memory 502 coupled to the processor 501.
  • the memory 502 stores instructions. When executed by the processor 501, the instructions cause the processor 501 to perform the following actions:
  • An index associated with the first uniform resource location address exists in the cache, and if the first time information is earlier than the second time information in the index, via the The hypertext transfer protocol interface returns a webpage associated with the first uniform resource location address.
  • the processor 501 when the instruction is executed, the processor 501 further performs the following operations:
  • the protocol interface returns an identifier indicating that the web page has not been modified.
  • the processor 501 when the instruction is executed, the processor 501 further performs the following operations:
  • D12 comparing the blockchain data with data corresponding to a webpage stored in the index to determine whether the blockchain data at the uniform resource location address is updated;
  • the webpage associated with the uniform resource location address is updated in the index to be generated based on the updated blockchain data A webpage, and updates the second time information to the update time of the blockchain data.
  • the processor 501 when the instruction is executed, the processor 501 further performs the following operations:
  • the webpage associated with the uniform resource location address is updated in the index to be based on the updated A webpage generated by the blockchain data, and updating the second time information to an update time of the blockchain data.
  • the webpage reading request further includes a first indicator indicating that a difference webpage is allowed to be returned
  • each index in the cache further includes one or more difference webpages and a data file corresponding to each
  • the time period information corresponding to a difference webpage when the instruction is executed, also causes the processor 501 to perform the following operations:
  • an index associated with the first uniform resource location address exists in the cache, and the first time information is earlier than the second time information in the index.
  • the instruction further causes the processor 501 to perform the following operations:
  • the first indicator exists in the received webpage read request, based on the time difference between the first time information and the second time information, it is determined that the time difference exists in the cache
  • the corresponding one or more difference webpages are returned, one or more of the difference webpages corresponding to the time difference are returned via the hypertext transfer protocol interface.
  • the processor 501 when the instruction is executed, the processor 501 further performs the following operations:
  • a webpage associated with the first uniform resource location address is returned via the hypertext transfer protocol interface.
  • the instruction causes the processing when executed.
  • the router 501 also performs the following operations:
  • the first uniform resource location address, a webpage associated with the first uniform resource location address, and the second time information are stored in the cache as an index.
  • the processor 501 when the instruction is executed, the processor 501 further performs the following operations:
  • a webpage associated with the first uniform resource location address is generated according to the first blockchain data.
  • determining whether there is at least one second uniform resource location address in step C32 further includes:
  • obtaining the first blockchain data at the first uniform resource location address in step C31 further includes:
  • first blockchain data or the second blockchain data is stored in a public ledger; And in a case where the first blockchain data or the second blockchain data is private data, the first blockchain data or the second blockchain data is stored in a privacy ledger;
  • the first blockchain data at the first uniform resource location address is acquired.
  • obtaining the first blockchain data at the first uniform resource location address in step C31 further includes:
  • the first blockchain data or the second blockchain data is stored in a public area of a ledger Medium; and in the case where the first blockchain data or the second blockchain data is privacy data, the first blockchain data or the second blockchain data is stored in the privacy of the ledger Area
  • the first blockchain data at the first uniform resource location address is acquired.
  • the first blockchain data and / or the second blockchain data includes a first attribute, and wherein, in step C31, the first unified The first blockchain data at the resource location address further includes:
  • the first blockchain data at the first uniform resource location address is obtained.
  • the method, device and corresponding computer-readable storage medium provided by the present invention for searching for blockchain data can, on the one hand, search the cache for previously searched data to improve the performance of the blockchain data.
  • Search efficiency on the other hand, can make precise control of the data on the blockchain, achieve only access to publicly available data, and limit an internal mechanism and interface for access and retrieval, which not only allows external web links to directly link to the zone
  • the public data in the blockchain can also link the public data in the blockchain.
  • the solution provided by the present invention can realize the rapid interconnection and interconnection of the blockchain and Internet information, and further exert the great value of the blockchain.
  • FIG. 6 shows a schematic block diagram of a device 600 for searching blockchain data.
  • the device 600 may be implemented to implement the functions of the method 200 for searching for blockchain data in FIG. 2A.
  • 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.
  • I / O interface 605 Multiple components in the device 600 are connected to 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.
  • a computer program is loaded into RAM 603 and executed by CPU 601, one or more actions or steps in 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Disclosed in the present invention is a method for searching for blockchain data. The method comprises: A. receiving a web page reading request by means of a hypertext transfer protocol interface, the web page reading request comprising a first uniform resource location address and first time information; B. determining whether an index associated with the first uniform resource location address exists in a cache, wherein the cache stores one or more indexes retrieved in a predetermined period of time, and each index comprises a retrieved uniform resource location address, a web page associated with the uniform resource location address, and second time information; and C1. in a case where an index associated with the first uniform resource location address exists in the cache and the first time information is earlier than the second time information in the index, returning the web page associated with the first uniform resource location address by means of the hypertext transfer protocol interface.

Description

用于搜索区块链数据的方法、设备及计算机可读存储介质Method, device and computer-readable storage medium for searching blockchain data 技术领域Technical field
本发明内容涉及区块链搜索技术,更为具体地涉及一种用于搜索区块链数据的方法、一种用于搜索区块链数据的设备以及一种相应的计算机可读存储介质。The present invention relates to a blockchain search technology, and more particularly, to a method for searching for blockchain data, a device for searching for blockchain data, and a corresponding computer-readable storage medium.
背景技术Background technique
搜索引擎是指自动从万维网搜集信息,经过一定整理以后,提供给用户进行查询的系统。在搜索引擎搜集信息的过程中,其利用称为网络爬虫程序(Spider)来连上每一个网页上的超链接。网络爬虫程序根据网页链到其中的超链接,就像日常生活中所说的"一传十、十传百……"一样,从少数几个网页开始,连到网络上所有其他的网页链接。理论上,若网页上有适当的超链接,网络爬虫程序便可以遍历绝大部分网页。A search engine refers to a system that automatically collects information from the World Wide Web and provides it to users for query after a certain sorting. In the process of collecting information by search engines, it uses what is called a spider to connect to hyperlinks on each web page. The web crawler program, based on the hyperlinks to the webpage links, is like "one pass ten, ten pass 100 ..." in daily life, starting from a few web pages and connecting to all other web pages on the web. In theory, a web crawler can traverse most web pages if there are appropriate hyperlinks on the web pages.
区块链(Blockchain)是用分布式数据库识别、传播和记载信息的智能化对等网络,也称为价值互联网。区块链具有去中心化、反篡改、数据一致性存储、过程透明可追踪等技术优势,其被认为在金融、征信、物联网、经济贸易结算、资产管理等众多领域都拥有广泛的应用前景。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.It is considered to have a wide range of applications in many fields such as finance, credit reporting, the Internet of Things, economic and trade settlement, and asset management. prospect.
发明内容Summary of the invention
本发明的实施例提供了一种用于搜索区块链数据的方法、设备和计算机可读存储介质,可以从检索过的索引中搜集信息,从而提高了针对区块链数据的搜索效率。Embodiments of the present invention provide a method, a device, and a computer-readable storage medium for searching for blockchain data, which can collect information from the retrieved index, thereby improving the search efficiency for the blockchain data.
为此,本发明内容的第一方面提出了一种用于搜索区块链数据的方法,所述方法包括:To this end, a first aspect of the present invention proposes a method for searching blockchain data, the method comprising:
A.经由超文本传输协议接口接收网页读取请求,所述网页读取请求包括第一统一资源定位地址和第一时间信息;A. receiving a webpage read request via a hypertext transfer protocol interface, where the webpage read request includes a first uniform resource location address and first time information;
B.确定缓存中是否存在与所述第一统一资源定位地址相关联的索引,其中,所述缓存存储在预定时间段内检索过的一个或多个索引,每一个索引包括检索过的统一资源定位地址、与所述统一资源定位地址相关联的网 页以及第二时间信息;B. Determine whether an index associated with the first uniform resource location address exists in the cache, wherein the cache stores one or more indexes retrieved within a predetermined period of time, each index including the retrieved uniform resource A positioning address, a webpage associated with the uniform resource positioning address, and second time information;
C1.在所述缓存中存在与所述第一统一资源定位地址相关联的索引,并且在所述第一时间信息早于所述索引中的所述第二时间信息的情况下,经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页。C1. An index associated with the first uniform resource location address exists in the cache, and if the first time information is earlier than the second time information in the index, via the The hypertext transfer protocol interface returns a webpage associated with the first uniform resource location address.
此外,本发明内容的第二方面提出了一种用于搜索区块链数据的设备,所述设备包括:处理器;以及存储器,其用于存储指令,当所述指令执行时使得所述处理器执行以下操作:In addition, a second aspect of the present invention proposes 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.经由超文本传输协议接口接收网页读取请求,所述网页读取请求包括第一统一资源定位地址和第一时间信息;A. receiving a webpage read request via a hypertext transfer protocol interface, where the webpage read request includes a first uniform resource location address and first time information;
B.确定缓存中是否存在与所述第一统一资源定位地址相关联的索引,其中,所述缓存存储在预定时间段内检索过的一个或多个索引,每一个索引包括检索过的统一资源定位地址、与所述统一资源定位地址相关联的网页以及第二时间信息;B. Determine whether an index associated with the first uniform resource location address exists in the cache, wherein the cache stores one or more indexes retrieved within a predetermined period of time, each index including the retrieved uniform resource A positioning address, a webpage associated with the uniform resource positioning address, and second time information;
C1.在所述缓存中存在与所述第一统一资源定位地址相关联的索引,并且在所述第一时间信息早于所述索引中的所述第二时间信息的情况下,经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页。C1. An index associated with the first uniform resource location address exists in the cache, and if the first time information is earlier than the second time information in the index, via the The hypertext transfer protocol interface returns a webpage associated with the first uniform resource location address.
最后,本发明内容的第三方面提供了一种计算机可读存储介质,其具有存储在其上的计算机可读程序指令,所述计算机可读程序指令用于执行根据本发明内容的第一方面所述的用于搜索区块链数据的方法。Finally, 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 first aspect according to the present invention The method for searching blockchain data.
依据本发明内容的用于搜索区块链数据的方法、设备以及相对应的计算机可读存储介质能够基于在缓存中存储检索过的索引来确定是否曾经进行过相同的检索,在确定曾经进行过相同的检索的情况下返回该索引,进而提高了对区块链数据的搜索效率。The method, device and corresponding computer-readable storage medium for searching for blockchain data according to the present invention can determine whether the same search has been performed based on the retrieved index stored in the cache, and it is determined that the same search has been performed. The same index is returned in the case of the same retrieval, thereby improving the search efficiency of the blockchain data.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
结合附图并参考以下详细说明,本发明的各实施例的特征、优点及其他方面将变得更加明显,在此以示例性而非限制性的方式示出了本发明的 若干实施例,在附图中:The features, advantages, and other aspects of the embodiments of the present invention will become more apparent with reference to the drawings and the following detailed description. Several embodiments of the present invention are shown here by way of example and not limitation. In the drawings:
图1为依据本发明内容的区块链的网络结构的示意图;1 is a schematic diagram of a network structure of a blockchain according to the present invention;
图2A为依据本发明内容的用于搜索区块链数据的方法的流程图;2A is a flowchart of a method for searching blockchain data according to the present disclosure;
图2B为依据本发明内容的缓存中所存储的索引的第一实施例的示意图;2B is a schematic diagram of a first embodiment of an index stored in a cache according to the present invention;
图3为依据本发明内容的用于搜索区块链数据的方法的第一实施例的流程图;3 is a flowchart of a first embodiment of a method for searching blockchain data according to the present disclosure;
图4A为依据本发明内容的用于搜索区块链数据的方法的第二实施例的流程图;4A is a flowchart of a second embodiment of a method for searching blockchain data according to the present disclosure;
图4B为依据本发明内容的缓存中所存储的索引的第二实施例的示意图;4B is a schematic diagram of a second embodiment of an index stored in a cache according to the present disclosure;
图5为依据本发明内容的用于搜索区块链数据的设备的第一实施例的示意图;以及5 is a schematic diagram of a first embodiment of a device for searching blockchain data according to the present disclosure; and
图6为依据本发明内容的用于搜索区块链数据的设备的第二实施例的示意图。FIG. 6 is a schematic diagram of a second embodiment of a device for searching blockchain data according to the present disclosure.
具体实施方式detailed description
以下参考附图详细描述本发明的各个示例性实施例。附图中的流程图和框图示出了根据本发明的各种实施例的方法和系统的可能实现的体系架构、功能和操作。应当注意,流程图或框图中的每一个方框可以代表一个模块、程序段、或代码的一部分,所述模块、程序段、或代码的一部分可以包括一个或多个用于实现各个实施例中所规定的逻辑功能的可执行指令。也应当注意,在有些作为备选的实现中,方框中所标注的功能也可以按照不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,或者它们有时也可以按照相反的顺序执行,这取决于所涉及的功能。同样应当注意的是,流程图和/或框图中的每一个方框、以及流程图和/或框图中的方框的组合,可以使用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以使用专用硬件与计算机指令的组合来实现。Hereinafter, various exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods and systems according to various embodiments of the present invention. It should be noted that 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. It should also be noted that in some alternative implementations, the functions marked in the blocks may also occur in a different order than those marked in the drawings. For example, two blocks represented one after the other may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that 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.
本文所使用的术语"包括"、"包含"及类似术语应该理解为是开放性的术语,即"包括/包含但不限于",表示还可以包括其他内容。术语"基于"是"至少部分地基于"。术语"一个实施例"表示"至少一个实施例";术语"另一实施例"表示"至少一个另外的实施例",等等。The terms "including", "including" and similar terms used herein should be understood as open terms, that is, "including / including but not limited to", meaning that other content may also be included. The term "based on" is "based at least in part on." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment", and so on.
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,所述技术、方法和设备应当作为说明书的一部分。对于附图中的各单元之间的连线,仅仅是为了便于说明,其表示至少连线两端的单元是相互通信的,并非旨在限制未连线的单元之间无法通信。Techniques, methods, and equipment known to those of ordinary skill in the relevant field may not be discussed in detail, but where appropriate, the techniques, methods, and equipment should be part of the description. The 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.
本发明内容中的术语"搜索节点"是指独立于区块链中的其他节点的一种区块链节点,在搜索节点上设置有超文本传输协议接口以处理搜索引擎或者用户设备发送的网页读取请求,并且其上还设置有缓存以存储索引,此外该搜索节点仅能够同步区块链上的公开数据。The term "search node" in the context of the present invention refers to a type of blockchain node that is independent of other nodes in the blockchain. A hypertext transfer protocol interface is provided on the search node to process web pages sent by search engines or user equipment. The read request has a cache to store the index, and the search node can only synchronize the public data on the blockchain.
本发明内容中的术语"网页读取请求"中的"读取"包括由搜索引擎去抓取网页和由用户通过用户设备来获取网页,其中,通过用户设备来获取网页具体是指用户通过用户设备来查询或者浏览展由区块链数据生成的网页。The term "read" in the term "webpage read request" includes crawling a webpage by a search engine and obtaining a webpage by a user through a user device, where obtaining a webpage by the user device specifically refers to the user's Device to query or browse web pages generated by blockchain data.
本发明内容中的术语"用户设备"是指包括但不限于智能手机、平板电脑、台式机、笔记本电脑的智能终端。The term "user equipment" in the context of the present invention refers to smart terminals including, but not limited to, smart phones, tablet computers, desktops, and notebook computers.
本发明内容中的术语"统一资源定位地址"是指因特网上标准的资源的地址,又称统一资源定位符(URL:Uniform Resource Locator)或网页地址。相应地,本发明内容中的术语"第一统一资源定位地址"是指依据本发明所提出的用于搜索区块链数据的方法执行时本级的统一资源定位地址,即本级URL;而本发明内容中的术语"第二统一资源定位地址"是指依据本发明所提出的用于搜索区块链数据的方法执行时下一级的统一资源定位地址,即次级URL。The term “uniform resource location address” in the present invention refers to the address of a standard resource on the Internet, also known as a Uniform Resource Locator (URL) or a web page address. Accordingly, the term "first uniform resource location address" in the content of the present invention refers to the uniform resource location address at the current level when the method for searching for blockchain data according to the present invention is executed, that is, the URL at the current level; and The term “second uniform resource location address” in the content of the present invention refers to a uniform resource location address at a lower level when the method for searching for blockchain data according to the present invention is executed, that is, a secondary URL.
发明内容中的术语"第一区块链数据"是指区块链中在第一统一资源定位地址处的区块链数据;与之相对应地,本发明内容中的术语"第二区块链数据"是指区块链中在第二统一资源定位地址处的区块链数据。The term "first blockchain data" in the summary of the present invention refers to the blockchain data at the first uniform resource location address in the blockchain; correspondingly, the term "second block" in the present disclosure "Chain data" refers to the blockchain data at the second uniform resource location address in the blockchain.
本发明内容中的术语"公开数据"是指不需要身份验证即可访问的数 据,而"隐私数据"是指需要身份验证才可访问的数据。The term "public data" in the context of the present invention refers to data that can be accessed without authentication, and "privacy data" refers to data that requires authentication to be accessible.
本发明内容中的术语"第一时间信息"是指用户设备或搜索引擎上一次访问统一资源定位地址相关的网页的修改时间;术语"第二时间信息"是指该统一资源定位地址处区块链数据更新的时间。The term "first time information" in the context of the present invention refers to the modification time of the last time a user device or search engine visited a webpage related to a uniform resource location address; the term "second time information" refers to a block at the uniform resource location address The time when the chain data was updated.
本发明内容中的术语"第一"、"第二"仅用于描述指代、目的或某具体事物,而不能理解为指示或暗示相对重要性,或者隐含指明所指示的技术特征的数量。The terms "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. .
本发明内容中的术语"多个"是指两个或两个以上。The term "plurality" in this summary means two or more.
本发明内容中出现了术语"检索"和"搜索",其中,术语"检索"是指搜索引擎通过网络爬虫程序对于区块链数据的抓取、处理、建立索引和遍历的过程,而术语"搜索"是指搜索引擎接收用户在搜索引擎页面上输入关键词后对于之前的建立过索引的网页内容的查找。The terms "retrieval" and "search" appear in the content of the present invention, wherein the term "retrieval" refers to the process of crawling, processing, indexing, and traversing of blockchain data by a search engine through a web crawler program, and the term " "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.
本发明内容中的表述"在所述至少一个第二统一资源定位地址处的第二区块链数据与所述第一区块链数据相关联"是指所述第一区块链数据所包括的层次属性和预先确定的层次关系树表明是否存在处于第二统一资源定位地址的第二区块链数据的关联关系。The expression "the second blockchain data at the at least one second uniform resource location address is associated with the first blockchain data" means that the first blockchain data includes The hierarchical attribute and the predetermined hierarchical relationship tree indicate whether there is an association relationship of the second blockchain data at the second uniform resource location address.
本发明内容中的术语"层次关系树"是指预先确定的表明所访问的区块链数据所生成的网页的层次结构的逻辑关系树。The term "hierarchical relationship tree" in the present invention refers to a predetermined logical relationship tree indicating a hierarchical structure of a webpage generated by the accessed blockchain data.
本发明内容中的术语"层次属性"是指表明与所读取的网页相关联的统一资源定位地址属于上述的层次关系树中的哪一层的信息。The term "hierarchical attribute" in the content of the present invention refers to information indicating to which layer of the above hierarchical relationship tree the uniform resource location address associated with the read webpage belongs.
本发明内容中的术语"第一属性"用于标记区块链数据为隐私或者公开。The term "first attribute" in the context of the present invention is used to mark blockchain data as private or public.
本发明内容中的术语"公开账本"是指在其中仅存储不需要身份验证即可访问的公开数据的区块链账本。The term "public ledger" in the present context refers to a blockchain ledger in which only public data that can be accessed without authentication is stored.
本发明内容中的术语"隐私账本"是指在其中仅存储需要身份验证才可访问的隐私数据的区块链账本。The term “privacy ledger” in the context of the present invention refers to a blockchain ledger in which only private data that requires access to authentication is stored.
本发明内容中的术语"账本的公开区域"是指账本中用于存储公开数据的区域。The term "public area of the ledger" in the present context refers to an area in the ledger for storing public data.
本发明内容中的术语"账本的隐私区域"是指账本中用于存储隐私数据 的区域。The term "privacy area of the ledger" in the context of the present invention refers to the area in the ledger for storing private data.
本发明的实施例主要关注以下技术问题:首先,当前的区块链节点无法处理搜索引擎发送的超文本传输协议请求;其次,当前的网络搜索引擎是通过网络爬虫程序来抓取网页的方式来遍历网络中的信息的,但是当前的搜索引擎并不能遍历区块链网络中的区块链数据;再次,对现有的区块链中的数据进行检索时,由于区块链中的数据量大容易导致负责检索的区块链节点负担很重、检索速度慢、检索效率低并且可能干扰区块链的正常运行,此外还可能存在获取受保护的数据(也即,隐私数据)的风险。另外,当前的搜索引擎所搜索的都应该是公开数据,而区块链网络可能会同时存储公开数据和隐私数据,在搜索过程中应当区分这两类数据。The embodiments of the present invention mainly focus on the following technical issues: first, the current blockchain nodes cannot process the hypertext transfer protocol requests sent by search engines; second, the current web search engines use web crawlers to crawl web pages. Iterate over the information in the network, but the current search engine cannot traverse the blockchain data in the blockchain network; again, when retrieving the data in the existing blockchain, due to the amount of data in the blockchain It is easy to cause the burden of the blockchain nodes responsible for retrieval, the retrieval speed is slow, the retrieval efficiency is low, and it may interfere with the normal operation of the blockchain. In addition, there may be risks of obtaining protected data (that is, private data). In addition, the current search engine should search for public data, and the blockchain network may store both public data and private data. During the search process, these two types of data should be distinguished.
为解决这些问题,实现针对区块链网络的搜索服务,本发明的实施例首先提供了一种超文本传输协议接口,该超文本传输协议接口例如位于区块链的搜索节点中,使得搜索节点能够处理由搜索引擎或用户设备发送的超文本传输协议请求。其次,在搜索节点中设置缓存,使得该缓存能够存储搜索引擎或用户设备在预定时间段内检索过的索引。再次,本发明的实施例通过将其他网页的统一资源定位地址作为信息加入到该网页中,使得搜索引擎能够通过该网页链接到其他网页,实现了针对区块链网络的网页抓取功能。此外,本发明的实施例还针对区块链网络中的公开数据和隐私数据进行了区分处理。更为具体的实现方法和本发明的其他优势请参见下文中的阐述。In order to solve these problems and implement a search service for a blockchain network, an embodiment of the present invention first provides a hypertext transfer protocol interface. The hypertext transfer protocol interface is, for example, located in a search node of a blockchain, so that the search node Ability to process Hypertext Transfer Protocol requests sent by search engines or user devices. Secondly, a cache is set in the search node, so that the cache can store indexes retrieved by the search engine or user equipment within a predetermined period of time. Third, the embodiment of the present invention adds the uniform resource location address of other webpages as information to the webpage, so that the search engine can link to other webpages through the webpage, and implements the webpage crawling function for the blockchain network. In addition, the embodiments of the present invention also distinguish between public data and private data in the blockchain network. For more specific implementation methods and other advantages of the present invention, please refer to the description below.
图1示出了依据本发明内容的区块链的网络结构100的示意图,在图1中区块链的网络结构100包括了区块链节点111、112、113、114、115、116以及搜索节点117;其中,搜索节点117包括缓存。区块链节点111-116以及搜索节点117之间可以通过网络同步数据,该网络可以是任何有线和/或无线网络。FIG. 1 shows a schematic diagram of a blockchain network structure 100 according to the present invention. In FIG. 1, the blockchain network structure 100 includes blockchain nodes 111, 112, 113, 114, 115, 116, and search. Node 117; wherein the search node 117 includes a cache. Blockchain nodes 111-116 and search nodes 117 can synchronize data through a network, which can be any wired and / or wireless network.
在本发明内容中,搜索节点117仅能够同步公开数据,而不能够同步隐私数据。需要说明的是,在本发明内容中可以采用现有的或将来开发的同步技术实现数据同步。此外,在搜索节点117中设置的缓存能够存储在设定时间段内检索过的一个或多个索引,每一个索引包括检索过的统一资 源定位地址、与该统一资源定位地址相关联的网页以及第二时间信息。图2B示出了存储在缓存中的示例性索引,其中包括了URL1以及与其对应的网页html_1、第二时间信息STAMP 1,URLn以及与其对应的网页html_n、第二时间信息STAMP n。另外,鉴于搜索节点117中缓存容量的限制,当所述设定时间段结束时,将删除该缓存内所有的索引,以实现缓存中索引的实时更新。In the present invention, the search node 117 can only synchronize public data, and cannot synchronize private data. It should be noted that, in the content of the present invention, existing or future developed synchronization technologies can be used to implement data synchronization. In addition, the cache set in the search node 117 can store one or more indexes retrieved within a set period of time, each index including the retrieved uniform resource location address, a webpage associated with the uniform resource location address, and Second time information. FIG. 2B shows an exemplary index stored in the cache, which includes URL1 and its corresponding webpage html_1, second time information STAMP1, URLn and its corresponding webpage html_n, second time information STAMPn. In addition, in view of the limitation of the cache capacity in the search node 117, when the set time period ends, all indexes in the cache will be deleted to achieve real-time updating of the indexes in the cache.
图2A示出了用于搜索区块链数据的方法200的流程图,在本实施例中,图1所示的区块链网络100中的搜索节点117可以实施图2A所示的方法200,具体如下:FIG. 2A shows a flowchart of a method 200 for searching for blockchain data. In this embodiment, the search node 117 in the blockchain network 100 shown in FIG. 1 may implement the method 200 shown in FIG. 2A. details as follows:
步骤210:经由超文本传输协议接口接收网页读取请求,所述网页读取请求包括第一统一资源定位地址和第一时间信息。Step 210: Receive a webpage read request via a hypertext transfer protocol interface, where the webpage read request includes a first uniform resource location address and first time information.
在具体抓取网页信息时,搜索引擎端可以增加以下功能,即搜索引擎可以访问区块链的入口地址(例如:http://test.com.homepage),以便于搜索引擎能够访问该区块链。或者,用户可以利用浏览器访问区块链的入口地址(例如:http://test.com.homepage),使得用户能够访问该区块链。When crawling webpage information, the search engine can add the following functions, that is, the search engine can access the entry address of the blockchain (for example: http: //test.com.homepage), so that the search engine can access the block chain. Alternatively, the user can use a browser to access the entrance address of the blockchain (for example: http: //test.com.homepage), so that the user can access the blockchain.
步骤220:确定缓存中是否存在与所述第一统一资源定位地址相关联的索引。Step 220: Determine whether an index associated with the first uniform resource location address exists in the cache.
在本步骤中,根据该网页读取请求中的该第一统一资源定位地址来确定缓存中是否存在与第一统一资源定位地址相关联的索引,并且所述缓存存储在预定时间段内检索过的一个或多个索引,每一个索引包括检索过的统一资源定位地址、与所述统一资源定位地址相关联的网页以及第二时间信息In this step, it is determined whether an index associated with the first uniform resource location address exists in the cache according to the first uniform resource location address in the webpage read request, and the cache is stored and retrieved within a predetermined period of time. One or more indexes of each, each index including the retrieved uniform resource location address, a webpage associated with the uniform resource location address, and second time information
步骤230:在所述缓存中存在与所述第一统一资源定位地址相关联的索引,并且在所述第一时间信息早于所述索引中的所述第二时间信息的情况下,经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页;具体实施方式如下:Step 230: An index associated with the first uniform resource location address exists in the cache, and if the first time information is earlier than the second time information in the index, The hypertext transfer protocol interface returns a webpage associated with the first uniform resource location address; the specific implementation is as follows:
第一,判断搜索引擎或用户是否曾经访问过与第一统一资源定位地址相关联的网页,当在该缓存中存在与第一统一资源定位地址相关联的索引时,表明搜索引擎或用户曾经访问过;然后,判断该访问过的网页的具体 修改时间(也即,第一时间信息)是否早于缓存中存储的相应网页的修改时间(也即,表示区块链数据更新时间的第二时间信息),当第一时间信息早于该索引中的第二时间信息时,表明已经修改过该第一统一资源定位地址相关联的网页。First, determine whether a search engine or user has visited a webpage associated with the first uniform resource location address, and when an index associated with the first uniform resource location address exists in the cache, it indicates that the search engine or user has visited Then, determine whether the specific modification time (ie, first time information) of the visited webpage is earlier than the modification time of the corresponding webpage stored in the cache (ie, the second time representing the update time of the blockchain data) Information), when the first time information is earlier than the second time information in the index, it indicates that the webpage associated with the first uniform resource location address has been modified.
第二,当确定已经修改过该第一统一资源定位地址相关联的网页时,将经由超文本传输协议接口向搜索引擎或用户返回索引中的与第一统一资源定位地址相关联的网页,由此确保了搜索引擎或用户能够得到最新的检索结果。Secondly, when it is determined that the webpage associated with the first uniform resource location address has been modified, the webpage associated with the first uniform resource location address in the index will be returned to the search engine or the user via the Hypertext Transfer Protocol interface. This ensures that search engines or users get the latest search results.
此外,具体到如何通过生成与第一统一资源定位地址相关联的网页,其实现方式能够是多种多样的。例如能够在网页中生成第一统一资源定位地址所指向的区块链数据,另外,在存在至少一个第二统一资源定位地址即第二统一资源定位地址的情况下,该第二统一资源定位地址也能够呈现在该网页上,所以,该网页既能够包括区块链的数据,也能够包括统一资源定位地址。在具有多个统一资源定位地址的情况下,这些统一资源定位地址能够顺序地排列在所述网页上。也能够通过将区块链数据根据其逻辑关系生成与区块链数据中的数据相关联的逻辑搜索树状图的方式来实现。In addition, specifically how to generate a webpage associated with the first uniform resource location address can be implemented in various ways. For example, the blockchain data pointed to by the first uniform resource location address can be generated in a webpage. In addition, if there is at least one second uniform resource location address, that is, the second uniform resource location address, the second uniform resource location address It can also be presented on the webpage, so the webpage can include both the data of the blockchain and the uniform resource location address. In the case where there are multiple uniform resource location addresses, these uniform resource location addresses can be sequentially arranged on the webpage. It can also be implemented by generating a logical search tree diagram associated with the data in the blockchain data according to its logical relationship.
再接下来,将该网页返回给用户设备或搜索引擎。用户设备或搜索引擎在接收到该返回的网页之后,既能够直接抽取其中的区块链数据及其访问地址,也能够向区块链网络侧发起进一步的网页读取请求,以抓取后续的区块链数据。Next, the webpage is returned to the user device or search engine. After receiving the returned webpage, the user equipment or search engine can either directly extract the blockchain data and its access address, or initiate a further webpage read request to the blockchain network side to capture the subsequent Blockchain data.
如果在所述缓存中存在与所述第一统一资源定位地址相关联的索引并且所述第一时间信息等于所述索引中的所述第二时间信息的情况下,经由所述超文本传输协议接口返回表示网页未修改的标识。具体地,确定缓存中存在与所述第一统一资源定位地址相关联的索引并且第一时间信息等于相应索引中的第二时间信息,则表明用户或搜索引擎曾经搜索的网页没有变化,也即无需向用户或搜索引擎提供检索结果,因此经由超文本传输协议接口返回表示网页未修改的标识。在具体实现中,可以返回HTTP状态码'304'以表明上述情况。If an index associated with the first uniform resource location address exists in the cache and the first time information is equal to the second time information in the index, via the hypertext transfer protocol The interface returns an identifier indicating that the web page has not been modified. Specifically, if it is determined that an index associated with the first uniform resource location address exists in the cache and the first time information is equal to the second time information in the corresponding index, it indicates that the webpage that the user or search engine has searched for has not changed, that is, There is no need to provide search results to the user or search engine, so an identifier indicating that the web page has not been modified is returned via a hypertext transfer protocol interface. In a specific implementation, the HTTP status code '304' may be returned to indicate the above situation.
在本实施例中,如果判断缓存中不存在与第一统一资源定位地址相关 联的索引,则方法200还包括如下步骤:In this embodiment, if it is determined that there is no index associated with the first uniform resource location address in the cache, the method 200 further includes the following steps:
首先,在所述缓存中不存在与所述第一统一资源定位地址相关联的索引的情况下,获取在所述第一统一资源定位地址处的第一区块链数据。其次,判断是否存在至少一个第二统一资源定位地址,其中,在所述至少一个第二统一资源定位地址处的第二区块链数据与所述第一区块链数据相关联。再次,在存在所述至少一个第二统一资源定位地址的情况下,根据所述第一区块链数据和所述至少一个第二统一资源定位地址生成与所述第一统一资源定位地址相关联的网页;或者在不存在所述至少一个第二统一资源定位地址的情况下,根据所述第一区块链数据生成与所述第一统一资源定位地址相关联的网页。然后,经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页。最后,将该第一统一资源定位地址、与该第一统一资源定位地址相关联的网页以及第二时间信息作为新的索引存储在所述缓存中。First, if there is no index associated with the first uniform resource location address in the cache, first blockchain data at the first uniform resource location address is obtained. Secondly, it is determined whether there is at least one second uniform resource location address, wherein the second blockchain data at the at least one second uniform resource location address is associated with the first blockchain data. Again, in the case where the at least one second uniform resource location address exists, generating the association with the first uniform resource location address according to the first blockchain data and the at least one second uniform resource location address Or a webpage associated with the first uniform resource location address according to the first blockchain data when the at least one second uniform resource location address does not exist. Then, a webpage associated with the first uniform resource location address is returned via the hypertext transfer protocol interface. Finally, the first uniform resource location address, the webpage associated with the first uniform resource location address, and the second time information are stored in the cache as a new index.
在本发明内容中,获取在所述第一统一资源定位地址处的第一区块链数据具体包括:根据所述第一区块链数据的账本存储位置来确定是否获取在所述第一统一资源定位地址处的第一区块链数据;具体地,在所述第一区块链数据或所述第二区块链数据为公开数据的情况下,所述第一区块链数据或所述第二区块链数据存储在公开账本中;以及在所述第一区块链数据或所述第二区块链数据为隐私数据的情况下,所述第一区块链数据或所述第二区块链数据存储在隐私账本中;在所述第一区块链数据存储在所述公开账本中的情况下,获取在所述第一统一资源定位地址处的第一区块链数据。In the content of the present invention, obtaining the first blockchain data at the first unified resource location address specifically includes: determining whether to obtain the first unified data according to the ledger storage location of the first blockchain data. The first blockchain data at the resource location address; specifically, if the first blockchain data or the second blockchain data is public data, the first blockchain data or Said second blockchain data is stored in a public ledger; and in a case where said first blockchain data or said second blockchain data is private data, said first blockchain data or said The second blockchain data is stored in the privacy ledger; in the case where the first blockchain data is stored in the public ledger, the first blockchain data at the first uniform resource location address is obtained .
在本发明内容中,获取在所述第一统一资源定位地址处的第一区块链数据还可以包括:根据所述第一区块链数据的存储区域位置来确定是否获取在所述第一统一资源定位地址处的第一区块链数据;具体地,在所述第一区块链数据或所述第二区块链数据为公开数据的情况下,所述第一区块链数据或所述第二区块链数据存储在账本的公开区域中;以及在所述第一区块链数据或所述第二区块链数据为隐私数据的情况下,所述第一区块链数据或所述第二区块链数据存储在账本的隐私区域中;在所述第一区块链 数据存储在所述账本的公开区域中的情况下,获取在所述第一统一资源定位地址处的第一区块链数据。In the content of the present invention, acquiring the first blockchain data at the first uniform resource location address may further include: determining whether to acquire the first blockchain data according to a location of the storage area of the first blockchain data. The first blockchain data at the uniform resource location address; specifically, in a case where the first blockchain data or the second blockchain data is public data, the first blockchain data or The second blockchain data is stored in a public area of the ledger; and in a case where the first blockchain data or the second blockchain data is private data, the first blockchain data Or the second blockchain data is stored in the privacy area of the ledger; in the case where the first blockchain data is stored in the public area of the ledger, it is obtained at the first uniform resource location address Of the first blockchain data.
在本发明内容中,判断是否存在至少一个第二统一资源定位地址进一步包括:根据所述第一区块链数据所包括的层次属性和预先确定的层次关系树来判断是否存在所述至少一个第二统一资源定位地址。In the content of the present invention, determining whether there is at least one second uniform resource location address further includes: determining whether the at least one first resource exists according to a hierarchical attribute included in the first blockchain data and a predetermined hierarchical relationship tree. Second, the uniform resource location address.
在本发明内容中,在生成与第一统一资源定位地址相关联的网页的时候,区块链数据所包括的层次属性也能够起到非常重要的作用,将会根据第一区块链数据所包括的层次属性和预先确定的层次关系树来判断是否存在至少一个第二统一资源定位地址。具体来看例如区块链数据A的层次属性为"保险",并且预先确定的层次关系树表明存在层次属性为"保险/区块链保险"的区块链数据B,那么区块链数据B则为区块链数据A的下一级区块链数据。如果网页读取请求是为了抓取层次属性为"保险"的区块链数据A,则将指向层次属性为"保险/区块链保险"的区块链数据B的统一资源定位地址也生成在网页上,即在所生成的网页中包含指向层次属性为"保险/区块链保险"的区块链数据B的统一资源定位地址。In the present invention, when generating a webpage associated with the first uniform resource location address, the hierarchical attributes included in the blockchain data can also play a very important role. It includes a hierarchical attribute and a predetermined hierarchical relationship tree to determine whether there is at least one second uniform resource location address. Specifically, for example, the hierarchical attribute of the blockchain data A is "insurance", and the predetermined hierarchical relationship tree indicates that there exists the blockchain data B whose hierarchical attribute is "insurance / blockchain insurance", then the blockchain data B It is the next level of blockchain data of blockchain data A. If the webpage read request is to capture the blockchain data A whose hierarchical attribute is "insurance", the uniform resource location address pointing to the blockchain data B whose hierarchical attribute is "insurance / blockchain insurance" is also generated in On the webpage, the generated webpage contains a uniform resource location address pointing to the blockchain data B whose hierarchical attribute is "insurance / blockchain insurance".
此外,在本实施例中为了确保缓存中所存储的索引中包含了相应统一资源定位地址的最新的区块链数据,以便于向用户或搜索引擎快速、有效地返回最新的网页,本发明内容所提供的用于搜索区块链数据的方法还包括了如图3所示的第一实施例300以便于更新缓存中索引,具体包括如下步骤:In addition, in this embodiment, in order to ensure that the index stored in the cache contains the latest blockchain data of the corresponding uniform resource location address, so as to quickly and effectively return the latest web page to the user or search engine, the present invention The provided method for searching for blockchain data further includes a first embodiment 300 as shown in FIG. 3 to facilitate updating the index in the cache, and specifically includes the following steps:
步骤310:基于每一个索引中存储的统一资源定位地址确定所述区块链中相应统一资源定位地址处的区块链数据。Step 310: Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index.
步骤320:将所述区块链数据与所述索引中存储的网页所对应的数据进行比较以确定所述统一资源定位地址处的区块链数据是否更新。Step 320: Compare the blockchain data with data corresponding to a webpage stored in the index to determine whether the blockchain data at the uniform resource location address is updated.
在本步骤中,当区块链数据与该索引中存储的网页所对应的数据之间存在差异时,表明已经更新过该统一资源定位地址处的区块链数据。In this step, when there is a difference between the blockchain data and the data corresponding to the webpage stored in the index, it indicates that the blockchain data at the uniform resource location address has been updated.
步骤330:在所述统一资源定位地址处的区块链数据被更新的情况下,在所述索引中将与所述统一资源定位地址相关联的网页更新为根据更新的区块链数据所生成的网页,并将所述第二时间信息更新为所述区块链数据 的更新时间。Step 330: In the case that the blockchain data at the uniform resource location address is updated, update the webpage associated with the uniform resource location address in the index to be generated based on the updated blockchain data And update the second time information to the update time of the blockchain data.
本发明内容可以采用该实施例实现在缓存中更新相应的索引。The present invention can use this embodiment to update the corresponding index in the cache.
替代地,本发明内容还可以采用如下实施例实现对于缓存中索引的实时更新:Alternatively, the present invention may also use the following embodiments to implement real-time updating of indexes in the cache:
首先,基于每一个索引中存储的统一资源定位地址确定所述区块链中相应统一资源定位地址处的区块链数据。First, the blockchain data at the corresponding uniform resource location address in the blockchain is determined based on the uniform resource location address stored in each index.
其次,将所述区块链数据的修改时间信息与所述索引中的第二时间信息进行比较以确定所述统一资源定位地址处的区块链数据是否更新。Secondly, the modification time information of the blockchain data is compared with the second time information in the index to determine whether the blockchain data at the uniform resource location address is updated.
具体地,当该区块链数据的修改时间信息不晚于该索引中的第二时间信息时表明该统一资源定位地址处的区块链数据没有被更新,当该区块链数据的修改时间信息晚于该索引中的第二时间信息时表明该统一资源定位地址处的区块链数据已经被更新。Specifically, when the modification time information of the blockchain data is not later than the second time information in the index, it indicates that the blockchain data at the uniform resource location address has not been updated. When the modification time of the blockchain data is When the information is later than the second time information in the index, it indicates that the blockchain data at the uniform resource location address has been updated.
第三,在所述区块链数据的修改时间信息晚于所述索引中的第二时间信息的情况下,在所述索引中将与所述统一资源定位地址相关联的网页更新为根据更新的区块链数据所生成的网页,并将所述第二时间信息更新为所述区块链数据的更新时间。Third, in a case where the modification time information of the blockchain data is later than the second time information in the index, the webpage associated with the uniform resource location address is updated in the index to be based on the update A webpage generated by the blockchain data and updates the second time information to the update time of the blockchain data.
本发明内容也可以采用上述实施例在缓存中实时更新相应的索引。The present invention can also use the above embodiments to update the corresponding indexes in the cache in real time.
可选地,为了确保缓存中所存储的索引中包含了相应统一资源定位地址的最新的区块链数据,以便于向用户设备或搜索引擎快速、有效地返回最新的网页,本发明内容所提供的用于搜索区块链数据的方法还可以采用如图4A所示的第二实施例400来实现上述目的。Optionally, in order to ensure that the index stored in the cache contains the latest blockchain data of the corresponding uniform resource location address, in order to quickly and effectively return the latest webpage to the user equipment or search engine, the present invention provides The method for searching for blockchain data can also use the second embodiment 400 shown in FIG. 4A to achieve the above purpose.
在图4A所示的方法中,首先,网页读取请求中还包括表示允许返回差异网页的第一指示符,缓存中的每一个索引还包括一个或多个差异网页以及与每一个差异网页相对应的时间段信息。In the method shown in FIG. 4A, first, the webpage read request further includes a first indicator indicating that it is allowed to return the difference webpages, and each index in the cache further includes one or more difference webpages and corresponding data to each difference webpage. Corresponding time period information.
如图4A所示的方法400具体操作如下:The specific operation of the method 400 shown in FIG. 4A is as follows:
步骤410:基于每一个索引中存储的统一资源定位地址确定所述区块链中相应统一资源定位地址处的区块链数据。Step 410: Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index.
步骤420:将所述区块链数据与所述索引中存储的网页所对应的数据进行比较以确定所述统一资源定位地址处的区块链数据是否更新。Step 420: Compare the blockchain data with data corresponding to a webpage stored in the index to determine whether the blockchain data at the uniform resource location address is updated.
在本步骤中,将该区块链数据与所述索引中存储的网页所对应的数据进行比较判断是否存在数据差异,当存在数据差异时确定已经更新了该统一资源定位地址处的区块链数据。In this step, the blockchain data is compared with the data corresponding to the webpage stored in the index to determine whether there is a data difference. When there is a data difference, it is determined that the blockchain at the uniform resource location address has been updated. data.
步骤430:在所述索引中的所述统一资源定位地址处的区块链数据被更新的情况下,利用更新的区块链数据与所述索引中存储的网页所对应的数据之间的数据差异生成相应的差异网页,将所述第二时间信息以及区块链数据的更新时间一起作为与所述差异网页相对应的时间段信息。Step 430: When the blockchain data at the uniform resource location address in the index is updated, use the data between the updated blockchain data and the data corresponding to the webpage stored in the index. The difference generates a corresponding difference webpage, and uses the second time information and the update time of the blockchain data as the time period information corresponding to the difference webpage.
步骤440:将与所述统一资源定位地址相关联的网页更新为根据更新的区块链数据所生成的网页,并将所述第二时间信息更新为所述区块链数据的更新时间。Step 440: Update the webpage associated with the uniform resource location address to a webpage generated according to the updated blockchain data, and update the second time information to the update time of the blockchain data.
因此,更新后的所述索引包括统一资源定位地址、与该统一资源定位地址相关联的网页、第二时间信息、与该统一资源定位地址相关联的一个或多个差异网页以及与每一个差异网页相对应的时间段信息。Therefore, the updated index includes a uniform resource location address, a webpage associated with the uniform resource location address, second time information, one or more difference webpages associated with the uniform resource location address, and each difference Information about the time period corresponding to the web page.
在实际操作中,如果采用图4A所示的第二实施例400实现对缓存中索引的更新,则在所述缓存中存在与所述第一统一资源定位地址相关联的索引并且所述第一时间信息早于所述索引中的所述第二时间信息的情况下,用于搜索区块链数据的方法还包括:In actual operation, if the second embodiment 400 shown in FIG. 4A is used to update the index in the cache, an index associated with the first uniform resource location address exists in the cache and the first If the time information is earlier than the second time information in the index, the method for searching for blockchain data further includes:
首先,确定所接收的网页读取请求中是否存在第一指示符。First, it is determined whether a first indicator exists in the received webpage reading request.
也即,当存在第一指示符时,表明发出该网页读取请求的搜索引擎或用户使用的浏览器允许返回差异网页。That is, when the first indicator is present, it indicates that the search engine or the browser used by the user that issued the read request of the webpage is allowed to return the difference webpage.
其次,在接收的网页读取请求中存在第一指示符的情况下,基于所述第一时间信息与所述第二时间信息之间的时间差量以确定所述缓存中存在与所述时间差量相对应的一个或多个所述差异网页时,经由所述超文本传输协议接口返回与所述时间差量相对应的一个或多个所述差异网页。Secondly, in the case where the first indicator exists in the received webpage reading request, based on the time difference between the first time information and the second time information, it is determined that there is a time difference between the cache and the time. When the corresponding one or more difference webpages are returned, one or more of the difference webpages corresponding to the time difference are returned via the hypertext transfer protocol interface.
本发明内容的上述步骤均可以由图1中所示的搜索节点117实现。The above steps of the present invention can all be implemented by the search node 117 shown in FIG. 1.
例如,搜索引擎向搜索节点117发送包括第一统一资源定位地址URLx、第一时间信息(例如,18:30)以及第一指示符的网页读取请求时,搜索节点117在缓存中查找是否存在与URLx相关联的索引。在图4B中显示了在缓存中与URLx相关联的索引的示例,具体包括了URLx以及与其 对应的网页html_x、第二时间信息(例如,19:00)、在预定时间段内根据URLx获得的多个不同的差异网页(例如,△html_1、△html_2、△html_3)以及与这些差异网页相对应的时间段信息(例如,18:45-19:00、18:30-18:45、18:10-18:30)。搜索节点117根据第一时间信息(例如,18:30)与第二时间信息(例如,19:00)之间的时间差量(18:30-19:00),并从该索引中的多个时间段信息(例如,18:10-18:30、18:30-18:45、18:45-19:00)中确定在缓存中存在两个差异网页(也即,分别对应于18:45-19:00、18:30-18:45的△html_1、△html_2),则搜索节点117经由超文本传输协议接口返回这两个差异网页。For example, when the search engine sends a webpage read request including the first uniform resource location address URLx, the first time information (for example, 18:30), and the first indicator to the search node 117, the search node 117 looks for the existence in the cache The index associated with URLx. An example of the index associated with URLx in the cache is shown in FIG. 4B, and specifically includes URLx and its corresponding web page html_x, second time information (for example, 19:00), and obtained according to URLx within a predetermined time period. Multiple different difference pages (for example, △ html_1, △ html_2, △ html_3) and the time period information corresponding to these difference pages (for example, 18: 45-19: 00, 18: 30-18: 45, 18: 10-18: 30). The search node 117 is based on the time difference (18: 30-19: 00) between the first time information (e.g., 18:30) and the second time information (e.g., 19:00), and selects from a plurality of times in the index In the time period information (for example, 18: 10-18: 30, 18: 30-18: 45, 18: 45-19: 00), it is determined that there are two difference webpages in the cache (that is, respectively corresponding to 18:45 -1html, △ html_1, △ html_2 of 19:00, 18: 30-18: 45), the search node 117 returns the two difference web pages via the hypertext transfer protocol interface.
再比如,搜索引擎向搜索节点117发送包括第一统一资源定位地址URLx、第一时间信息(例如,08:20)以及第一指示符的网页读取请求时,搜索节点117在缓存中查找是否存在与URLx相关联的索引。在预定时间段设定为两个小时的情况下,在缓存中存在与URLx相关联的索引的情况下,查看URLx相对应的第二时间信息(例如,19:00),并且还查找到URLx相对应的多个时间段信息(例如,18:10-18:30、18:30-18:45、18:45-19:00),但是鉴于第一时间信息(例如,08:20)与第二时间信息(例如,19:00)之间的时间差量远远超过了所述预定时间段(例如,两个小时),那么搜索节点117将与URLx相关联的网页(例如,html_x)从缓存中经由超文本传输协议接口返回给搜索引擎。For another example, when the search engine sends a webpage read request including the first uniform resource location address URLx, the first time information (for example, 08:20), and the first indicator to the search node 117, the search node 117 looks for whether in the cache There is an index associated with URLx. In a case where the predetermined time period is set to two hours, and if an index associated with URLx exists in the cache, the second time information (for example, 19:00) corresponding to URLx is viewed, and URLx is also found Corresponding multiple time period information (for example, 18: 10-18: 30, 18: 30-18: 45, 18: 45-19: 00), but given the first time information (for example, 08:20) and The time difference between the second time information (e.g., 19:00) far exceeds the predetermined time period (e.g., two hours), then the search node 117 will change the webpage (e.g., html_x) associated with URLx from The cache is returned to the search engine via the Hypertext Transfer Protocol interface.
在本发明内容中,为了实现通过该统一资源定位地址对于与其相关联的区块链数据的正确解析,本发明内容提出了为区块链数据配置用于指定该区块链数据的解析方式的属性。例如,该属性包括用于表示所述区块链数据的数据解析方法的数据格式名。In the present invention, in order to realize the correct analysis of the blockchain data associated with the unified resource location address, the present invention proposes to configure the blockchain data to specify the analysis method of the blockchain data. Attributes. For example, the attribute includes a data format name for a data analysis method representing the blockchain data.
在实现上述链接地址时,同样需要遵循搜索引擎所需遵守的Robots协议。具体而言,Robots协议也称为爬虫协议、机器人协议等,其全称是"网络爬虫排除标准"(Robots Exclusion Protocol),网站通过Robots协议告诉搜索引擎哪些页面可以抓取,哪些页面不能抓取。When implementing the above link addresses, it is also necessary to follow the Robots protocol that search engines need to abide by. Specifically, the Robots protocol is also known as the crawler protocol, robot protocol, etc., and its full name is "Robots Exclusion Protocol". The website tells search engines which pages can be crawled and which pages cannot be crawled through the Robots protocol.
具体到本发明内容,对于该入口网页中的各项链接地址,也需要通过Robots协议告知搜索引擎允许遍历的链接地址。本发明内容利用区块链数 据本身的属性(例如依据本发明内容所公开的区块链数据包括公开数据和隐私数据)来实现对于搜索引擎的搜索行为的控制,其中,公开数据和隐私数据存储在区块链的不同位置或者所述公开数据和所述隐私数据具有不同的标记。Specifically to the content of the present invention, for each link address in the portal page, the link addresses that the search engine is allowed to traverse are also notified through the Robots protocol. The present invention utilizes the properties of the blockchain data itself (for example, the disclosed blockchain data includes public data and privacy data) to control the search behavior of the search engine, where the public data and privacy data are stored The public data and the private data have different marks at different locations on the blockchain.
Fabric、Corda等联盟链则对所有区块链数据中的全部的数据都做访问权限控制。由此可见,区块链平台对于有不同要求的数据都做了一样的访问控制而不具有不同的访问控制的能力。而一般而言,企业级区块链通常使用联盟链平台,对全部数据均做访问权限控制导致外部搜索引擎无法检索到需要公开的信息。Fabric, Corda and other alliance chains control access to all data in all blockchain data. It can be seen that the blockchain platform has the same access control for data with different requirements without having different access control capabilities. Generally speaking, the enterprise-level blockchain usually uses the alliance chain platform to control access to all data, which makes it impossible for external search engines to retrieve the information that needs to be disclosed.
具体而言,公开数据和隐私数据存储在区块链的不同位置或者公开数据和隐私数据具有不同的标记的实现方式方法能够有很多种。Specifically, there can be many implementation methods and methods for storing public data and private data in different locations of the blockchain or public data and private data having different marks.
举例来说,本发明内容可以对于多个账本进行区分,例如将第一个账本标记为公开账本,即其上仅仅存储上述的公开数据,而将其他账本标记为隐私账本,其上仅仅存储隐私数据。本领域的技术人员应当了解,公开账本和隐私账本的数量能够根据区块链上需要公开的数据和隐私数据的比例动态配置。由此能够实现对于区块链网络上的数据的区分对待,从而为后续对于区块链上的数据的搜索服务提供保障。For example, the present invention can distinguish multiple ledgers, such as marking the first ledger as a public ledger, that is, only the above-mentioned public data is stored on it, and other ledgers are marked as private ledgers, on which only privacy data. Those skilled in the art should understand that the number of public ledgers and privacy ledgers can be dynamically configured according to the ratio of data to be disclosed and privacy data on the blockchain. In this way, the data on the blockchain network can be treated differently, thereby providing guarantee for subsequent search services for data on the blockchain.
在第一区块链数据存储在公开账本中的情况下,获取第一统一资源定位地址处的第一区块链数据。在第一统一资源定位地址处的第一区块链数据存储在隐私账本中的情况下,不能够获取该第一区块链数据。In the case where the first blockchain data is stored in the public ledger, the first blockchain data at the first uniform resource location address is obtained. In the case where the first blockchain data at the first uniform resource location address is stored in the privacy ledger, the first blockchain data cannot be obtained.
替代地,也能够例如将第一个账本划分为两个不同的区域,在第一个区域上存储公开数据,而在第二个区域上存储隐私数据,由此也能够实现对于区块链网络上的数据的区分对待,从而为后续对于区块链上的数据的搜索服务提供保障。Alternatively, it is also possible to divide the first ledger into two different areas, for example, to store public data in the first area, and to store private data in the second area. The data on the blockchain is treated differently, thereby providing guarantee for subsequent search services for data on the blockchain.
在第一区块链数据存储在账本的公开区域中的情况下,获取在第一统一资源定位地址处的第一区块链数据;在第一区块链数据存储在账本的隐私区域中的情况下,不能够获取该第一区块链数据。In the case where the first blockchain data is stored in the public area of the ledger, the first blockchain data at the first uniform resource location address is obtained; the first blockchain data is stored in the private area of the ledger In this case, the first blockchain data cannot be obtained.
附加地或替代地,区块链数据以键值(Key/Value)方式进行存储,其中区块链数据还包括第一属性。当第一属性表明区块链数据为公开数据时, 则可以检索到该区块链数据;当第一属性表明区块链数据为隐私数据时,则不能够检索到该区块链数据。Additionally or alternatively, the blockchain data is stored in a key / value manner, where the blockchain data also includes a first attribute. When the first attribute indicates that the blockchain data is public data, the blockchain data can be retrieved; when the first attribute indicates that the blockchain data is private data, the blockchain data cannot be retrieved.
针对区块链网络上的对于区块链数据的访问无法保证满足搜索引擎的诸如Robots协议的搜索要求的技术问题,本发明内容的发明人创新性地意识到能够通过改造区块链网络上的数据的属性来适配搜索引擎,从而实现基于搜索引擎来搜索区块链网络上的数据的目的,此外,在实现检索的同时还能够满足区块链对于需要进行隐私保护部分数据的隐私保护。Aiming at the technical problem that access to blockchain data on the blockchain network cannot guarantee that the search requirements of search engines such as the Robots protocol are met, the inventor of the present invention innovatively realizes that the The attributes of the data are adapted to the search engine, so as to achieve the purpose of searching the data on the blockchain network based on the search engine. In addition, while implementing the retrieval, it can also satisfy the privacy protection of the blockchain for some data that needs privacy protection.
上述用于搜索区块链数据的方法一方面能够实现仅对区块链上公开数据进行检索,避免对区块链上隐私数据的获取;另一方面能够利用缓存中的索引来确定是否曾经进行过相同检索便于实现对网页读取请求的快速响应,并且降低了搜索节点处理网页读取请求的压力,由此提高了对区块链上公开数据的搜索效率。同时,通过本发明内容所提供的解决方案还可以减轻在搜索过程中对区块链的负担和干扰,以避免搜索引擎对区块链的其他节点进行直接访问,进而降低了搜索引擎获得区块链上的隐私数据的风险,增强了区块链与传统互联网互联互通过程中的安全性。此外,通过本发明内容所提供的解决方案可以实现区块链和互联网信息的互联互通,进一步发挥出区块链的巨大价值。The above method for searching for blockchain data can, on the one hand, enable retrieval of only public data on the blockchain and avoid the acquisition of private data on the blockchain; on the other hand, it can use the index in the cache to determine whether it has been performed Passing the same search facilitates fast response to web page read requests, and reduces the pressure on search nodes to process web page read requests, thereby improving the search efficiency of open data on the blockchain. At the same time, the solution provided by the present invention can also reduce the burden and interference on the blockchain during the search process, to avoid direct access by search engines to other nodes in the blockchain, and thus reduce the search engine's access to blocks. The risk of private data on the chain enhances the security of the blockchain and the traditional Internet interconnection process. In addition, the solution provided by the present invention can realize the interconnection and interconnection of the blockchain and Internet information, and further exert the great value of the blockchain.
此外,替代地,上述方法能够通过计算机程序产品,即计算机可读存储介质来实现。计算机程序产品可以包括计算机可读存储介质,其上载有用于执行本发明内容的各个方面的计算机可读程序指令。计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是但不限于电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本 身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。Further, alternatively, 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. More specific examples (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. 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 (for example, light pulses through fiber optic cables), or via electrical wires Electrical signal transmitted.
图5示出了依据本发明内容的第一实施例所公开的用于搜索区块链数据的设备500的方框图。从图5中可以看出,用于搜索区块链数据的设备500包括处理器501和与处理器501耦接的存储器502。其中,存储器502存储有指令。指令在由处理器501执行时使得处理器501执行以下动作:FIG. 5 shows a block diagram of a device 500 for searching for blockchain data according to a first embodiment of the present disclosure. As can be seen from FIG. 5, the device 500 for searching for blockchain data includes a processor 501 and a memory 502 coupled to the processor 501. The memory 502 stores instructions. When executed by the processor 501, the instructions cause the processor 501 to perform the following actions:
A.经由超文本传输协议接口接收网页读取请求,所述网页读取请求包括第一统一资源定位地址和第一时间信息;A. receiving a webpage read request via a hypertext transfer protocol interface, where the webpage read request includes a first uniform resource location address and first time information;
B.确定缓存中是否存在与所述第一统一资源定位地址相关联的索引,其中,所述缓存存储在预定时间段内检索过的一个或多个索引,每一个索引包括检索过的统一资源定位地址、与所述统一资源定位地址相关联的网页以及第二时间信息;B. Determine whether an index associated with the first uniform resource location address exists in the cache, wherein the cache stores one or more indexes retrieved within a predetermined period of time, each index including the retrieved uniform resource A positioning address, a webpage associated with the uniform resource positioning address, and second time information;
C1.在所述缓存中存在与所述第一统一资源定位地址相关联的索引,并且在所述第一时间信息早于所述索引中的所述第二时间信息的情况下,经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页。C1. An index associated with the first uniform resource location address exists in the cache, and if the first time information is earlier than the second time information in the index, via the The hypertext transfer protocol interface returns a webpage associated with the first uniform resource location address.
在依据本发明内容的一个实施例中,当所述指令执行时使得所述处理器501还执行以下操作:In an embodiment according to the present invention, when the instruction is executed, the processor 501 further performs the following operations:
C2.在所述缓存中存在与所述第一统一资源定位地址相关联的索引并且所述第一时间信息等于所述索引中的所述第二时间信息的情况下,经由所述超文本传输协议接口返回表示网页未修改的标识。C2. When an index associated with the first uniform resource location address exists in the cache and the first time information is equal to the second time information in the index, transmitted via the hypertext The protocol interface returns an identifier indicating that the web page has not been modified.
在依据本发明内容的一个实施例中,当所述指令执行时使得所述处理器501还执行以下操作:In an embodiment according to the present invention, when the instruction is executed, the processor 501 further performs the following operations:
D11.基于每一个索引中存储的统一资源定位地址确定所述区块链中相应统一资源定位地址处的区块链数据;D11. Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index;
D12.将所述区块链数据与所述索引中存储的网页所对应的数据进行比较以确定所述统一资源定位地址处的区块链数据是否更新;D12: comparing the blockchain data with data corresponding to a webpage stored in the index to determine whether the blockchain data at the uniform resource location address is updated;
D13.在所述统一资源定位地址处的区块链数据被更新的情况下,在所 述索引中将与所述统一资源定位地址相关联的网页更新为根据更新的区块链数据所生成的网页,并将所述第二时间信息更新为所述区块链数据的更新时间。D13. In the case where the blockchain data at the uniform resource location address is updated, the webpage associated with the uniform resource location address is updated in the index to be generated based on the updated blockchain data A webpage, and updates the second time information to the update time of the blockchain data.
在依据本发明内容的一个实施例中,当所述指令执行时使得所述处理器501还执行以下操作:In an embodiment according to the present invention, when the instruction is executed, the processor 501 further performs the following operations:
D21.基于每一个索引中存储的统一资源定位地址确定所述区块链中相应统一资源定位地址处的区块链数据;D21. Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index;
D22.将所述区块链数据的修改时间信息与所述索引中的第二时间信息进行比较以确定所述统一资源定位地址处的区块链数据是否更新;D22. Compare the modification time information of the blockchain data with the second time information in the index to determine whether the blockchain data at the uniform resource location address is updated;
D23.在所述区块链数据的修改时间信息晚于所述索引中的第二时间信息的情况下,在所述索引中将与所述统一资源定位地址相关联的网页更新为根据更新的区块链数据所生成的网页,并将所述第二时间信息更新为所述区块链数据的更新时间。D23. In the case that the modification time information of the blockchain data is later than the second time information in the index, the webpage associated with the uniform resource location address is updated in the index to be based on the updated A webpage generated by the blockchain data, and updating the second time information to an update time of the blockchain data.
在依据本发明内容的一个实施例中,所述网页读取请求还包括表示允许返回差异网页的第一指示符,所述缓存中的每一个索引还包括一个或多个差异网页以及与分别每一个差异网页相对应的时间段信息,所述指令执行时还使得所述处理器501执行以下操作:In an embodiment according to the present invention, the webpage reading request further includes a first indicator indicating that a difference webpage is allowed to be returned, and each index in the cache further includes one or more difference webpages and a data file corresponding to each The time period information corresponding to a difference webpage, when the instruction is executed, also causes the processor 501 to perform the following operations:
E1.基于每一个索引中存储的统一资源定位地址确定所述区块链中相应统一资源定位地址处的区块链数据;E1. Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index;
E2.将所述区块链数据与所述索引中存储的网页所对应的数据进行比较以确定所述统一资源定位地址处的区块链数据是否更新;E2. Compare the blockchain data with data corresponding to a webpage stored in the index to determine whether the blockchain data at the uniform resource location address is updated;
E3.在所述索引中的所述统一资源定位地址处的区块链数据被更新的情况下,利用更新的区块链数据与所述索引中存储的网页所对应的数据之间的数据差异生成相应的差异网页,将所述第二时间信息以及区块链数据的更新时间一起作为与所述差异网页相对应的时间段信息;E3. When the blockchain data at the uniform resource location address in the index is updated, use the data difference between the updated blockchain data and the data corresponding to the webpage stored in the index Generating a corresponding difference webpage, and using the second time information and the update time of the blockchain data as the time period information corresponding to the difference webpage;
E4.将与所述统一资源定位地址相关联的网页更新为根据更新的区块链数据所生成的网页,并将所述第二时间信息更新为所述区块链数据的更新时间。E4. Updating the webpage associated with the uniform resource location address to a webpage generated according to the updated blockchain data, and updating the second time information to the update time of the blockchain data.
在依据本发明内容的一个实施例中,在所述缓存中存在与所述第一统 一资源定位地址相关联的索引并且所述第一时间信息早于所述索引中的所述第二时间信息的情况下,所述指令执行时还使得所述处理器501执行以下操作:In an embodiment according to the present invention, an index associated with the first uniform resource location address exists in the cache, and the first time information is earlier than the second time information in the index. In the case of execution, the instruction further causes the processor 501 to perform the following operations:
F1.确定所接收的网页读取请求中是否存在第一指示符;F1. Determine whether a first indicator exists in the received webpage reading request;
F2.在接收的网页读取请求中存在第一指示符的情况下,基于所述第一时间信息与所述第二时间信息之间的时间差量以确定所述缓存中存在与所述时间差量相对应的一个或多个所述差异网页时,经由所述超文本传输协议接口返回与所述时间差量相对应的一个或多个所述差异网页。F2. In the case where the first indicator exists in the received webpage read request, based on the time difference between the first time information and the second time information, it is determined that the time difference exists in the cache When the corresponding one or more difference webpages are returned, one or more of the difference webpages corresponding to the time difference are returned via the hypertext transfer protocol interface.
在依据本发明内容的一个实施例中,当所述指令执行时使得所述处理器501还执行以下操作:In an embodiment according to the present invention, when the instruction is executed, the processor 501 further performs the following operations:
C31.在所述缓存中不存在与所述第一统一资源定位地址相关联的索引的情况下,获取在所述第一统一资源定位地址处的第一区块链数据;C31. When there is no index associated with the first uniform resource location address in the cache, obtain first blockchain data at the first uniform resource location address;
C32.判断是否存在至少一个第二统一资源定位地址,其中,在所述至少一个第二统一资源定位地址处的第二区块链数据与所述第一区块链数据相关联;C32. Determine whether there is at least one second uniform resource location address, wherein the second blockchain data at the at least one second uniform resource location address is associated with the first blockchain data;
C33.在存在所述至少一个第二统一资源定位地址的情况下,根据所述第一区块链数据和所述至少一个第二统一资源定位地址生成与所述第一统一资源定位地址相关联的网页;以及C33. In the case where the at least one second uniform resource location address exists, generating the association with the first uniform resource location address according to the first blockchain data and the at least one second uniform resource location address Web pages; and
C34.经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页。C34. A webpage associated with the first uniform resource location address is returned via the hypertext transfer protocol interface.
在依据本发明内容的一个实施例中,在所述步骤C34中经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页之后,所述指令执行时使得所述处理器501还执行以下操作:In an embodiment according to the present invention, after the webpage associated with the first uniform resource location address is returned via the hypertext transfer protocol interface in the step C34, the instruction causes the processing when executed. The router 501 also performs the following operations:
C35.将所述第一统一资源定位地址、与所述第一统一资源定位地址相关联的网页以及所述第二时间信息作为索引存储在所述缓存中。C35. The first uniform resource location address, a webpage associated with the first uniform resource location address, and the second time information are stored in the cache as an index.
在依据本发明内容的一个实施例中,当所述指令执行时使得所述处理器501还执行以下操作:In an embodiment according to the present invention, when the instruction is executed, the processor 501 further performs the following operations:
在不存在所述至少一个第二统一资源定位地址的情况下,根据所述第一区块链数据生成与所述第一统一资源定位地址相关联的网页。When the at least one second uniform resource location address does not exist, a webpage associated with the first uniform resource location address is generated according to the first blockchain data.
在依据本发明内容的一个实施例中,所述步骤C32中判断是否存在至少一个第二统一资源定位地址进一步包括:In an embodiment according to the present invention, determining whether there is at least one second uniform resource location address in step C32 further includes:
根据所述第一区块链数据所包括的层次属性和预先确定的层次关系树来判断是否存在所述至少一个第二统一资源定位地址。Determining whether the at least one second uniform resource location address exists according to a hierarchical attribute included in the first blockchain data and a predetermined hierarchical relationship tree.
在依据本发明内容的一个实施例中,所述步骤C31中获取在所述第一统一资源定位地址处的第一区块链数据进一步包括:In an embodiment according to the present invention, obtaining the first blockchain data at the first uniform resource location address in step C31 further includes:
根据所述第一区块链数据的账本存储位置来确定是否获取在所述第一统一资源定位地址处的第一区块链数据,Determining whether to obtain the first blockchain data at the first uniform resource location address according to the ledger storage location of the first blockchain data,
其中,在所述第一区块链数据或所述第二区块链数据为公开数据的情况下,所述第一区块链数据或所述第二区块链数据存储在公开账本中;以及在所述第一区块链数据或所述第二区块链数据为隐私数据的情况下,所述第一区块链数据或所述第二区块链数据存储在隐私账本中;Wherein, in a case where the first blockchain data or the second blockchain data is public data, the first blockchain data or the second blockchain data is stored in a public ledger; And in a case where the first blockchain data or the second blockchain data is private data, the first blockchain data or the second blockchain data is stored in a privacy ledger;
在所述第一区块链数据存储在所述公开账本中的情况下,获取在所述第一统一资源定位地址处的第一区块链数据。In a case where the first blockchain data is stored in the public ledger, the first blockchain data at the first uniform resource location address is acquired.
在依据本发明内容的一个实施例中,所述步骤C31中获取在所述第一统一资源定位地址处的第一区块链数据进一步包括:In an embodiment according to the present invention, obtaining the first blockchain data at the first uniform resource location address in step C31 further includes:
根据所述第一区块链数据的存储区域位置来确定是否获取在所述第一统一资源定位地址处的第一区块链数据,Determining whether to obtain the first blockchain data at the first uniform resource location address according to the storage area location of the first blockchain data,
其中,在所述第一区块链数据或所述第二区块链数据为公开数据的情况下,所述第一区块链数据或所述第二区块链数据存储在账本的公开区域中;以及在所述第一区块链数据或所述第二区块链数据为隐私数据的情况下,所述第一区块链数据或所述第二区块链数据存储在账本的隐私区域中;Wherein, in a case where the first blockchain data or the second blockchain data is public data, the first blockchain data or the second blockchain data is stored in a public area of a ledger Medium; and in the case where the first blockchain data or the second blockchain data is privacy data, the first blockchain data or the second blockchain data is stored in the privacy of the ledger Area
在所述第一区块链数据存储在所述账本的公开区域中的情况下,获取在所述第一统一资源定位地址处的第一区块链数据。In a case where the first blockchain data is stored in a public area of the ledger, the first blockchain data at the first uniform resource location address is acquired.
在依据本发明内容的一个实施例中,所述第一区块链数据和/或所述第二区块链数据包括第一属性,并且其中,所述步骤C31中获取在所述第一统一资源定位地址处的第一区块链数据进一步包括:In an embodiment according to the present invention, the first blockchain data and / or the second blockchain data includes a first attribute, and wherein, in step C31, the first unified The first blockchain data at the resource location address further includes:
在所述第一区块链数据的第一属性表明所述第一区块链数据为公开数 据的情况下,获取在所述第一统一资源定位地址处的第一区块链数据。When the first attribute of the first blockchain data indicates that the first blockchain data is public data, the first blockchain data at the first uniform resource location address is obtained.
综上所述,本发明内容所提出的用于搜索区块链数据的方法、设备以及相应的计算机可读存储介质一方面能够在缓存中搜索曾经搜索过的数据来提高对区块链数据的搜索效率,另一方面能够对区块链上的数据作出精确控制,实现仅访问可以公开的数据,并且限定了一种供访问检索的内部机制和接口,不仅可以让外部网页链接可以直接链接区块链中的公开数据,也可以让区块链中的公开数据相互链接。此外,通过本发明内容所提供的解决方案可以实现区块链和互联网信息的快速互联互通,进一步发挥出区块链的巨大价值。In summary, the method, device and corresponding computer-readable storage medium provided by the present invention for searching for blockchain data can, on the one hand, search the cache for previously searched data to improve the performance of the blockchain data. Search efficiency, on the other hand, can make precise control of the data on the blockchain, achieve only access to publicly available data, and limit an internal mechanism and interface for access and retrieval, which not only allows external web links to directly link to the zone The public data in the blockchain can also link the public data in the blockchain. In addition, the solution provided by the present invention can realize the rapid interconnection and interconnection of the blockchain and Internet information, and further exert the great value of the blockchain.
图6示出了用于搜索区块链数据的设备600的示意性框图。应当理解,设备600可以实现为实现图2A中的用于搜索区块链数据的方法200的功能。从图6中可以看出用于搜索区块链数据的设备600包括中央处理单元(CPU)601(例如,处理器),其可以根据存储在只读存储器(ROM)602中的计算机程序指令或者从存储单元608加载到随机访问存储器(RAM)603中的计算机程序指令,来执行各种适当的动作和处理。在RAM 603中,还可存储该设备600操作所需的各种程序和数据。CPU 601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。FIG. 6 shows a schematic block diagram of a device 600 for searching blockchain data. It should be understood that the device 600 may be implemented to implement the functions of the method 200 for searching for blockchain data in FIG. 2A. It can be seen from FIG. 6 that 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. In the RAM 603, 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.
设备600中的多个部件连接至I/O接口605,包括:输入单元606,例如键盘、鼠标等;输出单元607,例如各种类型的显示器、扬声器等;存储单元608,例如磁盘、光盘等;以及通信单元609,例如网卡、调制解调器、无线通信收发机等。通信单元609允许该设备600通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Multiple components in the device 600 are connected to 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.
上文所描述的各种方法,例如用于搜索区块链数据的方法能够由CPU601执行。例如,在一些实施例中,用于搜索区块链数据的方法200可以实现为计算机软件程序,其有形地包含于机器可读介质,例如存储单元608。在一些实施例中,计算机程序的部分或者全部可以经由ROM 602和/或通信单元609而载入和/或安装到该设备600上。当计算机程序加载到RAM 603并由CPU 601执行时,可以执行上文描述的方法200中的一个或多个 动作或步骤。Various methods described above, such as methods for searching for blockchain data, can be executed by the CPU 601. For example, in some embodiments, 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. In some embodiments, 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. When a computer program is loaded into RAM 603 and executed by CPU 601, one or more actions or steps in method 200 described above may be performed.
一般而言,本发明的各种示例实施例可以在硬件或专用电路、软件、固件、逻辑,或其任何组合中实施。某些方面可以在硬件中实施,而其他方面可以在可以由控制器、微处理器或其他计算设备执行的固件或软件中实施。当本发明的实施例的各方面图示或描述为框图、流程图或使用某些其他图形表示时,将理解此处描述的方框、装置、系统、技术或方法可以作为非限制性的示例在硬件、软件、固件、专用电路或逻辑、通用硬件或控制器或其他计算设备,或其某些组合中实施。In general, 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. When 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.
应当注意,尽管在上文的详细描述中提及了设备的若干装置或子装置,但是这种划分仅仅是示例性而非强制性的。实际上,根据本发明的实施例,上文描述的两个或更多装置的特征和功能可以在一个装置中具体化。反之,上文描述的一个装置的特征和功能可以进一步划分为由多个装置来具体化。It should be noted that although several devices or sub-devices of the device are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of the two or more devices described above may be embodied in one device. Conversely, the features and functions of one device described above can be further divided into specificization by multiple devices.
以上所述仅为本发明的实施例可选实施例,并不用于限制本发明的实施例,对于本领域的技术人员来说,本发明的实施例可以有各种更改和变化。凡在本发明的实施例的精神和原则之内,所作的任何修改、等效替换、改进等,均应包含在本发明的实施例的保护范围之内。The above description is only an optional embodiment of the present invention, and is not intended to limit the embodiment of the present invention. For those skilled in the art, the embodiment of the present invention may have various modifications and changes. Any modification, equivalent replacement, and improvement made within the spirit and principle of the embodiments of the present invention shall be included in the protection scope of the embodiments of the present invention.
虽然已经参考若干具体实施例描述了本发明的实施例,但是应该理解,本发明的实施例并不限于所公开的具体实施例。本发明的实施例旨在涵盖在所附权利要求的精神和范围内所包括的各种修改和等同布置。所附权利要求的范围符合最宽泛的解释,从而包含所有这样的修改及等同结构和功能。Although the embodiments of the present invention have been described with reference to several specific embodiments, it should be understood that the embodiments of the present invention are not limited to the specific embodiments disclosed. The embodiments of the present invention are intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

Claims (29)

  1. 一种用于搜索区块链数据的方法,所述方法包括:A method for searching blockchain data, the method includes:
    A.经由超文本传输协议接口接收网页读取请求,所述网页读取请求包括第一统一资源定位地址和第一时间信息;A. receiving a webpage read request via a hypertext transfer protocol interface, where the webpage read request includes a first uniform resource location address and first time information;
    B.确定缓存中是否存在与所述第一统一资源定位地址相关联的索引,其中,所述缓存存储在预定时间段内检索过的一个或多个索引,每一个索引包括检索过的统一资源定位地址、与所述统一资源定位地址相关联的网页以及第二时间信息;B. Determine whether an index associated with the first uniform resource location address exists in the cache, wherein the cache stores one or more indexes retrieved within a predetermined period of time, each index including the retrieved uniform resource A positioning address, a webpage associated with the uniform resource positioning address, and second time information;
    C1.在所述缓存中存在与所述第一统一资源定位地址相关联的索引,并且在所述第一时间信息早于所述索引中的所述第二时间信息的情况下,经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页。C1. An index associated with the first uniform resource location address exists in the cache, and if the first time information is earlier than the second time information in the index, via the The hypertext transfer protocol interface returns a webpage associated with the first uniform resource location address.
  2. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, further comprising:
    C2.在所述缓存中存在与所述第一统一资源定位地址相关联的索引并且所述第一时间信息等于所述索引中的所述第二时间信息的情况下,经由所述超文本传输协议接口返回表示网页未修改的标识。C2. When an index associated with the first uniform resource location address exists in the cache and the first time information is equal to the second time information in the index, transmitted via the hypertext The protocol interface returns an identifier indicating that the web page has not been modified.
  3. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, further comprising:
    D11.基于每一个索引中存储的统一资源定位地址确定所述区块链中相应统一资源定位地址处的区块链数据;D11. Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index;
    D12.将所述区块链数据与所述索引中存储的网页所对应的数据进行比较以确定所述统一资源定位地址处的区块链数据是否更新;D12: comparing the blockchain data with data corresponding to a webpage stored in the index to determine whether the blockchain data at the uniform resource location address is updated;
    D13.在所述统一资源定位地址处的区块链数据被更新的情况下,在所述索引中将与所述统一资源定位地址相关联的网页更新为根据更新的区块链数据所生成的网页,并将所述第二时间信息更新为所述区块链数据的更新时间。D13. In the case where the blockchain data at the uniform resource location address is updated, the webpage associated with the uniform resource location address is updated in the index to be generated based on the updated blockchain data A webpage, and updates the second time information to the update time of the blockchain data.
  4. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, further comprising:
    D21.基于每一个索引中存储的统一资源定位地址确定所述区块链中相应统一资源定位地址处的区块链数据;D21. Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index;
    D22.将所述区块链数据的修改时间信息与所述索引中的第二时间信息进行比较以确定所述统一资源定位地址处的区块链数据是否更新;D22. Compare the modification time information of the blockchain data with the second time information in the index to determine whether the blockchain data at the uniform resource location address is updated;
    D23.在所述区块链数据的修改时间信息晚于所述索引中的第二时间信息的情况下,在所述索引中将与所述统一资源定位地址相关联的网页更新为根据更新的区块链数据所生成的网页,并将所述第二时间信息更新为所述区块链数据的更新时间。D23. In the case that the modification time information of the blockchain data is later than the second time information in the index, the webpage associated with the uniform resource location address is updated in the index to be based on the updated A webpage generated by the blockchain data, and updating the second time information to an update time of the blockchain data.
  5. 根据权利要求1所述的方法,其中,所述网页读取请求还包括表示允许返回差异网页的第一指示符,所述缓存中的每一个索引还包括一个或多个差异网页以及分别与每一个差异网页相对应的时间段信息,所述方法还包括:The method according to claim 1, wherein the webpage read request further comprises a first indicator indicating that a difference webpage is allowed to be returned, and each index in the cache further includes one or more difference webpages and a separate comparison with each The time period information corresponding to a difference webpage, the method further includes:
    E1.基于每一个索引中存储的统一资源定位地址确定所述区块链中相应统一资源定位地址处的区块链数据;E1. Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index;
    E2.将所述区块链数据与所述索引中存储的网页所对应的数据进行比较以确定所述统一资源定位地址处的区块链数据是否更新;E2. Compare the blockchain data with data corresponding to a webpage stored in the index to determine whether the blockchain data at the uniform resource location address is updated;
    E3.在所述索引中的所述统一资源定位地址处的区块链数据被更新的情况下,利用更新的区块链数据与所述索引中存储的网页所对应的数据之间的数据差异生成相应的差异网页,将所述第二时间信息以及区块链数据的更新时间一起作为与所述差异网页相对应的时间段信息;E3. When the blockchain data at the uniform resource location address in the index is updated, use the data difference between the updated blockchain data and the data corresponding to the webpage stored in the index Generating a corresponding difference webpage, and using the second time information and the update time of the blockchain data as the time period information corresponding to the difference webpage;
    E4.将与所述统一资源定位地址相关联的网页更新为根据更新的区块链数据所生成的网页,并将所述第二时间信息更新为所述区块链数据的更新时间。E4. Updating the webpage associated with the uniform resource location address to a webpage generated according to the updated blockchain data, and updating the second time information to the update time of the blockchain data.
  6. 根据权利要求5所述的方法,其中,在所述缓存中存在与所述第一统一资源定位地址相关联的索引并且所述第一时间信息早于所述索引中的所述第二时间信息的情况下,所述方法还包括:The method according to claim 5, wherein an index associated with the first uniform resource location address exists in the cache and the first time information is earlier than the second time information in the index In the case, the method further includes:
    F1.确定所接收的网页读取请求中是否存在第一指示符;F1. Determine whether a first indicator exists in the received webpage reading request;
    F2.在接收的网页读取请求中存在第一指示符的情况下,基于所述第一时间信息与所述第二时间信息之间的时间差量以确定所述缓存中存在与所述时间差量相对应的一个或多个所述差异网页时,经由所述超文本传输协议接口返回与所述时间差量相对应的一个或多个所述差异网页。F2. In the case where the first indicator exists in the received webpage read request, based on the time difference between the first time information and the second time information, it is determined that the time difference exists in the cache and the time difference When the corresponding one or more difference webpages are returned, one or more of the difference webpages corresponding to the time difference are returned via the hypertext transfer protocol interface.
  7. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, further comprising:
    C31.在所述缓存中不存在与所述第一统一资源定位地址相关联的索引的情况下,获取在所述第一统一资源定位地址处的第一区块链数据;C31. When there is no index associated with the first uniform resource location address in the cache, obtain first blockchain data at the first uniform resource location address;
    C32.判断是否存在至少一个第二统一资源定位地址,其中,在所述至 少一个第二统一资源定位地址处的第二区块链数据与所述第一区块链数据相关联;C32. Determine whether there is at least one second uniform resource location address, wherein the second blockchain data at the at least one second uniform resource location address is associated with the first blockchain data;
    C33.在存在所述至少一个第二统一资源定位地址的情况下,根据所述第一区块链数据和所述至少一个第二统一资源定位地址生成与所述第一统一资源定位地址相关联的网页;以及C33. In the case where the at least one second uniform resource location address exists, generating the association with the first uniform resource location address according to the first blockchain data and the at least one second uniform resource location address Web pages; and
    C34.经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页。C34. A webpage associated with the first uniform resource location address is returned via the hypertext transfer protocol interface.
  8. 根据权利要求7所述的方法,其中,在所述步骤C34中经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页之后,所述方法还包括:The method according to claim 7, wherein after returning a webpage associated with the first uniform resource location address via the hypertext transfer protocol interface in the step C34, the method further comprises:
    C35.将所述第一统一资源定位地址、与所述第一统一资源定位地址相关联的网页以及所述第二时间信息作为索引存储在所述缓存中。C35. The first uniform resource location address, a webpage associated with the first uniform resource location address, and the second time information are stored in the cache as an index.
  9. 根据权利要求7所述的方法,其中,所述方法还包括:The method according to claim 7, wherein the method further comprises:
    在不存在所述至少一个第二统一资源定位地址的情况下,根据所述第一区块链数据生成与所述第一统一资源定位地址相关联的网页。When the at least one second uniform resource location address does not exist, a webpage associated with the first uniform resource location address is generated according to the first blockchain data.
  10. 根据权利要求7所述的方法,其中,所述步骤C32中判断是否存在至少一个第二统一资源定位地址进一步包括:The method according to claim 7, wherein determining whether there is at least one second uniform resource location address in step C32 further comprises:
    根据所述第一区块链数据所包括的层次属性和预先确定的层次关系树来判断是否存在所述至少一个第二统一资源定位地址。Determining whether the at least one second uniform resource location address exists according to a hierarchical attribute included in the first blockchain data and a predetermined hierarchical relationship tree.
  11. 根据权利要求7所述的方法,其中,所述步骤C31中获取在所述第一统一资源定位地址处的第一区块链数据进一步包括:The method according to claim 7, wherein obtaining the first blockchain data at the first uniform resource location address in step C31 further comprises:
    根据所述第一区块链数据的账本存储位置来确定是否获取在所述第一统一资源定位地址处的第一区块链数据,Determining whether to obtain the first blockchain data at the first uniform resource location address according to the ledger storage location of the first blockchain data,
    其中,在所述第一区块链数据或所述第二区块链数据为公开数据的情况下,所述第一区块链数据或所述第二区块链数据存储在公开账本中;以及在所述第一区块链数据或所述第二区块链数据为隐私数据的情况下,所述第一区块链数据或所述第二区块链数据存储在隐私账本中;Wherein, in a case where the first blockchain data or the second blockchain data is public data, the first blockchain data or the second blockchain data is stored in a public ledger; And in a case where the first blockchain data or the second blockchain data is private data, the first blockchain data or the second blockchain data is stored in a privacy ledger;
    在所述第一区块链数据存储在所述公开账本中的情况下,获取在所述第一统一资源定位地址处的第一区块链数据。In a case where the first blockchain data is stored in the public ledger, the first blockchain data at the first uniform resource location address is acquired.
  12. 根据权利要求7所述的方法,其中,所述步骤C31中获取在所述第一统一资源定位地址处的第一区块链数据进一步包括:The method according to claim 7, wherein obtaining the first blockchain data at the first uniform resource location address in step C31 further comprises:
    根据所述第一区块链数据的存储区域位置来确定是否获取在所述第一统一资源定位地址处的第一区块链数据,Determining whether to obtain the first blockchain data at the first uniform resource location address according to the storage area location of the first blockchain data,
    其中,在所述第一区块链数据或所述第二区块链数据为公开数据的情况下,所述第一区块链数据或所述第二区块链数据存储在账本的公开区域中;以及在所述第一区块链数据或所述第二区块链数据为隐私数据的情况下,所述第一区块链数据或所述第二区块链数据存储在账本的隐私区域中;Wherein, in a case where the first blockchain data or the second blockchain data is public data, the first blockchain data or the second blockchain data is stored in a public area of a ledger Medium; and in the case where the first blockchain data or the second blockchain data is privacy data, the first blockchain data or the second blockchain data is stored in the privacy of the ledger Area
    在所述第一区块链数据存储在所述账本的公开区域中的情况下,获取在所述第一统一资源定位地址处的第一区块链数据。In a case where the first blockchain data is stored in a public area of the ledger, the first blockchain data at the first uniform resource location address is acquired.
  13. 根据权利要求7所述的方法,其中,所述第一区块链数据和/或所述第二区块链数据包括第一属性,并且其中,所述步骤C31中获取在所述第一统一资源定位地址处的第一区块链数据进一步包括:The method according to claim 7, wherein the first blockchain data and / or the second blockchain data includes a first attribute, and wherein in step C31, the first unified The first blockchain data at the resource location address further includes:
    在所述第一区块链数据的第一属性表明所述第一区块链数据为公开数据的情况下,获取在所述第一统一资源定位地址处的第一区块链数据。When the first attribute of the first blockchain data indicates that the first blockchain data is public data, the first blockchain data at the first uniform resource location address is obtained.
  14. 根据权利要求1至13中任一项所述的方法,其中,在所述区块链的搜索节点中设置所述缓存,使得所述搜索节点能够执行根据权利要求1至13中任一项所述的用于搜索区块链数据的方法。The method according to any one of claims 1 to 13, wherein the cache is set in a search node of the blockchain so that the search node can execute The method described above for searching blockchain data.
  15. 一种用于搜索区块链数据的设备,所述设备包括:A device for searching blockchain data, the device includes:
    处理器;以及Processor; and
    存储器,其用于存储指令,当所述指令执行时使得所述处理器执行以下操作:A memory for storing instructions that, when executed, cause the processor to perform the following operations:
    A.经由超文本传输协议接口接收网页读取请求,所述网页读取请求包括第一统一资源定位地址和第一时间信息;A. receiving a webpage read request via a hypertext transfer protocol interface, where the webpage read request includes a first uniform resource location address and first time information;
    B.确定缓存中是否存在与所述第一统一资源定位地址相关联的索引,其中,所述缓存存储在预定时间段内检索过的一个或多个索引,每一个索引包括检索过的统一资源定位地址、与所述统一资源定位地址相关联的网页以及第二时间信息;B. Determine whether an index associated with the first uniform resource location address exists in the cache, wherein the cache stores one or more indexes retrieved within a predetermined period of time, each index including the retrieved uniform resource A positioning address, a webpage associated with the uniform resource positioning address, and second time information;
    C1.在所述缓存中存在与所述第一统一资源定位地址相关联的索引,并且在所述第一时间信息早于所述索引中的所述第二时间信息的情况下,经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页。C1. An index associated with the first uniform resource location address exists in the cache, and if the first time information is earlier than the second time information in the index, via the The hypertext transfer protocol interface returns a webpage associated with the first uniform resource location address.
  16. 根据权利要求15所述的设备,其中,所述指令执行时还使得所述 处理器执行以下操作:The device according to claim 15, wherein the execution of the instructions further causes the processor to perform the following operations:
    C2.在所述缓存中存在与所述第一统一资源定位地址相关联的索引并且所述第一时间信息等于所述索引中的所述第二时间信息的情况下,经由所述超文本传输协议接口返回表示网页未修改的标识。C2. When an index associated with the first uniform resource location address exists in the cache and the first time information is equal to the second time information in the index, transmitted via the hypertext The protocol interface returns an identifier indicating that the web page has not been modified.
  17. 根据权利要求15所述的设备,其中,所述指令执行时还使得所述处理器执行以下操作:The device according to claim 15, wherein the execution of the instructions further causes the processor to perform the following operations:
    D11.基于每一个索引中存储的统一资源定位地址确定所述区块链中相应统一资源定位地址处的区块链数据;D11. Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index;
    D12.将所述区块链数据与所述索引中存储的网页所对应的数据进行比较以确定所述统一资源定位地址处的区块链数据是否更新;D12: comparing the blockchain data with data corresponding to a webpage stored in the index to determine whether the blockchain data at the uniform resource location address is updated;
    D13.在所述统一资源定位地址处的区块链数据被更新的情况下,在所述索引中将与所述统一资源定位地址相关联的网页更新为根据更新的区块链数据所生成的网页,并将所述第二时间信息更新为所述区块链数据的更新时间。D13. In the case where the blockchain data at the uniform resource location address is updated, the webpage associated with the uniform resource location address is updated in the index to be generated based on the updated blockchain data A webpage, and updates the second time information to the update time of the blockchain data.
  18. 根据权利要求15所述的设备,其中,所述指令执行时还使得所述处理器执行以下操作:The device according to claim 15, wherein the execution of the instructions further causes the processor to perform the following operations:
    D21.基于每一个索引中存储的统一资源定位地址确定所述区块链中相应统一资源定位地址处的区块链数据;D21. Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index;
    D22.将所述区块链数据的修改时间信息与所述索引中的第二时间信息进行比较以确定所述统一资源定位地址处的区块链数据是否更新;D22. Compare the modification time information of the blockchain data with the second time information in the index to determine whether the blockchain data at the uniform resource location address is updated;
    D23.在所述区块链数据的修改时间信息晚于所述索引中的第二时间信息的情况下,在所述索引中将与所述统一资源定位地址相关联的网页更新为根据更新的区块链数据所生成的网页,并将所述第二时间信息更新为所述区块链数据的更新时间。D23. In the case that the modification time information of the blockchain data is later than the second time information in the index, the webpage associated with the uniform resource location address is updated in the index to be based on the updated A webpage generated by the blockchain data, and updating the second time information to an update time of the blockchain data.
  19. 根据权利要求15所述的设备,其中,所述网页读取请求还包括表示允许返回差异网页的第一指示符,所述缓存中的每一个索引还包括一个或多个差异网页以及与分别每一个差异网页相对应的时间段信息,所述指令执行时还使得所述处理器执行以下操作:The device according to claim 15, wherein the webpage read request further comprises a first indicator indicating that a difference webpage is allowed to be returned, and each index in the cache further includes one or more difference webpages and a connection with each The time period information corresponding to a difference webpage, when the instruction is executed, also causes the processor to perform the following operations:
    E1.基于每一个索引中存储的统一资源定位地址确定所述区块链中相应统一资源定位地址处的区块链数据;E1. Determine the blockchain data at the corresponding unified resource location address in the blockchain based on the unified resource location address stored in each index;
    E2.将所述区块链数据与所述索引中存储的网页所对应的数据进行比 较以确定所述统一资源定位地址处的区块链数据是否更新;E2. Comparing the blockchain data with data corresponding to a webpage stored in the index to determine whether the blockchain data at the uniform resource location address is updated;
    E3.在所述索引中的所述统一资源定位地址处的区块链数据被更新的情况下,利用更新的区块链数据与所述索引中存储的网页所对应的数据之间的数据差异生成相应的差异网页,将所述第二时间信息以及区块链数据的更新时间一起作为与所述差异网页相对应的时间段信息;E3. When the blockchain data at the uniform resource location address in the index is updated, use the data difference between the updated blockchain data and the data corresponding to the webpage stored in the index Generating a corresponding difference webpage, and using the second time information and the update time of the blockchain data as the time period information corresponding to the difference webpage;
    E4.将与所述统一资源定位地址相关联的网页更新为根据更新的区块链数据所生成的网页,并将所述第二时间信息更新为所述区块链数据的更新时间。E4. Updating the webpage associated with the uniform resource location address to a webpage generated according to the updated blockchain data, and updating the second time information to the update time of the blockchain data.
  20. 根据权利要求19所述的设备,其中,在所述缓存中存在与所述第一统一资源定位地址相关联的索引并且所述第一时间信息早于所述索引中的所述第二时间信息的情况下,所述指令执行时还使得所述处理器执行以下操作:The device according to claim 19, wherein an index associated with the first uniform resource location address exists in the cache and the first time information is earlier than the second time information in the index In the case of execution, the instruction further causes the processor to perform the following operations:
    F1.确定所接收的网页读取请求中是否存在第一指示符;F1. Determine whether a first indicator exists in the received webpage reading request;
    F2.在接收的网页读取请求中存在第一指示符的情况下,基于所述第一时间信息与所述第二时间信息之间的时间差量以确定所述缓存中存在与所述时间差量相对应的一个或多个所述差异网页时,经由所述超文本传输协议接口返回与所述时间差量相对应的一个或多个所述差异网页。F2. In the case where the first indicator exists in the received webpage read request, based on the time difference between the first time information and the second time information, it is determined that the time difference exists in the cache and the time difference When the corresponding one or more difference webpages are returned, one or more of the difference webpages corresponding to the time difference are returned via the hypertext transfer protocol interface.
  21. 根据权利要求15所述的设备,其中,所述指令执行时还使得所述处理器执行以下操作:The device according to claim 15, wherein the execution of the instructions further causes the processor to perform the following operations:
    C31.在所述缓存中不存在与所述第一统一资源定位地址相关联的索引的情况下,获取在所述第一统一资源定位地址处的第一区块链数据;C31. When there is no index associated with the first uniform resource location address in the cache, obtain first blockchain data at the first uniform resource location address;
    C32.判断是否存在至少一个第二统一资源定位地址,其中,在所述至少一个第二统一资源定位地址处的第二区块链数据与所述第一区块链数据相关联;C32. Determine whether there is at least one second uniform resource location address, wherein the second blockchain data at the at least one second uniform resource location address is associated with the first blockchain data;
    C33.在存在所述至少一个第二统一资源定位地址的情况下,根据所述第一区块链数据和所述至少一个第二统一资源定位地址生成与所述第一统一资源定位地址相关联的网页;以及C33. In the case where the at least one second uniform resource location address exists, generating the association with the first uniform resource location address according to the first blockchain data and the at least one second uniform resource location address Web pages; and
    C34.经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页。C34. A webpage associated with the first uniform resource location address is returned via the hypertext transfer protocol interface.
  22. 根据权利要求21所述的设备,其中,在所述步骤C34中经由所述超文本传输协议接口返回与所述第一统一资源定位地址相关联的网页之 后,所述指令执行时还使得所述处理器执行以下操作:The device according to claim 21, wherein after returning a web page associated with the first uniform resource location address via the hypertext transfer protocol interface in the step C34, the instruction further causes the The processor does the following:
    C35.将所述第一统一资源定位地址、与所述第一统一资源定位地址相关联的网页以及所述第二时间信息作为索引存储在所述缓存中。C35. The first uniform resource location address, a webpage associated with the first uniform resource location address, and the second time information are stored in the cache as an index.
  23. 根据权利要求21所述的设备,其中,所述指令执行时还使得所述处理器执行以下操作:The device according to claim 21, wherein the execution of the instructions further causes the processor to perform the following operations:
    在不存在所述至少一个第二统一资源定位地址的情况下,根据所述第一区块链数据生成与所述第一统一资源定位地址相关联的网页。When the at least one second uniform resource location address does not exist, a webpage associated with the first uniform resource location address is generated according to the first blockchain data.
  24. 根据权利要求21所述的设备,其中,所述步骤C32中判断是否存在至少一个第二统一资源定位地址进一步包括:The device according to claim 21, wherein determining in step C32 whether there is at least one second uniform resource location address further comprises:
    根据所述第一区块链数据所包括的层次属性和预先确定的层次关系树来判断是否存在所述至少一个第二统一资源定位地址。Determining whether the at least one second uniform resource location address exists according to a hierarchical attribute included in the first blockchain data and a predetermined hierarchical relationship tree.
  25. 根据权利要求21所述的设备,其中,所述步骤C31中获取在所述第一统一资源定位地址处的第一区块链数据进一步包括:The device according to claim 21, wherein the acquiring the first blockchain data at the first uniform resource location address in step C31 further comprises:
    根据所述第一区块链数据的账本存储位置来确定是否获取在所述第一统一资源定位地址处的第一区块链数据,Determining whether to obtain the first blockchain data at the first uniform resource location address according to the ledger storage location of the first blockchain data,
    其中,在所述第一区块链数据或所述第二区块链数据为公开数据的情况下,所述第一区块链数据或所述第二区块链数据存储在公开账本中;以及在所述第一区块链数据或所述第二区块链数据为隐私数据的情况下,所述第一区块链数据或所述第二区块链数据存储在隐私账本中;Wherein, in a case where the first blockchain data or the second blockchain data is public data, the first blockchain data or the second blockchain data is stored in a public ledger; And in a case where the first blockchain data or the second blockchain data is private data, the first blockchain data or the second blockchain data is stored in a privacy ledger;
    在所述第一区块链数据存储在所述公开账本中的情况下,获取在所述第一统一资源定位地址处的第一区块链数据。In a case where the first blockchain data is stored in the public ledger, the first blockchain data at the first uniform resource location address is acquired.
  26. 根据权利要求21所述的设备,其中,所述步骤C31中获取在所述第一统一资源定位地址处的第一区块链数据进一步包括:The device according to claim 21, wherein the acquiring the first blockchain data at the first uniform resource location address in step C31 further comprises:
    根据所述第一区块链数据的存储区域位置来确定是否获取在所述第一统一资源定位地址处的第一区块链数据,Determining whether to obtain the first blockchain data at the first uniform resource location address according to the storage area location of the first blockchain data,
    其中,在所述第一区块链数据或所述第二区块链数据为公开数据的情况下,所述第一区块链数据或所述第二区块链数据存储在账本的公开区域中;以及在所述第一区块链数据或所述第二区块链数据为隐私数据的情况下,所述第一区块链数据或所述第二区块链数据存储在账本的隐私区域中;Wherein, in a case where the first blockchain data or the second blockchain data is public data, the first blockchain data or the second blockchain data is stored in a public area of a ledger Medium; and in the case where the first blockchain data or the second blockchain data is privacy data, the first blockchain data or the second blockchain data is stored in the privacy of the ledger Area
    在所述第一区块链数据存储在所述账本的公开区域中的情况下,获取在所述第一统一资源定位地址处的第一区块链数据。In a case where the first blockchain data is stored in a public area of the ledger, the first blockchain data at the first uniform resource location address is acquired.
  27. 根据权利要求21所述的设备,其中,所述第一区块链数据和/或所述第二区块链数据包括第一属性,并且其中,所述步骤C31中获取在所述第一统一资源定位地址处的第一区块链数据进一步包括:The device according to claim 21, wherein the first blockchain data and / or the second blockchain data includes a first attribute, and wherein in step C31, the first unified The first blockchain data at the resource location address further includes:
    在所述第一区块链数据的第一属性表明所述第一区块链数据为公开数据的情况下,获取在所述第一统一资源定位地址处的第一区块链数据。When the first attribute of the first blockchain data indicates that the first blockchain data is public data, the first blockchain data at the first uniform resource location address is obtained.
  28. 根据权利要求15至27中任一项所述的设备,其中,所述设备设置在所述区块链的搜索节点中,并且所述搜索节点包括所述缓存,使得所述搜索节点能够实现根据权利要求15至27中任一项所述的用于搜索区块链数据的设备的操作。The device according to any one of claims 15 to 27, wherein the device is provided in a search node of the blockchain, and the search node includes the cache, so that the search node can implement Operation of the device for searching blockchain data according to any one of claims 15 to 27.
  29. 一种计算机可读存储介质,其具有存储在其上的计算机可读程序指令,所述计算机可读程序指令用于执行根据权利要求1至14中任一项所述的用于搜索区块链数据的方法。A computer-readable storage medium having computer-readable program instructions stored thereon, the computer-readable program instructions for executing the method for searching a blockchain according to any one of claims 1 to 14. Data methods.
PCT/CN2019/098186 2018-08-03 2019-07-29 Method and device for searching for blockchain data, and computer readable storage medium WO2020024903A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810878351.0A CN109145188A (en) 2018-08-03 2018-08-03 For searching for the method, equipment and computer readable storage medium of block chain data
CN201810878351.0 2018-08-03

Publications (1)

Publication Number Publication Date
WO2020024903A1 true WO2020024903A1 (en) 2020-02-06

Family

ID=64791677

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/098186 WO2020024903A1 (en) 2018-08-03 2019-07-29 Method and device for searching for blockchain data, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN109145188A (en)
WO (1) WO2020024903A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021048663A1 (en) * 2019-09-12 2021-03-18 nChain Holdings Limited Sharing data via transactions of a blockchain

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109145188A (en) * 2018-08-03 2019-01-04 上海点融信息科技有限责任公司 For searching for the method, equipment and computer readable storage medium of block chain data
CN109885794B (en) * 2019-01-24 2020-10-20 曲阜师范大学 Processing method for circularly and synchronously updating webpage based on block chain
CN110008738B (en) * 2019-02-21 2021-06-25 网易(杭州)网络有限公司 Caching method, device, medium and computing equipment for block chain contract data
CN111159289B (en) * 2019-12-17 2024-03-01 深圳前海微众银行股份有限公司 Method and device for synchronizing blocks
EP3834157B1 (en) 2020-04-22 2023-09-13 Alipay (Hangzhou) Information Technology Co., Ltd. Managing transaction requests in ledger systems
EP3841549B1 (en) * 2020-04-22 2022-10-26 Alipay (Hangzhou) Information Technology Co., Ltd. Managing transaction requests in ledger systems

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273556A (en) * 2017-08-23 2017-10-20 上海点融信息科技有限责任公司 Block chain data index method and equipment
CN107943893A (en) * 2017-11-16 2018-04-20 北京奇安信科技有限公司 A kind of search processing method and device based on internet
US20180137196A1 (en) * 2016-11-11 2018-05-17 International Business Machines Corporation Trustable web searching verification in a blockchain
CN109145188A (en) * 2018-08-03 2019-01-04 上海点融信息科技有限责任公司 For searching for the method, equipment and computer readable storage medium of block chain data

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6931598B2 (en) * 2001-03-30 2005-08-16 Intel Corporation Dynamic web list display
CN102087664A (en) * 2011-01-27 2011-06-08 深圳市五巨科技有限公司 Optimizing method of mobile terminal access network, system and mobile terminal
CN103714078A (en) * 2012-09-29 2014-04-09 百度在线网络技术(北京)有限公司 Method, system and device for providing update contents of web pages
CN104133852B (en) * 2014-07-04 2018-03-16 小米科技有限责任公司 Web access method, device, server and terminal
CN108062413B (en) * 2017-12-30 2019-05-28 平安科技(深圳)有限公司 Web data processing method, device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180137196A1 (en) * 2016-11-11 2018-05-17 International Business Machines Corporation Trustable web searching verification in a blockchain
CN107273556A (en) * 2017-08-23 2017-10-20 上海点融信息科技有限责任公司 Block chain data index method and equipment
CN107943893A (en) * 2017-11-16 2018-04-20 北京奇安信科技有限公司 A kind of search processing method and device based on internet
CN109145188A (en) * 2018-08-03 2019-01-04 上海点融信息科技有限责任公司 For searching for the method, equipment and computer readable storage medium of block chain data

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021048663A1 (en) * 2019-09-12 2021-03-18 nChain Holdings Limited Sharing data via transactions of a blockchain
US20220342951A1 (en) * 2019-09-12 2022-10-27 nChain Holdings Limited Sharing Data Via Transactions of a Blockchain
US11893074B2 (en) 2019-09-12 2024-02-06 Nchain Licensing Ag Sharing data via transactions of a blockchain

Also Published As

Publication number Publication date
CN109145188A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
WO2020024903A1 (en) Method and device for searching for blockchain data, and computer readable storage medium
JP6669892B2 (en) Versioned hierarchical data structure for distributed data stores
US10558656B2 (en) Optimizing write operations in object schema-based application programming interfaces (APIS)
CA3025493C (en) Optimizing read and write operations in object schema-based application programming interfaces (apis)
US10108645B1 (en) Database monitoring for online migration optimization
US9158843B1 (en) Addressing mechanism for data at world wide scale
RU2383920C2 (en) System and method for client-supported search using web-agent
WO2020024904A1 (en) Method and device for searching blockchain data, and readable storage medium
CN103890709B (en) Key value database based on caching maps and replicates
CN109145205A (en) A kind of across chain data manipulation method and device based on block chain
US20180276304A1 (en) Advanced computer implementation for crawling and/or detecting related electronically catalogued data using improved metadata processing
WO2020024895A1 (en) Method and apparatus for searching blockchain data, and storage medium
WO2020024908A1 (en) Method and device for data searching on blockchain-as-a-service platform, and storage medium
CN109033406B (en) Method, apparatus and storage medium for searching blockchain data
US10936559B1 (en) Strongly-consistent secondary index for a distributed data set
US10503923B1 (en) Centralized data store for multiple data processing environments
JP2006107446A (en) Batch indexing system and method for network document
WO2020024898A1 (en) Method and apparatus for searching blockchain data, and storage medium
US20220229657A1 (en) Extensible resource compliance management
CN112231598B (en) Webpage path navigation method and device, electronic equipment and storage medium
US20140019454A1 (en) Systems and Methods for Caching Data Object Identifiers
JP2020201935A (en) API access based on privacy reliability
CN112925954A (en) Method and apparatus for querying data in a graph database
CN109086414B (en) Method, apparatus and storage medium for searching blockchain data
KR20190138037A (en) An information retrieval system using knowledge base of cyber security and the method thereof

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: 19844757

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: 19844757

Country of ref document: EP

Kind code of ref document: A1