Data query methods, data query devices, and computer program products

By receiving query descriptions and processing query fields using multiple components, query statements across data sources are generated, solving the customization and local storage problems of traditional data query methods and achieving flexible and efficient data querying.

CN116635848BActive Publication Date: 2026-04-17BOE TECHNOLOGY GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BOE TECHNOLOGY GROUP CO LTD
Filing Date
2021-12-20
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Traditional data query methods require customized development, lack flexibility, and rely on local storage, making the process cumbersome.

Method used

This provides a data query method that receives a query description and uses multiple components to process the query fields, generating query statements across data sources. It supports different data source formats and types, dynamically generates query statements, and decouples the data description from the query engine.

Benefits of technology

It implements custom query rules, supports querying and analysis from multiple data sources, improves the flexibility and efficiency of data querying, and reduces data redundancy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116635848B_ABST
    Figure CN116635848B_ABST
Patent Text Reader

Abstract

A data query method is provided. The data query method includes: receiving a query description; processing the query description by a processor using one or more components; and determining a query statement; wherein processing the query description includes: obtaining query fields from the query description; processing the query fields using the one or more components; and determining a first sub-statement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to display technology, and more particularly to a data query method, a data query device, and a computer program product. Background Technology

[0002] Traditional data querying methods require the development of software tailored to specific client needs, each requiring a lengthy development period. These methods also lack flexibility in allowing users to define rules. Furthermore, some traditional methods require local data storage, making the querying process quite cumbersome. Summary of the Invention

[0003] On one hand, this disclosure provides a data query method, including: receiving a query description; processing the query description by a processor using one or more components; and determining a query statement; wherein processing the query description includes: obtaining query fields from the query description; processing the query fields using the one or more components; and determining a first sub-statement.

[0004] Optionally, processing the query description includes: determining whether the query field includes an aggregate query field; and processing the aggregate query field using a first component; wherein the first component is configured to provide implementations for aggregate functions of the same type, the aggregate functions being defined differently by different data sources.

[0005] Optionally, processing the query description includes: determining whether the query field includes a time data query field; and processing the time data query field using a second component; wherein the second component is configured to provide implementations for time data of different formats or types from different data sources.

[0006] Optionally, processing the query description includes: determining whether the query field includes a time data query field; processing the time data query field using a second component; determining whether the query field includes an aggregate query field; and after processing the time data query field using the second component, processing the aggregate query field using a first component; wherein the first component is configured to provide implementations for aggregate functions of the same type, the aggregate functions being defined differently by different data sources; and the second component is configured to provide implementations for time data of different formats or types from different data sources.

[0007] Optionally, processing the query description further includes: obtaining a filter type field from the query description; processing the filter type field using one or more components; and determining a second sub-statement.

[0008] Optionally, processing the filter type field includes at least one of the following: using a third component to process the filter type field to generate a first filter sub-statement configured to filter character type fields; using a fourth component to process the filter type field to generate a second filter sub-statement configured to filter numeric type fields; or using a fifth component to process the filter type field to generate a third filter sub-statement configured to filter date data type fields; wherein the second sub-statement includes at least one of the first filter sub-statement, the second filter sub-statement, or the third filter sub-statement.

[0009] Optionally, the data query method further includes: obtaining filter condition fields from the query description; or obtaining the data source type from the query description.

[0010] Optionally, the data query method further includes: obtaining a classification field from the query description; and determining a third sub-statement.

[0011] Optionally, the data query method further includes: obtaining a sequence field from the query description; and determining a fourth sub-statement.

[0012] Optionally, determining the query statement includes joining multiple substatements, including the first substatement, into the query statement.

[0013] Optionally, the data query method further includes: loading the query statement into a query engine; and querying the data source by the query engine to obtain query results.

[0014] Optionally, the data query method further includes: determining whether the query engine supports the data source; determining whether querying the data source includes multi-table queries; when it is determined that querying the data source includes multi-table queries, splitting the multi-table queries into multiple single-table queries; and compiling query results from the multiple single-table queries.

[0015] Optionally, the data query method further includes: loading the interface of the corresponding component among the one or more components into a memory; and obtaining the corresponding implementation of the corresponding component from the interface of the corresponding component.

[0016] Optionally, the data query method further includes: determining the query description; wherein determining the query description includes: defining at least one of the query field, filter type field, filter condition field, and sequence field.

[0017] Optionally, the data query method further includes: defining the one or more components; wherein, a corresponding component among the one or more components is defined to include multiple interfaces compatible with different data sources; the corresponding component is configured to provide implementations for data of different formats or types in the different data sources.

[0018] Optionally, the one or more components include at least one user-defined component.

[0019] Optionally, the query engine is the Presto query engine.

[0020] Optionally, the query statement is an SQL statement.

[0021] On the other hand, this disclosure provides a data query apparatus, comprising: a memory; one or more processors; wherein the memory and the one or more processors are connected to each other; and the memory stores computer-executable instructions for controlling the one or more processors to perform the following operations: receiving a query description; processing the query description using one or more components; and determining a query statement; wherein the one or more processors are configured to: obtain a query field from the query description; process the query field using the one or more components; and determine a first substatement.

[0022] On the other hand, this disclosure provides a computer program product including a non-transitory tangible computer-readable medium having computer-readable instructions thereon, the computer-readable instructions being executable by a processor to cause the processor to perform the following operations: receiving a query description; processing the query description using one or more components; and determining a query statement; wherein processing the query description includes: obtaining a query field from the query description; processing the query field using the one or more components; and determining a first substatement. Attached Figure Description

[0023] The following figures are merely illustrative examples based on various disclosed embodiments and are not intended to limit the scope of the invention.

[0024] Figure 1 This is a flowchart illustrating a data query method according to some embodiments of the present disclosure.

[0025] Figure 2A This is a flowchart illustrating a data query method according to some embodiments of the present disclosure.

[0026] Figure 2B This is a flowchart illustrating a data query method according to some embodiments of the present disclosure.

[0027] Figure 3This is a flowchart illustrating a data query method according to some embodiments of the present disclosure.

[0028] Figure 4 This is a flowchart illustrating a data query method according to some embodiments of the present disclosure.

[0029] Figure 5 This is a schematic diagram illustrating a data query apparatus according to some embodiments of the present disclosure. Detailed Implementation

[0030] This disclosure will now be described in more detail with reference to the following embodiments. It should be noted that the following description of some embodiments presented herein is for illustrative and descriptive purposes only. It is not exhaustive or limited to the precise forms disclosed.

[0031] This disclosure provides, in particular, a data query method, a data query apparatus, and a computer program product that substantially eliminates one or more problems caused by the limitations and disadvantages of the prior art. In one aspect, this disclosure provides a data query method. In some embodiments, the data query method includes: receiving a query description; processing the query description by a processor using one or more components; and determining a query statement. Optionally, processing the query description includes: obtaining query fields from the query description; processing the query fields using the one or more components; and determining a first sub-statement. The data query method of this invention allows users to customize query rules and supports various data sources in different formats, enabling querying and analysis of data across data sources.

[0032] Figure 1 This is a flowchart illustrating a data query method according to some embodiments of the present disclosure. Figure 2A This is a flowchart illustrating a data query method according to some embodiments of the present disclosure. (Refer to...) Figure 1 and Figure 2A In some embodiments, the data query method includes: receiving a query description; processing the query description by a processor using one or more components; and determining a query statement. In some embodiments, the query description may be submitted by a user in a front-end application, for example, through a user interface. In one example, based on different data source types, dynamic query conditions such as query descriptions received at the front end are interpreted into corresponding query information to generate a query statement. The query statement is then transmitted to a query engine to execute the data query.

[0033] In some embodiments, the query description includes one or more fields for interpretation by one or more components. Examples of fields in the query description include query fields, filter type fields, category fields, and order fields. In one example, the data query method performs queries and analyses on vehicles. An example of a query field could be "vehicle type". An example of a filter type field could be "small car". Filter type fields are used to filter data. Examples of category fields could be "passenger vehicle" or "truck". An example of an order field could be "ASC", which indicates ascending order.

[0034] As used herein, the term "component" refers to a computer-related entity, such as a process running on a processor. In this data query method, one or more components include at least one user-defined component. The term "user-defined" means, for example, that one or more aspects can be specified by the user before or during runtime. One or more aspects that can be user-defined include, for example, time data types, time data formats, aggregate function parameters, aggregate function names, character type field filters, numeric type field filters, and date data type field filters.

[0035] This approach enables data querying and analysis across multiple data sources. Different data sources can have different data description formats, while the query engine uses query statements (e.g., SQL statements) that are compatible with the data description format of one data source but incompatible with the data description format of another. To decouple the data description from the query engine's query statements, this approach introduces at least one user-defined component configured to process data descriptions from different data sources into a unified query statement, thereby enabling the dynamic generation of query statements.

[0036] Various suitable user-defined components can be implemented in the data query method of this invention. Components can be defined according to the type of data source. In some embodiments, the user-defined component may include a time data component, which is configured to provide implementations for time data of different formats or types from different data sources. For example, the time data component may be configured to convert various time data formats into a unified format. In one example, different data sources may use different time data formats such as year, month, week, day, hour, minute, or second; the time data component is configured to convert the different formats into a unified format. In another example, the time data component may be configured to convert various time data types (e.g., timestamp data or string data) into a unified type.

[0037] In some embodiments, a user-defined component may include an aggregation component configured to provide implementations of aggregate functions of the same type, wherein the aggregate functions are defined differently by different data sources. In one example, different data sources may use different aggregate function names and / or aggregate function parameters for the same aggregate function. The user-defined aggregation component enables the implementation of aggregate functions of the same type.

[0038] In some embodiments, a user-defined component may include a filter component configured to provide an implementation for a filter type field. In one example, the user-defined component may include a character filter component configured to process the filter type field to generate a filter substatement configured to filter the character type field. Implementations provided by the character filter component in some embodiments enable fuzzy matching and / or enumeration during data querying. In another example, the user-defined component may include a numeric filter component configured to process the filter type field to generate a filter substatement configured to filter the numeric type field. In yet another example, the user-defined component may include a date data filter component configured to process the filter type field to generate a filter substatement configured to filter the date data type field.

[0039] Reference Figure 2A In some embodiments, the steps of processing a query description include: obtaining a query field from the query description; processing the query field using the one or more components; and determining a first substatement. In some embodiments, the steps of processing a query description include: determining whether the query field includes an aggregate query field. When it is determined that the query field includes an aggregate query field, the method further includes: processing the aggregate query field using a first component. The first component is configured to provide implementations of aggregate functions of the same type, wherein the aggregate functions are defined differently by different data sources. As used herein, the term "aggregate function" refers to a query that may contain a function that returns an aggregate value rather than individual records. Examples of aggregate functions include, but are not limited to, AVG (average), SUM (summation), MAX (maximum), RMS (root mean square), etc.

[0040] In some embodiments, the step of processing the query description includes: determining whether a query field includes a time data query field; and processing the time data query field using a second component. The second component is configured to provide implementations of time data in different formats or types from different data sources. When it is determined that the query field includes a time data query field, the method further includes processing the time data query field using the second component. The second component is configured to provide implementations for time data in different formats or types from different data sources.

[0041] Reference Figure 2AIn some embodiments, the steps of processing the query description further include: obtaining a filter type field from the query description; processing the filter type field using one or more components; and determining a second substatement. Examples of filter type fields include character type fields (filtered by character), numeric type fields (filtered by numeric), and date data type fields (filtered by date). As described above, user-defined components may include character filter components, numeric filter components, or date data filter components. Therefore, in some embodiments, the steps of processing the filter type field include at least one of the following steps: processing the filter type field using a third component to generate a first filter substatement configured to filter character type fields; processing the filter type field using a fourth component to generate a second filter substatement configured to filter numeric type fields; or processing the filter type field using a fifth component to generate a third filter substatement configured to filter date data type fields. The second substatement includes at least one of the first filter substatement, the second filter substatement, or the third filter substatement.

[0042] In some embodiments, the data query method further includes obtaining a filter condition field from the query description. One example of a filter condition is filtering by a single condition. Another example of a filter condition is filtering by multiple conditions. Furthermore, values ​​such as "contains" or "excludes" can be assigned to filter conditions. In one example, the filter condition filters by containing a single condition. In another example, the filter condition filters by excluding a single condition. In one example, the filter condition filters by containing multiple conditions. In another example, the filter condition filters by excluding multiple conditions. In yet another example, the filter condition filters by containing one or more conditions and excluding one or more conditions.

[0043] In some embodiments, the data query method further includes obtaining the data source type from the query description.

[0044] Reference Figure 2A In some embodiments, the steps of processing the query description further include: obtaining a classification field from the query description; and determining a third sub-statement. In one example, the query results can be classified according to the classification field. As described above, in one example, the classification field may include "passenger vehicle" or "freight vehicle". Query results obtained using the query field "vehicle type" can be classified as either "passenger vehicle" or "freight vehicle".

[0045] Reference Figure 2A In some embodiments, the steps of processing the query description further include: obtaining a sequence field from the query description; and determining a fourth sub-statement. Examples of sequence fields include ascending and descending order. Query results can be sorted according to the sequence field.

[0046] Reference Figure 2A In some embodiments, the data query method further includes concatenating multiple sub-statements, including a first sub-statement, into a query statement. In one example, the method includes concatenating a first sub-statement, a second sub-statement, a third sub-statement, and a fourth sub-statement into a query statement.

[0047] In one example, the query field could be "average monthly sales". Table 1 shows an example of a data source containing information about a company's sales.

[0048] Table 1

[0049] company Sales revenue (in billions) month A 100 January B 90 January C 80 January D 70 January A 80 February B 70 February C 60 February D 50 February

[0050] As described above, the data query method in some embodiments includes: processing query fields using one or more components; and determining a first sub-statement. An example of the first sub-statement is "SELECT: Company, Average Monthly Sales in January and February".

[0051] As described above, the data query method in some embodiments includes: processing filter-type fields using one or more components; and determining a second sub-statement. An example of a second sub-statement is "where: companies in (A, B, C, D) and months in (January and February)".

[0052] As described above, the data query method in some embodiments includes: obtaining a category field from the query description; and determining a third sub-statement. An example of a third sub-statement is "group: company".

[0053] As described above, the data query method in some embodiments includes: obtaining a sequence field from the query description; and determining a fourth sub-statement. An example of the fourth sub-statement is "Sequence: Average Monthly Sales".

[0054] An example query is: "SELECT: Companies, Average Monthly Sales in January and February; WHERE: Companies in (A, B, C, D) and Months in (January and February); GROUP: Companies; ORDER BY: Average Monthly Sales." The query can be generated by concatenating the first, second, third, and fourth sub-statements.

[0055] An example of the query results is shown in Table 2:

[0056] Table 2

[0057] company Average monthly sales (January and February) (billion) A 90 B 80 C 70 D 60

[0058] In one example described in Table 1, the query field could be "monthly average sales". The query fields include an aggregate query field (average) and a time-based query field (monthly). Figure 2BThis is a flowchart illustrating a data query method according to some embodiments of the present disclosure. (Refer to...) Figure 2B In some embodiments, the steps of processing the query description include: determining whether the query field includes a time data query field; if the query field is determined to include a time data query field, processing the time data query field using a second component; determining whether the query field includes an aggregate query field; and after processing the time data query field and if the query field is determined to include an aggregate query field, aggregating the query field using a first component. The second component is configured to provide implementations for different formats or types of time data from different data sources, and the first component is configured to provide implementations for the same type of aggregation function, wherein the aggregation function is defined differently by the different data sources.

[0059] As described above, in some embodiments, processing the filter type field includes at least one of the following: using a third component to process the filter type field to generate a first filter sub-statement configured to filter character type fields; using a fourth component to process the filter type field to generate a second filter sub-statement configured to filter numeric type fields; or using a fifth component to process the filter type field to generate a third filter sub-statement configured to filter date data type fields; wherein the second sub-statement includes at least one of the first filter sub-statement, the second filter sub-statement, or the third filter sub-statement. An example of the second sub-statement is "Where: companies in (A, B, C, D) and months in (January and February) have average monthly sales > 60 billion." An example of the first filter sub-statement is "Companies in (A, B, C, D)." An example of the third filter sub-statement is "Months in (January and February)." An example of the second filter sub-statement is "Average monthly sales > 60 billion."

[0060] When generating a query statement, the query can be executed. In some embodiments, the data query method further includes: loading the query statement into a query engine; and querying the data source by the query engine to obtain query results. Because this method uses a user-defined component configured to process data descriptions from different data sources into a unified query statement to decouple the data description from the query engine's query statement, various suitable query engines can be used in this data query method. Examples of query engines include... Apache And so on. In one example, the query engine is a distributed query engine, such as a distributed SQL query engine. Such as... Distributed SQL query engines, for example, do not require data storage. It supports multiple connectors and allows querying corresponding databases (e.g., MySQL, PostgreSQL, MongoDB, and Elasticsearch) through these connectors. Furthermore, Allows users to develop additional connectors for attaching databases. The query engine includes a coordinator configured to perform query parsing and job scheduling, and one or more workers configured to perform query execution and computation.

[0061] Depending on the chosen query engine, the query statement can be of various appropriate types. In one example, the query statement is an SQL statement such as a MySQL statement, PostgreSQL statement, Oracle statement, InfluxDB statement, IOTDB statement, or Cassandra statement. In another example, the query statement is a non-SQL statement such as a MongoDB statement or an Elasticsearch statement.

[0062] Figure 3 This is a flowchart illustrating a data query method according to some embodiments of the present disclosure. (Refer to...) Figure 3 In some embodiments, the data query method further includes: determining whether a query engine supports the data source. When it is determined that the query engine supports the data source, the method further includes: querying the data source by the query engine to obtain query results. When it is determined that the query engine does not support the data source, the method further includes: determining whether querying the data source involves a multi-table query, for example, a query involving an aggregate function in which multiple input values ​​(e.g., from multiple tables respectively) are combined to form a single summary value. When it is determined that querying the data source involves a multi-table query, the data query method further includes: splitting the multi-table query into multiple single-table queries; and, for example, compiling query results from the multiple single-table queries based on join relationships between the multiple tables.

[0063] When multi-table queries are involved, the query description contains information about the multiple tables. For example, this information might include identifiers of the tables linked by the multi-table query, the method used to join the tables, and the fields to be retained after the join. In a specific example, the identifiers of the multiple tables might be ID 100 and ID 200, the join method might be an SQL left-outer join, and the fields to be retained for table ID 100 might include "id", "code", "name_1", "name_2", "name_3", and "name_4", while the fields to be retained for table ID 200 might include "id", "code", "name", "value", and "update_time".

[0064] This data query method enables multi-table queries, significantly enhancing its flexibility. Therefore, it can handle highly complex data query scenarios. Specifically, it can handle many-to-many relationships during the query process. This method avoids the need to create a single table containing a large amount of data, greatly reducing data redundancy in the data source.

[0065] Before using one or more components to process the query description, some embodiments of the data query method further include loading the one or more components. Typically, loading occurs when the query is initiated. In some embodiments, the data query method further includes loading the interface of a corresponding component of the one or more components into memory; and obtaining the corresponding implementation of the corresponding component from the interface of the corresponding component. Figure 4 This is a flowchart illustrating a data query method according to some embodiments of the present disclosure. (Refer to...) Figure 4 In one example, the data query method includes accessing the interface of one or more components, thereby accessing the corresponding interface of the corresponding component among the one or more components from memory. Specifically, the data query method includes at least one of the following: loading an interface of a time data component, loading an interface of an aggregation component, or loading an interface of a filter component. More specifically, the interface of loading a filter component may include at least one of the following: loading an interface of a character filter component, loading an interface of a numeric filter component, or loading an interface of a date data filter component.

[0066] In a specific example, the data query method includes: loading the top-level interfaces of each component; obtaining implementations of the top-level interface and any lower-level interfaces associated with it; and classifying the obtained implementations. This unique interface loading method offers many advantages over other methods. For example, it eliminates the need to repeatedly create interface implementations, thereby achieving efficient reuse of computing resources and significantly improving call execution efficiency.

[0067] Once the interface is loaded into memory, the data query method further includes obtaining the implementation of the component from the component's interface. Optionally, the data query method further includes determining the type of data source; grouping the components into different groups; and registering the components. As used herein, an interface refers to a set of operations (e.g., the name of a function) that declares a service agreement or protocol provided or requested by a component. As used herein, the term "implementation" refers to a function that implements the component's interface. An interface may contain different implementations corresponding to different data sources. For illustrative purposes, in one example, the interface may be "driving a vehicle," and the interface may include a set of operations such as accelerating, decelerating, shifting gears, turning on lights, etc. In one example, an implementation corresponding to the "accelerate" operation may include "using the user's right foot," "continuously," "pressing the accelerator," etc.

[0068] As described above, the data query method in some embodiments includes: loading an interface for a time data component. In one example, the interface for the time data component could be "month". In another example, the implementation of the interface could be "converting time data into yyyy-mm format". For example, time data in the data source could have a format of "yyyy-mm-dd hh:mm:ss", and the time data component would convert the format to "yyyy-mm format".

[0069] As described above, the data query method in some embodiments includes loading the interface of an aggregation component. In one example, the interface of the aggregation component may be an averaging operation, and the corresponding implementation may be adding an averaging function to the values. For example, the aggregation component is configured to add an averaging function to "Sales Amount," converting it into an "avg(Sales Amount)" statement.

[0070] As described above, the data query method in some embodiments includes loading an interface of a character filter component. In one example, the interface of the character filter component may be an operation that filters characters and conditions and assembles the characters and conditions into a statement. For example, the character filter component is configured to filter characters and conditions to obtain "Company" and "(A, B, C, D)", and assemble them into the statement "Company in (A, B, C, D)".

[0071] As described above, in some embodiments, the data query method includes loading an interface for a numerical filter component. In one example, the interface for the numerical filter component may be an operation that filters numerical data and assembles the numerical data into a statement. For example, the numerical filter component is configured to filter "avg(sales revenue)" values ​​greater than a threshold of 60 billion and assemble the numerical data into the statement "avg(sales revenue) > 60 billion".

[0072] As described above, the data query method in some embodiments includes loading an interface for a date data filter component. In one example, the interface for the date data filter component may be an operation that filters date data and assembles the date data into a statement. For example, the date data filter component is configured to filter date data to obtain "month" and "(January, February)", and assemble them into the statement "(January, February)".

[0073] In some embodiments, the results processed using the interface of the aggregation component and / or the interface of the aggregation component can be used in processing using the interface of the numerical filter component. For example, "company" and "avg (sales revenue)" can be used in processing using the interface of the numerical filter component.

[0074] In some embodiments, the data query method further includes: determining the query description. Optionally, the step of determining the query description includes: defining at least one of a query field, a filter type field, a filter condition field, and a sequence field.

[0075] In some embodiments, the data query method further includes: defining the one or more components. A corresponding component of the one or more components is defined as including multiple interfaces compatible with different data sources. The corresponding component is configured to provide implementations for data of different formats or types from different data sources.

[0076] On the other hand, this disclosure provides a data query apparatus. In some embodiments, the data query apparatus includes: a memory; and one or more processors. The memory and the one or more processors are connected to each other. In some embodiments, the memory stores computer-executable instructions for controlling the one or more processors to perform the following operations: receiving a query description; processing the query description using one or more components; and determining a query statement. Optionally, the one or more processors are configured to: obtain a query field from the query description; process the query field using the one or more components; and determine a first sub-statement.

[0077] Figure 5 This is a schematic diagram illustrating a data query apparatus according to some embodiments of the present disclosure. (Refer to...) Figure 5 The data query device can include any suitable type of television, such as a plasma TV, liquid crystal display (LCD) TV, touchscreen TV, projection TV, non-smart TV, or smart TV. The data query device can also include other computing systems such as a personal computer (PC), tablet or mobile computer, or smartphone. Furthermore, the data query device can be any suitable content presentation device capable of displaying appropriate content. Users can interact with the data query device to perform other activities of interest.

[0078] like Figure 5 As shown, the data query device may include a processor 1002, a storage medium 1004, a display 1006, a communication module 1008, a database 1010, and peripheral devices 1012. For better description of the relevant embodiments, some devices may be omitted, and other devices may be included.

[0079] Processor 1002 may include any suitable one or more processors. Furthermore, processor 1002 may include multiple cores for multithreaded or parallel processing. Processor 1002 can execute sequences of computer program instructions to perform various processes. Storage medium 1004 may include memory modules such as ROM, RAM, flash memory modules, and mass storage devices, such as CD-ROMs and hard disks. Storage medium 1004 may store computer programs for implementing various processes when processor 1002 executes the computer program. For example, storage medium 1004 may store computer programs for implementing various algorithms when processor 1002 executes the computer program.

[0080] Furthermore, the communication module 1008 may include certain network interface devices for establishing connections through communication networks such as television cable networks, wireless networks, and the Internet. The database 1010 may include one or more databases for storing certain data and for performing certain operations on the stored data, such as database searches.

[0081] Display 1006 can provide information to the user. Display 1006 can include any suitable type of computer display device or electronic device display such as LCD- or OLED-based devices. Peripheral devices 112 can include various sensors and other I / O devices such as keyboards and mice.

[0082] All or some of the functional modules / units in the steps, systems, and devices disclosed above can be implemented as software, firmware, hardware, or a suitable combination thereof. In hardware implementation, the division between functional modules / units mentioned above does not necessarily correspond to the division between physical components. For example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components can be implemented as software executed by a processor such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit such as an application-specific integrated circuit. Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). The term "computer storage medium" includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data, as is well known to those skilled in the art. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic tape cassettes, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible by a computer. Additionally, communication media are typically embodied as computer-readable instructions, data structures, program modules, or other data in modulated data signals, such as carrier waves or other transmission mechanisms, as is well known to those skilled in the art.

[0083] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and possible operation of devices, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, one or more program segments, or a portion of code, including at least one executable instruction for implementing one or more specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, depending on the functions involved, two consecutively connected blocks may actually be executed substantially simultaneously, or these blocks may sometimes be executed in reverse order. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a system based on dedicated hardware or a combination of dedicated hardware and computer instructions that performs the specified functions or operations.

[0084] On the other hand, this disclosure provides a computer program product including a non-transitory tangible computer-readable medium having computer-readable instructions thereon. In some embodiments, the computer-readable instructions are executable by a processor to cause the processor to perform the following operations: receiving a query description; processing the query description using one or more components; and determining a query statement. Optionally, processing the query description includes: obtaining query fields from the query description; processing the query fields using the one or more components; and determining a first substatement.

[0085] For illustrative and descriptive purposes, the foregoing description of embodiments of the invention has been provided. It is not exhaustive, nor is it intended to limit the invention to the precise forms or exemplary embodiments disclosed. Therefore, the foregoing description should be considered illustrative rather than restrictive. Clearly, many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described to explain the principles of the invention and its best mode of practical application, thereby enabling those skilled in the art to understand the various embodiments of the invention and the various modifications suitable for the particular use or implementation contemplated. The scope of the invention is intended to be defined by the appended claims and their equivalents, wherein, unless otherwise stated, all terms are to be interpreted in their broadest reasonable sense. Therefore, the terms “the invention,” “the present invention,” etc., do not necessarily limit the scope of the claims to the specific embodiments, and references to exemplary embodiments of the invention do not imply limitation of the invention, nor should such limitation be inferred. The invention is defined only by the spirit and scope of the appended claims. Furthermore, these claims may involve the use of “first,” “second,” etc., followed by nouns or elements. These terms should be understood as nomenclature and should not be construed as limiting the number of elements modified by these nomenclatures unless a specific number has been given. Any advantages and benefits described may not apply to all embodiments of the invention. It should be understood that changes to the described embodiments can be made by those skilled in the art without departing from the scope of the invention as defined by the appended claims. Furthermore, the elements and components in this disclosure are not intended for public distribution, whether or not they are expressly recited in the appended claims.

Claims

1. A data query method, comprising: Receive query description; The query description includes one or more fields for interpretation by one or more components, the one or more fields including one or more of query fields, filter type fields, category fields, and order fields; the components are user-defined and configured to process data descriptions from different data sources into the same query statement; Load the one or more components; The loading of the one or more components includes: loading the corresponding interface of the corresponding component among the one or more components; obtaining the corresponding implementation of the corresponding component from the corresponding interface of the corresponding component; and having the processor process the query description using the one or more components; and Determine the query statement; The processing of the query description includes: Obtain the query fields from the query description, and determine whether the query fields include aggregate query fields; The query fields are processed using one or more of the components; and Determine the first sub-statement; The step of using one or more components to process the query field includes: using a first component to process the aggregate query field; the first component is configured to provide implementations of the same type of aggregate functions, which are defined differently by different data sources.

2. The data query method according to claim 1, wherein, Processing the query description also includes: Determine whether the query field includes a time data query field; and The time data query field is processed using the second component; The second component is configured to provide implementations for time data of different formats or types from different data sources.

3. The data query method according to claim 1 or 2, wherein, Processing the query description also includes: Obtain the filter type field from the query description; The filter type field is processed using one or more components; and Determine the second sub-statement.

4. The data query method according to claim 3, wherein, Processing the filter type field includes at least one of the following: Use a third component to process filter type fields to generate a first filter substatement configured to filter character type fields; Use the fourth component to process filter type fields to generate a second filter sub-statement configured to filter numeric type fields; or Use the fifth component to process filter type fields to generate a third filter sub-statement configured to filter date data type fields; The second sub-statement includes at least one of the first filter sub-statement, the second filter sub-statement, or the third filter sub-statement.

5. The data query method according to claim 4 further includes: Obtain the filter condition fields from the query description; or The data source type is obtained from the query description.

6. The data query method according to claim 1 further includes: Obtain the category field from the query description; as well as Determine the third sub-statement.

7. The data query method according to claim 1 further includes: Obtain the order field from the query description; as well as Determine the fourth sub-statement.

8. The data query method according to claim 1, wherein, Determining the query statement includes: concatenating multiple substatements, including the first substatement, into the query statement.

9. The data query method according to claim 1 further includes: Load the query statement into the query engine; as well as The query engine queries the data source to obtain the query results.

10. The data query method according to claim 9 further includes: Determine whether the query engine supports the data source; Determine whether the query data source includes multi-table queries; When it is determined that the data source being queried includes the multi-table query, the multi-table query is split into multiple single-table queries; as well as The query results are compiled from the multiple single-table queries.

11. The data query method according to claim 1, further comprising: Load the interface of the corresponding component from the one or more components into memory; as well as The corresponding implementation of the corresponding component is obtained from the interface of the corresponding component.

12. The data query method according to claim 1, further comprising: Determine the query description; The determination of the query description includes: defining at least one of the query fields, filter type fields, filter condition fields, and order fields.

13. The data query method according to claim 1, further comprising: Define the one or more components; Among them, the corresponding component of the one or more components is defined as including multiple interfaces compatible with different data sources; The corresponding components are configured to provide implementations for different formats or types of data from the different data sources.

14. The data query method according to claim 1, wherein, The one or more components include at least one user-defined component.

15. The data query method according to claim 10, wherein, The query engine is the Presto query engine.

16. The data query method according to claim 1, wherein, The query statement is an SQL statement.

17. A data query device, comprising: Memory; One or more processors; Wherein, the memory and the one or more processors are connected to each other; and The memory stores computer-executable instructions for controlling the one or more processors to perform the following operations: Receive a query description; the query description includes one or more fields for interpretation by one or more components, the one or more fields including one or more of query fields, filter type fields, category fields, and order fields; the components are user-defined and configured to process data descriptions from different data sources into a unified query statement; Load the one or more components; Loading the one or more components includes: loading the corresponding interface of the corresponding component among the one or more components; and obtaining the corresponding implementation of the corresponding component from the corresponding interface of the corresponding component. The query description is processed using one or more components; and Determine the query statement; Wherein, the one or more processors are configured as follows: Obtain the query fields from the query description, and determine whether the query fields include aggregate query fields; The query fields are processed using one or more of the components; and Determine the first sub-statement; The step of using one or more components to process the query field includes: using a first component to process the aggregate query field; the first component is configured to provide implementations of the same type of aggregate functions, which are defined differently by different data sources.

18. A computer program product comprising a non-transitory tangible computer-readable medium having computer-readable instructions thereon, the computer-readable instructions being executable by a processor to cause the processor to perform the following operations: Receive a query description; the query description includes one or more fields for interpretation by one or more components, the one or more fields including one or more of query fields, filter type fields, category fields, and order fields; the components are user-defined and configured to process data descriptions from different data sources into a unified query statement; Load the one or more components; The loading of the one or more components includes: loading the corresponding interface of the corresponding component among the one or more components; obtaining the corresponding implementation of the corresponding component from the corresponding interface of the corresponding component; processing the query description using the one or more components; and Determine the query statement; The processing of the query description includes: Obtain the query fields from the query description, and determine whether the query fields include aggregate query fields; The query fields are processed using one or more of the components; and Determine the first sub-statement; The step of using one or more components to process the query field includes: using a first component to process the aggregate query field; the first component is configured to provide implementations of the same type of aggregate functions, which are defined differently by different data sources.

Citation Information

Patent Citations

  • Data retrieval method supporting heterogeneous database

    CN108446289A

  • Flexible adoption of base data sources in a remote application integration scenario

    US20200192907A1