WO2021129062A1 - Data query method, apparatus, device and system, and medium - Google Patents

Data query method, apparatus, device and system, and medium Download PDF

Info

Publication number
WO2021129062A1
WO2021129062A1 PCT/CN2020/121086 CN2020121086W WO2021129062A1 WO 2021129062 A1 WO2021129062 A1 WO 2021129062A1 CN 2020121086 W CN2020121086 W CN 2020121086W WO 2021129062 A1 WO2021129062 A1 WO 2021129062A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
blockchain
storage space
index information
query
Prior art date
Application number
PCT/CN2020/121086
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 WO2021129062A1 publication Critical patent/WO2021129062A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries

Definitions

  • This application relates to the field of data query technology, and in particular to a data query method, device, equipment, system and medium.
  • a data query platform may be connected to multiple blockchain systems, and different data of the same attribute may be stored in the blockchains of different blockchain systems.
  • the data query platform receives the data query request.
  • cross-blockchain query that is, to traverse different blockchains for iterative query, which makes the data query process more cumbersome and the efficiency of data query is low.
  • the embodiments of the present application provide a data query method, device, equipment, system, and medium, which can improve the efficiency of data query.
  • an embodiment of the present application provides a data query method, which includes:
  • the first storage space that matches the first index information is queried; among them, one storage space corresponds to one blockchain, and each blockchain The data stored in is different;
  • an embodiment of the present application provides a data query device, which includes:
  • the request receiving module is configured to receive a data query request; wherein, the data query request includes first index information;
  • the space query module is used to query the first storage space that matches the first index information in the multiple storage spaces of the Bloom filter in response to the data query request; among them, one storage space corresponds to one blockchain , The data stored in each blockchain is different;
  • the data query module is used to query the first data corresponding to the first index information in the first blockchain corresponding to the first storage space.
  • an embodiment of the present application provides a data query device, which includes: a processor and a memory storing computer program instructions;
  • an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored on the computer-readable storage medium, and when the computer program instructions are executed by a processor, the data query method as described in the first aspect is implemented .
  • an embodiment of the present application provides a data query system, including:
  • each blockchain system has a blockchain, and the data stored in each blockchain is different;
  • a data query device for receiving a data query request; wherein the data query request includes the first index information; in response to the data query request, in the multiple storage spaces of the Bloom filter, the first index information matching the first index information is queried A storage space; where one storage space corresponds to a block chain; in the first block chain corresponding to the first storage space, the first data corresponding to the first index information is queried.
  • the data query method, device, device, system, and medium of the embodiments of the present application can query and query data in multiple storage spaces of the Bloom filter according to the first index information in the data query request after receiving the data query request.
  • the first storage space that matches the first index information can be quickly located according to the first storage space to the first blockchain where the first data to be queried is stored, and directly in the first storage space corresponding to the first storage space.
  • the first data is queried in one block chain.
  • there is no need to traverse different block chains for iterative query which simplifies the process of data query and improves the efficiency of data query.
  • the data stored in the Bloom filter is an attribute value with no practical significance, the privacy of the data will not be leaked, and the security of data storage and data query is improved.
  • Figure 1 is a system architecture diagram of a data query system in related technologies
  • FIG. 2 is a schematic flowchart of an embodiment of the data query method of the present application
  • Fig. 3 is a schematic diagram of an example of a storage space query process according to an embodiment of the present application.
  • Fig. 4 is a schematic diagram of an example of a Bloom filter update process according to an embodiment of the present application.
  • Figure 5 is a schematic structural diagram of an embodiment of the data query device of the present application.
  • Fig. 6 is a schematic diagram of the hardware structure of an embodiment of the data query device of the present application.
  • a data query platform may be connected to multiple blockchain systems, and different data of the same attribute may be stored in the blockchains of different blockchain systems.
  • Figure 1 shows a system architecture diagram of a data query system in related technologies.
  • the data query system includes a user equipment 110, a server 120 of a data query platform, and multiple blockchain systems 130.
  • each block chain system 130 is respectively provided with a block chain, and each block chain stores different data with the same attribute.
  • the server 120 can be connected to each blockchain system 130 respectively.
  • a data query application corresponding to the data query platform is installed on the user equipment 110.
  • the user can initiate a data query through the data query application, so that the user equipment 110 generates a data query request, and sends the data query request to the server 120.
  • the server 120 can respond to the data query request to perform cross-regional operations.
  • Block chain query is to sequentially traverse different block chains to query the data corresponding to the data query request, which makes the process of data query more cumbersome and the efficiency of data query is low.
  • embodiments of the present application provide a data query method, device, equipment, system, and medium. The following first introduces the data query method provided by the embodiment of the present application.
  • Fig. 2 shows a schematic flowchart of an embodiment of the data query method of the present application.
  • the method shown in FIG. 2 may be executed by an electronic device or a server.
  • the electronic device may be the user equipment 110 shown in FIG. 1
  • the server may be the server 120 shown in FIG. 1.
  • the server may be a high-performance electronic calculator for storing and processing data; electronic devices include, but are not limited to, mobile phones, tablet computers, notebook computers, palmtop computers, vehicle-mounted terminals, wearable devices, and Pedometer, etc.
  • the data query method may include:
  • S210 Receive a data query request; where the data query request includes first index information;
  • S230 Query the first data corresponding to the first index information in the first blockchain corresponding to the first storage space.
  • the multiple storage spaces of the Bloom filter can be queried for the first storage that matches the first index information.
  • Space it is possible to quickly locate the first block chain stored in the first data that needs to be queried according to the first storage space, and directly query the first data in the first block chain corresponding to the first storage space.
  • querying data there is no need to traverse different blockchains for iterative query, which simplifies the process of data query and improves the efficiency of data query.
  • the data stored in the Bloom filter is an attribute value with no practical significance, the privacy of the data will not be leaked, and the security of data storage and data query is improved.
  • the received data query request is a data query request input by the user, for example, electronic The data query request input by the user received by the device through the data query application.
  • the electronic device stores the Bloom filter.
  • the Bloom filter For the Bloom filter, if the Bloom filter has m storage spaces, and each storage space can store x bytes of attribute values, the total storage capacity of the Bloom filter is m*x bytes, which can be seen , The total storage capacity of the Bloom filter is relatively low, only a small amount of storage resources of the electronic device will be occupied, and the data processing efficiency of the electronic device will not be affected.
  • the specific method of S230 may be:
  • the first data corresponding to the first index information is queried.
  • the electronic device when the electronic device uses its own stored Bloom filter to find the first storage space that matches the first index information in the data query request, if it is opposite to the first storage space If the first blockchain system to which the first blockchain belongs does not have a first gateway node, the electronic device can directly use any first blockchain node in the first blockchain system, from the first block chain The data stored in the first blockchain is downloaded in the chain, and then, among the acquired data, the first data corresponding to the first index information is queried.
  • the electronic device can directly use the first blockchain queried based on the first index information to query the first data, which improves the efficiency of data query.
  • the specific method of S230 may also be:
  • a block chain system the first block chain system is a block chain system with the first block chain;
  • the electronic device when the electronic device uses its own stored Bloom filter to find the first storage space that matches the first index information in the data query request, if it is opposite to the first storage space If the first blockchain system to which the first blockchain belongs has a first gateway node, the electronic device can send a data query request to the first gateway node, so that the first gateway node responds to the data query request, To query the first data corresponding to the first index information in the blockchain, the electronic device only needs to receive the first data fed back by the first gateway node, which can reduce the amount of data processing of the electronic device and further reduce the resources of the electronic device Occupied.
  • the received data query request is a data query request sent by the target device.
  • the specific method of S210 may be: receiving a data query request sent by the target device, where the data query request may be a query request for querying the first data based on the first index information.
  • bloom filters are stored in the server.
  • the Bloom filter if the Bloom filter has m storage spaces, and each storage space can store x bytes of attribute values, the total storage capacity of the Bloom filter is m*x bytes, which can be seen , The total storage capacity of Bloom filter is low, only a small amount of storage resources of the server will be occupied, and the data processing efficiency of the server will not be affected.
  • the target device may be an electronic device installed with a data query application corresponding to the data query platform.
  • the target device may also be a server of another application platform.
  • the electronic device has an application program corresponding to another application platform installed, and the other application The platform can interface with the data query platform in terms of data query functions.
  • the specific method of S230 may be:
  • the first data corresponding to the first index information is queried.
  • the server when the server uses its own stored Bloom filter to find the first storage space that matches the first index information in the data query request, if the first storage space is relative to the first storage space If the first blockchain system to which the first blockchain belongs does not have a first gateway node, the server can directly use any of the first blockchain nodes in the first blockchain system, from the first blockchain Download the data stored in the first block chain, and then, in the acquired data, query the first data corresponding to the first index information.
  • the specific method of S230 may be:
  • a block chain system the first block chain system is a block chain system with the first block chain;
  • the server when the server uses its own stored Bloom filter to find the first storage space that matches the first index information in the data query request, if the first storage space is relative to the first storage space If the first blockchain system to which the first blockchain belongs has a first gateway node, the server can send a data query request to the first gateway node, so that the first gateway node responds to the data query request in the first block To query the first data corresponding to the first index information in the chain, the server only needs to receive the first data fed back by the first gateway node, which can reduce the data processing volume of the server and further reduce the resource occupation of the server.
  • the data query method may further include:
  • the server can quickly query the first data for the target device based on the first index information in response to the data query request sent by the target device, and feed back the found first data to the target device, so that the user can pass
  • the target device implements a recursive query on the first data.
  • the received data query request is a data query request sent by the target device.
  • the specific method of S210 may be: receiving a data query request sent by the target device, where the data query request may be a query request for querying the first blockchain to which the first data belongs based on the first index information.
  • bloom filters are stored in the server.
  • the Bloom filter if the Bloom filter has m storage spaces, and each storage space can store x bytes of attribute values, the total storage capacity of the Bloom filter is m*x bytes, which can be seen , The total storage capacity of Bloom filter is low, only a small amount of storage resources of the server will be occupied, and the data processing efficiency of the server will not be affected.
  • the target device may be an electronic device installed with a data query application corresponding to the data query platform.
  • the target device may also be a server of another application platform.
  • the electronic device has an application program corresponding to another application platform installed, and the other application The platform can interface with the data query platform in terms of data query functions.
  • the specific method of S230 may be:
  • the query instruction information is used to indicate the first blockchain corresponding to the first storage space, so that the target device can query the first blockchain in the first blockchain according to the query instruction information.
  • the corresponding first data is used to indicate the first blockchain corresponding to the first storage space, so that the target device can query the first blockchain in the first blockchain according to the query instruction information.
  • the server After the server finds the first storage space that matches the first index information, it can feed back the query instruction information indicating the first blockchain corresponding to the first storage space to the target device, so that the target The device queries the first block chain for the first data corresponding to the first index information based on the query instruction information, so that the user implements an iterative query on the first data through the target device.
  • the query indication information may include the blockchain system identification of the first blockchain system to which the first blockchain belongs, so that the target device can find the first blockchain system according to the blockchain system identification , To query the first data corresponding to the first index information in the first blockchain of the first blockchain system.
  • the query instruction information may include the blockchain identification of the first blockchain, so that the target device can directly find the first blockchain according to the blockchain identification, so as to be in the first blockchain system. Query the first data corresponding to the first index information in the first block chain.
  • the method for the target device to query the first data corresponding to the first index information is similar to the method for the electronic device or server to query the first data corresponding to the first index information. I won’t go into details here.
  • each storage space can store x bytes of attribute values as an example, and each storage space corresponds to a blockchain, then There are also m blocks in the blockchain.
  • the judgment value corresponding to each storage space can be calculated according to the attribute value of each byte stored in each storage space. If a certain storage space corresponds to If the judgment value is true, it can be determined that the first data corresponding to the first index information is stored on the blockchain corresponding to the storage space, and the storage space is used as the first storage space. If the judgment values corresponding to all storage spaces are false , It can be determined that the first data corresponding to the first index information does not exist on any blockchain.
  • Each storage space has multiple storage locations, and each storage location corresponds to one byte, so each storage space has x storage locations.
  • the attribute value of at least one storage location corresponding to the first index information in each storage space can be queried. If the attribute values of these storage locations in a certain storage space are all preset values, it can be determined that the storage space corresponds to The judgment value of is true. If the attribute values of these storage locations in a certain storage space are not all preset values, it can be determined that the judgment value corresponding to the storage space is false.
  • the first index information may be a first data index identifier.
  • the first data index identifier may be a string composed of an invoice code and/or an invoice code.
  • the first data index identification may be a character string corresponding to the account address.
  • the specific method of S230 may include:
  • the storage space whose attribute values of the storage location are all preset values is used as the first storage space matching the first index information.
  • the first data index identifier may be a string composed of invoice code and invoice code, and the first data index identifier is hashed After the modulus operation is processed, the first modulus corresponding to the first data index identification can be obtained. Since each first modulus corresponds to a storage location in the storage space, the storage location corresponding to the first data index identification can be determined, and then , It is possible to query the attribute value of the storage location in each storage space, and determine the first storage space matching the first index information according to the attribute value, so as to improve the search accuracy of the first storage space.
  • the attribute value in order to further reduce the amount of data storage, may be represented by 0 and 1, where 1 may be used as a preset value, and 0 may be used as an initial value.
  • a specific method for performing a hash modulo operation on the first data index identifier to obtain the first modulus corresponding to the first data index identifier may include:
  • For each first hash address use the preset divisor corresponding to the preset hash function that outputs the first hash address to perform modulo operation processing on the first hash address to obtain multiple first data index identifiers corresponding to the first hash address.
  • a modulus For each first hash address, use the preset divisor corresponding to the preset hash function that outputs the first hash address to perform modulo operation processing on the first hash address to obtain multiple first data index identifiers corresponding to the first hash address.
  • FIG. 3 shows a schematic diagram of an example of a storage space query process according to an embodiment of the present application.
  • the first data index identifier can be index identifier Y
  • the preset value of the attribute value is 1
  • the preset hash function is Hash 1-Hash 3
  • the preset divisor is Mod 1-Mod 3
  • a preset Suppose that the hash function is set in a one-to-one correspondence with a preset divisor, that is, the first hash address obtained by Hash needs to be modulo operation processing with Mod 1 to obtain the first modulus. Therefore, Hash 1-Hash 3 can be used to hash the index identification Y to obtain three first hash addresses, and then Mod 1-Mod 3 can be used to perform modulo operation on the corresponding first hash addresses. After processing, three first moduli are obtained, and the three first moduli respectively correspond to three storage locations. For example, the first modulus 2, 4, and 7 correspond to storage locations 2, 4, and 7, respectively.
  • Bloom filter has 3 storage spaces.
  • the attribute values of storage locations 2, 4, and 7 of the second storage space are 1, 1, and 1, respectively, and the judgment value corresponding to the second storage space can be determined to be true.
  • the judgment value corresponding to other storage space is false. Therefore, the second storage space is the first storage space that matches the first index information.
  • the first index information is the first modulus corresponding to the first data index identifier, that is, at least one first modulus obtained after the hash modulus operation is directly received on the first data index identifier. number.
  • the specific method of S230 may include:
  • the storage space whose attribute values of the storage location are all preset values is used as the first storage space matching the first index information.
  • each first modulus corresponds to a storage location in the storage space
  • the storage location corresponding to each first modulus can be directly determined, and then the attributes of the storage location in each storage space can be queried. Value, the first storage space matching the first index information is determined according to the attribute value, thereby reducing the amount of data processing.
  • the specific method for querying the attribute value of the storage location in each storage space may include:
  • the specific method for querying the attribute value of the storage location in each storage space may include:
  • the target storage space is the storage space with the target storage location
  • the target storage location is arranged in the order adjacent to the storage location and the attribute value is The storage location of the preset value.
  • the bloom filter before the bloom filter can be used to query the first block chain to which the first data corresponding to the first index information belongs, it is also necessary to match the first block in the bloom filter to In the first storage space corresponding to the chain, the attribute value of at least one storage location corresponding to the first index information is set as a preset value.
  • the Bloom filter can also be updated at any time to set the attribute value of at least one storage location corresponding to the index information of the other data as a preset value in the storage space corresponding to the other data.
  • the difference between the second index information and the first index information is that the first index information does not carry the blockchain system identifier or the blockchain identifier, and the second index information carries the blockchain system identifier or the blockchain identifier .
  • the data query method may further include:
  • the second index information update the second storage space in the Bloom filter; where the second storage space is the storage space corresponding to the second block chain, and the second block chain is the second storage space corresponding to the second index information.
  • the blockchain where the data is stored.
  • the blockchain system identifier or zone can be directly based on the blockchain system identifier or blockchain identifier carried in the second index information.
  • the second storage space corresponding to the block chain identifier is updated.
  • the second index information may be a second data index identifier.
  • the second data index identifier may be a string composed of an invoice code and/or an invoice code.
  • the second data index identifier may be a character string corresponding to the account address.
  • the second data may be the same data as the first data, or may be other data different from the first data.
  • the specific method for updating the second storage space in the Bloom filter according to the second index information may include:
  • the attribute value of the storage location in the second storage space is updated from the initial value to the preset value.
  • the method for performing a hash modulus operation on the second data index identifier is similar to the above-mentioned method for performing a hash modulus operation on the first data index identifier, and will not be repeated here.
  • Fig. 4 shows a schematic diagram of an example of a Bloom filter update process according to an embodiment of the present application.
  • the second data index identifier can be an index identifier X, which carries a blockchain identifier.
  • the default value of the attribute value is 1, and the default hash function is Hash 1-Hash 3.
  • the divisor is Mod 1-Mod 3, and a preset hash function is set in a one-to-one correspondence with a preset divisor, that is, the second hash address obtained by Hash needs to be modulo 1 to obtain the second modulus. number.
  • Hash 1-Hash 3 can be used to hash the index identifier X to obtain three second hash addresses, and then Mod 1-Mod 3 can be used to perform modulo operation on the corresponding second hash addresses. After processing, 3 second moduli are obtained, and the 3 second moduli respectively correspond to 3 storage locations. For example, the first modulus 2, 4, and 7 correspond to storage locations 2, 4, and 7, respectively.
  • Bloom filter has 3 storage spaces, and each storage space corresponds to a blockchain. According to the blockchain identifier carried by the index identifier X, it can be determined that the second storage space corresponding to the blockchain identifier is the second storage space , Set the attribute values of the storage locations 2, 4, and 7 of the second storage space to 1, 1, and 1, respectively, to complete the update of the Bloom filter for the index mark X.
  • the second index information is the second modulus corresponding to the second data index identifier, that is, at least one second modulus obtained after the hash modulo operation is directly received on the second data index identifier. number.
  • the specific method for updating the second storage space in the Bloom filter according to the second index information may include:
  • the attribute value of the storage location in the second storage space is updated from the initial value to the preset value.
  • each second modulus corresponds to a storage location in the storage space, and the second modulus carries a blockchain identifier, it can be directly determined in the second storage space corresponding to the blockchain identifier
  • Each second modulus corresponds to a storage location, and then the determined attribute value of the storage location is updated to a preset value.
  • the server or electronic device storing the Bloom filter can be pushed through the blockchain system to monitor each blockchain system, or the server or electronic device storing the Bloom filter can monitor each area.
  • the block chain query method is to obtain the second index information for obtaining.
  • the specific method of receiving the second index information may include:
  • the second gateway node belongs to the second blockchain system
  • the second blockchain system is a blockchain system with a second blockchain
  • the first notification information is used
  • the first notification information includes the second index information.
  • the second blockchain system has a second gateway node
  • the gateway node since the gateway node can communicate with other systems, when the second gateway node uploads the second data in the second blockchain, it can actively include the second gateway node.
  • the first notification information of the second index information corresponding to the data is sent to the server or the electronic device storing the bloom filter, so that the server or the electronic device storing the bloom filter receives the first notification information and receives the notification from the first notification.
  • the second index information carrying the blockchain system identifier or the blockchain identifier is obtained from the information.
  • the second index information may be a second data index identifier, or may be a second modulus corresponding to the second data index identifier.
  • the data query method before receiving the second index information, may further include:
  • the second blockchain node sends an event registration request to the second blockchain node, so that the second blockchain node can register a monitoring event in response to the event registration request; the monitoring event is used to monitor the data storage event of the second data, and the second blockchain
  • the node belongs to the second blockchain system, and the second blockchain system is a blockchain system with a second blockchain;
  • the specific method of receiving the second index information may include:
  • the server or electronic device storing the Bloom filter can send an event registration request to each second blockchain node in the second blockchain system , So that each second blockchain node separately registers a monitoring event for monitoring the data storage event of the second data, as long as any second blockchain node uploads the second data to the second blockchain, The monitoring event in the second blockchain node will be triggered, and the second blockchain node will feed back the second notification information that triggers the monitoring event to the server or electronic device where the bloom filter is stored, so that the The server or electronic device of the Long Filter can obtain the second index information carrying the blockchain system identifier or the blockchain identifier from the received second notification information.
  • the second index information may be a second data index identifier.
  • the specific method of receiving the second index information may include:
  • the server or electronic device storing the Bloom filter can obtain the data stored in the second blockchain at each moment in real time, and compare the current data stored at the current moment with the previous The historical data stored at the moment is compared, the data that exists in the current data and does not exist in the historical data, that is, the newly added data in the second blockchain, is used as the second data, and then the second data is obtained from the second data. 2. Index information.
  • the second index information may be a second data index identifier.
  • the server when the data query method is executed by a server, the server may be any server in the server cluster of the data query platform, and the bloom filter may be stored in any storage area of the server.
  • the server when the data query method is executed by the server, the server may be any query platform blockchain node of the query platform blockchain system corresponding to the data query platform, that is, the third blockchain Node, query platform blockchain system can be a distributed ledger platform system jointly built by multiple blockchain systems for storing data to be queried, namely the third blockchain system, query platform blockchain system for each
  • the query platform blockchain node corresponds to a blockchain system for storing the data to be queried, so that each query platform blockchain node can communicate with the corresponding blockchain system to obtain the corresponding blockchain
  • the second index information sent by the system when the data query method is executed by the server, the server may be any query platform blockchain node of the query platform blockchain system corresponding to the data query platform, that is, the third blockchain Node, query platform blockchain system can be a distributed ledger platform system jointly built by multiple blockchain systems for storing data to be queried, namely the third blockchain system, query platform blockchain system for each
  • the query platform blockchain node corresponds to a blockchain system for storing the data to be queried,
  • the third blockchain node belongs to the third blockchain system, and the third blockchain corresponding to the third blockchain system is used to store the update data of the Bloom filter, that is, whenever the third area After the block chain node receives the second index information and updates the Bloom filter based on the second index information, the updated data of this update is uploaded to the third block chain corresponding to the third block chain system.
  • the bloom filter can be stored in the global state storage space of the third blockchain node, so as to ensure that the attribute value of each storage location in the bloom filter can be changed.
  • first block chain and the second block chain may be homogeneous or heterogeneous block chains respectively, which is not limited here.
  • Fig. 5 shows a schematic structural diagram of an embodiment of the data query device of the present application.
  • the device shown in FIG. 5 may be installed in an electronic device or a server.
  • the electronic device may be the user equipment 110 shown in FIG. 1, and the server may be the server 120 shown in FIG. 1.
  • the server may be a high-performance electronic calculator for storing and processing data; electronic devices include, but are not limited to, mobile phones, tablet computers, notebook computers, palmtop computers, vehicle-mounted terminals, wearable devices, and Pedometer, etc.
  • the data query device 300 may include:
  • the request receiving module 310 is configured to receive a data query request; wherein, the data query request includes first index information;
  • the space query module 320 is used to query the first storage space that matches the first index information among the multiple storage spaces of the Bloom filter in response to the data query request; among them, one storage space is related to one blockchain Correspondingly, the data stored in each blockchain is different;
  • the data query module 330 is configured to query the first data corresponding to the first index information in the first blockchain corresponding to the first storage space.
  • the multiple storage spaces of the Bloom filter can be queried for the first storage that matches the first index information.
  • Space it is possible to quickly locate the first block chain stored in the first data that needs to be queried according to the first storage space, and directly query the first data in the first block chain corresponding to the first storage space.
  • querying data there is no need to traverse different blockchains for iterative query, which simplifies the process of data query and improves the efficiency of data query.
  • the data stored in the Bloom filter is an attribute value with no practical significance, the privacy of the data will not be leaked, and the security of data storage and data query is improved.
  • the first index information may be a first data index identifier.
  • the spatial query module 320 may be specifically used to:
  • the storage space whose attribute values of the storage location are all preset values is used as the first storage space matching the first index information.
  • the spatial query module 320 may be further used to:
  • For each first hash address use the preset divisor corresponding to the preset hash function that outputs the first hash address to perform modulo operation processing on the first hash address to obtain multiple first data index identifiers corresponding to the first hash address.
  • a modulus For each first hash address, use the preset divisor corresponding to the preset hash function that outputs the first hash address to perform modulo operation processing on the first hash address to obtain multiple first data index identifiers corresponding to the first hash address.
  • the first index information may be the first modulus corresponding to the first data index identifier.
  • the spatial query module 320 may also be specifically used to:
  • the storage space whose attribute values of the storage location are all preset values is used as the first storage space matching the first index information.
  • the spatial query module 320 may be specifically used to:
  • the spatial query module 320 may also be specifically used to:
  • the target storage space is the storage space with the target storage location
  • the target storage location is arranged in the order adjacent to the storage location and the attribute value is The storage location of the preset value.
  • the data query device 300 may further include:
  • An information receiving module for receiving second index information
  • the information update module is used to update the second storage space in the Bloom filter according to the second index information; where the second storage space is the storage space corresponding to the second blockchain, and the second blockchain is the first The block chain where the second data corresponding to the second index information is stored.
  • the second index information may be a second data index identifier.
  • the information update module can be specifically used for:
  • the attribute value of the storage location in the second storage space is updated from the initial value to the preset value.
  • the second index information may be a second modulus corresponding to the second data index identifier.
  • the information update module can also be specifically used for:
  • the attribute value of the storage location in the second storage space is updated from the initial value to the preset value.
  • the information receiving module may be specifically used for:
  • the second gateway node belongs to the second blockchain system
  • the second blockchain system is a blockchain system with a second blockchain
  • the first notification information is used
  • the first notification information includes the second index information.
  • the data query device 300 may further include:
  • the request sending module is used to send an event registration request to the second blockchain node, so that the second blockchain node can register a monitoring event in response to the event registration request; wherein the monitoring event is used to monitor the data storage event of the second data ,
  • the second blockchain node belongs to the second blockchain system, and the second blockchain system is a blockchain system with a second blockchain;
  • the information receiving module can also be specifically used to:
  • the information receiving module may also be specifically used for:
  • the Bloom filter can be stored in the global state storage space of the third blockchain node.
  • the third blockchain node belongs to the third blockchain system, and the third blockchain system corresponds to The third blockchain is used to store the update data of the Bloom filter.
  • the data query module 330 may be specifically used to:
  • the first data corresponding to the first index information is queried.
  • the request receiving module 310 may be specifically configured to:
  • the data query device 300 may further include:
  • the data sending module is used to send the first data to the target device.
  • the request receiving module 310 may also be specifically used to:
  • the data query module 330 may also be specifically used to:
  • the query instruction information is used to indicate the first blockchain corresponding to the first storage space, so that the target device can query the first blockchain in the first blockchain according to the query instruction information.
  • the corresponding first data is used to indicate the first blockchain corresponding to the first storage space, so that the target device can query the first blockchain in the first blockchain according to the query instruction information.
  • the data query module 330 may also be specifically used to:
  • a block chain system the first block chain system is a block chain system with the first block chain;
  • the data query apparatus 300 provided by the embodiment of the present application can implement the various processes and effects implemented by the electronic device or server in the method embodiments of FIGS. 2-4, and the principles for implementing each process are similar. To avoid repetition, I won't repeat it here.
  • Fig. 6 shows a schematic diagram of the hardware structure of an embodiment of the data query device of the present application.
  • the data query device may include a processor 401 and a memory 402 storing computer program instructions.
  • the foregoing processor 401 may include a central processing unit (CPU), or a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • the memory 402 may include mass storage for data or instructions.
  • the memory 402 may include a hard disk drive (Hard Disk Drive, HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape or a Universal Serial Bus (USB) drive or two or more Multiple combinations of these.
  • the storage 402 may include removable or non-removable (or fixed) media.
  • the memory 402 may be inside or outside the integrated gateway disaster recovery device.
  • the memory 402 is a non-volatile solid state memory.
  • the memory 402 includes read-only memory (ROM).
  • the ROM can be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), electrically rewritable ROM (EAROM) or flash memory or A combination of two or more of these.
  • the processor 401 reads and executes computer program instructions stored in the memory 402 to implement any one of the data query methods in the foregoing embodiments.
  • the data query device may further include a communication interface 403 and a bus 410.
  • the processor 401, the memory 402, and the communication interface 403 are connected through a bus 410 and complete mutual communication.
  • the communication interface 403 is mainly used to implement communication between various modules, devices, units and/or devices in the embodiments of the present application.
  • the bus 410 includes hardware, software, or both, and couples the components of the data query device to each other.
  • the bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnect, industry standard architecture (ISA) Bus, Infinite Bandwidth Interconnect, Low Pin Count (LPC) Bus, Memory Bus, Micro Channel Architecture (MCA) Bus, Peripheral Component Interconnect (PCI) Bus, PCI-E4press (PCI-4) Bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association Local (VLB) bus or other suitable bus or a combination of two or more of these.
  • the bus 410 may include one or more buses.
  • the data query device can execute the data query method in the embodiment of the present application, thereby realizing the data query method and device described in conjunction with FIG. 2 to FIG. 5.
  • the embodiment of the present application may provide a computer-readable storage medium for implementation.
  • the computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the data query methods in the foregoing embodiments is implemented.
  • An example of the computer-readable storage medium may be a non-transitory computer-readable storage medium, including ROM, RAM, magnetic disk, or optical disk.
  • the functional blocks shown in the above-mentioned structural block diagram can be implemented as hardware, software, firmware, or a combination thereof.
  • it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, and so on.
  • ASIC application specific integrated circuit
  • the elements of this application are programs or code segments used to perform required tasks.
  • the program or code segment may be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link through a data signal carried in a carrier wave.
  • "Machine-readable medium" may include any medium that can store or transmit information.
  • machine-readable media examples include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and so on.
  • the code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.
  • the embodiment of the present application also provides a data query system, which includes a data query system, multiple blockchain systems and data query equipment.
  • each blockchain system has a blockchain, and the data stored in each blockchain is different.
  • the data query device is used to receive a data query request; wherein the data query request includes the first index information; in response to the data query request, in the multiple storage spaces of the Bloom filter, the first index matching the first index information is queried.
  • Storage space among them, one storage space corresponds to one block chain; in the first block chain corresponding to the first storage space, query the first data corresponding to the first index information.
  • the multiple storage spaces of the Bloom filter can be queried for the first storage that matches the first index information.
  • Space it is possible to quickly locate the first block chain stored in the first data that needs to be queried according to the first storage space, and directly query the first data in the first block chain corresponding to the first storage space.
  • querying data there is no need to traverse different blockchains for iterative query, which simplifies the process of data query and improves the efficiency of data query.
  • the data stored in the Bloom filter is an attribute value with no practical significance, the privacy of the data will not be leaked, and the security of data storage and data query is improved.
  • the data query device may be an electronic device or a server.
  • the electronic device may be the user equipment 110 shown in FIG. 1
  • the server may be the server 120 shown in FIG. 1.
  • the server may be a high-performance electronic computer for storing and processing data; electronic devices include, but are not limited to, mobile phones, tablet computers, notebook computers, palmtop computers, vehicle-mounted terminals, wearable devices, and computers. Stepper and so on.
  • Each invoice system can store its own electronic invoices through the corresponding blockchain system of the invoice system.
  • Invoice information for example, the invoice system of the Shenzhen Taxation Bureau uses the TrustSQL blockchain underlying platform to build its corresponding blockchain system, which is used to store the electronic invoice information issued by the Shenzhen Taxation Bureau.
  • the invoice system of the Fujian Taxation Bureau adopts the Hyperledger Fabric alliance chain to build its corresponding blockchain system, which is used to store the electronic invoice information issued by the Fujian Taxation Bureau.
  • the data index is identified as a string formed by the invoice code and the beginning and end of the invoice code.
  • the user can enter the invoice code and invoice code into the electronic device installed with the data query application corresponding to the data query platform, so that the electronic device generates a data query request and sends it to the data query device, and the data query device obtains the data index in the data query device
  • the storage space that matches the data index identification can be queried in the multiple storage spaces of the Bloom filter.
  • the query is the same as the data index identification.
  • the corresponding electronic invoice information is the same as the data index identification.
  • Each encrypted currency platform system can be stored separately through the corresponding blockchain system of the encrypted currency platform system.
  • the cryptocurrency information it owns for example, cryptocurrency platform systems such as Bitcoin, Ethereum, EOS, USDT, and Ripple (XRP) have their own blocks Chain system.
  • the data index is identified as the character string corresponding to the account address.
  • the user can input the account address to the electronic device installed with the data query application corresponding to the data query platform to make the electronic device generate a data query request and send it to the data query device.
  • the data query device obtains the data index identifier in the data query device, In the multiple storage spaces of the Bloom filter, the storage space matching the data index identification can be queried, and finally, in the blockchain corresponding to the queried storage space, the encryption corresponding to the data index identification can be queried Currency information.
  • the data query device provided in the embodiment of the present application can implement the various processes and effects implemented by the electronic device or the server in the method embodiments of FIGS. 2-4, and the principles for implementing each process are similar. To avoid repetition, here No longer.

Abstract

A data query method, apparatus, device and system, and a medium. The data query method comprises: receiving a data query request, wherein the data query request comprises first index information (S210); in response to the data query request and in a plurality of storage spaces of a bloom filter, querying a first storage space matching the first index information, wherein a storage space corresponds to a blockchain, and data stored in each blockchain is different (S220); and in a first blockchain corresponding to the first storage space, querying first data corresponding to the first index information (S230). The method can improve data query efficiency.

Description

数据查询方法、装置、设备、系统及介质Data query method, device, equipment, system and medium
相关申请的交叉引用Cross references to related applications
本申请要求享有于2019年12月27日提交的名称为“数据查询方法、装置、设备、系统及介质”的中国专利申请201911382203.0的优先权,该申请的全部内容通过引用并入本文中。This application claims the priority of the Chinese patent application 201911382203.0 named "Data Query Method, Device, Equipment, System and Medium" filed on December 27, 2019, and the entire content of this application is incorporated herein by reference.
技术领域Technical field
本申请涉及数据查询技术领域,特别是涉及一种数据查询方法、装置、设备、系统及介质。This application relates to the field of data query technology, and in particular to a data query method, device, equipment, system and medium.
背景技术Background technique
在相关技术中,一个数据查询平台可能对接有多个区块链系统,相同属性的不同数据可能分别存储在不同的区块链系统的区块链中,在数据查询平台接收到数据查询请求的情况下,需要进行跨区块链查询,即分别遍历不同的区块链进行迭代查询,使得数据查询的过程比较繁琐,数据查询的效率较低。In related technologies, a data query platform may be connected to multiple blockchain systems, and different data of the same attribute may be stored in the blockchains of different blockchain systems. The data query platform receives the data query request. In this case, it is necessary to perform cross-blockchain query, that is, to traverse different blockchains for iterative query, which makes the data query process more cumbersome and the efficiency of data query is low.
发明内容Summary of the invention
本申请实施例提供一种数据查询方法、装置、设备、系统及介质,能够提高数据查询的效率。The embodiments of the present application provide a data query method, device, equipment, system, and medium, which can improve the efficiency of data query.
第一方面,本申请实施例提供一种数据查询方法,该方法包括:In the first aspect, an embodiment of the present application provides a data query method, which includes:
接收数据查询请求;其中,数据查询请求包括第一索引信息;Receiving a data query request; wherein the data query request includes first index information;
响应于数据查询请求,在布隆过滤器的多个存储空间中,查询与第一索引信息相匹配的第一存储空间;其中,一个存储空间与一个区块链相对应,每个区块链中所存储的数据不同;In response to the data query request, among the multiple storage spaces of the Bloom filter, the first storage space that matches the first index information is queried; among them, one storage space corresponds to one blockchain, and each blockchain The data stored in is different;
在与第一存储空间相对应的第一区块链中,查询与第一索引信息相对 应的第一数据。In the first blockchain corresponding to the first storage space, query the first data corresponding to the first index information.
第二方面,本申请实施例提供了一种数据查询装置,该装置包括:In the second aspect, an embodiment of the present application provides a data query device, which includes:
请求接收模块,用于接收数据查询请求;其中,数据查询请求包括第一索引信息;The request receiving module is configured to receive a data query request; wherein, the data query request includes first index information;
空间查询模块,用于响应于数据查询请求,在布隆过滤器的多个存储空间中,查询与第一索引信息相匹配的第一存储空间;其中,一个存储空间与一个区块链相对应,每个区块链中所存储的数据不同;The space query module is used to query the first storage space that matches the first index information in the multiple storage spaces of the Bloom filter in response to the data query request; among them, one storage space corresponds to one blockchain , The data stored in each blockchain is different;
数据查询模块,用于在与第一存储空间相对应的第一区块链中,查询与第一索引信息相对应的第一数据。The data query module is used to query the first data corresponding to the first index information in the first blockchain corresponding to the first storage space.
第三方面,本申请实施例提供了一种数据查询设备,该设备包括:处理器以及存储有计算机程序指令的存储器;In a third aspect, an embodiment of the present application provides a data query device, which includes: a processor and a memory storing computer program instructions;
处理器执行计算机程序指令时实现如第一方面所述的数据查询方法。When the processor executes the computer program instructions, the data query method as described in the first aspect is implemented.
第四方面,本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序指令,计算机程序指令被处理器执行时实现如第一方面所述的数据查询方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored on the computer-readable storage medium, and when the computer program instructions are executed by a processor, the data query method as described in the first aspect is implemented .
第五方面,本申请实施例提供了一种数据查询系统,包括:In a fifth aspect, an embodiment of the present application provides a data query system, including:
多个区块链系统,每个区块链系统具有一个区块链,每个区块链中所存储的数据不同;Multiple blockchain systems, each blockchain system has a blockchain, and the data stored in each blockchain is different;
数据查询设备,用于接收数据查询请求;其中,数据查询请求包括第一索引信息;响应于数据查询请求,在布隆过滤器的多个存储空间中,查询与第一索引信息相匹配的第一存储空间;其中,一个存储空间与一个区块链相对应;在与第一存储空间相对应的第一区块链中,查询与第一索引信息相对应的第一数据。A data query device for receiving a data query request; wherein the data query request includes the first index information; in response to the data query request, in the multiple storage spaces of the Bloom filter, the first index information matching the first index information is queried A storage space; where one storage space corresponds to a block chain; in the first block chain corresponding to the first storage space, the first data corresponding to the first index information is queried.
本申请实施例的数据查询方法、装置、设备、系统及介质,在接收到数据查询请求后,能够根据数据查询请求中的第一索引信息,在布隆过滤器的多个存储空间中查询与第一索引信息相匹配的第一存储空间,从而可以根据第一存储空间快速定位到所需查询的第一数据所存储的第一区块链,并且直接在与第一存储空间相对应的第一区块链中查询第一数据,在数据查询时,无需遍历不同的区块链进行迭代查询,简化了数据查询的过程, 提高了数据查询的效率。另外,由于布隆过滤器中所存储的数据为无实际意义的属性值,因此,不会泄露数据的隐私,提高了数据存储和数据查询的安全性。The data query method, device, device, system, and medium of the embodiments of the present application can query and query data in multiple storage spaces of the Bloom filter according to the first index information in the data query request after receiving the data query request. The first storage space that matches the first index information can be quickly located according to the first storage space to the first blockchain where the first data to be queried is stored, and directly in the first storage space corresponding to the first storage space. The first data is queried in one block chain. During data query, there is no need to traverse different block chains for iterative query, which simplifies the process of data query and improves the efficiency of data query. In addition, since the data stored in the Bloom filter is an attribute value with no practical significance, the privacy of the data will not be leaked, and the security of data storage and data query is improved.
附图说明Description of the drawings
下面将通过参考附图来描述本申请示例性实施例的特征、优点和技术效果。The features, advantages, and technical effects of the exemplary embodiments of the present application will be described below with reference to the accompanying drawings.
图1是相关技术中的一种数据查询系统的系统架构图;Figure 1 is a system architecture diagram of a data query system in related technologies;
图2是本申请的数据查询方法的实施例的流程示意图;FIG. 2 is a schematic flowchart of an embodiment of the data query method of the present application;
图3是根据本申请实施例的存储空间查询过程的示例的原理示意图;Fig. 3 is a schematic diagram of an example of a storage space query process according to an embodiment of the present application;
图4是根据本申请实施例的布隆过滤器更新过程的示例的原理示意图;Fig. 4 is a schematic diagram of an example of a Bloom filter update process according to an embodiment of the present application;
图5是本申请的数据查询装置的实施例的结构示意图;Figure 5 is a schematic structural diagram of an embodiment of the data query device of the present application;
图6是本申请的数据查询设备的实施例的硬件结构示意图。Fig. 6 is a schematic diagram of the hardware structure of an embodiment of the data query device of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请的实施方式作进一步详细描述。以下实施例的详细描述和附图用于示例性地说明本申请的原理,但不能用来限制本申请的范围,即本申请不限于所描述的实施例。The implementation of the present application will be described in further detail below in conjunction with the accompanying drawings and embodiments. The detailed description and drawings of the following embodiments are used to exemplarily illustrate the principle of the present application, but cannot be used to limit the scope of the present application, that is, the present application is not limited to the described embodiments.
在本申请的描述中,需要说明的是,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。In the description of this application, it should be noted that relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities Or there is any such actual relationship or sequence between operations. Moreover, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes those that are not explicitly listed Other elements of, or also include elements inherent to this process, method, article or equipment. If there are no more restrictions, the element defined by the sentence "including..." does not exclude the existence of other same elements in the process, method, article or equipment that includes the element.
在相关技术中,一个数据查询平台可能对接有多个区块链系统,相同属性的不同数据可能分别存储在不同的区块链系统的区块链中。In related technologies, a data query platform may be connected to multiple blockchain systems, and different data of the same attribute may be stored in the blockchains of different blockchain systems.
图1示出了相关技术中的一种数据查询系统的系统架构图。如图1所示,该数据查询系统包括用户设备110、数据查询平台的服务器120和多个区块链系统130。其中,每个区块链系统130分别设置有一个区块链,每个区块链内分别存储有相同属性的不同数据。服务器120可以分别对接每个区块链系统130。用户设备110上安装有数据查询平台对应的数据查询应用程序。用户可以通过数据查询应用程序发起数据查询,使用户设备110生成数据查询请求,并将数据查询请求发送至服务器120,服务器120接收到数据查询请求后,可以响应于该数据查询请求,进行跨区块链查询,以依次遍历不同的区块链以查询数据查询请求对应的数据,使得数据查询的过程比较繁琐,数据查询的效率较低。Figure 1 shows a system architecture diagram of a data query system in related technologies. As shown in FIG. 1, the data query system includes a user equipment 110, a server 120 of a data query platform, and multiple blockchain systems 130. Among them, each block chain system 130 is respectively provided with a block chain, and each block chain stores different data with the same attribute. The server 120 can be connected to each blockchain system 130 respectively. A data query application corresponding to the data query platform is installed on the user equipment 110. The user can initiate a data query through the data query application, so that the user equipment 110 generates a data query request, and sends the data query request to the server 120. After receiving the data query request, the server 120 can respond to the data query request to perform cross-regional operations. Block chain query is to sequentially traverse different block chains to query the data corresponding to the data query request, which makes the process of data query more cumbersome and the efficiency of data query is low.
为了解决上述的问题,本申请实施例提供了一种数据查询方法、装置、设备、系统及介质。下面首先对本申请实施例所提供的数据查询方法进行介绍。In order to solve the aforementioned problems, embodiments of the present application provide a data query method, device, equipment, system, and medium. The following first introduces the data query method provided by the embodiment of the present application.
图2示出了本申请的数据查询方法的实施例的流程示意图。图2所示的方法可以由电子设备或者服务器执行。其中,电子设备可以为图1所示的用户设备110,服务器可以为图1所示的服务器120。Fig. 2 shows a schematic flowchart of an embodiment of the data query method of the present application. The method shown in FIG. 2 may be executed by an electronic device or a server. The electronic device may be the user equipment 110 shown in FIG. 1, and the server may be the server 120 shown in FIG. 1.
本申请实施例中,服务器可以是一种高性能的电子计算器,用于存储和处理数据;电子设备包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。In the embodiments of this application, the server may be a high-performance electronic calculator for storing and processing data; electronic devices include, but are not limited to, mobile phones, tablet computers, notebook computers, palmtop computers, vehicle-mounted terminals, wearable devices, and Pedometer, etc.
如图2所示,该数据查询方法可以包括:As shown in Figure 2, the data query method may include:
S210、接收数据查询请求;其中,数据查询请求包括第一索引信息;S210. Receive a data query request; where the data query request includes first index information;
S220、响应于数据查询请求,在布隆过滤器的多个存储空间中,查询与第一索引信息相匹配的第一存储空间;其中,一个存储空间与一个区块链相对应,每个区块链中所存储的数据不同;S220. In response to the data query request, query the first storage space matching the first index information among the multiple storage spaces of the Bloom filter; among them, one storage space corresponds to one blockchain, and each zone The data stored in the block chain is different;
S230、在与第一存储空间相对应的第一区块链中,查询与第一索引信息相对应的第一数据。S230: Query the first data corresponding to the first index information in the first blockchain corresponding to the first storage space.
在本申请实施例中,在接收到数据查询请求后,能够根据数据查询请求中的第一索引信息,在布隆过滤器的多个存储空间中查询与第一索引信息相匹配的第一存储空间,从而可以根据第一存储空间快速定位到所需查 询的第一数据所存储的第一区块链,并且直接在与第一存储空间相对应的第一区块链中查询第一数据,在数据查询时,无需遍历不同的区块链进行迭代查询,简化了数据查询的过程,提高了数据查询的效率。另外,由于布隆过滤器中所存储的数据为无实际意义的属性值,因此,不会泄露数据的隐私,提高了数据存储和数据查询的安全性。In the embodiment of the present application, after receiving the data query request, according to the first index information in the data query request, the multiple storage spaces of the Bloom filter can be queried for the first storage that matches the first index information. Space, it is possible to quickly locate the first block chain stored in the first data that needs to be queried according to the first storage space, and directly query the first data in the first block chain corresponding to the first storage space, When querying data, there is no need to traverse different blockchains for iterative query, which simplifies the process of data query and improves the efficiency of data query. In addition, since the data stored in the Bloom filter is an attribute value with no practical significance, the privacy of the data will not be leaked, and the security of data storage and data query is improved.
在本申请一些实施例的S210中,若数据查询方法由电子设备执行,例如电子设备为图1所示的用户设备110,则所接收的数据查询请求为用户输入的数据查询请求,例如,电子设备通过数据查询应用程序接收到的用户输入的数据查询请求。In S210 of some embodiments of the present application, if the data query method is executed by an electronic device, for example, the electronic device is the user equipment 110 shown in FIG. 1, then the received data query request is a data query request input by the user, for example, electronic The data query request input by the user received by the device through the data query application.
在这些实施例中,电子设备存储有布隆过滤器。对于布隆过滤器而言,若布隆过滤器具有m个存储空间,每个存储空间可以存储x个字节的属性值,则布隆过滤器的总存储量为m*x个字节,可见,布隆过滤器的总存储量较低,仅会占用电子设备的少量存储资源,不会影响电子设备的数据处理效率。In these embodiments, the electronic device stores the Bloom filter. For the Bloom filter, if the Bloom filter has m storage spaces, and each storage space can store x bytes of attribute values, the total storage capacity of the Bloom filter is m*x bytes, which can be seen , The total storage capacity of the Bloom filter is relatively low, only a small amount of storage resources of the electronic device will be occupied, and the data processing efficiency of the electronic device will not be affected.
进一步地,若数据查询方法由电子设备执行,在一些实施例中,S230的具体方法可以为:Further, if the data query method is executed by an electronic device, in some embodiments, the specific method of S230 may be:
获取第一区块链所存储的数据;Obtain the data stored in the first blockchain;
在所获取的数据中,查询与第一索引信息相对应的第一数据。Among the acquired data, the first data corresponding to the first index information is queried.
在这些实施例中,在电子设备利用其自身所存储的布隆过滤器,查询到与数据查询请求中的第一索引信息相匹配的第一存储空间的情况下,如果与第一存储空间相对于的第一区块链所属的第一区块链系统不具有第一网关节点,则电子设备可以直接利用第一区块链系统中的任一第一区块链节点,从第一区块链中下载第一区块链所存储的数据,然后,在所获取的数据中,查询与第一索引信息相对应的第一数据。In these embodiments, when the electronic device uses its own stored Bloom filter to find the first storage space that matches the first index information in the data query request, if it is opposite to the first storage space If the first blockchain system to which the first blockchain belongs does not have a first gateway node, the electronic device can directly use any first blockchain node in the first blockchain system, from the first block chain The data stored in the first blockchain is downloaded in the chain, and then, among the acquired data, the first data corresponding to the first index information is queried.
由此,电子设备可以直接利用基于第一索引信息所查询到的第一区块链对第一数据进行查询,提高了数据查询效率。As a result, the electronic device can directly use the first blockchain queried based on the first index information to query the first data, which improves the efficiency of data query.
进一步地,若数据查询方法由电子设备执行,在另一些实施例中,S230的具体方法还可以为:Further, if the data query method is executed by an electronic device, in other embodiments, the specific method of S230 may also be:
向第一网关节点发送数据查询请求,以使第一网关节点响应于数据查 询请求,在第一区块链中查询与第一索引信息相对应的第一数据;其中,第一网关节点属于第一区块链系统,第一区块链系统为具有第一区块链的区块链系统;Send a data query request to the first gateway node, so that the first gateway node queries the first block chain for the first data corresponding to the first index information in response to the data query request; wherein, the first gateway node belongs to the first block chain. A block chain system, the first block chain system is a block chain system with the first block chain;
接收第一网关节点反馈的第一数据。Receive the first data fed back by the first gateway node.
在这些实施例中,在电子设备利用其自身所存储的布隆过滤器,查询到与数据查询请求中的第一索引信息相匹配的第一存储空间的情况下,如果与第一存储空间相对于的第一区块链所属的第一区块链系统具有第一网关节点,则电子设备可以向第一网关节点发送数据查询请求,以使第一网关节点响应于数据查询请求,在第一区块链中查询与第一索引信息相对应的第一数据,电子设备仅需接收第一网关节点反馈的第一数据即可,可以降低电子设备的数据处理量,进一步减少对电子设备的资源占用。In these embodiments, when the electronic device uses its own stored Bloom filter to find the first storage space that matches the first index information in the data query request, if it is opposite to the first storage space If the first blockchain system to which the first blockchain belongs has a first gateway node, the electronic device can send a data query request to the first gateway node, so that the first gateway node responds to the data query request, To query the first data corresponding to the first index information in the blockchain, the electronic device only needs to receive the first data fed back by the first gateway node, which can reduce the amount of data processing of the electronic device and further reduce the resources of the electronic device Occupied.
在本申请另一些实施例中,若数据查询方法由服务器执行,例如电子设备为图1所示的服务器120,则所接收的数据查询请求为目标设备发送的数据查询请求。此时,S210的具体方法可以为:接收目标设备发送的数据查询请求,其中,数据查询请求可以为用于基于第一索引信息查询第一数据的查询请求。In other embodiments of the present application, if the data query method is executed by a server, for example, the electronic device is the server 120 shown in FIG. 1, then the received data query request is a data query request sent by the target device. At this time, the specific method of S210 may be: receiving a data query request sent by the target device, where the data query request may be a query request for querying the first data based on the first index information.
在这些实施例中,服务器内存储有布隆过滤器。对于布隆过滤器而言,若布隆过滤器具有m个存储空间,每个存储空间可以存储x个字节的属性值,则布隆过滤器的总存储量为m*x个字节,可见,布隆过滤器的总存储量较低,仅会占用服务器的少量存储资源,不会影响服务器的数据处理效率。In these embodiments, bloom filters are stored in the server. For the Bloom filter, if the Bloom filter has m storage spaces, and each storage space can store x bytes of attribute values, the total storage capacity of the Bloom filter is m*x bytes, which can be seen , The total storage capacity of Bloom filter is low, only a small amount of storage resources of the server will be occupied, and the data processing efficiency of the server will not be affected.
在本申请一些实施例中,若服务器为数据查询平台的服务器,则目标设备可以为安装有数据查询平台对应的数据查询应用程序的电子设备。在本申请另一些实施例中,若服务器为数据查询平台的服务器,则目标设备也可以为其他应用平台的服务器,此时,电子设备上安装有其他应用平台对应的应用程序,并且该其他应用平台能够与数据查询平台在数据查询功能上进行对接。In some embodiments of the present application, if the server is a server of a data query platform, the target device may be an electronic device installed with a data query application corresponding to the data query platform. In some other embodiments of the present application, if the server is a server of a data query platform, the target device may also be a server of another application platform. At this time, the electronic device has an application program corresponding to another application platform installed, and the other application The platform can interface with the data query platform in terms of data query functions.
进一步地,若数据查询方法由服务器执行,在一些实施例中,S230的具体方法可以为:Further, if the data query method is executed by the server, in some embodiments, the specific method of S230 may be:
获取第一区块链所存储的数据;Obtain the data stored in the first blockchain;
在所获取的数据中,查询与第一索引信息相对应的第一数据。Among the acquired data, the first data corresponding to the first index information is queried.
在这些实施例中,在服务器利用其自身所存储的布隆过滤器,查询到与数据查询请求中的第一索引信息相匹配的第一存储空间的情况下,如果与第一存储空间相对于的第一区块链所属的第一区块链系统不具有第一网关节点,则服务器可以直接利用第一区块链系统中的任一第一区块链节点,从第一区块链中下载第一区块链所存储的数据,然后,在所获取的数据中,查询与第一索引信息相对应的第一数据。In these embodiments, when the server uses its own stored Bloom filter to find the first storage space that matches the first index information in the data query request, if the first storage space is relative to the first storage space If the first blockchain system to which the first blockchain belongs does not have a first gateway node, the server can directly use any of the first blockchain nodes in the first blockchain system, from the first blockchain Download the data stored in the first block chain, and then, in the acquired data, query the first data corresponding to the first index information.
进一步地,若数据查询方法由服务器执行,在另一些实施例中,S230的具体方法可以为:Further, if the data query method is executed by the server, in other embodiments, the specific method of S230 may be:
向第一网关节点发送数据查询请求,以使第一网关节点响应于数据查询请求,在第一区块链中查询与第一索引信息相对应的第一数据;其中,第一网关节点属于第一区块链系统,第一区块链系统为具有第一区块链的区块链系统;Send a data query request to the first gateway node, so that the first gateway node queries the first block chain for the first data corresponding to the first index information in response to the data query request; wherein, the first gateway node belongs to the first block chain. A block chain system, the first block chain system is a block chain system with the first block chain;
接收第一网关节点反馈的第一数据。Receive the first data fed back by the first gateway node.
在这些实施例中,在服务器利用其自身所存储的布隆过滤器,查询到与数据查询请求中的第一索引信息相匹配的第一存储空间的情况下,如果与第一存储空间相对于的第一区块链所属的第一区块链系统具有第一网关节点,则服务器可以向第一网关节点发送数据查询请求,以使第一网关节点响应于数据查询请求,在第一区块链中查询与第一索引信息相对应的第一数据,服务器仅需接收第一网关节点反馈的第一数据即可,可以降低服务器的数据处理量,进一步减少对服务器的资源占用。In these embodiments, when the server uses its own stored Bloom filter to find the first storage space that matches the first index information in the data query request, if the first storage space is relative to the first storage space If the first blockchain system to which the first blockchain belongs has a first gateway node, the server can send a data query request to the first gateway node, so that the first gateway node responds to the data query request in the first block To query the first data corresponding to the first index information in the chain, the server only needs to receive the first data fed back by the first gateway node, which can reduce the data processing volume of the server and further reduce the resource occupation of the server.
在上述的实施例中,可选地,在S230之后,该数据查询方法还可以包括:In the foregoing embodiment, optionally, after S230, the data query method may further include:
将第一数据发送至目标设备。Send the first data to the target device.
由此,服务器可以响应于目标设备所发送的数据查询请求,基于第一索引信息为目标设备快速地查询到第一数据,并且将所查到的第一数据反馈给目标设备,以使用户通过目标设备实现对第一数据的递归查询。Thus, the server can quickly query the first data for the target device based on the first index information in response to the data query request sent by the target device, and feed back the found first data to the target device, so that the user can pass The target device implements a recursive query on the first data.
在本申请又一些实施例中,若数据查询方法由服务器执行,例如电子 设备为图1所示的服务器120,则所接收的数据查询请求为目标设备发送的数据查询请求。此时,S210的具体方法可以为:接收目标设备发送的数据查询请求,其中,数据查询请求可以为用于基于第一索引信息查询第一数据所属的第一区块链的查询请求。In still other embodiments of the present application, if the data query method is executed by a server, for example, the electronic device is the server 120 shown in FIG. 1, then the received data query request is a data query request sent by the target device. At this time, the specific method of S210 may be: receiving a data query request sent by the target device, where the data query request may be a query request for querying the first blockchain to which the first data belongs based on the first index information.
在这些实施例中,服务器内存储有布隆过滤器。对于布隆过滤器而言,若布隆过滤器具有m个存储空间,每个存储空间可以存储x个字节的属性值,则布隆过滤器的总存储量为m*x个字节,可见,布隆过滤器的总存储量较低,仅会占用服务器的少量存储资源,不会影响服务器的数据处理效率。In these embodiments, bloom filters are stored in the server. For the Bloom filter, if the Bloom filter has m storage spaces, and each storage space can store x bytes of attribute values, the total storage capacity of the Bloom filter is m*x bytes, which can be seen , The total storage capacity of Bloom filter is low, only a small amount of storage resources of the server will be occupied, and the data processing efficiency of the server will not be affected.
在本申请一些实施例中,若服务器为数据查询平台的服务器,则目标设备可以为安装有数据查询平台对应的数据查询应用程序的电子设备。在本申请另一些实施例中,若服务器为数据查询平台的服务器,则目标设备也可以为其他应用平台的服务器,此时,电子设备上安装有其他应用平台对应的应用程序,并且该其他应用平台能够与数据查询平台在数据查询功能上进行对接。In some embodiments of the present application, if the server is a server of a data query platform, the target device may be an electronic device installed with a data query application corresponding to the data query platform. In some other embodiments of the present application, if the server is a server of a data query platform, the target device may also be a server of another application platform. At this time, the electronic device has an application program corresponding to another application platform installed, and the other application The platform can interface with the data query platform in terms of data query functions.
进一步地,若数据查询方法由服务器执行,在又一些实施例中,S230的具体方法可以为:Further, if the data query method is executed by the server, in other embodiments, the specific method of S230 may be:
向目标设备发送查询指示信息,查询指示信息用于指示第一存储空间相对应的第一区块链,以使目标设备根据查询指示信息,在第一区块链中查询与第一索引信息相对应的第一数据。Send query instruction information to the target device. The query instruction information is used to indicate the first blockchain corresponding to the first storage space, so that the target device can query the first blockchain in the first blockchain according to the query instruction information. The corresponding first data.
由此,在服务器查询到与第一索引信息相匹配的第一存储空间后,可以将用于指示第一存储空间相对应的第一区块链的查询指示信息反馈至目标设备,以使目标设备基于该查询指示信息在第一区块链中查询与第一索引信息相对应的第一数据,以使用户通过目标设备实现对第一数据的迭代查询。Thus, after the server finds the first storage space that matches the first index information, it can feed back the query instruction information indicating the first blockchain corresponding to the first storage space to the target device, so that the target The device queries the first block chain for the first data corresponding to the first index information based on the query instruction information, so that the user implements an iterative query on the first data through the target device.
在一些实施例中,查询指示信息中可以包括第一区块链所属的第一区块链系统的区块链系统标识,从而使目标设备可以根据区块链系统标识找到第一区块链系统,以在第一区块链系统的第一区块链中查询与第一索引信息相对应的第一数据。在另一些实施例中,查询指示信息中可以包括第 一区块链的区块链标识,从而使目标设备可以根据区块链标识直接找到第一区块链,以在第一区块链系统的第一区块链中查询与第一索引信息相对应的第一数据。In some embodiments, the query indication information may include the blockchain system identification of the first blockchain system to which the first blockchain belongs, so that the target device can find the first blockchain system according to the blockchain system identification , To query the first data corresponding to the first index information in the first blockchain of the first blockchain system. In other embodiments, the query instruction information may include the blockchain identification of the first blockchain, so that the target device can directly find the first blockchain according to the blockchain identification, so as to be in the first blockchain system. Query the first data corresponding to the first index information in the first block chain.
需要说明的是,在本申请实施例中,目标设备查询与第一索引信息相对应的第一数据的方法与电子设备或服务器查询与第一索引信息相对应的第一数据的方法相似,在此不做赘述。It should be noted that in this embodiment of the application, the method for the target device to query the first data corresponding to the first index information is similar to the method for the electronic device or server to query the first data corresponding to the first index information. I won’t go into details here.
在本申请实施例的S220中,继续以布隆过滤器具有m个存储空间,每个存储空间可以存储x个字节的属性值为例,每个存储空间与一个区块链相对应,则区块链也有m条,当接收到第一索引信息时,可以先根据每个存储空间所存储的各个字节的属性值,计算每个存储空间对应的判断值,若某个存储空间对应的判断值为真,则可以确定第一索引信息对应的第一数据存储在该存储空间对应的区块链上,将该存储空间作为第一存储空间,若全部存储空间对应的判断值均为假,则可以确定第一索引信息对应的第一数据不存在于任何区块链上。In S220 of the embodiment of the present application, continue to assume that the Bloom filter has m storage spaces, and each storage space can store x bytes of attribute values as an example, and each storage space corresponds to a blockchain, then There are also m blocks in the blockchain. When the first index information is received, the judgment value corresponding to each storage space can be calculated according to the attribute value of each byte stored in each storage space. If a certain storage space corresponds to If the judgment value is true, it can be determined that the first data corresponding to the first index information is stored on the blockchain corresponding to the storage space, and the storage space is used as the first storage space. If the judgment values corresponding to all storage spaces are false , It can be determined that the first data corresponding to the first index information does not exist on any blockchain.
每个存储空间有多个存储位置,每个存储位置对应一个字节,则每个存储空间有x个存储位置。具体地,可以查询第一索引信息对应的至少一个存储位置在每个存储空间中的属性值,若某个存储空间中这些存储位置的属性值均为预设值,则可以确定该存储空间对应的判断值为真,若某个存储空间中这些存储位置的属性值不全为预设值,则可以确定该存储空间对应的判断值为假。Each storage space has multiple storage locations, and each storage location corresponds to one byte, so each storage space has x storage locations. Specifically, the attribute value of at least one storage location corresponding to the first index information in each storage space can be queried. If the attribute values of these storage locations in a certain storage space are all preset values, it can be determined that the storage space corresponds to The judgment value of is true. If the attribute values of these storage locations in a certain storage space are not all preset values, it can be determined that the judgment value corresponding to the storage space is false.
在本申请一些实施例中,第一索引信息可以为第一数据索引标识,例如,如果第一数据为发票信息,第一数据索引标识可以为发票编码和/或发票代码构成的字符串,再例如,如果第一数据为加密货币信息,第一数据索引标识可以为账户地址对应的字符串。In some embodiments of the present application, the first index information may be a first data index identifier. For example, if the first data is invoice information, the first data index identifier may be a string composed of an invoice code and/or an invoice code. For example, if the first data is encrypted currency information, the first data index identification may be a character string corresponding to the account address.
在这些实施例中,S230的具体方法可以包括:In these embodiments, the specific method of S230 may include:
对第一数据索引标识进行哈希取模运算处理,得到第一数据索引标识对应的第一模数;Performing hash modulo operation processing on the first data index identifier to obtain the first modulus corresponding to the first data index identifier;
根据第一模数,确定第一数据索引标识对应的存储位置;According to the first modulus, determine the storage location corresponding to the first data index identifier;
查询存储位置在每个存储空间中的属性值;Query the attribute value of the storage location in each storage space;
将存储位置的属性值均为预设值的存储空间,作为与第一索引信息相匹配的第一存储空间。The storage space whose attribute values of the storage location are all preset values is used as the first storage space matching the first index information.
以第一数据索引标识为发票编码和发票代码构成的字符串为例,第一数据索引标识可以为由发票编码和发票代码首尾拼接所构成的字符串,对第一数据索引标识进行哈希取模运算处理后,可以得到第一数据索引标识对应的第一模数,由于每一个第一模数对应存储空间中的一个存储位置,因此,可以确定第一数据索引标识对应的存储位置,然后,可以查询存储位置在每个存储空间中的属性值,根据属性值确定与第一索引信息相匹配的第一存储空间,以提高第一存储空间的查找准确率。Taking the first data index identifier as a string composed of invoice code and invoice code as an example, the first data index identifier may be a string composed of the invoice code and the beginning and end of the invoice code, and the first data index identifier is hashed After the modulus operation is processed, the first modulus corresponding to the first data index identification can be obtained. Since each first modulus corresponds to a storage location in the storage space, the storage location corresponding to the first data index identification can be determined, and then , It is possible to query the attribute value of the storage location in each storage space, and determine the first storage space matching the first index information according to the attribute value, so as to improve the search accuracy of the first storage space.
在一些实施例中,为了进一步降低数据存储量,属性值可以由0和1代表,其中,1可以作为预设值,0可以作为初始值。In some embodiments, in order to further reduce the amount of data storage, the attribute value may be represented by 0 and 1, where 1 may be used as a preset value, and 0 may be used as an initial value.
在本申请实施例中,对第一数据索引标识进行哈希取模运算处理的方法有多种。在一些实施例中,其中一种对第一数据索引标识进行哈希取模运算处理得到第一数据索引标识对应的第一模数的具体方法可以包括:In the embodiment of the present application, there are multiple methods for performing hash modulo operation processing on the first data index identifier. In some embodiments, a specific method for performing a hash modulo operation on the first data index identifier to obtain the first modulus corresponding to the first data index identifier may include:
利用多个预设哈希函数分别对第一数据索引标识进行哈希运算处理,得到第一数据索引标识对应的多个第一哈希地址;Utilizing a plurality of preset hash functions to respectively perform a hash operation process on the first data index identifier to obtain a plurality of first hash addresses corresponding to the first data index identifier;
针对每个第一哈希地址,利用输出第一哈希地址的预设哈希函数对应的预设除数对第一哈希地址进行取模运算处理,得到第一数据索引标识对应的多个第一模数。For each first hash address, use the preset divisor corresponding to the preset hash function that outputs the first hash address to perform modulo operation processing on the first hash address to obtain multiple first data index identifiers corresponding to the first hash address. A modulus.
图3示出了根据本申请实施例的存储空间查询过程的示例的原理示意图。如图3所示,第一数据索引标识可以为索引标识Y,属性值的预设值为1,预设哈希函数为Hash 1-Hash 3,预设除数为Mod 1-Mod 3,一个预设哈希函数与一个预设除数一一对应设置,即利用Hash得到的第一哈希地址,需要用Mod 1进行取模运算处理,得到第一模数。由此,可以利用Hash 1-Hash 3分别对索引标识Y进行哈希运算处理,得到3个第一哈希地址,然后利用Mod 1-Mod 3分别对对应的第一哈希地址进行取模运算处理,得到3个第一模数,3个第一模数分别对应3个存储位置。例如,第一模数2、4和7分别对应2、4和7号存储位置。FIG. 3 shows a schematic diagram of an example of a storage space query process according to an embodiment of the present application. As shown in Figure 3, the first data index identifier can be index identifier Y, the preset value of the attribute value is 1, the preset hash function is Hash 1-Hash 3, the preset divisor is Mod 1-Mod 3, and a preset Suppose that the hash function is set in a one-to-one correspondence with a preset divisor, that is, the first hash address obtained by Hash needs to be modulo operation processing with Mod 1 to obtain the first modulus. Therefore, Hash 1-Hash 3 can be used to hash the index identification Y to obtain three first hash addresses, and then Mod 1-Mod 3 can be used to perform modulo operation on the corresponding first hash addresses. After processing, three first moduli are obtained, and the three first moduli respectively correspond to three storage locations. For example, the first modulus 2, 4, and 7 correspond to storage locations 2, 4, and 7, respectively.
布隆过滤器具有3个存储空间,第二个存储空间的2、4和7号存储位 置的属性值分别为1、1、1,则可以确定第二个存储空间对应的判断值为真,其他存储空间对应的判断值为假。因此,第二个存储空间为与第一索引信息相匹配的第一存储空间。Bloom filter has 3 storage spaces. The attribute values of storage locations 2, 4, and 7 of the second storage space are 1, 1, and 1, respectively, and the judgment value corresponding to the second storage space can be determined to be true. The judgment value corresponding to other storage space is false. Therefore, the second storage space is the first storage space that matches the first index information.
在本申请另一些实施例中,第一索引信息为第一数据索引标识对应的第一模数,即直接接收对第一数据索引标识进行哈希取模运算处理后得到的至少一个第一模数。In some other embodiments of the present application, the first index information is the first modulus corresponding to the first data index identifier, that is, at least one first modulus obtained after the hash modulus operation is directly received on the first data index identifier. number.
在这些实施例中,S230的具体方法可以包括:In these embodiments, the specific method of S230 may include:
根据第一模数,确定第一数据索引标识对应的存储位置;According to the first modulus, determine the storage location corresponding to the first data index identifier;
查询存储位置在每个存储空间中的属性值;Query the attribute value of the storage location in each storage space;
将存储位置的属性值均为预设值的存储空间,作为与第一索引信息相匹配的第一存储空间。The storage space whose attribute values of the storage location are all preset values is used as the first storage space matching the first index information.
在这些实施例中,由于每一个第一模数对应存储空间中的一个存储位置,可以直接确定每个第一模数对应的存储位置,然后,可以查询存储位置在每个存储空间中的属性值,根据属性值确定与第一索引信息相匹配的第一存储空间,从而减少数据处理量。In these embodiments, since each first modulus corresponds to a storage location in the storage space, the storage location corresponding to each first modulus can be directly determined, and then the attributes of the storage location in each storage space can be queried. Value, the first storage space matching the first index information is determined according to the attribute value, thereby reducing the amount of data processing.
在本申请一些实施例中,查询存储位置在每个存储空间中的属性值的具体方法可以包括:In some embodiments of the present application, the specific method for querying the attribute value of the storage location in each storage space may include:
按照多个存储空间的排列顺序,依次查询存储位置在每个存储空间中的属性值。According to the sequence of multiple storage spaces, query the attribute value of the storage location in each storage space in turn.
继续参见图3,可以在对第一个存储空间的全部存储位置遍历查询,得到在第一个存储空间中的第一数据索引标识对应的存储位置的属性值后,再分别对第二个存储空间和第三个存储空间的全部存储位置进行遍历查询。这样,在查询到判断值为真的存储空间后,即可以停止查询。由此,在存储空间数量较少时,可以提高查询效率。Continuing to refer to Figure 3, you can traverse the query on all the storage locations of the first storage space, and obtain the attribute value of the storage location corresponding to the first data index identifier in the first storage space, and then perform the second storage respectively. All storage locations of the space and the third storage space are traversed and inquired. In this way, after the storage space with the judgment value as true is queried, the query can be stopped. As a result, when the amount of storage space is small, query efficiency can be improved.
在本申请另一些实施例中,查询存储位置在每个存储空间中的属性值的具体方法可以包括:In some other embodiments of the present application, the specific method for querying the attribute value of the storage location in each storage space may include:
针对每个存储位置,查询存储位置在每个目标存储空间中的属性值;其中,目标存储空间为具有目标存储位置的存储空间,目标存储位置为排列顺序与存储位置前相邻且属性值为预设值的存储位置。For each storage location, query the attribute value of the storage location in each target storage space; among them, the target storage space is the storage space with the target storage location, and the target storage location is arranged in the order adjacent to the storage location and the attribute value is The storage location of the preset value.
继续参见图3,可以先查询每个存储空间内的2号存储位置的属性值,可以确定第一个存储空间和第二个存储空间中的2号存储位置的属性值为1,然后继续查询第一个存储空间和第二个存储空间中的4号存储位置的属性值,以此类推。由此,在存储空间内的存储位置数量较少时,可以提高查询效率。Continue to refer to Figure 3, you can first query the attribute value of the storage location No. 2 in each storage space, you can determine the attribute value of the storage location No. 2 in the first storage space and the second storage space, and then continue to query The attribute value of the storage location No. 4 in the first storage space and the second storage space, and so on. As a result, when the number of storage locations in the storage space is small, query efficiency can be improved.
在本申请一些实施例中,在能够利用布隆过滤器对第一索引信息对应的第一数据所属的第一区块链进行查询之前,还需要在布隆过滤器中的与第一区块链对应的第一存储空间内,将第一索引信息对应的至少一个存储位置的属性值设置为预设值。In some embodiments of the present application, before the bloom filter can be used to query the first block chain to which the first data corresponding to the first index information belongs, it is also necessary to match the first block in the bloom filter to In the first storage space corresponding to the chain, the attribute value of at least one storage location corresponding to the first index information is set as a preset value.
在本申请另一些实施例中,还可以随时对布隆过滤器进行更新,以在其他数据对应的存储空间内将其他数据的索引信息对应的至少一个存储位置的属性值设置为预设值。In some other embodiments of the present application, the Bloom filter can also be updated at any time to set the attribute value of at least one storage location corresponding to the index information of the other data as a preset value in the storage space corresponding to the other data.
下面,将以第二数据和第二数据的第二索引信息对如何更新布隆过滤器进行说明。其中,第二索引信息与第一索引信息的区别在于,第一索引信息未携带有区块链系统标识或区块链标识,而第二索引信息携带有区块链系统标识或区块链标识。Hereinafter, how to update the Bloom filter will be described with the second data and the second index information of the second data. Among them, the difference between the second index information and the first index information is that the first index information does not carry the blockchain system identifier or the blockchain identifier, and the second index information carries the blockchain system identifier or the blockchain identifier .
在本申请一些实施例中,在S210之前,该数据查询方法还可以包括:In some embodiments of the present application, before S210, the data query method may further include:
接收第二索引信息;Receive the second index information;
根据第二索引信息,更新布隆过滤器中的第二存储空间;其中,第二存储空间为与第二区块链相对应的存储空间,第二区块链为第二索引信息对应的第二数据所存储的区块链。According to the second index information, update the second storage space in the Bloom filter; where the second storage space is the storage space corresponding to the second block chain, and the second block chain is the second storage space corresponding to the second index information. 2. The blockchain where the data is stored.
具体地,由于第二索引信息携带有区块链系统标识或区块链标识,可以直接根据第二索引信息所携带的区块链系统标识或区块链标识,对区块链系统标识或区块链标识对应的第二存储空间进行更新。Specifically, since the second index information carries the blockchain system identifier or blockchain identifier, the blockchain system identifier or zone can be directly based on the blockchain system identifier or blockchain identifier carried in the second index information. The second storage space corresponding to the block chain identifier is updated.
在本申请一些实施例中,第二索引信息可以为第二数据索引标识,例如,如果第二数据为发票信息,第二数据索引标识可以为发票编码和/或发票代码构成的字符串,再例如,如果第二数据为加密货币信息,第二数据索引标识可以为账户地址对应的字符串。In some embodiments of the present application, the second index information may be a second data index identifier. For example, if the second data is invoice information, the second data index identifier may be a string composed of an invoice code and/or an invoice code. For example, if the second data is encrypted currency information, the second data index identifier may be a character string corresponding to the account address.
其中,第二数据可以为与第一数据相同的数据,也可以为与第一数据 不同的其他数据。Wherein, the second data may be the same data as the first data, or may be other data different from the first data.
在这些实施例中,根据第二索引信息更新布隆过滤器中的第二存储空间的具体方法可以包括:In these embodiments, the specific method for updating the second storage space in the Bloom filter according to the second index information may include:
对第二数据索引标识进行哈希取模运算处理,得到第二数据索引标识对应的第二模数;Perform hash modulo operation processing on the second data index identifier to obtain the second modulus corresponding to the second data index identifier;
根据第二模数,确定第二数据索引标识对应的存储位置;According to the second modulus, determine the storage location corresponding to the second data index identifier;
将第二存储空间中的存储位置的属性值,由初始值更新为预设值。The attribute value of the storage location in the second storage space is updated from the initial value to the preset value.
具体地,对第二数据索引标识进行哈希取模运算处理的方法与上述的对第一数据索引标识进行哈希取模运算处理的方法相似,在此不做赘述。Specifically, the method for performing a hash modulus operation on the second data index identifier is similar to the above-mentioned method for performing a hash modulus operation on the first data index identifier, and will not be repeated here.
图4示出了根据本申请实施例的布隆过滤器更新过程的示例的原理示意图。如图4所示,第二数据索引标识可以为索引标识X,索引标识X携带有区块链标识,属性值的预设值为1,预设哈希函数为Hash 1-Hash 3,预设除数为Mod 1-Mod 3,一个预设哈希函数与一个预设除数一一对应设置,即利用Hash得到的第二哈希地址,需要用Mod 1进行取模运算处理,得到第二模数。由此,可以利用Hash 1-Hash 3分别对索引标识X进行哈希运算处理,得到3个第二哈希地址,然后利用Mod 1-Mod 3分别对对应的第二哈希地址进行取模运算处理,得到3个第二模数,3个第二模数分别对应3个存储位置。例如,第一模数2、4和7分别对应2、4和7号存储位置。Fig. 4 shows a schematic diagram of an example of a Bloom filter update process according to an embodiment of the present application. As shown in Figure 4, the second data index identifier can be an index identifier X, which carries a blockchain identifier. The default value of the attribute value is 1, and the default hash function is Hash 1-Hash 3. The divisor is Mod 1-Mod 3, and a preset hash function is set in a one-to-one correspondence with a preset divisor, that is, the second hash address obtained by Hash needs to be modulo 1 to obtain the second modulus. number. Therefore, Hash 1-Hash 3 can be used to hash the index identifier X to obtain three second hash addresses, and then Mod 1-Mod 3 can be used to perform modulo operation on the corresponding second hash addresses. After processing, 3 second moduli are obtained, and the 3 second moduli respectively correspond to 3 storage locations. For example, the first modulus 2, 4, and 7 correspond to storage locations 2, 4, and 7, respectively.
布隆过滤器具有3个存储空间,每个存储空间对应一个区块链,根据索引标识X所携带的区块链标识,可以确定区块链标识对应的第二个存储空间为第二存储空间,则将第二个存储空间的2、4和7号存储位置的属性值分别设置为1、1、1,完成布隆过滤器针对索引标识X的更新。Bloom filter has 3 storage spaces, and each storage space corresponds to a blockchain. According to the blockchain identifier carried by the index identifier X, it can be determined that the second storage space corresponding to the blockchain identifier is the second storage space , Set the attribute values of the storage locations 2, 4, and 7 of the second storage space to 1, 1, and 1, respectively, to complete the update of the Bloom filter for the index mark X.
在本申请另一些实施例中,第二索引信息为第二数据索引标识对应的第二模数,即直接接收对第二数据索引标识进行哈希取模运算处理后得到的至少一个第二模数。In some other embodiments of the present application, the second index information is the second modulus corresponding to the second data index identifier, that is, at least one second modulus obtained after the hash modulo operation is directly received on the second data index identifier. number.
在这些实施例中,根据第二索引信息更新布隆过滤器中的第二存储空间的具体方法可以包括:In these embodiments, the specific method for updating the second storage space in the Bloom filter according to the second index information may include:
根据第二模数,确定第二数据索引标识对应的存储位置;According to the second modulus, determine the storage location corresponding to the second data index identifier;
将第二存储空间中的存储位置的属性值,由初始值更新为预设值。The attribute value of the storage location in the second storage space is updated from the initial value to the preset value.
在这些实施例中,由于每一个第二模数对应存储空间中的一个存储位置,并且第二模数携带有区块链标识,则可以直接在区块链标识对应的第二存储空间中确定每个第二模数对应的存储位置,然后,将所确定的存储位置的属性值更新为预设值。In these embodiments, since each second modulus corresponds to a storage location in the storage space, and the second modulus carries a blockchain identifier, it can be directly determined in the second storage space corresponding to the blockchain identifier Each second modulus corresponds to a storage location, and then the determined attribute value of the storage location is updated to a preset value.
在本申请实施例中,可以通过区块链系统推送、存储有布隆过滤器的服务器或电子设备对各个区块链系统进行监听、或者存储有布隆过滤器的服务器或电子设备对各个区块链进行查询的方法,获取第二索引信息进行获取。In the embodiment of the present application, the server or electronic device storing the Bloom filter can be pushed through the blockchain system to monitor each blockchain system, or the server or electronic device storing the Bloom filter can monitor each area. The block chain query method is to obtain the second index information for obtaining.
在一些实施例中,接收第二索引信息的具体方法可以包括:In some embodiments, the specific method of receiving the second index information may include:
接收第二网关节点发送的第一通知信息;其中,第二网关节点属于第二区块链系统,第二区块链系统为具有第二区块链的区块链系统,第一通知信息用于表征第二区块链系统已经将第二数据存储在第二区块链中,第一通知信息包括第二索引信息。Receive the first notification information sent by the second gateway node; where the second gateway node belongs to the second blockchain system, the second blockchain system is a blockchain system with a second blockchain, and the first notification information is used To indicate that the second blockchain system has stored the second data in the second blockchain, the first notification information includes the second index information.
在第二区块链系统具有第二网关节点的情况下,由于网关节点能够与其他系统进行通信,第二网关节点在第二区块链中上传了第二数据时,可以主动将包括第二数据对应的第二索引信息的第一通知信息发送给存储有布隆过滤器的服务器或电子设备,以使存储有布隆过滤器的服务器或电子设备接收第一通知信息,并且从第一通知信息中获取携带有区块链系统标识或者区块链标识的第二索引信息。In the case that the second blockchain system has a second gateway node, since the gateway node can communicate with other systems, when the second gateway node uploads the second data in the second blockchain, it can actively include the second gateway node. The first notification information of the second index information corresponding to the data is sent to the server or the electronic device storing the bloom filter, so that the server or the electronic device storing the bloom filter receives the first notification information and receives the notification from the first notification. The second index information carrying the blockchain system identifier or the blockchain identifier is obtained from the information.
在这些实施例中,第二索引信息可以为第二数据索引标识,也可以为第二数据索引标识对应的第二模数。In these embodiments, the second index information may be a second data index identifier, or may be a second modulus corresponding to the second data index identifier.
在另一些实施例中,在接收第二索引信息之前,该数据查询方法还可以包括:In other embodiments, before receiving the second index information, the data query method may further include:
向第二区块链节点发送事件注册请求,以使第二区块链节点响应于事件注册请求,注册监听事件;其中,监听事件用于监听第二数据的数据存储事件,第二区块链节点属于第二区块链系统,第二区块链系统为具有第二区块链的区块链系统;Send an event registration request to the second blockchain node, so that the second blockchain node can register a monitoring event in response to the event registration request; the monitoring event is used to monitor the data storage event of the second data, and the second blockchain The node belongs to the second blockchain system, and the second blockchain system is a blockchain system with a second blockchain;
在这些实施例中,接收第二索引信息的具体方法可以包括:In these embodiments, the specific method of receiving the second index information may include:
接收第二区块链节点发送的第二通知信息;其中,第二通知信息用于表征第二区块链系统触发监听事件,第二通知信息包括第二索引信息。Receive second notification information sent by a second blockchain node; where the second notification information is used to characterize the second blockchain system triggering a monitoring event, and the second notification information includes second index information.
在第二区块链系统不具有第二网关节点的情况下,存储有布隆过滤器的服务器或电子设备可以向第二区块链系统中的每个第二区块链节点发送事件注册请求,以使每个第二区块链节点中分别注册用于监听第二数据的数据存储事件的监听事件,只要是任一个第二区块链节点向第二区块链上传了第二数据,该第二区块链节点内的监听事件则会被触发,该第二区块链节点会向存储有布隆过滤器的服务器或电子设备反馈触发监听事件的第二通知信息,使得存储有布隆过滤器的服务器或电子设备可以从接收到的第二通知信息中获取携带有区块链系统标识或者区块链标识的第二索引信息。In the case that the second blockchain system does not have a second gateway node, the server or electronic device storing the Bloom filter can send an event registration request to each second blockchain node in the second blockchain system , So that each second blockchain node separately registers a monitoring event for monitoring the data storage event of the second data, as long as any second blockchain node uploads the second data to the second blockchain, The monitoring event in the second blockchain node will be triggered, and the second blockchain node will feed back the second notification information that triggers the monitoring event to the server or electronic device where the bloom filter is stored, so that the The server or electronic device of the Long Filter can obtain the second index information carrying the blockchain system identifier or the blockchain identifier from the received second notification information.
在这些实施例中,第二索引信息可以为第二数据索引标识。In these embodiments, the second index information may be a second data index identifier.
在又一些实施例中,接收第二索引信息的具体方法可以包括:In still other embodiments, the specific method of receiving the second index information may include:
接收第二区块链在当前时刻下所存储的当前数据和在上一时刻下所存储的历史数据;Receive the current data stored by the second blockchain at the current moment and the historical data stored at the previous moment;
将存在于当前数据中且不存在于历史数据中的数据,作为第二数据;Use data that exists in the current data but not in the historical data as the second data;
获取第二数据的第二索引信息。Obtain the second index information of the second data.
在这些实施例中,存储有布隆过滤器的服务器或电子设备可以实时地获取每个时刻下第二区块链所存储的数据,并且将在当前时刻下所存储的当前数据和在上一时刻下所存储的历史数据进行比较,将存在于当前数据中且不存在于历史数据中的数据,即第二区块链中新增的数据作为第二数据,然后从第二数据中获取第二索引信息。In these embodiments, the server or electronic device storing the Bloom filter can obtain the data stored in the second blockchain at each moment in real time, and compare the current data stored at the current moment with the previous The historical data stored at the moment is compared, the data that exists in the current data and does not exist in the historical data, that is, the newly added data in the second blockchain, is used as the second data, and then the second data is obtained from the second data. 2. Index information.
在这些实施例中,第二索引信息可以为第二数据索引标识。In these embodiments, the second index information may be a second data index identifier.
在本申请一些实施例中,在数据查询方法由服务器执行的情况下,服务器可以为数据查询平台的服务器集群中的任一个服务器,布隆过滤器可以存储在服务器的任何存储区域存储。In some embodiments of the present application, when the data query method is executed by a server, the server may be any server in the server cluster of the data query platform, and the bloom filter may be stored in any storage area of the server.
在本申请另一些实施例中,在数据查询方法由服务器执行的情况下,服务器可以为数据查询平台对应的查询平台区块链系统的任一个查询平台区块链节点,即第三区块链节点,查询平台区块链系统可以为多个用于存 储待查询的数据的区块链系统共建的分布式账本平台系统,即第三区块链系统,查询平台区块链系统的每个查询平台区块链节点对应一个用于存储待查询的数据的区块链系统,使每个查询平台区块链节点与对应的区块链系统之间可以进行通信,以获取对应的区块链系统发送的第二索引信息。In other embodiments of the present application, when the data query method is executed by the server, the server may be any query platform blockchain node of the query platform blockchain system corresponding to the data query platform, that is, the third blockchain Node, query platform blockchain system can be a distributed ledger platform system jointly built by multiple blockchain systems for storing data to be queried, namely the third blockchain system, query platform blockchain system for each The query platform blockchain node corresponds to a blockchain system for storing the data to be queried, so that each query platform blockchain node can communicate with the corresponding blockchain system to obtain the corresponding blockchain The second index information sent by the system.
在这些实施例中,第三区块链节点属于第三区块链系统,第三区块链系统对应的第三区块链用于存储布隆过滤器的更新数据,即每当第三区块链节点接收到第二索引信息,并基于第二索引信息对布隆过滤器进行更新后,本次更新的更新数据被上传至第三区块链系统对应的第三区块链。而布隆过滤器可以存储于第三区块链节点的全局状态存储空间内,从而保证布隆过滤器中的各个存储位置的属性值可以更改。In these embodiments, the third blockchain node belongs to the third blockchain system, and the third blockchain corresponding to the third blockchain system is used to store the update data of the Bloom filter, that is, whenever the third area After the block chain node receives the second index information and updates the Bloom filter based on the second index information, the updated data of this update is uploaded to the third block chain corresponding to the third block chain system. The bloom filter can be stored in the global state storage space of the third blockchain node, so as to ensure that the attribute value of each storage location in the bloom filter can be changed.
在本申请实施例中,第一区块链和第二区块链可以分别是同构或异构的区块链,在此不做限制。In the embodiments of the present application, the first block chain and the second block chain may be homogeneous or heterogeneous block chains respectively, which is not limited here.
图5示出了本申请的数据查询装置的实施例的结构示意图。图5所示的装置可以设置于电子设备或者服务器内。其中,电子设备可以为图1所示的用户设备110,服务器可以为图1所示的服务器120。Fig. 5 shows a schematic structural diagram of an embodiment of the data query device of the present application. The device shown in FIG. 5 may be installed in an electronic device or a server. The electronic device may be the user equipment 110 shown in FIG. 1, and the server may be the server 120 shown in FIG. 1.
本申请实施例中,服务器可以是一种高性能的电子计算器,用于存储和处理数据;电子设备包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。In the embodiments of this application, the server may be a high-performance electronic calculator for storing and processing data; electronic devices include, but are not limited to, mobile phones, tablet computers, notebook computers, palmtop computers, vehicle-mounted terminals, wearable devices, and Pedometer, etc.
如图5所示,该数据查询装置300可以包括:As shown in FIG. 5, the data query device 300 may include:
请求接收模块310,用于接收数据查询请求;其中,数据查询请求包括第一索引信息;The request receiving module 310 is configured to receive a data query request; wherein, the data query request includes first index information;
空间查询模块320,用于响应于数据查询请求,在布隆过滤器的多个存储空间中,查询与第一索引信息相匹配的第一存储空间;其中,一个存储空间与一个区块链相对应,每个区块链中所存储的数据不同;The space query module 320 is used to query the first storage space that matches the first index information among the multiple storage spaces of the Bloom filter in response to the data query request; among them, one storage space is related to one blockchain Correspondingly, the data stored in each blockchain is different;
数据查询模块330,用于在与第一存储空间相对应的第一区块链中,查询与第一索引信息相对应的第一数据。The data query module 330 is configured to query the first data corresponding to the first index information in the first blockchain corresponding to the first storage space.
在本申请实施例中,在接收到数据查询请求后,能够根据数据查询请求中的第一索引信息,在布隆过滤器的多个存储空间中查询与第一索引信息相匹配的第一存储空间,从而可以根据第一存储空间快速定位到所需查 询的第一数据所存储的第一区块链,并且直接在与第一存储空间相对应的第一区块链中查询第一数据,在数据查询时,无需遍历不同的区块链进行迭代查询,简化了数据查询的过程,提高了数据查询的效率。另外,由于布隆过滤器中所存储的数据为无实际意义的属性值,因此,不会泄露数据的隐私,提高了数据存储和数据查询的安全性。In the embodiment of the present application, after receiving the data query request, according to the first index information in the data query request, the multiple storage spaces of the Bloom filter can be queried for the first storage that matches the first index information. Space, it is possible to quickly locate the first block chain stored in the first data that needs to be queried according to the first storage space, and directly query the first data in the first block chain corresponding to the first storage space, When querying data, there is no need to traverse different blockchains for iterative query, which simplifies the process of data query and improves the efficiency of data query. In addition, since the data stored in the Bloom filter is an attribute value with no practical significance, the privacy of the data will not be leaked, and the security of data storage and data query is improved.
在本申请一些实施例中,第一索引信息可以为第一数据索引标识。In some embodiments of the present application, the first index information may be a first data index identifier.
在这些实施例中,空间查询模块320可以具体用于:In these embodiments, the spatial query module 320 may be specifically used to:
对第一数据索引标识进行哈希取模运算处理,得到第一数据索引标识对应的第一模数;Performing hash modulo operation processing on the first data index identifier to obtain the first modulus corresponding to the first data index identifier;
根据第一模数,确定第一数据索引标识对应的存储位置;According to the first modulus, determine the storage location corresponding to the first data index identifier;
查询存储位置在每个存储空间中的属性值;Query the attribute value of the storage location in each storage space;
将存储位置的属性值均为预设值的存储空间,作为与第一索引信息相匹配的第一存储空间。The storage space whose attribute values of the storage location are all preset values is used as the first storage space matching the first index information.
在这些实施例中,可选地,空间查询模块320可以进一步用于:In these embodiments, optionally, the spatial query module 320 may be further used to:
利用多个预设哈希函数分别对第一数据索引标识进行哈希运算处理,得到第一数据索引标识对应的多个第一哈希地址;Utilizing a plurality of preset hash functions to respectively perform a hash operation process on the first data index identifier to obtain a plurality of first hash addresses corresponding to the first data index identifier;
针对每个第一哈希地址,利用输出第一哈希地址的预设哈希函数对应的预设除数对第一哈希地址进行取模运算处理,得到第一数据索引标识对应的多个第一模数。For each first hash address, use the preset divisor corresponding to the preset hash function that outputs the first hash address to perform modulo operation processing on the first hash address to obtain multiple first data index identifiers corresponding to the first hash address. A modulus.
在本申请另一些实施例中,第一索引信息可以为第一数据索引标识对应的第一模数。In other embodiments of the present application, the first index information may be the first modulus corresponding to the first data index identifier.
在这些实施例中,空间查询模块320还可以具体用于:In these embodiments, the spatial query module 320 may also be specifically used to:
根据第一模数,确定第一数据索引标识对应的存储位置;According to the first modulus, determine the storage location corresponding to the first data index identifier;
查询存储位置在每个存储空间中的属性值;Query the attribute value of the storage location in each storage space;
将存储位置的属性值均为预设值的存储空间,作为与第一索引信息相匹配的第一存储空间。The storage space whose attribute values of the storage location are all preset values is used as the first storage space matching the first index information.
在本申请一些实施例中,空间查询模块320可以具体用于:In some embodiments of the present application, the spatial query module 320 may be specifically used to:
按照多个存储空间的排列顺序,依次查询存储位置在每个存储空间中的属性值。According to the sequence of multiple storage spaces, query the attribute value of the storage location in each storage space in turn.
在本申请另一些实施例中,空间查询模块320还可以具体用于:In some other embodiments of the present application, the spatial query module 320 may also be specifically used to:
针对每个存储位置,查询存储位置在每个目标存储空间中的属性值;其中,目标存储空间为具有目标存储位置的存储空间,目标存储位置为排列顺序与存储位置前相邻且属性值为预设值的存储位置。For each storage location, query the attribute value of the storage location in each target storage space; among them, the target storage space is the storage space with the target storage location, and the target storage location is arranged in the order adjacent to the storage location and the attribute value is The storage location of the preset value.
在本申请一些实施例中,该数据查询装置300还可以包括:In some embodiments of the present application, the data query device 300 may further include:
信息接收模块,用于接收第二索引信息;An information receiving module for receiving second index information;
信息更新模块,用于根据第二索引信息,更新布隆过滤器中的第二存储空间;其中,第二存储空间为与第二区块链相对应的存储空间,第二区块链为第二索引信息对应的第二数据所存储的区块链。The information update module is used to update the second storage space in the Bloom filter according to the second index information; where the second storage space is the storage space corresponding to the second blockchain, and the second blockchain is the first The block chain where the second data corresponding to the second index information is stored.
在本申请一些实施例中,第二索引信息可以为第二数据索引标识。In some embodiments of the present application, the second index information may be a second data index identifier.
在这些实施例中,信息更新模块可以具体用于:In these embodiments, the information update module can be specifically used for:
对第二数据索引标识进行哈希取模运算处理,得到第二数据索引标识对应的第二模数;Perform hash modulo operation processing on the second data index identifier to obtain the second modulus corresponding to the second data index identifier;
根据第二模数,确定第二数据索引标识对应的存储位置;According to the second modulus, determine the storage location corresponding to the second data index identifier;
将第二存储空间中的存储位置的属性值,由初始值更新为预设值。The attribute value of the storage location in the second storage space is updated from the initial value to the preset value.
在本申请另一些实施例中,第二索引信息可以为第二数据索引标识对应的第二模数。In some other embodiments of the present application, the second index information may be a second modulus corresponding to the second data index identifier.
在这些实施例中,信息更新模块还可以具体用于:In these embodiments, the information update module can also be specifically used for:
根据第二模数,确定第二数据索引标识对应的存储位置;According to the second modulus, determine the storage location corresponding to the second data index identifier;
将第二存储空间中的存储位置的属性值,由初始值更新为预设值。The attribute value of the storage location in the second storage space is updated from the initial value to the preset value.
在本申请一些实施例中,信息接收模块可以具体用于:In some embodiments of the present application, the information receiving module may be specifically used for:
接收第二网关节点发送的第一通知信息;其中,第二网关节点属于第二区块链系统,第二区块链系统为具有第二区块链的区块链系统,第一通知信息用于表征第二区块链系统已经将第二数据存储在第二区块链中,第一通知信息包括第二索引信息。Receive the first notification information sent by the second gateway node; where the second gateway node belongs to the second blockchain system, the second blockchain system is a blockchain system with a second blockchain, and the first notification information is used To indicate that the second blockchain system has stored the second data in the second blockchain, the first notification information includes the second index information.
在本申请另一些实施例中,该数据查询装置300还可以包括:In some other embodiments of the present application, the data query device 300 may further include:
请求发送模块,用于向第二区块链节点发送事件注册请求,以使第二区块链节点响应于事件注册请求,注册监听事件;其中,监听事件用于监听第二数据的数据存储事件,第二区块链节点属于第二区块链系统,第二 区块链系统为具有第二区块链的区块链系统;The request sending module is used to send an event registration request to the second blockchain node, so that the second blockchain node can register a monitoring event in response to the event registration request; wherein the monitoring event is used to monitor the data storage event of the second data , The second blockchain node belongs to the second blockchain system, and the second blockchain system is a blockchain system with a second blockchain;
在这些实施例中,信息接收模块还可以具体用于:In these embodiments, the information receiving module can also be specifically used to:
接收第二区块链节点发送的第二通知信息;其中,第二通知信息用于表征第二区块链系统触发监听事件,第二通知信息包括第二索引信息。Receive second notification information sent by a second blockchain node; where the second notification information is used to characterize the second blockchain system triggering a monitoring event, and the second notification information includes second index information.
在本申请又一些实施例中,信息接收模块也可以具体用于:In some other embodiments of the present application, the information receiving module may also be specifically used for:
接收第二区块链在当前时刻下所存储的当前数据和在上一时刻下所存储的历史数据;Receive the current data stored by the second blockchain at the current moment and the historical data stored at the previous moment;
将存在于当前数据中且不存在于历史数据中的数据,作为第二数据;Use data that exists in the current data but not in the historical data as the second data;
获取第二数据的第二索引信息。Obtain the second index information of the second data.
在本申请一些实施例中,布隆过滤器可以存储于第三区块链节点的全局状态存储空间内,第三区块链节点属于第三区块链系统,第三区块链系统对应的第三区块链用于存储布隆过滤器的更新数据。In some embodiments of the present application, the Bloom filter can be stored in the global state storage space of the third blockchain node. The third blockchain node belongs to the third blockchain system, and the third blockchain system corresponds to The third blockchain is used to store the update data of the Bloom filter.
在本申请一些实施例中,数据查询模块330可以具体用于:In some embodiments of the present application, the data query module 330 may be specifically used to:
获取第一区块链所存储的数据;Obtain the data stored in the first blockchain;
在所获取的数据中,查询与第一索引信息相对应的第一数据。Among the acquired data, the first data corresponding to the first index information is queried.
在这些实施例中,可选地,请求接收模块310可以具体用于:In these embodiments, optionally, the request receiving module 310 may be specifically configured to:
接收目标设备发送的数据查询请求;Receive the data query request sent by the target device;
在这些实施例中,可选地,该数据查询装置300还可以包括:In these embodiments, optionally, the data query device 300 may further include:
数据发送模块,用于将第一数据发送至目标设备。The data sending module is used to send the first data to the target device.
在本申请另一些实施例中,请求接收模块310还可以具体用于:In some other embodiments of the present application, the request receiving module 310 may also be specifically used to:
接收目标设备发送的数据查询请求;Receive the data query request sent by the target device;
在这些实施例中,可选地,数据查询模块330还可以具体用于:In these embodiments, optionally, the data query module 330 may also be specifically used to:
向目标设备发送查询指示信息,查询指示信息用于指示第一存储空间相对应的第一区块链,以使目标设备根据查询指示信息,在第一区块链中查询与第一索引信息相对应的第一数据。Send query instruction information to the target device. The query instruction information is used to indicate the first blockchain corresponding to the first storage space, so that the target device can query the first blockchain in the first blockchain according to the query instruction information. The corresponding first data.
在本申请又一些实施例中,数据查询模块330也可以具体用于:In still other embodiments of the present application, the data query module 330 may also be specifically used to:
向第一网关节点发送数据查询请求,以使第一网关节点响应于数据查询请求,在第一区块链中查询与第一索引信息相对应的第一数据;其中,第一网关节点属于第一区块链系统,第一区块链系统为具有第一区块链的 区块链系统;Send a data query request to the first gateway node, so that the first gateway node queries the first block chain for the first data corresponding to the first index information in response to the data query request; wherein, the first gateway node belongs to the first block chain. A block chain system, the first block chain system is a block chain system with the first block chain;
接收第一网关节点反馈的第一数据。Receive the first data fed back by the first gateway node.
需要说明的是,本申请实施例提供的数据查询装置300能够实现图2-4的方法实施例中电子设备或者服务器所实现的各个过程和效果,并且实现各个过程的原理相似,为避免重复,这里不再赘述。It should be noted that the data query apparatus 300 provided by the embodiment of the present application can implement the various processes and effects implemented by the electronic device or server in the method embodiments of FIGS. 2-4, and the principles for implementing each process are similar. To avoid repetition, I won't repeat it here.
图6示出了本申请的数据查询设备的实施例的硬件结构示意图。如图6所示,数据查询设备可以包括处理器401以及存储有计算机程序指令的存储器402。Fig. 6 shows a schematic diagram of the hardware structure of an embodiment of the data query device of the present application. As shown in FIG. 6, the data query device may include a processor 401 and a memory 402 storing computer program instructions.
具体地,上述处理器401可以包括中央处理器(CPU),或者特定集成电路(Application Specific Integrated Circuit,ASIC),或者可以被配置成实施本申请实施例的一个或多个集成电路。Specifically, the foregoing processor 401 may include a central processing unit (CPU), or a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
存储器402可以包括用于数据或指令的大容量存储器。举例来说而非限制,存储器402可包括硬盘驱动器(Hard Disk Drive,HDD)、软盘驱动器、闪存、光盘、磁光盘、磁带或通用串行总线(Universal Serial Bus,USB)驱动器或者两个或更多个以上这些的组合。在合适的情况下,存储器402可包括可移除或不可移除(或固定)的介质。在合适的情况下,存储器402可在综合网关容灾设备的内部或外部。在特定实施例中,存储器402是非易失性固态存储器。在特定实施例中,存储器402包括只读存储器(ROM)。在合适的情况下,该ROM可以是掩模编程的ROM、可编程ROM(PROM)、可擦除PROM(EPROM)、电可擦除PROM(EEPROM)、电可改写ROM(EAROM)或闪存或者两个或更多个以上这些的组合。The memory 402 may include mass storage for data or instructions. For example and not limitation, the memory 402 may include a hard disk drive (Hard Disk Drive, HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape or a Universal Serial Bus (USB) drive or two or more Multiple combinations of these. Where appropriate, the storage 402 may include removable or non-removable (or fixed) media. Where appropriate, the memory 402 may be inside or outside the integrated gateway disaster recovery device. In a particular embodiment, the memory 402 is a non-volatile solid state memory. In a particular embodiment, the memory 402 includes read-only memory (ROM). Where appropriate, the ROM can be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), electrically rewritable ROM (EAROM) or flash memory or A combination of two or more of these.
处理器401通过读取并执行存储器402中存储的计算机程序指令,以实现上述实施例中的任意一种数据查询方法。The processor 401 reads and executes computer program instructions stored in the memory 402 to implement any one of the data query methods in the foregoing embodiments.
在一个示例中,数据查询设备还可包括通信接口403和总线410。其中,如图6所示,处理器401、存储器402、通信接口403通过总线410连接并完成相互间的通信。In an example, the data query device may further include a communication interface 403 and a bus 410. Among them, as shown in FIG. 6, the processor 401, the memory 402, and the communication interface 403 are connected through a bus 410 and complete mutual communication.
通信接口403,主要用于实现本申请实施例中各模块、装置、单元和/或设备之间的通信。The communication interface 403 is mainly used to implement communication between various modules, devices, units and/or devices in the embodiments of the present application.
总线410包括硬件、软件或两者,将数据查询设备的部件彼此耦接在一起。举例来说而非限制,总线可包括加速图形端口(AGP)或其他图形总线、增强工业标准架构(EISA)总线、前端总线(FSB)、超传输(HT)互连、工业标准架构(ISA)总线、无限带宽互连、低引脚数(LPC)总线、存储器总线、微信道架构(MCA)总线、外围组件互连(PCI)总线、PCI-E4press(PCI-4)总线、串行高级技术附件(SATA)总线、视频电子标准协会局部(VLB)总线或其他合适的总线或者两个或更多个以上这些的组合。在合适的情况下,总线410可包括一个或多个总线。尽管本申请实施例描述和示出了特定的总线,但本申请考虑任何合适的总线或互连。The bus 410 includes hardware, software, or both, and couples the components of the data query device to each other. For example and not limitation, the bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnect, industry standard architecture (ISA) Bus, Infinite Bandwidth Interconnect, Low Pin Count (LPC) Bus, Memory Bus, Micro Channel Architecture (MCA) Bus, Peripheral Component Interconnect (PCI) Bus, PCI-E4press (PCI-4) Bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association Local (VLB) bus or other suitable bus or a combination of two or more of these. Where appropriate, the bus 410 may include one or more buses. Although the embodiments of this application describe and show a specific bus, this application considers any suitable bus or interconnection.
该数据查询设备可以执行本申请实施例中的数据查询方法,从而实现结合图2至图5描述的数据查询方法和装置。The data query device can execute the data query method in the embodiment of the present application, thereby realizing the data query method and device described in conjunction with FIG. 2 to FIG. 5.
另外,结合上述实施例中的数据查询方法,本申请实施例可提供一种计算机可读存储介质来实现。该计算机可读存储介质上存储有计算机程序指令;该计算机程序指令被处理器执行时实现上述实施例中的任意一种数据查询方法。计算机可读存储介质的示例可以是非暂态计算机可读存储介质,包括ROM、RAM、磁碟或者光盘等。In addition, in combination with the data query method in the foregoing embodiment, the embodiment of the present application may provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the data query methods in the foregoing embodiments is implemented. An example of the computer-readable storage medium may be a non-transitory computer-readable storage medium, including ROM, RAM, magnetic disk, or optical disk.
需要明确的是,本申请并不局限于上文所描述并在图中示出的特定配置和处理。为了简明起见,这里省略了对已知方法的详细描述。在上述实施例中,描述和示出了若干具体的步骤作为示例。但是,本申请的方法过程并不限于所描述和示出的具体步骤,本领域的技术人员可以在领会本申请的精神后,作出各种改变、修改和添加,或者改变步骤之间的顺序。It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figure. For the sake of brevity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown. After understanding the spirit of the present application, those skilled in the art can make various changes, modifications and additions, or change the sequence between the steps.
以上所述的结构框图中所示的功能块可以实现为硬件、软件、固件或者它们的组合。当以硬件方式实现时,其可以例如是电子电路、专用集成电路(ASIC)、适当的固件、插件、功能卡等等。当以软件方式实现时,本申请的元素是被用于执行所需任务的程序或者代码段。程序或者代码段可以存储在机器可读介质中,或者通过载波中携带的数据信号在传输介质或者通信链路上传送。“机器可读介质”可以包括能够存储或传输信息的任何介质。机器可读介质的例子包括电子电路、半导体存储器设备、ROM、闪存、可擦除ROM(EROM)、软盘、CD-ROM、光盘、硬盘、光纤介质、 射频(RF)链路,等等。代码段可以经由诸如因特网、内联网等的计算机网络被下载。The functional blocks shown in the above-mentioned structural block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, and so on. When implemented in software, the elements of this application are programs or code segments used to perform required tasks. The program or code segment may be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link through a data signal carried in a carrier wave. "Machine-readable medium" may include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and so on. The code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.
还需要说明的是,本申请中提及的示例性实施例,基于一系列的步骤或者装置描述一些方法或系统。但是,本申请不局限于上述步骤的顺序,也就是说,可以按照实施例中提及的顺序执行步骤,也可以不同于实施例中的顺序,或者若干步骤同时执行。It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps may be performed in the order mentioned in the embodiments, or may be different from the order in the embodiments, or several steps may be performed at the same time.
本申请实施例还提供了一种数据查询系统,该包括数据查询系统多个区块链系统和数据查询设备。其中,每个区块链系统具有一个区块链,每个区块链中所存储的数据不同。数据查询设备用于接收数据查询请求;其中,数据查询请求包括第一索引信息;响应于数据查询请求,在布隆过滤器的多个存储空间中,查询与第一索引信息相匹配的第一存储空间;其中,一个存储空间与一个区块链相对应;在与第一存储空间相对应的第一区块链中,查询与第一索引信息相对应的第一数据。The embodiment of the present application also provides a data query system, which includes a data query system, multiple blockchain systems and data query equipment. Among them, each blockchain system has a blockchain, and the data stored in each blockchain is different. The data query device is used to receive a data query request; wherein the data query request includes the first index information; in response to the data query request, in the multiple storage spaces of the Bloom filter, the first index matching the first index information is queried. Storage space; among them, one storage space corresponds to one block chain; in the first block chain corresponding to the first storage space, query the first data corresponding to the first index information.
在本申请实施例中,在接收到数据查询请求后,能够根据数据查询请求中的第一索引信息,在布隆过滤器的多个存储空间中查询与第一索引信息相匹配的第一存储空间,从而可以根据第一存储空间快速定位到所需查询的第一数据所存储的第一区块链,并且直接在与第一存储空间相对应的第一区块链中查询第一数据,在数据查询时,无需遍历不同的区块链进行迭代查询,简化了数据查询的过程,提高了数据查询的效率。另外,由于布隆过滤器中所存储的数据为无实际意义的属性值,因此,不会泄露数据的隐私,提高了数据存储和数据查询的安全性。In the embodiment of the present application, after receiving the data query request, according to the first index information in the data query request, the multiple storage spaces of the Bloom filter can be queried for the first storage that matches the first index information. Space, it is possible to quickly locate the first block chain stored in the first data that needs to be queried according to the first storage space, and directly query the first data in the first block chain corresponding to the first storage space, When querying data, there is no need to traverse different blockchains for iterative query, which simplifies the process of data query and improves the efficiency of data query. In addition, since the data stored in the Bloom filter is an attribute value with no practical significance, the privacy of the data will not be leaked, and the security of data storage and data query is improved.
在本申请实施例中,数据查询设备可以为电子设备或者服务器。其中,电子设备可以为图1所示的用户设备110,服务器可以为图1所示的服务器120。In the embodiment of the present application, the data query device may be an electronic device or a server. The electronic device may be the user equipment 110 shown in FIG. 1, and the server may be the server 120 shown in FIG. 1.
本申请实施例中,服务器可以是一种高性能的电子计算机,用于存储和处理数据;电子设备包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。In the embodiments of this application, the server may be a high-performance electronic computer for storing and processing data; electronic devices include, but are not limited to, mobile phones, tablet computers, notebook computers, palmtop computers, vehicle-mounted terminals, wearable devices, and computers. Stepper and so on.
以数据查询设备为数据查询平台的服务器、区块链系统为存储电子发票信息的区块链系统为例,每个发票系统可以分别通过该发票系统对应的 区块链系统存储其所拥有的电子发票信息,例如,深圳税务局的发票系统采用TrustSQL区块链底层平台建设其对应的区块链系统,用于存储深圳税务局开具的电子发票信息。再例如,福建税务局的发票系统采用Hyperledger Fabric联盟链建设其对应的区块链系统,用于存储福建税务局开具的电子发票信息。此时,数据索引标识为由发票编码和发票代码首尾拼接所构成的字符串。Take the data query equipment as the server of the data query platform, and the blockchain system as the blockchain system for storing electronic invoice information. Each invoice system can store its own electronic invoices through the corresponding blockchain system of the invoice system. Invoice information, for example, the invoice system of the Shenzhen Taxation Bureau uses the TrustSQL blockchain underlying platform to build its corresponding blockchain system, which is used to store the electronic invoice information issued by the Shenzhen Taxation Bureau. For another example, the invoice system of the Fujian Taxation Bureau adopts the Hyperledger Fabric alliance chain to build its corresponding blockchain system, which is used to store the electronic invoice information issued by the Fujian Taxation Bureau. At this time, the data index is identified as a string formed by the invoice code and the beginning and end of the invoice code.
用户可以向安装有数据查询平台对应的数据查询应用程序的电子设备输入发票编码和发票代码,使电子设备生成数据查询请求,并发送给数据查询设备,数据查询设备获取数据查询设备中的数据索引标识后,可在布隆过滤器的多个存储空间中,查询与数据索引标识相匹配的存储空间,最终,在与所查询的存储空间相对应的区块链中,查询与数据索引标识相对应的电子发票信息。The user can enter the invoice code and invoice code into the electronic device installed with the data query application corresponding to the data query platform, so that the electronic device generates a data query request and sends it to the data query device, and the data query device obtains the data index in the data query device After the identification, the storage space that matches the data index identification can be queried in the multiple storage spaces of the Bloom filter. Finally, in the blockchain corresponding to the queried storage space, the query is the same as the data index identification. The corresponding electronic invoice information.
再以数据查询设备为数据查询平台的服务器、区块链系统为存储加密货币信息的区块链系统为例,每个加密货币平台系统可以分别通过该加密货币平台系统对应的区块链系统存储其所拥有的加密货币信息,例如,比特币(Bitcoin)、以太币(Ethereum)、柚子币(EOS)、泰达币(USDT)、瑞波币(XRP)等加密货币平台系统都有各自的区块链系统。此时,数据索引标识为账户地址对应的字符串。Take the data query device as the server of the data query platform and the blockchain system as the blockchain system for storing encrypted currency information as an example. Each encrypted currency platform system can be stored separately through the corresponding blockchain system of the encrypted currency platform system. The cryptocurrency information it owns, for example, cryptocurrency platform systems such as Bitcoin, Ethereum, EOS, USDT, and Ripple (XRP) have their own blocks Chain system. At this time, the data index is identified as the character string corresponding to the account address.
用户可以向安装有数据查询平台对应的数据查询应用程序的电子设备输入账户地址,使电子设备生成数据查询请求,并发送给数据查询设备,数据查询设备获取数据查询设备中的数据索引标识后,可在布隆过滤器的多个存储空间中,查询与数据索引标识相匹配的存储空间,最终,在与所查询的存储空间相对应的区块链中,查询与数据索引标识相对应的加密货币信息。The user can input the account address to the electronic device installed with the data query application corresponding to the data query platform to make the electronic device generate a data query request and send it to the data query device. After the data query device obtains the data index identifier in the data query device, In the multiple storage spaces of the Bloom filter, the storage space matching the data index identification can be queried, and finally, in the blockchain corresponding to the queried storage space, the encryption corresponding to the data index identification can be queried Currency information.
需要说明的是,本申请实施例提供的数据查询设备能够实现图2-4的方法实施例中电子设备或者服务器所实现的各个过程和效果,并且实现各个过程的原理相似,为避免重复,这里不再赘述。It should be noted that the data query device provided in the embodiment of the present application can implement the various processes and effects implemented by the electronic device or the server in the method embodiments of FIGS. 2-4, and the principles for implementing each process are similar. To avoid repetition, here No longer.
以上所述,仅为本申请的具体实施方式,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的系统、模块和单元的具 体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。应理解,本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。The above are only specific implementations of the present application. Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process of the above-described systems, modules and units can be referred to the foregoing method embodiments. The corresponding process in, I will not repeat it here. It should be understood that the scope of protection of this application is not limited to this, and any person skilled in the art can easily think of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should cover Within the scope of protection of this application.

Claims (21)

  1. 一种数据查询方法,包括:A data query method, including:
    接收数据查询请求,其中,所述数据查询请求包括第一索引信息;Receiving a data query request, where the data query request includes first index information;
    响应于所述数据查询请求,在布隆过滤器的多个存储空间中,查询与所述第一索引信息相匹配的第一存储空间,其中,一个所述存储空间与一个区块链相对应,每个所述区块链中所存储的数据不同;In response to the data query request, among the multiple storage spaces of the Bloom filter, a first storage space that matches the first index information is queried, wherein one of the storage spaces corresponds to one blockchain , The data stored in each block chain is different;
    在与所述第一存储空间相对应的第一区块链中,查询与所述第一索引信息相对应的第一数据。In the first blockchain corresponding to the first storage space, query the first data corresponding to the first index information.
  2. 根据权利要求1所述的方法,其中,所述第一索引信息为第一数据索引标识;The method according to claim 1, wherein the first index information is a first data index identifier;
    所述在布隆过滤器的多个存储空间中,查询与所述第一索引信息相匹配的第一存储空间,包括:The querying the first storage space that matches the first index information among the multiple storage spaces of the Bloom filter includes:
    对所述第一数据索引标识进行哈希取模运算处理,得到所述第一数据索引标识对应的第一模数;Performing a hash modulus operation process on the first data index identifier to obtain the first modulus corresponding to the first data index identifier;
    根据所述第一模数,确定所述第一数据索引标识对应的存储位置;Determine the storage location corresponding to the first data index identifier according to the first modulus;
    查询所述存储位置在每个所述存储空间中的属性值;Query the attribute value of the storage location in each storage space;
    将所述存储位置的属性值均为预设值的存储空间,作为与所述第一索引信息相匹配的所述第一存储空间。A storage space whose attribute values of the storage location are all preset values is used as the first storage space that matches the first index information.
  3. 根据权利要求2所述的方法,其中,所述对所述第一数据索引标识进行哈希取模运算处理,得到所述第一数据索引标识对应的第一模数,包括:The method according to claim 2, wherein said performing a hash modulo operation processing on the first data index identifier to obtain the first modulus corresponding to the first data index identifier comprises:
    利用多个预设哈希函数分别对所述第一数据索引标识进行哈希运算处理,得到所述第一数据索引标识对应的多个第一哈希地址;Using a plurality of preset hash functions to respectively perform a hash operation process on the first data index identifier to obtain a plurality of first hash addresses corresponding to the first data index identifier;
    针对每个所述第一哈希地址,利用输出所述第一哈希地址的预设哈希函数对应的预设除数对所述第一哈希地址进行取模运算处理,得到所述第一数据索引标识对应的多个第一模数。For each of the first hash addresses, the first hash address is modulo arithmetic processing by using the preset divisor corresponding to the preset hash function that outputs the first hash address to obtain the first hash address The data index identifies the corresponding multiple first moduli.
  4. 根据权利要求1所述的方法,其中,所述第一索引信息为第一数据索引标识对应的第一模数;The method according to claim 1, wherein the first index information is a first modulus corresponding to a first data index identifier;
    所述在布隆过滤器的多个存储空间中,查询与所述第一索引信息相匹配的第一存储空间,包括:The querying the first storage space that matches the first index information among the multiple storage spaces of the Bloom filter includes:
    根据所述第一模数,确定所述第一数据索引标识对应的存储位置;Determine the storage location corresponding to the first data index identifier according to the first modulus;
    查询所述存储位置在每个所述存储空间中的属性值;Query the attribute value of the storage location in each storage space;
    将所述存储位置的属性值均为预设值的存储空间,作为与所述第一索引信息相匹配的所述第一存储空间。A storage space whose attribute values of the storage location are all preset values is used as the first storage space that matches the first index information.
  5. 根据权利要求2或4所述的方法,其中,所述查询所述存储位置在每个所述存储空间中的属性值,包括:The method according to claim 2 or 4, wherein the querying the attribute value of the storage location in each of the storage spaces comprises:
    按照多个所述存储空间的排列顺序,依次查询所述存储位置在每个所述存储空间中的属性值。According to the arrangement order of the multiple storage spaces, query the attribute value of the storage location in each storage space in turn.
  6. 根据权利要求2或4所述的方法,其中,所述查询所述存储位置在每个所述存储空间中的属性值,包括:The method according to claim 2 or 4, wherein the querying the attribute value of the storage location in each of the storage spaces comprises:
    针对每个所述存储位置,查询所述存储位置在每个目标存储空间中的属性值,其中,所述目标存储空间为具有目标存储位置的存储空间,所述目标存储位置为排列顺序与所述存储位置前相邻且属性值为所述预设值的存储位置。For each storage location, query the attribute value of the storage location in each target storage space, where the target storage space is a storage space with a target storage location, and the target storage location is arranged in order and The storage location is adjacent before the storage location and whose attribute value is the preset value.
  7. 根据权利要求1所述的方法,其中,所述接收数据查询请求之前,还包括:The method according to claim 1, wherein before the receiving the data query request, the method further comprises:
    接收第二索引信息;Receive the second index information;
    根据所述第二索引信息,更新所述布隆过滤器中的第二存储空间,其中,所述第二存储空间为与第二区块链相对应的存储空间,所述第二区块链为所述第二索引信息对应的第二数据所存储的区块链。According to the second index information, update the second storage space in the Bloom filter, where the second storage space is a storage space corresponding to a second blockchain, and the second blockchain Is the block chain where the second data corresponding to the second index information is stored.
  8. 根据权利要求7所述的方法,其中,所述第二索引信息为第二数据索引标识;The method according to claim 7, wherein the second index information is a second data index identifier;
    所述根据所述第二索引信息,更新所述布隆过滤器中的第二存储空间,包括:The updating the second storage space in the Bloom filter according to the second index information includes:
    对所述第二数据索引标识进行哈希取模运算处理,得到所述第二数据索引标识对应的第二模数;Performing hash modulo operation processing on the second data index identifier to obtain the second modulus corresponding to the second data index identifier;
    根据所述第二模数,确定所述第二数据索引标识对应的存储位置;Determine the storage location corresponding to the second data index identifier according to the second modulus;
    将所述第二存储空间中的所述存储位置的属性值,由初始值更新为预设值。The attribute value of the storage location in the second storage space is updated from an initial value to a preset value.
  9. 根据权利要求7所述的方法,其中,所述第二索引信息为第二数据索引标识对应的第二模数;8. The method according to claim 7, wherein the second index information is a second modulus corresponding to a second data index identifier;
    所述根据所述第二索引信息,更新所述布隆过滤器中的第二存储空间,包括:The updating the second storage space in the Bloom filter according to the second index information includes:
    根据所述第二模数,确定所述第二数据索引标识对应的存储位置;Determine the storage location corresponding to the second data index identifier according to the second modulus;
    将所述第二存储空间中的所述存储位置的属性值,由初始值更新为预设值。The attribute value of the storage location in the second storage space is updated from an initial value to a preset value.
  10. 根据权利要求7所述的方法,其中,所述接收第二索引信息,包括:The method according to claim 7, wherein said receiving second index information comprises:
    接收第二网关节点发送的第一通知信息,其中,所述第二网关节点属于第二区块链系统,所述第二区块链系统为具有所述第二区块链的区块链系统,所述第一通知信息用于表征所述第二区块链系统已经将所述第二数据存储在所述第二区块链中,所述第一通知信息包括所述第二索引信息。Receive first notification information sent by a second gateway node, where the second gateway node belongs to a second blockchain system, and the second blockchain system is a blockchain system with the second blockchain The first notification information is used to indicate that the second blockchain system has stored the second data in the second blockchain, and the first notification information includes the second index information.
  11. 根据权利要求7所述的方法,其中,所述接收第二索引信息之前,还包括:The method according to claim 7, wherein before said receiving the second index information, the method further comprises:
    向第二区块链节点发送事件注册请求,以使所述第二区块链节点响应于所述事件注册请求,注册监听事件,其中,所述监听事件用于监听所述第二数据的数据存储事件,所述第二区块链节点属于第二区块链系统,所述第二区块链系统为具有所述第二区块链的区块链系统;Send an event registration request to the second blockchain node, so that the second blockchain node registers for a monitoring event in response to the event registration request, wherein the monitoring event is used to monitor the data of the second data To store events, the second blockchain node belongs to a second blockchain system, and the second blockchain system is a blockchain system with the second blockchain;
    所述接收第二索引信息,包括:The receiving second index information includes:
    接收所述第二区块链节点发送的第二通知信息,其中,所述第二通知信息用于表征所述第二区块链系统触发所述监听事件,所述第二通知信息包括所述第二索引信息。Receive second notification information sent by the second blockchain node, where the second notification information is used to characterize that the second blockchain system triggers the monitoring event, and the second notification information includes the The second index information.
  12. 根据权利要求7所述的方法,其中,所述接收第二索引信息,包括:The method according to claim 7, wherein said receiving second index information comprises:
    接收所述第二区块链在当前时刻下所存储的当前数据和在上一时刻下所存储的历史数据;Receiving the current data stored in the second blockchain at the current time and the historical data stored at the previous time;
    将存在于所述当前数据中且不存在于所述历史数据中的数据,作为所述第二数据;Use data that exists in the current data but not in the historical data as the second data;
    获取所述第二数据的所述第二索引信息。Acquiring the second index information of the second data.
  13. 根据权利要求7所述的方法,其中,所述布隆过滤器存储于第三区块链节点的全局状态存储空间内,所述第三区块链节点属于第三区块链系统,所述第三区块链系统对应的第三区块链用于存储所述布隆过滤器的更新数据。The method according to claim 7, wherein the bloom filter is stored in a global state storage space of a third blockchain node, the third blockchain node belongs to a third blockchain system, and the The third blockchain corresponding to the third blockchain system is used to store the update data of the bloom filter.
  14. 根据权利要求1所述的方法,其中,所述在与所述第一存储空间相对应的第一区块链中,查询与所述第一索引信息相对应的第一数据,包括:The method according to claim 1, wherein the querying the first data corresponding to the first index information in the first blockchain corresponding to the first storage space comprises:
    获取所述第一区块链所存储的数据;Acquiring data stored in the first blockchain;
    在所获取的数据中,查询与所述第一索引信息相对应的第一数据。Among the acquired data, the first data corresponding to the first index information is queried.
  15. 根据权利要求14所述的方法,其中,所述接收数据查询请求,包括:The method according to claim 14, wherein said receiving a data query request comprises:
    接收目标设备发送的所述数据查询请求;Receiving the data query request sent by the target device;
    其中,所述在与所述第一存储空间相对应的第一区块链中,查询与所述第一索引信息相对应的第一数据之后,还包括:Wherein, after querying the first data corresponding to the first index information in the first blockchain corresponding to the first storage space, the method further includes:
    将所述第一数据发送至所述目标设备。Sending the first data to the target device.
  16. 根据权利要求1所述的方法,其中,所述接收数据查询请求,包括:The method according to claim 1, wherein said receiving a data query request comprises:
    接收目标设备发送的所述数据查询请求;Receiving the data query request sent by the target device;
    所述在与所述第一存储空间相对应的第一区块链中,查询与所述第一索引信息相对应的第一数据,包括:The querying the first data corresponding to the first index information in the first blockchain corresponding to the first storage space includes:
    向所述目标设备发送查询指示信息,所述查询指示信息用于指示所述第一存储空间相对应的第一区块链,以使所述目标设备根据所述查询指示信息,在所述第一区块链中查询与所述第一索引信息相对应的第一数据。Send query instruction information to the target device, where the query instruction information is used to indicate the first blockchain corresponding to the first storage space, so that the target device can perform the first block chain according to the query instruction information The first data corresponding to the first index information is queried in a blockchain.
  17. 根据权利要求1所述的方法,其中,所述在与所述第一存储空间相对应的第一区块链中,查询与所述第一索引信息相对应的第一数据,包括:The method according to claim 1, wherein the querying the first data corresponding to the first index information in the first blockchain corresponding to the first storage space comprises:
    向第一网关节点发送所述数据查询请求,以使所述第一网关节点响应于所述数据查询请求,在所述第一区块链中查询与所述第一索引信息相对应的所述第一数据,其中,所述第一网关节点属于第一区块链系统,所述第一区块链系统为具有所述第一区块链的区块链系统;Send the data query request to the first gateway node, so that the first gateway node queries the first block chain corresponding to the first index information in response to the data query request First data, wherein the first gateway node belongs to a first blockchain system, and the first blockchain system is a blockchain system with the first blockchain;
    接收所述第一网关节点反馈的所述第一数据。Receiving the first data fed back by the first gateway node.
  18. 一种数据查询装置,包括:A data query device includes:
    请求接收模块,用于接收数据查询请求;其中,所述数据查询请求包括第一索引信息;A request receiving module, configured to receive a data query request; wherein, the data query request includes first index information;
    空间查询模块,用于响应于所述数据查询请求,在布隆过滤器的多个存储空间中,查询与所述第一索引信息相匹配的第一存储空间,其中,一个所述存储空间与一个区块链相对应,每个所述区块链中所存储的数据不同;The space query module is used to query the first storage space matching the first index information in the multiple storage spaces of the Bloom filter in response to the data query request, wherein one of the storage spaces is One block chain corresponds, and the data stored in each block chain is different;
    数据查询模块,用于在与所述第一存储空间相对应的第一区块链中,查询与所述第一索引信息相对应的第一数据。The data query module is configured to query the first data corresponding to the first index information in the first blockchain corresponding to the first storage space.
  19. 一种数据查询设备,包括:处理器以及存储有计算机程序指令的存储器;A data query device includes: a processor and a memory storing computer program instructions;
    所述处理器执行所述计算机程序指令时实现如权利要求1-17任意一项所述的数据查询方法。When the processor executes the computer program instructions, the data query method according to any one of claims 1-17 is implemented.
  20. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现如权利要求1-17任意一项所述的数据查询方法。A computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the data query method according to any one of claims 1-17 is realized.
  21. 一种数据查询系统,包括:A data query system includes:
    多个区块链系统,每个所述区块链系统具有一个区块链,每个所述区块链中所存储的数据不同;Multiple blockchain systems, each of the blockchain systems has a blockchain, and the data stored in each of the blockchains is different;
    数据查询设备,用于接收数据查询请求,其中,所述数据查询请求包括第一索引信息;响应于所述数据查询请求,在布隆过滤器的多个存储空间中,查询与所述第一索引信息相匹配的第一存储空间,其中,一个所述存储空间与一个所述区块链相对应;在与所述第一存储空间相对应的第一区块链中,查询与所述第一索引信息相对应的第一数据。The data query device is configured to receive a data query request, wherein the data query request includes first index information; in response to the data query request, in the multiple storage spaces of the Bloom filter, the query is related to the first index information. The first storage space that matches the index information, wherein one of the storage spaces corresponds to one of the blockchains; in the first blockchain corresponding to the first storage space, the query is related to the first storage space. First data corresponding to an index information.
PCT/CN2020/121086 2019-12-27 2020-10-15 Data query method, apparatus, device and system, and medium WO2021129062A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911382203.0A CN111143371B (en) 2019-12-27 2019-12-27 Data query method, device, equipment, system and medium
CN201911382203.0 2019-12-27

Publications (1)

Publication Number Publication Date
WO2021129062A1 true WO2021129062A1 (en) 2021-07-01

Family

ID=70521250

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/121086 WO2021129062A1 (en) 2019-12-27 2020-10-15 Data query method, apparatus, device and system, and medium

Country Status (2)

Country Link
CN (1) CN111143371B (en)
WO (1) WO2021129062A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117521152A (en) * 2024-01-05 2024-02-06 同盾科技有限公司 Data updating method, trace query method, electronic equipment and medium

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143371B (en) * 2019-12-27 2023-09-19 中国银联股份有限公司 Data query method, device, equipment, system and medium
CN111966731A (en) * 2020-10-23 2020-11-20 支付宝(杭州)信息技术有限公司 Method and device for querying data in block chain system
CN112001796A (en) * 2020-10-26 2020-11-27 支付宝(杭州)信息技术有限公司 Method and device for processing service in block chain system
CN113205424B (en) * 2020-10-28 2023-08-25 支付宝(杭州)信息技术有限公司 Method and apparatus for deploying and invoking contracts in blockchain
CN112948438B (en) * 2021-03-05 2022-06-24 杭州复杂美科技有限公司 Data query method, computer device and storage medium
CN113239078B (en) * 2021-05-17 2022-09-20 国网河南省电力公司信息通信公司 Data rapid query method based on alliance chain
CN113485949B (en) * 2021-05-28 2023-06-20 浙江毫微米科技有限公司 Data processing method, chip and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180097779A1 (en) * 2016-09-30 2018-04-05 Nec Europe Ltd. Method and system for providing a transaction forwarding service in blockchain implementations
CN109167811A (en) * 2018-07-27 2019-01-08 阿里巴巴集团控股有限公司 A kind of across chain data access method and device based on block chain
CN109918398A (en) * 2019-02-26 2019-06-21 符安文 A kind of data search classification method based on block chain
US20190370241A1 (en) * 2018-06-05 2019-12-05 Oracle International Corportion Authenticated Key-value Stores Supporting Partial State
CN110597912A (en) * 2019-09-17 2019-12-20 深圳前海微众银行股份有限公司 Block storage method and device
CN111143371A (en) * 2019-12-27 2020-05-12 中国银联股份有限公司 Data query method, device, equipment, system and medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11775479B2 (en) * 2018-05-24 2023-10-03 Luther Systems Us Incorporated System and method for efficient and secure private similarity detection for large private document repositories
CN109933586A (en) * 2019-02-26 2019-06-25 符安文 A kind of management method optimizing location index based on block chain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180097779A1 (en) * 2016-09-30 2018-04-05 Nec Europe Ltd. Method and system for providing a transaction forwarding service in blockchain implementations
US20190370241A1 (en) * 2018-06-05 2019-12-05 Oracle International Corportion Authenticated Key-value Stores Supporting Partial State
CN109167811A (en) * 2018-07-27 2019-01-08 阿里巴巴集团控股有限公司 A kind of across chain data access method and device based on block chain
CN109918398A (en) * 2019-02-26 2019-06-21 符安文 A kind of data search classification method based on block chain
CN110597912A (en) * 2019-09-17 2019-12-20 深圳前海微众银行股份有限公司 Block storage method and device
CN111143371A (en) * 2019-12-27 2020-05-12 中国银联股份有限公司 Data query method, device, equipment, system and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117521152A (en) * 2024-01-05 2024-02-06 同盾科技有限公司 Data updating method, trace query method, electronic equipment and medium
CN117521152B (en) * 2024-01-05 2024-05-07 同盾科技有限公司 Data updating method, trace query method, electronic equipment and medium

Also Published As

Publication number Publication date
CN111143371A (en) 2020-05-12
CN111143371B (en) 2023-09-19

Similar Documents

Publication Publication Date Title
WO2021129062A1 (en) Data query method, apparatus, device and system, and medium
US11539701B2 (en) Network access point
US11470092B2 (en) Expendable network access
CN108769111A (en) A kind of server connection method, computer readable storage medium and terminal device
US20200204999A1 (en) Home Network Access
US10866953B2 (en) Intelligent caching for enterprise resource planning reporting
CN108153757A (en) A kind of method and apparatus of Hash table management
CN111615818A (en) Block chain construction method and block chain link points
WO2017128701A1 (en) Method and apparatus for storing data
CN112860953A (en) Data importing method, device, equipment and storage medium of graph database
CN113474804A (en) Transaction and account verification method, device and storage medium of digital currency
CN114637703B (en) Data access device, method, readable medium and electronic equipment
CN111046106A (en) Cache data synchronization method, device, equipment and medium
CN112445841B (en) Account query method, device, system, server and medium
CN108241685B (en) Data query method and query client
US20200349286A1 (en) Ascertaining network devices used with anonymous identifiers
CN110427538B (en) Data query method, data storage method, data query device, data storage device and electronic equipment
CN110990350B (en) Log analysis method and device
CN116743785A (en) Cloud network data storage method, device, equipment and medium based on fog calculation
CN109842482B (en) Information synchronization method, system and terminal equipment
CN115481440B (en) Data processing method, device, electronic equipment and medium
CN111241137A (en) Data processing method and device, electronic equipment and storage medium
CN112685064B (en) Processing method and device for equipment identification, storage medium and electronic device
CN112688870B (en) Routing method, routing device and node equipment
CN108255533B (en) System configuration changing method and device

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

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

Country of ref document: EP

Kind code of ref document: A1