Data query method and device, electronic equipment and storage medium

By constructing a data query step execution process and a cache database, the processing of data query requests is optimized, solving the problem of low efficiency in traditional methods and achieving more efficient and stable data querying.

CN121833775APending Publication Date: 2026-04-10CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-22
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Traditional data query request processing methods are inefficient and cannot effectively meet the high requirements of enterprises and institutions for data accuracy and real-time performance.

Method used

By parsing data query requests, constructing step execution flow, utilizing cached data in the cache database for querying, and optimizing data query steps through feature extraction and modular design, combined with intelligent caching mechanisms and the construction of the cache database, query efficiency is improved.

Benefits of technology

It improves the execution efficiency of data query requests, reduces computing resource consumption and response time, and provides faster and more stable data services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121833775A_ABST
    Figure CN121833775A_ABST
Patent Text Reader

Abstract

The invention discloses a data query method and device, electronic equipment and a storage medium. The method comprises the following steps: under the condition that a data query request is received, analyzing the data query request to obtain a plurality of data query steps and a dependency relationship among the plurality of data query steps; based on the dependency relationship, constructing a step execution process of the plurality of data query steps, the step execution process being used for representing execution logic between different data query steps; and executing a plurality of data query steps based on the step execution process to query cached data cached in the cache database to obtain a data query result, the cached data being used for representing data obtained by screening and preprocessing initial data meeting a preset condition in the initial database. The technical problem that the efficiency of executing the data query request is low in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing, and more specifically, to a data query method, apparatus, electronic device, and storage medium. Background Technology

[0002] Currently, enterprises and institutions face ever-increasing data volumes and complex data processing needs, especially in fields such as auditing and financial analysis, where the accuracy and real-time performance of data are extremely important. However, traditional data query request processing methods typically parse and execute data query statements one by one according to the order they are entered by the user. This usually consumes a lot of time in actual processing, resulting in low efficiency in executing data query requests.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This invention provides a data query method, apparatus, electronic device, and storage medium to at least address the technical problem of low efficiency in executing data query requests in related technologies.

[0005] According to one aspect of the present invention, a data query method is provided, comprising: upon receiving a data query request, parsing the data query request to obtain multiple data query steps and dependencies between the multiple data query steps; based on the dependencies, constructing a step execution flow for the multiple data query steps, wherein the step execution flow is used to characterize the execution logic between different data query steps; and executing the multiple data query steps based on the step execution flow to query cached data in a cache database to obtain data query results, wherein the cached data is used to characterize data obtained by filtering and preprocessing initial data in an initial database that meets preset conditions.

[0006] Furthermore, multiple data query steps are executed based on the step execution flow, including: extracting features from any data query step to obtain step features; determining step execution modules from the execution module library based on the step features, wherein the execution module library stores multiple target execution modules, and the step execution modules are used to characterize the execution modules that match the data query steps among the multiple target execution modules; and executing multiple data query steps according to the step execution flow based on the step execution modules corresponding to the multiple data query steps.

[0007] Furthermore, the above method also includes: splitting the execution process of the data query model to obtain multiple initial query steps; modularizing the multiple initial query steps to obtain multiple initial execution modules; testing the multiple initial execution modules using a test sample set to obtain module test results, wherein the test sample set contains multiple test samples, and different test samples are used to test different initial execution modules; and if the module test results indicate that the multiple initial execution modules have passed the test, the multiple initial execution modules are determined to be multiple target execution modules.

[0008] Furthermore, the above method also includes: obtaining the module identifier of the step execution module during the execution of the corresponding data query step using any step execution module; matching the module identifier with multiple cache identifiers stored in the identifier cache library to obtain the identifier matching result, wherein the identifier cache library is used to store the identifiers of the step execution modules corresponding to the executed data query steps; if the identifier matching result indicates that the module identifier does not match with any of the multiple cache identifiers, executing the corresponding data query step using any step execution module and storing the module identifier in the identifier cache library.

[0009] Furthermore, the above method also includes: obtaining the data access frequency and data change frequency of any initial data in the initial database; determining that the initial data meets the preset conditions when the data access frequency is greater than a first preset threshold and the data change frequency is less than a second preset threshold; preprocessing the initial data to obtain cached data; and constructing a cached database based on the cached data.

[0010] Furthermore, constructing a cache database based on cached data includes: extracting features from the cached data to obtain data features of the cached data; and dividing the cached data into target cache regions based on the data features to construct a cache database, wherein the cache database includes multiple cache regions, and the target cache region is used to represent the cache region that matches the data features among the multiple cache regions.

[0011] Furthermore, the above method also includes: if the query for cached data in the cache database fails, re-execute the steps of executing multiple data queries based on the step execution process to query the initial data stored in the initial database and obtain new data query results.

[0012] Furthermore, before parsing the data query request to obtain multiple data query steps and the dependencies between them, the method also includes: extracting features from the initial query request input by the user to obtain the statement features of the initial query request; and adjusting the initial query request according to preset rules based on the statement features to obtain the data query request.

[0013] According to another aspect of the present invention, a data query apparatus is also provided, comprising: a statement parsing module, configured to parse a data query request upon receiving it, thereby obtaining multiple data query steps and dependencies between the multiple data query steps; a process construction module, configured to construct a step execution flow for the multiple data query steps based on the dependencies, wherein the step execution flow is used to characterize the execution logic between different data query steps; and a data query module, configured to execute the multiple data query steps based on the step execution flow to query cached data in a cache database and obtain data query results, wherein the cached data is used to characterize data obtained by filtering and preprocessing initial data in an initial database that meets preset conditions.

[0014] Furthermore, the data query module is also used for: extracting features from any data query step to obtain step features; determining the step execution module from the execution module library based on the step features, wherein the execution module library stores multiple target execution modules, and the step execution module is used to characterize the execution module that matches the data query step among the multiple target execution modules; and executing multiple data query steps according to the step execution flow based on the step execution modules corresponding to the multiple data query steps.

[0015] Furthermore, the aforementioned data query device is also used to: decompose the execution process of the data query model to obtain multiple initial query steps; modularize the multiple initial query steps to obtain multiple initial execution modules; test the multiple initial execution modules using a test sample set to obtain module test results, wherein the test sample set contains multiple test samples, and different test samples are used to test different initial execution modules; and if the module test results indicate that the multiple initial execution modules have all passed the test, determine the multiple initial execution modules as multiple target execution modules.

[0016] Furthermore, the aforementioned data query device is also used to: obtain the module identifier of the step execution module during the execution of a corresponding data query step using any step execution module; match the module identifier with multiple cache identifiers stored in the identifier cache library to obtain an identifier matching result, wherein the identifier cache library is used to store the identifiers of the step execution modules corresponding to the executed data query steps; and when the identifier matching result indicates that the module identifier does not match any of the multiple cache identifiers, execute the corresponding data query step using any step execution module and store the module identifier in the identifier cache library.

[0017] Furthermore, the aforementioned data query device is also used to: obtain the data access frequency and data change frequency of any initial data in the initial database; determine that the initial data meets preset conditions when the data access frequency is greater than a first preset threshold and the data change frequency is less than a second preset threshold; preprocess the initial data to obtain cached data; and construct a cached database based on the cached data.

[0018] Furthermore, the aforementioned data query device is also used to: extract features from cached data to obtain data features of the cached data; and based on the data features, divide the cached data into target cache regions to construct a cache database, wherein the cache database includes multiple cache regions, and the target cache region is used to characterize the cache region that matches the data features among the multiple cache regions.

[0019] Furthermore, the aforementioned data query device is also used to: when the data query result indicates that the query for cached data in the cache database has failed, to re-execute the steps of performing multiple data queries based on the step execution process, so as to query the initial data stored in the initial database and obtain new data query results.

[0020] Furthermore, the aforementioned data query device is also used to: extract features from the initial query request input by the user to obtain the statement features of the initial query request; and adjust the initial query request according to preset rules based on the statement features to obtain the data query request.

[0021] According to another aspect of the present invention, an electronic device is also provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods of various embodiments of the present invention during runtime.

[0022] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is executed, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of the present invention.

[0023] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods of various embodiments of the present invention.

[0024] According to another aspect of the present invention, a computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods of various embodiments of the present invention.

[0025] According to another aspect of the present invention, a computer program is also provided, which, when executed by a processor, implements the methods of the various embodiments of the present invention.

[0026] In this embodiment of the invention, upon receiving a data query request, the data query request is parsed to obtain multiple data query steps and the dependencies between these steps. Based on these dependencies, an execution flow for the multiple data query steps is constructed. The multiple data query steps are then executed according to this execution flow to query cached data in a cache database and obtain the query results. By utilizing the dependencies between different data query steps in the data query request to construct the execution flow for these data query steps, and then following this execution flow to query the target data corresponding to the data query request from the cache database after data filtering and preprocessing, the efficiency of executing data query requests can be effectively improved, thus solving the technical problem of low efficiency in executing data query requests in related technologies. Attached Figure Description

[0027] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0028] Figure 1 This is a flowchart illustrating a data query method according to an embodiment of the present invention;

[0029] Figure 2 This is a structural block diagram of a data query device according to an embodiment of the present invention. Detailed Implementation

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

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] According to an embodiment of the present invention, a method embodiment of a data query method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0033] Figure 1 This is a flowchart illustrating a data query method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0034] Step S102: Upon receiving a data query request, the data query request is parsed to obtain multiple data query steps and the dependencies between them.

[0035] The aforementioned data query request can refer to a request to query the target data that the user wants to query, such as "get the sales data for the first quarter of 2022 from all financial statements" or "compare the inventory levels for the same period last year and this year".

[0036] The data query steps mentioned above can refer to the steps that the query system needs to perform in the process of executing a data query request to query the target data, such as data filtering (e.g., filtering by date range), data aggregation (e.g., calculating total sales), and data association (e.g., merging sales data with inventory data).

[0037] In one optional embodiment, upon receiving a data query request, the query system can first parse the data query request to obtain the multiple data query steps that must be executed during the execution of the data query request, as well as the dependencies between different data query steps.

[0038] For example, suppose there is a data query request A: "Get and compare quarterly profits for the past two years". During the execution of data query request A, the query system can first use the parsing engine to parse the request, obtaining the corresponding data query steps A (get financial data), B (summarize profits by quarter), and C (compare quarterly profits for the past two years). Simultaneously, the system determines the dependencies between data query steps A, B, and C. For instance, data query step B requires calculations based on the results of data query step A, while data query step C depends on the results of data query step B for comparison.

[0039] By identifying the multiple data query steps corresponding to a data query request and the dependencies between different data query steps, the query system can understand the task nature, execution order, and possible parallel processing opportunities of each step. This allows for the generation of a faster execution plan, the rational allocation of resources, and the effective improvement of query efficiency and response speed. It also provides a basis for implementing caching strategies, enabling the reduction of redundant calculations without affecting data accuracy and further adjustments to resource usage.

[0040] Step S104: Based on the dependency relationship, construct the execution flow of multiple data query steps.

[0041] The step execution flow is used to characterize the execution logic between different data query steps.

[0042] In one optional embodiment, after obtaining multiple data query steps and their corresponding dependencies, the query system can construct the step execution flow corresponding to these multiple data query steps according to the dependencies. This allows the query system to arrange and execute the data query steps in an orderly manner through the step execution flow, ensuring the continuity and logic of the data processing process, avoiding data processing redundancy, and thereby improving the overall query efficiency and response speed.

[0043] Step S106: Perform multiple data query steps based on the step execution flow to query the cached data in the cache database and obtain the data query results.

[0044] The cached data is used to represent the data obtained by filtering and preprocessing the initial data in the initial database that meets the preset conditions.

[0045] The aforementioned initial database can refer to an internal database or task database of an enterprise, which stores the enterprise's raw data, such as financial records, transaction details, user information, and other data.

[0046] In one optional embodiment, after the step execution flow is constructed, the query system can execute these multiple data query steps according to the step execution flow to query the target data of interest to the user. Considering that during the data query process, the query system typically needs to progressively filter data related to the data query request from the initial database to find the target data of interest to the user, and since the initial database may contain a very large amount of data, directly querying the data in the initial database may consume a large amount of computing resources and time, resulting in excessively long query response times and a poor user experience.

[0047] Therefore, before actually executing a data query request, the query system can first use preset conditions to filter and preprocess the initial data stored in the initial database to obtain the aforementioned cached data. Then, it can use this cached data to initially construct a cached database. The corresponding query system can then quickly locate and access the preprocessed target data through the cached database, reducing database I / O (Input / Output) operations and computational burden, thereby improving the efficiency of executing data query requests, shortening query response time, and providing users with faster and more stable data services.

[0048] In this embodiment of the invention, upon receiving a data query request, the data query request is parsed to obtain multiple data query steps and the dependencies between these steps. Based on these dependencies, an execution flow for the multiple data query steps is constructed. The multiple data query steps are then executed according to this execution flow to query cached data in a cache database and obtain the query results. By utilizing the dependencies between different data query steps in the data query request to construct the execution flow for these data query steps, and then following this execution flow to query the target data corresponding to the data query request from the cache database after data filtering and preprocessing, the efficiency of executing data query requests can be effectively improved, thus solving the technical problem of low efficiency in executing data query requests in related technologies.

[0049] Furthermore, multiple data query steps are executed based on the step execution flow, including: extracting features from any data query step to obtain step features; determining step execution modules from the execution module library based on the step features, wherein the execution module library stores multiple target execution modules, and the step execution modules are used to characterize the execution modules that match the data query steps among the multiple target execution modules; and executing multiple data query steps according to the step execution flow based on the step execution modules corresponding to the multiple data query steps.

[0050] In one optional embodiment, in order to efficiently and flexibly execute multiple data query steps according to the step execution process, the query system can first extract features from any data query step to obtain the corresponding step features. These features may include information such as the type of data query (e.g., JOIN, SELECT, GROUP BY), data source, query conditions, and output format.

[0051] Then, the query system can leverage the step features to determine the corresponding execution module from the execution module library. The execution module library is a database containing multiple predefined target execution modules, each corresponding to a data processing logic or algorithm, such as a data filtering module, a data aggregation module, or a data JOIN module. By matching these with the step features, the query system can automatically select the most suitable execution module for the current data query step, thereby achieving automated and intelligent data query processing.

[0052] Finally, the query system can execute multiple data query steps according to the constructed step execution flow through the step execution modules corresponding to different data query steps, thereby realizing the automated execution of data queries, improving the efficiency and accuracy of data processing, reducing human error, and enabling the query system to adapt to query needs of different complexity and types, providing more stable and faster data services.

[0053] The execution module library can refer to a pre-built database used to store multiple target execution modules. Different target execution modules can implement different data query functions. The corresponding step execution module determined from the execution module library based on the step characteristics of the data query steps can refer to the execution module that matches the step characteristics among the multiple target execution modules and can implement the corresponding function of the data query steps.

[0054] Furthermore, the above method also includes: splitting the execution process of the data query model to obtain multiple initial query steps; modularizing the multiple initial query steps to obtain multiple initial execution modules; testing the multiple initial execution modules using a test sample set to obtain module test results, wherein the test sample set contains multiple test samples, and different test samples are used to test different initial execution modules; and if the module test results indicate that the multiple initial execution modules have passed the test, the multiple initial execution modules are determined to be multiple target execution modules.

[0055] In one optional embodiment, to accurately determine the execution modules matching the step features, the query system can first decompose the execution process of the pre-trained data query model into multiple initial query steps during the construction of the execution module library. Then, these initial query steps are modularized to obtain multiple initial execution modules. Next, the query system can use multiple test samples contained in the strategy sample set to test the functionality of different initial execution modules, obtaining module test results to determine whether the corresponding initial execution modules can stably and accurately implement their respective functions. If the module test results show that multiple initial execution modules have passed the test, i.e., can implement their respective functions, the query module can determine these multiple initial execution modules as multiple target execution modules to construct the corresponding execution module library.

[0056] Furthermore, the above method also includes: obtaining the module identifier of the step execution module during the execution of the corresponding data query step using any step execution module; matching the module identifier with multiple cache identifiers stored in the identifier cache library to obtain the identifier matching result, wherein the identifier cache library is used to store the identifiers of the step execution modules corresponding to the executed data query steps; if the identifier matching result indicates that the module identifier does not match with any of the multiple cache identifiers, executing the corresponding data query step using any step execution module and storing the module identifier in the identifier cache library.

[0057] In one optional embodiment, to avoid repeatedly executing the same data query step and improve the overall efficiency of review report processing, the query system employs an intelligent caching mechanism. Specifically, during the execution of a corresponding data query step using any step execution module, the query system first obtains the unique module identifier of that step execution module. This identifier can be the module's ID, hash value, or other encoding that uniquely identifies the module.

[0058] Next, the query system matches the obtained module identifier with multiple cache identifiers stored in the identifier cache database, which is a database specifically used to record the execution module identifiers of data query steps that have been successfully executed. By comparing the module identifier and the cache identifiers, the query system can determine whether the data query step that needs to be executed has already been executed, thereby avoiding unnecessary duplicate calculations.

[0059] If the identifier of the identifier matching result does not match with multiple cached identifiers, meaning that the data query step corresponding to the current step execution module has not been cached or executed, the query system can execute that data query step. Simultaneously, the system will store the module identifier in the identifier cache library for quick location and retrieval of subsequent identical or similar data query steps. This enables one-time calculation for multiple uses, significantly improving the query performance of the audit report system, reducing database load, and providing a faster and more efficient service experience for task users.

[0060] In this way, the intelligent caching mechanism can not only effectively reduce repetitive calculations and database I / O operations, but also accelerate data query response time, ensuring the efficiency and timeliness of audit report processing, and further improving the overall system performance and resource utilization. Meanwhile, the establishment and maintenance of the identifier cache library has become an important part of system tuning. It helps the system build an index of historical execution steps, providing the possibility of fast retrieval and reuse for future query requests, and is a key technical means to achieve continuous tuning and efficiency improvement in audit report processing.

[0061] Furthermore, the above method also includes: obtaining the data access frequency and data change frequency of any initial data in the initial database; determining that the initial data meets the preset conditions when the data access frequency is greater than a first preset threshold and the data change frequency is less than a second preset threshold; preprocessing the initial data to obtain cached data; and constructing a cached database based on the cached data.

[0062] In one optional embodiment, to improve the efficiency and usability of the constructed cache database and ensure high access volume and low variability of cached data, thereby guaranteeing the effectiveness of the caching strategy, the query system can first obtain the data access frequency and data change frequency of any initial data in the initial database during the construction process. The data access frequency refers to the number of times specific data is queried or accessed within a certain time range, reflecting the popularity and importance of the data. The data change frequency refers to the frequency with which data is modified or updated within a certain time range, reflecting the dynamic and real-time requirements of the data.

[0063] Then, the query system can determine that the initial data meets preset conditions if the data access frequency is greater than a first preset threshold and the data change frequency is less than a second preset threshold. The first and second preset thresholds are set by the system administrator or algorithm based on actual task requirements and database performance. They are used to filter out data with high access volume and low variability. This data is most suitable for caching because it is frequently queried but does not change much. Caching can significantly reduce I / O operations on the initial database and improve query efficiency.

[0064] After determining that the initial data meets the preset conditions, the query system can preprocess the initial data, including data cleaning, format conversion, preliminary calculation, and other operations, to obtain cached data. The purpose of preprocessing is to reduce the amount of calculation and data transmission during subsequent queries, so that the cached data can be accessed and processed more quickly during queries.

[0065] Finally, the query system can build a cache database based on the cached data. This process involves data storage and index adjustments to ensure that cached data can be retrieved and loaded quickly. A cache database built in this way significantly improves the response speed of data queries and the overall operating efficiency of the system, while reducing the load on the initial database. Especially when dealing with large-scale data, the use of a cache database can greatly improve the user experience, increase the speed of report generation, and support more efficient data analysis and task decision-making.

[0066] Furthermore, constructing a cache database based on cached data includes: extracting features from the cached data to obtain data features of the cached data; and dividing the cached data into target cache regions based on the data features to construct a cache database, wherein the cache database includes multiple cache regions, and the target cache region is used to represent the cache region that matches the data features among the multiple cache regions.

[0067] In one optional embodiment, when constructing a cache database using cached data, in order to manage and access the cached data more accurately and quickly, and improve the efficiency of data querying, the query system can extract features from the cached data to obtain its data features. These data features may include, but are not limited to, the type, size, access frequency, update cycle, data type (such as text, numbers, dates, etc.), and other attributes that can be used to distinguish and classify the cached data.

[0068] Then, the query system can further divide the cached data into target cache regions based on data characteristics to build a cache database. Specifically, the cache database is designed with an architecture containing multiple cache regions, each with its specific use case and storage strategy, such as high-frequency access regions, latest data regions, and long-unupdated regions. The target cache region refers to the most suitable storage location selected from multiple cache regions based on the data characteristics of the cached data. The storage strategy and access adjustment method of this region have the highest degree of matching with the data characteristics, which can maximize data access speed and reduce resource consumption.

[0069] By dividing the cached data into regions in the cache database, the query system can achieve fine-grained data management and high-speed access, reduce the time of global search, improve the speed and hit rate of data query, and at the same time facilitate dynamic adjustment of caching strategies according to changes in data characteristics, ensuring that the cache database is always in a preset state, and providing task users with more stable and efficient data query services.

[0070] Furthermore, region partitioning helps balance the load on the cache database, preventing bottlenecks caused by concentrated access to certain hot data sets, and improving the overall stability and availability of the system. Through effective organization and management of cached data, the query system further enhances resource utilization efficiency and user experience.

[0071] Furthermore, the above method also includes: if the query for cached data in the cache database fails, re-execute the steps of executing multiple data queries based on the step execution process to query the initial data stored in the initial database and obtain new data query results.

[0072] In one optional embodiment, in order to effectively query target data of interest to users, if the data query result indicates that the query of cached data in the cache database fails, the query system can re-execute the steps of executing multiple data queries based on the step execution process to query the initial data stored in the initial database and obtain new data query results.

[0073] Furthermore, before parsing the data query request to obtain multiple data query steps and the dependencies between them, the method also includes: extracting features from the initial query request input by the user to obtain the statement features of the initial query request; and adjusting the initial query request according to preset rules based on the statement features to obtain the data query request.

[0074] In one optional embodiment, to improve the efficiency of the query system in understanding and executing data query requests and to ensure the standardization and compatibility of query requests, the query system extracts features from the initial query request input by the user before parsing it, obtaining the statement features of the initial query request. These statement features include, but are not limited to, key information such as query type (e.g., SELECT, JOIN), data source, query range (e.g., time interval or dataset range), filtering conditions, and output format.

[0075] Next, the query system adjusts the initial query request based on the extracted statement features and according to preset request adjustment rules. These preset rules may include syntax correction, query adjustment, and data source adaptation to ensure the query request can be correctly parsed and executed efficiently. For example, the system may need to convert non-standard SQL statements (Structured Query Language) into standard SQL statements, transform fuzzy conditions in the query into precise filtering conditions, or adjust JOIN conditions to utilize database indexes.

[0076] Through the above steps, the query system can obtain a more standardized data query request. This request can not only be correctly parsed but also adjusted according to statement characteristics and preset rules to reduce potential performance bottlenecks during execution and improve query response speed. Simultaneously, the adjusted data query request can better adapt to the characteristics of different database systems, ensuring accurate and efficient data processing results in various technical environments, thereby improving the usability and user experience of the entire audit report processing system.

[0077] It should be noted that the collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0078] In the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used the solution.

[0079] According to an embodiment of the present invention, an apparatus embodiment for a data query method is provided. It should be noted that the apparatus can be used to execute the above-described data query method. Figure 2 This is a structural block diagram of a data query device according to an embodiment of the present invention, such as... Figure 2 As shown, the device includes: a statement parsing module 202, a process construction module 204, and a data query module 206.

[0080] The statement parsing module 202 is used to parse the data query request upon receiving it, and obtain multiple data query steps and the dependencies between them. The process construction module 204 is used to construct the execution flow of the multiple data query steps based on the dependencies, wherein the execution flow represents the execution logic between different data query steps. The data query module 206 is used to execute the multiple data query steps based on the execution flow to query the cached data in the cache database and obtain the data query results, wherein the cached data represents the data obtained by filtering and preprocessing the initial data in the initial database that meets the preset conditions.

[0081] Furthermore, the data query module is also used for: extracting features from any data query step to obtain step features; determining the step execution module from the execution module library based on the step features, wherein the execution module library stores multiple target execution modules, and the step execution module is used to characterize the execution module that matches the data query step among the multiple target execution modules; and executing multiple data query steps according to the step execution flow based on the step execution modules corresponding to the multiple data query steps.

[0082] Furthermore, the aforementioned data query device is also used to: decompose the execution process of the data query model to obtain multiple initial query steps; modularize the multiple initial query steps to obtain multiple initial execution modules; test the multiple initial execution modules using a test sample set to obtain module test results, wherein the test sample set contains multiple test samples, and different test samples are used to test different initial execution modules; and if the module test results indicate that the multiple initial execution modules have all passed the test, determine the multiple initial execution modules as multiple target execution modules.

[0083] Furthermore, the aforementioned data query device is also used to: obtain the module identifier of the step execution module during the execution of a corresponding data query step using any step execution module; match the module identifier with multiple cache identifiers stored in the identifier cache library to obtain an identifier matching result, wherein the identifier cache library is used to store the identifiers of the step execution modules corresponding to the executed data query steps; and when the identifier matching result indicates that the module identifier does not match any of the multiple cache identifiers, execute the corresponding data query step using any step execution module and store the module identifier in the identifier cache library.

[0084] Furthermore, the aforementioned data query device is also used to: obtain the data access frequency and data change frequency of any initial data in the initial database; determine that the initial data meets preset conditions when the data access frequency is greater than a first preset threshold and the data change frequency is less than a second preset threshold; preprocess the initial data to obtain cached data; and construct a cached database based on the cached data.

[0085] Furthermore, the aforementioned data query device is also used to: extract features from cached data to obtain data features of the cached data; and based on the data features, divide the cached data into target cache regions to construct a cache database, wherein the cache database includes multiple cache regions, and the target cache region is used to characterize the cache region that matches the data features among the multiple cache regions.

[0086] Furthermore, the aforementioned data query device is also used to: when the data query result indicates that the query for cached data in the cache database has failed, to re-execute the steps of performing multiple data queries based on the step execution process, so as to query the initial data stored in the initial database and obtain new data query results.

[0087] Furthermore, the aforementioned data query device is also used to: extract features from the initial query request input by the user to obtain the statement features of the initial query request; and adjust the initial query request according to preset rules based on the statement features to obtain the data query request.

[0088] Embodiments of this application also provide an electronic device, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of the present invention during runtime.

[0089] Embodiments of this application also provide a computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of the present invention.

[0090] Embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the methods of various embodiments of the present invention.

[0091] Embodiments of this application also provide a computer program product, including a non-volatile computer-readable storage medium for storing a computer program that, when executed by a processor, implements the methods in various embodiments of the present invention.

[0092] Embodiments of this application also provide a computer program that, when executed by a processor, implements the methods described in the various embodiments of the present invention.

[0093] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0094] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0095] The units described 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 units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0096] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0097] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, 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 steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0098] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A data query method, characterized by, The method comprises the following steps: In the case of receiving a data query request, the data query request is parsed to obtain a plurality of data query steps and a dependency relationship between the plurality of data query steps; Based on the dependency relationship, a step execution flow of the plurality of data query steps is constructed, wherein the step execution flow is used to represent the execution logic between different data query steps; Based on the step execution flow, the plurality of data query steps are executed to query the cached data in the cache database to obtain a data query result, wherein the cached data is used to represent the data obtained by filtering and preprocessing the initial data in the initial database that meets the preset condition.

2. The method of claim 1, wherein, Executing the plurality of data query steps based on the step execution flow comprises: extracting features of any one data query step to obtain step features; determining a step execution module from an execution module library based on the step features, wherein the execution module library stores a plurality of target execution modules, and the step execution module is used to represent the execution module in the plurality of target execution modules that matches the data query step; executing the plurality of data query steps according to the step execution flow based on the step execution modules corresponding to the plurality of data query steps.

3. The method of claim 2, wherein, The method further comprises: splitting the execution process of the data query model to obtain a plurality of initial query steps; modularizing the plurality of initial query steps to obtain a plurality of initial execution modules; testing the plurality of initial execution modules respectively using a test sample set to obtain a module test result, wherein the test sample set contains a plurality of test samples, and different test samples are used to test different initial execution modules; in the case that the module test result represents that the plurality of initial execution modules all pass the test, determining that the plurality of initial execution modules are the plurality of target execution modules.

4. The method of claim 2, wherein, The method further comprises: obtaining a module identifier of the step execution module in the process of executing the corresponding data query step using any one step execution module; matching the module identifier with a plurality of cache identifiers stored in an identifier cache library to obtain an identifier matching result, wherein the identifier cache library is used to store the identifiers of the step execution modules corresponding to the data query steps that have been executed; in the case that the identifier matching result represents that the module identifier does not match the plurality of cache identifiers, executing the corresponding data query step using any one step execution module and storing the module identifier in the identifier cache library.

5. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: obtaining a data access frequency and a data change frequency of any one initial data in the initial database; in the case that the data access frequency is greater than a first preset threshold and the data change frequency is less than a second preset threshold, determining that the initial data meets the preset condition; preprocessing the initial data to obtain the cached data; constructing the cache database based on the cached data.

6. The method of claim 5, wherein, Constructing the cache database based on the cached data comprises: extracting features of the cached data to obtain data features of the cached data; Based on the data feature, the cache data is divided into a target cache area, and a cache database is constructed, wherein the cache database includes a plurality of cache areas, and the target cache area is used to represent a cache area in the plurality of cache areas that matches the data feature.

7. The method of claim 1, wherein, The method further includes: In a case where the data query result represents a failure to query the cached cache data in the cache database, the step of executing the plurality of data queries based on the step execution process is re-executed to query the initial data stored in the initial database, and a new data query result is obtained.

8. The method of claim 1, wherein, Before the data query request is parsed to obtain the plurality of data query steps and the dependency relationship between the plurality of data query steps, the method further includes: The initial query request input by the user is subjected to feature extraction to obtain a sentence feature of the initial query request; Based on the sentence feature, the initial query request is adjusted according to a preset rule to obtain the data query request.

9. A data query apparatus, characterized by comprising: It includes: The sentence analysis module is configured to parse the data query request to obtain the plurality of data query steps and the dependency relationship between the plurality of data query steps when the data query request is received; The process construction module is configured to construct a step execution process of the plurality of data query steps based on the dependency relationship, wherein the step execution process is used to represent the execution logic between different data query steps; The data query module is configured to execute the plurality of data query steps based on the step execution process to query the cached cache data in the cache database, and obtain a data query result, wherein the cache data is used to represent data obtained by filtering and preprocessing initial data in an initial database that meets a preset condition.

10. An electronic device, comprising: It includes: A memory that stores an executable program; A processor configured to run the program, wherein the program, when executed, performs the method of any one of claims 1 to 8.

11. A computer readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein the executable program, when executed, controls the device where the storage medium is located to perform the method of any one of claims 1 to 8.

12. A computer program product, characterised in that, It includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 8.