CN110704438A - Method and device for generating bloom filter in block chain - Google Patents

Method and device for generating bloom filter in block chain Download PDF

Info

Publication number
CN110704438A
CN110704438A CN201910918040.7A CN201910918040A CN110704438A CN 110704438 A CN110704438 A CN 110704438A CN 201910918040 A CN201910918040 A CN 201910918040A CN 110704438 A CN110704438 A CN 110704438A
Authority
CN
China
Prior art keywords
bloom filter
theme
block
storage
bits
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910918040.7A
Other languages
Chinese (zh)
Other versions
CN110704438B (en
Inventor
王�章
刘明臻
李辉忠
张开翔
范瑞彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201910918040.7A priority Critical patent/CN110704438B/en
Publication of CN110704438A publication Critical patent/CN110704438A/en
Priority to PCT/CN2020/114235 priority patent/WO2021057482A1/en
Application granted granted Critical
Publication of CN110704438B publication Critical patent/CN110704438B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Software Systems (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for generating a bloom filter in a block chain, wherein the method comprises the following steps: acquiring the number of themes of the blocks; determining the number of theme storage bits required to be occupied for storing each theme of the block according to the number of the themes; the theme storage bit number is positively correlated with the theme number; generating a bloom filter of the block according to the theme storage bit number; and for each theme of the block, updating the value of the bit mapped in the bloom filter by the theme from the first preset value to a second preset value according to a preset mapping relation, and obtaining the bloom filter for storing each theme of the block. When the method is applied to financial technology (Fintech), the storage space of the bloom filter is sufficient, the storage of each theme of the block can be met, the mapping bits among the themes are not conflicted, and the block can be accurately queried when whether the queried theme is contained in the subsequent block is determined.

Description

Method and device for generating bloom filter in block chain
Technical Field
The invention relates to the field of financial technology (Fintech) and the field of a block chain (Blockchain), in particular to a method and a device for generating a bloom filter in the block chain.
Background
With the development of computer technology, more and more technologies (big data, distributed, Blockchain (Blockchain), artificial intelligence, etc.) are applied in the financial field, and the traditional financial industry is gradually changing to financial technology (Fintech). Currently, in the field of financial science and technology, financial activities are often implemented through blockchains. There may be multiple transactions in a block, each transaction including at least one event, each event in turn including at least one topic. In some scenarios, a lookup for an event may be involved. Events can be looked up by the topic of the event.
In the prior art, a bloom filter with a fixed length of 2048 bits is used to store the theme of a block. The bloom filter can completely store the theme of the block with small transaction amount, however, for the block which can package tens of thousands of transactions in a single block, the bloom filter with the fixed length of 2048 bits inevitably generates the phenomenon of bit repetition, the bloom filter completely fails, the theme of the block cannot be accurately stored, and in addition, the theme of the block with small transaction amount causes a large amount of storage space waste, which is a problem to be solved urgently.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating a bloom filter in a block chain, and solves the problems that in the prior art, the theme of a block cannot be accurately stored and a large amount of storage space is wasted.
In a first aspect, an embodiment of the present application provides a method for generating a bloom filter in a blockchain: acquiring the number of themes of the blocks; determining the number of theme storage bits required to be occupied for storing each theme of the block according to the number of the themes; the theme storage bit number is positively correlated with the theme number; generating a bloom filter of the block according to the theme storage bit number; the storage space of the bloom filter is larger than the number of the theme storage bits; the initial value of each bit in the storage space of the bloom filter is a first preset value; updating the value of the bit mapped in the bloom filter by the theme from the first preset value to a second preset value according to a preset mapping relation aiming at each theme of the block, and obtaining the bloom filter for storing each theme of the block; in the storage space of the bloom filter, the number of the bits with the second preset value is the number of the theme storage bits; the bloom filter is used to determine whether a block contains the subject of a query.
In the method, the number of themes of a block is obtained, the number of theme storage bits is determined according to the number of themes, and then the bloom filter of the block is generated according to the number of theme storage bits. In addition, the initial values of the bits in the storage space of the bloom filter are all first preset values, and for each topic of the block, the value of the bits mapped in the bloom filter by the topic can be updated from the first preset value to a second preset value according to a preset mapping relationship, so as to obtain the bloom filter for storing each topic of the block.
In an alternative embodiment, the number of bits of the theme storage bit is related to the number of themes as follows: k ═ T × n; wherein K is the bit number of the theme storage bit; t is the number of the themes; n is the number of bits occupied by each topic of the tile at the bloom filter.
In the method, the bit number of the theme storage bit is in direct proportion to the number of the themes, and the bit number occupied by each theme in the bloom filter is the same, so that the bit number of the theme storage bit can be conveniently counted according to the number of the themes, and the method for determining the bit number of the theme storage bit is provided.
In an alternative embodiment, the ratio of the number of subject storage bits to the storage space of the bloom filter is m; m is the storage space usage rate of the bloom filter configuration.
In the method, the discreteness of the bit of each theme in the bloom filter can be adjusted according to the setting of m, so that the flexibility of theme storage through the bloom filter is improved.
In an optional implementation, the obtaining the number of topics of the block includes: determining transactions in the block and events for each transaction; determining the number of index parameters of each event in the block; wherein the number of index parameters of each event corresponds to a topic; and taking the sum of the index parameter numbers of all events in the block as the number of the topics.
In the above manner, the sum of the numbers of the index parameters of the events in the block is used as the number of topics, and since the index parameters can be used for searching for the events, it can be ensured that each topic has a corresponding index, and each topic in the topics with the number of topics can be searched.
In a second aspect, the present application provides an apparatus for generating a bloom filter in a block chain, including: the acquisition module is used for acquiring the number of the themes of the blocks; the processing module is used for determining the number of theme storage bits required to be occupied by storing each theme of the block according to the number of the themes; the theme storage bit number is positively correlated with the theme number; generating a bloom filter of the block according to the theme storage bit number; the storage space of the bloom filter is larger than the number of the theme storage bits; the initial value of each bit in the storage space of the bloom filter is a first preset value; the bloom filter is used for updating the value of the bit mapped in the bloom filter by the theme from the first preset value to a second preset value according to a preset mapping relation aiming at each theme of the block, and obtaining the bloom filter for storing each theme of the block; in the storage space of the bloom filter, the number of the bits with the second preset value is the number of the theme storage bits; the bloom filter is used to determine whether a block contains the subject of a query.
In an alternative embodiment, the number of bits of the theme storage bit is related to the number of themes as follows: k ═ T × n; wherein K is the bit number of the theme storage bit; t is the number of the themes; n is the number of bits occupied by each topic of the tile at the bloom filter.
In an alternative embodiment, the ratio of the number of subject storage bits to the storage space of the bloom filter is m; m is the storage space usage rate of the bloom filter configuration.
In an optional implementation manner, the obtaining module is specifically configured to: determining transactions in the block and events for each transaction; determining the number of index parameters of each event in the block; wherein the number of index parameters of each event corresponds to a topic; and taking the sum of the index parameter numbers of all events in the block as the number of the topics.
For the advantages of the second aspect and the embodiments of the second aspect, reference may be made to the advantages of the first aspect and the embodiments of the first aspect, which are not described herein again.
In a third aspect, an embodiment of the present application provides a computer device, which includes a program or instructions, and when the program or instructions are executed, the computer device is configured to perform the method of each embodiment of the first aspect and the first aspect.
In a fourth aspect, an embodiment of the present application provides a storage medium, which includes a program or instructions, and when the program or instructions are executed, the program or instructions are configured to perform the method of the first aspect and the embodiments of the first aspect.
Drawings
FIG. 1 is a schematic diagram of a blockchain;
fig. 2 is a schematic flowchart illustrating steps of a method for generating a bloom filter in a block chain according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a device for generating a bloom filter in a block chain according to an embodiment of the present application.
Detailed Description
In order to better understand the technical solutions, the technical solutions will be described in detail below with reference to the drawings and the specific embodiments of the specification, and it should be understood that the specific features in the embodiments and examples of the present application are detailed descriptions of the technical solutions of the present application, but not limitations of the technical solutions of the present application, and the technical features in the embodiments and examples of the present application may be combined with each other without conflict.
The terms appearing in the embodiments of the present application are explained first below.
Block chains: as shown in fig. 1, a block chain is a chain consisting of a series of blocks, and each block records a Hash value of the block in addition to the data of the block, so that a chain is formed. The block chain has two core ideas, one is a cryptography technology, the other is a decentralization idea, and based on the two ideas, historical information on the block chain cannot be tampered.
And (3) node: each participant in the network is a node that participates in network set-up and data exchange. In a blockchain network, a node refers to a participant with a unique identity, and the node has a complete copy of the ledger and has the capability of participating in the consensus and ledger maintenance of the blockchain network.
Intelligent contract: an intelligent contract is a computer protocol intended to propagate, validate or execute contracts in an informational manner. Smart contracts allow trusted transactions to be conducted without third parties, which transactions are traceable and irreversible. The specific form of the intelligent contract is a code which is deployed on a block chain and completes a specific function. For example, identity is a mainstream intelligent contract programming language, and an intelligent contract written in the identity language is called an identity contract. When an intelligent contract is deployed on a blockchain, a contract address is generated, and a user can call the intelligent contract through the contract address. The function defined in the intelligent contract is called a contract interface, and the calling of the intelligent contract is to call a certain contract interface in the contract through a contract address.
Trading: a transaction is a user request for an operation of an intelligent contract interface deployed on a blockchain. The transaction is initiated by the user, sent from the client of the user to the block chain node, and after receiving the transaction, the block chain node calls the corresponding intelligent contract according to the contract address and the interface specified by the transaction. In blockchains, any operation (deploying a contract, invoking a contract interface, etc.) is done by sending a transaction. The transaction is initiated by the user and sent to the blockchain node through the client. After receiving the transaction, the blockchain node packs the transaction into blocks and executes the blocks.
Each transaction in the block is executed to generate a corresponding transaction receipt. The transaction receipt stores the execution result of the transaction, and typically contains important information such as a transaction hash, a status bit identifying whether the transaction was executed successfully, and a log generated during the execution.
A bloom filter:
the bloom filter is a data structure and a relatively ingenious probability type data structure, the core realization is a super-large bit array and a plurality of hash functions, and the bloom filter is characterized by being efficiently inserted and inquired and being capable of judging whether elements exist or not. The efficiency of querying events is greatly improved by the bloom filter of the Etherhouse.
Event (Event), Log (Log):
an event is a convenient interface provided by the virtual machine log infrastructure, which can be predefined, for generating logs in a predetermined format. When an event (call) is sent, it triggers the storage of parameters into the log of the transaction (a special data structure on the blockchain). These logs are associated with the addresses of contracts and are recorded into blockchains, each transaction receipt of which may contain from 0 to more log records representing events triggered by intelligent contracts.
Topic (topic):
in a blockchain, when defining an event, parameters of the event need to be specified. Parameters are classified into two types, one is modified by an index parameter key (extended), and the other is not modified by an extended. The difference between these two parameters is that the former will be stored in the topoc field of the log, while the latter will be stored in the data field of the log. The topoic field of the log may be used as a search, while the data field may not.
When tasks are scheduled among data center nodes in the operation process of financial institutions (banking institutions, insurance institutions or security institutions) during business (such as loan business, deposit business and the like of banks), financial activities are usually realized through a block chain due to the possible sequence dependency among the tasks. In some scenarios, which may involve a search for an event, a tile may include multiple transactions, each transaction including at least one event, each event including at least one topic.
The current approach is to store the subject of the tile through a bloom filter of fixed length. In the mode, for the theme of the block with large transaction amount, the phenomenon of bit repetition can occur, the bloom filter can be completely invalid, and the theme of the block can not be accurately stored; for the subject of the block with smaller transaction amount, a large amount of storage space is wasted. This situation does not meet the requirements of financial institutions such as banks, and the efficient operation of various services of the financial institutions cannot be ensured.
Therefore, the current bloom filter cannot meet the requirement under multiple scenarios of the block chain, and the policy for generating the bloom filter needs to be adjusted, as shown in the step flow diagram shown in fig. 2, the present application provides a method for generating the bloom filter in the block chain.
Step 201: the number of subjects of the block is obtained.
Step 202: and determining the number of theme storage bits required to be occupied for storing each theme of the block according to the number of the themes.
The number of theme storage bits is positively correlated with the number of themes.
Step 203: and generating a bloom filter of the block according to the theme storage bit number.
The storage space of the bloom filter is larger than the number of the theme storage bits; the initial value of each bit in the storage space of the bloom filter is a first preset value;
step 204: and for each theme of the block, updating the value of the bit mapped in the bloom filter by the theme from the first preset value to a second preset value according to a preset mapping relation, and obtaining the bloom filter for storing each theme of the block.
In the storage space of the bloom filter, the number of the bits with the second preset value is the number of the theme storage bits; the bloom filter is used to determine whether a block contains the subject of a query.
Step 201 occurs after the block is executed, and the number of topics of the block is obtained by counting the number of topics included in all transaction receipts of the block. Specifically, the following embodiments may be taken:
determining transactions in the block and events for each transaction; determining the number of index parameters of each event in the block; wherein the number of index parameters of each event corresponds to a topic; and taking the sum of the index parameter numbers of all events in the block as the number of the topics.
For example, there are 100 transactions in the block, and the number of events per transaction is 2. And 2 index parameters for each event modified by an index. Then the sum of the index parameters of each event in the block is 100 x 2-400, and the number of topics in the block is 400. It should be noted that the number of events of different transactions may be different, and the number of index parameters of different events is also different, and here, only how to obtain the number of topics is illustrated.
In step 202, the relationship between the number of bits of the theme storage bit and the number of themes may be as follows:
k ═ T × n; wherein K is the bit number of the theme storage bit; t is the number of the themes; n is the number of bits occupied by each topic of the tile at the bloom filter.
The bit number of each topic occupied by the bloom filter can be freely set according to requirements, for example, each topic occupies 3 bits of the bloom filter.
In the generation process of the bloom filter in step 203, configuration items may also be added in advance: storage space usage of bloom filters; m is the storage space usage rate of the bloom filter configuration. Under the configuration of m, the ratio of the number of the theme storage bits to the storage space of the bloom filter is m.
The configuration item influences the query efficiency of the bloom filter and the storage space of the bloom filter, the smaller the utilization rate is, the lower the conflict rate of the bloom filter is, the faster the query speed is, but the larger the storage space is required to be, and the balance between the search efficiency and the storage is sought according to actual needs. For example, m may be set to 10%, which is not limited herein.
In step 203, the size of the storage space of the bloom filter of the current chunk can be calculated according to the number of the topics of the chunk and the bit usage rate of the bloom filter:
bloom filter size 3 number of topics for a tile/bloom filter space usage; unit: a bit (bit).
In step 204, for each topic of the block, updating the value of the bit mapped by the topic in the bloom filter from the first preset value to a second preset value according to a preset mapping relationship, and obtaining the bloom filter storing each topic of the block. For example, the first preset value is 0, and the second preset value is 1; the first preset value may be 1, and the second preset value may be 0.
In step 204, it is ensured that: and in the storage space of the bloom filter, the number of the bits with the second preset value is the number of the theme storage bits. That is, each bit can only uniquely identify one subject, and the storage between the subjects does not conflict.
After step 204, the respective topics for the tile are stored in the bloom filter accordingly. When a certain target event needs to be queried, the query can be performed by querying a target topic in the target event. If the target subject can be inquired, determining that the target event exists; otherwise, the target event does not exist.
The method for generating the bloom filter in the block chain is described below with reference to two different specific scenarios.
Scene one:
the time zone blockchain operates in a high load, high Throughput (TPS) mode, where the parameters of block one are as follows:
Figure BDA0002216766230000091
the bloom filter size for block one is:
the usage rate of the tile one title number 3/bit is 40000 3/10%: 1200000bit ≈ 1.2 Mb.
Scene two:
the load of the block chain under the scene is lower, wherein the parameters of the second block are as follows:
Figure BDA0002216766230000092
the bloom filter size of block two is:
the usage rate of tile one title 3/bit is 60 × 3/10% ═ 1800bit ≈ 1.8 Kb.
In the method of steps 201 to 204, the number of topics of a block is obtained first, and the number of topic storage bits is determined according to the number of topics, so that a bloom filter of the block is generated according to the number of topic storage bits, because the number of topic storage bits is positively correlated with the number of topics, and the storage space of the bloom filter is greater than the number of topic storage bits, when the number of topics of the block is greater, the storage space of the bloom filter is correspondingly greater, and when the number of topics of the block is smaller, the storage space of the bloom filter is correspondingly smaller, so that a bloom filter suitable for the storage space can be generated according to the number of topics of the block. In addition, the initial values of the bits in the storage space of the bloom filter are all first preset values, and for each topic of the block, the value of the bits mapped in the bloom filter by the topic can be updated from the first preset value to a second preset value according to a preset mapping relationship, so as to obtain the bloom filter for storing each topic of the block.
As shown in fig. 3, the present application provides an apparatus for generating a bloom filter in a block chain, including: an obtaining module 301, configured to obtain the number of topics of a block; a processing module 302, configured to determine, according to the number of topics, a number of topic storage bits that need to be occupied for storing each topic of the block; the theme storage bit number is positively correlated with the theme number; generating a bloom filter of the block according to the theme storage bit number; the storage space of the bloom filter is larger than the number of the theme storage bits; the initial value of each bit in the storage space of the bloom filter is a first preset value; the bloom filter is used for updating the value of the bit mapped in the bloom filter by the theme from the first preset value to a second preset value according to a preset mapping relation aiming at each theme of the block, and obtaining the bloom filter for storing each theme of the block; in the storage space of the bloom filter, the number of the bits with the second preset value is the number of the theme storage bits; the bloom filter is used to determine whether a block contains the subject of a query.
In an alternative embodiment, the number of bits of the theme storage bit is related to the number of themes as follows: k ═ T × n; wherein K is the bit number of the theme storage bit; t is the number of the themes; n is the number of bits occupied by each topic of the tile at the bloom filter.
In an alternative embodiment, the ratio of the number of subject storage bits to the storage space of the bloom filter is m; m is the storage space usage rate of the bloom filter configuration.
In an optional implementation manner, the obtaining module 301 is specifically configured to: determining transactions in the block and events for each transaction; determining the number of index parameters of each event in the block; wherein the number of index parameters of each event corresponds to a topic; and taking the sum of the index parameter numbers of all events in the block as the number of the topics.
The embodiment of the present application provides a computer device, which includes a program or an instruction, and when the program or the instruction is executed, the program or the instruction is used to execute the method for generating the bloom filter in the block chain and any optional method provided by the embodiment of the present application.
The embodiment of the present application provides a storage medium, which includes a program or an instruction, and when the program or the instruction is executed, the program or the instruction is used to execute a method for generating a bloom filter in a block chain and any optional method provided by the embodiment of the present application.
Finally, it should be noted that: as will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for generating a bloom filter in a block chain comprises the following steps:
acquiring the number of themes of the blocks;
determining the number of theme storage bits required to be occupied for storing each theme of the block according to the number of the themes; the theme storage bit number is positively correlated with the theme number;
generating a bloom filter of the block according to the theme storage bit number; the storage space of the bloom filter is larger than the number of the theme storage bits; the initial value of each bit in the storage space of the bloom filter is a first preset value;
updating the value of the bit mapped in the bloom filter by the theme from the first preset value to a second preset value according to a preset mapping relation aiming at each theme of the block, and obtaining the bloom filter for storing each theme of the block; in the storage space of the bloom filter, the number of the bits with the second preset value is the number of the theme storage bits; the bloom filter is used to determine whether a block contains the subject of a query.
2. The method of claim 1, wherein the number of topic storage bits is related to the number of topics as follows:
k ═ T × n; wherein K is the bit number of the theme storage bit; t is the number of the themes; n is the number of bits occupied by each topic of the tile at the bloom filter.
3. The method of claim 1, wherein a ratio of the number of subject storage bits to the storage space of the bloom filter is m; m is the storage space usage rate of the bloom filter configuration.
4. The method of any of claims 1-3, wherein obtaining the number of topics for a block comprises:
determining transactions in the block and events for each transaction;
determining the number of index parameters of each event in the block; wherein the number of index parameters of each event corresponds to a topic;
and taking the sum of the index parameter numbers of all events in the block as the number of the topics.
5. An apparatus for generating a bloom filter in a blockchain, comprising:
the acquisition module is used for acquiring the number of the themes of the blocks;
the processing module is used for determining the number of theme storage bits required to be occupied by storing each theme of the block according to the number of the themes; the theme storage bit number is positively correlated with the theme number; generating a bloom filter of the block according to the theme storage bit number; the storage space of the bloom filter is larger than the number of the theme storage bits; the initial value of each bit in the storage space of the bloom filter is a first preset value; the bloom filter is used for updating the value of the bit mapped in the bloom filter by the theme from the first preset value to a second preset value according to a preset mapping relation aiming at each theme of the block, and obtaining the bloom filter for storing each theme of the block; in the storage space of the bloom filter, the number of the bits with the second preset value is the number of the theme storage bits; the bloom filter is used to determine whether a block contains the subject of a query.
6. The apparatus of claim 5, wherein the number of topic storage bits to the number of topics is as follows:
k ═ T × n; wherein K is the bit number of the theme storage bit; t is the number of the themes; n is the number of bits occupied by each topic of the tile at the bloom filter.
7. The apparatus of claim 5, wherein a ratio of the number of subject storage bits to storage space of the bloom filter is m; m is the storage space usage rate of the bloom filter configuration.
8. The apparatus of any one of claims 5-7, wherein the acquisition module is specifically configured to:
determining transactions in the block and events for each transaction;
determining the number of index parameters of each event in the block; wherein the number of index parameters of each event corresponds to a topic;
and taking the sum of the index parameter numbers of all events in the block as the number of the topics.
9. A computer device comprising a program or instructions that, when executed, perform the method of any of claims 1 to 4.
10. A storage medium comprising a program or instructions which, when executed, perform the method of any one of claims 1 to 4.
CN201910918040.7A 2019-09-26 2019-09-26 Method and device for generating bloom filter in blockchain Active CN110704438B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910918040.7A CN110704438B (en) 2019-09-26 2019-09-26 Method and device for generating bloom filter in blockchain
PCT/CN2020/114235 WO2021057482A1 (en) 2019-09-26 2020-09-09 Method and device for generating bloom filter in blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910918040.7A CN110704438B (en) 2019-09-26 2019-09-26 Method and device for generating bloom filter in blockchain

Publications (2)

Publication Number Publication Date
CN110704438A true CN110704438A (en) 2020-01-17
CN110704438B CN110704438B (en) 2023-10-03

Family

ID=69196497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910918040.7A Active CN110704438B (en) 2019-09-26 2019-09-26 Method and device for generating bloom filter in blockchain

Country Status (2)

Country Link
CN (1) CN110704438B (en)
WO (1) WO2021057482A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021057482A1 (en) * 2019-09-26 2021-04-01 深圳前海微众银行股份有限公司 Method and device for generating bloom filter in blockchain
CN112950211A (en) * 2021-05-14 2021-06-11 腾讯科技(深圳)有限公司 Transaction duplication checking method, device, equipment and medium
GB2595489A (en) * 2020-05-28 2021-12-01 Nchain Holdings Ltd Probabilistic membership test for blockchain transaction outputs
CN116341023A (en) * 2023-05-24 2023-06-27 北京百度网讯科技有限公司 Block chain-based service address verification method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150363704A1 (en) * 2014-06-11 2015-12-17 Apple Inc. Dynamic Bloom Filter Operation for Service Discovery
CN107273556A (en) * 2017-08-23 2017-10-20 上海点融信息科技有限责任公司 Block chain data index method and equipment
CN107357843A (en) * 2017-06-23 2017-11-17 东南大学 Mass network data search method based on data flow architecture
CN107368527A (en) * 2017-06-09 2017-11-21 东南大学 More property index methods based on data flow
CN109313654A (en) * 2016-05-24 2019-02-05 万事达卡国际股份有限公司 The block chain being licensed desynchronize the method and system of recovery using Bloom filter
US20190079998A1 (en) * 2017-01-31 2019-03-14 Thomas Jay Rush Blockchain data-processing engine
CN110097363A (en) * 2019-04-12 2019-08-06 深圳前海微众银行股份有限公司 It is a kind of based on block chain event publication, event subscription method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10204341B2 (en) * 2016-05-24 2019-02-12 Mastercard International Incorporated Method and system for an efficient consensus mechanism for permissioned blockchains using bloom filters and audit guarantees
CN107247773B (en) * 2017-06-07 2018-05-15 北京邮电大学 A kind of method that inquiry is traded in distributed data base based on block chain
CN109977261B (en) * 2019-04-02 2021-11-26 北京奇艺世纪科技有限公司 Data request processing method and device and server
CN110704438B (en) * 2019-09-26 2023-10-03 深圳前海微众银行股份有限公司 Method and device for generating bloom filter in blockchain

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150363704A1 (en) * 2014-06-11 2015-12-17 Apple Inc. Dynamic Bloom Filter Operation for Service Discovery
CN109313654A (en) * 2016-05-24 2019-02-05 万事达卡国际股份有限公司 The block chain being licensed desynchronize the method and system of recovery using Bloom filter
US20190079998A1 (en) * 2017-01-31 2019-03-14 Thomas Jay Rush Blockchain data-processing engine
CN107368527A (en) * 2017-06-09 2017-11-21 东南大学 More property index methods based on data flow
CN107357843A (en) * 2017-06-23 2017-11-17 东南大学 Mass network data search method based on data flow architecture
CN107273556A (en) * 2017-08-23 2017-10-20 上海点融信息科技有限责任公司 Block chain data index method and equipment
CN110097363A (en) * 2019-04-12 2019-08-06 深圳前海微众银行股份有限公司 It is a kind of based on block chain event publication, event subscription method and device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021057482A1 (en) * 2019-09-26 2021-04-01 深圳前海微众银行股份有限公司 Method and device for generating bloom filter in blockchain
GB2595489A (en) * 2020-05-28 2021-12-01 Nchain Holdings Ltd Probabilistic membership test for blockchain transaction outputs
WO2021239345A1 (en) * 2020-05-28 2021-12-02 Nchain Licensing Ag Probabilistic membership test for blockchain transaction outputs
CN112950211A (en) * 2021-05-14 2021-06-11 腾讯科技(深圳)有限公司 Transaction duplication checking method, device, equipment and medium
CN116341023A (en) * 2023-05-24 2023-06-27 北京百度网讯科技有限公司 Block chain-based service address verification method, device, equipment and storage medium
CN116341023B (en) * 2023-05-24 2023-08-29 北京百度网讯科技有限公司 Block chain-based service address verification method, device, equipment and storage medium

Also Published As

Publication number Publication date
WO2021057482A1 (en) 2021-04-01
CN110704438B (en) 2023-10-03

Similar Documents

Publication Publication Date Title
US20210103604A1 (en) System and method for implementing a scalable data storage service
US20230400990A1 (en) System and method for performing live partitioning in a data store
US10387402B2 (en) System and method for conditionally updating an item with attribute granularity
CN110704438B (en) Method and device for generating bloom filter in blockchain
CN108389118B (en) Asset management system, method and device and electronic equipment
CN108062672B (en) Flow scheduling method based on block chain intelligent contract
US8819027B1 (en) System and method for partitioning and indexing table data using a composite primary key
US9372911B2 (en) System and method for performing replica copying using a physical copy mechanism
US11609697B2 (en) System and method for providing a committed throughput level in a data store
TW202101437A (en) Hierarchical storage method and device based on block chain and electronic equipment
CN110689349A (en) Transaction hash value storage and search method and device in block chain
CN111144883A (en) Processing performance analysis method and device for block chain network
CN110599166A (en) Method and device for acquiring transaction dependency relationship in block chain
WO2021027612A1 (en) Method and apparatus for executing transaction in blockchain
CN112560114A (en) Method and device for calling intelligent contract
CN109241056A (en) A kind of digital ID generation system for distributed system
CN108399175B (en) Data storage and query method and device
US11120513B2 (en) Capital chain information traceability method, system, server and readable storage medium
CN109241057A (en) A kind of digital ID generation method for distributed system
CN113469815A (en) Data management method and device
CN114357080A (en) Account data reading and writing method and device
CN114297171A (en) Account data reading and writing method and device
CN116662338A (en) Data storage method, device, equipment and storage medium
CN115859374A (en) Block chain-based data evidence storage method and device
CN117650982A (en) Method, equipment and medium for implementing complex gateway based on BPMN

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant