Data query method and device, equipment and medium

By synchronizing the data of the target service in the system database to the backup database and synchronizing only the required query data, the problem of low data query efficiency under large data volume is solved, and the effect of improving query efficiency and reducing system load is achieved.

CN119719154APending Publication Date: 2025-03-28CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411784645.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When the amount of data stored in the database is large, the efficiency of obtaining historical data from the database through query is low, resulting in an increase in the operating load of the business system.

Method used

By obtaining the data synchronization request for the target service, the data of the target service in the system database is synchronized to the backup database, and the data table and data query conditions are determined based on the corresponding relationship between the preset service and the query scenario, and only the query data required by the target service is synchronized to the backup database.

Benefits of technology

It improves the efficiency of data query, reduces the load on the system database, and improves the operation efficiency of the business system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719154A_ABST
    Figure CN119719154A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of databases, in particular to a data query method and device, equipment and a medium, and is used for solving the problem of relatively low data query efficiency. The method comprises the following steps: a first device obtains a data synchronization request of a target service; wherein the data synchronization request is used for requesting to synchronize data of the target service in a system database to a backup database. And the first device determines a query scene corresponding to the target service according to a preset corresponding relationship between the service and the query scene. And the first device determines a plurality of data tables and data query conditions corresponding to the target service according to the query scene. And the first device queries the plurality of data tables according to the data query condition to obtain a data file corresponding to the target service. And the first equipment processes the table structures of the plurality of data tables based on the data query condition to obtain a target table structure. And the first device synchronizes the data file to the backup database based on the target table structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and in particular to a data query method, device, equipment and medium. Background Art

[0002] As the business system runs longer, the business data of the business system increases, and the amount of data in the database increases. In order to reduce the operating load of the business system, improve the operating efficiency of the business system, and ensure the business system's query function for historical data, a relational database is usually used for data backup. In other words, the data update in the master database is synchronized to the slave database through the master-slave replication mechanism, and the corresponding historical data is obtained by querying the slave database.

[0003] However, when the amount of data stored in the database is relatively large, even if the corresponding historical data is obtained from the database through query, a large amount of data needs to be polled, resulting in low efficiency of querying data. Summary of the invention

[0004] Embodiments of the present application provide a data query method, apparatus, device and medium for synchronizing required query data to a backup database, thereby improving the efficiency of querying data.

[0005] In a first aspect, the present application provides a data query method, the method comprising: a first device obtains a data synchronization request for a target business. The data synchronization request is used to request that the data of the target business in the system database be synchronized to a backup database. The first device determines a query scenario corresponding to the target business based on a preset correspondence between the business and the query scenario. The first device determines a plurality of data tables and data query conditions corresponding to the target business based on the query scenario. The first device queries the plurality of data tables based on the data query conditions to obtain a data file corresponding to the target business. The first device processes the table structure of the plurality of data tables based on the data query conditions to obtain a target table structure. The first device synchronizes the data file to the backup database based on the target table structure. The backup database is used to perform data query operations for the target business.

[0006] By adopting this method, the first device can determine the corresponding data table and data query conditions according to the query scenario corresponding to the target business, and filter the data in the data table according to the data query conditions, and synchronize the filtered data to the backup database. In other words, only the query data required by the target business is synchronized to the backup database, and the data query operation of the target business is performed by querying the backup database, thereby improving the efficiency of querying data. At the same time, the system database does not need to perform data query operations, which reduces the load on the system database and improves the operating efficiency of the business system.

[0007] In a possible embodiment, multiple data tables are queried according to data query conditions to obtain data files corresponding to the target business, including: determining the value range of a specific field in the data query conditions; and querying multiple data tables according to the data query conditions and the value range of the specific field to obtain the data file.

[0008] In a possible embodiment, the specific field includes at least one of an operation start date, an operation end date, a business processing personnel identifier, a data table name, a keyword, and an operation date.

[0009] In a possible embodiment, the table structures of multiple data tables are processed based on data query conditions to obtain a target table structure, including: determining multiple fields corresponding to the target business in the table structures of the multiple data tables and the association relationship between the fields based on the data query conditions; determining the target table structure based on the multiple fields and the association relationship between the fields.

[0010] In a possible embodiment, a unique service attribute of the target service is determined; and the unique service attribute is used as an index of the target table structure.

[0011] In a possible embodiment, synchronizing a data file to a backup database based on a target table structure includes: processing data in the data file according to the target table structure to obtain processed data, the processed data satisfying the target table structure; and storing the processed data in the backup database.

[0012] In a second aspect, the present application provides a data query device, which includes: a communication module, which is used to obtain a data synchronization request for a target business, and the data synchronization request is used to request that the data of the target business in the system database be synchronized to a backup database; a processing module, which is used to determine the query scenario corresponding to the target business according to the correspondence between the preset business type and the query scenario; the processing module is also used to determine multiple data tables and data query conditions corresponding to the target business according to the query scenario; the processing module is also used to query multiple data tables according to the data query conditions to obtain data files corresponding to the target business; and the processing module is also used to process the table structures of multiple data tables based on the data query conditions to obtain the target table structure; the processing module is also used to synchronize the data files to the backup database based on the target table structure, and the backup database is used to execute data query operations for the target business.

[0013] In a possible embodiment, multiple data tables are queried according to data query conditions to obtain data files corresponding to the target business, and the processing module is specifically used to: determine the value range of a specific field in the data query conditions; query multiple data tables according to the data query conditions and the value range of the specific field to obtain data files.

[0014] In a possible embodiment, the specific field includes at least one of an operation start date, an operation end date, a business processing personnel identifier, a data table name, a keyword, and an operation date.

[0015] In a possible embodiment, the table structures of multiple data tables are processed based on data query conditions to obtain a target table structure, and the processing module is specifically used to: determine multiple fields corresponding to the target business in the table structures of multiple data tables and the association relationship between the fields based on the data query conditions; determine the target table structure based on the multiple fields and the association relationship between the fields.

[0016] In a possible embodiment, the processing module is further used to: determine a unique service attribute of the target service; and use the unique service attribute as an index of the target table structure.

[0017] In a possible embodiment, the data file is synchronized to the backup database based on the target table structure, and the processing module is specifically used to: process the data in the data file according to the target table structure to obtain processed data, and the processed data satisfies the target table structure; and store the processed data in the backup database.

[0018] In a third aspect, the present application provides an electronic device, including:

[0019] A memory for storing program instructions;

[0020] The processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods in the first aspect according to the obtained program instructions.

[0021] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the methods described in the first aspect.

[0022] In a fifth aspect, the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect.

[0023] The technical effects brought about by the second to fifth aspects and any one of their designs can refer to the technical effects brought about by the corresponding designs in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A schematic diagram of a data query system structure in the prior art;

[0025] Figure 2A flowchart of a data query method provided in an embodiment of the present application;

[0026] Figure 3 A schematic diagram of the structure of a data query device provided in an embodiment of the present application;

[0027] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0029] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0030] In the technical solution of this application, the collection, dissemination, and use of data are in compliance with the requirements of relevant national laws and regulations.

[0031] Before introducing the data query method provided in the embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced in detail below.

[0032] In order to reduce the load on the business system, improve the operating efficiency of the business system and ensure the business system's query function for historical data, the existing technology usually synchronizes the historical data in the master database to the slave database, and implements the business system's query function for historical data by querying the slave database.

[0033] At present, data synchronization of relational databases is usually based on the master-slave replication mechanism to synchronize data in the master database to the slave database. The master-slave replication mechanism is to synchronize data updates of the master database server to other database servers by configuring the master-slave relationship of multiple databases. The master database is used to perform write operations, and the slave database is used to perform read operations, thereby reducing the load of the business system and improving the operating efficiency of the business system.

[0034] However, when the amount of data stored in the database is relatively large, even if the corresponding historical data is obtained from the database through query, a large amount of data needs to be polled, resulting in low efficiency in querying data. In order to solve the above defects, the embodiments of the present application provide a data query method, device, equipment and medium for synchronizing the required query data to a backup database, thereby improving the efficiency of querying data.

[0035] Figure 1 This is a schematic diagram of the structure of a data query system provided in an embodiment of the present application. Figure 1 As shown in the figure, the data in the system database can be stored in the Hive library through data archiving. For example, you can use database tools (such as sqluldr) to export historical data in the system database (such as Oracle database), generate the corresponding table structure and data files, and import the data files into the Hive library according to the table structure files. In addition, since business data is generated every day, the new data in the system database can be imported into Hive at a fixed time every day.

[0036] Based on the unloading script, the data in the Hive library is filtered to determine the corresponding data file. Among them, the unloading script can be a script generated according to the data query conditions and data tables corresponding to the target business. The data file is stored in the CTbase library using the loading script. Among them, the loading script can be a script generated according to the target table structure corresponding to the target business. The CTbase library can be used to query historical data with a business completion time of 10 years ago, and the system database can be used to query historical data with a business completion time within 10 years.

[0037] Among them, Hive is a data warehouse tool based on Hadoop, which can map structured data files into a database table and provide SQL query functions for creating orders.

[0038] CTBase is an application built on HBase. By repackaging the native API of HBase, it implements a cluster table / cluster index framework based on HBase.

[0039] In the present application, the method adopted includes: the first device obtains a data synchronization request for the target business. The data synchronization request is used to request that the data of the target business in the system database be synchronized to the backup database. The first device determines the query scenario corresponding to the target business according to the correspondence between the preset business and the query scenario. The first device determines multiple data tables and data query conditions corresponding to the target business according to the query scenario. The first device queries the multiple data tables according to the data query conditions to obtain the data files corresponding to the target business. The first device processes the table structures of the multiple data tables based on the data query conditions to obtain the target table structure. The first device synchronizes the data file to the backup database based on the target table structure. The backup database is used to perform data query operations for the target business.

[0040] By adopting this method, the first device can determine the corresponding data table and data query conditions according to the query scenario corresponding to the target business, and filter the data in the data table according to the data query conditions, and synchronize the filtered data to the backup database. In other words, only the query data required by the target business is synchronized to the backup database, and the data query operation of the target business is performed by querying the backup database, thereby improving the efficiency of querying data. At the same time, the system database does not need to perform data query operations, which reduces the load on the system database and improves the operating efficiency of the business system.

[0041] In addition, the first device may be a processing device for executing the method described in the present application, or may be a processing device in a computer system for executing the method described in the present application, such as a processor or a processing module, etc., which is not specifically limited in the present application.

[0042] Figure 2 A flow chart of a data query method provided by an embodiment of the present invention. Taking the first device as the execution subject as an example, the flow may include the following steps:

[0043] S201, a first device obtains a data synchronization request for a target service, wherein the data synchronization request is used to request synchronization of data of the target service in a system database to a backup database.

[0044] In one or more embodiments, the data synchronization request of the target business may be triggered by the user according to the business requirements. For example, the user may trigger the corresponding business processing option on the front page of the system through the input device of the terminal device (such as a mouse, keyboard, or touch screen), or trigger the business processing option in the application, and when the operation of triggering the business processing option is detected, the corresponding data synchronization request of the target business may be generated.

[0045] In one or more embodiments, the present application may include a management device, which may be used to manage data of each service. The data synchronization request of the target service may be generated by the management device according to the target service and sent to the first device. For example, in the process of synchronizing data, the management device may generate data synchronization requests for multiple services in sequence.

[0046] Optionally, the management device may generate a data synchronization request for the target service at a fixed time. For example, the management device may generate a data synchronization request for the target service during a time period when fewer services are processed each day, thereby synchronizing the data of the service to the backup database.

[0047] In addition, the first device may also obtain the data synchronization request of the target service through other methods, which are not specifically limited in this application.

[0048] S202: The first device determines a query scenario corresponding to the target service according to a preset correspondence between the service type and the query scenario.

[0049] In one or more embodiments, the data synchronization request may carry an identifier of the service type. For example, the first two bytes of the data synchronization request message are used to indicate the identifier of the service type. The first device may determine the corresponding service type from the correspondence information between the pre-stored service type and the identifier of the service type according to the identifier of the service type carried in the data synchronization request.

[0050] For example, Table 1 is a correspondence table between a service type and a service type identifier provided in an embodiment of the present application. As shown in Table 1, different service type identifiers correspond to different service types. The first device can determine the corresponding service type according to the service type identifier by looking up the table.

[0051]

[0052]

[0053] Table 1

[0054] In one or more embodiments, after determining the service type of the target service, the first device may determine the query scenario corresponding to the target service from the correspondence between the service type and the query scenario stored in the first device.

[0055] Exemplarily, the first device may determine the query scenario corresponding to the service type by looking up a table. Table 2 is a correspondence table between a service type and a query scenario provided in an embodiment of the present application.

[0056] Business Type Query scenario Business 1 Query scenario 1 Business 2 Query scenario 2 Business 3 Query scenario 3 Business 4 Query scenario 4 Business 5 Query scenario 5

[0057] Table 2

[0058] In addition, the first device may also obtain the query scenario corresponding to the business type according to the business type in other ways, which is not specifically limited in this application.

[0059] S203: The first device determines multiple data tables and data query conditions corresponding to the target business according to the query scenario.

[0060] In one or more embodiments, the first device may determine the multiple data tables and data query conditions corresponding to the query scenario of the target business based on the correspondence between the pre-stored query scenario and the multiple data tables and data query conditions. The multiple data tables and data query conditions corresponding to the pre-stored query scenario may be determined based on the historical query data of the business corresponding to the query scenario.

[0061] Alternatively, the multiple data tables and data query conditions corresponding to the query scenario may be set by the user according to the business content.

[0062] In this application, different query scenarios may correspond to different data tables and data query conditions. Alternatively, different query scenarios may correspond to the same data tables and data query conditions.

[0063] S204: The first device queries multiple data tables according to the data query condition to obtain a data file corresponding to the target business.

[0064] In one or more embodiments, the first device may obtain the data file corresponding to the target service in the following manner:

[0065] The first device may determine the value range of the specific field in the data query condition according to the backup requirement. Optionally, the specific field may include at least one of the operation start date, operation end date, business processing personnel identification, data table name, keyword, and operation date.

[0066] The first device may query multiple data tables according to the data query condition and the value range of the specific field to obtain the data file corresponding to the target business.

[0067] For example, the specific field may be the operation date, and the value range of the operation date may be 10 years earlier than the current date. In other words, 120 months earlier than the current time. For example, if the current date is January 1, 2024, the value range of the operation date may be less than January 1, 2014.

[0068] The first device may filter out data from multiple data tables that are 10 years earlier than the current date according to the data query condition, and organize the filtered data to obtain corresponding data files.

[0069] In addition, in order to realize the automatic operation of the program, the first device can encapsulate the query conditions of the data to generate corresponding automatic execution statements. Figure 1 As shown, the first device can encapsulate the query conditions of the data to generate a corresponding unloading script. The first device can execute the unloading script on the system database or Hive library to filter the data in the data table to obtain the corresponding data file.

[0070] S205: The first device processes the table structures of multiple data tables based on the data query condition to obtain a target table structure.

[0071] In one or more embodiments, the first device may determine, based on the data query condition, multiple fields corresponding to the target business in the table structure of multiple data tables and the association relationship between the fields.

[0072] It is understandable that the data query condition includes the data table where the required query data is located and the field corresponding to the required query data, and the data query condition usually includes multiple data tables and multiple fields, and there is an association relationship between different fields. Therefore, the first device can determine the multiple fields corresponding to the target business in the table structure of multiple data tables and the association relationship between the fields based on the data query condition.

[0073] Furthermore, the first device may determine the corresponding target table structure based on the association relationship between the multiple fields. In other words, the first device may construct a new table structure based on the association relationship between the multiple fields.

[0074] For example, the data query condition involves data table A and data table B, and it is necessary to obtain the data of field a1 and field a2 of data table A, and the data of field b1, field b2, and field b3 of data table B. Among them, data table A and data table B are associated through field a1 and field b1.

[0075] The first device may integrate data table A and data table B into data table C based on field a1, field a2, field b1, field b2, and field b3, and the association relationship between field a1 and field b1. The table structure of data table C includes field A.a1, field A.a2, field B.b2, and field B.b3.

[0076] In one or more embodiments, the first device may determine a unique service attribute of the target service. The first device may use the unique service attribute as an index of the target table structure.

[0077] Still taking the above example, the unique business attribute of the target business can be represented by some or all fields corresponding to the business. For example, a1, field a2, field b1, field b2 and field b3 can be used as the unique business attribute of the business. That is, the index of the target table structure corresponding to the target business can be a1a2b1b2b3.

[0078] Alternatively, the field in the business correspondence table structure may be used as the unique attribute of the business. For example, field A.a1 of data table C may be used as the unique attribute of the business. That is, the index of the target table structure corresponding to the target business may be A.a1.

[0079] In one or more embodiments, after the first device determines the target table structure, the target table structure may be constructed in the backup database to store the target business data based on the table structure.

[0080] It is understandable that the execution order of determining the data file corresponding to the target business and determining the target table structure is not limited in this application. That is, the order of executing step S204 and step S205 is not limited. Step S204 can be executed first, and then step S205. Alternatively, step S205 can be executed first, and then step S204. Alternatively, step S204 and step S205 can be executed at the same time.

[0081] S206: The first device synchronizes the data file to the backup database based on the target table structure, wherein the backup database can be used to perform a data query operation of the target business.

[0082] In one or more embodiments, different business types in the present application may correspond to different backup databases. For example, data of different business types may be backed up in different backup databases, thereby reducing the amount of data in the database and improving data query efficiency.

[0083] Alternatively, different business types may correspond to the same backup database. For example, the backup databases corresponding to all business types are the same database, thereby reducing the cost of data backup.

[0084] Alternatively, some business types correspond to the same backup database. For example, business types of the same business system can be backed up to the same backup database, thereby improving data query efficiency while ensuring the cost of data backup.

[0085] Alternatively, the first device may store data of different numerical values ​​of the specific field in different backup databases based on the value range of the specific field.

[0086] In one or more embodiments, the first device may process the data in the data file according to the target table structure to obtain processed data, wherein the processed data satisfies the target table structure.

[0087] It is understandable that the data obtained by the first device from multiple data tables based on the data query condition may not satisfy the target table structure, so the first device can process the data in the data file based on the target table structure. For example, if the data in the data file includes data of redundant fields, the first device can delete the data of the redundant fields in the data file based on the target table structure.

[0088] The first device may store the processed data in a backup database. After obtaining the processed data, the first device may immediately store the data in the backup database, thereby updating the data in the backup database in real time. Alternatively, the first device may periodically store the data in the backup database, thereby reducing the amount of communication with the backup database and reducing costs.

[0089] In one or more embodiments, the first device may back up all data of the target business in the system database to the backup database. Alternatively, the first device may back up part of the data of the target business in the system database to the backup database. For example, the data of the target business in the system database 10 years ago may be backed up to the backup database.

[0090] In addition, after backing up the required data to the backup database, the present application can delete the corresponding data in the system database, thereby reducing the load on the system database and improving the operating efficiency of the business system.

[0091] In this application, the business system can call the backup database to perform the corresponding data query operation. That is, the backup database can be used to perform the data query operation, and the system database may not perform the data query operation, thereby reducing the system data load.

[0092] Alternatively, the business system can call the backup database and the system database at the same time to perform the corresponding data query operation. That is, both the backup database and the system database can be used to perform the data query operation. Exemplarily, different data query conditions can be queried using different databases. For example, Figure 1 As shown, historical data from 10 years ago can be queried through the backup database (CTbase), while historical data within 10 years can be queried through the system database.

[0093] Based on the same inventive concept, an embodiment of the present application provides a data query device. Figure 3 FIG. 1 shows a schematic diagram of the structure of a data query device provided in an embodiment of the present application. Figure 3As shown, the device includes a communication module 301 and a processing module 302 .

[0094] The communication module 301 is used to obtain the data synchronization request of the target business, and the data synchronization request is used to request to synchronize the data of the target business in the system database to the backup database. The processing module 302 is used to determine the query scenario corresponding to the target business according to the correspondence between the preset business type and the query scenario; the processing module 302 is also used to determine the multiple data tables and data query conditions corresponding to the target business according to the query scenario; the processing module 302 is also used to query the multiple data tables according to the data query conditions to obtain the data files corresponding to the target business; and the processing module 302 is also used to process the table structures of the multiple data tables based on the data query conditions to obtain the target table structure; the processing module 302 is also used to synchronize the data files to the backup database based on the target table structure, and the backup database is used to perform the data query operation of the target business.

[0095] In a possible embodiment, multiple data tables are queried according to data query conditions to obtain data files corresponding to the target business, and the processing module 302 is specifically used to: determine the value range of a specific field in the data query conditions; query multiple data tables according to the data query conditions and the value range of the specific field to obtain data files.

[0096] In a possible embodiment, the specific field includes at least one of an operation start date, an operation end date, a business processing personnel identifier, a data table name, a keyword, and an operation date.

[0097] In a possible embodiment, the table structures of multiple data tables are processed based on data query conditions to obtain a target table structure, and the processing module 302 is specifically used to: determine multiple fields corresponding to the target business in the table structures of multiple data tables and the association relationship between the fields based on the data query conditions; determine the target table structure based on the association relationship between the multiple fields and the fields.

[0098] In a possible embodiment, the processing module 302 is further used to: determine a unique service attribute of the target service; and use the unique service attribute as an index of the target table structure.

[0099] In a possible embodiment, the data file is synchronized to the backup database based on the target table structure, and the processing module 302 is specifically used to: process the data in the data file according to the target table structure to obtain processed data, and the processed data satisfies the target table structure; and store the processed data in the backup database.

[0100] Based on the same inventive concept, an embodiment of the present application provides an electronic device, which can implement the functions of the data query device discussed above. Figure 4A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown.

[0101] The electronic device in the embodiment of the present application may include a processor 401. The processor 401 is the control center of the device, and various interfaces and lines can be used to connect various parts of the device, by running or executing instructions stored in the memory 403 and calling data stored in the memory 403. Optionally, the processor 401 may include one or more processing units, and the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401. In some embodiments, the processor 401 and the memory 403 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.

[0102] Processor 401 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The method steps disclosed in the embodiments of the present application can be directly executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.

[0103] In the embodiment of the present application, the memory 403 stores instructions that can be executed by at least one processor 401. The at least one processor 401 can be used to execute the method steps disclosed in the embodiment of the present application by executing the instructions stored in the memory 403.

[0104] Memory 403, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Memory 403 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic memory, disk, optical disk, etc. Memory 403 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 403 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0105] In the embodiment of the present application, the device may further include a communication interface 402 , through which the electronic device may transmit data.

[0106] Optional, can be Figure 4 The processor 401 (or the processor 401 and the communication interface 402) implements Figure 3 The processing module 302 and / or the communication module 301 shown, that is, the actions of the processing module 302 and / or the communication module 301 can be executed by the processor 401 (or the processor 401 and the communication interface 402).

[0107] Based on the same inventive concept, the embodiment of the present application also provides a computer-readable storage medium, which may store instructions. When the instructions are executed on a computer, the computer executes the operation steps provided in the above method embodiment. The computer-readable storage medium may be Figure 4 The memory 403 is shown.

[0108] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0109] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0110] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0112] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data query method, characterized in that: The method comprises: Obtaining a data synchronization request for a target business, wherein the data synchronization request is used to request synchronization of data of the target business in a system database to a backup database; Determining the query scenario corresponding to the target business according to the preset correspondence between the business type and the query scenario; Determine multiple data tables and data query conditions corresponding to the target business according to the query scenario; Query the multiple data tables according to the data query condition to obtain the data file corresponding to the target business; and Processing the table structures of the multiple data tables based on the data query condition to obtain a target table structure; The data file is synchronized to the backup database based on the target table structure, and the backup database is used to execute the data query operation of the target business.

2. The method according to claim 1, characterized in that The querying the multiple data tables according to the data query condition to obtain the data file corresponding to the target business includes: Determine the value range of a specific field in the data query condition; The data file is obtained by querying the multiple data tables according to the data query condition and the value range of the specific field.

3. The method according to claim 2, characterized in that The specific field includes at least one of an operation start date, an operation end date, a business processing personnel identifier, a data table name, a keyword, and an operation date.

4. The method according to claim 1, characterized in that The step of processing the table structures of the plurality of data tables based on the data query condition to obtain a target table structure includes: Determine, based on the data query condition, a plurality of fields corresponding to the target business in the table structure of the plurality of data tables and association relationships between the fields; The target table structure is determined based on the multiple fields and the association relationships between the fields.

5. The method according to claim 1 or 4, characterized in that The method further comprises: Determine a unique business attribute of the target business; The unique business attribute is used as an index of the target table structure.

6. The method according to claim 1, characterized in that The step of synchronizing the data file to the backup database based on the target table structure includes: Processing the data in the data file according to the target table structure to obtain processed data, wherein the processed data satisfies the target table structure; The processed data is stored in the backup database.

7. A data query device, characterized in that: The device comprises: A communication module, used for obtaining a data synchronization request of a target service, wherein the data synchronization request is used for requesting synchronization of the data of the target service in the system database to the backup database; A processing module, used to determine the query scenario corresponding to the target business according to the correspondence between the preset business type and the query scenario; The processing module is further used to determine multiple data tables and data query conditions corresponding to the target business according to the query scenario; The processing module is further used to query the multiple data tables according to the data query condition to obtain the data file corresponding to the target business; and The processing module is further used to process the table structures of the multiple data tables based on the data query condition to obtain a target table structure; The processing module is further used to synchronize the data file to the backup database based on the target table structure, and the backup database is used to execute the data query operation of the target business.

8. The device according to claim 7, characterized in that The multiple data tables are queried according to the data query condition to obtain the data file corresponding to the target business, and the processing module is specifically used for: Determine the value range of a specific field in the data query condition; The data file is obtained by querying the multiple data tables according to the data query condition and the value range of the specific field.

9. The device according to claim 8, characterized in that The specific field includes at least one of an operation start date, an operation end date, a business processing personnel identifier, a data table name, a keyword, and an operation date.

10. The device according to claim 7, characterized in that The table structures of the multiple data tables are processed based on the data query condition to obtain a target table structure, and the processing module is specifically used for: Determine, based on the data query condition, a plurality of fields corresponding to the target business in the table structure of the plurality of data tables and association relationships between the fields; The target table structure is determined based on the multiple fields and the association relationships between the fields.

11. The device according to claim 7 or 10, characterized in that The processing module is further used for: Determine a unique business attribute of the target business; The unique business attribute is used as an index of the target table structure.

12. The device according to claim 7, characterized in that The data file is synchronized to the backup database based on the target table structure, and the processing module is specifically used for: Processing the data in the data file according to the target table structure to obtain processed data, wherein the processed data satisfies the target table structure; The processed data is stored in the backup database.

13. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1-6 according to the obtained program instructions.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 6.

15. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.