Query database generation method and device and computer equipment

By automatically generating and optimizing the configuration files and query strategies for cross-base query databases, the problems of high technical requirements and low efficiency in traditional technologies are solved, and an efficient, secure and easy-to-use solution for cross-base data query is achieved.

CN119166691APending Publication Date: 2024-12-20BEIJING PACTERA JINXIN TECH LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411273476.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

Traditional cross-library business query technology requires Java and Sql technology capabilities, and manual writing of Sql statements and configuration files leads to high technical requirements and low efficiency, limited application population, and difficult to adapt to different system environments.

Method used

By obtaining the connector configuration information of multiple databases, generating connector configuration files, identifying data fields and visual data tables based on metadata information, generating query policies, automatically retrieving data content, storing it in the target query database, optimizing Presto function, and realizing Automatic configuration and dynamic loading to reduce user manual operations.

Benefits of technology

It improves the efficiency and applicable population of cross-border data query, reduces technical requirements, ensures data security and permission control, avoids manual inefficiency, and improves user experience and query efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166691A_ABST
    Figure CN119166691A_ABST
Patent Text Reader

Abstract

The invention relates to a query database generation method and device and computer equipment. The method comprises the following steps: acquiring connector configuration information of multiple databases and a cross-database query program directory, and generating a connector configuration file corresponding to each database, so as to configure and obtain a target cross-database query program; based on the metadata information, identifying each data field and a visual data table which need to be queried, and based on each data field, respectively calling data content corresponding to each data field through the target cross-database query program to obtain a to-be-queried database; identifying a query permission of each data content, and generating a query strategy of each data content based on the query permission of each data content and the visual data table; and storing query strategies of all the data contents and the visual data table in the to-be-queried database to obtain a target query database. By adopting the method, the cross-library data query efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of cross-database data query, and in particular to a query database generation method, device and computer equipment. Background Art

[0002] At present, companies have built many business systems, and related business data is stored in different types of databases, including MySQL, Oracle, Hive and other databases. In order to improve the efficiency of collaborative retrieval of multiple business data, cross-database business data query is often required. Therefore, how to improve the efficiency of cross-database business query is the main technical research issue at present.

[0003] Traditional cross-database business query technology is often through the Presto cross-database business data query program. However, when applying this query program, the query personnel are often required to have Java and Sql technical capabilities and manually write Sql statements for data query. When encountering a new database adaptation scenario, it is necessary to manually write the database connector configuration file according to the Presto specification, put the file into the directory specified by Presto, and restart Presto to dynamically load the database connector information, so that the new database can be used. However, this method has high technical requirements for personnel, and it is difficult to execute the above query method in different system environments, which leads to low efficiency of cross-database data query. Summary of the invention

[0004] Based on this, it is necessary to provide a query database generation method, device, computer equipment, computer readable storage medium and computer program product to address the above technical problems.

[0005] In a first aspect, the present application provides a method for generating a query database. The method comprises:

[0006] Obtain connector configuration information of multiple databases and a cross-database query program directory, and generate a connector configuration file corresponding to each database based on each of the connector configuration information;

[0007] Configuring each of the configuration files in the cross-database query program directory, obtaining a target cross-database query program, and collecting metadata information;

[0008] Based on the metadata information, the data fields to be queried and the visual data tables corresponding to all the data fields are identified, and based on the data fields, the data content corresponding to each data field is retrieved in each database through the target cross-database query program to obtain the database to be queried;

[0009] Identify the query authority of each data content, and generate a query strategy for each data content based on the query authority of each data content and the visualized data table;

[0010] The query strategies for all data contents and the visual data table are stored in the database to be queried to obtain a target query database.

[0011] Optionally, generating a connector configuration file corresponding to each database based on each connector configuration information includes:

[0012] For each connector configuration information, identify each configuration content of the connector configuration information and the configuration type of each configuration content, and identify the format requirement information of the cross-library query program;

[0013] Convert the configuration format of the configuration content of each configuration type into a target format corresponding to the format requirement information to obtain the target configuration content of each configuration type;

[0014] The target configuration contents of all configuration types are used as configuration files of the database to which the connector configuration information belongs.

[0015] Optionally, configuring each of the configuration files in the cross-database query program directory to obtain a target cross-database query program includes:

[0016] For each configuration file, storing the configuration file in the cross-database query program directory of the cross-database query program;

[0017] After all configuration files have completed the storage operation, the file loading mode of the cross-database query program is adjusted to a mode of periodically loading configuration files to obtain a target cross-database query program.

[0018] Optionally, the identifying, based on the metadata information, each data field to be queried and a visual data table corresponding to all the data fields includes:

[0019] In the metadata information, data information including data field identification information is screened, and each piece of data information including data field identification information is used as each data field;

[0020] In the set of historical visualization data tables, identifying the number of the data fields contained in each historical visualization data table, and taking the historical visualization data table corresponding to the largest number as a candidate visualization data table;

[0021] In each of the data fields, target data fields not included in the candidate visualization data table are screened, and based on each of the target data fields, the candidate visualization data table is updated to obtain visualization data tables corresponding to all data fields.

[0022] Optionally, the identifying query authority for each data content includes:

[0023] For each data content, identify the data source corresponding to the data content, and query the query authority scope corresponding to the data source;

[0024] Based on the data field corresponding to the data content, within the query permission range, query permission corresponding to the data content is queried.

[0025] Optionally, the query strategy for each data content is generated based on the query permission for each data content and the visualized data table, including:

[0026] For each data content, identifying the location information of the data field corresponding to the data content in the visual data table, and generating a retrieval strategy for the data content based on the data field corresponding to the data content and the location information of the data field;

[0027] Based on the query authority of the data content, the access authority restriction information of the data content is generated, and the access strategy of the data content and the access authority restriction information of the data content are used as the query strategy of the data content.

[0028] In a second aspect, the present application also provides a query database generation device. The device comprises:

[0029] An acquisition module, used to acquire connector configuration information of multiple databases and a cross-database query program directory, and generate a connector configuration file corresponding to each database based on each of the connector configuration information;

[0030] A configuration module, used to configure each of the configuration files in the cross-database query program directory, obtain a target cross-database query program, and collect metadata information;

[0031] An identification module, for identifying each data field to be queried and a visual data table corresponding to all data fields based on the metadata information, and based on each data field, through the target cross-database query program, respectively retrieves the data content corresponding to each data field in each database to obtain a database to be queried;

[0032] A generation module, used to identify the query authority of each data content, and generate a query strategy for each data content based on the query authority of each data content and the visualized data table;

[0033] The determination module is used to store the query strategies of all data contents and the visual data table in the database to be queried to obtain a target query database.

[0034] Optionally, the acquisition module is specifically used to:

[0035] For each connector configuration information, identify each configuration content of the connector configuration information and the configuration type of each configuration content, and identify the format requirement information of the cross-library query program;

[0036] Convert the configuration format of the configuration content of each configuration type into a target format corresponding to the format requirement information to obtain the target configuration content of each configuration type;

[0037] The target configuration contents of all configuration types are used as configuration files of the database to which the connector configuration information belongs.

[0038] Optionally, the configuration module is specifically used to:

[0039] For each configuration file, storing the configuration file in the cross-database query program directory of the cross-database query program;

[0040] After all configuration files have completed the storage operation, the file loading mode of the cross-database query program is adjusted to a mode of periodically loading configuration files to obtain a target cross-database query program.

[0041] Optionally, the identification module is specifically used to:

[0042] In the metadata information, data information including data field identification information is screened, and each piece of data information including data field identification information is used as each data field;

[0043] In the set of historical visualization data tables, identifying the number of the data fields contained in each historical visualization data table, and taking the historical visualization data table corresponding to the largest number as a candidate visualization data table;

[0044] In each of the data fields, target data fields not included in the candidate visualization data table are screened, and based on each of the target data fields, the candidate visualization data table is updated to obtain visualization data tables corresponding to all data fields.

[0045] Optionally, the generating module is specifically used for:

[0046] For each data content, identify the data source corresponding to the data content, and query the query authority scope corresponding to the data source;

[0047] Based on the data field corresponding to the data content, within the query permission range, query permission corresponding to the data content is queried.

[0048] Optionally, the generating module is specifically used for:

[0049] For each data content, identifying the location information of the data field corresponding to the data content in the visual data table, and generating a retrieval strategy for the data content based on the data field corresponding to the data content and the location information of the data field;

[0050] Based on the query authority of the data content, the access authority restriction information of the data content is generated, and the access strategy of the data content and the access authority restriction information of the data content are used as the query strategy of the data content.

[0051] In a third aspect, the present application provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the methods in the first aspect are implemented.

[0052] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of any one of the methods in the first aspect are implemented.

[0053] In a fifth aspect, the present application provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of any one of the methods in the first aspect are implemented.

[0054] The above-mentioned query database generation method, device and computer equipment obtain connector configuration information of multiple databases and a cross-database query program directory, and generate a connector configuration file corresponding to each database based on each of the connector configuration information; configure each of the configuration files in the cross-database query program directory to obtain a target cross-database query program, and collect metadata information; based on the metadata information, identify each data field to be queried and a visual data table corresponding to all data fields, and based on each of the data fields, through the target cross-database query program, retrieve the data content corresponding to each data field in each of the databases to obtain a database to be queried; identify the query permission of each data content, and generate a query strategy for each data content based on the query permission of each data content and the visual data table; store the query strategy of all data contents and the visual data table in the database to be queried to obtain a target query database. This solution optimizes this function of Presto. After generating the configuration files of each database, this solution automatically FTPs each configuration file to the directory of Presto, ensuring that the directory is automatically scanned in a loop to dynamically load files, avoiding the inefficiency of users manually storing configuration files. Moreover, this solution applies a visual data table for each data content, so that the staff can directly obtain the data content to be queried by clicking on the query field, without requiring the technical ability of the staff, thereby increasing the applicable population of cross-database data query and improving the user experience. Then, this solution ensures the security of data content retrieval by limiting the query permissions of different data contents, improves the control effect of the retrieval permissions of each data content, and thus improves the security protection effect of each data content. Finally, this solution obtains metadata information in advance and then builds the target query database, avoiding the timeliness problem in actual cross-database business queries, thereby comprehensively improving the efficiency of cross-database data queries. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A schematic diagram of a flow chart of a method for generating a query database in one embodiment;

[0056] Figure 2 A diagram of a configuration page of connector configuration information in one embodiment;

[0057] Figure 3 A diagram of a page for collecting metadata information in an embodiment;

[0058] Figure 4 A data table query page diagram of a visual data table in one embodiment;

[0059] Figure 5 A page diagram for defining permissions for each data content in an embodiment;

[0060] Figure 6 A schematic diagram of a process for querying a database to generate an example in one embodiment;

[0061] Figure 7 A structural block diagram of a query database generating device in one embodiment;

[0062] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0064] The query database generation method provided in the embodiment of the present application can be applied to the application environment of cross-database query. The method can be applied to a terminal, a server, or a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, etc. Among them, the terminal optimizes this function of Presto. After generating the configuration files of each database, this solution automatically FTPs each configuration file to the directory of Presto, ensuring that the directory is automatically scanned in a loop to dynamically load files, avoiding the inefficiency of users manually storing configuration files. Moreover, this solution applies a visual data table for each data content, so that the staff can directly obtain the data content to be queried by clicking on the query field, without requiring the technical ability of the staff, thereby increasing the applicable population of cross-database data query and improving the user experience. Then, this solution ensures the security of data content retrieval by limiting the query permissions of different data contents, improves the management and control effect of the retrieval permissions of each data content, and thus improves the security protection effect of each data content. Finally, this solution obtains metadata information in advance and then builds the target query database, avoiding the timeliness problem in actual cross-database business queries, thereby comprehensively improving the efficiency of cross-database data queries.

[0065] In one embodiment, Figure 1 As shown, a query database generation method is provided, which is described by taking the method applied to a terminal as an example, and includes the following steps:

[0066] Step S101, obtaining connector configuration information of multiple databases and a cross-database query program directory, and generating a connector configuration file corresponding to each database based on each connector configuration information.

[0067] In this embodiment, the terminal responds to the configuration information upload operation of the staff to obtain the connector configuration information of each database, wherein the connector configuration information is as follows: Figure 2 As shown, it includes the data source number, data source name, data source description, metadata directory, data set system code, data set system name, usage scenario and other information of the database. The connector configuration information is used to build a call connection relationship between the cross-database query program and the database. Then, the terminal obtains the cross-database query program directory, which is a storage directory for storing connector configuration files corresponding to each database. Finally, the terminal generates a connector configuration file corresponding to each database based on the configuration information of each connector. Among them, the connector configuration file is configuration information that meets the format required by Presto (i.e., the cross-database query program).

[0068] Step S102, configure each configuration file in the cross-database query program directory, obtain the target cross-database query program, and collect metadata information.

[0069] In this embodiment, the terminal configures each configuration file in the cross-database query program directory, obtains the target cross-database query program, and collects metadata information. Among them, the metadata information includes a collection of data fields that the user needs to query, wherein each data field originates from a data content, each data content corresponds to a data category, and each data content of all data categories is stored in the database. The terminal obtains the collection of data fields that the user needs to query by querying the database. Among them, each database includes data content of multiple data categories. The staff needs to first filter the data categories that need to be queried in the data categories of each database as the data categories of the metadata information. Then, the terminal uses the collection of data fields corresponding to all data contents of each data category as metadata information. Figure 3 The figure shows a schematic diagram of metadata information collection. In the figure, each field type represents a data category.

[0070] Step S103, based on the metadata information, identify the data fields to be queried and the visual data tables corresponding to all the data fields, and based on the data fields, through the target cross-database query program, retrieve the data content corresponding to each data field in each database to obtain the database to be queried.

[0071] In this embodiment, the terminal identifies the data fields to be queried and the visual data tables corresponding to all the data fields based on the metadata information, and retrieves the data content corresponding to each data field in each database through the target cross-database query program based on each data field to obtain the database to be queried. The specific identification process will be described in detail later, wherein the visual data table is as follows: Figure 4As shown, it is a data table query page diagram of a visual data table, including query fields corresponding to each data field. Each query field can query the data content corresponding to the data field by selecting, filtering, etc.

[0072] Step S104, identifying the query authority of each data content, and generating a query strategy for each data content based on the query authority of each data content and the visualized data table.

[0073] In this embodiment, the terminal identifies the query permission of each data content, and generates a query strategy for each data content based on the query permission of each data content and the visualized data table. The data content described here is the data content corresponding to the data field retrieved in step S103. Figure 5 As shown, it is a query permission page diagram of data content. The query strategy of each data content includes the query permission restriction strategy of each data content and the retrieval strategy of each data content. The specific generation process will be described in detail later.

[0074] Step S105, storing the query strategies of all data contents and the visualized data table in the database to be queried, and obtaining the target query database.

[0075] In this embodiment, the terminal stores the query strategies of all data contents and the visual data table in the to-be-queried database to obtain the target query database. The specific process of obtaining the target query database will be described in detail later.

[0076] Based on the above solution, by optimizing this function of Presto, after generating the configuration files of each database, this solution automatically FTPs each configuration file to the directory of Presto, ensuring that the directory is automatically scanned in a loop to dynamically load files, avoiding the inefficiency of users manually storing configuration files. Moreover, this solution applies a visual data table for each data content, so that the staff can directly obtain the data content to be queried by clicking on the query field, without requiring the technical ability of the staff, thereby increasing the applicable population of cross-database data query and improving the user experience. Then, this solution ensures the security of data content retrieval by limiting the query permissions of different data contents, improves the control effect of the retrieval permissions of each data content, and thus improves the security protection effect of each data content. Finally, this solution obtains metadata information in advance and then builds the target query database, avoiding the timeliness problem in actual cross-database business queries, thereby comprehensively improving the efficiency of cross-database data queries.

[0077] Optionally, based on each connector configuration information, a connector configuration file corresponding to each database is generated, including: for each connector configuration information, identifying each configuration content of the connector configuration information and the configuration type of each configuration content, and identifying the format requirement information of the cross-database query program; converting the configuration format of the configuration content of each configuration type into a target format corresponding to the format requirement information to obtain the target configuration content of each configuration type; and using the target configuration content of all configuration types as the configuration file of the database to which the connector configuration information belongs.

[0078] In this embodiment, the terminal identifies each configuration content of the connector configuration information and the configuration type of each configuration content for each connector configuration information. The configuration content of the connector configuration information is the software configuration content of the connector, and the configuration type of each configuration content is the configuration type corresponding to each software configuration content of the connector, and the configuration type is used to locate the adjustment position of the connector configuration information that needs to be adjusted.

[0079] Then, the terminal identifies the format requirement information of the cross-library query program. The format requirement information is that each configuration content in the configuration file can be configured in the target configuration of the connector. Then, the terminal converts the configuration format of the configuration content of each configuration type into the target format corresponding to the format requirement information, and obtains the target configuration content of each configuration type. Finally, the terminal uses the target configuration content of all configuration types as the configuration file of the database to which the connector configuration information belongs.

[0080] Based on the above solution, by converting the configuration content of each configuration information into a format according to each configuration type, each target configuration content is obtained, ensuring that each configuration file can be normally started by the cross-database query program to retrieve the data content in each database.

[0081] Optionally, each configuration file is configured in a cross-database query program directory to obtain a target cross-database query program, including: for each configuration file, storing the configuration file in the cross-database query program directory of the cross-database query program; after all configuration files complete the storage operation, adjusting the file loading method of the cross-database query program to a method of periodically loading configuration files to obtain the target cross-database query program.

[0082] In this embodiment, the terminal stores each configuration file in the cross-database query program directory of the cross-database query program. Then, after all configuration files are stored, the terminal adjusts the file loading mode of the cross-database query program to a timed loading mode of the configuration file to obtain the target cross-database query program. Among them, the original loading mode of the cross-database query program is a manual file loading mode, which can only manually retrieve the configuration file of a database to perform a data content retrieval operation. When it is adjusted to a timed loading mode of the configuration file, the terminal can automatically load the parameters in the file into the cross-database retrieval operation corresponding to the cross-database query program after detecting the configuration file storage operation, thereby avoiding the inefficiency of manual configuration.

[0083] Based on the above solution, by adjusting the storage format of each configuration file in the cross-database query program and adjusting the loading method of the configuration file, the efficiency of the cross-database query program in calling each database is improved.

[0084] Optionally, based on the metadata information, identify the data fields to be queried and the visual data tables corresponding to all the data fields, including: in the metadata information, filter the data information containing the data field identification information, and use each piece of data information containing the data field identification information as each data field; in the set of historical visual data tables, identify the number of data fields contained in each historical visual data table, and use the historical visual data table corresponding to the maximum number as a candidate visual data table; in each data field, filter the target data field not included in the candidate visual data table, and based on each target data field, update the candidate visual data table to obtain the visual data table corresponding to all the data fields.

[0085] In this embodiment, the terminal screens the data information containing data field identification information in the metadata information, and uses each data information containing data field identification information as each data field. Then, in the set of historical visualization data tables, the terminal identifies the number of data fields contained in each historical visualization data table, and uses the historical visualization data table corresponding to the maximum number as a candidate visualization data table. Finally, in each data field, the terminal screens the target data fields not included in the candidate visualization data table, and based on each target data field, updates the candidate visualization data table to obtain the visualization data table corresponding to all data fields. Among them, the set of historical visualization data tables includes the historical visualization data tables used by the staff in each cross-library query, and each historical visualization data table includes the data fields of each database and the query statement of each data field. After the update, the terminal stores the visualization data table in the set of historical visualization data tables.

[0086] Based on the above solution, by retrieving the historical visualization data table containing the largest number of data fields required for this query, the amount of updated data in the data table can be reduced, thereby improving the updating efficiency of the data table.

[0087] Optionally, identifying the query permission for each data content includes: for each data content, identifying the data source corresponding to the data content, and querying the query permission scope corresponding to the data source; based on the data field corresponding to the data content, querying the query permission corresponding to the data content within the query permission scope.

[0088] In this embodiment, the terminal identifies the data source corresponding to each data content, and queries the query permission range corresponding to the data source. Each data source corresponds to a query permission range, and the query permission range includes the query permissions corresponding to different data fields of the data source. Then, based on the data field corresponding to the data content, the terminal queries the query permission corresponding to the data content in the query permission range.

[0089] Based on the above scheme, after first identifying the query authority scope, the query authority corresponding to each query data content is determined, thereby ensuring the accuracy of the query authority corresponding to the identified query data content.

[0090] Optionally, based on the query permissions of each data content and the visual data table, a query strategy for each data content is generated, including: for each data content, identifying the location information of the data field corresponding to the data content in the visual data table, and generating a data content retrieval strategy based on the data field corresponding to the data content and the location information of the data field; based on the query permissions of the data content, generating data content retrieval permission restriction information, and using the data content retrieval strategy and the data content retrieval permission restriction information as the data content query strategy.

[0091] In this embodiment, the terminal identifies the location information of the data field corresponding to each data content in the visual data table, and generates a data content retrieval strategy based on the data field corresponding to the data content and the location information of the data field. The data content retrieval strategy is that after the worker selects / screens the query statement, the terminal identifies the query field corresponding to the query statement based on the query statement, thereby retrieving the data content corresponding to the query field in the target query database.

[0092] Then, the terminal generates data content access permission restriction information based on the query permission of the data content, and uses the data content access strategy and the data content access permission restriction information as the data content query strategy. The access permission restriction information is used for the range of data fields that the current user can access.

[0093] Based on the above solution, by generating data content retrieval strategies and data content retrieval permission restriction information, the efficiency of data content retrieval is ensured without the need for technical restrictions on staff, and the security of data content retrieval is ensured, avoiding the data risk problem that all users can retrieve all data content.

[0094] This application also provides an example of query database generation, such as Figure 6 As shown, the specific processing process includes the following steps:

[0095] Step S601, obtaining connector configuration information of multiple databases and a cross-database query program directory.

[0096] Step S602: for each connector configuration information, identify each configuration content of the connector configuration information and the configuration type of each configuration content, and identify the format requirement information of the cross-database query program.

[0097] Step S603: convert the configuration format of the configuration content of each configuration type into a target format corresponding to the format requirement information to obtain the target configuration content of each configuration type.

[0098] Step S604: Use the target configuration contents of all configuration types as configuration files of the database to which the connector configuration information belongs.

[0099] Step S605, for each configuration file, storing the configuration file in the cross-database query program directory of the cross-database query program.

[0100] Step S606, after all configuration files have completed the storage operation, the file loading mode of the cross-database query program is adjusted to a mode of loading configuration files at a scheduled time, to obtain a target cross-database query program.

[0101] Step S607: collecting metadata information.

[0102] Step S608: Filter the data information containing the data field identification information in the metadata information, and use each piece of data information containing the data field identification information as each data field.

[0103] Step S609 , in the set of historical visualization data tables, identifying the number of data fields contained in each historical visualization data table, and taking the historical visualization data table corresponding to the largest number as a candidate visualization data table.

[0104] Step S610 , in each data field, the target data field not included in the candidate visualization data table is screened, and based on each target data field, the candidate visualization data table is updated to obtain the visualization data table corresponding to all data fields.

[0105] Step S611, based on each data field, through the target cross-database query program, in each database, the data content corresponding to each data field is retrieved respectively to obtain the database to be queried.

[0106] Step S612: for each data content, identify the data source corresponding to the data content, and query the query authority range corresponding to the data source.

[0107] Step S613, based on the data field corresponding to the data content, query the query authority corresponding to the data content within the query authority range.

[0108] Step S614, for each data content, identifying the location information of the data field corresponding to the data content in the visualized data table, and generating a data content retrieval strategy based on the data field corresponding to the data content and the location information of the data field.

[0109] Step S615, based on the query authority of the data content, generate the access authority restriction information of the data content, and use the data content access strategy and the data content access authority restriction information as the query strategy of the data content.

[0110] Step S616, storing the query strategies of all data contents and the visualized data tables in the database to be queried, and obtaining the target query database.

[0111] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0112] Based on the same inventive concept, the embodiment of the present application also provides a query database generation device for implementing the query database generation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more query database generation device embodiments provided below can refer to the limitations of the query database generation method above, and will not be repeated here.

[0113] In one embodiment, Figure 7As shown, a query database generation device is provided, including: an acquisition module 710, a configuration module 720, an identification module 730, a generation module 740 and a determination module 750, wherein:

[0114] The acquisition module 710 is used to acquire the connector configuration information of multiple databases and the cross-database query program directory, and generate a connector configuration file corresponding to each database based on the connector configuration information;

[0115] Configuration module 720, configured to configure each of the configuration files in the cross-database query program directory, obtain the target cross-database query program, and collect metadata information;

[0116] The identification module 730 is used to identify the data fields to be queried and the visual data tables corresponding to all the data fields based on the metadata information, and retrieve the data content corresponding to each data field in each database through the target cross-database query program based on the data fields to obtain the database to be queried;

[0117] A generation module 740, for identifying the query authority of each data content, and generating a query strategy for each data content based on the query authority of each data content and the visualized data table;

[0118] The determination module 750 is used to store the query strategies of all data contents and the visual data table in the database to be queried to obtain a target query database.

[0119] Optionally, the acquisition module 710 is specifically configured to:

[0120] For each connector configuration information, identify each configuration content of the connector configuration information and the configuration type of each configuration content, and identify the format requirement information of the cross-library query program;

[0121] Convert the configuration format of the configuration content of each configuration type into a target format corresponding to the format requirement information to obtain the target configuration content of each configuration type;

[0122] The target configuration contents of all configuration types are used as configuration files of the database to which the connector configuration information belongs.

[0123] Optionally, the configuration module 720 is specifically used to:

[0124] For each configuration file, storing the configuration file in the cross-database query program directory of the cross-database query program;

[0125] After all configuration files have completed the storage operation, the file loading mode of the cross-database query program is adjusted to a mode of periodically loading configuration files to obtain a target cross-database query program.

[0126] Optionally, the identification module 730 is specifically configured to:

[0127] In the metadata information, data information including data field identification information is screened, and each piece of data information including data field identification information is used as each data field;

[0128] In the set of historical visualization data tables, identifying the number of the data fields contained in each historical visualization data table, and taking the historical visualization data table corresponding to the largest number as a candidate visualization data table;

[0129] In each of the data fields, target data fields not included in the candidate visualization data table are screened, and based on each of the target data fields, the candidate visualization data table is updated to obtain visualization data tables corresponding to all data fields.

[0130] Optionally, the generating module 740 is specifically configured to:

[0131] For each data content, identify the data source corresponding to the data content, and query the query authority scope corresponding to the data source;

[0132] Based on the data field corresponding to the data content, within the query permission range, query permission corresponding to the data content is queried.

[0133] Optionally, the generating module 740 is specifically configured to:

[0134] For each data content, identifying the location information of the data field corresponding to the data content in the visual data table, and generating a retrieval strategy for the data content based on the data field corresponding to the data content and the location information of the data field;

[0135] Based on the query authority of the data content, the access authority restriction information of the data content is generated, and the access strategy of the data content and the access authority restriction information of the data content are used as the query strategy of the data content.

[0136] Each module in the above-mentioned query database generation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0137] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a query database generation method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.

[0138] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0139] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of any one of the methods in the first aspect are implemented.

[0140] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the methods in the first aspect are implemented.

[0141] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods in the first aspect.

[0142] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0143] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0144] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0145] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for generating a query database, characterized in that: The method comprises: Obtain connector configuration information of multiple databases and a cross-database query program directory, and generate a connector configuration file corresponding to each database based on each of the connector configuration information; Configuring each of the configuration files in the cross-database query program directory, obtaining a target cross-database query program, and collecting metadata information; Based on the metadata information, the data fields to be queried and the visual data tables corresponding to all the data fields are identified, and based on the data fields, the data content corresponding to each data field is retrieved in each database through the target cross-database query program to obtain the database to be queried; Identify the query authority of each data content, and generate a query strategy for each data content based on the query authority of each data content and the visualized data table; The query strategies for all data contents and the visual data table are stored in the database to be queried to obtain a target query database.

2. The method according to claim 1, characterized in that The generating a connector configuration file corresponding to each database based on each of the connector configuration information includes: For each connector configuration information, identify each configuration content of the connector configuration information and the configuration type of each configuration content, and identify the format requirement information of the cross-library query program; Convert the configuration format of the configuration content of each configuration type into a target format corresponding to the format requirement information to obtain the target configuration content of each configuration type; The target configuration contents of all configuration types are used as configuration files of the database to which the connector configuration information belongs.

3. The method according to claim 2, characterized in that The step of configuring each of the configuration files in the cross-database query program directory to obtain a target cross-database query program includes: For each configuration file, storing the configuration file in the cross-database query program directory of the cross-database query program; After all configuration files have completed the storage operation, the file loading mode of the cross-database query program is adjusted to a mode of periodically loading configuration files to obtain a target cross-database query program.

4. The method according to claim 1, characterized in that: The step of identifying the data fields to be queried and the visual data tables corresponding to all the data fields based on the metadata information includes: In the metadata information, data information including data field identification information is screened, and each piece of data information including data field identification information is used as each data field; In the set of historical visualization data tables, identifying the number of the data fields contained in each historical visualization data table, and taking the historical visualization data table corresponding to the largest number as a candidate visualization data table; In each of the data fields, target data fields not included in the candidate visualization data table are screened, and based on each of the target data fields, the candidate visualization data table is updated to obtain visualization data tables corresponding to all data fields.

5. The method according to claim 1, characterized in that The query authority for identifying each data content includes: For each data content, identify the data source corresponding to the data content, and query the query authority scope corresponding to the data source; Based on the data field corresponding to the data content, within the query permission range, query permission corresponding to the data content is queried.

6. The method according to claim 1, characterized in that The query strategy for each data content is generated based on the query authority of each data content and the visualized data table, including: For each data content, identifying the location information of the data field corresponding to the data content in the visual data table, and generating a retrieval strategy for the data content based on the data field corresponding to the data content and the location information of the data field; Based on the query authority of the data content, the access authority restriction information of the data content is generated, and the access strategy of the data content and the access authority restriction information of the data content are used as the query strategy of the data content.

7. A query database generation device, characterized in that: The device comprises: An acquisition module, used to acquire connector configuration information of multiple databases and a cross-database query program directory, and generate a connector configuration file corresponding to each database based on each of the connector configuration information; A configuration module, used to configure each of the configuration files in the cross-database query program directory, obtain a target cross-database query program, and collect metadata information; An identification module, for identifying each data field to be queried and a visual data table corresponding to all data fields based on the metadata information, and based on each data field, through the target cross-database query program, respectively retrieves the data content corresponding to each data field in each database to obtain a database to be queried; A generation module, used to identify the query authority of each data content, and generate a query strategy for each data content based on the query authority of each data content and the visualized data table; The determination module is used to store the query strategies of all data contents and the visual data table in the database to be queried to obtain a target query database.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

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 according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Cross-database user data reading method, medium, product and equipment

    CN119441336A

  • Method, medium, product and device for reading user data across databases

    CN119441336B