Data query method and data query device

CN123012014APending Publication Date: 2026-10-30SWEET POTATO TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611466274.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-20
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0003]然而,相关查询方式对聚合比较、连续性判断、多条件组合及排序等复杂查询需求的支持能力有限,用户通常需要多次设置或调整查询条件,操作较为繁琐

Benefits of technology

[0010]本说明书一个实施例提供的数据查询方法,通过对数据查询请求进行解析,将数据查询请求所表达的查询意图划分为用于表征数据查询范围的查询条件信息和用于表征待分析数据的分析处理逻辑的分析逻辑信息,使数据范围的确定过程与针对范围内数据的分析过程相互分离;进而先基于查询条件信息获得与数据查询范围对应的待分析数据,再将分析逻辑信息限定作用于该待分析数据,以获得符合分析处理逻辑的目标对象标识,最后基于目标对象标识查询目标对象数据。由此,可以在支持聚合、比较、筛选、排序等复杂查询意图的同时,避免直接利用分析逻辑信息对范围未经限定的数据进行处理,并将目标对象标识的确定过程与目标对象数据的查询过程相分离,减少分析处理涉及的数据量,降低复杂分析处理过程的执行负担,提高数据查询的准确性和查询效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012014A_ABST
    Figure CN123012014A_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a data query method and a data query device, wherein the data query method comprises: obtaining a data query request; parsing the data query request to obtain query condition information and analysis logic information, wherein the query condition information is used to represent a data query range corresponding to the data query request, and the analysis logic information is used to represent an analysis processing logic for to-be-analyzed data corresponding to the data query range; performing data query based on the query condition information to obtain the to-be-analyzed data, and performing analysis processing on the to-be-analyzed data based on the analysis logic information to obtain a target object identifier; and querying target object data corresponding to the data query request based on the target object identifier. Avoiding directly processing data without a range limit using the analysis logic information, reducing the amount of data involved in the analysis processing, reducing the execution burden of the complex analysis processing process, and improving the accuracy and query efficiency of data query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of computer technology, and in particular to data query methods and data query devices. Background Technology

[0002] As data scale and dimensions continue to increase, data query systems are widely used for retrieving and analyzing object data. Related data query systems typically offer query methods such as identifier query, name query, and conditional filtering. Users can set query conditions such as time range, object status, and indicator thresholds to retrieve the desired object data from large amounts of data.

[0003] However, the existing query methods have limited support for complex query needs such as aggregation comparisons, continuity judgments, multi-condition combinations, and sorting. Users often need to set or adjust query conditions multiple times, making the process cumbersome. Furthermore, when there are many data fields and complex data relationships, complex queries involve a large amount of data processing, easily leading to problems such as long query times, inaccurate query results, and a heavy burden of repeated queries. Summary of the Invention

[0004] In view of this, embodiments of this specification provide a data query method. One or more embodiments of this specification also relate to a data query apparatus, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.

[0005] According to a first aspect of the embodiments of this specification, a data query method is provided, including: Get data query request; The data query request is parsed to obtain query condition information and analysis logic information. The query condition information is used to characterize the data query range corresponding to the data query request, and the analysis logic information is used to characterize the analysis and processing logic for the data to be analyzed corresponding to the data query range. The data query is performed based on the query conditions to obtain the data to be analyzed, and the data to be analyzed is processed based on the analysis logic to obtain the target object identifier. Based on the target object identifier, query the data corresponding to the target object in the query request.

[0006] According to a second aspect of the embodiments of this specification, a data query apparatus is provided, comprising: The retrieval module is configured to retrieve data query requests. The parsing module is configured to parse data query requests to obtain query condition information and analysis logic information. The query condition information is used to characterize the data query range corresponding to the data query request, and the analysis logic information is used to characterize the analysis and processing logic for the data to be analyzed corresponding to the data query range. The execution module is configured to perform data queries based on query conditions to obtain the data to be analyzed, and to analyze and process the data to be analyzed based on the analysis logic information to obtain the target object identifier. The query module is configured to query the target object data corresponding to the query request based on the target object identifier.

[0007] According to a third aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the data query method provided in the first aspect above.

[0008] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program / instructions that, when executed by a processor, implement the steps of the data query method provided in the first aspect.

[0009] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the data query method provided in the first aspect.

[0010] This specification provides a data query method in one embodiment. By parsing a data query request, the query intent expressed in the request is divided into query condition information characterizing the data query range and analysis logic information characterizing the analysis and processing logic of the data to be analyzed. This separates the process of determining the data range from the process of analyzing the data within that range. First, the data to be analyzed corresponding to the data query range is obtained based on the query condition information. Then, the analysis logic information is applied to that data to obtain a target object identifier that conforms to the analysis and processing logic. Finally, the target object data is queried based on the target object identifier. Therefore, while supporting complex query intents such as aggregation, comparison, filtering, and sorting, this method avoids directly processing data with an undefined range using analysis logic information. Furthermore, by separating the process of determining the target object identifier from the process of querying the target object data, it reduces the amount of data involved in the analysis and processing, lowers the execution burden of complex analysis and processing processes, and improves the accuracy and efficiency of data queries. Attached Figure Description

[0011] Figure 1 This is a flowchart illustrating a data query method provided in one embodiment of this specification; Figure 2 This is a timing diagram illustrating the processing of a data query method according to one embodiment of this specification. Figure 3 This is a schematic diagram illustrating the processing procedure of a data query method provided in one embodiment of this specification; Figure 4 This is a schematic diagram illustrating the processing procedure of a pagination query method provided in one embodiment of this specification; Figure 5 This is an architecture diagram of a data query system provided in one embodiment of this specification; Figure 6 This is a schematic diagram of the structure of a data query device provided in one embodiment of this specification; Figure 7 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0012] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0013] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items. The term “at least one” as used in one or more embodiments of this specification means “one or more,” and “a plurality of” means “two or more.” The term “comprising” is an open-ended description and should be understood as “including but not limiting,” and may include other content in addition to what has been described.

[0014] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0015] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in one or more embodiments of this specification are obtained through open-source datasets or public datasets that comply with their license agreements, or are obtained with full authorization from the relevant parties. Moreover, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0016] In one or more embodiments of this specification, a large model refers to a deep learning model with a large number of model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even tens of trillions of model parameters. A large model can also be called a foundation model. It is pre-trained using large-scale unlabeled corpora to produce a pre-trained model with hundreds of millions of parameters. Such models can adapt to a wide range of downstream tasks and have good generalization ability. Examples include Large Language Models (LLMs) and multi-modal pre-training models.

[0017] In practical applications, large models only require a small number of samples to fine-tune the pre-trained model before they can be applied to different tasks. Large models can be widely used in fields such as Natural Language Processing (NLP) and Computer Vision. Specifically, they can be applied to computer vision tasks such as Visual Question Answering (VQA), Image Captioning (IC), and Image Generation, as well as natural language processing tasks such as text-based sentiment classification, text summarization, and machine translation. The main application scenarios of large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.

[0018] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0019] Campaigns, ad groups, creatives, and keywords: These refer to different types of data objects organized hierarchically in advertising campaigns. A campaign can include one or more ad groups, an ad group can include one or more creatives, and a creative can be associated with one or more keywords. This manual primarily uses campaigns as the target object for illustrative purposes; however, the corresponding data query methods can also be applied to other levels of data objects such as ad groups, creatives, or keywords.

[0020] Large language models are language models trained on large-scale data that are capable of semantic understanding, content generation, or information extraction from natural language.

[0021] Text-to-SQL (Text to Structured Query Language) refers to a processing technique that converts natural language query content into structured query statements. In this specification, text-to-structured query statements can be used to convert user-input data query requests into structured data retrieval parameters and data analysis query statements.

[0022] Domain-Specific Language (DSL): This refers to a structured information representation format designed for a specific application domain and capable of being parsed by a computer. In this specification, DSL can be used to carry query condition information such as object hierarchy, fields to be queried, object names, time ranges, and object status, thereby limiting the data query scope corresponding to the data query request.

[0023] Data analysis query statements (analyzeSQL) are structured query statements used to perform analytical processing such as aggregation, comparison, filtering, or sorting on the data to be analyzed. In some implementations, data analysis query statements are generated by a semantic parsing module based on the data query request, and the virtual table corresponding to the data to be analyzed is used as the query object.

[0024] A virtual table is a collection of data organized according to the scope of a data query and referenced by data analysis queries. Virtual tables can be implemented using common table expressions, temporary tables, views, subqueries, or materialized intermediate results. In some implementations, the virtual table is named a temporary table (temp) and contains only data fields relevant to the current data query request.

[0025] A Common Table Expression (CTE) is a query expression that uses the WITH statement in Structured Query Language to name the query results and allow them to be referenced by subsequent queries. In some implementations, data retrieval queries can be encapsulated as common table expressions to form a virtual table that can be referenced by data analysis queries.

[0026] A base query statement (baseSql) is a query statement constructed based on query conditions to obtain the data to be analyzed from the corresponding data. Base queries can include processing logic such as data joining, data aggregation, data partitioning, data merging, and data filtering, and can also serve as subqueries corresponding to common table expressions.

[0027] Online Analytical Processing (OLAP) refers to data processing techniques that perform aggregation, statistical analysis, comparison, and querying on large amounts of multidimensional data. OLAP engines can use columnar storage and are used to execute data retrieval queries, data analysis queries, or a combination of both.

[0028] Large model application orchestration platform (Dify): This refers to an application orchestration platform used to configure, organize, and invoke large language model processing flows. In some implementations, the large model application orchestration platform can carry out the semantic parsing process of data query requests and output query condition information and analysis logic information to the data query system.

[0029] Query record identifier (recordId or queryRecordId): This refers to the identification information used to uniquely identify a data query process. The query record identifier can serve as an index for query records, a query handle for paginated queries, and an access identifier for query snapshots, enabling paginated query requests to retrieve the corresponding query snapshots.

[0030] The Backend For Frontend (BFF) is a service layer that interacts with the frontend and handles request reception, protocol conversion, service invocation, and result organization. In some implementations, the BFF can send data query requests to the appropriate query processing chain based on the query type, and return the retrieved target object data to the frontend.

[0031] Aspect-Oriented Programming (AOP) refers to a programming approach that separates common processing logic from business logic and invokes this logic at a predetermined execution location. In some implementations, AOP can be used to perform tasks such as query result adaptation, query result count recording, or query status updates after data querying is completed.

[0032] Thread-local variables (ThreadLocal) are variables that store and pass data within the scope of a single thread, with different threads maintaining their own copies of the variables. In some implementations, thread-local variables can be used to pass query record identifiers, candidate query information, or prompts between multiple processing stages corresponding to the same data query request.

[0033] Time To Live (TTL) refers to the duration from when cached data is written to the cache until it becomes invalid. TTL can be preset based on data update frequency, query frequency, or system processing load, and is used to control the retention time of query snapshots, model processing results, or query context information.

[0034] BigKey: This refers to cached key-value data that occupies more storage space than a preset amount of data in the caching system. BigKey may increase the processing resources required for reading, writing, transferring, and deleting cached data. The size of the cached data can be controlled by limiting the number of object identifiers, storing data in blocks, or using compression encoding.

[0035] Clarification information refers to information generated when there is semantic ambiguity in a data query request, used to further determine the user's query intent. Clarification information may include multiple candidate query information, from which the user can confirm the target candidate query information to form a semantically clear data query request.

[0036] Backup information: This refers to the message generated when a data query request cannot be parsed into executable query results. Backup information can be used to prompt users to adjust their query content, supplement query conditions, or resubmit the data query request.

[0037] Fail-closed: This refers to an exception handling method where the data query result is determined to be empty if a matching target object identifier is not obtained. This method can prevent data queries that are not limited by the corresponding query conditions from being executed due to incorrectly generated query conditions or the failure to find the target object.

[0038] Access service, data query service, and record storage service: These refer to the services in a data query system that perform different processing functions. Access service receives and forwards data query requests; data query service performs request parsing, data querying, and data analysis; and record storage service stores query records and the relationships between different query records.

[0039] As data scale and dimensions continue to increase, data query systems are widely used for retrieving and analyzing large amounts of object data. Taking advertising data query scenarios as an example, a single data user may manage hundreds to thousands of campaigns, each containing metrics such as spending, impressions, clicks, and conversions. Users need to quickly find target campaigns that meet their business requirements from a large number of campaigns. Similar query needs can also exist in scenarios such as product management, device management, customer management, task management, and report analysis.

[0040] Relevant data query systems typically offer query methods such as identifier query, name query, and conditional filtering. For identifier queries, users can enter an object identifier to precisely search for the corresponding object; for name queries, users can enter the object name or name keywords for fuzzy searching; for conditional filtering, users can set query conditions such as time range, object status, indicator type, and indicator threshold through the filter panel to identify object data that meets the conditions from a large amount of object data. However, filtering methods based on fixed fields and preset conditions are mainly suitable for simple queries such as "field equal to, greater than, or less than a fixed value," and are difficult to express complex query intentions such as aggregation comparison, continuity judgment, and combination of multiple conditions. For example, users may need to query "plans with costs below the average," "plans with consumption not exceeding a preset value for three consecutive days," or "plans with any one of multiple indicators exceeding the corresponding threshold." Such queries usually involve aggregating, comparing, filtering, and sorting data within a certain data range, which is difficult to complete with a single condition setting. Users need to repeatedly select fields, adjust thresholds, and combine multiple filter conditions, making the operation cumbersome and prone to failing to obtain the expected results due to inaccurate condition settings.

[0041] To enable users to express complex query intents using natural language, some solutions directly convert natural language queries into complete query statements targeting data tables. However, real-world business data is typically distributed across multiple tables, and the query process may involve processing logic such as time partitioning, data joining, data merging, data aggregation, access permissions, and business metric definitions. When a data table contains a large number of fields and the relationships between tables are complex, generating a complete query statement requires processing lengthy field and relationship information, which can easily increase the computational load of semantic parsing and response latency. It may also lead to problems such as incorrect field selection, incorrect data joining, or inconsistent metric definitions, affecting the accuracy of the query results.

[0042] Furthermore, performing complex analytical queries directly on complete data increases the processing burden on the data storage system. Queries involving mean comparisons, rankings, continuity assessments, and combinations of multiple indicators require first aggregating or sorting a large data range before identifying matching objects. If this analysis process is repeated with each paginated query, the same or similar data scans and calculations will be performed repeatedly, increasing query time and computational resource consumption. When the underlying data changes between adjacent paginated queries, the candidate objects and their order may also change, leading to duplicate or missed objects across different pages.

[0043] Another related approach is to cache the complete object data obtained from the query and directly read the cached data during subsequent pagination. While this method can reduce repeated queries, complete object data usually contains many fields, and the number of candidate objects may be large. Cached object data for a long time will consume a lot of storage space. At the same time, the object's metric data or status data may have changed during the caching period, and subsequent pagination will still return the old data in the cache, making it difficult to balance pagination stability and real-time changes in object data.

[0044] Therefore, a data query scheme is needed that can separately determine the data query scope and analysis processing logic in a data query request. First, the data to be analyzed is obtained within the corresponding data query scope. Then, the target object identifier is determined according to the analysis processing logic, and the target object data is queried based on the target object identifier. By separating the determination process of the target object identifier from the query process of the target object data, complex query requirements such as aggregation comparison, continuity judgment, multi-condition combination, and sorting can be supported. This reduces the data content involved in complex analysis stages and facilitates the reuse of existing object data query capabilities, thereby improving the accuracy and efficiency of data queries.

[0045] This specification provides a data query method, and also relates to a data query device, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0046] It is worth noting that the data query methods provided in this manual can be applied to scenarios requiring natural language retrieval, complex conditional analysis, and paginated queries from large amounts of multidimensional object data. Examples include campaign, ad group, creative, or keyword queries in advertising platforms; product or order queries in e-commerce platforms; customer data queries in customer management platforms; equipment operation data queries in equipment management platforms; and scenarios such as task management, report analysis, and data operations. Users can express their query needs through natural language, including aggregation comparisons, continuity judgments, multi-condition combinations, and sorting. The data query system then determines the data query scope and analysis logic, obtains the identifiers of the target objects that meet the requirements, and further queries the corresponding target object data.

[0047] See Figure 1 , Figure 1 This specification shows a flowchart of a data query method according to an embodiment, which specifically includes the following steps: Step 102: Obtain the data query request.

[0048] It should be noted that a data query request refers to information used to request data of the queried object. A data query request may include at least one of the following: query content, requested object information, query entry information, pagination information, query source information, historical query record identifiers, and request time. The query content can take the form of object identifier, object name, name keywords, natural language description, or structured query conditions. Through a data query request, the user-input query content and relevant information required to execute the data query can be obtained, providing a basis for subsequent parsing and processing of the data query request.

[0049] In practical applications, there are various ways to obtain data query requests, and the specific method should be selected according to the actual situation. This specification does not impose any limitations on these methods in the embodiments. In one possible implementation, the user-input query content can be obtained through a data query page. In response to the user triggering the query control, a data query request is generated based on the query content, the object type corresponding to the data query page, the query source, and the pagination information. This data query request is then sent to the data query system. In another possible implementation, data query requests sent by other business systems can be received through a data query interface. These other business systems can be dialog systems, reporting systems, or data management systems. The data query request can be generated by the other business system based on the user-input query content and the current business context, and sent to the data query system through a remote procedure call interface or a hypertext transfer protocol interface.

[0050] For example, if a user needs to search for "plans with a click-through rate of less than 2% in the last 7 days" from multiple plans, they can enter the query content in the search box on the plan query page and trigger the query operation. The data query page generates a data query request based on the query content, the plan object type, the current page number, and the amount of data per page, and sends the data query request to the data query system.

[0051] By applying the solutions in the embodiments of this specification, and by obtaining data query requests carrying query content and related request information, it is possible to uniformly accept query requirements from different query entry points and different expression forms, enabling the data query service to perform subsequent processing based on the data query requests, thereby improving the efficiency of receiving and processing data query requests.

[0052] Step 104: Parse the data query request to obtain query condition information and analysis logic information. The query condition information is used to characterize the data query range corresponding to the data query request, and the analysis logic information is used to characterize the analysis and processing logic for the data to be analyzed corresponding to the data query range.

[0053] It should be noted that query condition information refers to structured information parsed from a data query request, used to limit the range of data to be queried. Query condition information may include at least one of the following: object type, object level, field to be queried, object name, object identifier, time range, and object status. Through query condition information, the query intent related to the data range in the data query request can be converted into information that a computer can recognize and process, thereby determining the data range involved in subsequent data queries.

[0054] The data query scope refers to the range of data to be queried, determined based on query criteria. The data query scope can be limited by at least one of the following: object scope, field scope, time scope, and status scope. For example, the data query scope could be the click-through rate and consumption data generated by all plans corresponding to a target user within the past 7 days. By defining the data query scope, the data relevant to the current query request can be limited from the available data, reducing the amount of data involved in subsequent analysis and processing.

[0055] Analysis logic information refers to the information parsed from a data query request that describes how the data to be analyzed should be processed. Analysis logic information can take the form of structured query statements, query expressions, relational algebra expressions, query plan nodes, or machine-resolvable parameter combinations, and can characterize computational, comparative, combinatorial, and sequential relationships between data. Through analysis logic information, the complex analytical intent in a data query request can be transformed into analytical processing logic that can be executed by computing devices.

[0056] Analysis and processing logic refers to the data processing rules executed on the data to be analyzed within the scope of the data query. Analysis and processing logic can include the processing rules required for data statistics, numerical calculations, conditional judgments, relationship combinations, or order determination of the data to be analyzed, and is used to determine the data within the data to be analyzed that meets the data query request. Through analysis and processing logic, query intents such as relative comparisons, continuity judgments, and combinations of multiple conditions, which are difficult to describe directly with fixed query conditions, can be expressed.

[0057] In practical applications, there are various ways to parse data query requests to obtain query condition information and analysis logic information. The specific method chosen depends on the actual situation, and this specification does not limit this approach. In one possible implementation, the data query request can be input into a semantic parsing module. This module performs word segmentation, entity extraction, intent recognition, and field matching on the data query request. Based on the object field information and the correspondence between business terms and standard fields, it identifies the scope limitations in the data query request, such as object type, query field, time range, and object status, and generates query condition information. It also identifies numerical calculation relationships, conditional judgment relationships, logical combination relationships, and sequential relationships in the data query request, generating analysis logic information. The semantic parsing module is a functional module used to semantically understand the data query request and convert it into query condition information and analysis logic information. The input to the semantic parsing module can include the data query request, as well as object field information, field meaning information, the correspondence between business terms and standard fields, and the context information of the business scenario to which the target object belongs. The output of the semantic parsing module includes query condition information and analysis logic information. The semantic parsing module can be implemented by a large language model, a domain language model, a rule parser, or a combination of the aforementioned processing methods.

[0058] For example, a data query request might contain the query content "filter campaigns with a click-through rate (CTR) of less than 2% in the last 7 days and sort them by spending from highest to lowest." The semantic parsing module can identify the object type corresponding to "campaign," the time range corresponding to "last 7 days," and the target fields corresponding to "CTR" and "spending." It then generates query condition information containing the object type, time range, and target fields, and generates analytical logic information to characterize the comparison between CTR and 2% and to determine the sorting order based on spending. Thus, complex query intents in natural language form can be converted into structured information that computing devices can recognize and execute, improving the accuracy of query intent parsing.

[0059] In another possible implementation of this specification, the data query request can be parsed based on preset parsing rules and query templates. The keywords in the data query request are matched with a preset field dictionary, and the range limiting content such as object type, field to be queried, time range, and object status are extracted from the data query request according to the matching results to generate query condition information. Then, according to the comparison template, continuity template, condition combination template, or order template matched by the data query request, the corresponding fields and parameters are filled to generate analysis logic information.

[0060] By parsing the data query request, the data range limitation content in the data query request is converted into query condition information, and the processing requirements for the corresponding data range are converted into analysis logic information. The data query range and analysis processing logic can be expressed separately, so that subsequent data queries and data analysis can be performed based on the corresponding information, thereby improving the ability to express complex query intentions and the accuracy of data queries.

[0061] In one optional embodiment of this specification, before parsing the data query request to obtain query condition information and analysis logic information, the following steps may be included: Determine the query type corresponding to the data query request. The query type includes any one of the following: identifier query type, name query type, and semantic query type. Parsing a data query request to obtain query conditions and analysis logic information may include the following steps: When the query type is a semantic query, the data query request is parsed to obtain query condition information and analysis logic information.

[0062] It should be noted that query type refers to the information used to characterize the query method employed in a data query request, determined based on the query content or type indication information. Query types can include any of the following: identifier query type, name query type, and semantic query type. By using query types, data query requests with different expressions can be assigned to corresponding query processing paths, allowing multiple query methods to share the same query entry point.

[0063] An identifier query type refers to a query type that precisely retrieves data about a target object based on its identifier. An object identifier can be a number, character, or a combination of both that uniquely represents the corresponding object, such as a plan identifier, product identifier, equipment identifier, or task identifier. By using the identifier carried in the data query request, the identifier of the object to be queried can be directly determined.

[0064] A name query type refers to a query type that retrieves target object data based on object name or name keywords. Name query types can be used to perform exact matching, prefix matching, suffix matching, keyword matching, or fuzzy matching of object names. Through name query types, you can identify objects from multiple objects whose names match the query content in the data query request.

[0065] Semantic query types refer to query types that require semantic parsing of data query requests to determine the scope of the data query and the analysis and processing logic. The query content corresponding to a semantic query type can include range limitations in natural language form, numerical calculations, relative comparisons, continuity judgments, and requirements for multiple condition combinations or permutations. Semantic query types can identify query needs that cannot be directly expressed through a single object identifier or object name.

[0066] In practical applications, there are multiple ways to determine the query type corresponding to a data query request. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. In one possible implementation, the query type identifier carried in the data query request can be obtained, and the query type corresponding to the data query request can be determined based on the query type identifier. For example, different values ​​of the query type identifier can correspond to an identifier query type, a name query type, and a semantic query type, respectively. In another possible implementation, the query content in the data query request can be format-recognized and semantically characterized. If the query content conforms to a preset object identifier format, the query type is determined to be an identifier query type; if the query content matches an object name or name keywords, the query type is determined to be a name query type; if the query content includes range limitations, numerical calculations, relative comparisons, continuity judgments, multi-condition combinations, or permutation requirements, the query type is determined to be a semantic query type.

[0067] For example, when a user enters "102356" in the same search box, the query can be determined to be an identifier query type based on the fact that the query content conforms to the preset plan identifier format; when a user enters "Autumn New Products", the query can be determined to be a name query type based on the fact that the query content matches the plan name; when a user enters "Filter plans with a click-through rate of less than 2% in the past 7 days and sort them by spending from high to low", the query can be determined to be a semantic query type based on the fact that the query content includes a time range, indicator comparison, and sorting requirements. The query can then be parsed to obtain query condition information that represents the data query range corresponding to the plan, the past 7 days, click-through rate, and spending, as well as analytical logic information that represents the comparison relationship between click-through rate and 2% and the sorting order based on spending.

[0068] By applying the solution of the embodiments in this specification, by determining the query type corresponding to the data query request, and parsing the query condition information and analysis logic information when the query type is a semantic query type, the identifier query, name query and semantic query can share the same query entry point. At the same time, different types of data query requests can enter the corresponding processing path, avoiding semantic parsing of data query requests of identifier query type and name query type, reducing unnecessary data processing and improving the processing efficiency of data query requests.

[0069] In one optional implementation of the specification, parsing the data query request to obtain query condition information and analysis logic information may include the following steps: Parse the data query request to obtain the parsing result; When the parsing results indicate that the data query request has semantic ambiguity, multiple candidate query information are generated; In response to the confirmation information of the target candidate query information among multiple candidate query information, the updated data query request is determined based on the target candidate query information, and the updated data query request is parsed to obtain query condition information and analysis logic information.

[0070] It should be noted that the parsing result refers to the information obtained after semantic understanding of the data query request, used to characterize the identification of the query intent corresponding to the data query request. The parsing result may include the identified object type, fields, time range, object status, analysis relationship and its corresponding confidence index, and may also include semantic ambiguity markers, unresolved markers, or successfully resolved markers. Through the parsing result, it can be determined whether the data query request can form meaningful query conditions and analytical logic information.

[0071] Semantic ambiguity refers to situations where words, fields, values, time ranges, or logical relationships in a data query request have multiple possible meanings, and it is impossible to directly determine any one of these meanings as the user's query intent. Semantic ambiguity can include multiple candidate fields corresponding to the same business term, multiple candidate time ranges corresponding to the same time expression, unclear combinations of multiple query conditions, and unclear sorting objects. By identifying semantic ambiguity, the actual query content needed by the user can be further determined when the query intent is unclear.

[0072] Candidate query information refers to information generated based on ambiguous content in a data query request, representing a possible query intent. Candidate query information can take the form of natural language query content, structured query parameters, or a combination of both, and can include an explicit explanation of the ambiguous content. By generating multiple candidate query messages, users can be presented with various possible query intents corresponding to the data query request for selection.

[0073] Target candidate query information refers to the candidate query information determined from multiple candidate query information that corresponds to the user's actual query intent. Target candidate query information can be selected by the user or determined based on supplementary query content provided by the user. Using target candidate query information, semantic ambiguity in the original data query request can be eliminated, and a basis for generating an updated data query request can be provided.

[0074] Confirmation information refers to information used to instruct the selection of a target query from multiple candidate queries. Confirmation information may include selection identifiers for candidate queries, confirmation text entered by the user, field information supplemented by the user, or operation information generated by the user performing a confirmation operation on a candidate query. Confirmation information helps determine the user's selected query intent.

[0075] An updated data query request refers to a data query request obtained by clarifying ambiguous content in the original data query request based on target candidate query information. The updated data query request can retain the clear content of the original data query request and replace or supplement the ambiguous content with target candidate query information. Through the updated data query request, more clearly defined query conditions and analytical logic information can be obtained.

[0076] In practical applications, there are various ways to parse data query requests and obtain parsing results. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. In one possible implementation, the data query request can be input into a semantic parsing module. The semantic parsing module performs entity extraction, field matching, relationship identification, and confidence calculation on the data query request to obtain candidate semantics and confidence indices corresponding to each query content. Based on the number of candidate semantics and the confidence indices, it determines whether the data query request has semantic ambiguity and generates corresponding parsing results. In another possible implementation, the words in the data query request can be matched with a preset field dictionary, business term correspondences, and query templates. When a word matches multiple candidate fields, a query content matches multiple query templates, or the combination relationship between multiple query conditions cannot be uniquely determined, a parsing result representing the existence of semantic ambiguity is generated.

[0077] Furthermore, when the parsing results represent semantic ambiguity in the data query request, there are multiple ways to generate multiple candidate query information. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. In one possible implementation, multiple candidate fields or logical relationships from the parsing results can be used to replace the ambiguous content in the data query request, generating multiple clearly defined candidate query information. In another possible implementation, multiple standard query contents matching the data query request can be retrieved from historical query records, preset query templates, or an indicator information database. These standard query contents can then be filled or adjusted based on the unambiguous content in the data query request to generate multiple candidate query information.

[0078] Furthermore, in response to confirmation information regarding the target candidate query information among multiple candidate query information, an updated data query request is determined based on the target candidate query information. The updated data query request is then parsed to obtain query condition information and analysis logic information. There are multiple ways to do this, and the specific method is selected based on the actual situation. This specification does not limit this approach in any way. In one possible implementation, the system may receive confirmation information generated by the user triggering a selection control based on the target candidate query information, directly using the target candidate query information as the updated data query request, and calling the semantic parsing module to parse the updated data query request to obtain query condition information and analysis logic information. In another possible implementation, the system may receive confirmation text or supplementary information input by the user, concatenate the confirmation text or supplementary information with the original data query request, or replace ambiguous content in the original data query request with the confirmation text or supplementary information to obtain the updated data query request. Then, the updated data query request is parsed based on preset parsing rules and query templates to obtain query condition information and analysis logic information.

[0079] For example, the query content in the data query request is "filter plans with costs below the average". The semantic parsing module determines that "cost" can correspond to multiple fields such as cost per click, conversion cost, and private message outreach cost, thus obtaining a parsing result indicating that the data query request has semantic ambiguity. Based on multiple candidate fields, multiple candidate query information such as "filter plans with cost per click below the average", "filter plans with conversion cost below the average", and "filter plans with private message outreach cost below the average" can be generated. In response to the confirmation information generated by the user selecting "filter plans with private message outreach cost below the average", this candidate query information can be identified as the target candidate query information and parsed as the updated data query request to obtain query condition information representing the plan, private message outreach cost, and corresponding data range, as well as analytical logic information representing the comparison relationship between private message outreach cost and the average.

[0080] The solution implemented in this specification identifies semantic ambiguities in data query requests, generates multiple candidate query information for ambiguous content, and determines the target candidate query information based on confirmation information. This allows for the formation of updated data query requests based on the user's confirmed query intent without directly selecting the meaning of ambiguous words, thereby reducing query errors caused by misunderstandings of fields, time ranges, or logical relationships, and improving the accuracy of query condition information and analysis logic information.

[0081] In one optional embodiment of this specification, the data query request is parsed, and after obtaining the parsing result, the request processing status corresponding to the data query request can be determined based on the parsing result. The request processing status includes any one of the following: unparseable status, parsing successful but no matching object status, and parsing successful and a matching object exists status.

[0082] If the parsing result indicates that the data query request is in an unparseable state, a redescription prompt message is generated and returned to the requesting end corresponding to the data query request. An unparseable state can occur when the necessary information in the object type, query fields, query conditions, or analysis and processing logic cannot be identified from the data query request, or when multiple identified pieces of information cannot form an executable query relationship. The redescription prompt message can be used to prompt the user to adjust the query expression, supplement the query conditions, or re-enter the data query request. For example, if the user enters the query "Help me find something suitable," and the object to be queried, the judgment conditions, and analysis and processing logic cannot be determined, a redescription prompt message such as "Please supplement the object to be queried and the filter conditions" can be returned.

[0083] If the parsing result indicates that the data query request can be parsed, the data query is executed based on the query condition information obtained from the parsing, and the data to be analyzed is processed based on the analysis logic information. If the target object identifier is not obtained, the data query request is determined to be in a state of successful parsing and no matching object, and an empty query result is returned. The failure to obtain the target object identifier can be due to the absence of an object in the data to be analyzed that satisfies the analysis logic information, or it can be due to the object identifier obtained from the analysis being empty. In this case, the query condition information and analysis logic information corresponding to the data query request can be retained, the corresponding query conditions are not canceled, and object data queries not limited by the corresponding query conditions are not executed.

[0084] Furthermore, for semantic query type data query requests, if the target object identifier is not obtained, an empty object identifier set can be generated, and an empty query result can be generated based on this empty object identifier set; alternatively, if the number of target object identifiers is detected to be zero, the execution of the target object data query can be stopped and an empty query result can be generated directly. Thus, when the system does not obtain the target object identifier that matches the data query request, it can avoid returning all object data as the query result due to canceling the query conditions, ensuring that the returned query result is consistent with the user's input query conditions.

[0085] For example, if a user enters "query plans with a click-through rate (CTR) of less than 2% in the last 7 days," the system can parse and obtain the corresponding query conditions and analysis logic. However, if no plans with a CTR of less than 2% exist in the data to be analyzed, the system determines that it has not obtained the target object identifier and returns an empty list to the user. It does not cancel the query conditions corresponding to "last 7 days" and "CTR less than 2%," nor does it return all plans that have not been filtered by these query conditions.

[0086] Step 106: Execute a data query based on the query conditions to obtain the data to be analyzed, and analyze and process the data to be analyzed based on the analysis logic information to obtain the target object identifier.

[0087] It should be noted that the data to be analyzed refers to the data obtained from the data query scope defined by the query conditions, used for subsequent analysis and processing. The data to be analyzed may include object identifiers and one or more object fields related to the current data query request, and may also include field values, data time, and object status information. The data to be analyzed can take the form of a data table, virtual table, view, data frame, object collection, or query result set. By using the data to be analyzed, the data on which the analysis logic is applied can be limited to the data query scope related to the current data query request.

[0088] Analysis and processing refers to the process of calculating data to be analyzed according to analytical logic information in order to determine objects that meet the data query request. Analysis and processing can include at least one of the following: numerical calculation, data statistics, relationship comparison, conditional judgment, logical combination, continuity judgment, and order determination. Different analysis and processing methods can also be combined and executed according to the sequential or nested relationships indicated by the analytical logic information. Through analysis and processing, complex query intentions that are difficult to express directly with fixed query conditions can be realized.

[0089] A target object identifier is information used to identify the target object that has been determined by analysis and processing to meet the data query request. A target object identifier can be a number, a character, or a combination of numbers and characters, and can include a single object identifier or a composite object identifier consisting of multiple identifier fields. There can be one or more target object identifiers; if multiple target object identifiers exist, they can be arranged in the order corresponding to the analysis logic information. Using target object identifiers, the target object for subsequent data queries can be determined without directly outputting complete object data from the analysis and processing process.

[0090] In practical applications, there are multiple ways to perform data queries based on query conditions to obtain the data to be analyzed. The specific method chosen depends on the actual situation, and this specification does not limit this approach. In one possible implementation, a query construction engine can be invoked to convert the query conditions into a data retrieval query statement and execute it to retrieve the data to be analyzed corresponding to the data query range. The query construction engine can determine the corresponding data table, data relationships, and data filtering conditions based on the object type, query field, time range, and object status in the query conditions, and generate the data retrieval query statement accordingly. In another possible implementation, a target query template can be determined from multiple preset query templates based on the query conditions. The field values ​​from the query conditions are then filled into the target query template to obtain the target query information. The data to be analyzed is then retrieved through a data query interface corresponding to the target query information. For example, a corresponding data query interface can be determined based on the object type, and the query field, time range, and object status can be sent as interface parameters to the data query interface. The data query interface then returns data that matches the corresponding data query range as the data to be analyzed.

[0091] Furthermore, based on the analysis logic information, there are multiple ways to analyze and process the data to be analyzed to obtain the target object identifier. The specific method is selected according to the actual situation, and this specification does not limit this approach. In one possible implementation, the analysis logic information may include a data analysis query statement. The data to be analyzed is organized into query objects corresponding to the data analysis query statement, and the data analysis query statement is executed. The data to be analyzed is calculated, compared, filtered, or sorted. The object identifier that conforms to the analysis logic information is extracted from the execution result to obtain the target object identifier. In another possible implementation, a data analysis engine can be invoked to parse the analysis logic information, determine the data processing operators indicated by the analysis logic information and the execution relationships between multiple data processing operators, and process the data to be analyzed sequentially using the corresponding data processing operators according to the execution relationship to obtain object data that conforms to the analysis logic information. The object identifier is then extracted from the object data to obtain the target object identifier. The data processing operators may include at least one of calculation operators, comparison operators, filtering operators, combination operators, and sorting operators.

[0092] For example, query criteria information is used to characterize the click-through rate (CTR) and cost data of the plans within the past 7 days, and analysis logic information is used to characterize the filtering of plans with CTRs below 2% and their order based on cost from highest to lowest. Performing a data query based on these query criteria information yields data to be analyzed, including plan identifiers, CTRs, and costs. Then, based on the analysis logic information, the CTRs in the data to be analyzed are compared with 2%, identifying plans with CTRs below 2%, and sorting them according to their respective costs from highest to lowest, thus obtaining multiple target object identifiers.

[0093] By applying the solutions of the embodiments in this specification, the data to be analyzed corresponding to the data query range is obtained based on query condition information, and the analysis logic information is limited to the data to be analyzed, which can reduce the data range involved in complex analysis and processing. At the same time, by obtaining only the target object identifier for determining the hit object through analysis and processing, the process of determining the target object identifier can be separated from the query process of the target object data, reducing the data content and data transmission volume involved in the analysis and processing stage, reducing the data processing burden, and improving data query efficiency.

[0094] In one optional implementation of this specification, performing a data query based on query criteria information to obtain the data to be analyzed may include the following steps: The query construction engine is invoked to construct a data retrieval query statement based on the query condition information. The data retrieval query statement is used to determine the data to be analyzed corresponding to the data query scope from the target data source based on at least one of the following: data association relationship, data permission conditions, and business indicator caliber. Execute the data retrieval query to obtain the data to be analyzed from the target data source.

[0095] It's important to note that a query construction engine is a functional component capable of generating data retrieval query statements based on structured query conditions. The query construction engine can convert query conditions into query statements that can be executed by the target data source, based on preset data table configurations, field configurations, relationship configurations, permission configurations, and indicator configurations. Through the query construction engine, existing data query configurations and query statement generation logic can be reused, reducing the need to process fields and data relationships that would be required for the semantic parsing module to directly generate complex data retrieval query statements.

[0096] A data retrieval query statement is a machine-executable statement used to retrieve data corresponding to a specified range from a target data source. Data retrieval queries can take the form of structured query statements, search engine query expressions, relational algebra expressions, or query plans, and can include the fields to be queried, data tables, join conditions, filter conditions, and grouping conditions. Through data retrieval queries, the data query range represented by the query conditions can be transformed into a query task that the target data source can execute.

[0097] Data relationships refer to the correspondence between data stored in the same or different data tables. Data relationships can include object identifier correspondence, primary key and foreign key correspondence, object hierarchy correspondence, time correspondence, and data version correspondence, etc. Through data relationships, related data distributed across one or more data tables can be organized into data for analysis.

[0098] Data permission conditions are used to limit the range of data that a current data query request can retrieve. Data permission conditions can be determined based on information such as the requesting user, the user's organization, object affiliation, data level, or preset access scope. By using data permission conditions, the data to be analyzed can be kept within the queryable range corresponding to the current data query request.

[0099] Business indicator definitions refer to the pre-defined rules for determining business indicators, including data sources, calculation methods, statistical scope, and statistical time periods. For the same business indicator, different business indicator definitions can correspond to different data fields, calculation formulas, statistical objects, or statistical periods. By defining business indicator definitions, indicator data can be obtained from the data to be analyzed according to unified indicator determination rules, improving the consistency of indicator data.

[0100] A target data source refers to a data storage object that provides data corresponding to a data query range. A target data source can include at least one of the following: relational database, non-relational database, columnar storage system, online analytical processing engine, search engine, data warehouse, or data service interface. It can also include multiple interrelated data tables. Through the target data source, the data to be analyzed can be obtained for performing analytical processing.

[0101] In practical applications, there are multiple ways to invoke the query construction engine and construct data retrieval query statements based on query condition information. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. In one possible implementation, the query condition information can be mapped to corresponding fields in a preset query request object. The query construction engine determines the corresponding data table and projection fields based on the object type and the fields to be queried in the query request object, determines filtering conditions based on the time range and object status, and generates a data retrieval query statement according to preset data association relationships, data permission conditions, and business indicator definitions. In another possible implementation, a target query template can be determined from multiple preset query templates based on the query condition information. Then, the parameters to be filled in the target query template are determined based on the query condition information. Parameters such as object identifier, object name, time range, object status, and the fields to be queried are filled into the target query template. The target query template is then adjusted according to the data permission conditions and business indicator definitions corresponding to the current data query request to obtain the data retrieval query statement.

[0102] Furthermore, there are multiple ways to execute a data retrieval query statement to obtain the data to be analyzed from the target data source. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. In one possible implementation, the data retrieval query statement can be sent to the target data source via a data access connection. The target data source then performs data reading, data association, data filtering, and indicator calculation, and returns the execution results as the data to be analyzed. In another possible implementation, the data retrieval query statement can be sent to a data query service. The data query service determines one or more data storage objects corresponding to the data retrieval query statement, retrieves data from each of the corresponding data storage objects, performs association, merging, filtering, and indicator calculation on the retrieved data, and then organizes the processed data into the data to be analyzed before returning it.

[0103] For example, query criteria information is used to characterize the click-through rate (CTR) and cost data generated by the campaign corresponding to the target user within the past 7 days. The query construction engine can determine the data table corresponding to the campaign data based on the object type, determine the fields corresponding to the campaign identifier, CTR, and cost based on the fields to be queried, determine the time filter conditions based on the past 7 days, and construct a data retrieval query statement by combining the data relationships between campaign data, the data permission conditions corresponding to the target user, and the business metric definitions corresponding to CTR and cost. Executing this data retrieval query statement can obtain the data to be analyzed, including the campaign identifier, CTR, and cost, from the target data source.

[0104] The solution implemented in this specification constructs a data acquisition query statement based on query condition information using a query construction engine. The data acquisition query statement is then used to obtain the data to be analyzed from the target data source according to at least one of the following: data association, data permission conditions, and business indicator caliber. This allows for the reuse of existing data association, data range limitation, and indicator calculation capabilities, ensuring that the obtained data to be analyzed conforms to the corresponding data query range. This reduces the repetitive construction of complex data acquisition logic and improves the efficiency and accuracy of data acquisition.

[0105] In one optional embodiment of this specification, the analysis logic information includes a data analysis query statement, where the query object of the data analysis query statement is the data to be analyzed. Based on the analysis logic information, the data to be analyzed is processed to obtain the target object identifier, which may include the following steps: Execute data analysis query statements to analyze and process the data to be analyzed and obtain the target object identifier. The analysis and processing include at least one of aggregation, comparison, filtering and sorting.

[0106] It's important to note that data analysis query statements are machine-executable statements generated based on the analytical intent expressed in a data query request, used to analyze and process the data to be analyzed. Data analysis query statements can be structured query statements, data frame-oriented query expressions, search engine query expressions, or query expressions suitable for online analytical processing engines (OLAP). Data analysis query statements can include fields to be processed, processing conditions, calculation relationships, logical relationships, and permutation relationships. Through data analysis query statements, complex analytical intents in natural language form can be converted into analytical processing logic that can be executed by a data processing system.

[0107] The query object of a data analysis query is the data to be analyzed. This means that the data referenced and processed by the data analysis query is limited to the data obtained based on the query conditions. The data to be analyzed can be organized into virtual tables, temporary tables, views, subqueries, data frames, or intermediate result sets, and used as the data input for the data analysis query. By using the data to be analyzed as the query object, the analysis can be performed within the data corresponding to the query scope, reducing the range of data involved in the analysis.

[0108] Aggregation refers to the process of performing statistical calculations on multiple data records in the data to be analyzed, based on object identifiers, time intervals, or other grouping fields. Aggregation can include at least one of the following: summation, averaging, counting, finding the maximum value, finding the minimum value, and summarizing according to a preset period. Through aggregation, statistical results can be obtained for performing relative comparisons, continuity judgments, or group filtering.

[0109] Comparison refers to the process of comparing field values, aggregate results, or preset values ​​in the data to be analyzed according to the comparison relationships indicated by the data analysis query. Comparison relationships can include at least one of greater than, less than, equal to, not equal to, greater than or equal to, and less than or equal to, and can also include relative comparisons between objects or between an object and the overall statistical result. Through comparison, it can be determined whether the corresponding data satisfies the numerical relationships expressed by the data query request.

[0110] Filtering refers to the process of identifying data from the data to be analyzed that meets one or more processing conditions in a data analysis query. Multiple processing conditions can have AND, OR, NOT, or nested relationships. Through filtering, object data that matches the data query request can be identified from the data to be analyzed.

[0111] Sorting refers to the process of determining the order of multiple objects according to a preset arrangement direction based on the target field value or the calculation result of the corresponding field in the data to be analyzed. The arrangement direction can include ascending or descending order, or it can determine the order of objects sequentially according to multiple sorting fields. Through sorting, the obtained multiple target object identifiers can be organized according to the arrangement requirements expressed by the data query request.

[0112] In practical applications, there are multiple ways to execute data analysis queries to analyze and process the data to be analyzed and obtain the target object identifier. The specific method chosen depends on the actual situation, and this specification does not limit this approach. In one possible implementation, the data to be analyzed can be organized into a virtual table corresponding to a common table expression. The data analysis query is then appended to the common table expression, allowing the query to reference the virtual table. The resulting query is sent to the data processing engine for execution. The engine aggregates, compares, filters, or sorts the data in the virtual table according to the query, and outputs object identifiers that conform to the corresponding analysis and processing logic, thus obtaining the target object identifier. In another possible implementation, the data to be analyzed can be organized into a data frame or intermediate result set. The data analysis query is parsed to obtain one or more data processing operators and the execution relationships between them. The corresponding data processing operators are then called sequentially according to these relationships to process the data, and the object identifier is extracted from the processing results to obtain the target object identifier.

[0113] For example, the data to be analyzed includes plan identifiers, click-through rates (CTRs) for the past 7 days, and spending for the past 7 days for multiple plans. The data analysis query is used to filter plans with CTRs lower than the average CTR of all plans and sort them by spending from highest to lowest. When executing the data analysis query, the CTRs in the data to be analyzed can be aggregated first to calculate the average CTR of all plans; then, the CTRs of each plan can be compared with this average CTR to filter out plans with CTRs lower than the average; further, the plans can be sorted by spending from highest to lowest, and the sorted plan identifiers can be extracted to obtain the target object identifier.

[0114] By applying the solutions of the embodiments in this specification, a data analysis query statement is generated with the data to be analyzed as the query object, and the data analysis query statement is executed to aggregate, compare, filter or sort the data to be analyzed. Complex analysis processing such as relative comparison, multi-condition combination and order determination can be achieved within the data query range limited by the query condition information. Only the target object identifier that conforms to the analysis processing logic is output, which reduces the data range and output data volume involved in the analysis processing and improves the execution efficiency of complex queries.

[0115] In one optional implementation of this specification, executing a data analysis query statement to analyze and process the data to be analyzed and obtain the target object identifier may include the following steps: Execute data analysis query statements to analyze and process the data to be analyzed, and obtain data analysis results; Extract object identifiers from the data analysis results, and then deduplicate the extracted object identifiers to obtain the target object identifiers.

[0116] It should be noted that data analysis results refer to the data obtained after executing data analysis queries to analyze and process the data to be analyzed. Data analysis results can include object identifiers, as well as the field values ​​corresponding to those objects, aggregation results, comparison results, grouping results, sorting results, or intermediate calculation results. Data analysis results can take the form of data record sets, result tables, data frames, or object collections. Through data analysis results, the output of data analysis queries on the data to be analyzed can be presented.

[0117] An object identifier is information used to distinguish different objects. An object identifier can be the object's primary key, object number, object code, or a composite identifier composed of multiple identifier fields. When the data analysis results include multiple result data corresponding to the same object, these multiple result data can carry the same object identifier. By extracting the object identifier from the data analysis results, the objects that have been identified through the analysis can be determined.

[0118] Deduplication refers to the process of comparing multiple extracted object identifiers and merging duplicate object identifiers into a single object identifier. Deduplication can be performed simultaneously with object identifier extraction or after all object identifiers have been extracted; when multiple object identifiers have a specific order, it can also preserve the first occurrence of the same object identifier within that order. By deduplication, the same object can be prevented from being repeatedly identified as the target object due to corresponding to multiple data records, multiple time intervals, or multiple grouping results.

[0119] In practical applications, the method of "executing data analysis query statements, analyzing and processing the data to be analyzed, and obtaining data analysis results" can refer to the above implementation method of "executing data analysis query statements, analyzing and processing the data to be analyzed, and obtaining target object identifiers". The embodiments in this specification will not be described in detail.

[0120] Furthermore, object identifiers are extracted from the data analysis results, and deduplication is performed on the extracted object identifiers. There are multiple ways to obtain the target object identifier, and the specific method is selected according to the actual situation. This specification does not limit this method in any way. In one possible implementation of this specification, the corresponding field value can be read from each result data of the data analysis results according to the preset object identifier field name. The read field value is added to the identifier set, and the object identifier is deduplicated by taking advantage of the characteristic that the identifier set does not store duplicate elements, thereby obtaining the target object identifier. In another possible implementation of this specification, a deduplication operator can be called to group the data analysis results according to the object identifier field, and one object identifier can be retained from each group. If the data analysis results have a sorted order, the position of the first occurrence of each object identifier can be recorded, and the deduplicated object identifiers can be arranged according to the position of the first occurrence to obtain the target object identifier.

[0121] For example, a data analysis query statement is used to query plans whose consumption is lower than a preset value for three consecutive days. After executing this data analysis query statement, the data analysis results may include the result data corresponding to Plan A in the first consecutive time period, the result data corresponding to Plan A in the second consecutive time period, and the result data corresponding to Plan B. Since Plan A corresponds to two result data sets, after extracting the plan identifier from each result data set, the object identifiers corresponding to Plan A and Plan B can be obtained; after deduplication of the extracted object identifiers, the target object identifiers corresponding to Plan A and Plan B can be obtained.

[0122] By applying the scheme of the embodiments of this specification, data analysis results are obtained by executing data analysis query statements, and then object identifiers are extracted from the data analysis results and deduplication is performed. This allows for obtaining unique target object identifiers from data analysis results containing multiple fields or multiple duplicate object records, reducing duplicate queries and data transmissions when querying target object data based on target object identifiers, and improving the query efficiency of target object data.

[0123] Step 108: Based on the target object identifier, query the target object data corresponding to the data query request.

[0124] It should be noted that target object data refers to the object data corresponding to the target object identifier, which is returned as the query result of the data query request. Target object data may include object name, object type, object status, creation time, update time, and one or more object indicator data, and may also include statistical data calculated based on the basic data of the corresponding object. Target object data can be the complete object data corresponding to the target object, or it can be a partial object data specified in the data query request. Through target object data, the requesting end corresponding to the data query request can be provided with objects and their specific data that meet the query conditions and analysis logic information.

[0125] In practical applications, there are multiple ways to query the target object data corresponding to a data query request based on the target object identifier. The specific method is selected according to the actual situation, and this specification does not limit this approach. In one possible implementation, multiple target object identifiers can be written into an existing object data query request as a whole, serving as the query conditions corresponding to the object identifier field. An existing object data query engine is then invoked, which limits the query scope according to the target object identifier, performs data association, indicator calculation, and field assembly, and obtains the target object data corresponding to each of the multiple target object identifiers. In another possible implementation, the access layer can send object data retrieval requests to the object details service separately or in batches based on multiple target object identifiers. The object details service reads the object data of the corresponding object based on each target object identifier. Then, the access layer merges and arranges the returned object data according to the correspondence between the target object identifier and the object data to obtain the target object data corresponding to the data query request.

[0126] For example, after obtaining the target object identifiers corresponding to Plan A, Plan B, and Plan C based on query condition information and analysis logic information, the identifiers of Plan A, Plan B, and Plan C can be added to the plan data query request, and the existing plan data query interface can be called to query the plan name, plan status, click rate, consumption, and other data of the corresponding plan, so as to obtain the target object data corresponding to the data query request.

[0127] By applying the scheme of the embodiments of this specification, the target object data can be queried based on the target object identifier obtained by analysis and processing. This separates the analysis and processing process for determining the hit object from the query process for obtaining the specific data of the object. This eliminates the need for the analysis and processing stage to directly output complete object data and allows the use of existing object data query methods to obtain the target object data. This reduces the data content and data transmission volume involved in complex analysis and processing and improves the query efficiency of target object data.

[0128] In one optional embodiment of this specification, querying the target object data corresponding to the data query request based on the target object identifier may include the following steps: Retrieve the first page information corresponding to the data query request and the order information corresponding to the target object identifier; Based on the first page information and sequence information, determine the current object identifier corresponding to the first page from the target object identifier; Based on the current object identifier corresponding to the first page, query the target object data corresponding to the first page.

[0129] It should be noted that the first pagination information refers to the information used to determine the data page to be returned for the current data query request. The first pagination information may include at least one of the following: page number, number of data items per page, start position, and end position. For example, the first pagination information may include a page number of 1 and a number of data items per page of 20, indicating that the current data query request needs to return the 20 object data items on page 1. Through the first pagination information, the range of object identifiers and the number of object data items corresponding to the current data query request can be determined.

[0130] Sequence information refers to information used to characterize the arrangement order among multiple target object identifiers. Sequence information may include the sequence number corresponding to each target object identifier, or it may include a sorting field, the value of the sorting field, and the sorting direction used to determine the arrangement order of the target object identifiers. Sequence information can be determined based on the sorting results corresponding to the analysis logic information, or it can be determined based on preset object arrangement rules. Using sequence information, multiple target object identifiers can be organized according to the arrangement requirements expressed in the data query request.

[0131] The current object identifier corresponding to the first page refers to the target object identifier belonging to the first page, determined from multiple target object identifiers based on the first page information and sequence information. The current object identifier may include one or more target object identifiers, and its number may be less than or equal to the amount of data per page indicated by the first page information. By using the current object identifier, the query scope of target object data can be limited to the objects that need to be displayed on the current page, avoiding querying the object data of all target objects in each pagination query.

[0132] In practical applications, there are multiple ways to obtain the first page information corresponding to the data query request and the order information corresponding to the target object identifiers. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on these methods. In one possible implementation, the page number and the amount of data per page can be read from the data query request to obtain the first page information. Then, according to the arrangement position of multiple target object identifiers in the data analysis results, sequential numbers are set for the multiple target object identifiers to obtain the order information corresponding to each target object identifier. In another possible implementation, the start and end positions can be read from the data query request to obtain the first page information. The sorting field and arrangement direction are extracted from the analysis logic information. Based on the sorting field value and arrangement direction corresponding to each target object identifier, the arrangement position corresponding to each target object identifier is calculated to obtain the order information.

[0133] Furthermore, there are multiple ways to determine the current object identifier corresponding to the first page from the target object identifiers based on the first page information and sequence information. The specific method chosen depends on the actual situation, and this specification does not limit this approach. In one possible implementation, multiple target object identifiers can be arranged according to sequence information. The start and end positions corresponding to the first page are calculated based on the page number and the amount of data per page in the first page information. The target object identifier located between the start and end positions is then extracted from the arranged multiple target object identifiers and used as the current object identifier. In another possible implementation, the target object identifiers and their sequence information can be organized into an object identifier query set. Pagination query parameters are set according to the first page information. By performing a query operation on the object identifier query set, which arranges the identifiers according to sequence information and extracts them according to the pagination query parameters, the current object identifier corresponding to the first page can be obtained.

[0134] Furthermore, based on the current object identifier corresponding to the first page, there are multiple ways to query the target object data corresponding to the first page. The specific method should be selected according to the actual situation, and this specification does not limit this approach. In one possible implementation, multiple current object identifiers corresponding to the first page can be used as object limiting conditions. An object data query interface can be called to batch query the object data corresponding to each of the multiple current object identifiers. The queried object data is then organized according to the order information corresponding to the current object identifiers to obtain the target object data corresponding to the first page. In another possible implementation, an object data query statement can be constructed based on the current object identifier corresponding to the first page. The current object identifier is used as the query condition corresponding to the object identifier field, and the order information is used as the arrangement condition for the object data. The object data query statement is then executed to obtain the target object data corresponding to the first page arranged in the corresponding order.

[0135] For example, the first pagination information corresponding to the data query request includes a page number of 2 and a data volume of 20 per page. Analysis and processing yield 100 target object identifiers, and these 100 target object identifiers are assigned sequence numbers from 1 to 100. Based on the page number and the data volume per page, the starting sequence number for the second page is determined to be 21, and the ending sequence number is determined to be 40. Then, 20 target object identifiers with sequence numbers from 21 to 40 are selected from the 100 target object identifiers as the current object identifiers. By querying the name, status, and indicator data of the corresponding object based on these 20 current object identifiers, the target object data corresponding to the first page can be obtained.

[0136] By applying the scheme of the embodiments of this specification, the current object identifier corresponding to the first page is determined from multiple target object identifiers through the first pagination information and the sequence information. Then, the corresponding target object data is queried based on the current object identifier. Only the object data required for the current page can be queried, reducing the amount of data and data transmission involved in a single pagination query. At the same time, the pagination boundary and the arrangement order of object data can be determined according to the sequence information corresponding to the target object identifier, improving the consistency of the pagination query results and the query efficiency.

[0137] In one optional embodiment of this specification, after analyzing and processing the data to be analyzed based on analysis logic information to obtain the target object identifier, the following steps may also be included: Obtain the sequence information corresponding to the target object identifiers and generate the query identifier corresponding to the data query request; Generate a query snapshot corresponding to the data query request based on the target object identifier, sequence information, and query conditions. Establish the correspondence between query identifiers and query snapshots.

[0138] It should be noted that a query identifier is information used to uniquely identify a single data query process. Query identifiers can be numbers, characters, or a combination of numbers and characters, and can be generated based on random identifier generation algorithms, distributed identifier generation algorithms, time information, or request information. The query identifier can serve as a query handle for subsequently obtaining a query snapshot, enabling subsequent query requests to retrieve a snapshot corresponding to the relevant data query process.

[0139] A query snapshot is a data set generated based on the target object identifiers, their corresponding order information, and query conditions obtained during a data query process. Query snapshots record the candidate object members identified during the corresponding data query process, their order of arrangement, and the data range limitations required to query the target object data. Query snapshots can store the target object identifiers and their order information without storing the complete object data corresponding to those identifiers. Through query snapshots, the set of target object identifiers and their order obtained from the corresponding data query request can be preserved.

[0140] The mapping relationship refers to the association between a query identifier and a query snapshot. This mapping relationship can be represented in the form of key-value pairs, index relationships, mapping relationships, or related records. The query identifier can serve as the access key or index field for the query snapshot. Through this mapping relationship, the corresponding query snapshot can be located and retrieved based on the query identifier.

[0141] In practical applications, there are multiple ways to obtain the sequence information corresponding to the target object identifiers and generate the query identifier corresponding to the data query request. The specific method chosen depends on the actual situation, and this specification does not limit this approach. In one possible implementation, multiple target object identifiers can be assigned sequential numbers according to their arrangement in the data analysis results. These sequential numbers are then used as the sequence information for the corresponding target object identifiers, and a random identifier generation algorithm is called to generate the query identifier corresponding to the data query request. In another possible implementation, a sorting field and arrangement direction can be extracted from the analysis logic information. Based on the sorting field values ​​and arrangement direction corresponding to the multiple target object identifiers, the arrangement position of each target object identifier is determined. This arrangement position is used as the sequence information, and a query identifier is generated based on at least one of the request time, request terminal identifier, and request sequence number of the data query request.

[0142] Furthermore, there are multiple ways to generate a query snapshot corresponding to a data query request based on the target object identifier, sequence information, and query condition information. The specific method chosen depends on the actual situation, and this specification does not limit this approach. In one possible implementation, each target object identifier can be associated and stored with its corresponding sequence information to obtain an ordered object identifier set. This ordered object identifier set and the query condition information are then encapsulated into a snapshot data object to obtain a query snapshot. In another possible implementation, multiple target object identifiers can be arranged according to sequence information to generate an ordered object identifier sequence. The ordered object identifier sequence and query condition information are then written into the object identifier field and query condition field of the query snapshot, respectively. If the number of target object identifiers exceeds a preset number, the ordered object identifier sequence can be segmented or compressed to obtain a query snapshot.

[0143] Furthermore, there are multiple ways to establish the correspondence between query identifiers and query snapshots, and the specific method should be selected according to the actual situation. This specification does not impose any limitations on this method in the embodiments. In one possible implementation, the query identifier can be used as a cache key, and the query snapshot can be written as a cache value to a distributed cache or local cache, forming a key-value correspondence between the query identifier and the query snapshot. A lifespan is set for this key-value correspondence. When a pagination query request carrying a query identifier is received subsequently, the query identifier can be used as a cache key to read the corresponding query snapshot. In another possible implementation, the query identifier and the query snapshot can be written to the same query snapshot record in a database or key-value storage system. A query identifier field is set in the query snapshot record, and a query index is created for the query identifier field. Subsequently, the corresponding query snapshot record can be retrieved based on the query identifier to obtain the query snapshot corresponding to the query identifier.

[0144] For example, after processing the data query request, the target object identifiers corresponding to Plan A, Plan B, and Plan C are obtained, and the three target object identifiers are arranged in descending order of consumption. Sequence numbers 1, 2, and 3 can be determined based on the arrangement of the three target object identifiers, and a query identifier Q001 can be generated. Then, Plan A and its sequence number 1, Plan B and its sequence number 2, Plan C and its sequence number 3, along with the query conditions corresponding to the past 7 days, are encapsulated into a query snapshot. This snapshot is then written to the cache using Q001 as the cache key and the query snapshot as the cache value, thereby establishing the correspondence between the query identifier Q001 and the query snapshot.

[0145] The solution implemented in this specification generates a query snapshot by using the target object identifier, sequence information, and query condition information, and establishes a correspondence between the query identifier and the query snapshot. The query snapshot can be used to record the candidate object members, order of arrangement, and data query range corresponding to the corresponding data query request, so that subsequent queries can obtain the corresponding query snapshot based on the query identifier. This provides a data foundation for reusing the determined target object identifier and its sequence information, and reduces the storage space occupied by repeatedly saving complete target object data.

[0146] In one optional embodiment of this specification, after establishing the correspondence between the query identifier and the query snapshot, the following steps may also be included: In response to a paginated query request carrying a query identifier, obtain the query snapshot corresponding to the query identifier; If the snapshot meets the snapshot usage conditions, the current object identifier corresponding to the second page is determined based on the second page information corresponding to the pagination query request, the target object identifier in the query snapshot, and the order information corresponding to the target object identifier. Based on the current object identifier corresponding to the second page and the query condition information in the query snapshot, query the target object data corresponding to the second page.

[0147] It should be noted that a pagination query request refers to a query request used to retrieve data from a specified page within a target object's data set. A pagination query request may include a query identifier and second pagination information, and may also include requesting user information, query object type, or query source information. The query identifier carried in the pagination query request allows us to determine the correspondence between the pagination query request and the preceding data query process, and to obtain the corresponding query snapshot.

[0148] The second pagination information refers to the information used to determine the page requested in the pagination query request. The second pagination information may include at least one of the following: page number, amount of data per page, start position, and end position. The term "second" is used to distinguish it from the first pagination information used in the initial data query and does not limit the specific page number of the corresponding page.

[0149] Snapshot usage conditions refer to the conditions used to determine whether a query snapshot can be used to process the current pagination query request. Snapshot usage conditions can include at least one of the following: the query snapshot exists, the query snapshot is within a preset lifespan, the data structure of the query snapshot is complete, the object type corresponding to the query snapshot matches the object type corresponding to the pagination query request, and the query snapshot corresponds to the current requesting user. By using snapshot usage conditions, it can be determined whether there is a usable correspondence between the query snapshot and the current pagination query request.

[0150] In practical applications, there are multiple ways to obtain the query snapshot corresponding to a query identifier in response to a paginated query request carrying a query identifier. The specific method chosen depends on the actual situation, and this specification does not limit this approach. In one possible implementation, the query identifier can be extracted from the paginated query request, used as a cache key to access the cache, the cache value corresponding to the cache key can be read, and the read cache value can be determined as the query snapshot. In another possible implementation, the query identifier carried in the paginated query request can be used as a query condition. The key-value storage system or database can be accessed through the query interface corresponding to the query snapshot, and the query snapshot corresponding to the query identifier can be obtained based on the index relationship between the query identifier and the query snapshot.

[0151] Furthermore, when the query snapshot meets the snapshot usage conditions, there are multiple ways to determine the current object identifier corresponding to the second page based on the second page information corresponding to the pagination query request, the target object identifier in the query snapshot, and the order information corresponding to each target object identifier. The specific method is selected based on the actual situation, and this specification does not limit this approach. In one possible implementation, multiple target object identifiers in the query snapshot can be arranged according to their order information. The start and end positions of the second page can be calculated based on the page number and the amount of data per page in the second page information. The target object identifier located between the start and end positions can be extracted from the arranged multiple target object identifiers as the current object identifier corresponding to the second page. In another possible implementation, the target object identifiers and their order information in the query snapshot can be organized into an object identifier query set. Pagination query parameters can be set according to the second page information. A query operation that arranges the object identifiers according to their order information and extracts them according to the pagination query parameters can be performed on the object identifier query set to obtain the current object identifier corresponding to the second page.

[0152] Furthermore, based on the current object identifier corresponding to the second page and the query condition information in the query snapshot, there are multiple ways to query the target object data corresponding to the second page. The specific method is selected according to the actual situation, and this specification does not limit this approach. In one possible implementation, the current object identifier corresponding to the second page and the query condition information in the query snapshot can be written into an object data query request, and the object data query interface can be called. The object data query interface will then query the object data of the corresponding object within the object range defined by the current object identifier, according to the query condition information, to obtain the target object data corresponding to the second page. In another possible implementation, an object identifier limiting condition can be constructed based on the current object identifier, and a data range limiting condition can be constructed based on the query condition information in the query snapshot. The object identifier limiting condition and the data range limiting condition can be combined into an object data query statement, which is then executed to obtain the target object data corresponding to the second page.

[0153] For example, a user enters "Query plans with a click-through rate (CTR) of less than 2% in the last 7 days, sorted by spending from highest to lowest" on the plan query page, and requests to display page 1 with 20 data entries per page. The query page generates a data query request accordingly. This query request is parsed to obtain query conditions representing the range of data for plans, the last 7 days, CTR, and spending, as well as analytical logic representing the comparison between CTR and 2% and the sorting by spending from highest to lowest. Based on the query conditions, a data query is executed to obtain CTR and spending data for multiple plans in the last 7 days. Based on the analytical logic, these data are compared, filtered, and sorted to obtain 100 plan identifiers sorted by spending from highest to lowest. Subsequently, these 100 plan identifiers are assigned sequential numbers from 1 to 100, generating query identifier Q001. A query snapshot is then generated based on the 100 plan identifiers, their corresponding sequential numbers, and the query conditions, establishing a correspondence between Q001 and the query snapshot. Based on the first pagination information (page 1, 20 items per page), the plan identifiers with sequence numbers 1 to 20 are determined as the current object identifiers for the first page. The plan name, plan status, click-through rate, and cost corresponding to these 20 plan identifiers are queried, and the target object data for page 1, along with the query identifier Q001, are returned to the query page. When the user triggers a query for the next page, the query page generates a pagination query request carrying Q001 and the second pagination information (page 2, 20 items per page). In response to this pagination query request, a corresponding query snapshot is obtained based on Q001. If the query snapshot meets the snapshot usage conditions, the plan identifiers with sequence numbers 21 to 40 are determined as the current object identifiers for the second page based on the sequence information in the query snapshot. Then, based on these 20 plan identifiers and the query condition information in the query snapshot, the corresponding target object data is queried, and the target object data for page 2 is obtained and returned.

[0154] The scheme implemented in this specification obtains a query snapshot by carrying a query identifier in the pagination query request, and uses the target object identifier and its order information determined in the query snapshot to determine the current object identifier corresponding to the second page. When the query snapshot meets the snapshot usage conditions, it is not necessary to re-parse the data query request or re-execute the analysis process used to determine the target object identifier, thereby reducing redundant data analysis and computational resource consumption. At the same time, the query snapshot fixes the candidate object members and their order, which can improve the member consistency and order consistency among multiple pagination queries corresponding to the same query snapshot, while the target object data can still be queried based on the current object identifier and query condition information to obtain the object data of the corresponding page.

[0155] In one optional embodiment of this specification, after obtaining the query snapshot corresponding to the query identifier, the following steps may also be included: If the query snapshot corresponding to the query identifier does not exist, or the query snapshot does not meet the snapshot usage conditions, the query record corresponding to the query identifier is obtained. The query record includes the query condition information and analysis logic information corresponding to the data query request. The data query is re-executed based on the query conditions to obtain the updated data to be analyzed. Based on the analysis logic information, the updated data to be analyzed is processed to obtain the updated target object identifier and the update order information corresponding to the updated target object identifier. Based on the updated target object identifier, update order information, and query condition information, an updated query snapshot is generated, and a correspondence is established between the query identifier and the updated query snapshot.

[0156] It should be noted that "query snapshot does not exist" refers to a situation where the corresponding query snapshot cannot be obtained based on the query identifier. This can be due to the query snapshot being removed after exceeding a preset lifespan, the query snapshot not yet being written, the storage location of the query snapshot changing, or the query snapshot failing to be read. By identifying situations where the query snapshot does not exist, a processing path can be initiated to re-execute data queries and analysis when the query snapshot cannot be reused.

[0157] A query snapshot not meeting the snapshot usage conditions means that although a query snapshot is obtained based on the query identifier, it cannot be used to process the current pagination query request. Conditions for a query snapshot not meeting the snapshot usage conditions include the query snapshot exceeding its preset lifespan, the query snapshot's data structure being incomplete, the object type corresponding to the query snapshot being inconsistent with the object type corresponding to the pagination query request, or the query snapshot not corresponding to the current requesting user. By determining whether the query snapshot meets the snapshot usage conditions, it can be determined whether to re-obtain the target object identifier and its order information.

[0158] A query record is a data record used to document information related to a single data query process. Query records include query conditions and analysis logic information corresponding to the data query request, and may also include information such as query identifier, original query content, query type, query time, query source, processing status, and the number of query results. Query records can be stored in a database, key-value store, or other persistent storage objects, and can be retrieved based on the query identifier. Through query records, information needed to re-execute data queries and analysis can be restored when a query snapshot is missing or unavailable.

[0159] Updated data to be analyzed refers to the data obtained by re-executing the data query based on the query conditions in the query records. Since the data may change during the re-execution of the data query, the updated data to be analyzed may be the same as or different from the data obtained when the original query snapshot was generated. Using the updated data to be analyzed, objects that meet the data query request can be determined based on the data conditions during the re-execution of the data query.

[0160] The updated target object identifiers and update order information refer to the target object identifiers and their order obtained after analyzing the updated data based on the analytical logic information in the query records. The update order information may include the sequence number corresponding to each updated target object identifier, as well as the corresponding sorting field value and sorting direction. Using the updated target object identifiers and update order information, the candidate object members that meet the data query request and their order can be re-determined.

[0161] An updated query snapshot is a newly generated query snapshot based on the updated target object identifier, update order information, and query conditions. The updated query snapshot replaces non-existent query snapshots or those that do not meet the snapshot usage conditions, and establishes a correspondence with the corresponding query identifier. The updated query snapshot allows for the restoration of the processing chain for subsequent pagination query requests based on the query identifier.

[0162] In practical applications, when the query snapshot corresponding to the query identifier does not exist, or the query snapshot does not meet the snapshot usage conditions, there are multiple ways to obtain the query record corresponding to the query identifier. The specific method should be selected based on the actual situation, and this specification does not impose any limitations on this. In one possible implementation, the query identifier can be used as a cache key to access the cache. If the corresponding query snapshot is not found, or if the lifespan of the query snapshot has expired, the query identifier can be used as the primary key to access the database, read the corresponding query record, and extract query condition information and analysis logic information from the query record. In another possible implementation, a query snapshot can be obtained based on the query identifier, and the data structure, object type, and corresponding relationship of the requesting user in the query snapshot can be verified. If the query snapshot fails verification, the query record service is called, sending the query identifier as a query parameter to the query record service, which then returns the corresponding query record based on the index relationship between the query identifier and the query record.

[0163] Furthermore, the method of "re-executing the data query based on the query condition information to obtain the updated data to be analyzed, and analyzing and processing the updated data to be analyzed based on the analysis logic information to obtain the updated target object identifier and the update order information corresponding to the updated target object identifier" can refer to the above implementation method of "executing the data query based on the query condition information to obtain the data to be analyzed, and analyzing and processing the data to be analyzed based on the analysis logic information to obtain the target object identifier"; the method of "generating an updated query snapshot based on the updated target object identifier, update order information and query condition information, and establishing a correspondence between the query identifier and the updated query snapshot" can refer to the above implementation method of "generating a query snapshot corresponding to the data query request based on the target object identifier, order information and query condition information; establishing a correspondence between the query identifier and the query snapshot", and will not be described again in the embodiments of this specification.

[0164] For example, when a user initially inputs "Query campaigns with a click-through rate (CTR) below 2% in the last 7 days, sorted by spending from highest to lowest," the system processes this data query request, obtains 100 campaign identifiers and their order information, generates a query identifier Q001, and establishes a correspondence between Q001 and the corresponding query snapshot. Simultaneously, the system saves query records including the query conditions and analysis logic information corresponding to this data query request. When the user subsequently requests page 3, with 20 campaign data entries per page, the pagination query request carries the query identifier Q001. However, if no query snapshot is obtained using Q001 as the cache key, or if the obtained query snapshot has exceeded its preset lifespan, then the system retrieves the corresponding query record based on Q001. From this record, it reads the query conditions representing the data query range for campaigns, the last 7 days, CTR, and spending, as well as the analysis logic information representing the comparison between CTR and 2% and sorting by spending from highest to lowest. The data query is re-executed based on the query conditions to obtain the click-through rate and consumption data for each campaign within the past 7 days. This data is then compared, filtered, and sorted based on analytical logic to obtain the updated target object identifier and corresponding update order information. An updated query snapshot is generated based on the updated target object identifier, update order information, and query conditions. Q001 is used as the cache key, and the updated query snapshot is used as the cache value to rewrite the cache, thereby restoring the correspondence between Q001 and the query snapshot.

[0165] By applying the solution of the embodiments of this specification, when the query snapshot does not exist or does not meet the conditions for using the snapshot, the query record containing query condition information and analysis logic information can be obtained according to the query identifier, and the data query and analysis processing can be re-executed using the query record to generate an updated query snapshot. In this way, when the original query snapshot cannot be directly reused, the target object identifier, order information and query condition information required for pagination query can be restored, avoiding the interruption of pagination query due to missing or unusable query snapshot, and enabling the regenerated query snapshot to reflect the candidate object members and their order of arrangement when the data query is re-executed.

[0166] See Figure 2 , Figure 2 This document illustrates a timing diagram of the processing procedure for a data query method according to an embodiment of this specification. Figure 2 The data query process shown can be executed by the requesting client, access layer, data query service, semantic parsing module, query execution engine, and target data source working together. Specifically, the requesting client receives the user's query input and displays the results; the access layer handles the data interaction between the requesting client and the data query service; the data query service organizes the data query process; the semantic parsing module parses the data query request; the query execution engine executes the query statement; and the target data source stores and provides the data to be queried.

[0167] The requesting client sends a semantic query type data query request to the access layer. The data query request can include the natural language query content entered by the user, as well as pagination information, object type, and requesting user information. For example, a user can enter "query plans with a click-through rate of less than 2% in the last 7 days, sorted by spending from highest to lowest" on the requesting client. The requesting client generates a semantic query type data query request based on this query content and sends it to the access layer. Upon receiving the data query request, the access layer sends a data query request to the data query service.

[0168] The data query service invokes the semantic parsing module to perform semantic parsing based on the data query request, business context information, and field information. The business context information can include the business scenario to which the target object belongs, the target object's hierarchy, and the business objectives corresponding to the requesting user. The field information can include the field names, meanings, types, and correspondences between multiple candidate fields. The semantic parsing module can perform word standardization, entity extraction, field matching, and query intent recognition on the data query request, and then return query condition information and analysis logic information, or candidate query information or a restatement prompt. Specifically, when the query intent of the data query request can be clearly parsed, the semantic parsing module returns query condition information and analysis logic information. The query condition information characterizes the data query scope corresponding to the data query request, and the analysis logic information characterizes the analysis and processing logic for the data to be analyzed within the data query scope. When the data query request has semantic ambiguity, the semantic parsing module can return multiple candidate query information to update the data query request based on the user's confirmation of the target candidate query information. When the semantic parsing module cannot determine the query intent expressed by the data query request, it can return a restatement prompt to encourage the user to supplement or adjust the query content.

[0169] After obtaining the query criteria information, the data query service writes this information into a structured query request. The structured query request can include fields such as object type, object hierarchy, fields to be queried, object name, time range, and object status. The data query service can then write the structured parameters contained in the query criteria information into the corresponding fields of the structured query request, enabling the query engine to determine the data range for this query based on the structured query request.

[0170] The data query service invokes the query construction engine to construct a data retrieval query statement based on the query conditions. The query construction engine can determine the corresponding data table and projection fields based on the object type and query fields in the structured query request, determine the corresponding filtering conditions based on the time range and object status, and generate the data retrieval query statement based on at least one of data association relationships, data permission conditions, and business indicator definitions. The data retrieval query statement is used to determine the data to be analyzed corresponding to the data query range from the target data source. The data query service combines the data retrieval query statement with a data analysis query statement, where the query object of the data analysis query statement is the data to be analyzed. In one implementation, the data retrieval query statement can be encapsulated into a common table expression, so that the query result of the data retrieval query statement forms the data to be analyzed, and the data analysis query statement is concatenated after the common table expression, allowing the data analysis query statement to reference this data to be analyzed. Thus, the data retrieval query statement is used to obtain the data to be analyzed corresponding to the query conditions, and the data analysis query statement is used to perform corresponding analysis processing on this data.

[0171] The data query service sends a combined query statement to the query execution engine and instructs the engine to execute it. Upon receiving the combined query statement, the query execution engine invokes the target data source to perform data query and analysis. The target data source can first execute a data retrieval query statement to obtain the data to be analyzed corresponding to the data query range. Then, using this data as the query object of the data analysis query statement, it performs at least one of the following analysis processes: aggregation, comparison, filtering, and sorting, to obtain the data analysis results, which are then returned to the query execution engine.

[0172] The query execution engine extracts object identifiers from the data analysis results and performs deduplication to obtain the target object identifier. Specifically, the query execution engine can read the field values ​​corresponding to the object identifier field from each result in the data analysis results, and perform deduplication on the read object identifiers, merging multiple identical object identifiers for the same object into a single target object identifier. If the data analysis results are sorted, the deduplication process can preserve the first occurrence of the same object identifier within that sorted order. The query execution engine then returns the obtained target object identifier to the data query service.

[0173] The data query service obtains the sequence information corresponding to the target object identifiers, generates a query identifier, and generates a query snapshot based on the target object identifiers, sequence information, and query conditions. Specifically, the data query service can assign sequence numbers to multiple target object identifiers according to their arrangement in the data analysis results, and use these sequence numbers as the sequence information for the corresponding target object identifiers. It then generates a query identifier to uniquely identify the current data query process, organizes the target object identifiers and their sequence information into an ordered set of object identifiers, and encapsulates this ordered set of object identifiers and the query conditions into a query snapshot. The data query service can use the query identifier as a cache key and the query snapshot as a cache value to write to the cache, thereby establishing a correspondence between the query identifier and the query snapshot.

[0174] The data query service returns the target object identifier, query condition information, and query identifier to the access layer. The access layer can determine the current object identifier for the current page from multiple target object identifiers based on the pagination information corresponding to the data query request and the order information corresponding to the target object identifiers. For example, if the pagination information corresponding to the data query request includes page number 1 and 20 data items per page, the access layer can determine the target object identifiers with sequence numbers 1 to 20 from multiple target object identifiers arranged in order, and use them as the current object identifier.

[0175] The access layer sends an object data query request based on the current object identifier and query conditions. The object data query request can include the current object identifier, query conditions, order information, and pagination information, allowing the data query service to limit the scope of the objects to be queried based on the current object identifier and restore the corresponding data query scope based on the query conditions. Upon receiving the object data query request, the data query service calls the target data source to query the target object data based on the current object identifier, order information, and pagination information. Specifically, the current object identifier can be used as the query condition corresponding to the object identifier field, the order information can be used as the basis for arranging the target object data, and the pagination information can be used to limit the number of target object data items to be returned in this query. The target data source returns the target object data corresponding to the current page. The target object data corresponding to the current page can include the object name, object status, creation time, update time, and object metric data corresponding to the current object identifier. The data query service returns the target object data corresponding to the current page to the access layer, which then returns the target object data and query identifier to the requesting client, allowing the requesting client to display the target object data corresponding to the current page and save the query identifier.

[0176] The solutions implemented in this specification allow users to express complex query needs such as multi-dimensional queries, aggregation calculations, relative comparisons, continuity judgments, and multi-condition combinations using natural language. The data query system can process the data query scope represented by the natural language query and the analysis and processing logic separately, thereby reducing processing latency, field matching deviations, data association errors, and indicator caliber deviations caused by directly generating complex query statements, and reusing existing data query capabilities. At the same time, by separating the query of the target object identifier and the target object data and reusing query snapshots, the system improves the processing efficiency of paginated queries and the consistency of member order. It also provides clarification, re-description, returning empty results, or recalculation for situations such as semantic ambiguity, inability to parse, failure to obtain the target object identifier, or processing timeout, thereby improving the accuracy, stability, and fault tolerance of the natural language data query process.

[0177] See Figure 3 , Figure 3 This diagram illustrates the processing steps of a data query method according to an embodiment of this specification. Figure 3 The data query method shown can be executed by the data query service, or it can be executed by the data query service in conjunction with the semantic parsing module, the query construction engine, and the target data source.

[0178] Obtain data query requests of semantic query type. Parse the data query requests to obtain parsing results. Specifically, the data query request can be input into the semantic parsing module, which combines business context information and field information to perform word standardization, entity extraction, field matching, and query intent recognition on the data query request, and generates parsing results based on the identified object type, query field, time range, and analysis relationships.

[0179] Further, the parsing result type is determined. If the parsing result type is semantically ambiguous, multiple candidate query information is generated to allow the user to identify the target candidate query that matches their query intent. If the parsing result type is unparseable, a rephrasing prompt is generated to encourage the user to adjust their query or supplement their query content. If the parsing result type is successful, query condition information and analysis logic information are obtained. The analysis logic information includes the data analysis query statement. Query condition information characterizes the data query range corresponding to the data query request and may include information such as object type, query field, time range, and object status. The data analysis query statement characterizes the analysis and processing logic executed on the data to be analyzed within the data query range; its query object is the data to be analyzed.

[0180] Furthermore, the query criteria information is written into the structured query request. The structured query request can include fields such as object type, set of fields to be queried, object name, start time, end time, and object status. Based on the type of each piece of information in the query criteria, the corresponding information can be written into the corresponding fields in the structured query request.

[0181] Furthermore, the query construction engine is invoked to construct a data retrieval query statement based on the query conditions. The query construction engine can determine the corresponding data table and projection fields based on the object type and the fields to be queried in the structured query request, determine data filtering conditions based on the time range and object status, and construct the data retrieval query statement based on at least one of the following: data relationships, data permission conditions, and business metric definitions. The data retrieval query statement is used to obtain the data to be analyzed corresponding to the data query range.

[0182] Furthermore, data retrieval queries are combined with data analysis queries. In one implementation, the data retrieval query can be encapsulated into a common table expression, so that the query result of the data retrieval query forms the data to be analyzed. The data analysis query is then appended to this common table expression, allowing the data analysis query to reference the data to be analyzed. Thus, the data retrieval query is used to determine the data range involved in the analysis, and the data analysis query is used to perform the corresponding analysis within that data range.

[0183] Furthermore, the combined query statement is executed to analyze and process the data to be analyzed, obtaining data analysis results. Specifically, the query execution engine can send the combined query statement to the target data source for execution. The target data source first obtains the data to be analyzed based on the data acquisition query statement, then performs at least one of the following processes on the data to be analyzed according to the data analysis query statement: aggregation, comparison, filtering, and sorting, and returns the data analysis results.

[0184] Furthermore, object identifiers are extracted from the data analysis results and deduplicated to obtain the target object identifiers. Specifically, the field values ​​corresponding to the object identifier field can be read from each result data in the data analysis results, and duplicate identical object identifiers can be merged into one object identifier. If the data analysis results are sorted, the first occurrence of the same object identifier can be retained to obtain target object identifiers that are unique and maintain their corresponding order.

[0185] Furthermore, a query snapshot is generated based on the target object identifier, the order information of the target object identifier, and the query condition information; a correspondence is established between the query identifier and the query snapshot; the current object identifier is determined based on the pagination information and the order information; and the target object data corresponding to the current page is queried based on the current object identifier. Specifically, the sequence number corresponding to each target object identifier can be determined according to the arrangement position of multiple target object identifiers in the data analysis results, and the target object identifier, sequence number, and query condition information are encapsulated into a query snapshot; a query identifier is generated to identify the current data query process, and the query identifier is written to the cache as a cache key and the query snapshot as a cache value. Subsequently, the range of sequence numbers corresponding to the current page can be determined based on the page number and the amount of data per page in the pagination information, and the target object identifier within this sequence number range is selected from multiple target object identifiers as the current object identifier, and then the object data of the corresponding object is queried based on the current object identifier.

[0186] See Figure 4 , Figure 4 This diagram illustrates the processing flow of a pagination query method according to an embodiment of this specification. Figure 4 The pagination query method shown can generate a query snapshot when the data query is executed for the first time, and reuse the query snapshot when subsequent pagination query requests are received; when the query snapshot does not exist or does not meet the snapshot usage conditions, the data query and analysis processing can be re-executed based on the query records to generate an updated query snapshot.

[0187] First, obtain the data query request or the pagination query request carrying a query identifier. The data query request can be generated when the user initiates a query for the first time, including the query content and corresponding pagination information; the pagination query request can be generated when the user triggers a page-turning operation after viewing the initially returned target object data, including the query identifier and the pagination information corresponding to the currently requested page. The query identifier is used to associate data query requests, query records, and query snapshots within the same data query process.

[0188] Further, determine whether the obtained request is a data query request. This can be determined based on whether the request carries a query identifier, the value of the request type field, or the query stage the request is in. If the request does not carry an existing query identifier, or the request type field indicates an initial query, the request can be identified as a data query request; if the request carries an existing query identifier, or the request type field indicates a paginated query, the request can be identified as a paginated query request.

[0189] If so, based on the data query request, query condition information and analysis logic information are obtained, and data query and analysis processing are performed to obtain the target object identifier. Specifically, the data query request can be parsed to obtain query condition information that characterizes the scope of the data query and analysis logic information that characterizes the analysis processing logic for the data to be analyzed; based on the query condition information, the data query is performed to obtain the data to be analyzed, and based on the analysis logic information, the data to be analyzed is analyzed and processed to obtain the target object identifier.

[0190] Further, a query identifier is generated and the query record is saved. The query identifier can be a number, a character, or a combination of numbers and characters, used to uniquely identify this data query process. The query record may include the query identifier, the query conditions corresponding to the data query request, and the analysis logic information. It may also include information such as the original query content, query type, query time, and the number of target object identifiers. The query identifier can be used as the primary key or index field of the query record, and the query record can be saved to a database or other persistent storage object.

[0191] Furthermore, a query snapshot is generated based on the target object identifier, sequence information, and query condition information, and a correspondence is established between the query identifier and the query snapshot. Specifically, the sequence information corresponding to each target object identifier can be determined based on its position in the data analysis results, and the multiple target object identifiers, their corresponding sequence information, and query condition information are encapsulated into a query snapshot. The query identifier can be used as a cache key and the query snapshot as a cache value, or the query identifier can be written into the query identifier field of the query snapshot record, thereby establishing a correspondence between the query identifier and the query snapshot. The query snapshot can also be set with a preset lifespan to limit the time range within which the query snapshot can be directly reused by paginated query requests.

[0192] If not, obtain a query snapshot based on the query identifier. Specifically, the query identifier can be extracted from the pagination query request and used as a cache key to access the cache and read the corresponding query snapshot; alternatively, the database or key-value store system can be accessed based on the query identifier, and the corresponding query snapshot can be obtained according to the index relationship between the query identifier and the query snapshot.

[0193] Further, it is determined whether the query snapshot meets the snapshot usage conditions. Snapshot usage conditions may include at least one of the following: the query snapshot exists, the query snapshot is within a preset lifespan, the data structure of the query snapshot is complete, the object type corresponding to the query snapshot is consistent with the object type corresponding to the pagination query request, and the query snapshot corresponds to the current requesting user. If the query snapshot meets the snapshot usage conditions, it can be directly used to process the pagination query request. If the query snapshot does not exist or does not meet the snapshot usage conditions, the query record is retrieved, the data query and analysis processing are re-executed, and an updated query snapshot is generated. Specifically, the corresponding query record can be retrieved based on the query identifier carried by the pagination query request; the query condition information and analysis logic information corresponding to the data query request can be extracted from the query record; the data query is re-executed based on the query condition information to obtain the updated data to be analyzed; and the updated data to be analyzed is analyzed based on the analysis logic information to obtain the updated target object identifier and the corresponding update order information; then, an updated query snapshot is generated based on the updated target object identifier, update order information, and query condition information, and a correspondence between the query identifier and the updated query snapshot is established.

[0194] Furthermore, the current object identifier is determined based on the pagination information and the target object identifier and sequence information in the query snapshot. When the query snapshot meets the snapshot usage conditions, the current object identifier can be determined based on the pagination information and the target object identifier and sequence information in the original query snapshot; when a new and updated query snapshot is generated, the current object identifier can be determined based on the pagination information and the target object identifier and update sequence information in the updated query snapshot. Specifically, multiple target object identifiers can be arranged according to sequence information, and the start and end positions corresponding to the current page can be determined based on the page number and the amount of data per page in the pagination information. The target object identifier located between the start and end positions is then determined as the current object identifier.

[0195] Furthermore, based on the current object identifier and the query conditions in the query snapshot, the target object data corresponding to the current page is retrieved. Specifically, the current object identifier can be used as the object identifier limiting condition, and the query conditions in the query snapshot can be used as the data range limiting condition. The object identifier limiting condition and the data range limiting condition are written into the object data query request to retrieve the target object data, such as the object name, object status, and object metric data corresponding to the current object identifier. When using the updated query snapshot, the target object data corresponding to the current page can be retrieved based on the current object identifier and the query conditions in the updated query snapshot.

[0196] Finally, the target object data corresponding to the current page is returned. The returned target object data can be arranged according to the order information corresponding to the current object identifier, and can also carry a query identifier, so that the requesting end saves the query identifier and writes the query identifier into a new pagination query request when the user continues to perform pagination operations.

[0197] See Figure 5 , Figure 5 This specification illustrates an architecture diagram of a data query system provided in one embodiment of the specification. The data query system may include a client 502 and a server 504. Client 502 is used to send a data query request to server 504; The server-side 504 is used to parse data query requests, obtain query condition information and analysis logic information; execute data queries based on query condition information to obtain data to be analyzed, and analyze and process the data to be analyzed based on analysis logic information to obtain target object identifiers; query the target object data corresponding to the data query request based on the target object identifiers; and send the target object data to the client 502. Client 502 is also used to receive target object data sent by server 504.

[0198] In practical applications, a data query system may include a server 504 and multiple clients 502. Multiple clients 502 can establish communication connections through the server 504. In a data query scenario, the server 504 provides data query services between the multiple clients 502. Each client 502 can act as a sender or receiver, communicating through the server 504. Users can interact with the server 504 through clients 502 to receive data sent by other clients 502, or send data to other clients 502, etc. In a data query scenario, a user can publish a data stream to the server 504 through a client 502. The server 504 determines the target object data based on the data stream and pushes the target object data to other clients with established communication. Clients 502 can also interact with users through a graphical user interface to implement the data query method provided in the embodiments of this specification. The client 502 and server 504 are connected via a network. The network provides the medium for the communication link between the client 502 and server 504. Networks can include various connection types, such as wired and wireless communication links or fiber optic cables. Data transmitted by client 502 may need to undergo encoding, transcoding, compression, or other processing before being published to server 504.

[0199] Client 502 can be a browser, application (APP), or web application such as HyperText Markup Language 5 (H5) application, or a lightweight application (also known as a mini-program), or cloud application, etc. Client 502 can be developed based on the software development kit (SDK) of the corresponding service provided by server 504, such as based on a Real-Time Communication (RTC) SDK. Client 502 can be deployed in electronic devices and depends on the device to run or on certain apps within the device. Electronic devices may have displays and support information browsing, such as personal mobile terminals like mobile phones, tablets, and personal computers. Various other types of applications can also be configured in electronic devices, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, and social media platform software.

[0200] Server-side 504 can include servers providing various services, such as servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It should be noted that server-side 504 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. The server can also be a server in a distributed system, or a server integrated with blockchain. The server can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0201] It is worth noting that the data query method provided in the embodiments of this specification is generally executed by the server. However, in other embodiments of this specification, the client may also have similar functions to the server, thereby executing the data query method provided in the embodiments of this specification. In other embodiments, the data query method provided in the embodiments of this specification may also be executed jointly by the client and the server.

[0202] Corresponding to the above-described data query method embodiments, this specification also provides data query device embodiments. Figure 6 A schematic diagram of a data query device according to one embodiment of this specification is shown. Figure 6As shown, the device includes: Module 602 is configured to retrieve data query requests; The parsing module 604 is configured to parse the data query request to obtain query condition information and analysis logic information. The query condition information is used to characterize the data query range corresponding to the data query request, and the analysis logic information is used to characterize the analysis and processing logic for the data to be analyzed corresponding to the data query range. The execution module 606 is configured to perform data query based on query condition information to obtain the data to be analyzed, and to analyze and process the data to be analyzed based on the analysis logic information to obtain the target object identifier. The query module 608 is configured to query the target object data corresponding to the query request based on the target object identifier.

[0203] Optionally, the execution module 606 is further configured to call the query construction engine to construct a data acquisition query statement based on the query condition information. The data acquisition query statement is used to determine the data to be analyzed corresponding to the data query range from the target data source based on at least one of data association, data permission conditions, and business indicator caliber. The data acquisition query statement is executed to obtain the data to be analyzed from the target data source.

[0204] Optionally, the analysis logic information includes a data analysis query statement, the query object of which is the data to be analyzed; the execution module 606 is further configured to execute the data analysis query statement to analyze and process the data to be analyzed and obtain the target object identifier, wherein the analysis and processing includes at least one of aggregation, comparison, filtering and sorting.

[0205] Optionally, the execution module 606 is further configured to execute data analysis query statements, analyze and process the data to be analyzed, obtain data analysis results, extract object identifiers from the data analysis results, and perform deduplication processing on the extracted object identifiers to obtain target object identifiers.

[0206] Optionally, the query module 608 is further configured to obtain the first page information corresponding to the data query request and the sequence information corresponding to the target object identifier respectively; determine the current object identifier corresponding to the first page from the target object identifier based on the first page information and the sequence information; and query the target object data corresponding to the first page based on the current object identifier corresponding to the first page.

[0207] Optionally, the device further includes: a first establishment module, configured to acquire the sequence information corresponding to the target object identifiers respectively, and generate a query identifier corresponding to the data query request; generate a query snapshot corresponding to the data query request based on the target object identifiers, sequence information and query condition information; and establish a correspondence between the query identifiers and the query snapshots.

[0208] Optionally, the device further includes: a first determining module, configured to, in response to a pagination query request carrying a query identifier, obtain a query snapshot corresponding to the query identifier; if the query snapshot meets the snapshot usage conditions, determine the current object identifier corresponding to the second page based on the second pagination information corresponding to the pagination query request, the target object identifier in the query snapshot, and the order information corresponding to the target object identifier; and query the target object data corresponding to the second page based on the current object identifier corresponding to the second page and the query condition information in the query snapshot.

[0209] Optionally, the device further includes: a second establishment module, configured to: obtain a query record corresponding to the query identifier when the query snapshot corresponding to the query identifier does not exist or the query snapshot does not meet the snapshot usage conditions; wherein the query record includes query condition information and analysis logic information corresponding to the data query request; re-execute the data query based on the query condition information to obtain updated data to be analyzed, and analyze and process the updated data to be analyzed based on the analysis logic information to obtain the updated target object identifier and the update order information corresponding to the updated target object identifier; generate an updated query snapshot based on the updated target object identifier, the update order information and the query condition information, and establish a correspondence between the query identifier and the updated query snapshot.

[0210] Optionally, the device further includes: a second determining module configured to determine the query type corresponding to the data query request, wherein the query type includes any one of an identifier query type, a name query type, and a semantic query type; and a parsing module 604 further configured to parse the data query request to obtain query condition information and analysis logic information when the query type is a semantic query type.

[0211] Optionally, the parsing module 604 is further configured to parse the data query request and obtain the parsing result; if the parsing result indicates that the data query request has semantic ambiguity, generate multiple candidate query information; in response to the confirmation information of the target candidate query information among the multiple candidate query information, determine the updated data query request based on the target candidate query information, and parse the updated data query request to obtain query condition information and analysis logic information.

[0212] The solution implemented in this specification involves parsing a data query request into query condition information and analysis logic information using a parsing module. The execution module first obtains the data to be analyzed corresponding to the data query range based on the query condition information, and then determines the target object identifier based on the analysis logic information. The query module further queries the target object data based on the target object identifier. This approach can connect the determination of the data query range, the determination of the target object identifier, and the query of the target object data, thereby reducing the data range and output data volume involved in complex analysis and processing, and improving the accuracy and efficiency of data queries.

[0213] The above is an illustrative scheme of a data query device according to this embodiment. It should be noted that the technical solution of this data query device and the technical solution of the data query method described above belong to the same concept. For details not described in detail in the technical solution of the data query device, please refer to the description of the technical solution of the data query method described above.

[0214] Figure 7 A structural block diagram of a computing device according to one embodiment of this specification is shown. The components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and a database 750 is used to store data.

[0215] The computing device 700 also includes an access device 740, which enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 740 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Networks (WLAN) interface, a Wi-MAX (World Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0216] In one embodiment of this specification, the above-described components of the computing device 700 and Figure 7 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 7 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0217] The computing device 700 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 700 can also be a mobile or stationary server.

[0218] The processor 720 is used to execute computer programs / instructions, which, when executed by the processor, implement the steps of the data query method described above.

[0219] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the data query method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the data query method described above.

[0220] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the data query method described above.

[0221] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the data query method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the data query method described above.

[0222] An embodiment of this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described data query method.

[0223] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the data query method described above belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the data query method described above.

[0224] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0225] Computer instructions include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in computer-readable media can be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0226] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0227] In the above embodiments, 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.

[0228] The preferred embodiments disclosed above are merely illustrative of this specification. Optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A data query method, characterized in that, include: Get data query request; The data query request is parsed to obtain query condition information and analysis logic information. The query condition information is used to characterize the data query range corresponding to the data query request, and the analysis logic information is used to characterize the analysis and processing logic for the data to be analyzed corresponding to the data query range. A data query is performed based on the query conditions to obtain the data to be analyzed, and the data to be analyzed is processed based on the analysis logic information to obtain the target object identifier. Based on the target object identifier, query the target object data corresponding to the data query request.

2. The method according to claim 1, characterized in that, The process of performing a data query based on the query conditions to obtain the data to be analyzed includes: The query construction engine is invoked to construct a data acquisition query statement based on the query condition information. The data acquisition query statement is used to determine the data to be analyzed corresponding to the data query range from the target data source based on at least one of data association, data permission conditions, and business indicator caliber. Execute the data retrieval query statement to obtain the data to be analyzed from the target data source.

3. The method according to claim 1, characterized in that, The analysis logic information includes data analysis query statements, and the query object of the data analysis query statements is the data to be analyzed; The step of analyzing and processing the data to be analyzed based on the analysis logic information to obtain the target object identifier includes: The data analysis query statement is executed to analyze and process the data to be analyzed, and the target object identifier is obtained. The analysis and processing includes at least one of aggregation, comparison, filtering and sorting.

4. The method according to claim 3, characterized in that, The step of executing the data analysis query statement to analyze and process the data to be analyzed and obtain the target object identifier includes: Execute the data analysis query statement to analyze and process the data to be analyzed, and obtain the data analysis results; The object identifier is extracted from the data analysis results, and the extracted object identifier is deduplicated to obtain the target object identifier.

5. The method according to claim 1, characterized in that, The step of querying the target object data corresponding to the data query request based on the target object identifier includes: Obtain the first pagination information corresponding to the data query request and the order information corresponding to the target object identifier; Based on the first pagination information and the sequence information, determine the current object identifier corresponding to the first page from the target object identifier; Based on the current object identifier corresponding to the first page, query the target object data corresponding to the first page.

6. The method according to any one of claims 1 to 5, characterized in that, After analyzing and processing the data to be analyzed based on the analysis logic information to obtain the target object identifier, the process further includes: Obtain the sequence information corresponding to the target object identifiers respectively, and generate the query identifier corresponding to the data query request; Generate a query snapshot corresponding to the data query request based on the target object identifier, the sequence information, and the query condition information; Establish the correspondence between the query identifier and the query snapshot.

7. The method according to claim 6, characterized in that, After establishing the correspondence between the query identifier and the query snapshot, the method further includes: In response to a pagination query request carrying the query identifier, obtain the query snapshot corresponding to the query identifier; If the query snapshot meets the snapshot usage conditions, the current object identifier corresponding to the second page is determined based on the second page information corresponding to the pagination query request, the target object identifier in the query snapshot, and the order information corresponding to the target object identifier. Based on the current object identifier corresponding to the second page and the query condition information in the query snapshot, query the target object data corresponding to the second page.

8. The method according to claim 7, characterized in that, After obtaining the query snapshot corresponding to the query identifier, the method further includes: If the query snapshot corresponding to the query identifier does not exist, or the query snapshot does not meet the snapshot usage conditions, the query record corresponding to the query identifier is obtained, wherein the query record includes the query condition information and the analysis logic information corresponding to the data query request; The data query is re-executed based on the query conditions to obtain the updated data to be analyzed. Based on the analysis logic information, the updated data to be analyzed is processed to obtain the updated target object identifier and the update order information corresponding to the updated target object identifier. Based on the updated target object identifier, the update order information, and the query condition information, an updated query snapshot is generated, and a correspondence is established between the query identifier and the updated query snapshot.

9. The method according to any one of claims 1 to 5, characterized in that, Before parsing the data query request to obtain query condition information and analysis logic information, the process also includes: Determine the query type corresponding to the data query request, wherein the query type includes any one of the following: identifier query type, name query type, and semantic query type; The process of parsing the data query request to obtain query condition information and analysis logic information includes: When the query type is the semantic query type, the data query request is parsed to obtain the query condition information and the analysis logic information.

10. The method according to claim 9, characterized in that, The step of parsing the data query request to obtain the query condition information and the analysis logic information includes: The data query request is parsed to obtain the parsing result; If the parsing result indicates that the data query request has semantic ambiguity, multiple candidate query information are generated; In response to the confirmation information for the target candidate query information among the multiple candidate query information, an updated data query request is determined based on the target candidate query information, and the updated data query request is parsed to obtain the query condition information and the analysis logic information.

11. A data query device, characterized in that, include: The retrieval module is configured to retrieve data query requests. The parsing module is configured to parse the data query request to obtain query condition information and analysis logic information, wherein the query condition information is used to characterize the data query range corresponding to the data query request, and the analysis logic information is used to characterize the analysis and processing logic for the data to be analyzed corresponding to the data query range. The execution module is configured to perform a data query based on the query conditions to obtain the data to be analyzed, and to analyze and process the data to be analyzed based on the analysis logic information to obtain the target object identifier; The query module is configured to query the target object data corresponding to the data query request based on the target object identifier.

12. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, It stores a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 10.

14. A computer program product, characterized in that, Includes a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 10.