Data query method and device

By storing part of the data in the first database and all the data in the second database, efficient historical data query is realized, and the problem of inefficient data query in traditional methods is solved, and business response speed and query simplicity are improved.

CN119782352APending Publication Date: 2025-04-08CHINA CONSTR BANK CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411853520.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In traditional data storage environments, historical data query is inefficient, resulting in delayed business response and it is difficult for non-technical personnel to conduct report query.

Method used

By storing part of the data of the original database in the first database and storing all the data from the second database when necessary for querying, the part of the data is obtained using the high response speed of the first database, and if it is incomplete, the complete data is obtained from the second database.

Benefits of technology

It improves the efficiency and response speed of historical data query, simplifies the report query process for non-technical personnel, and solves the problem of inefficient data query in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782352A_ABST
    Figure CN119782352A_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a data query method and device, including: in response to a target query instruction of target data, obtaining first data in a first database, wherein the first database is used to store part of the data in an original database; verifying whether all the target data are included in the first data; in the case of determining that only part of the target data is included in the first data, obtaining second data in a second database in response to the target query instruction, wherein the second database is used to store all the data in the original database; determining the target data based on the first data and the second data; the first database has a higher response speed to the data query instruction than the second database, and the second database has a higher response speed to the data query instruction than the original database. Through the present invention, the problem of low efficiency of historical data query in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the computer field, and in particular, to a data query method and device. Background Art

[0002] In daily operations, it is often necessary to quickly and accurately obtain historical data for decision support or audit review. However, in traditional data storage environments, report queries usually require manual SQL statements, which is not only time-consuming but also difficult for non-technical personnel. In addition, as the amount of data increases, the database slows down data query speed after storing a large amount of data, thus affecting the timely response of the business.

[0003] There is currently no effective solution to the above problems. Summary of the invention

[0004] The embodiments of the present invention provide a data query method and device to at least solve the problem of low efficiency of historical data query in the related art.

[0005] According to one embodiment of the present invention, a data query method is provided, comprising: in response to a target query instruction of target data, obtaining first data in a first database, wherein the first database is used to store part of the data in an original database; verifying whether the first data includes all of the target data; in the case where it is determined that the first data only includes part of the target data, obtaining second data in a second database in response to the target query instruction, wherein the second database is used to store all of the data in the original database; determining the target data based on the first data and the second data; the response speed of the first database to the data query instruction is higher than the response speed of the second database to the data query instruction, and the response speed of the second database to the data query instruction is higher than the response speed of the original database to the data query instruction.

[0006] In an exemplary embodiment, whether all the target data are included in the first data is verified, including: obtaining the size of the return value of a historical data query instruction to obtain a first numerical value, wherein the historical data query instruction is a query instruction having a similarity with a query instruction of the target data greater than or equal to a preset threshold; estimating the size of the target data based on the first numerical value to obtain an estimated numerical value; and verifying whether all the target data are included in the first data based on the estimated numerical value.

[0007] In an exemplary embodiment, whether the first data includes all the target data is verified based on the estimated value, including: obtaining the size of the first data to obtain a second value; if the difference between the second value and the estimated value is less than a preset threshold, determining that the first data includes all the target data; otherwise, determining that the first data does not include all the target data.

[0008] In an exemplary embodiment, verifying whether the first data includes all of the target data includes: reading a preset list of the first database, wherein the preset list is used to record the integrity of each category of data stored in the first database; and determining from the preset list whether the first data includes all of the target data.

[0009] In an exemplary embodiment, determining from the preset list whether the first data includes all of the target data includes: obtaining the target type of the target data; searching the preset list for the integrity of the data of the target type to obtain a first result; if the first result is that the stored data is complete, determining that the first data includes all of the target data; otherwise, determining that the first data does not include all of the target data.

[0010] In an exemplary embodiment, the target data is determined based on the first data and the second data, including: when the first data includes all of the target data, the first data is determined as the target data; when the first data does not include all of the target data, the second data is determined as the target data, wherein the second data includes the target data; or, when the first data does not include all of the target data, the first data and the second data are determined as the target data, wherein the second data is data in the target data other than the first data.

[0011] According to another embodiment of the present invention, a data query device is provided, comprising: a first acquisition module, used to acquire first data in a first database in response to a target query instruction of target data, wherein the first database is used to store part of the data in an original database; a verification module, used to verify whether the first data includes all of the target data; a second acquisition module, used to acquire second data in a second database in response to the target query instruction when it is determined that the first data only includes part of the target data, wherein the second database is used to store all the data in the original database; a determination module, used to determine the target data based on the first data and the second data; the response speed of the first database to the data query instruction is higher than the response speed of the second database to the data query instruction, and the response speed of the second database to the data query instruction is higher than the response speed of the original database to the data query instruction.

[0012] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of any of the above methods when executed by a processor.

[0013] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0014] According to yet another embodiment of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0015] Through the present invention, since the response speed of the first database is higher than that of the second database, and the response speed of the second database is higher than that of the original database, the data in the original database is transferred to the first database and the second database, and when querying data, the data is first obtained from the first database, and when the obtained data is incomplete, the data is obtained from the second database, which effectively improves the query performance and response speed. Therefore, the problem of low efficiency of historical data query in the related art can be solved, and the effect of improving the efficiency of historical data query can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a hardware structure block diagram of a mobile terminal according to a data query method of an embodiment of the present invention;

[0017] Figure 2 is a flow chart of a method for querying data according to an embodiment of the present invention;

[0018] Figure 3 is a flow chart of data management according to an embodiment of the present invention;

[0019] Figure 4 It is a structural block diagram of a data query device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0020] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0022] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a data query method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0023] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data query method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0024] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0025] In this embodiment, a method for querying data running on the above mobile terminal or network architecture is provided. Figure 2 is a flow chart of a method for querying data according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0026] Step S202, in response to a target query instruction of target data, obtaining first data in a first database, wherein the first database is used to store part of the data in the original database;

[0027] The above-mentioned target data may be data that a user needs to obtain from a database; the above-mentioned target query instruction may be an instruction for querying the target data in a database; the above-mentioned first database may be a database for storing historical data, and the database may be a distributed search database, such as an Elasticsearch database. By storing, retrieving and analyzing data through the first database, a large amount of data can be processed quickly and efficiently, and real-time data processing can be realized; the above-mentioned first data may be data obtained from the first database; the above-mentioned original database may be a database for initially collecting and integrating historical data, and the database may be a centralized database, such as an Oracle database; the system obtains the first data from the first database in response to the target query instruction of the target data.

[0028] Step S204, verifying whether the first data includes all the target data;

[0029] Since some data may be lost or incomplete when migrating the data in the original database to the first database, the first database only stores part of the data in the original database. After obtaining the first data, it is necessary to verify the first data to determine whether the first data includes all the target data to ensure the integrity and accuracy of the obtained target data.

[0030] Optionally, verifying whether all the target data are included in the first data includes: obtaining the size of the return value of a historical data query instruction to obtain a first numerical value, wherein the historical data query instruction is a query instruction whose similarity with the query instruction of the target data is greater than or equal to a preset threshold; estimating the size of the target data according to the first numerical value to obtain an estimated numerical value; and verifying whether all the target data are included in the first data according to the estimated numerical value.

[0031] The above-mentioned historical query instruction can be a data query instruction in which the queried data is similar to the target data within the historical time range, that is, a query instruction whose similarity with the query instruction of the target data is greater than or equal to a preset threshold. For example, the target query instruction can be a query for the total value of each year in the past ten years. In this case, the historical query instruction can be a query for the total value of each year in the past five years, or a query for the total value of all years; the above-mentioned return value can be a numerical value returned by the query instruction. For example, when the historical query instruction can be a query for the total value of each year in the past five years, the return value can be five specific numerical values, wherein each numerical value represents the total value of each year in five years; the above-mentioned first size can be the data or file size of the return value, such as 1M, 2M, 3M, etc.; obtain the return value of the query instruction similar to the target query instruction within the historical time range, and determine the data size of the return value, that is, the first numerical value, estimate the data size of the target numerical value according to the first numerical value, and obtain the estimated numerical value, so as to judge whether the first data includes all the target data according to the estimated numerical value.

[0032] As an optional implementation, verifying whether the first data includes all the target data is performed based on the estimated value, including: obtaining the size of the first data to obtain a second value; if the difference between the second value and the estimated value is less than a preset threshold, determining that the first data includes all the target data; otherwise, determining that the first data does not include all the target data.

[0033] The above-mentioned second value can be the data of the first data (i.e., the return value of the target query instruction in the first database) or the file size, such as 1M, 2M, 3M, etc.; obtain the data size of the first data to obtain the second value, compare the second value with the estimated value, and when the difference between the second value and the estimated value is less than a preset threshold, determine that the first data includes all the target data; otherwise, determine that the first data does not include all the target data, wherein the preset threshold can be set according to actual conditions.

[0034] For example, the historical data query instruction is to query the total value of each year in the past five years, and the size of the return value (that is, the first value) is 5M. The target query instruction is to query the total value of each year in the past ten years. The size of the target data is estimated by the first value, and the estimated value is 10M. At the same time, the second value of the first data is obtained. If the difference between the second value and 10M is less than the preset threshold, it is determined that the first data includes all the target data; if the difference between the second value and 10M is greater than or equal to 1M, it is determined that the first data does not include all the target data.

[0035] Optionally, verifying whether the first data includes all the target data includes: reading a preset list of the first database, wherein the preset list is used to record the integrity of each category of data stored in the first database; and determining from the preset list whether the first data includes all the target data.

[0036] The above-mentioned preset list can be a list used to store the data storage status in the first database, such as the integrity of each category of data stored in the first database. Through the preset list, it can be clearly known whether each category of data in the first database is complete, so as to quickly determine whether the first data obtained from the first database may be missing.

[0037] As an optional implementation, determining whether the first data includes all of the target data from the preset list includes: obtaining the target type of the target data; searching the preset list for the integrity of the data of the target type to obtain a first result; if the first result is that the stored data is complete, determining that the first data includes all of the target data; otherwise, determining that the first data does not include all of the target data.

[0038] The above-mentioned target type may be the type of target data. For example, if the target data is the gross domestic product of each year, then the target type may be the gross domestic product. If the target data is the increase ratio of each year compared to the previous year, then the target type may be the increase ratio. The above-mentioned first result is used to indicate the integrity of the target type data stored in the first database. The system obtains the target type of the target data, checks the integrity of the stored target type data in a preset list, and obtains the first result. If the first result is that the complete target type data is stored, it is determined that all target data are included in the first data; otherwise, it is determined that all target data are not included in the first data.

[0039] For example, the first database stores data from the past ten years, and the target query instruction is to query the total value of each year in the past ten years. The data type of the total value of each year in the past ten years is determined to be the total value, and the storage of the total value of the records is checked in the preset list to see whether it is complete, and the first result is obtained. If the first result is displayed as complete, it is determined that the first data includes all the target data; if the first result is displayed as incomplete, it is determined that the first data does not include all the target data.

[0040] It should be noted that when acquiring target data, it is possible to directly determine through a preset list whether complete data of the target type is stored in the first database. When it is determined that the data of the target type stored in the first database is incomplete, the data can be directly acquired from the complete database without acquiring the first data from the first database, thereby reducing the data query time to a certain extent and improving the efficiency and accuracy of data acquisition.

[0041] Step S206, when it is determined that the first data only includes part of the target data, in response to the target query instruction, obtaining second data in a second database, wherein the second database is used to store all the data in the original database;

[0042] The above-mentioned target query instruction can be an instruction for querying target data in a database; the above-mentioned second database can be a database for storing historical data, and the database can be a data warehouse tool, such as a Hive database. Through the second database, storage and management of large-scale data sets can be realized, which is helpful for data analysis, data mining and other data processing tasks; the above-mentioned second data can be data obtained from the second database; the above-mentioned original database can be a database for initially collecting and integrating historical data, and the database can be a centralized database, such as an Oracle database; when the system determines that the first data only includes part of the target data, the system responds to the target query instruction and obtains the second data from the second database, wherein the second data can be all the target data or other data in the target data other than the first data.

[0043] Step S208, determining the target data based on the first data and the second data; the response speed of the first database to the data query instruction is higher than the response speed of the second database to the data query instruction, and the response speed of the second database to the data query instruction is higher than the response speed of the original database to the data query instruction.

[0044] Specifically, when all the target data are included in the first data, the first data is determined as the target data; when all the target data are not included in the first data, the second data is determined as the target data, wherein the second data includes the target data; or, when all the target data are not included in the first data, the first data and second data are determined as the target data, wherein the second data is data in the target data other than the first data.

[0045] Optionally, the executor of the above steps may be a background processor, or other devices with similar processing capabilities, or a machine that integrates at least an image acquisition device and a data processing device, wherein the image acquisition device may include a graphics acquisition module such as a camera, and the data processing device may include a computer, a mobile phone or other terminal, but is not limited thereto.

[0046] Through the above steps, since the response speed of the first database is higher than that of the second database, and the response speed of the second database is higher than that of the original database, the data in the original database is transferred to the first database and the second database, and when querying data, the data is first obtained from the first database, and when the obtained data is incomplete, the data is obtained from the second database, which effectively improves the query performance and response speed. The problem of low efficiency of historical data query in related technologies is solved, and the query efficiency of historical data is improved.

[0047] As an optional implementation, before obtaining the first data in the first database, the method also includes: obtaining the data in the original database at preset time intervals to obtain a data set; processing each data in the data set to obtain integrated data; and storing the integrated data in the first database.

[0048] For example, the original database includes two data tables A and B. When migrating the data in the original database to the first database, the two data tables A and B are processed and integrated into a data table C, and then the data table C is migrated to the first database.

[0049] As an optional implementation, before obtaining the second data in the second database, it also includes: obtaining the data in the original database at preset time intervals to obtain a data set; partitioning the data in the data set to obtain multiple data subsets; generating a data structure and a data file for each data subset based on each data subset, wherein the data file includes the values ​​of all the data in the data subset; and storing the data structure and the data file in the second database.

[0050] As an optional implementation, Figure 3 is a flow chart of data management according to an embodiment of the present invention, such as Figure 3 As shown, the specific process includes:

[0051] S1, data archiving;

[0052] Determine the list of historical data tables and data volume that need to be migrated in the original database; export the historical data in the original database to files, and use the SQLULDR tool to perform batch data extraction to generate files containing table structures and data values, as well as related metadata files (or header files); import the data files into the Hive database (i.e., the second database), and specifically use the Hadoop client to complete the data migration through the three-step method of data verification, data replication, and data loading. Among them, data verification ensures the integrity and consistency of data, data replication ensures the safe storage of data, and finally the data is loaded into the Hive table for subsequent processing and analysis.

[0053] S2, data migration;

[0054] Integrate historical data, establish a mapping relationship between the source table and the target table, synchronize the data in the original database to the first database, and use the data integration management mechanism to achieve real-time data synchronization.

[0055] S3, data query;

[0056] Data query can be realized by writing query statements, configuring query parameters and returning result parameters, etc. At the same time, based on Java application, operators can dynamically set query interface and report input and output through configuration page, complete report development without programming, and realize user-defined report query function.

[0057] Through the three steps of data archiving, data migration and report query, the challenges in historical data management and query are effectively solved, which not only improves data processing efficiency, but also ensures data compliance, security and availability, providing enterprises with a comprehensive data management solution.

[0058] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0059] In the present embodiment, a data query device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0060] Figure 4 is a structural block diagram of a data query device according to an embodiment of the present invention. Figure 4 As shown, the device includes: a first acquisition module 402, used to respond to a target query instruction of target data and acquire first data in a first database, wherein the first database is used to store part of the data in an original database; a verification module 404, used to verify whether the first data includes all of the target data; a second acquisition module 406, used to respond to the target query instruction and acquire second data in a second database when it is determined that the first data only includes part of the target data, wherein the second database is used to store all of the data in the original database; a determination module 408, used to determine the target data based on the first data and the second data; the response speed of the first database to the data query instruction is higher than the response speed of the second database to the data query instruction, and the response speed of the second database to the data query instruction is higher than the response speed of the original database to the data query instruction.

[0061] In an exemplary embodiment, the device is also used to obtain the size of the return value of a historical data query instruction to obtain a first numerical value, wherein the historical data query instruction is a query instruction whose similarity with the query instruction of the target data is greater than or equal to a preset threshold; estimate the size of the target data based on the first numerical value to obtain an estimated numerical value; and verify whether all the target data are included in the first data based on the estimated numerical value.

[0062] In an exemplary embodiment, the device is also used to obtain the size of the first data to obtain a second value; when the difference between the second value and the estimated value is less than a preset threshold, it is determined that the first data includes all of the target data; otherwise, it is determined that the first data does not include all of the target data.

[0063] In an exemplary embodiment, the device is also used to read a preset list of the first database, wherein the preset list is used to record the integrity of each category of data stored in the first database; and determine from the preset list whether the first data includes all of the target data.

[0064] In an exemplary embodiment, the device is also used to obtain the target type of the target data; search the preset list for the integrity of the data of the target type to obtain a first result; if the first result is that the stored data is complete, determine that the first data includes all of the target data; otherwise, determine that the first data does not include all of the target data.

[0065] In an exemplary embodiment, the device is also used to determine the first data as the target data when the first data includes all of the target data; determine the second data as the target data when the first data does not include all of the target data, wherein the second data includes the target data; or, determine the first data and second data as the target data when the first data does not include all of the target data, wherein the second data is data in the target data other than the first data.

[0066] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0067] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0068] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0069] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0070] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0071] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method described in each embodiment of the present application when executed by a processor.

[0072] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0073] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0074] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A data query method, characterized in that: include: In response to a target query instruction of target data, first data is acquired in a first database, wherein the first database is used to store part of the data in the original database; Verifying whether the first data includes all the target data; When it is determined that the first data only includes part of the target data, in response to the target query instruction, obtaining second data in a second database, wherein the second database is used to store all the data in the original database; determining the target data based on the first data and the second data; The response speed of the first database to the data query instruction is higher than the response speed of the second database to the data query instruction, and the response speed of the second database to the data query instruction is higher than the response speed of the original database to the data query instruction.

2. The method according to claim 1, characterized in that Verifying whether the first data includes all the target data includes: Obtaining the size of a return value of a historical data query instruction to obtain a first value, wherein the historical data query instruction is a query instruction having a similarity with a query instruction of the target data greater than or equal to a preset threshold; estimating the size of the target data according to the first value to obtain an estimated value; Whether the first data includes all the target data is verified according to the estimated value.

3. The method according to claim 2, characterized in that Verifying whether the first data includes all the target data according to the estimated value includes: Obtain the size of the first data to obtain a second value; When the difference between the second value and the estimated value is less than a preset threshold, determining that the first data includes all the target data; Otherwise, it is determined that the first data does not include all of the target data.

4. The method according to claim 1, characterized in that: Verifying whether the first data includes all the target data includes: Reading a preset list of the first database, wherein the preset list is used to record the integrity of each category of data stored in the first database; It is determined from the preset list whether the first data includes all the target data.

5. The method according to claim 4, characterized in that Determining from the preset list whether the first data includes all the target data comprises: Acquire the target type of the target data; Searching the preset list for the integrity of the data of the target type to obtain a first result; When the first result indicates that the stored data is complete, determining that the first data includes all of the target data; Otherwise, it is determined that the first data does not include all of the target data.

6. The method according to claim 1, characterized in that Determining the target data based on the first data and the second data includes: In a case where all of the target data are included in the first data, determining the first data as the target data; In a case where the first data does not include all of the target data, determining the second data as the target data, wherein the second data includes the target data; or In a case where the first data does not include all of the target data, the first data and second data are determined as the target data, wherein the second data is data in the target data other than the first data.

7. A data query device, characterized in that: include: A first acquisition module, configured to acquire first data in a first database in response to a target query instruction of target data, wherein the first database is used to store part of the data in the original database; A verification module, used for verifying whether the first data includes all the target data; A second acquisition module is used to acquire second data in a second database in response to the target query instruction when it is determined that the first data only includes part of the target data, wherein the second database is used to store all the data in the original database; A determination module, configured to determine the target data based on the first data and the second data; The response speed of the first database to the data query instruction is higher than the response speed of the second database to the data query instruction, and the response speed of the second database to the data query instruction is higher than the response speed of the original database to the data query instruction.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 6 when executed by a processor.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.