Query method and query device for data and electronic equipment

By setting a whitelist and a cache database in the data query system, we can determine whether the query key of the user query statement is in the whitelist, and query data in the cached database or the original database based on the results, solving the problem of low query efficiency under large data volumes , realizes more efficient data query.

CN119396871APending Publication Date: 2025-02-07QINGDAO HAIER TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411454468.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

As the amount and dimensions of data in the original database increase, the combination of query conditions becomes more and more flexible, resulting in less efficient querying data from the original database.

Method used

By setting a whitelist based on hotspot query statements in advance, and querying the result data corresponding to the key in the whitelist in the cache database, receiving the query statement input by the user and converting it into the target query key, to determine whether it is in the whitelist, if If it is on the whitelist, query it in the cache database, otherwise query it in the original database.

Benefits of technology

Improve the efficiency of data query, reduce the load on the original database, and share the access pressure of the database through cache.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396871A_ABST
    Figure CN119396871A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses a query method and a query device for data and electronic equipment. The query method comprises the following steps: receiving a query statement input by a user, and converting the query statement into a target query key; determining whether the target query key is in a white list or not; wherein the white list is a key list set based on the hotspot query statement; under the condition that the target query key is in the white list, querying a target query result corresponding to the target query key in a cache database; wherein result data corresponding to the query key in the white list is cached in the cache database; and under the condition that the target query key is not in the white list, querying a target query result corresponding to the target query key in the original database. The data query efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, for example, to a method and device for querying data, and an electronic device. Background Art

[0002] At present, with the development of information technology, each business processing will accumulate a huge amount of data, which plays a vital role in business decision-making, market analysis, product optimization, etc. Therefore, these business data will be saved in the original database for users to query and use.

[0003] In the related art, users usually use business intelligence (BI) tools to query data from the original database.

[0004] In the process of implementing the embodiments of the present disclosure, it is found that there are at least the following problems in the related art:

[0005] As the amount and dimensions of data in the original database increase, the combination of query conditions becomes more and more flexible, which leads to low efficiency in querying data from the original database. Therefore, how to improve the efficiency of data query has become a technical problem that needs to be solved urgently.

[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0007] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0008] The embodiments of the present disclosure provide a method and device for querying data, and an electronic device, which can improve the efficiency of data query.

[0009] In some embodiments, a method for querying data includes: receiving a query statement input by a user, and converting the query statement into a target query key; determining whether the target query key is in a whitelist; wherein the whitelist is a key list set based on a hot query statement; when the target query key is in the whitelist, querying a cache database for a target query result corresponding to the target query key; wherein the cache database caches result data corresponding to the query key in the whitelist; when the target query key is not in the whitelist, querying an original database for a target query result corresponding to the target query key.

[0010] Optionally, when the target query key is in the whitelist, the target query result corresponding to the target query key is queried in the cache database, including: confirming whether the target query key is included in the valid key list; when the target query key is included in the valid key list, querying the target query result corresponding to the target query key in the cache database; when the target query key is not included in the valid key list, querying the target query result corresponding to the target query key in the original database.

[0011] Optionally, when the target query key is not included in the valid key list, after querying the target query result corresponding to the target query key in the original database, the query method also includes: caching the result data corresponding to the target query result to the cache database; after the caching is completed, adding the target query key to the valid key list.

[0012] Optionally, when no target query result corresponding to the target query key is found in the cache database, the query method further includes: querying the original database according to the target query key, and deleting the target query key from the valid key list.

[0013] Optionally, the query method also includes: confirming the first number of occurrences of each query key in the valid key list within a first set continuous time length; deleting the query key whose first number of occurrences is 0 from the valid key list, and deleting the result data corresponding to the query key whose first number of occurrences is 0 in the cache database.

[0014] Optionally, converting the query statement into a query key includes: using a semantic parser to decompose the query statement into a syntax tree to obtain multiple key information; and combining the multiple key information according to a preset strategy to obtain a target query key.

[0015] Optionally, the query method further includes: confirming a second occurrence number of each query key submitted by the user within a second set time period; and adding query keys whose second occurrence number is greater than or equal to the second set number to a whitelist.

[0016] In some embodiments, a device for querying data includes: a receiving module, configured to receive a query statement input by a user and convert the query statement into a target query key; a determining module, configured to determine whether the target query key is in a whitelist; wherein the whitelist is a key list set based on a hot query statement; a query module, configured to query a cache database for a target query result corresponding to the target query key if the target query key is in the whitelist; wherein the cache database caches result data corresponding to the query key in the whitelist; the query module is also configured to query an original database for a target query result corresponding to the target query key if the target query key is not in the whitelist.

[0017] In some embodiments, a device for querying data includes a processor and a memory storing program instructions, and the processor is configured to execute the above-mentioned method for querying data when running the program instructions.

[0018] In some embodiments, an electronic device includes: a device body; and a data query device as described above, which is disposed in the device body.

[0019] The data query method, query device, and electronic device provided by the embodiments of the present disclosure can achieve the following technical effects:

[0020] In the disclosed embodiment, a whitelist is set in advance based on hot query statements, and a cache database for caching result data corresponding to the query key in the whitelist is set. After receiving the user's query statement and converting the query statement into a target query key, it will first determine whether the target query key is in the whitelist. For the target query key in the whitelist, the target query result corresponding to the target query key can be directly queried from the cache database, which improves the speed of obtaining the query result. For the target query key that is not in the whitelist, the target query result corresponding to the target query key will be queried in the original database, and since some query keys are executed in the cache database, the access pressure of the original database is shared, which reduces the load of the original database compared to the method of accessing the original database for querying. Therefore, the disclosed embodiment can improve the efficiency of data query.

[0021] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0024] Figure 1 is a schematic diagram of an electronic device provided by an embodiment of the present disclosure;

[0025] Figure 2 is a schematic diagram of a method for querying data provided by an embodiment of the present disclosure;

[0026] Figure 3 is a schematic diagram of another method for querying data provided by an embodiment of the present disclosure;

[0027] Figure 4 is a schematic diagram of another method for querying data provided by an embodiment of the present disclosure;

[0028] Figure 5 is a schematic diagram of a data query device provided by an embodiment of the present disclosure;

[0029] Figure 6 It is a schematic diagram of another device for querying data provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] like Figure 1 As shown, the electronic device 100 includes a device body 110 and a data query device 500 (600).

[0033] Specifically, the query device 500 ( 600 ) for data is disposed in the device body 110 .

[0034] Optionally, the query device 600 for data includes a processor, which can receive a query statement input by a user and convert the query statement into a target query key. After obtaining the target query key, the processor needs to first determine whether the target query key is in a whitelist set based on the hot query statement. If the target query key is in the whitelist, the processor queries the target query result corresponding to the target query key in the cache database (the cache database is a database that caches the result data corresponding to the query key in the whitelist). If the target query key is not in the whitelist, the processor queries the target query result corresponding to the target query key in the original database.

[0035] In combination with the above electronic device, the present disclosure provides a method for querying data, such as Figure 2 As shown, the query method includes:

[0036] S201, the processor receives a query statement input by a user, and converts the query statement into a target query key.

[0037] Specifically, the query key is an identifier used to uniquely identify a query request in a database query or cache mechanism, and can be a string or identifier generated by processing certain key information (such as query conditions, keywords) in the query statement through a preset strategy.

[0038] Optionally, converting the query statement into a query key includes: using a semantic parser to decompose the query statement into a syntax tree to obtain multiple key information; and combining the multiple key information according to a preset strategy to obtain a target query key.

[0039] Specifically, a semantic parser is a tool that can understand and analyze the semantics of a query statement. It can convert a query statement into an internal structured representation, which is called a syntax tree (Syntax Tree), or an abstract syntax tree (AST). A syntax tree is a tree structure that represents the grammatical structure of a query statement. In a syntax tree, each node represents a part of a query statement, such as a query field, table name, predicate condition, aggregation condition, etc. By disassembling the syntax tree generated based on the query statement, the semantic parser can extract the various components of the query statement and the relationship between them, thereby obtaining multiple key information of the query statement.

[0040] Specifically, the preset strategy is a set of rules or algorithms that define the selection of key information, the order of key information, the interval between key information, etc. when constructing the query key. Therefore, the processor can combine multiple key information according to the preset strategy to obtain the target query key.

[0041] Optionally, in order to shorten the length of the query key and improve the efficiency of searching for data in the cache database or the original database, a hash algorithm is used to hash multiple key information or the constructed query key.

[0042] S202, the processor determines whether the target query key is in the whitelist; wherein the whitelist is a key list set based on the hot query statement.

[0043] Specifically, the whitelist is a key list that is pre-set based on hot query statements (frequently appearing query statements) of the business corresponding to the data stored in the original database.

[0044] Specifically, for a query key in the whitelist, the corresponding result data is stored in the cache database, that is, if the query key is in the whitelist, the result data can be directly queried from the cache database without querying in the original database. Therefore, after determining the target query key, it is necessary to first determine whether the target query key is in the whitelist.

[0045] S203, when the target query key is in the whitelist, the processor queries the cache database for a target query result corresponding to the target query key; wherein the cache database caches result data corresponding to the query key in the whitelist.

[0046] Specifically, the cache database is a database used to cache the result data corresponding to the query key in the whitelist. The database needs to have a high reading speed and low latency to ensure that the target query result can be quickly queried by querying the cache database.

[0047] Specifically, if the target query key is in the whitelist, it indicates that result data corresponding to the target query key is cached in the cache database. Therefore, in this case, the processor searches the cache database for the target query result corresponding to the target query key.

[0048] S204: When the target query key is not in the whitelist, the processor searches the original database for a target query result corresponding to the target query key.

[0049] Specifically, the original database is a database used to store all business data of a business.

[0050] Specifically, if the target query key is not in the whitelist, it means that the query statement entered by the user is not a hot query statement, and the corresponding result data is not cached in the cache database. Therefore, in this case, the processor needs to query the target query result corresponding to the target query key in the original database.

[0051] In the disclosed embodiment, a whitelist is set in advance based on hot query statements, and a cache database for caching result data corresponding to the query key in the whitelist is set. After receiving the user's query statement and converting the query statement into a target query key, it will first determine whether the target query key is in the whitelist. For the target query key in the whitelist, the target query result corresponding to the target query key can be directly queried from the cache database, which improves the speed of obtaining the query result. For the target query key that is not in the whitelist, the target query result corresponding to the target query key will be queried in the original database, and since some query keys are executed in the cache database, the access pressure of the original database is shared, which reduces the load of the original database compared to the method of accessing the original database for querying. Therefore, the disclosed embodiment can improve the efficiency of data query.

[0052] The present disclosure provides another method for querying data. Figure 3 As shown, the query method includes:

[0053] S301, the processor receives a query statement input by a user, and converts the query statement into a target query key.

[0054] S302, the processor determines whether the target query key is in the whitelist; wherein the whitelist is a key list set based on the hot query statement.

[0055] S303: When the target query key is in the whitelist, the processor confirms whether the target query key is included in the valid key list.

[0056] Specifically, the valid key list is a list used to record which query key result data is stored in the cache database.

[0057] Specifically, if the target query key is not included in the valid key list, then even if the target query key is in the whitelist, the corresponding result data cannot be queried from the cache database. Therefore, in order to reduce invalid query operations on the cache database, after confirming that the target query key is in the whitelist, the processor also needs to confirm whether the target query key is included in the valid key list.

[0058] S304, when the processor includes the target query key in the valid key list, the processor queries the cache database for the target query result corresponding to the target query key; wherein the cache database caches the result data corresponding to the query key in the whitelist.

[0059] Specifically, if the target query key is included in the valid key list, it indicates that the cache database has cached result data corresponding to the target query key. Therefore, in this case, the processor searches the cache database for the target query result corresponding to the target query key.

[0060] S305: When the processor does not include the target query key in the valid key list, it searches the original database for a target query result corresponding to the target query key.

[0061] Specifically, if the target query key is not included in the valid key list, it indicates that the cache database does not cache the result data corresponding to the target query key. Therefore, in this case, the processor directly queries the original database for the target query result corresponding to the target query key.

[0062] S306: If the target query key is not in the whitelist, the processor searches the original database for a target query result corresponding to the target query key.

[0063] In the disclosed embodiment, after confirming that the target query key is in the whitelist, it is also confirmed whether the target query key is included in the valid key list. Only when it is confirmed that the valid key list includes the target query key, the target query result corresponding to the target query key is queried in the cache database. In this way, invalid query operations on the cache database are reduced.

[0064] The present disclosure provides another method for querying data. Figure 4 As shown, the query method includes:

[0065] S401: The processor receives a query statement input by a user and converts the query statement into a target query key.

[0066] S402, the processor determines whether the target query key is in the whitelist; wherein the whitelist is a key list set based on the hot query statement.

[0067] S403: When the target query key is in the whitelist, the processor confirms whether the valid key list includes the target query key.

[0068] S404, when the processor includes the target query key in the valid key list, the processor queries the cache database for the target query result corresponding to the target query key; wherein the cache database caches the result data corresponding to the query key in the whitelist.

[0069] S405: When the processor does not include the target query key in the valid key list, it searches the original database for a target query result corresponding to the target query key.

[0070] S406: The processor caches the result data corresponding to the target query result into a cache database.

[0071] Specifically, when the target query key is a query key in the whitelist, by caching the result data corresponding to the query result in the cache database, the next time the same query key is encountered, the query can be directly performed from the cache database, which is conducive to improving the efficiency of data query.

[0072] S407, after the processor cache is completed, the target query key is added to the valid key list.

[0073] Specifically, after the result data corresponding to the target query result is cached in the cache database, by adding the target query key to the valid key list, when there is the same query key next time, it can be determined whether the cache database has the corresponding result data cached based on the valid key list. This helps to reduce invalid query operations on the cache database.

[0074] S408: If the target query key is not in the whitelist, the processor searches the original database for a target query result corresponding to the target query key.

[0075] In the disclosed embodiment, for a target query key that is in the whitelist but this time queries the target query result from the original database, the result data corresponding to the target query result will be cached in the cache database, and the target query key will be added to the valid key list. This is helpful to reduce subsequent invalid query operations on the cache database and improve the efficiency of subsequent query data.

[0076] In some embodiments, when no target query result corresponding to the target query key is found in the cache database, the query method further includes: querying the original database according to the target query key, and deleting the target query key from the valid key list.

[0077] Specifically, if the target query result corresponding to the target query key is not found in the cache database, it means that the information in the valid key list is incorrect and the corresponding result data is not cached in the cache database. Therefore, in this case, it is necessary to query the original database according to the target query key and delete the target query key from the valid key list.

[0078] In some embodiments, the query method also includes: confirming the first number of occurrences of each query key in the valid key list within a first set continuous time length; deleting the query key whose first number of occurrences is 0 from the valid key list, and deleting the result data corresponding to the query key whose first number of occurrences is 0 in the cache database.

[0079] It is understandable that hot query statements will change over time, which may cause the result data cached in the cache database to become useless data due to the change of hot spots. Therefore, in the embodiment of the present disclosure, the first occurrence number of each query key in the valid key list within the first set time period is monitored to confirm whether the query statement corresponding to each query key is still a hot query statement.

[0080] Specifically, if the query key has a first occurrence count of 0 within a first set time period, it indicates that the query statement corresponding to the query key has not been searched for a long time, and the query statement corresponding to the query key is no longer a hot query statement. Therefore, in the embodiment of the present disclosure, the query key with a first occurrence count of 0 will be deleted from the valid key list, and the result data corresponding to the query key with a first occurrence count of 0 will be deleted from the cache database.

[0081] Optionally, the first set duration is 5 to 10 days.

[0082] In the disclosed embodiment, it is monitored whether the query statement corresponding to each query key in the valid key list is still a hot query statement. If it is no longer a hot query statement, the query key will be deleted from the valid key list, and the result data corresponding to the query key will be deleted from the cache database. In this way, useless data in the cache database is reduced, which is conducive to improving the efficiency of subsequent data queries from the cache database.

[0083] In some embodiments, the query method further includes: confirming the second occurrence number of each query key submitted by the user within a second set time period; and adding the query keys whose second occurrence number is greater than or equal to the second set number to the whitelist.

[0084] It is understandable that hot query statements will change over time. Therefore, the whitelist needs to be updated regularly.

[0085] Specifically, if the second occurrence number of the query key submitted by the user within the second set time period is greater than or equal to the second set number, it indicates that the query statement corresponding to the query key is a recent hot query statement. Therefore, the query key whose second occurrence number is greater than or equal to the second set number needs to be added to the whitelist.

[0086] In the disclosed embodiment, the whitelist is updated regularly, thus ensuring the accuracy of the result data cached in the cache database, which is beneficial to improving the efficiency of subsequent querying data from the cache database.

[0087] Combination Figure 5 As shown, an embodiment of the present disclosure provides a query device 500 for data, including: a receiving module 501, a determining module 502 and a query module 503. The receiving module 501 is configured to receive a query statement input by a user, and convert the query statement into a target query key. The determining module 502 is configured to determine whether the target query key is in a whitelist; wherein the whitelist is a key list set based on hot query statements. The query module 503 is configured to query the target query result corresponding to the target query key in the cache database when the target query key is in the whitelist; wherein the result data corresponding to the query key in the whitelist is cached in the cache database. The query module is also configured to query the target query result corresponding to the target query key in the original database when the target query key is not in the whitelist.

[0088] Combination Figure 6As shown, the embodiment of the present disclosure provides a device 600 for querying data, and the device 600 for querying data includes: a processor (processor) 601 and a memory (memory) 602. Optionally, the device may also include a communication interface (Communication Interface) 603 and a bus 604. Among them, the processor 601, the communication interface 603, and the memory 602 can communicate with each other through the bus 604. The communication interface 603 can be used for information transmission. The processor 601 can call the logic instructions in the memory 602 to execute the query method for data of the above embodiment.

[0089] In addition, the logic instructions in the memory 602 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.

[0090] The memory 602 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 601 executes the functional application and data processing by running the program instructions / modules stored in the memory 602, that is, implements the query method for data in the above embodiment.

[0091] The memory 602 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 602 may include a high-speed random access memory and may also include a non-volatile memory.

[0092] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned query method for data.

[0093] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes.

[0094] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0095] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for querying data, characterized in that: include: Receive the query statement entered by the user and convert it into the target query key; Determine whether the target query key is in the whitelist; the whitelist is a key list set based on the hot query statement; When the target query key is in the whitelist, query the cache database for the target query result corresponding to the target query key; wherein the cache database caches the result data corresponding to the query key in the whitelist; If the target query key is not in the whitelist, the target query result corresponding to the target query key is queried in the original database.

2. The query method according to claim 1, characterized in that: When the target query key is in the whitelist, query the cache database for the target query result corresponding to the target query key, including: Confirm whether the target query key is included in the valid key list; When the target query key is included in the valid key list, the target query result corresponding to the target query key is searched in the cache database; When the target query key is not included in the valid key list, the target query result corresponding to the target query key is searched in the original database.

3. The query method according to claim 2, characterized in that: When the target query key is not included in the valid key list, after searching the original database for the target query result corresponding to the target query key, the query method further includes: Cache the result data corresponding to the target query result into the cache database; After caching is completed, the target query key is added to the valid key list.

4. The query method according to claim 2, characterized in that: When no target query result corresponding to the target query key is found in the cache database, the query method further includes: Query the original database according to the target query key and delete the target query key from the valid key list.

5. The query method according to claim 2, characterized in that: Also includes: Confirm the first occurrence of each query key in the valid key list within the first set time period; The query key whose first occurrence is 0 is deleted from the valid key list, and the result data corresponding to the query key whose first occurrence is 0 is deleted from the cache database.

6. The query method according to any one of claims 1 to 5, characterized in that: Convert the query statement into a query key, including: Use semantic parser to decompose the query statement into syntax tree to obtain multiple key information; Combine multiple key information according to the preset strategy to obtain the target query key.

7. The query method according to any one of claims 1 to 5, characterized in that: Also includes: Confirm the second occurrence count of each query key submitted by the user within the second set time period; Add the query key whose second occurrence number is greater than or equal to the second set number to the whitelist.

8. A device for querying data, characterized in that: include: A receiving module is configured to receive a query statement input by a user and convert the query statement into a target query key; A determination module is configured to determine whether the target query key is in a whitelist; wherein the whitelist is a key list set based on a hot query statement; The query module is configured to query the target query result corresponding to the target query key in the cache database when the target query key is in the whitelist; wherein the cache database caches the result data corresponding to the query key in the whitelist; The query module is also configured to query the original database for a target query result corresponding to the target query key if the target query key is not in the whitelist.

9. A data query device, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the data query method according to any one of claims 1 to 7 when running the program instructions.

10. An electronic device, characterized in that: include: Equipment body; The data query device as described in claim 8 or 9 is installed on the device body.