CN112364014A - Data query method, device, server and storage medium - Google Patents

Data query method, device, server and storage medium Download PDF

Info

Publication number
CN112364014A
CN112364014A CN202011159083.0A CN202011159083A CN112364014A CN 112364014 A CN112364014 A CN 112364014A CN 202011159083 A CN202011159083 A CN 202011159083A CN 112364014 A CN112364014 A CN 112364014A
Authority
CN
China
Prior art keywords
query
index
data
field
query field
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
CN202011159083.0A
Other languages
Chinese (zh)
Other versions
CN112364014B (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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202011159083.0A priority Critical patent/CN112364014B/en
Publication of CN112364014A publication Critical patent/CN112364014A/en
Application granted granted Critical
Publication of CN112364014B publication Critical patent/CN112364014B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Landscapes

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

Abstract

The disclosure relates to a data query method, a data query device, a server and a storage medium. The data query method comprises the following steps: acquiring a query condition input by a user, wherein the query condition comprises a first query field and key value information corresponding to the first query field; when a second query field in the pre-stored candidate indexes comprises a first query field, determining a target index matched with the key value information from the candidate indexes; a data identification associated with the target index is determined. By adopting the data query method, the data query device, the server and the storage medium, the problem that query efficiency is reduced when excessive data are stored in the database in the related technology can be solved.

Description

Data query method, device, server and storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a data query method, apparatus, server, and storage medium.
Background
With the development of technology, the number of application platforms is increased dramatically, and a database of each application platform stores massive data.
Currently, in the related art, a query needs to be performed in a database according to a query condition to obtain a query result matching the query condition. However, when the data stored in the database is excessive, the query efficiency may be reduced.
Disclosure of Invention
The present disclosure provides a data query method, apparatus, server and storage medium, to at least solve the problem that query efficiency is reduced when data stored in a database is excessive in the related art.
The technical scheme of the disclosure is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided a data query method, including:
acquiring a query condition input by a user, wherein the query condition comprises a first query field and key value information corresponding to the first query field; when a second query field in the pre-stored candidate indexes comprises a first query field, determining a target index matched with the key value information from the candidate indexes; a data identification associated with the target index is determined.
According to a second aspect of the embodiments of the present disclosure, there is provided a data query apparatus including:
the acquisition module is configured to execute acquisition of a query condition input by a user, wherein the query condition comprises a first query field and key value information corresponding to the first query field; the matching module is configured to determine a target index matched with the key value information from the candidate indexes when a second query field in the pre-stored candidate indexes comprises a first query field; a determination module configured to perform determining a data identity associated with the target index.
According to a third aspect of the embodiments of the present disclosure, there is provided a server, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the data query method as described in the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium, wherein instructions of the storage medium, when executed by a processor of a server, enable the server to perform the data query method according to the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product, wherein instructions of the computer program product, when executed by a processor of a server, enable the server to perform the data query method according to the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the embodiment of the disclosure, by determining the target index matched with the key value information in the query condition input by the user from the candidate indexes, the target index required by the user in the preset database can be quickly located, and each piece of data in the preset database does not need to be scanned and queried; and then determining the data identification associated with the target index, wherein the data corresponding to the target index is far smaller than the data of the preset database, which is equivalent to reducing the data range of scanning query, so that the query efficiency can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a schematic diagram of a data query method, apparatus, electronic device and storage medium application environment according to an example embodiment.
FIG. 2 is a flow chart illustrating a method of data querying in accordance with an exemplary embodiment.
FIG. 3 is a diagram illustrating a candidate index according to an example embodiment.
FIG. 4 is a block diagram illustrating a data query device in accordance with an exemplary embodiment.
FIG. 5 is a block diagram illustrating a server in accordance with an example embodiment.
FIG. 6 is a block diagram illustrating an apparatus for data processing according to an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The problem that query efficiency is reduced when data stored in a database is excessive in the related art is solved.
The disclosure provides a data query method, a data query device, an electronic device and a storage medium. The data query method, the data query device, the electronic equipment and the storage medium can determine the target index matched with key value information in the query condition input by the user from the candidate indexes, wherein the target index required by the user in the preset database can be quickly positioned, and then the data identification associated with the target index is determined.
Fig. 1 is a schematic application environment diagram of a data query method, an apparatus, an electronic device, and a storage medium according to one or more embodiments of the present disclosure. As shown in fig. 1, the server 100 is communicatively connected to one or more user terminals 200 via a network 300 for data communication or interaction. The server 100 may be a web server, a database server, or the like. The user end 200 may be, but is not limited to, a Personal Computer (PC), a smart phone, a tablet computer, a Personal Digital Assistant (PDA), and the like. The network 300 may be a wired or wireless network.
The following describes the data query method provided by the embodiments of the present disclosure in detail.
The data query method provided by the embodiment of the present disclosure can be applied to the user side 200, and for convenience of description, the embodiment of the present disclosure takes the user side 200 as an execution subject for description except for specific description. It is to be understood that the subject matter described is not to be construed as limiting the disclosure.
Next, a data query method provided by the present disclosure will be explained.
FIG. 2 is a flow chart illustrating a method of data querying in accordance with an exemplary embodiment.
As shown in fig. 2, the data query method may include the following steps.
S210, acquiring a query condition input by a user, wherein the query condition comprises a first query field and key value information corresponding to the first query field.
And S220, when the second query field in the pre-stored candidate indexes comprises the first query field, determining a target index matched with the key value information from the candidate indexes.
S230, determining a data identifier associated with the target index.
Specific implementations of the above steps will be described in detail below.
In the embodiment of the disclosure, by determining the target index matched with the key value information in the query condition input by the user from the candidate indexes, the target index required by the user in the preset database can be quickly located, and each piece of data in the preset database does not need to be scanned and queried; and then determining the data identification associated with the target index, wherein the data corresponding to the target index is far smaller than the data of the preset database, which is equivalent to reducing the data range of scanning query, so that the query efficiency can be improved.
Specific implementations of the above steps are described below.
First, S210 is introduced.
And acquiring a query condition input by a user, wherein the query condition comprises a first query field and key value information corresponding to the first query field.
When the query condition input by the user is "25 < user age < 45", the first query field included in the query condition is "user age", and the key value information corresponding to the first query field is "25 < user age < 45". The key value information "25 < user age < 45" may also be understood as the user age in the interval of (25, 45).
Then, S220 is introduced.
If the query condition input by the user is not in the second query field in the pre-stored candidate indexes, full-table scanning is performed, and if the query condition input by the user is in the second query field in the pre-stored candidate indexes, the target index matched with the key value information can be determined from the candidate indexes. How to construct the candidate index will be specifically described below.
In some embodiments of the present disclosure, before S220, the following steps may be further included:
obtaining index granularity and at least one second query field; sorting the corresponding data of the second query field in the preset database according to a preset sequence to obtain a data sequence; dividing the data sequence according to the index granularity to obtain at least one second index group; and determining at least one candidate index according to the second index group and the data identification associated with the second index group in the preset database.
As shown in fig. 3, the index granularity is 3, i.e., one candidate index is generated every 3 pieces of data. The candidate index includes an index second index group and a data identification. As shown, the second index group consists of search field values and the data identification may be an id.
The second index group of the candidate index is composed of at least one array, and the number of the arrays is related to the number of index fields needing to be established. As shown in fig. 3, it is necessary to establish two arrays of the index item name (product _ name) and the user age (user _ age), that is, the second index group part of the candidate index, which is composed of two arrays, the first element in the array represents the distribution of the product _ name in the batch of data, and [ app, app ] represents that these data start with the app value and end with the app value; the second element represents the distribution of user _ age in the batch of data, [18,22] indicating that user _ age for the batch of data begins at 18 and ends at 22. The candidate index can be built as described above.
It is noted that the above embodiments give an index granularity of 3; the smaller the index granularity is, the higher the retrieval efficiency is, but the more data the index needs to store; the larger the index granularity is, the lower the retrieval efficiency is, but the storage space can be saved. The value of the index granularity can be selected by the storage size and the requirement in the actual application scene, and the disclosure is not limited.
Here, by establishing the candidate indexes in advance, it is possible to speed up the determination of the target index matching the key value information from the candidate indexes.
In some embodiments of the present disclosure, before the step of obtaining the index granularity and the at least one second query field, the following steps may be further included:
acquiring historical query fields and query frequency thereof included in the historical query conditions; and determining a second query field with the query frequency larger than a preset threshold value from the historical query fields.
For historical query conditions, the historical query conditions can be collected, the frequency of the historical query fields included in the historical query conditions is sorted, and some fields with higher query frequency are screened out, namely the second query field with the query frequency greater than a preset threshold value. The specific screening of several fields can be determined according to actual service requirements, and the disclosure is not limited.
Here, according to the second query field determined from the historical query fields, the field with the higher query frequency is screened out to be used as a candidate index for subsequent determination, so as to improve the hit rate of the query condition on the candidate index.
In some embodiments of the disclosure, in the step of obtaining the data sequence by sorting the data corresponding to the second query field in the preset database according to the preset order, the method may specifically include the following steps:
when the second query field is a numerical field, sorting the data according to a preset size sequence to obtain a data sequence; and when the second query field is a character field, sequencing the data according to a preset character sequence to obtain a data sequence.
Wherein, the numeric field includes a numeric field, and the character field includes: a symbol field, an alphabet field, and a text field.
Illustratively, the second query field may include: index group name (product _ name) and user age (user _ age), wherein the index group name is a character field, and data are sorted according to a preset literal sequence (such as dictionary sequence); the age of the user is a numerical field, and data are sorted according to a preset size sequence.
Here, the second query fields of different types are sorted according to different sorting modes, so that clear and ordered data sequences can be obtained, and the data sequences can be conveniently divided in the follow-up process.
In some embodiments of the present disclosure, in the step of dividing the data sequence according to the index granularity to obtain at least one second index group, the following steps may be specifically included:
dividing the data sequence corresponding to the second query field according to the index granularity to obtain at least one index interval; and determining a second index group according to the index intervals, wherein the second index group comprises at least one index interval corresponding to the second query field.
Specifically, when the second query field is a numeric field, the data sequence corresponding to the second query field may be [18,70], and when the index granularity is 3, the data sequence corresponding to the second query field is divided according to the index granularity to obtain at least one index interval, as shown in fig. 3, the obtained index intervals are [18,22], [17,34], [41,60], and [70,70 ].
When the second query field is a character-type field, the data sequence corresponding to the second query field may be [ app, dpp ], and when the index granularity is 3, the data sequence corresponding to the second query field is divided according to the index granularity to obtain at least one index interval, as shown in fig. 3, the obtained index intervals are [ app, app ], [ bpp, cpp ], [ cpp, dpp ], and [ dpp, dpp ].
Finally, the second index set ([18,22], [ app, app ]) ([17,34], [ bpp, cpp ], [ cpp, dpp ]) ([41,60], [ cpp, dpp ]) and ([70,70], [ dpp, dpp ]) are determined from the determined index intervals [18,22], [ bpp, cpp ], [ cpp, dpp ] and [ dpp, dpp ].
The data sequence corresponding to the second query field is divided according to the index granularity to obtain at least one index interval, and then the second index group is determined according to the index interval, so that the field types included in the second index group can be enriched, and query is accelerated.
In some embodiments of the present disclosure, S220 may specifically include the following steps: determining a first index interval according to the first query field and key value information corresponding to the first query field; acquiring at least one second index interval corresponding to a second query field included in a second index group; comparing the second index interval with the first index interval, and determining a target index interval at least comprising part of the first index interval from the second index interval; and determining a second index group corresponding to the target index interval as a target index.
In some embodiments of the present disclosure, the first query field at least includes a first subfield and a second subfield, and in S320, the following steps may be specifically included:
traversing the candidate indexes to obtain first candidate indexes matched with the first subfields; and traversing the first candidate index to obtain a target index matched with the second subfield.
Illustratively, when the key value information of the user query is "product _ name ═ cpp AND17< user _ age < 34", the first query field includes at least a first sub-field "product _ name ═ cpp" AND a second sub-field "17 < user _ age < 34", the candidate indexes are first traversed to obtain first candidate indexes ([ bpp, cpp ], [17,34 ]) AND ([ cpp, dpp ], [41,60 ]) matching the first sub-field.
Then, a target index ([ bpp, cpp ], [17,34 ]) matching the second subfield "17 < user _ age < 34" is obtained by traversing on the basis of the first candidate index.
It is to be understood that, when the first query field includes more than three subfields, after obtaining a first candidate index matching the first subfield and obtaining a target index matching the second subfield, the target index is determined as the first candidate index, and the traversal of the target index matching the third subfield is continued based on this.
Here, by sequentially traversing the candidate indexes with the first subfield and the second subfield, the target index matching the first query field can be quickly and accurately determined.
Finally, S230 is introduced.
In some embodiments of the present disclosure, the step of determining the data identifier associated with the target index may specifically include the following steps:
and removing the data identifications which do not meet the key value information from the data identifications associated with the target index to obtain a query result.
Exemplarily, when the key value information queried by the user is "product _ name ═ dpp", querying that data of "product _ name ═ dpp" are contained in the data identifiers associated with the target index ([ cpp, dpp ], [41,60 ]) and the target index ([ dpp, dpp ], [70,70 ]), taking out the data identifiers corresponding to the two target indexes, and filtering out the data identifiers where the product _ name is not equal to the dpp, thereby obtaining a query result.
Exemplarily, when the key value information queried by the user is "user _ age < 45", querying that data identifiers associated with the target index ([ bpp, cpp ], [17,34 ]) and the target index ([ cpp, dpp ], [41,60 ]) both contain data of "user _ age < 45", extracting data identifiers corresponding to the two target indexes, and filtering out data identifiers with user _ age not less than 45, thereby obtaining a query result.
Exemplarily, when the key value information queried by the user is "product _ name ═ dpp ANDuser _ age > 65", querying that data having "product _ name ═ dpp ANDuser _ age > 65" is included in the data identifiers associated with the target index ([ dpp, dpp ], [70,70 ]), taking out the data identifier corresponding to the target index, and filtering out the data identifiers which do not satisfy the key value information, thereby obtaining a query result.
Here, by removing data identifiers that do not satisfy the key value information from the data identifiers associated with the target index, the accuracy of the query result can be improved.
In summary, the embodiments of the present disclosure determine at least one candidate index including the associated second index group and the data identifier according to at least one of the index granularity and the second query field; then, determining a target index matched with the query condition from at least one candidate index according to key value information in the query condition input by the user, wherein the target index matched with the query condition input by the user can be determined from the candidate indexes, so that the target index required by the user in a preset database can be quickly positioned without scanning and querying each piece of data in the preset database; and finally, determining a query result from the data identifier of the target index according to the query condition, wherein the data corresponding to the target index is far smaller than the data of the preset database, which is equivalent to reducing the data range of scanning query, so that the query efficiency can be improved.
Based on the data query method, the disclosure also provides a data query device. This is explained in detail with reference to fig. 4.
FIG. 4 is a block diagram illustrating a data query device in accordance with an exemplary embodiment. Referring to fig. 4, the data query apparatus 400 may include an acquisition module 410, a matching module 420, and a determination module 430.
The obtaining module 410 is configured to perform obtaining of a query condition input by a user, where the query condition includes a first query field and key value information corresponding to the first query field.
And the matching module 420 is configured to determine a target index matched with the key value information from the candidate indexes when the second query field in the pre-stored candidate indexes comprises the first query field.
A determination module 430 configured to perform determining a data identity associated with the target index.
In the embodiment of the present disclosure, the data querying device 400 is capable of determining at least one candidate index including the associated second index group and the data identification according to at least one of the index granularity and the second query field; then, determining a target index matched with the query condition from at least one candidate index according to key value information in the query condition input by the user, wherein the target index matched with the query condition input by the user can be determined from the candidate indexes, so that the target index required by the user in a preset database can be quickly positioned without scanning and querying each piece of data in the preset database; and finally, determining a query result from the data identifier of the target index according to the query condition, wherein the data corresponding to the target index is far smaller than the data of the preset database, which is equivalent to reducing the data range of scanning query, so that the query efficiency can be improved.
In some embodiments of the present disclosure, the obtaining module is further configured to perform obtaining the index granularity and the at least one second query field.
Accordingly, the data query apparatus 400 may further include: a sorting module and a dividing module;
the sorting module is configured to execute sorting of the data corresponding to the second query field in the preset database according to a preset sequence to obtain a data sequence.
The dividing module is configured to divide the data sequence according to the index granularity to obtain at least one second index group.
The determining module 420 is further configured to perform determining at least one candidate index according to the second index group and the data identification associated with the second index group in the preset database.
In some embodiments of the present disclosure, the obtaining module 410 is further configured to execute obtaining the historical query fields included in the historical query conditions and the query frequency thereof.
The determining module 420 is further configured to determine a second query field with a query frequency greater than a preset threshold from the historical query fields.
In some embodiments of the present disclosure, the dividing module is further configured to divide the data sequence corresponding to the second query field according to the index granularity, so as to obtain at least one index interval.
The determining module 420 is further configured to perform determining a second index group according to the index interval, where the second index group includes at least one index interval corresponding to the second query field.
In some embodiments of the present disclosure, the sorting module is further configured to, when the second query field is a value-class field, sort the data according to a preset size order to obtain a data sequence.
The sorting module is further configured to, when the second query field is a character field, sort the data according to a preset text sequence to obtain a data sequence.
In some embodiments of the present disclosure, the first query field includes at least a first subfield and a second subfield, and the matching module 420 includes a traversal module;
the traversing module is configured to perform traversing the candidate indexes to obtain a first candidate index matched with the first subfield.
The traversing module is configured to traverse the first candidate index to obtain a target index matched with the second sub-field.
In some embodiments of the present disclosure, the determining module 430 includes a removing module;
the removing module is configured to remove data identifications which do not meet the key value information from the data identifications associated with the target index to obtain a query result.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 5 is a block diagram illustrating a server in accordance with an example embodiment. Referring to fig. 5, an embodiment of the present disclosure further provides a server including a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 complete communication with each other through the communication bus 540.
The memory 530 is used for storing instructions executable by the processor 510.
The processor 510, when executing the instructions stored in the memory 530, implements the following steps:
acquiring a query condition input by a user, wherein the query condition comprises a first query field and key value information corresponding to the first query field; when a second query field in the pre-stored candidate indexes comprises a first query field, determining a target index matched with the key value information from the candidate indexes; a data identification associated with the target index is determined.
It can be seen that, with the embodiments of the present disclosure, at least one candidate index including the associated second index group and the data identifier is determined according to at least one of the index granularity and the second query field; then, determining a target index matched with the query condition from at least one candidate index according to key value information in the query condition input by the user, wherein the target index matched with the query condition input by the user can be determined from the candidate indexes, so that the target index required by the user in a preset database can be quickly positioned without scanning and querying each piece of data in the preset database; and finally, determining a query result from the data identifier of the target index according to the query condition, wherein the data corresponding to the target index is far smaller than the data of the preset database, which is equivalent to reducing the data range of scanning query, so that the query efficiency can be improved.
FIG. 6 is a block diagram illustrating an apparatus for data processing according to an example embodiment. For example, the apparatus 600 may be provided as a server. Referring to fig. 6, server 600 includes a processing component 622 that further includes one or more processors and memory resources, represented by memory 632, for storing instructions, such as applications, that are executable by processing component 622. The application programs stored in memory 632 may include one or more modules that each correspond to a set of instructions. Further, the processing component 622 is configured to execute instructions to perform the data query method described in any of the above embodiments.
The device 600 may also include a power component 626 configured to perform power management for the device 600, a wired or wireless network interface 650 configured to connect the device 600 to a network, and an input/output (I/O) interface 658. The device 600 may operate based on an operating system stored in the memory 632, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In some embodiments of the present disclosure, a storage medium is further provided, and when executed by a processor of a server, the instructions in the storage medium enable the server to execute the data query method described in any one of the above embodiments.
Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In some embodiments of the present disclosure, there is further provided a computer program product, wherein instructions of the computer program product, when executed by a processor of a server, enable the server to execute the data query method of any of the above embodiments.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for querying data, comprising:
acquiring a query condition input by a user, wherein the query condition comprises a first query field and key value information corresponding to the first query field;
when a second query field in pre-stored candidate indexes comprises the first query field, determining a target index matched with the key value information from the candidate indexes;
a data identification associated with the target index is determined.
2. The method of claim 1, wherein prior to the determining the target index from the candidate indexes that matches the key value information, the method further comprises:
obtaining index granularity and at least one second query field;
sorting the corresponding data of the second query field in the preset database according to a preset sequence to obtain a data sequence;
dividing the data sequence according to the index granularity to obtain at least one second index group;
and determining the at least one candidate index according to the second index group and the data identification associated with the second index group in the preset database.
3. The method of claim 2, wherein prior to the obtaining the index granularity and the at least one second query field, the method further comprises:
acquiring historical query fields and query frequency thereof included in the historical query conditions;
and determining the second query field with the query frequency larger than a preset threshold value from the historical query fields.
4. The method of claim 2, wherein the partitioning the data sequence according to the index granularity to obtain at least one second index group comprises:
dividing the data sequence corresponding to the second query field according to the index granularity to obtain at least one index interval;
and determining the second index group according to the index intervals, wherein the second index group comprises at least one index interval corresponding to the second query field.
5. The method according to claim 2, wherein the sorting the data corresponding to the second query field in the preset database according to a preset order to obtain a data sequence comprises:
when the second query field is a numerical field, sorting the data according to a preset size sequence to obtain the data sequence;
and when the second query field is a character field, sequencing the data according to a preset character sequence to obtain the data sequence.
6. The method of claim 1, wherein the first query field comprises at least a first sub-field and a second sub-field, and wherein determining the target index from the candidate indexes that matches the key value information comprises:
traversing the candidate index to obtain a first candidate index matched with the first subfield;
and traversing the first candidate index to obtain the target index matched with the second subfield.
7. The method of claim 1, wherein the key value information matches the target index portion, and wherein determining the data identity associated with the target index comprises:
and removing the data identifications which do not meet the key value information from the data identifications associated with the target index to obtain the query result.
8. A data query apparatus, comprising:
the system comprises an acquisition module, a storage module and a display module, wherein the acquisition module is configured to execute the acquisition of a query condition input by a user, and the query condition comprises a first query field and key value information corresponding to the first query field;
a matching module configured to determine a target index matched with the key value information from the candidate indexes when a second query field in the pre-stored candidate indexes includes the first query field;
a determination module configured to perform determining a data identity associated with the target index.
9. A server, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data query method of any one of claims 1 to 7.
10. A storage medium, wherein instructions in the storage medium, when executed by a processor of a server, enable the server to perform the data query method of any one of claims 1 to 7.
CN202011159083.0A 2020-10-26 2020-10-26 Data query method, device, server and storage medium Active CN112364014B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011159083.0A CN112364014B (en) 2020-10-26 2020-10-26 Data query method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011159083.0A CN112364014B (en) 2020-10-26 2020-10-26 Data query method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN112364014A true CN112364014A (en) 2021-02-12
CN112364014B CN112364014B (en) 2024-01-02

Family

ID=74510518

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011159083.0A Active CN112364014B (en) 2020-10-26 2020-10-26 Data query method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN112364014B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112765118A (en) * 2021-04-08 2021-05-07 北京优特捷信息技术有限公司 Log query method, device, equipment and storage medium
CN112835930A (en) * 2021-03-03 2021-05-25 上海渠杰信息科技有限公司 Database query method and device
CN113157703A (en) * 2021-04-29 2021-07-23 北京小米移动软件有限公司 Data query method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106959963A (en) * 2016-01-12 2017-07-18 杭州海康威视数字技术股份有限公司 A kind of data query method, apparatus and system
CN111008200A (en) * 2019-12-18 2020-04-14 北京数衍科技有限公司 Data query method and device and server
CN111797134A (en) * 2020-06-23 2020-10-20 北京小米松果电子有限公司 Data query method and device of distributed database and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106959963A (en) * 2016-01-12 2017-07-18 杭州海康威视数字技术股份有限公司 A kind of data query method, apparatus and system
CN111008200A (en) * 2019-12-18 2020-04-14 北京数衍科技有限公司 Data query method and device and server
CN111797134A (en) * 2020-06-23 2020-10-20 北京小米松果电子有限公司 Data query method and device of distributed database and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835930A (en) * 2021-03-03 2021-05-25 上海渠杰信息科技有限公司 Database query method and device
CN112765118A (en) * 2021-04-08 2021-05-07 北京优特捷信息技术有限公司 Log query method, device, equipment and storage medium
CN113157703A (en) * 2021-04-29 2021-07-23 北京小米移动软件有限公司 Data query method and device, electronic equipment and storage medium
CN113157703B (en) * 2021-04-29 2023-11-21 北京小米移动软件有限公司 Data query method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112364014B (en) 2024-01-02

Similar Documents

Publication Publication Date Title
CN112364014B (en) Data query method, device, server and storage medium
CN107544982B (en) Text information processing method and device and terminal
CN113255370B (en) Industry type recommendation method, device, equipment and medium based on semantic similarity
CN109460386B (en) Malicious file homology analysis method and device based on multi-dimensional fuzzy hash matching
CN108536739B (en) Metadata sensitive information field identification method, device, equipment and storage medium
CN112328842B (en) Data processing method and device, electronic equipment and storage medium
CN111931809A (en) Data processing method and device, storage medium and electronic equipment
CN108182200B (en) Keyword expansion method and device based on semantic similarity
CN111241400A (en) Information searching method and device
CN112148841B (en) Object classification and classification model construction method and device
CN113486664A (en) Text data visualization analysis method, device, equipment and storage medium
CN111104422B (en) Training method, device, equipment and storage medium of data recommendation model
CN112596851A (en) Multi-source heterogeneous data batch extraction method and analysis method of simulation platform
CN106844406B (en) Search method and search device
CN115147020B (en) Decoration data processing method, device, equipment and storage medium
CN108830302B (en) Image classification method, training method, classification prediction method and related device
CN111045735A (en) Personalized guide page pushing method, device and system
CN110909288B (en) Service data processing method, device, platform, service end, system and medium
CN109446330B (en) Network service platform emotional tendency identification method, device, equipment and storage medium
CN114780589A (en) Multi-table connection query method, device, equipment and storage medium
CN110633430B (en) Event discovery method, apparatus, device, and computer-readable storage medium
CN116702059B (en) Intelligent production workshop management system based on Internet of things
CN113886658A (en) Data processing method and device, storage medium and electronic equipment
CN117009463A (en) Processing method and device for multi-path recall text similarity
CN117033575A (en) Mixed word detection method, device, electronic equipment and readable storage medium

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