Data source query method and system, computer device and storage medium

By receiving and converting user operation commands through the driver abstraction layer interface, the problem of complex queries for various types of data sources is solved, achieving unified management and simplified queries for various types of data sources, and improving query efficiency and user-friendliness.

CN115357606BActive Publication Date: 2026-04-14HANGZHOU DBAPPSECURITY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU DBAPPSECURITY CO LTD
Filing Date
2022-08-01
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing technologies, with the expansion of data storage media, query methods for various types of data sources have become more complex. In particular, after the introduction of document storage based on search engines, data cannot be directly obtained through SQL queries, leading to management complexity.

Method used

This paper provides a data source query method that receives user operation instructions through the driver abstraction layer interface, converts them into operation statements of the target data source, loads the target driver object, establishes a connection, and realizes unified management and simplified querying of various types of data sources.

Benefits of technology

It achieves unified and simplified querying of various data sources, supports columnar storage and search engine-based document storage, lowers the technical threshold for data querying, and improves query efficiency and user-friendliness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115357606B_ABST
    Figure CN115357606B_ABST
Patent Text Reader

Abstract

The application relates to a data source query method, a system, computer equipment and a storage medium, wherein the data source query method comprises the following steps: receiving a first operation instruction input by a user, wherein the first operation instruction carries the type of a target data source and a first operation statement used for accessing the target data source; calling an execution method provided by a driver abstract layer, converting the first operation statement into a second operation statement corresponding to the type of the target data source according to the execution method; determining a driver object corresponding to the type of the target data source, loading the target driver object, creating a connection between a local data source and the target data source, and accessing the target data source according to the second operation statement. Through the application, the problem that a plurality of types of data source query methods are complex is solved, and the unification and simplification of the plurality of types of data source query methods are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of databases, and in particular to a data source query method, system, computer device, and storage medium. Background Technology

[0002] As the product's business continues to expand, the demand for business data storage is also increasing. To meet the storage and analysis requirements of big data, the storage medium has gradually expanded from the original single relational database to high-efficiency columnar storage and search engine-based document storage.

[0003] Currently, most multi-data source management methods on the market fall into two categories: the first supports storing multiple instances of the same type of data source, such as managing multiple MySQL data sources or multiple Oracle data sources; the second uses JDBC drivers to support the storage of multiple data sources, such as managing multiple MySQL and Oracle data source instances simultaneously using JDBC drivers. However, when existing products or projects introduce search engine-based document storage, such as data stored using the Elasticsearch search engine, users cannot directly retrieve the data stored in Elasticsearch through SQL queries, which complicates data source management. With the expansion of data storage media, the above two methods are no longer sufficient to meet the needs of existing products and projects.

[0004] There is currently no effective solution to the problem of complex query methods for various data sources in related technologies. Summary of the Invention

[0005] This embodiment provides a data source query method, system, computer device, and storage medium to solve the problem of complex query methods for various types of data sources in related technologies.

[0006] Firstly, this embodiment provides a data source query method, which receives a first operation instruction input by a user, wherein the first operation instruction carries the type of the target data source and a first operation statement for accessing the target data source; calls an execution method provided by a driver abstraction layer, and converts the first operation statement into a second operation statement corresponding to the type of the target data source according to the execution method; determines a driver object corresponding to the type of the target data source, and loads the target driver object to create a connection between the local device and the target data source, and accesses the target data source according to the second operation statement.

[0007] In some embodiments, an external driver abstraction layer interface is established; the driver abstraction layer is connected through the driver abstraction layer interface; and the first operation statement is converted into a second operation statement based on the language characteristics of the target data source.

[0008] In some embodiments, it is detected whether the first operation statement conforms to a preset rule; if the first operation statement does not conform to the preset rule, an error message corresponding to the first operation statement is output.

[0009] In some of these embodiments, the target data source is accessed according to the second operation statement, the access result is obtained, and the access result is visualized.

[0010] In some embodiments, the second operation statement is associated with a corresponding application programming interface (API), and the access result of the second operation statement is invoked through the API.

[0011] Secondly, this embodiment provides a data source query system. The data source storage system includes: an operation management layer, a data driver layer, and a data source layer, which are sequentially coupled. The data driver layer includes a driver abstraction layer and multiple driver objects, and the data source layer includes multiple data sources. The operation management layer receives a first operation instruction input by the user, calls an execution method provided by the driver abstraction layer, and determines a driver object corresponding to the type of the target data source. The first operation instruction carries the type of the target data source and a first operation statement for accessing the target data source. The data driver layer loads the target driver object to create a connection between the local machine and the target data source, and converts the first operation statement into a second operation statement corresponding to the type of the target data source, accessing the target data source according to the second operation statement. The driver abstraction layer is obtained by encapsulating multiple driver objects.

[0012] In some embodiments, the operation management layer includes a configuration module, a detection module, and a preview module; wherein the configuration module is used to provide an operation statement keyword library and an operation statement editing mode; the detection module is used to detect whether the first operation statement conforms to preset rules; and the preview module is used to access the target data source according to the second operation statement, obtain the access result, and visualize the access result.

[0013] In some embodiments, a data service layer is coupled to the operation management layer, which provides an application programming interface and caches access results obtained from local access to the target data source.

[0014] Thirdly, this embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the data source query method described in the first aspect.

[0015] Fourthly, this embodiment provides a storage medium storing a computer program that, when executed by a processor, implements the data source query method described in the first aspect.

[0016] Compared with related technologies, the data source query method provided in this embodiment receives a first operation instruction input by the user, wherein the first operation instruction carries the type of the target data source and a first operation statement for accessing the target data source; calls the execution method provided by the driver abstraction layer, and converts the first operation statement into a second operation statement corresponding to the type of the target data source according to the execution method; determines the driver object corresponding to the type of the target data source, and loads the target driver object to create a connection between the local and the target data source; and accesses the target data source according to the second operation statement. This solves the problem of complex query methods for multiple types of data sources in related technologies and realizes the unification and simplification of query methods for multiple types of data sources.

[0017] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0019] Figure 1 This is a hardware structure block diagram of a terminal for a data source query method according to an embodiment of this application;

[0020] Figure 2 This is a flowchart of a data source query method according to an embodiment of this application;

[0021] Figure 3 This is a flowchart of a method for querying various types of data sources according to an embodiment of this application;

[0022] Figure 4 This is a preferred flowchart of a multi-type data source query method according to an embodiment of this application;

[0023] Figure 5 This is a structural block diagram of a data source query system according to an embodiment of this application;

[0024] Figure 6 This is a preferred structural block diagram of a data source query system according to an embodiment of this application. Detailed Implementation

[0025] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0026] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.

[0027] In this application, the data source refers to the database or database server used by the database application.

[0028] Relational databases, also known as row-oriented databases, use a two-dimensional table structure to logically represent and implement data, strictly adhering to data format and length specifications. They are primarily used for storage and management. Common structured databases include MySQL, Oracle, and SQL Server. Column-oriented databases, also known as column-oriented storage, use column-based data storage. Common column-oriented storage solutions include ClickHouse.

[0029] API stands for Application Programming Interface, defined as a standard set of information and commands that an application can use to exchange with a computer's operating system; SQL stands for Structured Query Language, a database query and programming language used to access, query, update, and manage relational database systems; JDBC (Java Database Connectivity) is an application programming interface in the Java language that specifies how client programs access databases, providing methods such as querying and updating data in the database. MySQL, Oracle, SQL Server, and ClickHouse can all be considered JDBC-driven databases.

[0030] MySQL is a relational database management system developed by MySQL AB; Oracle is a high-performance relational database and data storage device developed by Oracle Corporation; SQL Server is a relational database developed and promoted by Microsoft; Elasticsearch is a search server developed in Java, providing a distributed, multi-user full-text search engine; ClickHouse is a columnar storage database for online analytical processing of queries, capable of generating analytical data reports in real time using SQL queries.

[0031] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. For example, it can run on a terminal. Figure 1 This is a hardware structure block diagram of a terminal for a data source query method according to an embodiment of this application. For example... Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA). The terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that… Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.

[0032] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the data source query method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0033] The transmission device 106 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0034] In one embodiment, reference Figure 5 The terminal is equipped with a data source query system. The data source storage system includes, in sequence, an operation management layer, a data driver layer, and a data source layer. The data driver layer includes a driver abstraction layer and multiple driver objects, and the data source layer includes multiple data sources. This embodiment provides a data source query method. Figure 2 This is a flowchart of the data source query method in this embodiment. Taking the application of this method to the data source query system as an example, the process includes the following steps:

[0035] Step S201: Receive a first operation instruction input by the user, wherein the first operation instruction carries the type of the target data source and a first operation statement for accessing the target data source.

[0036] The operation management layer sets up a user interface to receive the first operation command input by the user. The user interface can provide the function of writing or dragging and dropping syntax tags to receive the first operation command input by the user. The first operation statement includes a standard SQL statement.

[0037] Step S202: Invoke the execution method provided by the driver abstraction layer, and convert the first operation statement into a second operation statement corresponding to the type of the target data source according to the execution method.

[0038] Upon receiving the first operation instruction, the operation management layer sends the target data source type and the first operation statement to the driver abstraction layer. It then calls the execution method provided by the driver abstraction layer to obtain the language characteristics of the target data source. Based on these language characteristics, the first operation statement is converted into a second operation statement, ensuring that the second operation statement conforms to the language characteristics of the target data source. The language characteristics of the target data source refer to the extended characteristics exhibited by different types of data sources while adhering to the SQL standard specification. These include the syntax and keywords corresponding to the operation statements of the target data source. Different types of data sources include, but are not limited to, MySQL, Oracle, and SQL Server databases.

[0039] The driver abstraction layer is obtained by encapsulating multiple driver objects. Based on these driver objects, an abstract standard is established, which enables unified scheduling of various types of data sources, thereby creating connections between the local and target data sources. Secondly, the driver abstraction layer creates execution methods based on the language characteristics of different types of data sources, converting the first operation statement into a second operation statement that can access the target data source.

[0040] Step S203: Determine the driver object corresponding to the type of the target data source, load the target driver object to create a connection between the local machine and the target data source, and access the target data source according to the second operation statement.

[0041] The data source is stored in a distributed manner across multiple devices. In this embodiment, based on the target data source type carried in the first operation instruction, the driver abstraction layer can automatically load the target driver object, call the target driver object to create a connection between the target data source in the local device and other devices, and execute the second operation statement to query the information required by the user in the target data source.

[0042] In the steps described above, by abstracting and encapsulating driver objects for various data sources, a generalized and standard driver abstraction layer is provided to users, offering a unified SQL query entry point. Based on the language characteristics of various data sources, the driver abstraction layer converts the user-inputted standard SQL statement into a statement corresponding to the target data source, and calls the target driver object corresponding to the target data source to establish a connection between the local and target data sources. This lowers the technical barrier to data querying and improves query efficiency and user-friendliness. This data source query method supports queries for both columnar storage and search engine-based document storage. It can access the target data source based on the user-inputted standard SQL statement and database type, thereby helping users achieve standardized and unified management of various data sources and solving the problem of complex query methods for multiple data sources. Furthermore, when a new type of data source is added to the system, only the driver layer code needs to be implemented to ensure compatibility with the newly added data source.

[0043] In some embodiments, after receiving a first operation instruction input by the user, the method further includes: detecting whether the first operation statement conforms to a preset rule; and if the first operation statement does not conform to the preset rule, outputting an error message corresponding to the first operation statement.

[0044] In the SQL visual window, users enter their first operation statement by writing or dragging and dropping syntax tags. During this process, the SQL visual window retrieves storage information from the target data source based on a keyword library and provides real-time suggestions to the user as they enter the first operation statement. This ensures that the scope of the operation in the user's standard SQL statement does not exceed the storage range of the data in the target data source, improving the accuracy of the user's first operation statement.

[0045] The keyword library includes data source type (getDatabaseType), data source connection configuration information (getConfig), probe library information corresponding to the data source (probeSchemas), all table information obtained based on a certain probe library (probeTables), and table data information obtained based on a certain table and pagination conditions (probeDatas).

[0046] After the user completes the input of the first operation statement, it is checked whether the first operation statement conforms to preset rules. The preset rules include the syntax of the first operation statement, as well as the types and number of parameters in the first operation statement. If there is an error in the syntax or parameters of the first operation statement, the user is given the correct prompt.

[0047] In some embodiments, the method for receiving a first operation instruction input by a user includes accessing a target data source according to a second operation statement, obtaining the access result, and visually displaying the access result.

[0048] The system receives the first operation command input by the user, converts it according to the target data source type to obtain the second operation statement, calls the target driver object, accesses the target data source, executes the second operation statement to obtain the data query result, and returns the query result to the SQL visualization window. The display of the query result can be freely switched between table mode and JSON structure mode.

[0049] In some embodiments, after accessing the data source according to the second operation statement, the method further includes: associating the second operation statement with the corresponding application interface, and calling the access result of the second operation statement through the application interface.

[0050] An application programming interface (API) is created, and its access permissions and connection path are set. Based on the connection path, a second operation statement is associated with the corresponding API. The access result of the second operation statement is then invoked through the API, and the access result is provided to BI (Business Intelligence), large screens, or other business systems. The following describes and illustrates this embodiment through a preferred embodiment.

[0051] Figure 3 This is a flowchart of a method for querying multiple types of data sources according to an embodiment of this application.

[0052] Step S301, Configure the data source: Select the data source category to be connected from the existing supported data source types (MySQL, Oracle, SQL Server, Clickhouse, Elasticsearch), and load different data source configuration information according to different data source categories.

[0053] Step S302, Visual Configuration of SQL Statements: In the SQL visualization window, standard SQL statements are entered by writing and dragging syntax tags to perform SQL testing. During the SQL test, a unified driver interface is used to connect to the driver abstraction layer. The corresponding data driver is automatically loaded according to the data source category, a connection is established between the local machine and the data source, and the standard SQL statement is converted into the language characteristics of the target data source to obtain the query results. Here, language characteristics refer to the extended features that MySQL, Oracle, and SQL Server databases have while adhering to the SQL standard specification; these extended features are called language characteristics. The query results are returned to the SQL visualization window for display. The display results can be freely switched between table mode and JSON structure mode.

[0054] Step S303: Configure the API interface, including creating the API interface, setting API parameters and grouping the APIs according to the business system type of the data source being called, assigning access permissions and data isolation permissions to the API interface, and associating the API interface with the SQL statement to be executed, so that the BI system, dashboard, and business system can call the data source query results in step S302 through the API interface.

[0055] Figure 4 This is a preferred flowchart of a preferred embodiment of a method for querying various types of data sources according to this application, such as... Figure 4 As shown, this multi-source data source query method includes the following steps:

[0056] Step S401: Enter the SQL visualization window, configure SQL, and select the data source category to be connected from the existing supported data source types (MySQL, Oracle, SQL Server, ClickHouse, Elasticsearch) based on the user's input. If the existing data source support types do not meet the user's needs, the user needs to implement the driver layer code separately to configure the connection of the new data source.

[0057] Step S402: In the SQL visualization window, the system receives standard SQL statements entered by the user through writing and dragging syntax tags. During the writing process, the system provides user-friendly prompts regarding data source storage information in real time, based on the standard SQL keyword library, to improve the accuracy of the user's SQL statements. The standard SQL keyword library includes various data source types (getDatabaseType), data source connection configuration information (getConfig), probe database information corresponding to the data source (probeSchemas), information on all tables obtained based on a specific probe database (probeTables), and table data information obtained based on a specific table and pagination conditions (probeDatas).

[0058] Step S403: Automatically detect whether there are any syntax errors in the standard SQL statement entered by the user according to the standard SQL specification. If there are syntax errors in the standard SQL statement, the error message in the standard SQL statement will be displayed to the user.

[0059] In step S404, upon receiving the instruction to execute and analyze the SQL statement, the user-inputted standard SQL statement is pre-executed to obtain the preprocessing status of the standard SQL statement, allowing the user to check whether the parameters of the input standard SQL statement are correct.

[0060] In step S405, upon receiving an instruction to test the SQL statement, the preview function is executed. In the preview function, the user-inputted simulated parameter values ​​are received, and the user-inputted standard SQL statement is run. The abstract driver layer automatically loads the corresponding data driver according to the data source category, establishes a connection between the local machine and the data source, converts the standard SQL statement into the language characteristics of the target data source, executes the converted SQL statement to obtain the query results, and caches the query results locally. The query results are then returned to the SQL visualization window for display, where the display can be freely switched between table mode and JSON structure mode.

[0061] Step S406: Configure caching. The initial cache duration is set to 30 seconds. If a user accesses the same target data source with the same standard SQL statement within 30 seconds, the data is directly retrieved from the cache and returned to the user, reducing database connection time, hardware resource consumption, and network overhead. If the time interval between the next access and the previous access exceeds 30 seconds, a new connection between the local machine and the target data source will be created, and the user's second input standard SQL statement will be executed. The system receives the user's input cache duration and modifies the initial cache settings accordingly. If no cache duration is input, the initial cache settings are maintained.

[0062] Step S407: Create an API interface, set API parameters according to the business system type of the data source being called, and group the APIs.

[0063] Step S408: Assign access permissions and data isolation permissions to the API interface, and associate the API interface with the SQL statement to be executed.

[0064] Step S409: If a user's instruction to call the test results is received, the driver object of the target data source is loaded through the abstract driver layer, a connection between the local machine and the data source is created, the standard SQL statement is converted into the language characteristics of the target data source, the converted SQL statement is executed to obtain the test results, and the test results are displayed in the BI system, large screen or other business system through the API interface.

[0065] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0066] This embodiment also provides a data source query system for implementing the above embodiments and preferred embodiments; details already described will not be repeated. The terms "module," "unit," "subunit," etc., used below refer to combinations of software and / or hardware that perform a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0067] Figure 5 This is a structural block diagram of the data source query system in this embodiment, as follows: Figure 5 As shown, the system includes: an operation management layer, a data-driven layer, and a data layer, which are sequentially coupled to each other.

[0068] The operation management layer is used to receive the first operation instruction input by the user, call the execution method provided by the driver abstraction layer, and determine the driver object corresponding to the type of the target data source. The first operation instruction carries the type of the target data source and the first operation statement for accessing the target data source.

[0069] The data-driven layer includes a driver abstraction layer and multiple driver objects. The driver abstraction layer is used to load target driver objects to create a connection between the local and target data sources, and to convert a first operation statement into a second operation statement corresponding to the type of the target data source. The target data source is then accessed based on the second operation statement. The driver abstraction layer is obtained by encapsulating multiple driver objects.

[0070] The data source layer includes multiple data sources.

[0071] Figure 6 This is a preferred structural block diagram of a data source query system according to an embodiment of this application, such as... Figure 6 As shown, the data service layer, operation management layer, data driver layer, and data source layer are sequentially coupled in this system.

[0072] The data service layer provides API interface group management, permission management, API exposure, API testing, and cache management functions. The cache management function is used to cache the data query results obtained by users accessing the target data source to the local machine.

[0073] The operation management layer includes a configuration module, a detection module, and a preview module.

[0074] The configuration module includes a visual SQL configuration function, providing a visual user interface for editing standard SQL statements, as well as a keyword library for analyzing user-inputted standard SQL statements. The configuration module receives a first operation command from the user, which carries the type of the target data source and a first operation statement for accessing the target data source.

[0075] The detection module includes SQL detection, SQL analysis, and SQL pre-execution functions, used to detect whether the first operation statement conforms to preset rules. Specifically, the SQL detection function checks whether the syntax of the first operation statement conforms to preset rules; the SQL analysis function analyzes whether the number and type of input parameters in the first operation statement are correct; and the SQL pre-execution function calls the execution method provided by the driver abstraction layer to convert the first operation statement into a second operation statement for the target data source.

[0076] The preview module includes SQL testing functionality, which is used to access the target data source based on the second operation statement, obtain the access results, and visualize the access results.

[0077] The data-driven layer includes a driver abstraction and driver objects corresponding to various types of data sources. The driver abstraction is obtained by encapsulating multiple driver objects. It is used to load the target driver object to create a connection between the local machine and the target data source, and to translate the first operation statement into a second operation statement corresponding to the type of the target data source, accessing the target data source based on the second operation statement. Driver objects include MySQL drivers, Oracle drivers, SQL Server drivers, ClickHouse drivers, and Elasticsearch drivers.

[0078] The data source layer includes multiple data sources, including MySQL, Oracle, SQL Server, ClickHouse, and Elasticsearch.

[0079] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0080] This embodiment also provides a computer device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0081] Optionally, the computer device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0082] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0083] S1 receives a first operation instruction input by the user, wherein the first operation instruction carries the type of the target data source and a first operation statement for accessing the target data source.

[0084] S2, check whether the first operation statement conforms to the preset rules; if the first operation statement does not conform to the preset rules, output the error message corresponding to the first operation statement.

[0085] S3: Access the target data source according to the second operation statement, obtain the access result, and visualize the access result.

[0086] S4 calls the execution method provided by the driver abstraction layer, and converts the first operation statement into a second operation statement corresponding to the type of the target data source according to the execution method.

[0087] S5, determine the driver object corresponding to the type of the target data source, load the target driver object to create a connection between the local machine and the target data source, and access the target data source according to the second operation statement.

[0088] S6, associate the second operation statement with the corresponding application interface, and call the access result of the second operation statement through the application interface.

[0089] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.

[0090] Furthermore, in conjunction with the data source query methods provided in the above embodiments, this embodiment can also provide a storage medium for implementation. This storage medium stores a computer program; when executed by a processor, this computer program implements any of the data source query methods described in the above embodiments.

[0091] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0092] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.

[0093] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0094] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A data source query method, characterized in that, include: Receive a first operation instruction input by the user, wherein the first operation instruction carries the type of the target data source and a first operation statement for accessing the target data source; The execution method provided by the driver abstraction layer is invoked, and the first operation statement is converted into a second operation statement corresponding to the type of the target data source according to the execution method; the driver abstraction layer is obtained by encapsulating multiple driver objects; Determine the driver object corresponding to the type of the target data source, and load the target driver object through the driver abstraction layer to create a connection between the local machine and the target data source, and access the target data source according to the second operation statement; Invoking the execution method provided by the driver abstraction layer, and converting the first operation statement into a second operation statement corresponding to the type of the target data source according to the execution method, including: Establish an external interface for the driver abstraction layer; Connect to the driver abstraction layer through the driver abstraction layer interface; Call the execution method provided by the driver abstraction layer to obtain the language characteristics of the target data source; Based on the language characteristics of the target data source, the first operation statement is converted into a second operation statement of the type of the target data source through the driver abstraction layer.

2. The data source query method according to claim 1, characterized in that, After receiving the first operation instruction input by the user, the method further includes: Detect whether the first operation statement conforms to preset rules; If the first operation statement is detected to be inconsistent with the preset rule, an error message corresponding to the first operation statement is output.

3. The data source query method according to claim 1, characterized in that, After receiving the user's input operation command, the method further includes: Access the target data source according to the second operation statement, obtain the access result, and visualize the access result.

4. The data source query method according to claim 1, characterized in that, After accessing the data source according to the second operation statement, the method further includes: Associate the second operation statement with the corresponding application interface, and call the access result of the second operation statement through the application interface.

5. A data source query system, characterized in that, The data source query system comprises: an operation management layer, a data-driven layer, and a data source layer, sequentially coupled together. The data-driven layer includes a driver abstraction layer and multiple driver objects, and the data source layer includes multiple data sources. The operation management layer is used to receive a first operation instruction input by the user, call the execution method provided by the driver abstraction layer, and determine the driver object corresponding to the type of the target data source. The first operation instruction carries the type of the target data source and a first operation statement for accessing the target data source. The data-driven layer is used to load target driver objects to create a connection between the local machine and the target data source, and to convert the first operation statement into a second operation statement corresponding to the type of the target data source, and to access the target data source according to the second operation statement. The driver abstraction layer is obtained by encapsulating multiple driver objects. Call the execution methods provided by the driver abstraction layer, including: Establish an external interface for the driver abstraction layer; Connect to the driver abstraction layer through the driver abstraction layer interface; Call the execution method provided by the driver abstraction layer to obtain the language characteristics of the target data source; Based on the language characteristics of the target data source, the first operation statement is converted into the second operation statement.

6. The data source query system according to claim 5, characterized in that, The operation management layer includes: a configuration module, a detection module, and a preview module; wherein... The configuration module is used to provide a keyword library for operation statements and an operation statement editing mode; The detection module is used to detect whether the first operation statement conforms to preset rules; The preview module is used to access the target data source according to the second operation statement, obtain the access result, and visualize the access result.

7. The data source query system according to claim 6, characterized in that, Also includes: A data service layer, coupled to the operation management layer, is used to provide application programming interfaces and cache access results obtained from local access to the target data source.

8. A computer device, comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the data source query method according to any one of claims 1 to 4.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the data source query method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Data query method and device

    CN106649630A