Scene-driven query optimization method and system for heterogeneous data

By using read-time modeling techniques and flexible field extraction strategies, a data model is dynamically constructed, solving the problem of balancing flexibility and performance in heterogeneous data processing. This achieves efficient and flexible query optimization, improving the system's adaptability and scalability.

CN120910091APending Publication Date: 2025-11-07CHINA UNITECHS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510758583.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-11-07

Smart Images

  • Figure CN120910091A_ABST
    Figure CN120910091A_ABST
Patent Text Reader

Abstract

The invention discloses a scene-driven query optimization method and system for heterogeneous data, and the method comprises the steps: when a user initiates a query request, a query parser firstly parses a query grammar, and then recognizes fields and query conditions required by query; based on the query condition, generating a corresponding query rule through a real-time rule engine; based on the query rule, constructing a data model containing required fields; during query, a field extraction strategy during indexing or a field extraction strategy during reading is adopted to extract fields; and for the query needing aggregation calculation, executing corresponding calculation operation after the field is extracted. According to the method and the system, efficient and flexible query optimization of heterogeneous data is realized through a read-time modeling technology and a flexible field extraction strategy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of heterogeneous data query and processing, and in particular to a scene-driven query optimization method and system for heterogeneous data. BACKGROUND

[0002] In today's era of increasing popularity of big data applications, more and more enterprises are transforming from traditional business systems to big data systems. This transformation brings great challenges, especially when dealing with heterogeneous data. Heterogeneous data includes various different data sources, data formats and data types, such as structured data (such as tables in relational databases), semi-structured data (such as JSON, XML) and unstructured data (such as text, pictures, videos, etc.). The variety and structure of these data are different, making it difficult to query and process data, and facing some problems as follows:

[0003] (1) Data processing complexity.

[0004] In traditional data systems, data needs to be pre-processed before storage, and data format, field and index must be specified. For complex heterogeneous data, developers need to write special processing code for each data format, making data processing cumbersome and inflexible.

[0005] (2) Balance between flexibility and performance.

[0006] Traditional write-time modeling methods can optimize query performance by predefining data structures, but lack flexibility when facing dynamic query requirements. Changes in query patterns will require constant adjustments to the data model, affecting system performance. SUMMARY

[0007] To solve the above problems existing in the prior art, the present application provides a scene-driven query optimization method and system for heterogeneous data, which realizes efficient and flexible query optimization of heterogeneous data through read-time modeling technology and flexible field extraction strategy. This method dynamically constructs data models and selects the required fields during query, avoiding fixed structures and calculations in traditional queries, improving query performance while adapting to changing query requirements, especially suitable for big data and complex query scenarios.

[0008] To achieve the above purpose, the present application adopts the following technical solutions:

[0009] In an embodiment of the present application, a scene-driven query optimization method for heterogeneous data is proposed, which comprises:

[0010] When a user initiates a query request, the query parser first parses the query syntax and then identifies the required fields and query conditions.

[0011] Based on the query condition, a corresponding query rule is generated by a real-time rule engine; and based on the query rule, a data model containing the required fields is constructed;

[0012] During the query, the index-time field extraction strategy or the read-time field extraction strategy is used to extract the fields; and for the query requiring aggregation calculation, the corresponding calculation operation is performed after the fields are extracted.

[0013] Further, for the frequently used query condition, the query result is calculated in advance and stored; and for the frequently used query, a materialized view is created, and the query result is calculated and stored in advance.

[0014] Further, the read-time field extraction strategy comprises:

[0015] Firstly, the query condition is parsed, and the fields to be extracted are identified;

[0016] During the query, the fields are extracted in real time according to the query condition;

[0017] For the query requiring aggregation calculation, the corresponding calculation operation is performed after the fields are extracted.

[0018] Further, through metadata, the required fields are quickly located during the query, and the corresponding query rule is generated; the metadata comprises the data type of the fields, the relationship between the fields and the data update history.

[0019] In an embodiment of the present application, a scenario-driven query optimization system for heterogeneous data is also provided, which comprises:

[0020] The read-time modeling module is used for, when the user initiates a query request, the query parser firstly parses the query syntax, and then identifies the fields and the query condition required by the query; based on the query condition, a corresponding query rule is generated by a real-time rule engine; and based on the query rule, a data model containing the required fields is constructed;

[0021] The flexible field extraction strategy module is used for, during the query, the index-time field extraction strategy or the read-time field extraction strategy is used to extract the fields; and for the query requiring aggregation calculation, the corresponding calculation operation is performed after the fields are extracted.

[0022] Further, for the frequently used query condition, the query result is calculated in advance and stored; and for the frequently used query, a materialized view is created, and the query result is calculated and stored in advance.

[0023] Further, the read-time field extraction strategy comprises:

[0024] Firstly, the query condition is parsed, and the fields to be extracted are identified;

[0025] When querying, the fields are extracted in real time according to the query condition;

[0026] For the query requiring aggregation calculation, the corresponding calculation operation is performed after the fields are extracted.

[0027] Further, by metadata, the required fields are quickly located when querying, and the corresponding query rule is generated; the metadata includes the data type of the fields, the relationship between the fields and the data update history.

[0028] In an embodiment of the present application, a computer device is also provided, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, and the processor implements the aforementioned scene-driven query optimization method for heterogeneous data when executing the computer program.

[0029] In an embodiment of the present application, a computer readable storage medium is also provided, which stores a computer program for executing the scene-driven query optimization method for heterogeneous data.

[0030] Advantages:

[0031] 1. By the read-time modeling technology, the present application can dynamically select the fields and the calculation mode according to the query requirement, thereby avoiding the limitation of the fixed query structure in the traditional query, and being able to flexibly cope with the variable query requirement and the complex data structure.

[0032] 2. The present application combines the flexible field extraction strategy, extracts only the necessary fields, avoids unnecessary calculation and field loading, and thereby improves the query efficiency and reduces the storage and calculation overhead.

[0033] 3. The present application dynamically constructs the data model, does not need to modify the database structure or write multiple query statements, and is able to flexibly cope with different query requirements, thereby improving the adaptability and expansibility of the system. BRIEF DESCRIPTION OF DRAWINGS

[0034] Figure 1 is a flow chart of the scene-driven query optimization method for heterogeneous data of the present application;

[0035] Figure 2 is a structural schematic diagram of the scene-driven query optimization system for heterogeneous data of the present application;

[0036] Figure 3 is a structural schematic diagram of the computer device of the present application. DETAILED DESCRIPTION

[0037] The principles and spirits of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are given only to enable those skilled in the art to better understand and implement the present application, and are not intended to limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0038] Those skilled in the art know that the embodiments of the present application can be implemented as a system, a system, a device, a method or a computer program product. Therefore, the present disclosure can be embodied in the form of a complete hardware, a complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0039] According to the embodiments of the present application, a scene-driven query optimization method for heterogeneous data is proposed. By combining read-time modeling technology and flexible field extraction strategy, a data model can be dynamically generated during query, and appropriate fields can be selected for extraction according to specific query requirements, thereby optimizing query performance.

[0040] (1) Read-time modeling technology.

[0041] Read-time modeling technology is a technology that dynamically constructs a data model during query, without the need for predefined data structure design when data is written. In this way, the system can flexibly generate the required data model according to the query conditions, thereby improving query flexibility and reducing complexity during writing.

[0042] (2) Flexible field extraction strategy.

[0043] Flexible field extraction strategy refers to dynamically determining which fields need to be extracted during query according to the actual requirements of the query, thereby optimizing query performance. There are two main extraction strategies: index-time field extraction and read-time field extraction.

[0044] The principles and spirits of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are given only to enable those skilled in the art to better understand and implement the present application, and are not intended to limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0045] Figure 1 is a flowchart of the scene-driven query optimization method for heterogeneous data of the present application. As shown in Figure 1 , the method comprises:

[0046] When a user initiates a query request, the query parser first parses the query syntax, and then identifies the required fields and query conditions of the query;

[0047] Based on the query conditions, the corresponding query rules are generated through the real-time rule engine; based on the query rules, a data model containing the required fields is constructed;

[0048] When querying, use the field extraction strategy when indexing or the field extraction strategy when reading to extract fields; for queries that require aggregation calculations, perform the corresponding calculation operations after extracting the fields.

[0049] Specific implementation:

[0050] 1. Read-time modeling technology

[0051] Implementation process:

[0052] (1) Dynamic query parsing

[0053] When a user initiates a query request, the query parser first analyzes the query syntax and identifies the required fields and query conditions. The workflow of the query parser includes the following steps:

[0054] Query syntax parsing:

[0055] The query parser first parses the query syntax to ensure that the query syntax conforms to the system's query specifications and can extract the required fields from the data source.

[0056] Field selection and filtering condition analysis:

[0057] After syntax parsing, the query parser identifies the fields involved in the query and analyzes which fields need to be extracted based on the query conditions. For example, if the query condition is transaction records within a certain time period, the query parser will identify the timestamp field and determine its time range.

[0058] Calculation requirement analysis:

[0059] After query condition parsing, the system also needs to analyze whether the query involves calculation operations such as sum, average, maximum, minimum, etc. These calculation operations will affect the subsequent data extraction and processing strategies.

[0060] (2) Real-time rule engine

[0061] After query parsing, the system generates query rules through the real-time rule engine to determine how to extract the required fields from the data. The workflow of the real-time rule engine is as follows:

[0062] Rule generation:

[0063] Based on the query conditions provided by the query parser, the real-time rule engine generates corresponding query rules. These rules include field extraction rules, calculation rules (such as aggregation functions), connection rules (such as multi-table join), etc.

[0064] Dynamic optimization:

[0065] Based on the characteristics of different queries, the real-time rules engine also selects different optimization strategies. For example, if an index has been created for a certain field, the real-time rules engine will prefer to query through the index; if the query involves a join query of multiple tables, the real-time rules engine will decide whether to speed up the query through pre-query or materialized view.

[0066] (3) Data Model Construction and Filling

[0067] After the query rules are determined, the system fills the query results according to the generated data model. The specific process is as follows:

[0068] Data Model Construction:

[0069] Based on the query rules, the system dynamically constructs a data model containing the required fields. This model not only contains the fields in the data table, but also includes related calculation results (such as total, average, etc.).

[0070] Data Extraction and Filling:

[0071] The system fills the query results into the data model through dynamic field extraction. For simple queries, the system directly obtains data from the index; for complex queries, the system may need to extract data from multiple tables and perform merging or aggregation.

[0072] (4) Pre-query and Materialized View

[0073] In order to improve query performance, especially in the case of fixed query patterns, the system can optimize queries through pre-query and materialized view technology. The specific operation is as follows:

[0074] Pre-query:

[0075] For frequently used query conditions, the system can pre-compute query results and store them. For example, the system can pre-compute the total sales in a certain period and store it in a pre-query table. When users query, they can directly access these stored results, avoiding re-computation.

[0076] Materialized View:

[0077] For frequently used queries, the system can create a materialized view to pre-compute and store query results. Materialized views are usually used when data changes are less frequent. When queried, it directly returns the pre-computed results, reducing the overhead of real-time computation.

[0078] 2、Flexible Field Extraction Strategy

[0079] Flexible field extraction strategy refers to dynamically determining which fields need to be extracted based on the actual requirements of the query during query time, thereby optimizing query performance. There are two main extraction strategies: index-time field extraction and read-time field extraction.

[0080] (1) Index-time field extraction

[0081] In cases where the data structure is relatively fixed and the query pattern is clear, the system will create indexes for frequently used fields in advance when data is written. This approach can significantly improve query efficiency, especially in scenarios where specific fields need to be frequently queried.

[0082] Field selection:

[0083] When data is written, the system creates indexes for frequently used fields based on business requirements and query frequency. Common fields include time fields, user IDs, geographic locations, etc.

[0084] Index optimization:

[0085] To improve query efficiency, the system creates indexes based on the selectivity of fields. Fields with high selectivity (such as user_id) are prioritized for indexing, while fields with low selectivity (such as status flag fields) may not necessarily need indexing.

[0086] Index scanning:

[0087] When a user initiates a query, the system first checks whether the query conditions involve indexed fields. If the query conditions contain indexed fields, the system will directly use the index for querying to avoid full table scanning.

[0088] (2) Read-time field extraction

[0089] For scenarios where the data structure is not fixed or the query requirements are variable, the system adopts the read-time field extraction strategy. This approach does not rely on pre-defined field structures, but rather extracts data in real-time based on query conditions.

[0090] Query condition analysis:

[0091] The system first analyzes the query conditions to identify the fields that need to be extracted. For example, if a user queries for sales data within a specific time period, the system will dynamically determine which fields (such as timestamp, transaction_amount, etc.) need to be extracted.

[0092] Field extraction:

[0093] During query time, the system extracts data in real-time based on query conditions. While this approach improves the flexibility of the system, it also incurs certain performance overhead.

[0094] Calculation and aggregation:

[0095] For queries that require aggregated computation, the system will perform the corresponding computation operations such as sum, average, max, etc. after extracting the fields.

[0096] 3. Data Storage and Structure Design

[0097] In order to support read-time modeling and flexible field extraction strategy, the design of data storage structure is crucial. The data storage system must be able to support efficient data extraction, query optimization, and high-concurrency data access. Here are several common data storage design schemes:

[0098] (1) Data Storage Format Selection

[0099] Relational Database:

[0100] Relational databases (such as MySQL, PostgreSQL) are suitable for structured data and can provide good query performance and transaction support. For scenarios that require multiple table joins and complex queries, relational databases are a good choice.

[0101] Columnar Storage:

[0102] Columnar storage (such as HBase, Cassandra) is suitable for large-scale data storage and supports efficient read operations. Especially when dealing with large-scale log data, sensor data, etc., columnar storage can provide significant performance improvement.

[0103] NoSQL Database:

[0104] For unstructured data or data with flexible schema, using NoSQL databases (such as MongoDB, Elasticsearch) can improve the flexibility and scalability of the system.

[0105] (2) Metadata Management

[0106] In order to ensure efficient extraction of required fields during query processing, the system needs to have strong metadata management capabilities. Metadata includes information such as field data types, relationships between fields, data update history, etc. Through metadata, the system can quickly locate the required fields during query and generate corresponding query rules.

[0107] Field Data Type Management:

[0108] The system must know the data type of each field so that it can correctly process the field during query. For example, timestamp fields are usually time types, and transaction_amount fields are numerical types.

[0109] Relationship Management between Fields:

[0110] In multi-table queries, the system needs to know the relationships between different tables (such as foreign key relationships, association conditions, etc.) to generate the correct query plan.

[0111] (3) Index and view management

[0112] Index management:

[0113] When data is written, the system creates indexes for frequently used fields and updates them regularly. The index management system tracks the usage of indexes to ensure that queries can quickly locate the required fields.

[0114] View management:

[0115] For some commonly used query patterns, the system can create materialized views to improve query efficiency. Materialized views precompute and store query results to avoid repeated calculations.

[0116] It should be noted that although the operations of the method of the present application are described in a specific order in the above embodiments and drawings, this does not require or imply that the operations must be performed in that specific order, or that all the shown operations must be performed to achieve the desired results. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be divided into multiple steps.

[0117] To better explain the above-mentioned heterogeneous data-oriented scenario-driven query optimization method, a specific embodiment will be described below, however, it is worth noting that this embodiment is only to better illustrate the present application, and does not constitute an improper limitation on the present application.

[0118] Embodiment:

[0119] Suppose we have a user behavior log system containing the following fields:

[0120] user_id: user ID (such as user A, user B, etc.);

[0121] action_type: user behavior type (such as browsing, purchasing, evaluating, etc.);

[0122] timestamp: operation time (such as "2024-01-01 12:00:00");

[0123] transaction_amount: transaction amount (such as 100.5).

[0124] There are two query scenarios, representing fixed query patterns and dynamic query patterns, which demonstrate the system's optimization strategies under different query conditions.

[0125] Scenario 1: Fixed Query Pattern (Field Extraction using Index)

[0126] Query Request: Query all purchase records of user A between January 1, 2024, and January 10, 2024.

[0127] Query Parsing: When the user submits the query request, the query parser first analyzes the query request to identify the required fields and query conditions.

[0128] Query Fields: user_id, action_type, timestamp, and transaction_amount;

[0129] Query Conditions: user_id = 'A' and timestamp between January 1, 2024, and January 10, 2024.

[0130] Index Check: The system checks whether there are indexes for the query fields (e.g., user_id and timestamp) in the database. Indexes can significantly speed up queries as they pre-sort data, allowing direct access from the index without scanning the entire data table.

[0131] Index Optimization: If indexes exist, the query will directly locate records that match user_id = 'A' and timestamp range using the indexes. The query engine quickly locates relevant data rows through user_id and timestamp indexes, then further filters out records that meet the conditions through the indexes.

[0132] Avoid Full Table Scan: If there are no indexes, the system needs to scan the entire data table line by line to find data that meets the conditions, which significantly increases query time, especially in large data volumes.

[0133] Data Extraction and Calculation: Once the system finds records that meet the conditions through the index, it extracts relevant fields (e.g., action_type, transaction_amount). If the query includes calculation requirements (e.g., calculating the total transaction amount), the system will perform the corresponding aggregation or calculation operations on the extracted fields.

[0134] Query Result Return: Finally, the system returns the records that meet the conditions to the user and displays the complete purchase records as required.

[0135] Scenario 2: Dynamic Query Pattern (Field Extraction using Read-Time)

[0136] This scenario describes how to dynamically respond to query requests through read-time field extraction when the query conditions are not fixed, change greatly, or the query requirements are flexible.

[0137] Query request: Query the total transaction amount of all users within a specific time period.

[0138] Query parsing: When receiving the query request, the query parser first analyzes the query conditions, identifies the fields that need to be extracted and the related calculation requirements.

[0139] Query field: transaction_amount (need to calculate the total transaction amount).

[0140] Query condition: timestamp within a specific time period (e.g., January 1, 2024 to January 10, 2024).

[0141] Generate dynamic extraction rules: Since the query conditions (especially the time range) are dynamic, the system needs to generate corresponding field extraction rules through a real-time rules engine. The rules engine dynamically selects the required fields and decides how to extract data according to the time period of the user query.

[0142] For example, the user queries the total amount of all transactions within a specific time period, the system needs to find the transaction_amount field in the database and filter according to the time range. At this time, the system does not rely on indexes, but dynamically extracts data according to real-time rules.

[0143] Data extraction and calculation: The system extracts data that meets the conditions from the original data source. Since the query conditions are not fixed, it may be necessary to scan the data table to obtain records that meet the conditions.

[0144] Query result return: After the system calculates and aggregates all the transaction amounts that meet the conditions, the results are returned to the user.

[0145] Based on the same inventive concept, the present application also proposes a scenario-driven query optimization system for heterogeneous data. The implementation of this system can refer to the implementation of the above-mentioned method, and the repeated parts will not be repeated. The term "module" used below can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware implementation is also possible and contemplated.

[0146] Figure 2 is a schematic diagram of the scenario-driven query optimization system for heterogeneous data of the present application. As shown in Figure 2 , the system includes:

[0147] The read-time modeling module 101 is configured to, when a user initiates a query request, first parse the query syntax by the query parser, and then identify the fields and the query conditions required by the query; generate corresponding query rules by the real-time rule engine based on the query conditions; and construct a data model containing the required fields based on the query rules.

[0148] For frequently used query conditions, the query results are pre-calculated and stored; and for frequently used queries, a materialized view is created to pre-calculate and store the query results.

[0149] The flexible field extraction strategy module 102 is configured to, when querying, adopt the index-time field extraction strategy or the read-time field extraction strategy to extract the fields; and for a query requiring aggregation calculation, perform corresponding calculation operations after extracting the fields.

[0150] The read-time field extraction strategy includes:

[0151] First, parse the query conditions to identify the fields to be extracted;

[0152] During the query, the fields are extracted in real time according to the query conditions;

[0153] For a query requiring aggregation calculation, corresponding calculation operations are performed after extracting the fields.

[0154] Through metadata, the required fields are quickly located during the query, and corresponding query rules are generated; the metadata includes the data types of the fields, the relationships between the fields, and the data update history.

[0155] It should be noted that, although several modules of the scenario-driven query optimization system for heterogeneous data are mentioned in the foregoing detailed description, such division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided into multiple modules.

[0156] Based on the foregoing inventive concept, as shown in Figure 3 The present application further proposes a computer device 200, which includes a memory 210, a processor 220, and a computer program 230 stored in the memory 210 and executable on the processor 220, wherein the processor 220 implements the foregoing scenario-driven query optimization method for heterogeneous data when executing the computer program 230.

[0157] Based on the foregoing inventive concept, the present application further proposes a computer-readable storage medium, which stores a computer program for executing the foregoing scenario-driven query optimization method for heterogeneous data.

[0158] The scene-driven query optimization method for heterogeneous data has the following highlights:

[0159] 1. By using the read-time modeling technology, the system can dynamically select fields and calculation methods according to the query requirements, avoiding the limitation of the fixed query structure in the traditional query. In this way, the system can flexibly cope with the changing query requirements and complex data structures.

[0160] 2. In combination with the flexible field extraction strategy, the system only extracts necessary fields, avoiding unnecessary calculations and field loading, thereby improving the query efficiency and reducing the storage and calculation overhead.

[0161] 3. The system dynamically constructs a data model without modifying the database structure or writing multiple query statements, and can flexibly cope with different query requirements, improving the adaptability and expandability of the system.

[0162] Although the spirit and principles of the present application have been described with reference to several specific embodiments, it should be understood that the present application is not limited to the disclosed specific embodiments, and the division of aspects does not mean that the features in these aspects cannot be combined to benefit. The division is only for the convenience of expression. The present application is intended to cover various modifications and equivalent arrangements contained in the spirit and scope of the appended claims.

[0163] The scope of protection of the present application should be understood by those skilled in the art that various modifications or changes made on the basis of the technical solutions of the present application without creative labor are still within the protection scope of the present application.

Claims

1. A method for scenario-driven query optimization for heterogeneous data, the method comprising: The method comprises: When a user initiates a query request, a query parser first parses a query syntax, and then identifies fields and query conditions required by the query; Based on the query conditions, a corresponding query rule is generated through a real-time rule engine; and based on the query rule, a data model containing the required fields is constructed; During the query, a field extraction strategy in index time or a field extraction strategy in read time is adopted to extract the fields; and for a query requiring aggregation calculation, corresponding calculation operations are performed after the fields are extracted.

2. The schema-driven query optimization method for heterogeneous data according to claim 1, wherein, For frequently used query conditions, query results are pre-calculated and stored; and for frequently used queries, materialized views are created to pre-calculate and store the query results.

3. The schema-driven query optimization method for heterogeneous data according to claim 1, wherein, The field extraction strategy in read time comprises: First, the query conditions are parsed to identify the fields to be extracted; During the query, the fields are extracted in real time according to the query conditions; For a query requiring aggregation calculation, corresponding calculation operations are performed after the fields are extracted.

4. The schema-driven query optimization method for heterogeneous data according to claim 1, wherein, Through metadata, the required fields are quickly located during the query, and corresponding query rules are generated; the metadata includes data types of the fields, relationships between the fields, and data update history.

5. A heterogeneous data oriented, scenario driven query optimization system, characterized in that, The system comprises: A read-time modeling module, configured to, when a user initiates a query request, a query parser first parses a query syntax, and then identifies fields and query conditions required by the query; based on the query conditions, a corresponding query rule is generated through a real-time rule engine; and based on the query rule, a data model containing the required fields is constructed; A flexible field extraction strategy module, configured to, during the query, a field extraction strategy in index time or a field extraction strategy in read time is adopted to extract the fields; and for a query requiring aggregation calculation, corresponding calculation operations are performed after the fields are extracted.

6. The schema-driven query optimization system for heterogeneous data according to claim 5, wherein, For frequently used query conditions, query results are pre-calculated and stored; and for frequently used queries, materialized views are created to pre-calculate and store the query results.

7. The schema-driven query optimization system for heterogeneous data according to claim 5, wherein, The field extraction strategy in read time comprises: First, the query conditions are parsed to identify the fields to be extracted; During the query, the fields are extracted in real time according to the query conditions; For a query requiring aggregation calculation, corresponding calculation operations are performed after the fields are extracted.

8. The schema-driven query optimization system for heterogeneous data according to claim 5, wherein, Through metadata, the required fields are quickly located during the query, and corresponding query rules are generated; the metadata includes data types of the fields, relationships between the fields, and data update history.

9. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the method of any one of claims 1-4 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores the computer program for executing the method of any one of claims 1-4.