Data query method, device, equipment, storage medium and program product

By setting up a unified API interface and data source access plug-in, the problems of low query efficiency and low access control efficiency caused by different protocols of different database interfaces are solved, and efficient data query and access control are achieved.

CN119782336APending Publication Date: 2025-04-08PICC INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, the differences in interface protocols of different databases lead to low data query efficiency, excessive database connections but low utilization, difficult to control the total number of database access concurrency, and difficult to achieve fine-grained permission control.

Method used

Provides a data query method, which allows you to receive data query requests, select the target data set, and call the access plug-in of the target data source for access, and sets up a unified API interface to realize query and unified management of different data sources.

Benefits of technology

It improves data query efficiency, improves data access management efficiency, and realizes unified management of different data sources and fine-grained permission control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782336A_ABST
    Figure CN119782336A_ABST
Patent Text Reader

Abstract

The present disclosure provides a data query method, device, equipment, storage medium and program product. In some embodiments of the present disclosure, a data query request issued by a data query terminal is received, wherein the data query request carries a query field and a target data scenario; according to the query field, the target data set is parsed to obtain a target query strategy, a target data source and a target data source table corresponding to the query field; according to the target query strategy, the target data source and the target data source table, a data source access plug-in corresponding to the target data source is called to access the target data source to obtain a query result; the query result is uploaded to the data query terminal so that the data query terminal can view the query result; the present disclosure sets a unified API interface, and by calling the interface, a query method for different data sources is implemented, and through the interface, data access can be uniformly controlled, thereby improving data query efficiency and data access control efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In the field of big data, in order to meet the query requirements of various business scenarios, database components with different characteristics are generally introduced, such as OLAP databases: Clickhouse, Doris and GaussDB MPP version, etc., NoSQL databases: Hbase and Redis, etc., to form a data platform to provide services for downstream. When connecting to these database services, application services generally use the client tools provided by each database to directly connect to the database server for access.

[0003] The above databases that application services directly access the data platform generally have different interface protocols and obvious differences in usage. Applications need to master the characteristics of each database that needs to be accessed and encode the access functions in the application services in sequence. At the same time, on the database server side, in order to improve the resource utilization of the above distributed databases, multi-tenant methods are generally used for different application services. However, in this scenario, there are usually too many database connections but low utilization, and the total number of concurrent database accesses is difficult to control, which will affect the stability of the entire database cluster. In addition, in terms of data security, it is difficult to achieve more fine-grained permission control, such as column granularity and row granularity, only with tenant-level permission control.

[0004] At present, different databases have different interface protocols, and the data query efficiency is low; the data access control efficiency is low. Summary of the invention

[0005] The present disclosure provides a data query method, apparatus, device, storage medium and program product to at least solve the problems of low existing data query efficiency and low data access control efficiency.

[0006] The technical solution of the present disclosure is as follows:

[0007] The present disclosure provides a data query method, including:

[0008] Receiving a data query request sent by a data query terminal, wherein the data query request carries a query field and a target data scenario, the target data scenario is a data scenario acquired by the data query terminal in response to a data scenario selection operation; the data query request is a request generated by the data query terminal in response to a data query operation;

[0009] According to the target data scenario, a target data set corresponding to the target data scenario is selected; wherein the target data set includes: definition information and configuration information, the definition information includes: field, data type, whether to filter condition and filter operator, and the configuration information includes: query strategy, data source table, field mapping relationship and index;

[0010] According to the query field, the target data set is parsed to obtain a target query strategy, a target data source and a target data source table corresponding to the query field;

[0011] According to the target query strategy, the target data source and the target data source table, a data source access plug-in corresponding to the target data source is called to access the target data source to obtain a query result;

[0012] The query result is uploaded to the data query terminal so that the data query terminal can view the query result.

[0013] Optionally, selecting a target data set corresponding to the target data scenario according to the target data scenario includes:

[0014] According to the target data scenario, a mapping relationship table between data scenarios and data sets is queried to obtain a target data set corresponding to the target data scenario; wherein the mapping relationship table between data scenarios and data sets is obtained by configuring a configuration terminal.

[0015] Optionally, the field indicates a data structure format that can be obtained by the query request;

[0016] The data type indicates the data type corresponding to each of the fields;

[0017] The filtering condition indicates whether the field can be used as a filtering parameter for interface query;

[0018] The filtering operator represents a specific filtering logic;

[0019] The query strategy refers to a specific query method; the query strategy includes: directly connecting a single data source, connecting multiple data sources in parallel, and cascading multiple data sources;

[0020] The data source table represents any table or a SQL statement for a specific query;

[0021] The field mapping relationship represents the correspondence between the data source field and the underlying data source value, which is a field in the data source table, or an aggregate function logic, or a SQL processing logic;

[0022] The index represents some specific index information for querying the data source table.

[0023] Optionally, the target data set is parsed according to the query field to obtain a target query strategy, a target data source and a target data source table corresponding to the query field, including:

[0024] According to the query field, query the mapping relationship table between the field in the configuration information on the target data set and the data source table to obtain the target field, aggregation function logic or SQL processing logic of the query target data source table;

[0025] According to the query field, query the configuration information table of the configuration information on the target data set to obtain the target data source table;

[0026] Determine the target data source according to the target data source table;

[0027] According to the query field, the configuration information table of the configuration information on the target data set is queried to determine the target query strategy.

[0028] Optionally, the step of calling a data source access plug-in corresponding to the target data source to access the target data source according to the target query strategy, the target data source and the target data source table to obtain a query result includes:

[0029] According to the target query strategy, determine the target data source that needs to be called, and call the data source access plug-in corresponding to the target data source;

[0030] Using the data source access plug-in, access the target data source table to obtain query results;

[0031] According to the target query strategy, logical processing is performed on the query results.

[0032] Optionally, after accessing the target data source according to the target query strategy, the target data source and the target data source table by calling a data source access plug-in corresponding to the target data source to obtain a query result, the method further includes:

[0033] Encapsulating the query result using the data source access plug-in to obtain the encapsulated query result;

[0034] Using the query strategy instance, re-encapsulating the encapsulated query result to obtain a re-encapsulated query result;

[0035] The query result after the secondary packaging is uploaded to the data query terminal.

[0036] The present disclosure also provides a data query device, including:

[0037] A receiving module, configured to receive a data query request sent by a data query terminal, wherein the data query request carries a query field and a target data scenario, the target data scenario is a data scenario acquired by the data query terminal in response to a data scenario selection operation; the data query request is a request generated by the data query terminal in response to a data query operation;

[0038] A selection module is used to select a target data set corresponding to the target data scenario according to the target data scenario; wherein the target data set includes: definition information and configuration information, the definition information includes: field, data type, whether to filter condition and filter operator, and the configuration information includes: query strategy, data source table, field mapping relationship and index;

[0039] A parsing module, used to parse the target data set according to the query field to obtain a target query strategy, a target data source and a target data source table corresponding to the query field;

[0040] A calling module, configured to call a data source access plug-in corresponding to the target data source to access the target data source and obtain a query result according to the target query strategy, the target data source and the target data source table;

[0041] The uploading module is used to upload the query result to the data query terminal so that the data query terminal can view the query result.

[0042] The present disclosure also provides an electronic device, including:

[0043] processor;

[0044] a memory for storing processor-executable instructions;

[0045] The processor is configured to execute instructions to implement each step in the above method.

[0046] The embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, each step in the above method is implemented.

[0047] The embodiment of the present disclosure further provides a computer program product, including a computer program / instruction, which implements each step of the above method when executed by a processor.

[0048] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0049] In some embodiments of the present disclosure, a data query request issued by a data query terminal is received, wherein the data query request carries a query field and a target data scenario, and the target data scenario is a data scenario obtained by the data query terminal in response to a data scenario selection operation; the data query request is a request generated by the data query terminal in response to a data query operation; according to the target data scenario, a target data set corresponding to the target data scenario is selected; wherein the target data set includes: definition information and configuration information, wherein the definition information includes: field, data type, whether to filter condition and filter operator, and the configuration information includes: query strategy, data source table, field mapping relationship and index; according to the query field, the target data set is parsed to obtain a target query strategy, target data source and target data source table corresponding to the query field; according to the target query strategy, target data source and target data source table, a data source access plug-in corresponding to the target data source is called to access the target data source to obtain a query result; the query result is uploaded to the data query terminal for the data query terminal to view the query result; the present disclosure sets a unified API interface, and by calling the interface, a query method of different data sources is implemented, and the interface can be used to uniformly control data access, thereby improving data query efficiency and data access control efficiency.

[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0052] Figure 1 A flowchart of a data query method provided for an exemplary embodiment of the present disclosure;

[0053] Figure 2 A schematic diagram of a data set is provided for an exemplary embodiment of the present disclosure;

[0054] Figure 3 A data query schematic diagram provided for an exemplary embodiment of the present disclosure;

[0055] Figure 4 A flow chart of a data query method provided by an exemplary embodiment of the present disclosure;

[0056] Figure 5 A schematic diagram of the structure of a data query device provided by an exemplary embodiment of the present disclosure;

[0057] Figure 6A schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0058] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0059] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure.

[0060] It should be noted that the user information involved in this disclosure includes but is not limited to: user device information and user personal information; the collection, storage, use, processing, transmission, provision and disclosure of user information in this disclosure comply with the relevant laws and regulations and do not violate public order and good morals.

[0061] In view of the above technical problems, in some embodiments of the present disclosure, a data query request issued by a data query terminal is received, wherein the data query request carries a query field and a target data scenario, and the target data scenario is a data scenario obtained by the data query terminal in response to a data scenario selection operation; the data query request is a request generated by the data query terminal in response to a data query operation; according to the target data scenario, a target data set corresponding to the target data scenario is selected; wherein the target data set includes: definition information and configuration information, wherein the definition information includes: field, data type, whether to filter condition and filter operator, and the configuration information includes: query strategy, data source table, field mapping relationship and index; according to the query field, the target data set is parsed to obtain a target query strategy, target data source and target data source table corresponding to the query field; according to the target query strategy, target data source and target data source table, a data source access plug-in corresponding to the target data source is called to access the target data source to obtain a query result; the query result is uploaded to the data query terminal for the data query terminal to view the query result; the present disclosure sets a unified API interface, and by calling the interface, a query method of different data sources is implemented, and through the interface, data access can be uniformly controlled, thereby improving data query efficiency and data access control efficiency.

[0062] The technical solutions provided by various embodiments of the present disclosure are described in detail below in conjunction with the accompanying drawings.

[0063] Figure 1 The following is a flow chart of a data query method provided by an exemplary embodiment of the present disclosure. Figure 1 As shown, the method includes:

[0064] S101: receiving a data query request sent by a data query terminal, wherein the data query request carries a query field and a target data scenario, and the target data scenario is a data scenario acquired by the data query terminal in response to a data scenario selection operation; the data query request is a request generated by the data query terminal in response to the data query operation;

[0065] S102: According to the target data scenario, select a target data set corresponding to the target data scenario; wherein the target data set includes: definition information and configuration information, the definition information includes: field, data type, whether to filter condition and filter operator, and the configuration information includes: query strategy, data source table, field mapping relationship and index;

[0066] S103: parsing the target data set according to the query field to obtain a target query strategy, a target data source, and a target data source table corresponding to the query field;

[0067] S104: According to the target query strategy, the target data source and the target data source table, a data source access plug-in corresponding to the target data source is called to access the target data source to obtain a query result;

[0068] S105: Upload the query result to the data query terminal so that the data query terminal can view the query result.

[0069] In this embodiment, the execution subject of the above method can be a server, and the implementation form of the server is not limited. For example, the server can be a conventional server, a cloud server, a cloud host, a virtual center, and other server devices. Among them, the composition of the server mainly includes a processor, a hard disk, a memory, a system bus, etc., and a general computer architecture type.

[0070] In this embodiment, the data query terminal includes but is not limited to a mobile station (MS), a mobile terminal, a mobile phone, a handset, and a portable equipment, etc. The terminal device can communicate with one or more core networks via a radio access network (RAN). For example, the terminal device can be a mobile phone (or a "cellular" phone), a computer with a wireless communication function, etc. The terminal device can also be a computer with a wireless transceiver function, a virtual reality (VR) terminal device, an AR terminal device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, etc., and the operating system installed on the terminal device includes but is not limited to: IOS, Android, windows, linux, Mac OS and other operating systems. In different networks, the terminal may be called different names, such as user equipment, mobile station, subscriber unit, station, cellular phone, personal digital assistant, wireless modem, wireless communication device, handheld device, laptop computer, cordless phone, wireless local loop station, television, etc. For the convenience of description, it is referred to as terminal equipment in this embodiment.

[0071] In this embodiment, a data query request sent by a data query terminal is received, wherein the data query request carries a query field and a target data scenario, and the target data scenario is a data scenario obtained by the data query terminal in response to a data scenario selection operation; the data query request is a request generated by the data query terminal in response to a data query operation; according to the target data scenario, a target data set corresponding to the target data scenario is selected; wherein the target data set includes: definition information and configuration information, wherein the definition information includes but is not limited to: fields, data types, whether to filter conditions and filter operators, and the configuration information includes but is not limited to: query strategies, data source tables, field mapping relationships and indexes; according to the query fields, the target data set is parsed to obtain target query strategies, target data sources and target data source tables corresponding to the query fields; according to the target query strategies, target data sources and target data source tables, a data source access plug-in corresponding to the target data source is called to access the target data source to obtain query results; the query results are uploaded to the data query terminal for the data query terminal to view the query results; the present disclosure sets a unified API interface, and by calling the interface, a query method for different data sources is implemented, and through the interface, data access can be uniformly controlled, thereby improving data query efficiency and data access control efficiency.

[0072] It should be noted that the present disclosure does not limit the types of data scenarios, which include but are not limited to the following: earthquake scenarios, fire scenarios, car accident scenarios, e-commerce users, order query scenarios, and IoT device sensor data scenarios. The present disclosure does not limit the types of data sources, which include but are not limited to the following: Clickhouse, Hbase, and Gauss.

[0073] In some embodiments of the present disclosure, a data set is configured for each data scenario by configuring a mapping relationship table between data scenarios and data sets in the terminal configuration. The data set includes: definition information and configuration information, the definition information includes: fields, data types, whether to filter conditions and filter operators, and the configuration information includes: query strategies, data source tables, field mapping relationships and indexes.

[0074] Among them, field,represents the data structure format that can be obtained by the query request;

[0075] Data type, indicating the data type corresponding to each field;

[0076] Whether it is a filtering condition, indicating whether the field can be used as a filtering parameter for interface queries;

[0077] Filter operator, which indicates the specific filtering logic;

[0078] Query strategy, which indicates the specific query method; query strategies include but are not limited to: directly connecting to a single data source, connecting multiple data sources in parallel, and cascading multiple data sources;

[0079] Data source table, which represents any table or a SQL statement for a specific query;

[0080] The field mapping relationship indicates the correspondence between the data source field and the underlying data source value. It is a field in the data source table, or an aggregate function logic, or a SQL processing logic.

[0081] Index, which indicates some specific index information of querying data source table.

[0082] Figure 2 A schematic diagram of a data set is provided for an exemplary embodiment of the present disclosure. Figure 2 As shown in the figure, the business meaning represented by this dataset is to query the data results of a certain type of disaster occurring within a certain period of time by the occurrence time. The data results include the latitude and longitude, province, city and other information of the disaster location.

[0083] It should be noted that the field information defined in a dataset instance can correspond to a table on the underlying data source, or some fields in a table, or some fields after several tables are associated, or fields after data in several data sources are associated and combined. Through this flexible combination control, field-level granularity permission control can be achieved, and the application service is unaware of the specific source of the queried data.

[0084] In some embodiments of the present disclosure, the data query terminal obtains the target data scene in response to the data scene selection operation; the data query terminal generates a data query request in response to the data query operation, and sends the data query request to the server; the server performs data query through a unified API interface, obtains the query result, and returns the query result to the data query terminal. The present disclosure provides a universal API interface, and the application service only needs to call the interface to implement query access to different data sources, without paying attention to the differences in characteristics of different data sources, user identities, connection strings and other information. For example, a plurality of data scene controls are displayed on the display screen of the data query terminal, and the data query terminal selects the target data scene in response to the user's triggering operation on the data scene control; the data query terminal generates a data query request in response to the user's input operation of entering the query field; and sends the data query request to the server.

[0085] Figure 3 A data query schematic diagram provided for an exemplary embodiment of the present disclosure. Figure 3 As shown, different application services access different data sources by calling a unified API interface.

[0086] In some embodiments of the present disclosure, a target data set corresponding to the target data scenario is selected according to the target data scenario. One achievable method is to query a mapping relationship table between data scenarios and data sets according to the target data scenario to obtain a target data set corresponding to the target data scenario; wherein the mapping relationship table between data scenarios and data sets is obtained by configuring a configuration terminal. The present disclosure pre-sets a mapping relationship table between data scenarios and data sets, and the target data set can be quickly obtained by querying the mapping relationship table between data scenarios and data sets.

[0087] In some embodiments of the present disclosure, the target data set is parsed according to the query field to obtain the target query strategy, target data source and target data source table corresponding to the query field. One achievable method is to query the mapping relationship table between the field in the configuration information on the target data set and the data source table according to the query field, and obtain the target field, aggregation function logic or SQL processing logic of the query target data source table; query the configuration information table of the configuration information on the target data set according to the query field to obtain the target data source table; determine the target data source according to the target data source table; query the configuration information table of the configuration information on the target data set according to the query field to determine the target query strategy. . The present disclosure queries the mapping relationship table between the field in the configuration information on the target data set and the data source table through the query field, and then obtains the target field, aggregation function logic or SQL processing logic of the query target data source table; each data source stores a corresponding data source table, and the target data source can be further determined through the target data source table; if the target data source can be one, the query strategy is to directly connect to a single data source; if the target data source is multiple and the multiple target data sources are in parallel, the query strategy is multiple data source parallel; if the target data source is multiple and the multiple target data sources are in cascade relationship, the query strategy is multiple data source cascade. The present disclosure can quickly execute query strategies and improve data query efficiency through a mapping relationship table between fields in the configuration information on the target data set and a data source table.

[0088] In some embodiments of the present disclosure, according to the target query strategy, the target data source and the target data source table, the data source access plug-in corresponding to the target data source is called to access the target data source to obtain the query result. One achievable method is to determine the target data source data source that needs to be called according to the target query strategy, and call the data source access plug-in corresponding to the target data source; use the data source access plug-in to access the target data source table to obtain the query result; and perform logical processing on the query result according to the target query strategy. . For example, call the Hbase plug-in corresponding to the data source Hbase, use a single-source direct connection method to access the data source Hbase, and obtain the query result.

[0089] According to the target query strategy, the target data source and the target data source table, the data source access plug-in corresponding to the target data source is called to access the target data source, and after obtaining the query result, the query result is encapsulated by using the data source access plug-in to obtain the encapsulated query result; the encapsulated query result is re-encapsulated by using the query strategy instance to obtain the re-encapsulated query result; the re-encapsulated query result is uploaded to the data query terminal. The disclosure can prevent data from being tampered with during transmission and improve the security of data by re-encapsulating the query result.

[0090] Figure 4 The flowchart of a data query method provided by the exemplary embodiment of the present disclosure is as follows. Figure 4 As shown, after receiving the API query request, the data set of this query is parsed, and the corresponding query strategy template is generated according to the query strategy configured in the data set definition. The query strategy template implements the specific query strategy, for example, directly connecting to a single data source; the query strategy template can be expanded as needed, and only a unified input and output interface needs to be implemented as required; in each query strategy template, according to the data source and data source table information actually defined in the data set instance, the data source access plug-in corresponding to the data source is called to access each data source. The data source access plug-in can be expanded as needed, and only a unified input and output interface needs to be implemented as required; after obtaining the query result from the data source, the query result is encapsulated using the data source access plug-in to obtain the encapsulated query result; the encapsulated query result is re-encapsulated using the query strategy instance to obtain the re-encapsulated query result; the re-encapsulated query result is returned to the unified API interface.

[0091] Figure 5 FIG. 5 is a schematic diagram of a data query device 50 provided by an exemplary embodiment of the present disclosure. Figure 5 As shown, the data query device 50 includes: a receiving module 51, a selecting module 52, a parsing module 53, a calling module 54 and an uploading module 55.

[0092] The receiving module 51 is used to receive a data query request sent by the data query terminal, wherein the data query request carries a query field and a target data scenario, and the target data scenario is a data scenario obtained by the data query terminal in response to a data scenario selection operation; the data query request is a request generated by the data query terminal in response to a data query operation;

[0093] The selection module 52 is used to select a target data set corresponding to the target data scenario according to the target data scenario; wherein the target data set includes: definition information and configuration information, the definition information includes: field, data type, whether to filter condition and filter operator, and the configuration information includes: query strategy, data source table, field mapping relationship and index;

[0094] The parsing module 53 is used to parse the target data set according to the query field to obtain the target query strategy, target data source and target data source table corresponding to the query field;

[0095] The calling module 54 is used to call the data source access plug-in corresponding to the target data source to access the target data source according to the target query strategy, the target data source and the target data source table to obtain the query result;

[0096] The uploading module 55 is used to upload the query results to the data query terminal so that the data query terminal can view the query results.

[0097] Optionally, when selecting a target data set corresponding to a target data scenario according to the target data scenario, the selection module 52 is configured to:

[0098] According to the target data scenario, the mapping relationship table between the data scenario and the data set is queried to obtain the target data set corresponding to the target data scenario; wherein the mapping relationship table between the data scenario and the data set is obtained by configuring the configuration terminal.

[0099] Optionally, a field, indicating the data structure format that can be obtained by the query request;

[0100] Data type, indicating the data type corresponding to each field;

[0101] Whether it is a filtering condition, indicating whether the field can be used as a filtering parameter for interface queries;

[0102] Filter operator, which indicates the specific filtering logic;

[0103] Query strategy, which indicates the specific query method; query strategies include: directly connecting to a single data source, connecting multiple data sources in parallel, and cascading multiple data sources;

[0104] Data source table, which represents any table or a SQL statement for a specific query;

[0105] The field mapping relationship indicates the correspondence between the data source field and the underlying data source value. It is a field in the data source table, or an aggregate function logic, or a SQL processing logic.

[0106] Index, which indicates some specific index information of querying data source table.

[0107] Optionally, when the parsing module 53 parses the target data set according to the query field to obtain the target query strategy, target data source and target data source table corresponding to the query field, it is used to:

[0108] According to the query field, query the mapping relationship table between the field in the configuration information on the target data set and the data source table to obtain the target field, aggregation function logic or SQL processing logic of the query target data source table;

[0109] According to the query field, query the configuration information table of the configuration information on the target data set to obtain the target data source table;

[0110] Determine the target data source according to the target data source table;

[0111] According to the query field, the configuration information table of the configuration information on the target data set is queried to determine the target query strategy.

[0112] Optionally, the calling module 54 calls the data source access plug-in corresponding to the target data source to access the target data source according to the target query strategy, the target data source and the target data source table to obtain the query result, and is used to:

[0113] According to the target query strategy, determine the target data source that needs to be called, and call the data source access plug-in corresponding to the target data source;

[0114] Using the data source access plug-in, access the target data source table to obtain query results;

[0115] According to the target query strategy, logical processing is performed on the query results.

[0116] Optionally, after the calling module 54 calls the data source access plug-in corresponding to the target data source to access the target data source according to the target query strategy, the target data source and the target data source table and obtains the query result, it can also be used to:

[0117] Use the data source access plug-in to encapsulate the query results to obtain the encapsulated query results;

[0118] Using the query strategy instance, the encapsulated query result is re-encapsulated to obtain the re-encapsulated query result;

[0119] The query results after secondary packaging are uploaded to the data query terminal.

[0120] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0121] Figure 6 FIG. 1 is a schematic diagram of a structure of an electronic device provided by an exemplary embodiment of the present disclosure. Figure 6 As shown, the electronic device includes: a memory 61 and a processor 62. In addition, the electronic device also includes a power supply component 63 and a communication component 64.

[0122] The memory 61 is used to store computer programs and can be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application program or method operating on the electronic device.

[0123] Memory 61 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0124] The communication component 64 is used for data transmission with other devices.

[0125] The processor 62 can execute the computer instructions stored in the memory 61 to:

[0126] receiving a data query request sent by a data query terminal, wherein the data query request carries a query field and a target data scenario, the target data scenario being a data scenario acquired by the data query terminal in response to a data scenario selection operation; and the data query request being a request generated by the data query terminal in response to a data query operation;

[0127] According to the target data scenario, a target data set corresponding to the target data scenario is selected; wherein the target data set includes: definition information and configuration information, the definition information includes: field, data type, whether to filter condition and filter operator, and the configuration information includes: query strategy, data source table, field mapping relationship and index;

[0128] According to the query field, the target data set is parsed to obtain the target query strategy, target data source and target data source table corresponding to the query field;

[0129] According to the target query strategy, target data source and target data source table, the data source access plug-in corresponding to the target data source is called to access the target data source to obtain the query result;

[0130] The query results are uploaded to the data query terminal so that the data query terminal can view the query results.

[0131] Optionally, when the processor 62 selects a target data set corresponding to the target data scenario according to the target data scenario, it is configured to:

[0132] According to the target data scenario, the mapping relationship table between the data scenario and the data set is queried to obtain the target data set corresponding to the target data scenario; wherein the mapping relationship table between the data scenario and the data set is obtained by configuring the configuration terminal.

[0133] Optionally, a field, indicating the data structure format that can be obtained by the query request;

[0134] Data type, indicating the data type corresponding to each field;

[0135] Whether it is a filtering condition, indicating whether the field can be used as a filtering parameter for interface queries;

[0136] Filter operator, which indicates the specific filtering logic;

[0137] Query strategy, which indicates the specific query method; query strategies include: directly connecting to a single data source, connecting multiple data sources in parallel, and cascading multiple data sources;

[0138] Data source table, which represents any table or a SQL statement for a specific query;

[0139] The field mapping relationship indicates the correspondence between the data source field and the underlying data source value. It is a field in the data source table, or an aggregate function logic, or a SQL processing logic.

[0140] Index, which indicates some specific index information of querying data source table.

[0141] Optionally, when the processor 62 parses the target data set according to the query field to obtain the target query strategy, target data source and target data source table corresponding to the query field, it is configured to:

[0142] According to the query field, query the mapping relationship table between the field in the configuration information on the target data set and the data source table to obtain the target field, aggregation function logic or SQL processing logic of the query target data source table;

[0143] According to the query field, query the configuration information table of the configuration information on the target data set to obtain the target data source table;

[0144] Determine the target data source according to the target data source table;

[0145] According to the query field, the configuration information table of the configuration information on the target data set is queried to determine the target query strategy.

[0146] Optionally, when the processor 62 calls the data source access plug-in corresponding to the target data source to access the target data source according to the target query strategy, the target data source and the target data source table to obtain the query result, it is used to:

[0147] According to the target query strategy, determine the target data source that needs to be called, and call the data source access plug-in corresponding to the target data source;

[0148] Using the data source access plug-in, access the target data source table to obtain query results;

[0149] According to the target query strategy, logical processing is performed on the query results.

[0150] Optionally, after the processor 62 calls the data source access plug-in corresponding to the target data source to access the target data source according to the target query strategy, the target data source and the target data source table, and obtains the query result, it can also be used to:

[0151] Use the data source access plug-in to encapsulate the query results to obtain the encapsulated query results;

[0152] Using the query strategy instance, the encapsulated query result is re-encapsulated to obtain the re-encapsulated query result;

[0153] The query results after secondary packaging are uploaded to the data query terminal.

[0154] Accordingly, the present disclosure also provides a computer-readable storage medium storing a computer program. When the computer-readable storage medium stores the computer program and the computer program is executed by one or more processors, the one or more processors execute Figure 6 Each step in the method embodiment.

[0155] Accordingly, the present disclosure also provides a computer program product, the computer program product includes a computer program / instruction, the computer program / instruction is executed by a processor Figure 6 Each step in the method embodiment.

[0156] Above Figure 6The communication component in is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0157] Above Figure 6 The power supply component in the device provides power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.

[0158] The electronic device also includes a display screen and an audio component.

[0159] The display screen includes a screen, and the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0160] The audio component may be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal may be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting an audio signal.

[0161] In the above method, device, electronic device, storage medium and computer program product embodiments of the present disclosure, a data query request issued by a data query terminal is received, wherein the data query request carries a query field and a target data scenario, and the target data scenario is a data scenario obtained by the data query terminal in response to a data scenario selection operation; the data query request is a request generated by the data query terminal in response to a data query operation; according to the target data scenario, a target data set corresponding to the target data scenario is selected; wherein the target data set includes: definition information and configuration information, the definition information includes: field, data type, whether to filter condition and filter operator, and the configuration information includes: query strategy The invention discloses a method for querying data by setting a unified API interface and implementing query methods for different data sources by calling the interface. The method also discloses a method for querying data by setting a unified API interface and implementing query methods for different data sources by calling the interface. The method also discloses a method for querying data by setting a unified API interface and implementing query methods for different data sources by calling the interface. The method also discloses a method for querying data by setting a unified API interface and implementing query methods for different data sources by calling the interface. The method also discloses a method for querying data by setting a unified API interface and implementing query methods for different data sources by calling the interface. The method also discloses a method for querying data by setting a unified API interface and implementing query methods for different data sources by calling the interface. The method also discloses a method for controlling data access by setting a unified API interface and implementing the method for controlling data access by using the interface. The method also improves the efficiency of data query and the efficiency of data access control.

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

[0163] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. 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 generate 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.

[0164] 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 including 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.

[0165] 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.

[0166] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0167] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0168] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0169] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0170] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data query method, characterized in that: include: Receiving a data query request sent by a data query terminal, wherein the data query request carries a query field and a target data scenario, the target data scenario is a data scenario acquired by the data query terminal in response to a data scenario selection operation; the data query request is a request generated by the data query terminal in response to a data query operation; According to the target data scenario, a target data set corresponding to the target data scenario is selected; wherein the target data set includes: definition information and configuration information, the definition information includes: field, data type, whether to filter condition and filter operator, and the configuration information includes: query strategy, data source table, field mapping relationship and index; According to the query field, the target data set is parsed to obtain a target query strategy, a target data source and a target data source table corresponding to the query field; According to the target query strategy, the target data source and the target data source table, a data source access plug-in corresponding to the target data source is called to access the target data source to obtain a query result; The query result is uploaded to the data query terminal so that the data query terminal can view the query result.

2. The method according to claim 1, characterized in that The selecting, according to the target data scenario, a target data set corresponding to the target data scenario includes: According to the target data scenario, a mapping relationship table between data scenarios and data sets is queried to obtain a target data set corresponding to the target data scenario; wherein the mapping relationship table between data scenarios and data sets is obtained by configuring a configuration terminal.

3. The method according to claim 1, characterized in that The field indicates the data structure format that can be obtained by the query request; The data type indicates the data type corresponding to each of the fields; The filtering condition indicates whether the field can be used as a filtering parameter for interface query; The filtering operator represents a specific filtering logic; The query strategy refers to a specific query method; the query strategy includes: directly connecting a single data source, connecting multiple data sources in parallel, and cascading multiple data sources; The data source table represents any table or a SQL statement for a specific query; The field mapping relationship represents the correspondence between the data source field and the underlying data source value, which is a field in the data source table, or an aggregate function logic, or a SQL processing logic; The index represents some specific index information for querying the data source table.

4. The method according to claim 1, characterized in that: The target data set is parsed according to the query field to obtain a target query strategy, a target data source and a target data source table corresponding to the query field, including: According to the query field, query the mapping relationship table between the field in the configuration information on the target data set and the data source table to obtain the target field, aggregation function logic or SQL processing logic of the query target data source table; According to the query field, query the configuration information table of the configuration information on the target data set to obtain the target data source table; Determine the target data source according to the target data source table; According to the query field, the configuration information table of the configuration information on the target data set is queried to determine the target query strategy.

5. The method according to claim 1, characterized in that The step of calling a data source access plug-in corresponding to the target data source to access the target data source according to the target query strategy, the target data source and the target data source table to obtain a query result includes: According to the target query strategy, determine the target data source that needs to be called, and call the data source access plug-in corresponding to the target data source; Using the data source access plug-in, access the target data source table to obtain query results; According to the target query strategy, logical processing is performed on the query results.

6. The method according to claim 1, characterized in that After the target query strategy, the target data source and the target data source table are accessed by calling a data source access plug-in corresponding to the target data source to access the target data source and obtain the query result, the method further includes: Encapsulating the query result using the data source access plug-in to obtain the encapsulated query result; Using the query strategy instance, re-encapsulating the encapsulated query result to obtain a re-encapsulated query result; The query result after the secondary packaging is uploaded to the data query terminal.

7. A data query device, characterized in that: include: A receiving module, configured to receive a data query request sent by a data query terminal, wherein the data query request carries a query field and a target data scenario, the target data scenario is a data scenario acquired by the data query terminal in response to a data scenario selection operation; the data query request is a request generated by the data query terminal in response to a data query operation; A selection module is used to select a target data set corresponding to the target data scenario according to the target data scenario; wherein the target data set includes: definition information and configuration information, the definition information includes: field, data type, whether to filter condition and filter operator, and the configuration information includes: query strategy, data source table, field mapping relationship and index; A parsing module, used to parse the target data set according to the query field to obtain a target query strategy, a target data source and a target data source table corresponding to the query field; A calling module, configured to call a data source access plug-in corresponding to the target data source to access the target data source and obtain a query result according to the target query strategy, the target data source and the target data source table; The uploading module is used to upload the query result to the data query terminal so that the data query terminal can view the query result.

8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute instructions to implement each step in the method according to any one of claims 1 to 6.

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

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