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

By splitting SQL queries using query configuration files on the server side, cross-database concurrent execution is achieved, which solves the readability and performance problems caused by excessively long SQL queries, improves query efficiency and stability, and reduces expansion costs.

CN122240613APending Publication Date: 2026-06-19GF SECURITIES CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GF SECURITIES CO LTD
Filing Date
2026-03-10
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

When using Structured Query Language (SQL) to query data, joining multiple tables can lead to excessively long SQL statements, reduced readability and maintainability, worse query performance, inability to perform cross-database queries, and the need to write additional server-side program code.

Method used

By using a query configuration file, related queries are split into multiple query statements, which are then executed concurrently on the server side. This supports cross-database queries, reduces code redundancy, and improves code readability and query efficiency.

Benefits of technology

It enables cross-database queries, improves query efficiency and stability, reduces code redundancy, lowers expansion costs, and simplifies the development process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122240613A_ABST
    Figure CN122240613A_ABST
Patent Text Reader

Abstract

This invention discloses a data query method, a program product, an electronic device, and a storage medium. The data query method includes: receiving a query request sent by a client, the query request including an identifier of a specified query configuration file; determining and parsing the corresponding query configuration file based on the identifier, the query configuration file including query conditions for interleaving multiple data tables and multiple query statements, each query statement corresponding to at least one data table; and performing interleaved queries on the multiple data tables based on the query statements and the query conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a data query method, program product, electronic device and storage medium. Background Technology

[0002] When using Structured Query Language (SQL) to query data, it is necessary to integrate data scattered across multiple tables through related fields.

[0003] When performing related queries, the relevant technologies directly join multiple tables in a single query SQL. If there are too many tables to join, it means that the SQL is too long. Long SQL will reduce readability and maintainability, and will also lead to poor query performance. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a data query method, a program product, an electronic device, and a storage medium.

[0005] The technical solution of this invention is implemented as follows: On one hand, embodiments of the present invention provide a data query method, the method comprising: Receive a query request sent by a client, the query request including an identifier of a specified query configuration file; The corresponding query configuration file is determined and parsed based on the identifier; the query configuration file includes query conditions for querying multiple data tables and multiple query statements, each query statement corresponding to at least one data table; Based on the query statement and the query conditions, perform a related query on the multiple data tables.

[0006] In the above scheme, the join query includes a main query and at least one level of subqueries, with multiple subqueries at each level executed concurrently. The query conditions include the join order of at least one level of subqueries. The join query on the multiple data tables based on the query statement and the query conditions includes: The main query is executed based on the query statement of the main query, and the main query result is obtained; The at least one level of sub-queries are executed sequentially based on the main query result and the association order.

[0007] In the above scheme, the step of executing the at least one level of sub-queries sequentially based on the main query result and the association order includes: The values ​​of the associated fields are obtained from the main query results and used as query parameters for the first-level subquery; Multiple subqueries in the first-level subquery are executed concurrently. After all subqueries in each level are completed, the next-level subquery is determined according to the association order, and the values ​​of the associated fields are obtained from the query results of the current level as query parameters for the next-level subquery.

[0008] In the above scheme, the method further includes: The results of the main query and all subqueries are combined and integrated based on the associated fields to obtain the associated query results.

[0009] In the above scheme, the query configuration file includes the database corresponding to each subquery.

[0010] In the above scheme, the data query method is applied to the server, and the server receives the query request sent by the client through the query interface.

[0011] In the above scheme, the method further includes: Receive export requests for related query results sent by the client; The results of the related queries are returned to the client through the query interface.

[0012] On the other hand, embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described data query method.

[0013] On the other hand, embodiments of the present invention provide an electronic device including a processor and a memory, the processor and the memory being interconnected, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is configured to invoke the program instructions to execute the steps of the data query method provided in embodiments of the present invention.

[0014] On the other hand, embodiments of the present invention provide a computer-readable storage medium, comprising: the computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the steps of the data query method provided in the embodiments of the present invention.

[0015] The solution of this invention involves receiving a query request sent by a client, the query request including an identifier of a specified query configuration file; determining and parsing the corresponding query configuration file based on the identifier; the query configuration file includes query conditions for joining multiple data tables and multiple query statements, each query statement corresponding to at least one data table; and performing a join query on multiple data tables based on the query statements and the query conditions. This invention uses a query configuration file to implement join queries, eliminating the need for developers to write query statements on the client side; join queries can be quickly completed using the identifier of the specified query configuration file. Furthermore, the query configuration file divides a complete query statement into multiple query statements, which, compared to related technologies that join multiple tables in a single query SQL, effectively reduces code redundancy, improves code readability, and increases query efficiency. It also ensures that the logical complexity of each query SQL is controllable, thereby guaranteeing the stability of the overall query. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of an architecture for an associated query provided in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the implementation process of a data query method provided in an embodiment of the present invention; Figure 3 This invention provides a configurable multi-table join query framework and flowchart. Figure 4 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] In real-world projects, due to database normalization requirements, data from different dimensions is often distributed across different tables. Therefore, to meet most business query needs, when using SQL for data retrieval, it's necessary to integrate the data from multiple tables using join fields.

[0019] In related technologies, there are generally two common join solutions: The first is single-table query, which involves querying each table individually and then joining the results from all tables on the server side. Since the join logic between each table query needs to be implemented in the server-side code, the workload is significant. The second is join query, which directly joins multiple tables in a single SQL query. This solution is advantageous for quickly fulfilling query requirements and is more common in real-world projects. Join queries can quickly obtain complete data results and are widely used in data querying and data analysis scenarios, making them an essential skill for backend developers. However, join queries also have drawbacks. For example, they cannot join data across different databases in SQL. Furthermore, if the number of joined tables is too large, query performance will significantly degrade, a problem particularly prominent when using domestically developed databases.

[0020] In a typical client / server architecture, to meet the client's query needs, the server, after receiving a request, usually retrieves the required data from the database using a join query SQL, and then returns the query results to the client. A join query technique can be found here. Figure 1 As shown.

[0021] exist Figure 1 In SQL, join queries are primarily implemented using the keywords JOIN and ON. The client sends a query request to the server, which processes the request, executes the SQL query, retrieves the results from the database, and returns the results to the client. Using join queries in a client / server architecture offers a simple architecture and facilitates rapid fulfillment of query requirements. However, as business expands, the number of tables requiring joins increases, and when the number of joined tables becomes excessive, join queries exhibit several drawbacks.

[0022] While related queries using related technologies can quickly fulfill query requirements, they have the following drawbacks: 1. Unable to query cross-database data. A complete query SQL can only be executed in one database. If multiple tables are stored in different databases, cross-database data cannot be queried through join queries.

[0023] 2. Excessive number of join tables leads to poor query performance. Too many join tables result in numerous table join operations, causing issues such as increased data scanning scope, frequent temporary table generation, and index invalidation, ultimately degrading query performance. This problem is particularly pronounced in domestically developed distributed databases.

[0024] 3. If there are too many join tables, the execution plan will be unstable. As the number of join tables increases, the decision variables that the database optimizer needs to process increase exponentially, and the computational complexity increases dramatically. This may cause the optimizer to make completely different decisions on the join order, index selection, and filter condition priority, resulting in "jitter" in query efficiency.

[0025] 4. Too many related tables lead to poor readability. Too many related tables mean that the SQL statements are too long. Long SQL statements reduce readability and maintainability, and consequently reduce the system's scalability and flexibility.

[0026] 5. Difficult to scale up when encountering performance bottlenecks. Join queries are performed by the database. Too many joined tables can easily cause performance bottlenecks such as CPU and memory issues, requiring upgrades to the database hardware configuration for scaling up. In addition to the high cost, this may also involve backup and switchover operations, which can easily lead to data risks.

[0027] 6. Additional server-side program code is required. If the server is to provide a query interface, in addition to writing the query SQL, additional program code is needed to implement functions such as request processing, executing SQL queries, encapsulating and returning results.

[0028] To address the shortcomings of the aforementioned related technologies, embodiments of the present invention provide a data query method that can improve query efficiency and code readability. To illustrate the technical solution of the present invention, specific embodiments are described below.

[0029] Figure 2 This is a schematic diagram illustrating the implementation process of a data query method provided in an embodiment of the present invention. (Refer to...) Figure 1 Data query methods include: S201, Receive a query request sent by the client, the query request including an identifier of a specified query configuration file.

[0030] This embodiment can be deployed on the server side. This embodiment supports containerized deployment. An independent service can be deployed by introducing a Docker image and providing services to the outside world in the form of an interface.

[0031] The client sends a query request to the server through the query interface. The query request parameters include the id (identifier) ​​of the query configuration file and the query parameters defined in the query configuration file.

[0032] Each query configuration file has a unique ID. After the backend developers write the query configuration file, they provide the ID to the client. The client can then include this ID when sending a query request.

[0033] Both the id parameter and the query parameter are defined in the query configuration file. The client can directly view the configuration file to obtain the parameters, or the developers can provide parameter documentation.

[0034] S202, determine and parse the corresponding query configuration file according to the identifier; the query configuration file includes query conditions for querying multiple data tables and multiple query statements, each query statement corresponding to at least one data table.

[0035] The server stores pre-written query configuration files by the developers. The corresponding query configuration file is retrieved based on the query configuration file ID, and then the query configuration file is parsed.

[0036] The query configuration file contains query conditions for joining multiple data tables and multiple query statements. Each query statement can query at least one data table. Here, the query statement can be an SQL statement.

[0037] Compared to related technologies that associate multiple tables in a single query SQL, this embodiment can break down a long SQL query into multiple smaller SQL queries, which can effectively reduce code redundancy and improve code readability.

[0038] In other words, this embodiment of the invention divides a single SQL query into multiple SQL queries, which ensures that the logical complexity of each query SQL is controllable. This helps reduce the complexity of the database optimizer's computational cost, generates a stable execution plan, and thus guarantees the stability of the overall query.

[0039] Query conditions can include information such as the join method of the data tables, the column names of the specified data tables, and query parameters. Query conditions can specify the execution order of multiple query statements.

[0040] S203, perform a correlation query on the multiple data tables based on the query statement and the query conditions.

[0041] For example, multiple query statements can be executed in the order specified by the query conditions to complete a related query.

[0042] In some embodiments, the query results of each query statement can be concatenated to obtain the query results of the related query, and the query results can be returned to the client to complete the related query.

[0043] The solution of this invention involves receiving a query request sent by a client, the query request including an identifier of a specified query configuration file; determining and parsing the corresponding query configuration file based on the identifier; the query configuration file includes query conditions for joining multiple data tables and multiple query statements, each query statement corresponding to at least one data table; and performing a join query on multiple data tables based on the query statements and the query conditions. This invention uses a query configuration file to implement join queries, eliminating the need for developers to write query statements on the client side; join queries can be quickly completed using the identifier of the specified query configuration file. Furthermore, the query configuration file divides a complete query statement into multiple query statements, which, compared to related technologies that join multiple tables in a single query SQL, effectively reduces code redundancy, improves code readability, and increases query efficiency. It also ensures that the logical complexity of each query SQL is controllable, thereby guaranteeing the stability of the overall query.

[0044] Furthermore, the embodiments of the present invention only require writing a query configuration file to provide a query interface, which is conducive to quickly responding to query requests.

[0045] In some embodiments, the join query includes a main query and at least one level of subqueries, with multiple subqueries at each level executed concurrently. The query conditions include the join order of the at least one level of subqueries. The join query on the multiple data tables based on the query statement and the query conditions includes: The main query is executed based on the query statement of the main query, and the main query result is obtained; The at least one level of sub-queries are executed sequentially based on the main query result and the association order.

[0046] This embodiment adopts a hierarchical query approach, which can set a main query and at least one level of subqueries. The main query is executed first, and then the multi-level subqueries are executed sequentially. Each level of subqueries can consist of multiple subqueries, and the multiple subqueries at each level can be executed concurrently. Compared with long SQL, it is easier to hit the database cache, effectively improving query efficiency and avoiding the problem of excessively long SQL query time in the current domestically developed distributed database.

[0047] If there are requirements for the order of association, you can configure multi-level subqueries. Multiple subqueries at the same level are executed concurrently. After all the subqueries at each level are completed, the next level query is executed based on the query results of the previous level query.

[0048] In some embodiments, executing the at least one level of sub-queries sequentially based on the main query result and the association order includes: The values ​​of the associated fields are obtained from the main query results and used as query parameters for the first-level subquery; Multiple subqueries in the first-level subquery are executed concurrently. After all subqueries in each level are completed, the next-level subquery is determined according to the association order, and the values ​​of the associated fields are obtained from the query results of the current level as query parameters for the next-level subquery.

[0049] When executing a join query, the result of the previous query can be used as a parameter for the next query. After all subqueries at each level are completed, if there is a next subquery, the value of the join field is obtained based on the result of the current query and passed as a parameter to the next subquery.

[0050] In some embodiments, the method further includes: The results of the main query and all subqueries are combined and integrated based on the associated fields to obtain the associated query results.

[0051] After all subqueries have finished executing, the results of the main query and all subqueries are concatenated and integrated based on the associated fields to obtain the associated query results returned to the client.

[0052] In some embodiments, the query configuration file includes the database corresponding to each subquery.

[0053] This invention supports cross-database join queries, and each subquery can specify a data source, supporting cross-database queries and making it easier to handle database sharding and table partitioning scenarios.

[0054] In some embodiments, the data query method is applied to a server, which receives query requests sent by the client through a query interface.

[0055] The query service in this embodiment is independently deployable and easily scalable. It can be deployed independently on the basis of the existing system without intruding on the existing system. In terms of scalability, traditional relational queries are performed by the database, and may require database configuration upgrades when encountering performance bottlenecks. However, in this embodiment of the invention, the relational operation is performed by the server, which can effectively reduce the pressure on the database. Compared with database resources, cloud server resources are cheaper and easier to scale, effectively reducing expansion costs.

[0056] In some embodiments, the method further includes: Receive export requests for related query results sent by the client; The results of the related queries are returned to the client through the query interface.

[0057] If there is an export requirement, there is no need to provide a separate interface for exporting related query results to the client. The server will provide a unified export interface. The request parameters for the client to request the export interface are the same as those for the query interface. When the server receives the export request, it can encapsulate the related query results into an Excel file and return it to the client as a stream file.

[0058] For example, the query configuration file contains information such as the main query SQL, a list of related subqueries, related conditions, and query parameters. The server parses the contents of the query configuration file to execute the main query, execute subqueries, and perform join operations. Its file format can be a YAML file, and the following configuration is required: 1. Configure the query configuration file ID (identifier) The configuration file ID is specified by the developers and is used to locate the configuration file to be queried. It must be globally unique, and the client's query request parameters must specify the configuration file ID.

[0059] 2. Configure the main query SQL The main query SQL can be a single-table query or a multi-table join query. If there are requirements for dynamic query parameters, aggregation, sorting, etc., the tables corresponding to the fields involved should all be written into the main query SQL.

[0060] An example of a main query SQL is as follows: SQL: select from a where A.column1=:param1 AND A.column2 in :param2 AND A.column3 like :param3 Here, column1, column2, and column3 are the column names of the table, and param1, param2, and param3 correspond to the query parameters requested by the client. 3. 3. Configure the list of related subqueries. A subquery can also be an independent query configuration file. A subquery can be shared by multiple query configuration files, and it also includes the query configuration file ID, query SQL, query parameters, etc.

[0062] An example of a list of related subqueries is as follows: joinList: joinType: LEFT_JOIN (Association Method) joinOrder: 1 First-level subquery targetId: sub_query_id (related query ID) `on`: Associates conditions; multiple query conditions can be configured as an array. type: SOURCE_EQUALS_TARGET_COLUMN This is the join condition type, supporting conditions such as two columns being equal, the main query column being equal to a constant value, and the subquery column being equal to a constant value. sourceColumn:xxx Main Query Column `targetColumn:xxx` is a subquery column. The `select` list within the subquery must include this name. targetColumnQueryParam:xxx The query parameters of the subquery corresponding to the subquery column. selects: Configures the columns in the select statement, allowing multiple columns to be configured as an array. column:xxx Column name. This name must be included in the list selected in the subquery. alias:xxx (alias) targetParam: The query parameters for the subquery, configured as an array. type:FROM_PARAM Queries the parameter type, supports retrieving from global parameters, and specifies constants. `targteParam:xxx` is the query parameter, which must be consistent with the `name` of the `paramlist` parameter in the subquery. param:xxx specifies the value to retrieve from a specific key in the request parameters. type:CONSTANT Queries the parameter type, specifying a constant. targetParam:xxx constant:xxx joinType:LEFT_JOIN joinOrder: 2 Second-level subquery targetId: xxx joinType:LEFT_JOIN ... joinOrder: 3 Third-level subquery targetId: xxx The following provides a detailed explanation of the associated subquery configuration items: (1) joinType: Association method, currently supports LEFT JOIN.

[0063] (2) joinOrder: The order of association, supports multi-level subqueries, and multiple subqueries at the same level can be executed concurrently.

[0064] (3) targetId: Subquery ID, which specifies the query configuration file ID of the associated subquery.

[0065] (4) ON: The association condition requires specifying the main query column, subquery column, column association condition, etc.

[0066] (5) selects: Selects the result columns of a subquery, selects multiple columns in array form, and supports alias conversion.

[0067] (6) targetParams: Query parameters for the subquery, which can be provided by client request parameters or specified constants.

[0068] 4. Configure query parameters The SQL query parameters can be set according to the client's request parameters. Required fields can be configured, and array and fuzzy matching query methods are supported.

[0069] Here is an example of a query parameter: paramList: name: param1 Parameter name, corresponding to the query parameter in the client request. required: true Whether it is required name: param2 required: true `arr: true` requires this parameter to be set to true in IN queries. name: param3 required: true fuzzy: true. Like queries require this parameter to be specified as true. 5. Configure export parameters (optional) If there is a need to export related query results, an export configuration can be added. No additional code is required to implement the export interface; only the export file name and header mapping relationship need to be specified. The server will provide a unified export interface. The request parameters for the client requesting the export interface are the same as those for the query interface. Upon receiving the export request, the server will encapsulate the query results into an Excel file and return it to the client as a stream file.

[0070] Here is an example of exporting a configuration: exportConfig: Export file name title: "xxx" Export headers, separating field names and Chinese characters with colons, and separating multiple fields with commas. header: "name: Name, status: Status" The export configuration parameters here specify the filename, header, and other details of the Excel file. The advantage of this is that if exporting is required, there's no need to provide a separate Excel export interface to the client.

[0071] For example, embodiments of the present invention provide a configurable multi-table join query framework and flowchart, such as... Figure 3 As shown, the multi-table join query process includes: 1. The client sends a query request to the server. The client request parameters include: query configuration file ID (required) and query parameters defined in the query configuration file.

[0072] 2. The server processes the request. The server receives the client's query request and retrieves the query configuration file content based on the query configuration file ID.

[0073] 3. Parse the query configuration file to obtain the main query, list of related subqueries, and related conditions.

[0074] 4. Execute the main query Retrieve the main query results. For each subquery in the first-level subquery, based on the configured associated fields, retrieve the values ​​of the associated fields from the main query results and pass them as query parameters to the first-level subquery.

[0075] 5. Execute subquery If there are requirements regarding the order of association, you can configure multi-level subqueries. Multiple subqueries at the same level can be executed concurrently, which can improve query efficiency.

[0076] After all subqueries at each level are completed, if there is a subquery at the next level, the values ​​of the related fields are obtained based on the query results of the current level and passed as query parameters to the subquery at the next level.

[0077] 6. After all subqueries have finished executing, combine the results of the main query with the results of all subqueries based on the associated fields.

[0078] 7. Return the query results to the client. This invention achieves correlated query effects by configuring subqueries, with both the query and correlation operations performed by the server. In implementation, this invention service-orientedizes the configurable correlated query framework, deploying it as an independent service via a Docker image. The server provides functions such as handling client requests, parsing query configuration files, executing main and subqueries, concatenating correlations, and exporting files. Developers do not need to concern themselves with the server-side implementation details; they only need to write query configuration files to provide the query interface, facilitating rapid response to query requests. Compared to related technologies, the use of query configuration files is the core improvement and distinguishing feature of this invention.

[0079] This join query framework draws on the concept and thinking of "single-table query," supporting the splitting of a long SQL statement into multiple medium and small SQL statements through configuration. The SQL query and join result operations are all implemented uniformly by the server. Each SQL statement can specify a data source, thus supporting cross-database queries. Each SQL file is of moderate size and reusable, which is conducive to generating stable execution plans, reducing code redundancy, and improving readability. Multiple SQL queries can be executed concurrently, effectively improving query efficiency, optimizing system response performance, and thus enhancing user experience.

[0080] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0081] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0082] It should be noted that the technical solutions described in the embodiments of the present invention can be combined arbitrarily without conflict.

[0083] In addition, in the embodiments of the present invention, "first," "second," etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0084] In practical applications, the method steps of the above embodiments can be implemented by processors in electronic devices, such as central processing units (CPUs), digital signal processors (DSPs), microcontroller units (MCUs), or field-programmable gate arrays (FPGAs).

[0085] To implement the methods of the embodiments of this application, an electronic device is also provided.

[0086] Figure 4 This is a schematic diagram of the hardware structure of the electronic device according to an embodiment of this application, as shown below. Figure 4 As shown, the electronic device includes: A communication interface enables information exchange with other devices, such as network devices. The processor, connected to the communication interface, enables information interaction with other devices and, when running a computer program, executes the methods provided by one or more technical solutions on the electronic device side. The computer program is stored in memory.

[0087] Of course, in practical applications, the various components in an electronic device are coupled together through a bus system. It can be understood that the bus system is used to achieve communication and connection between these components. In addition to the data bus, the bus system also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in... Figure 4 The general will label all buses as bus systems.

[0088] The memory in this application embodiment is used to store various types of data to support the operation of the electronic device. Examples of such data include any computer program used to operate on the electronic device.

[0089] It is understood that memory can be volatile or non-volatile, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.

[0090] The methods disclosed in the embodiments of this application can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory. The processor reads the program from the memory and, in conjunction with its hardware, completes the steps of the aforementioned method.

[0091] Optionally, when the processor executes the program, it implements the corresponding processes implemented by the electronic device in the various methods of the embodiments of this application. For the sake of brevity, these will not be described in detail here.

[0092] In an exemplary embodiment, this application also provides a computer program product, including a computer program that can be executed by a processor of an electronic device to perform the steps described in the method of this application embodiment.

[0093] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a first memory storing a computer program, which can be executed by a processor of an electronic device to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.

[0094] In the several embodiments provided in this application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another system, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0095] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0096] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0097] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0098] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0099] It should be noted that the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.

[0100] In addition, in this application example, terms such as "first" and "second" are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0101] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data query method, characterized in that, The method includes: Receive a query request sent by a client, the query request including an identifier of a specified query configuration file; The corresponding query configuration file is determined and parsed based on the identifier; the query configuration file includes query conditions for querying multiple data tables and multiple query statements, each query statement corresponding to at least one data table; Based on the query statement and the query conditions, perform a related query on the multiple data tables.

2. The method according to claim 1, characterized in that, The join query includes a main query and at least one level of subqueries, with multiple subqueries at each level executed concurrently. The query conditions include the join order of the at least one level of subqueries. The join query on the multiple data tables based on the query statement and the query conditions includes: The main query is executed based on the query statement of the main query, and the main query result is obtained; The at least one level of sub-queries are executed sequentially based on the main query result and the association order.

3. The method according to claim 2, characterized in that, The step of executing the at least one level of sub-queries sequentially based on the main query result and the association order includes: The values ​​of the associated fields are obtained from the main query results and used as query parameters for the first-level subquery; Multiple subqueries in the first-level subquery are executed concurrently. After all subqueries in each level are completed, the next-level subquery is determined according to the association order, and the values ​​of the associated fields are obtained from the query results of the current level as query parameters for the next-level subquery.

4. The method according to claim 3, characterized in that, The method further includes: The results of the main query and all subqueries are combined and integrated based on the associated fields to obtain the associated query results.

5. The method according to claim 3, characterized in that, The query configuration file includes the database corresponding to each subquery.

6. The method according to claim 1, characterized in that, The data query method is applied to a server, which receives query requests sent by the client through a query interface.

7. The method according to claim 6, characterized in that, The method further includes: Receive export requests for related query results sent by the client; The results of the related queries are returned to the client through the query interface.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the data query method as described in any one of claims 1 to 7.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data query method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the steps of the data query method as described in any one of claims 1 to 7.