CN111858609A - Fuzzy query method and device for block chain - Google Patents
Fuzzy query method and device for block chain Download PDFInfo
- Publication number
- CN111858609A CN111858609A CN202010735355.0A CN202010735355A CN111858609A CN 111858609 A CN111858609 A CN 111858609A CN 202010735355 A CN202010735355 A CN 202010735355A CN 111858609 A CN111858609 A CN 111858609A
- Authority
- CN
- China
- Prior art keywords
- target
- entity
- identifier
- entity data
- fuzzy
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides a block chain fuzzy query method and a block chain fuzzy query device, which relate to the technical field of block chains, and the method comprises the following steps: receiving an fuzzy query request sent by user equipment, wherein the fuzzy query request comprises a fuzzy field; determining a target identifier corresponding to the fuzzy field in a predetermined longitudinal table; and determining a plurality of target entity data corresponding to the target identification, and sending the plurality of target entity data to the user equipment. The block chain data transverse table is converted into the longitudinal table to realize fuzzy query, so that the problem of fuzzy query is effectively solved, and the query efficiency is improved.
Description
Technical Field
The present invention relates to the field of block chain technologies, and in particular, to a block chain fuzzy query method and apparatus.
Background
With the updating of information technology, a blockchain is gradually becoming popular as a new storage technology, and a blockchain system is a data network system which utilizes cryptography to ensure the security of data transmission and access and generates a non-falsifiable and non-counterfeitable distributed account book.
Through investigation, the mainstream block chain query scheme at the present stage has the following two types:
in the first scheme, the level DB stores data. The level DB storage engine stores data, the level DB is a key-value non-relational database storage system of a Google open source, has high random writing and sequential reading/writing performance and good safety, and stores entity attributes in a matrix mode of a database cross table, namely, various attributes of an entity are placed in different recording fields and serve as a key-value non-relational database, and the level DB stores the entity attributes in the database cross table mode, so that the query efficiency is low.
Scheme two, CouchDB stores data. CouchDB is a NoSQL online document storage database. The CouchDB supports fuzzy query, but as an online database, the CouchDB has higher security problems, such as weak verification mechanism and easy brute force cracking, and a storage device can be directly accessed, so that data is tampered or stolen; in addition, the CouchDB has no access control of base and role, and the applications all rely on an upper-layer service deployment mechanism, but have no authentication mechanism of a database bottom layer, and lack log analysis, so that unauthorized access is more difficult to discover.
Disclosure of Invention
The invention aims to provide a block chain fuzzy query method and a block chain fuzzy query device so as to solve the technical problem of low query efficiency and poor security in the prior art.
In a first aspect, an embodiment provides a block chain fuzzy query method, including:
receiving a fuzzy query request sent by user equipment, wherein the fuzzy query request comprises a fuzzy field;
determining a target identifier corresponding to the fuzzy field in a predetermined vertical table, wherein each table entry of the vertical table comprises an identifier and an entity data, the target identifier is an identifier corresponding to the entity data comprising the fuzzy field in the vertical table, the vertical table is generated based on a horizontal table in the block chain, and the table entry of the horizontal table comprises an identifier and a plurality of entity data;
and determining a plurality of target entity data corresponding to the target identification, and sending the plurality of target entity data to the user equipment.
In an optional embodiment, the user equipment is a BaaS platform.
In an optional implementation manner, before receiving the fuzzy query request sent by the user equipment, the method further includes:
determining at least one first table entry updated in the horizontal table;
and converting each first table entry into a plurality of second table entries in the vertical table.
In an alternative embodiment of the method of the present invention,
each first table entry corresponds to a plurality of entity types, and each first table entry comprises entity values of the entity types; converting each of the first entries into a plurality of second entries in the vertical table, including:
converting a plurality of entity types corresponding to the first table entry into entity type identifiers based on a pre-established corresponding relationship between the entity types and the entity type identifiers;
and generating a plurality of second table entries according to the entity value based on the converted first table entry, wherein each second table entry comprises the entity type identifier and the entity value.
In an optional embodiment, the entity type is an attribute name, the entity value is the attribute value, and the entity data includes an entity value.
In an alternative embodiment of the method of the present invention,
determining a plurality of target entity data corresponding to the target identifier, and sending the plurality of target entity data to the user equipment, including:
querying the horizontal table based on the target identifier, and determining a target horizontal table item corresponding to the target identifier, wherein the target horizontal table item comprises a plurality of target entity data corresponding to the target identifier;
and sending the target horizontal table item to the user equipment.
In an alternative embodiment of the method of the present invention,
determining a plurality of target entity data corresponding to the target identifier, and sending the plurality of target entity data to the user equipment, including:
querying in the vertical table based on the target identifier, and determining a plurality of target vertical table entries corresponding to the target identifier, wherein each target vertical table entry comprises a target entity data corresponding to the target identifier;
generating a target horizontal table item corresponding to the target identifier based on the plurality of target vertical table items, wherein the target horizontal table item comprises a plurality of target entity data;
and sending the target horizontal table item to the user equipment.
In a second aspect, an embodiment provides a block chain fuzzy query apparatus, including:
the system comprises a receiving module, a query module and a query module, wherein the receiving module is used for receiving a fuzzy query request sent by user equipment, and the fuzzy query request comprises a fuzzy field;
a first determining module, configured to determine a target identifier corresponding to the fuzzy field in a predetermined vertical table, where each entry of the vertical table includes an identifier and one entity data, the target identifier is an identifier corresponding to the entity data that includes the fuzzy field in the vertical table, the vertical table is generated based on a horizontal table in the block chain, and an entry of the horizontal table includes one identifier and multiple entity data;
a second determining module, configured to determine multiple target entity data corresponding to the target identifier, and send the multiple target entity data to the user equipment.
In an optional embodiment, the user equipment is a BaaS platform.
In an optional embodiment, the system further comprises a conversion module, configured to:
determining at least one first table entry updated in the horizontal table;
and converting each first table entry into a plurality of second table entries in the vertical table.
In an optional embodiment, each of the first entries corresponds to a plurality of entity types, and each of the first entries includes entity values of the plurality of entity types; the conversion module is specifically configured to:
converting a plurality of entity types corresponding to the first table entry into entity type identifiers based on a pre-established corresponding relationship between the entity types and the entity type identifiers;
and generating a plurality of second table entries according to the entity value based on the converted first table entry, wherein each second table entry comprises the entity type identifier and the entity value.
In an optional embodiment, the entity type is an attribute name, the entity value is the attribute value, and the entity data includes an entity value.
In an optional embodiment, the second determining module is specifically configured to:
querying the horizontal table based on the target identifier, and determining a target horizontal table item corresponding to the target identifier, wherein the target horizontal table item comprises a plurality of target entity data corresponding to the target identifier;
and sending the target horizontal table item to the user equipment.
In an optional embodiment, the second determining module is specifically configured to:
querying in the vertical table based on the target identifier, and determining a plurality of target vertical table entries corresponding to the target identifier, wherein each target vertical table entry comprises a target entity data corresponding to the target identifier;
generating a target horizontal table item corresponding to the target identifier based on the plurality of target vertical table items, wherein the target horizontal table item comprises a plurality of target entity data;
and sending the target horizontal table item to the user equipment.
In a third aspect, an embodiment provides a computer device, including a memory and a processor, where the memory stores a computer program operable on the processor, and the processor implements the steps of the method of any one of the foregoing embodiments when executing the computer program.
In a fourth aspect, embodiments provide a computer readable storage medium having stored thereon machine executable instructions which, when invoked and executed by a processor, cause the processor to execute the method of any of the preceding embodiments.
The invention provides a block chain fuzzy query method and a block chain fuzzy query device, which are characterized in that a fuzzy query request sent by user equipment is received, wherein the fuzzy query request comprises a fuzzy field; determining a target identifier corresponding to the fuzzy field in a predetermined longitudinal table; and determining a plurality of target entity data corresponding to the target identification, and sending the plurality of target entity data to the user equipment. The block chain data transverse table is converted into the longitudinal table to realize fuzzy query, so that the problem of fuzzy query is effectively solved, and the query efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flow chart of a block chain fuzzy query method according to an embodiment of the present disclosure;
fig. 2 is an example of a block chain fuzzy query method according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a block chain fuzzy query apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The embodiment of the present invention is applicable to the application scenario shown in fig. 1, and as shown in fig. 1, the application scenario may include a BaaS platform 101 and a block chain node 102, where the block chain node is used to store block chain data, and the BaaS platform 101 is used to interact with a user and the block chain node 102, so that the user applies the block chain service. The BaaS platform 101 and the block link point 102 may correspond to a plurality of physical or logical devices.
With the increasingly wide application of a block chain as a Service (BaaS) platform, the requirement of block chain fuzzy query based on the BaaS platform is stronger, so the method provides a solution for the block chain fuzzy query based on the BaaS platform, and the method can effectively solve the problem of fuzzy query of data in the block chain. On the basis of a horizontal table of the level DB, the horizontal table on the block chain is converted into a vertical table in the BaaS and stored in MySQL, and the vertical table on the BaaS is used for realizing fuzzy query of block chain data, so that the problem that the level DB cannot carry out fuzzy query is solved, and in the process, any operation on original data on the chain is not needed, so that the safety of the block chain data is ensured.
Compared with the fuzzy query scheme adopting CouchDB storage, the method adopts the MySqL storage longitudinal table in the BaaS for fuzzy query, does not directly access the original online data, improves the safety of block chain data to a certain extent, and ensures better query performance.
The BaaS platform is combined with a block chain technology and is used for helping a user to create, manage and maintain services of an enterprise-level block chain network and applications. The main purposes of the BaaS platform are as follows: the method can quickly establish the required block chain application environment and provide a series of operation services such as search query, transaction, operation and maintenance, data analysis and the like based on the block chain network.
The fuzzy query means that the BaaS platform automatically matches data according to the keywords input by the user, so that more query results are obtained. A like statement in the database query language SQL is typically used.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Fig. 2 is a flowchart illustrating a block chain fuzzy query method according to an embodiment of the present invention. As shown in fig. 2, the method may include the steps of:
s210, receiving an fuzzy query request sent by user equipment, wherein the fuzzy query request comprises a fuzzy field;
the user equipment may be a BaaS platform. The fuzzy field to be requested to be queried is submitted to a node (a server) on a block chain in the BaaS platform, and the fuzzy query request can be a fuzzy query statement input by a user through a terminal provided with a BaaS platform client or a browser capable of running the BaaS platform, so that the server on the chain processes the fuzzy query request submitted by the BaaS platform. After receiving the fuzzy query request, the server analyzes the SQL query statement in the fuzzy query request under the condition that no request is submitted abnormally, and arranges out a query tree corresponding to the SQL query statement, a CF tree corresponding to each sub-query condition and a filter tree, and then saves the analyzed result.
S220, determining the target identification corresponding to the fuzzy field in a predetermined vertical table.
Each table entry of the vertical table comprises an identifier and entity data, and the target identifier is an identifier corresponding to the entity data comprising the fuzzy field in the vertical table; the vertical table is generated based on a horizontal table in the block chain, and the table entry of the horizontal table comprises an identification and a plurality of entity data.
The longitudinal table may be stored in a database, which may be a local database or an on-chain database, and the database may include various implementation forms, for example, the database may be a MySQL database. A query may be made in the database to determine the target identification based on the fuzzy field.
As an example, a cross-table is a table that places various types of attributes for a data entity into different record fields. For example, the table structure shown in table 1 is: primary key (Hash), first field (company name), second field (leader id), third field (CreateTimeStart), fourth field (createtimend), etc. When storing blockchain data onto the vertical table: and (4) putting input data into a configured specified directory, scanning and analyzing the input data through a scanning program module, acquiring table information and corresponding field information, and filtering error data.
TABLE 1
| Hash | CompanyName | LeagueId | CreateTimeStart | CreateTimeEnd |
| 1x0001 | AA | 1 | 2001-01-01 | 2009-09-09 |
| 1x0002 | BB | 1 | 2002-02-02 | 2010-10-10 |
| 1x0003 | CC | 2 | 2003-03-03 | 2011-11-11 |
As another example, as shown in table 2: the table structure of the vertical table is as follows: primary key (Hash), attribute field (attribute name), attribute value.
In the process of converting the horizontal table into the vertical table, when a piece of data in the horizontal table is converted into the vertical table, firstly, fields to be displayed in the vertical table in a row are selected and removed (assuming that n fields are taken out), and then two fields (one is used for recording the name of the removed attribute field and one is used for recording the attribute field value corresponding to the piece of data) are added to the horizontal table at the moment. At this time, the original 1 data in the horizontal surface is converted into n data in the vertical surface.
TABLE 2
| Hash | Attribute name | Attribute value |
| 1x0001 | CompanyName | AA |
| 1x0001 | LeagueId | 1 |
| 1x0001 | CreateTimeStart | 2001-01-01 |
| 1x0001 | CreateTimeEnd | 2009-09-09 |
| 1x0001 | Size | 3 |
| 1x0002 | CompanyName | BB |
| 1x0002 | LeagueId | 1 |
| 1x0002 | CreateTimeStart | 2002-02-02 |
| 1x0002 | CreateTimeEnd | 2010-10-10 |
| 1x0002 | Size | 5 |
| 1x0003 | CompanyName | CC |
| 1x0003 | LeagueId | 2 |
| 1x0003 | CreateTimeStart | 2003-03-03 |
| 1x0003 | CreateTimeEnd | 2011-11-11 |
| 1x0003 | Size | 7 |
The target identifier may be a primary key (Hash), one of the plurality of entity data corresponding to the identifier included in the entry of the vertical table may be one of the first field (company name), the second field (leader id), the third field (CreateTimeStart), and the fourth field (CreateTimeEnd) in table 1, and may further include an entity type corresponding to the field, for example, an attribute name described in table 2, where the attribute name corresponds to the type of each field in table 1. The entity data corresponding to the identifier included in the entry of the horizontal table may be the first field (company name), the second field (leader id), the third field (CreateTimeStart), and the fourth field (createtimend) in table 1. The fuzzy field may be one or more of the first field (company name), the second field (LeagueId), the third field (CreateTimeStart), and the fourth field (createtimend) in table 1.
The hit entity data corresponding to the fuzzy field can be searched from the vertical table of the block chain, and the target identifier corresponding to the hit entity data is determined, so that all entity data can be found according to the target identifier.
The entity data vertical table of the same type (attribute) can be multiple, each vertical table can be used for storing entity data with the same characteristic, wherein the characteristic can comprise at least one of data type, data length and attribute value.
And S230, determining a plurality of target entity data corresponding to the target identification, and sending the plurality of target entity data to the user equipment.
As an example, as shown in table 2, when the input fuzzy field is equal to "BB", in table 2, the query result is determined as SQL query statement "SELECT × FROM table _2WHERE resource value LIKE" BB% ", and the result is that entity data is queried, and the target identifier corresponding to the result is found to be" lx0001 ".
And then reading all target entity data corresponding to the target identifier to be searched from the horizontal table or the vertical table by combining the target identifier and returning all the target entity data of the target identifier to the BaaS. If the specified number of returned pieces exists, reading the specified number of pieces of data, if the number of returned pieces does not exist, returning the query result (for example, all data) of the default number of pieces, returning the query result to the BaaS, and ending the fuzzy query; if no query result exists, directly returning query information to the BaaS to prompt that no data exists, and ending the fuzzy query.
Through this application embodiment, can convert the horizontal table of block chain data into the vertical table and realize fuzzy inquiry, solve this problem of fuzzy inquiry effectively, promote query efficiency, through the combination of horizontal table and vertical table two kinds of modes simultaneously, realized the efficient entity attribute data lookup mode, also effectively reduced the data bulk, reduced the utilization to memory resource, simultaneously, through reducing the visit to original horizontal table, improved the security of block chain data to a certain extent.
In some embodiments, the horizontal table and the vertical table may be updated according to an update condition of data in the blockchain, and for the update of the vertical table, the update may be performed based on the update of the horizontal table, as an example, before step S210, the method may further include:
step a), determining at least one first table item updated in a horizontal table;
and b), converting each first table entry into a plurality of second table entries in the longitudinal table.
The entity meaning stored in the definition table of the entity type identifier can be utilized firstly, and then the corresponding relation between the entity value and the entity type identifier is stored in the longitudinal table, wherein the definition table is used for storing the corresponding relation between the entity type and the entity type identifier which is established in advance. For example, an entity type ID (or called entity ID) definition table may be set, defining entity type IDs of different entity types. For example, in connection with table 1, the entity types may include company name, LeagueId, CreateTimeStart, and CreateTimeEnd, and the entity type IDs may be numbers 1, 2, 3, and 4, respectively. Then, an index is created and stored for the entity type, and the definition table can be synchronously updated in the conversion process of the horizontal table and the vertical table.
As an example, each first entry corresponds to a plurality of entity types, and each first entry includes entity values of the plurality of entity types; the step b) can be realized by the following steps:
step 1), based on the corresponding relationship between the entity type and the entity type identifier established in advance, converting a plurality of entity types corresponding to the first table entry into the entity type identifier;
and 2) generating a plurality of second table entries according to the entity values based on the converted first table entry, wherein each second table entry comprises an entity type identifier and an entity value.
When the second table entry is generated, each entity value corresponds to one table entry.
The entity type may be an attribute name, the entity value may be an attribute value corresponding to the attribute name, and the entity data may include an entity value.
In some embodiments, the step S230 may be specifically implemented by the following steps:
step A-1), inquiring in a horizontal table based on a target identifier, and determining a target horizontal table item corresponding to the target identifier, wherein the target horizontal table item comprises a plurality of target entity data corresponding to the target identifier;
and step A-2), sending the target list item to the user equipment.
As an example, with reference to table 2, if the SQL query statement "SELECT FROM table _2where actual value LIKE '% BB'" is used, it is determined whether there is a query result in table 2, and the result is that entity data is queried, and the target identifier corresponding to the entity data is found to be "lx 0001". According to the searched "lx 0001", all data of the object identifier are searched in the horizontal table (such as table 1) and returned, as shown in table 3:
TABLE 3
| 1x0002 | BB | 1 | 2002-02-02 | 2010-10-10 |
The invention realizes fuzzy query by converting the block chain data horizontal table into the vertical table, effectively solves the problem of fuzzy query, and realizes an efficient entity attribute data fuzzy query mode by combining the horizontal table and the vertical table. Meanwhile, by reducing the access to the original data on the block chain, the safety of the block chain data is improved to a certain extent.
On the basis of the step of creating the vertical table, when fuzzy query is carried out to search values of all attributes of a certain block chain data entity, the vertical table can be searched in sequence according to each attribute, and although the searching speed is low, the function of fuzzy query can still be realized. As an example, the step S230 may be specifically implemented by the following steps:
step B-1), inquiring in the vertical table based on the target identifier, and determining a plurality of target vertical table entries corresponding to the target identifier, wherein each target vertical table entry comprises a target entity data corresponding to the target identifier;
step B-2), based on a plurality of target longitudinal table entries, generating a target transverse table entry corresponding to the target identifier, wherein the target transverse table entry comprises a plurality of target entity data;
and step B-3), sending the target list item to the user equipment.
Fig. 3 is a schematic structural diagram of a block chain fuzzy query apparatus according to an embodiment of the present invention. As shown in fig. 3, the apparatus may specifically include:
a receiving module 301, configured to receive an fuzzy query request sent by user equipment, where the fuzzy query request includes a fuzzy field;
a first determining module 302, configured to determine a target identifier corresponding to a fuzzy field in a predetermined vertical table, where each entry of the vertical table includes an identifier and one entity data, the target identifier is an identifier corresponding to the entity data that includes the fuzzy field in the vertical table, the vertical table is generated based on a horizontal table in a block chain, and an entry of the horizontal table includes one identifier and multiple entity data;
the second determining module 303 is configured to determine a plurality of target entity data corresponding to the target identifier, and send the plurality of target entity data to the user equipment.
The user equipment may be a BaaS platform.
In some embodiments, further comprising a conversion module to:
determining at least one first table item updated in the horizontal table;
and converting each first table entry into a plurality of second table entries in the vertical table.
In some embodiments, each first entry corresponds to a plurality of entity types, and each first entry includes entity values of the plurality of entity types; the conversion module is specifically configured to:
converting a plurality of entity types corresponding to the first table entry into entity type identifications based on a corresponding relation between the entity types and the entity type identifications established in advance;
and generating a plurality of second table entries according to the entity value based on the converted first table entry, wherein each second table entry comprises an entity type identifier and an entity value.
The entity type is an attribute name, the entity value is an attribute value, and the entity data comprises the entity value.
In some embodiments, the second determining module 303 is specifically configured to:
inquiring in the horizontal table based on the target identifier, and determining a target horizontal table item corresponding to the target identifier, wherein the target horizontal table item comprises a plurality of target entity data corresponding to the target identifier;
and sending the target list item to the user equipment.
In some embodiments, the second determining module 303 is specifically configured to:
inquiring in the vertical table based on the target identifier, and determining a plurality of target vertical table entries corresponding to the target identifier, wherein each target vertical table entry comprises a target entity data corresponding to the target identifier;
generating a target horizontal table item corresponding to the target identifier based on the target vertical table items, wherein the target horizontal table item comprises a plurality of target entity data;
and sending the target list item to the user equipment.
The block chain fuzzy query device provided by the embodiment of the application has the same technical characteristics as the block chain fuzzy query method provided by the embodiment of the application, so that the same technical problems can be solved, and the same technical effects can be achieved.
As shown in fig. 4, an embodiment of the present application provides a computer device 700, including: a processor 701, a memory 702 and a bus, wherein the memory 702 stores machine-readable instructions executable by the processor 701, when the electronic device is operated, the processor 701 communicates with the memory 702 through the bus, and the processor 701 executes the machine-readable instructions to perform the steps of the block chain fuzzy query method.
Specifically, the memory 702 and the processor 701 can be general-purpose memory and processor, which are not limited in particular, and the block chain fuzzy query method can be executed when the processor 701 executes a computer program stored in the memory 702.
Corresponding to the block chain fuzzy query method, the embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium stores machine executable instructions, and when the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to execute the steps of the block chain fuzzy query method.
The block chain fuzzy query device provided by the embodiment of the application can be specific hardware on the device or software or firmware installed on the device. The device provided by the embodiment of the present application has the same implementation principle and technical effect as the foregoing method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the foregoing method embodiments where no part of the device embodiments is mentioned. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the mobile control method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the scope of the embodiments of the present application. Are intended to be covered by the scope of the present application.
Claims (16)
1. A block chain fuzzy query method, comprising:
receiving a fuzzy query request sent by user equipment, wherein the fuzzy query request comprises a fuzzy field;
determining a target identifier corresponding to the fuzzy field in a predetermined vertical table, wherein each table entry of the vertical table comprises an identifier and an entity data, the target identifier is an identifier corresponding to the entity data comprising the fuzzy field in the vertical table, the vertical table is generated based on a horizontal table in the block chain, and the table entry of the horizontal table comprises an identifier and a plurality of entity data;
and determining a plurality of target entity data corresponding to the target identification, and sending the plurality of target entity data to the user equipment.
2. The method of claim 1, wherein the user equipment is a BaaS platform.
3. The method of claim 1, wherein before receiving the ambiguous query request sent by the user device, the method further comprises:
determining at least one first table entry updated in the horizontal table;
and converting each first table entry into a plurality of second table entries in the vertical table.
4. The method of claim 3, wherein each of the first entries corresponds to a plurality of entity types, and wherein each of the first entries comprises entity values of the plurality of entity types; converting each of the first entries into a plurality of second entries in the vertical table, including:
converting a plurality of entity types corresponding to the first table entry into entity type identifiers based on a pre-established corresponding relationship between the entity types and the entity type identifiers;
and generating a plurality of second table entries according to the entity value based on the converted first table entry, wherein each second table entry comprises the entity type identifier and the entity value.
5. The method of claim 4, wherein the entity type is an attribute name, the entity value is an attribute value, and the entity data comprises an entity value.
6. The method of claim 1, wherein the determining a plurality of target entity data corresponding to the target identifier and sending the plurality of target entity data to the user equipment comprises:
querying the horizontal table based on the target identifier, and determining a target horizontal table item corresponding to the target identifier, wherein the target horizontal table item comprises a plurality of target entity data corresponding to the target identifier;
and sending the target horizontal table item to the user equipment.
7. The method of claim 1, wherein the determining a plurality of target entity data corresponding to the target identifier and sending the plurality of target entity data to the user equipment comprises:
querying in the vertical table based on the target identifier, and determining a plurality of target vertical table entries corresponding to the target identifier, wherein each target vertical table entry comprises a target entity data corresponding to the target identifier;
generating a target horizontal table item corresponding to the target identifier based on the plurality of target vertical table items, wherein the target horizontal table item comprises a plurality of target entity data;
and sending the target horizontal table item to the user equipment.
8. A block chain fuzzy query apparatus, comprising:
the system comprises a receiving module, a query module and a query module, wherein the receiving module is used for receiving a fuzzy query request sent by user equipment, and the fuzzy query request comprises a fuzzy field;
a first determining module, configured to determine a target identifier corresponding to the fuzzy field in a predetermined vertical table, where each entry of the vertical table includes an identifier and one entity data, the target identifier is an identifier corresponding to the entity data that includes the fuzzy field in the vertical table, the vertical table is generated based on a horizontal table in the block chain, and an entry of the horizontal table includes one identifier and multiple entity data;
a second determining module, configured to determine multiple target entity data corresponding to the target identifier, and send the multiple target entity data to the user equipment.
9. The apparatus of claim 8, wherein the user equipment is a BaaS platform.
10. The apparatus of claim 8, further comprising a conversion module to:
determining at least one first table entry updated in the horizontal table;
and converting each first table entry into a plurality of second table entries in the vertical table.
11. The apparatus of claim 10, wherein each of the first entries corresponds to a plurality of entity types, and wherein each of the first entries comprises entity values of the plurality of entity types; the conversion module is specifically configured to:
converting a plurality of entity types corresponding to the first table entry into entity type identifiers based on a pre-established corresponding relationship between the entity types and the entity type identifiers;
and generating a plurality of second table entries according to the entity value based on the converted first table entry, wherein each second table entry comprises the entity type identifier and the entity value.
12. The apparatus of claim 11, wherein the entity type is an attribute name, the entity value is an attribute value, and the entity data comprises an entity value.
13. The apparatus of claim 8, wherein the second determining module is specifically configured to:
querying the horizontal table based on the target identifier, and determining a target horizontal table item corresponding to the target identifier, wherein the target horizontal table item comprises a plurality of target entity data corresponding to the target identifier;
and sending the target horizontal table item to the user equipment.
14. The apparatus of claim 8, wherein the second determining module is specifically configured to:
querying in the vertical table based on the target identifier, and determining a plurality of target vertical table entries corresponding to the target identifier, wherein each target vertical table entry comprises a target entity data corresponding to the target identifier;
generating a target horizontal table item corresponding to the target identifier based on the plurality of target vertical table items, wherein the target horizontal table item comprises a plurality of target entity data;
and sending the target horizontal table item to the user equipment.
15. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
16. A computer readable storage medium having stored thereon machine executable instructions which, when invoked and executed by a processor, cause the processor to execute the method of any of claims 1 to 7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010735355.0A CN111858609B (en) | 2020-07-27 | 2020-07-27 | Block chain fuzzy query method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010735355.0A CN111858609B (en) | 2020-07-27 | 2020-07-27 | Block chain fuzzy query method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111858609A true CN111858609A (en) | 2020-10-30 |
| CN111858609B CN111858609B (en) | 2024-10-22 |
Family
ID=72947898
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010735355.0A Active CN111858609B (en) | 2020-07-27 | 2020-07-27 | Block chain fuzzy query method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111858609B (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112507017A (en) * | 2020-12-03 | 2021-03-16 | 建信金融科技有限责任公司 | Data table conversion method and device |
| CN115062055A (en) * | 2022-06-21 | 2022-09-16 | 深圳华策辉弘科技有限公司 | A data table processing method, device, equipment and storage medium |
| CN116680270A (en) * | 2023-06-09 | 2023-09-01 | 中国联合网络通信集团有限公司 | Data table conversion method, device and storage medium |
| CN118626492A (en) * | 2024-06-21 | 2024-09-10 | 广州逸虎网络科技有限公司 | Business processing method, device, storage medium and electronic device |
Citations (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080114733A1 (en) * | 2006-11-14 | 2008-05-15 | Microsoft Corporation | User-structured data table indexing |
| CN103324764A (en) * | 2013-07-22 | 2013-09-25 | 苏州灵巴巴网络科技有限公司 | Web implementation of multi-condition random keyword multi-field fuzzy query method |
| CN105302869A (en) * | 2015-09-29 | 2016-02-03 | 烽火通信科技股份有限公司 | HBase secondary index query and storage system and query method |
| CN106933873A (en) * | 2015-12-30 | 2017-07-07 | 中国移动通信集团上海有限公司 | A kind of cross-platform data querying method and equipment |
| CN107169033A (en) * | 2017-04-17 | 2017-09-15 | 东北大学 | Relation data enquiring and optimizing method with parallel framework is changed based on data pattern |
| CN107291964A (en) * | 2017-08-16 | 2017-10-24 | 南京华飞数据技术有限公司 | A kind of method that fuzzy query is realized based on HBase |
| JP2017219882A (en) * | 2016-06-02 | 2017-12-14 | 日本電信電話株式会社 | Logical relation recognition device, logical relation recognition method and logical relation recognition program |
| CN107818155A (en) * | 2017-10-27 | 2018-03-20 | 许继电气股份有限公司 | A kind of storage method of distribution main website and distribution main website data |
| CN108038135A (en) * | 2017-11-21 | 2018-05-15 | 平安科技(深圳)有限公司 | Electronic device, the method for multilist correlation inquiry and storage medium |
| US20180268151A1 (en) * | 2017-03-19 | 2018-09-20 | International Business Machines Corporation | Automatic generating analytics from blockchain data |
| CN110377603A (en) * | 2019-06-28 | 2019-10-25 | 中信百信银行股份有限公司 | Date storage method and device |
| CN110569243A (en) * | 2019-08-22 | 2019-12-13 | 厦门网宿有限公司 | data query method, data query plug-in and data query server |
| US20200050613A1 (en) * | 2018-03-13 | 2020-02-13 | Blockpoint Systems Inc. | Relational Blockchain Database |
| CN111259056A (en) * | 2020-01-15 | 2020-06-09 | 深圳微众信用科技股份有限公司 | Block chain data query method, system and related equipment |
| CN111291037A (en) * | 2018-11-22 | 2020-06-16 | 中国移动通信集团重庆有限公司 | Data storage and query method, device, equipment and computer storage medium |
| CN111339130A (en) * | 2020-02-25 | 2020-06-26 | 腾讯科技(深圳)有限公司 | Data query method, related equipment and readable storage medium |
| CN111414644A (en) * | 2020-03-18 | 2020-07-14 | 支付宝(杭州)信息技术有限公司 | A blockchain-based privacy protection query method and blockchain system |
| CN111414361A (en) * | 2020-02-20 | 2020-07-14 | 口碑(上海)信息技术有限公司 | Label data storage method, device, equipment and readable storage medium |
-
2020
- 2020-07-27 CN CN202010735355.0A patent/CN111858609B/en active Active
Patent Citations (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080114733A1 (en) * | 2006-11-14 | 2008-05-15 | Microsoft Corporation | User-structured data table indexing |
| CN103324764A (en) * | 2013-07-22 | 2013-09-25 | 苏州灵巴巴网络科技有限公司 | Web implementation of multi-condition random keyword multi-field fuzzy query method |
| CN105302869A (en) * | 2015-09-29 | 2016-02-03 | 烽火通信科技股份有限公司 | HBase secondary index query and storage system and query method |
| CN106933873A (en) * | 2015-12-30 | 2017-07-07 | 中国移动通信集团上海有限公司 | A kind of cross-platform data querying method and equipment |
| JP2017219882A (en) * | 2016-06-02 | 2017-12-14 | 日本電信電話株式会社 | Logical relation recognition device, logical relation recognition method and logical relation recognition program |
| US20180268151A1 (en) * | 2017-03-19 | 2018-09-20 | International Business Machines Corporation | Automatic generating analytics from blockchain data |
| CN107169033A (en) * | 2017-04-17 | 2017-09-15 | 东北大学 | Relation data enquiring and optimizing method with parallel framework is changed based on data pattern |
| CN107291964A (en) * | 2017-08-16 | 2017-10-24 | 南京华飞数据技术有限公司 | A kind of method that fuzzy query is realized based on HBase |
| CN107818155A (en) * | 2017-10-27 | 2018-03-20 | 许继电气股份有限公司 | A kind of storage method of distribution main website and distribution main website data |
| CN108038135A (en) * | 2017-11-21 | 2018-05-15 | 平安科技(深圳)有限公司 | Electronic device, the method for multilist correlation inquiry and storage medium |
| US20200050613A1 (en) * | 2018-03-13 | 2020-02-13 | Blockpoint Systems Inc. | Relational Blockchain Database |
| CN111291037A (en) * | 2018-11-22 | 2020-06-16 | 中国移动通信集团重庆有限公司 | Data storage and query method, device, equipment and computer storage medium |
| CN110377603A (en) * | 2019-06-28 | 2019-10-25 | 中信百信银行股份有限公司 | Date storage method and device |
| CN110569243A (en) * | 2019-08-22 | 2019-12-13 | 厦门网宿有限公司 | data query method, data query plug-in and data query server |
| CN111259056A (en) * | 2020-01-15 | 2020-06-09 | 深圳微众信用科技股份有限公司 | Block chain data query method, system and related equipment |
| CN111414361A (en) * | 2020-02-20 | 2020-07-14 | 口碑(上海)信息技术有限公司 | Label data storage method, device, equipment and readable storage medium |
| CN111339130A (en) * | 2020-02-25 | 2020-06-26 | 腾讯科技(深圳)有限公司 | Data query method, related equipment and readable storage medium |
| CN111414644A (en) * | 2020-03-18 | 2020-07-14 | 支付宝(杭州)信息技术有限公司 | A blockchain-based privacy protection query method and blockchain system |
Non-Patent Citations (1)
| Title |
|---|
| 刘建平: "SQL SERVER数据库纵表转横表应用浅析", 中小企业管理与科技, no. 4, 5 April 2010 (2010-04-05), pages 214 - 215 * |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112507017A (en) * | 2020-12-03 | 2021-03-16 | 建信金融科技有限责任公司 | Data table conversion method and device |
| CN115062055A (en) * | 2022-06-21 | 2022-09-16 | 深圳华策辉弘科技有限公司 | A data table processing method, device, equipment and storage medium |
| CN115062055B (en) * | 2022-06-21 | 2025-04-11 | 深圳小雨点数字技术有限公司 | A data table processing method, device, equipment and storage medium |
| CN116680270A (en) * | 2023-06-09 | 2023-09-01 | 中国联合网络通信集团有限公司 | Data table conversion method, device and storage medium |
| CN118626492A (en) * | 2024-06-21 | 2024-09-10 | 广州逸虎网络科技有限公司 | Business processing method, device, storage medium and electronic device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111858609B (en) | 2024-10-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20230267153A1 (en) | Integrated index blocks and searching in blockchain systems | |
| CN111046034B (en) | Method and system for managing memory data and maintaining data in memory | |
| US9069788B2 (en) | Truncating data associated with objects in a multi-tenant database | |
| CN111858609A (en) | Fuzzy query method and device for block chain | |
| US11093461B2 (en) | Method for computing distinct values in analytical databases | |
| CN104794123A (en) | Method and device for establishing NoSQL database index for semi-structured data | |
| CN112925757A (en) | Method, equipment and storage medium for tracking operation log of intelligent equipment | |
| CN106415534B (en) | A method and device for associating table partitions in a distributed database | |
| CN107015987B (en) | Method and equipment for updating and searching database | |
| CN109669925B (en) | Management method and device of unstructured data | |
| CN111723161B (en) | A data processing method, device and equipment | |
| CN111506621A (en) | Data statistical method and device | |
| CN112527900A (en) | Method, device, equipment and medium for database multi-copy reading consistency | |
| US9053207B2 (en) | Adaptive query expression builder for an on-demand data service | |
| CN114116762A (en) | Offline data fuzzy search method, device, equipment and medium | |
| CN105005567B (en) | Interest point query method and system | |
| CN109614411B (en) | Data storage method, device and storage medium | |
| CN117171108B (en) | Virtual model mapping method and system | |
| CN105843809B (en) | Data processing method and device | |
| CN111767060A (en) | Multi-stage gray scale verification method, multi-stage gray scale verification device, electronic equipment and medium | |
| CN116432232A (en) | Data desensitizing method, device, computer equipment and computer readable storage medium | |
| CN113868267A (en) | Method for injecting time sequence data, method for inquiring time sequence data and database system | |
| CN114564501A (en) | Database data storage and query methods, devices, equipment and medium | |
| CN113934729A (en) | A data management method, related equipment and medium based on knowledge graph | |
| CN116361287B (en) | Path resolution methods, devices and systems |
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 |