A query request response method, device, equipment and storage medium
By understanding the intent and context of user query requests, and scheduling multiple agents for progressive analysis, this technology solves the problems of insufficient query accuracy and poor adaptability to complex tasks in existing technologies. It achieves precise querying and in-depth analysis, improving the accuracy and efficiency of data analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies for enterprise data query and analysis suffer from insufficient query accuracy, limited functionality, inability to adapt to complex tasks, and lack of business rule verification and post-processing mechanisms. They are unable to achieve accurate queries and in-depth analysis, and cannot meet the full-process needs from general data access to customized decision support.
By acquiring user-input query requests, performing intent understanding and context parsing, generating intent parsing results, scheduling data queries, attribution analysis, or intelligent decision-making agents, and combining result evaluation and cyclic scheduling mechanisms, a progressive analysis logic is formed to adapt to complex task requirements and achieve accurate queries and in-depth analysis.
It improves the accuracy and reliability of query results, forms a complete business analysis chain, adapts to complex tasks, reduces R&D and time costs, supports rapid iteration, and realizes the full-process requirements from data presentation to decision support.
Smart Images

Figure CN121365086B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a query request response method, apparatus, device, and storage medium. Background Technology
[0002] As digital transformation deepens, enterprises accumulate massive amounts of business data, and business and management personnel increasingly need to access and analyze this data directly through natural language to obtain decision support. Ideally, relevant personnel should not need to master Structured Query Language (SQL) or professional data analysis tools to complete the entire process from data fact retrieval and business attribution analysis to action decision recommendations, thereby lowering the barrier to data use and improving analysis efficiency and decision quality.
[0003] Existing technologies for enterprise data querying and analysis have significant shortcomings in terms of query accuracy, functional completeness, business adaptability, and ability to handle complex tasks. Therefore, there is an urgent need for a technical solution that can overcome these limitations and achieve accurate querying and in-depth analysis to meet the full-process needs of enterprises, from general data access to customized decision support. Summary of the Invention
[0004] In view of this, the present disclosure provides a query request response method, apparatus, device and storage medium to achieve accurate query and in-depth analysis, and to meet the full-process needs of enterprises from general data access to dedicated decision support.
[0005] Firstly, a query request response method is provided, applied to query responses to data resources within an enterprise, comprising: obtaining a query request input by a user; performing intent understanding and context parsing on the query request to generate an intent parsing result containing query semantics, task type, and preliminary subtask breakdown results; generating an agent scheduling instruction based on the intent parsing result; the agent scheduling instruction is used to invoke at least one sub-Agent among a data query agent, an attribution analysis agent, or an intelligent decision agent; according to the agent scheduling instruction, the scheduled sub-Agent performs corresponding data query, root cause analysis, or decision suggestion generation operations to obtain the sub-Agent execution result; evaluating whether to continue scheduling the sub-Agent based on the sub-Agent execution result, and when continued scheduling is required, cyclically invoking at least one agent among the data query agent, attribution analysis agent, or intelligent decision agent until the task termination condition is met to obtain an intelligent analysis report; and displaying the intelligent analysis report.
[0006] In one alternative implementation, after parsing the user's intent, the confidence level of the intent and the entity can be evaluated. If any score is lower than a threshold, structured follow-up questions are asked to complete the information, and then the completed information is combined to generate Agent scheduling instructions.
[0007] In one alternative implementation, the execution result, confidence level, and dialogue history of the sub-Agent are stored in the shared context to evaluate the task completion rate. Based on this, it is determined whether to continue scheduling and to determine scheduling strategies such as cyclic, parallel, or serial scheduling, and to generate new instructions.
[0008] In one alternative implementation, the data query agent parses the query task to obtain information such as metrics and dimensions, retrieves the corresponding SQL template, fills in the content to generate executable SQL, and executes it in the enterprise data source to obtain the query result dataset.
[0009] In one alternative implementation, the query results are loaded into an in-memory computing engine to perform secondary calculations that SQL cannot complete, such as year-on-year and month-on-month comparisons and composite operations, and then converted into a standard format to obtain refined query results.
[0010] In one alternative implementation, the data query agent generates a query ID, checks the cache first, and if a matching historical result is found, it returns it directly; otherwise, it executes SQL to obtain a new result and stores the associated ID in the cache.
[0011] In one alternative implementation, the attribution analysis agent parses the temporal representation of the attribution task using a large language model, verifies and standardizes the time parameters, extracts the corresponding time point indicator data for comparison, and obtains the time comparison analysis results.
[0012] In one alternative implementation, the attribution analysis agent extracts indicator data at comparison time points, detects indicator anomalies, and if significant, drills down to analyze and rank dimensional differences, calculates the contribution of core dimensions, and selects key factors to generate a structured attribution report.
[0013] In one alternative implementation, the attribution analysis agent parses the comparison intent to determine dimensions and filtering conditions, generates comparison groups with business semantics and corresponding query statements, calculates the differences between groups in parallel, and organizes the comparison results using a tree structure.
[0014] In one alternative implementation, the intelligent decision agent determines whether the decision task requires prediction. If prediction is required, it processes historical data to obtain an effective time series, automatically selects a model for training and prediction, and outputs a structured prediction result containing confidence intervals.
[0015] In one alternative implementation, the intelligent decision-making agent converts decision-making tasks into query vectors, retrieves candidate strategies from the strategy knowledge base, determines the optimal strategy through keyword filtering and scenario fit calculation, and generates a report by converting it into specific action suggestions.
[0016] In one alternative implementation, enterprise business scenario data is acquired, scenario-based metrics, dimensions, and time granularity are configured, and a thesaurus of metrics / dimensions and a business terminology knowledge base with dual indexes are constructed to convert user queries into standardized requests.
[0017] In one alternative implementation, the interface of the enterprise-specific tool is verified to conform to the specification. If it passes, it is declaratively registered to the corresponding Agent tool library. When scheduling the Agent, the tool is invoked, and the result is stored in the shared context for subsequent use.
[0018] In one alternative implementation, the enterprise's custom indicator configuration is obtained, the expression is parsed and a dependency graph is constructed, and it is registered to the indicator template library. When a relevant query is received, the basic indicators are first queried, the custom indicator results are calculated and stored in the shared context.
[0019] Secondly, a query request response device is provided for responding to queries on enterprise data resources, comprising: an intent parsing module for acquiring user-inputted query requests, performing intent understanding and context parsing on the query requests, and generating intent parsing results including query semantics, task type, and preliminary subtask breakdown results; a scheduling instruction generation module for generating agent scheduling instructions based on the intent parsing results; the agent scheduling instructions for invoking at least one sub-Agent among a data query agent, an attribution analysis agent, or an intelligent decision agent; a task execution module for executing corresponding data query, root cause analysis, or decision suggestion generation operations by the scheduled sub-Agent according to the agent scheduling instructions, obtaining sub-Agent execution results; evaluating whether to continue scheduling sub-Agents based on the sub-Agent execution results, and when continued scheduling is required, cyclically invoking at least one agent among the data query agent, attribution analysis agent, or intelligent decision agent until the task termination condition is met, obtaining an intelligent analysis report; and a display module for displaying the intelligent analysis report.
[0020] Thirdly, a computer device is provided, the computer device including a processor and a memory, the memory storing computer instructions for querying data resources within an enterprise, the processor executing the computer instructions to implement the method described in any of the above embodiments.
[0021] Fourthly, a computer-readable storage medium is provided for storing computer instructions for querying data resources within an enterprise, wherein the computer instructions, when executed, are used to implement the method described in any of the above embodiments.
[0022] The technical solution described in this disclosure, when dealing with internal business data, does not directly convert natural language into query commands when business personnel use it to query. Instead, it first performs intent understanding and context parsing on the query request, generating intent parsing results that include query semantics, task type, and preliminary sub-task breakdown. This process can identify ambiguous semantics in advance and supplement contextual information, reducing semantic bias from the source and providing accurate task basis for subsequent Agent execution, avoiding query result deviations caused by semantic misunderstandings. The scheduled data query Agent, attribution analysis Agent, and intelligent decision-making Agent are all specialized modules, and combined with result evaluation and cyclic scheduling mechanisms, further improve the accuracy and reliability of query results.
[0023] Furthermore, by scheduling three types of sub-agents, a complete business analysis chain is formed. Compared to the single data output of typical enterprise data query solutions, the method of this disclosure achieves an end-to-end closed loop from problem discovery to problem resolution, upgrading business value from data presentation to decision support. The three types of sub-agents do not execute independently but form a progressive analysis logic through scheduling instructions. The depth of analysis far exceeds the fixed-step output of typical solutions, better aligning with the complete thought process of human analysts. Moreover, this disclosure does not rely on predefined fixed processes but dynamically determines the next action based on the evaluation of sub-agent execution results. It can break down complex tasks into executable sub-steps and flexibly adjust the execution path based on intermediate results, adapting to open-ended and exploratory complex analysis needs. The task termination condition is not fixed but dynamically determined based on the business scenario. This avoids both insufficient and excessive analysis, balancing analysis quality and efficiency, and solving the problems of rigid processes and inability to adapt to complex tasks in traditional solutions.
[0024] In addition, the embodiments disclosed herein also provide customized service technologies for the semantic layer, tool layer, and logic layer. The customization of the semantic layer, tool layer, and logic layer does not exist in isolation, but forms a synergistic effect to achieve full-process customization support, which can significantly reduce R&D costs and time costs, while supporting rapid iteration when subsequent business changes occur. Attached Figure Description
[0025] Figure 1 A flowchart of a query request response method provided in this embodiment of the present disclosure;
[0026] Figure 2This is a schematic diagram illustrating the entire task execution process of an embodiment of this disclosure;
[0027] Figure 3 This is a schematic diagram of a query request response device provided in an embodiment of the present disclosure;
[0028] Figure 4 This is a schematic diagram of a computer device provided for an embodiment of the present disclosure. Detailed Implementation
[0029] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0030] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure 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 herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0031] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0032] Furthermore, the symbol “ / ” in this disclosure indicates that there is an “or” relationship between the related objects before and after the symbol, or that the related objects have an exemplary relationship that can coexist.
[0033] Research has revealed that current technical solutions for internal enterprise data querying and analysis primarily rely on data analysis workflows with fixed functions. These solutions achieve initial process-oriented analysis through predefined, fixed processes (such as querying data first and then performing simple comparison and sorting). However, the workflow paths are static and fixed, unable to be dynamically adjusted or intelligently orchestrated based on the complexity of user issues. Therefore, they struggle to meet the complex needs of enterprise-level critical business scenarios. For example, they lack business rule verification and post-processing mechanisms for query results, potentially leading to data discrepancies with actual business requirements and impacting analysis reliability. Furthermore, their functionality is limited and their business value is limited. They cannot simulate the complete thought process of a human analyst, from identifying a problem to analyzing its causes and making recommendations, resulting in limited decision-support value for the output. Finally, their ability to handle complex tasks is weak. Existing solutions either employ a linear execution model with a single agent or a fixed-path workflow, lacking the ability to break down complex tasks and dynamic scheduling mechanisms. They cannot perform multi-step, in-depth, progressive analysis based on intermediate results, making it difficult to address open-ended and exploratory complex analysis needs.
[0034] The embodiments disclosed herein aim to overcome the above limitations and achieve technical solutions for accurate querying, in-depth analysis, flexible customization, and intelligent orchestration, so as to meet the full-process needs of enterprises from general data access to dedicated decision support.
[0035] The solutions of the present disclosure will be further described in detail below through specific embodiments.
[0036] like Figure 1 The diagram illustrates a query request response method provided in this embodiment. The executing entity of this method can be considered as the central agent (Brain Agent) among the deployed agents, including:
[0037] S101: Obtain the query request input by the user, perform intent understanding and context parsing on the query request, and generate an intent parsing result containing query semantics, task type and preliminary subtask decomposition results.
[0038] Here, after receiving the user's query request, it not only identifies the key information in the query but also determines the task type: whether it only requires data retrieval (corresponding to the data query agent), requires cause analysis (corresponding to the attribution analysis agent), or requires decision-making suggestions (corresponding to the intelligent decision-making agent). This avoids the bias of returning only data when the user wants to analyze the cause. By sharing the context, it automatically connects the previous dialogue content. For example, if a user first asks "Sales revenue in East China in Q2 2024" and then asks "How much did it increase sequentially?", it will automatically associate "East China," "sales revenue," and "Q2 2024" from the previous step, without the user having to repeat the explanation, while also resolving the issue of vague expressions such as "it" or "this data." Finally, it generates results that include query semantics (standardized requirements, such as 'retrieve sales revenue of product A in East China in Q2 2024, excluding returned orders'), task type (such as 'data query'), and preliminary sub-task breakdown (such as 'first retrieve basic sales revenue, then filter returned data'), providing a clear basis for subsequent scheduling of the corresponding agent.
[0039] S102: Based on the intent parsing result, generate an agent scheduling instruction; the agent scheduling instruction is used to invoke at least one sub-Agent among the data query agent, attribution analysis agent, or intelligent decision agent.
[0040] This step can match agents according to needs. If data needs to be queried (such as Q2 sales), an instruction to call the data query agent is generated; if the cause needs to be found (such as why sales have decreased), the attribution analysis agent is called; if a solution needs to be found (such as how to increase sales), the intelligent decision agent is called, ensuring that the agent's capabilities accurately match the needs.
[0041] The number of Agents to be invoked is determined based on the preliminary subtask breakdown results. If it is a single requirement (such as simply querying data), a single Agent is invoked; if the requirement is complex (such as querying data first and then analyzing the cause), multiple Agents are invoked to ensure the coherent execution of multi-step requirements. The scheduling instruction in this embodiment of the disclosure is not just "invoking Agents," but also includes specific parameters (such as querying sales figures for "East China Region" and "2024Q2"), task objectives (such as excluding returned orders), and result requirements (such as returning results in tabular form), so that the sub-Agents clearly understand "what to do, how to do it, and what to output," avoiding execution deviations.
[0042] In one implementation, after generating the intent parsing result, the method further includes: performing intent confidence assessment and query entity confidence assessment on the intent parsing result; when the confidence score of either the intent confidence assessment or the query entity confidence assessment is lower than the corresponding threshold, generating a structured follow-up question and sending it to the user to obtain the missing information to be filled in; the step of generating an Agent scheduling instruction based on the intent parsing result includes: generating an Agent scheduling instruction based on the intent parsing result and the missing information to be filled in.
[0043] Here, after generating the intent parsing results, reliability can be assessed from two aspects: intent confidence (determining whether the user's core needs are accurately identified, such as misinterpreting "analyze sales" as "query profit") and query entity confidence (determining whether key information is clear, such as "this month" not specifying the year, or "sales revenue" not specifying the region), avoiding scheduling deviations directly caused by ambiguous understanding. When confidence is low, proactive follow-up questions are asked to supplement information. Specifically, if any confidence level is below a threshold (e.g., it's uncertain whether "this month" refers to May or June 2024), a structured follow-up question is generated (e.g., "Which month of 2024 do you specifically refer to as 'this month'?"), rather than guesswork, ensuring that missing key information is obtained. When finally generating the Agent scheduling instruction, the initial intent parsing results are combined with the user's supplementary information (e.g., "May 2024" "East China region"), making the instruction more precise (e.g., calling the data query Agent to query "May 2024 East China region sales revenue"), improving the accuracy of subsequent execution from the source.
[0044] Specifically, the first step is to perform a dual-reset reliability assessment. The Brain Agent invokes a dedicated confidence assessment module to score the previously generated intent parsing results from two dimensions: intent and entity (the scoring range is typically 0-1, and the threshold can be configured by the enterprise according to its business precision requirements, such as 0.8). The intent confidence assessment determines whether the understanding of the user's core need type is clear. The assessment object is the task type (data query / attribution analysis / decision suggestion) in the intent parsing results, mainly looking at the degree of matching between the user's description and the task type. For example, if a user queries "Why are sales so bad lately?", and the matching degree for "task type: attribution analysis" is high (confidence 0.95), then the assessment passes. If the user's description is vague (e.g., "sales-related analysis"), and it's unclear whether they are "checking data" or "finding the cause," then the intent confidence is low (e.g., 0.6), failing to reach the threshold. When evaluating the confidence level of a query entity, the assessment focuses on whether the extraction of "core entity information from the user's query" is complete and clear. The evaluation object is the key entities (such as indicators, dimensions, time ranges, and filtering conditions) contained in the query semantics of the intent parsing results. The main focus is on whether the entity is missing or ambiguous. For example, if a user queries "check sales revenue in East China in Q2 2024", and the extracted data is "indicator = sales revenue, dimension = East China region, time = 2024Q2", the entity is complete and unambiguous (confidence level 0.9), then the evaluation passes. If the user only says "check sales revenue" without mentioning the time or region (entity missing), or says "check sales revenue in that region" ("that region" is ambiguous), then the query entity confidence level is low (e.g., 0.5), failing to reach the threshold.
[0045] The second step involves structured follow-up questions. When either the intent confidence score or the query entity confidence score falls below a preset threshold, the Brain Agent automatically generates structured follow-up questions, rather than open-ended questions (such as asking precise questions instead of "What information do you need to provide?"), ensuring that the user can quickly and clearly provide the information. For follow-up questions with low intent confidence: focus on "clarifying the task type." For example, if the user says "sales-related analysis," the follow-up question is: "Do you need to query sales data, analyze the reasons for sales changes, or obtain decision-making suggestions to improve sales?" For follow-up questions with low query entity confidence, focus on "filling in missing / unambiguous entities." For example (missing entity), if the user says "check sales revenue," the follow-up question is: "Which time range (e.g., Q2 2024, this month) and which region (e.g., East China, nationwide) do you need to query for sales revenue?" For example (ambiguous entity), if the user says "check sales revenue in that region" (the meaning of "that region" was not mentioned earlier), the follow-up question is: "Does the 'that region' you mentioned refer to the 'South China region' mentioned in the previous round of dialogue?"
[0046] Step 3: Integrate and complete information to refine the intent parsing results. After the user replies with follow-up questions, the Brain Agent integrates the completed missing information (such as the user adding "2024Q2, East China region") with the initial intent parsing results to generate a refined intent parsing result. For example, the initial intent parsing result is "Query semantics = query sales revenue, task type = data query (confidence 0.6)". After the user adds "2024Q2, East China region" and explicitly states "query only data", the refined result becomes "Query semantics = query 2024Q2 East China region sales revenue, task type = data query (confidence 0.98)", eliminating all ambiguities.
[0047] Step 4: Generate scheduling instructions based on the improved results to ensure accuracy. The reconstructed Agent scheduling instruction generation step no longer relies solely on the initial intent parsing results, but instead uses the improved intent parsing results as the basis to ensure that the instructions contain complete and explicit execution parameters. For example, based on the improved result "Query sales revenue in East China region in Q2 2024, task type = data query", the generated scheduling instruction is "Target Agent: Data Query Agent; Execution Parameters: Indicator = Sales Revenue, Dimension = East China Region, Time = Q2 2024; Result Requirement: Return regional summary and detailed data for each city", avoiding Agent execution deviations due to missing parameters (such as not defaulting to querying "national" or "2023 data").
[0048] Furthermore, the confidence score mechanism is not a subjective judgment, but rather a calculation based on historical data matching and business rule matching. For example, intent confidence will refer to "historical matching records of similar user statements and task types," while query entity confidence will verify "whether the entity exists in the enterprise's business terminology library and whether it conforms to data model constraints" (e.g., "region" must be enterprise-defined "East China / South China / North China," avoiding non-standardized expressions like "XX province"). If both intent and entity confidence are low, "intent-related questions" can be asked first (clarifying "what to do" before "how to do it") to avoid logical confusion. For example, first ask "Are you looking for data or finding the cause?" and then ask "which time range do you need to query?" In practice, enterprises can adjust the confidence threshold according to their business scenarios. For example, financial analysis scenarios require high accuracy, so the threshold can be set to 0.9; daily operational queries require high efficiency, so the threshold can be set to 0.7, balancing accuracy and interaction efficiency.
[0049] This implementation method improves the accuracy of agent execution. By completing missing information and eliminating intent ambiguity, subsequent sub-agents (such as the data query agent) do not need to "guess" parameters, significantly improving the match between execution results and user needs and reducing the need for repeated queries and corrections. Proactive inquiry avoids the inefficient process of users providing feedback and corrections after outputting incorrect results, allowing users to obtain accurate results with a single operation, which is especially user-friendly for non-technical users (such as business personnel). It also avoids "invalid agent calls" caused by misunderstandings (such as mistakenly calling the attribution analysis agent and then having to call the data query agent again), reducing the pressure on system computing resources and data source access. This implementation method is a "error-proofing optimization" of the core process. Through quantitative evaluation and proactive completion, the understanding of requirements changes from "vague possibility" to "clear certainty," laying a precise foundation for subsequent multi-agent collaborative execution.
[0050] In one implementation, the execution results, result credibility scores, and dialogue history of the sub-agents can all be stored in a shared context storage, allowing all agents to share information and avoiding duplicate queries or information fragmentation.
[0051] Specifically, the execution result of the sub-Agent, along with the confidence score and dialogue history associated with the execution result, are written into a shared context memory; the execution result of the sub-Agent, the confidence score, and the dialogue history are read from the shared context memory, and the completeness of the execution result of the sub-Agent and the complexity of the query request are analyzed to generate a task completion evaluation result; the step of evaluating whether to continue scheduling the sub-Agent based on the execution result of the sub-Agent includes: determining whether to continue scheduling the sub-Agent based on the task completion evaluation result; when the task completion evaluation result indicates that continued scheduling is required, determining the next scheduling strategy, the scheduling strategy including at least one of cyclically calling the same agent, parallel scheduling of multiple agents, or serially calling different agents, to obtain a scheduling strategy scheme; and generating a new agent scheduling instruction based on the scheduling strategy scheme and the historical execution results in the shared context memory.
[0052] Here, the stored content includes three key types of information: sub-Agent execution results, such as the "2024Q2 East China Sales Dataset" returned by the data query agent and the "Root Cause List and Impact Ratio" output by the attribution analysis agent; association confidence scores, reflecting the reliability of the results, such as the "Data Accuracy Score (0.92)" of the data query agent and the "Root Cause Confidence Score (0.88)" of the attribution analysis agent (the scores are generated based on data matching degree and business rule verification); and dialogue history, which records the interaction between the user and the system, such as "the user initially queried 'analyze Q2 sales,' and then added 'must include East China + North China regions,'" used to associate the user's needs with the background. This approach can break the limitations of traditional solutions where "each agent's results are stored independently and cannot be shared." For example, the attribution analysis agent does not need to call the data query agent again and can directly read historical data results from the shared storage, reducing redundant calculations and resource waste.
[0053] Task completion assessment transforms "fuzzy judgments" into "quantifiable evidence." This step is crucial for connecting information storage and scheduling decisions. Its core is to objectively analyze whether the current analysis meets the requirements based on shared context information, avoiding subjective assessments. The assessment focuses on two core dimensions to ensure comprehensiveness. The completeness of the sub-Agent's execution results determines whether the results cover all elements of the user's needs. For example, if a user requests analysis of sales revenue in East and North China, returning only East China data results in a low completeness score (0.5); returning both data and preliminary attribution results in a high completeness score (0.85). The complexity of the query request determines whether the user's needs are multi-step or multi-level tasks. For example, "checking only sales revenue" is a simple task (complexity 0.3), while "checking sales revenue + analyzing the reasons for the decline + providing decision-making suggestions" is a complex task (complexity 0.9). The task completion assessment results are generated by combining the two dimensions and presented as a quantitative score plus text description, such as "Completion 60%: Sales data for East China region has been obtained (completeness 50%), data and attribution analysis for North China have not been obtained, the query request is of medium to high complexity (0.7), and supplementary analysis is required". This result directly serves as the core basis for subsequent scheduling decisions.
[0054] Based on the task completion assessment results, determine whether and how to continue scheduling, and generate executable scheduling instructions. When deciding whether to continue scheduling, the task completion assessment results are used as the basis. If the completion rate reaches a preset threshold (e.g., the enterprise sets "simple tasks ≥ 80%, complex tasks ≥ 90%)", scheduling stops; if it does not reach the threshold (e.g., completion rate 60%), subsequent scheduling strategy formulation is initiated. An appropriate scheduling strategy is selected based on the type of incomplete requirement, covering three core scenarios. Specifically, cyclically calling the same Agent is suitable for supplementing the same type of information (e.g., missing data dimensions, detailed results), for example, only obtaining East China sales figures, requiring supplementation with North China data → calling the data query Agent again; parallel scheduling of multiple Agents is suitable for simultaneously verifying multiple independent analysis directions (e.g., multi-cause attribution), for example, suspecting a sales decline due to channel stockouts and competitor promotions → simultaneously calling two attribution analysis Agents for verification; serially calling different Agents is suitable for progressive analysis based on data → attribution → decision (complex tasks), for example, having obtained sales data → first calling the attribution analysis Agent to find the cause → then calling the intelligent decision agent to provide suggestions.
[0055] By combining scheduling strategies with historical execution results from the shared context, instructions are generated to ensure that they include the "target Agent, execution parameters, and associated historical information," avoiding missing or duplicate parameters. For example, when repeatedly calling data query Agents, the instruction will explicitly state "supplement North China region data, referring to the '2024Q2 time range and sales indicator definition' in historical execution results," ensuring that the new execution results are logically consistent and connectable with historical results.
[0056] Here, the Agent scheduling instructions can carry dynamic parameters, such as context parameters: historical query results, the types and execution order of executed Agents, and task status information: current task completion progress, a list of pending subtasks, and anomaly flags. Context parameters allow the Agent to understand historical data, such as carrying historical query results (e.g., previously queried "2024Q2 East China sales data"), and the types and order of executed Agents (e.g., calling the data query Agent first, then the attribution analysis Agent), preventing the Agent from starting from scratch. For example, when the intelligent decision-making Agent receives an instruction, it can directly use historically queried sales data and attribution results to generate suggestions without repeating the query, and it can also connect with previous analysis logic. Task status information allows the Agent to understand the current execution status, such as the current task completion progress (e.g., "60% complete, missing North China data"), a list of pending subtasks (e.g., "Need to supplement North China sales data query and generate national decision-making suggestions"), and anomaly flags (e.g., "Previous East China data query had some missing data"), allowing the Agent to understand its own task's position in the overall process. For example, when a data query agent receives an instruction, it can clearly know that it needs to query data from North China to advance the progress, and it can also pay attention to anomaly indicators to avoid repeating errors.
[0057] Using the above implementation method, after the sub-Agent executes the results, they are written to the shared storage in real time, supporting read-write separation. Each sub-Agent can only read the information, preventing unauthorized modification and ensuring information consistency; only the Brain Agent has write permissions, ensuring information accuracy. The evaluation threshold is not fixed but dynamically adjusted based on business scenarios and user needs. For example, financial statement queries have high requirements for completeness (threshold 0.95), while daily operational quick queries have high requirements for efficiency (threshold 0.7), balancing accuracy and user experience. If multiple strategies are applicable (such as needing both supplementary data and attribution), they can be executed according to the priority of first supplementing basic information and then deepening analysis (first calling the data query agent to supplement data, then calling the attribution analysis agent) to avoid logical confusion.
[0058] This implementation approach makes multi-agent collaboration more efficient and accurate. Shared context reduces redundant data queries and agent calls; for example, attribution analysis agents can directly reuse shared data without re-executing SQL, shortening the analysis cycle. Parallel scheduling strategies can handle multiple analysis directions simultaneously, further improving efficiency. Quantitative task completion assessment avoids over-scheduling (e.g., continuing calls even when completion targets have been met) or under-scheduling (e.g., blindly attributing without complete data). Strategies such as sequential and parallel scheduling can handle complex multi-step and multi-dimensional requirements.
[0059] S103: According to the Agent scheduling instruction, the scheduled sub-Agent performs the corresponding data query, root cause analysis or decision suggestion generation operation to obtain the sub-Agent execution result.
[0060] In this step, specific tasks are executed according to Agent type: After receiving the instruction, the data query Agent will complete the operation from parsing the requirements to retrieving the enterprise's data source and generating accurate data results; the attribution analysis Agent will break down the root causes of change based on existing data; and the intelligent decision-making Agent will combine data and root causes to generate actionable recommendations.
[0061] S104: Evaluate whether to continue scheduling the sub-Agent based on the execution result of the sub-Agent. If continued scheduling is required, call at least one of the data query agent, attribution analysis agent, or intelligent decision agent in a loop until the task termination condition is met and an intelligent analysis report is obtained.
[0062] In this step, the Brain Agent combines the results of sub-Agents (such as data and root causes) with shared context (historical conversations, business rules) to determine whether the current analysis meets the requirements. For example, if only a decline in sales is found without identifying the cause, or the root cause is not drilled down to a specific channel, it is determined that further scheduling is needed. If further scheduling is required, the scheduling method is selected according to the needs. If supplementary data is needed, the data query agent is called again; if the root cause is deepened, the attribution analysis agent is called again; or different agents are called in series (data query → cause identification → suggestion provision), or even multiple agents are called in parallel to speed up the analysis, gradually improving the analysis. The loop stops when the termination conditions are met (such as root causes being fully identified, suggestions covering the requirements, or the user saying "enough"). The Brain Agent integrates all results to generate an intelligent analysis report containing "data facts, root causes, and decision recommendations," forming a complete analysis loop.
[0063] In one implementation, when the scheduled sub-Agent includes a data query agent, the data query agent performs a data query operation, including: in response to an assigned query task, the data query agent (which can use a data query tool) performs semantic parsing on the query task to identify the query's metric entities, dimension entities, filtering conditions, and aggregation intents, and obtains a semantic parsing result; based on the metric entities in the semantic parsing result, it retrieves an SQL expression template corresponding to the metric entity from a predefined metric template library to obtain an SQL template; according to the SQL template and the dimension entities, filtering conditions, and aggregation intents in the semantic parsing result, it fills the dimension entities, filtering conditions, and aggregation intents into the SQL template (which can be done through a parameterized query building engine) to generate an executable SQL query statement; and it executes the SQL query statement on an internal enterprise data source to obtain a query result dataset.
[0064] Here, semantic parsing involves the data query agent first using data analysis tools to semantically break down the user's query task (e.g., "query sales revenue of offline channels in East China in Q3 2024"). The core of this process is identifying four key types of information: indicator entities (the core data the user wants to query, such as "sales revenue"), dimension entities (the data analysis perspective, such as "time dimension: Q3 2024", "region dimension: East China", "channel dimension: offline"), filtering conditions (constraints for filtering data, such as "only East China", "only offline channels"), and aggregation intent (the statistical method of the data, such as "summarize the overall sales revenue for Q3, rather than breaking it down by week / day")). This step transforms ambiguous natural language into a structured list of query elements, laying a precise foundation for subsequent SQL generation. In the template matching stage, an indicator template library is pre-established for all business indicators of the enterprise (such as sales revenue, profit margin, and inventory turnover rate), with each indicator bound to a precise SQL expression template. Based on the identified metric entities (such as "sales revenue"), the data query agent precisely matches the corresponding SQL template from the template library, ensuring that the SQL syntax and business logic conform to the enterprise database structure (such as multi-table joins and field naming rules) from the source. Then, through the parameterized query building engine, the parsed dimension entities, filter conditions, and aggregation intents are populated into the corresponding positions in the SQL template one by one, ultimately generating a complete SQL statement that can be directly executed in the enterprise database, ensuring the accuracy and compliance of the SQL. Finally, the generated SQL statement is executed in the enterprise's internal data source, directly reading real business data to obtain a structured query result dataset (such as "2024 Q3 East China offline channel sales revenue: 5 million yuan"). This result is automatically written to the system's shared context storage, which can be directly fed back to users and also provide data support for subsequent attribution analysis agents (such as analyzing why sales revenue is high / low) and intelligent decision-making agents (generating suggestions on "how to increase sales revenue").
[0065] In summary, by using "predefined templates + structured parsing", the pain points of traditional NL2SQL systems are completely solved, and it has the advantages of high accuracy (avoiding syntax errors and business logic deviations in SQL generated from large models), strong adaptability (the template library and parameter filling logic can fit the enterprise's exclusive data model), and high efficiency (no need to manually write SQL, realizing the automatic conversion of "natural language → data results").
[0066] In the above embodiments, the SQL expression templates in the predefined indicator template library can be dynamically bound to enterprise business indicators. In one embodiment, retrieving the SQL expression template corresponding to the indicator entity from the predefined indicator template library to obtain the SQL template may include: performing a semantic matching query in the indicator template library based on the indicator entity in the semantic parsing result to obtain a candidate SQL template list; calculating the semantic similarity between each candidate SQL template and the query task based on the candidate SQL template list and the context information in the semantic parsing result to obtain a semantic similarity score; and selecting the SQL template with the highest similarity score as the final matched SQL template based on the semantic similarity score to obtain the SQL template.
[0067] In the traditional fixed-binding model, one indicator entity corresponds to only one SQL template, which cannot adapt to the differentiated query needs of the same indicator in different business scenarios. This implementation first filters out a list of candidate SQL templates related to the indicator entity through semantic matching query (such as "regional summary template", "channel detail template", and "time trend template" associated with "sales amount"). Then, it further filters by combining contextual information (such as the "analysis by region" intent in the query), so that one indicator entity can be adapted to multiple scenario-based templates. This avoids query results that do not meet business expectations due to a single template, and greatly improves the template library's ability to cover diverse query needs. In addition, when the query task contains fuzzy intent or multi-dimensional constraints (such as "analyze the sales amount of new customers in East China this month", which requires matching the "sales amount" indicator, the "new customer" filter condition, the "East China" dimension, and the "this month" time constraint at the same time), it is difficult to locate the most suitable template by searching only through the indicator entity (such as possibly mismatching "old customer sales amount template" and "national sales amount template"). This implementation calculates the semantic similarity between candidate templates and query tasks, incorporating contextual information (new customers, East China region, this month) into the matching dimension. For example, the context of "new customer sales + East China region + this month" will generate a higher similarity score with SQL templates that include "new customer filtering conditions," "regional dimension," and "time filtering." This accurately selects templates that fit complex constraints, avoiding template mismatches caused by ignoring context, and ensuring that the generated SQL statement fully covers all business semantics of the query. Furthermore, the query logic for enterprise business metrics may be updated with business iterations (e.g., adding a calculation rule for "deducting return amount" to "sales amount," requiring the addition of corresponding SQL templates). If the traditional "one-to-one binding" mode is used, the association between metrics and templates needs to be manually adjusted, resulting in high maintenance costs and a high risk of omissions. In this implementation, adding a new template only requires entering the indicator entity association information. During retrieval, the system will automatically include it in the candidate list through semantic matching, without the need to manually modify the binding rules. At the same time, the similarity scoring mechanism can ensure that the new template is matched first in the corresponding scenario (such as the "sales amount after deducting returns" template, when the query includes the context of "net sales amount" and "deducting returns", the similarity score is higher than that of the old template). This not only reduces the maintenance workload of the template library, but also ensures that new business logic is quickly implemented through "high similarity priority matching", and ensures the consistency of business logic of query results at different times.
[0068] In one implementation, after obtaining the query result dataset, a process of secondary processing and refinement of the data can be carried out (such as through a data post-processing tool) to upgrade from basic data query to business data insight.
[0069] Specifically, the query result dataset can be loaded into an in-memory computing engine (which can be a data result post-processing tool) to obtain an in-memory dataset; based on the complex computational requirements of the in-memory dataset and the query task, secondary calculation operations that cannot be directly completed by SQL are executed in the in-memory computing engine. The secondary calculation operations include at least one of year-on-year and month-on-month calculations across time periods, composite operations of multiple indicators, or calculations based on custom business rules, to obtain secondary processed data results; the secondary processed data results are then converted into a standardized data format to obtain refined query results.
[0070] Here, importing query results into the in-memory computing engine avoids disk I / O bottlenecks, improves efficiency for complex calculations, and allows for the execution of operations that are difficult to achieve with SQL (such as year-on-year and month-on-month comparisons, multi-indicator composite calculations, and enterprise-defined rule calculations) in memory, meeting complex business needs. Furthermore, converting the processed data into a unified format facilitates user understanding and allows for seamless access by subsequent agents (attribution analysis, intelligent decision-making), ensuring smooth data flow throughout the entire process.
[0071] In one implementation, the data query agent performing the data query operation further includes: generating a unique query identifier based on the query task, the semantic parsing result, and the SQL query statement using a hash algorithm to obtain a query ID; retrieving whether there are historical query results matching the query ID in the cache storage of the cache reading tool according to the query ID, and obtaining a cache retrieval result; when the cache retrieval result indicates that there are matching historical query results, retrieving the historical query results from the cache storage based on the query ID and returning them as the current query result; when the cache retrieval result indicates that there are no matching historical query results, performing a query operation on the enterprise's internal data source based on the SQL query statement to obtain a new query result dataset, and then associating the new query result dataset with the query ID and storing it in the cache storage to obtain a cache-updated query result.
[0072] Here, query efficiency is optimized by using a unique identifier and cached retrieval reuse. This can reduce the load and latency caused by repeated database queries (improving user experience) and ensure the consistency of results for queries with the same semantics through unique ID binding, avoiding data deviation.
[0073] In one implementation, when the scheduled sub-Agent includes an attribution analysis agent, accurate time dimension comparison results can be provided for attribution analysis by parsing the time representation in the attribution task, verifying and standardizing time parameters, and then comparing the indicator data at corresponding time points. Specifically, the attribution analysis agent performing root cause analysis operations may include: responding to the assigned attribution analysis task, according to the data query results in the shared context memory, having a time comparison attribution tool parse the time representation in the attribution analysis task by calling a large language model to obtain time parameter parsing results, the time parameter parsing results including relative time or absolute time; based on the time parameter parsing results, validating the time parameter parsing results through a time parameter verification mechanism to obtain verified standardized time parameters, the standardized time parameters supporting at least one time granularity among day, month, quarter, and year; and extracting indicator data at corresponding time points and performing time dimension comparison calculations based on the standardized time parameters and the data query results to obtain time comparison analysis results.
[0074] This implementation method transforms ambiguous time representations into standardized parameters, which are then used to compare indicator data over time. Specifically, the attribution analysis agent invokes a time comparison attribution tool, using a large language model to parse the time representations in the task (e.g., "last year's same period last year," "this month vs. last month," "2024Q1"), distinguishing between relative time (e.g., "last 7 days") or absolute time (e.g., "May 2024") to clarify the required time range for analysis. Through a time parameter verification mechanism (e.g., verifying the validity of "February 30th" and whether "quarter" matches the company's statistical cycle), the parsed time parameters are converted into standardized time in a unified format (supporting granularity such as day / month / quarter / year, e.g., uniformly converted to "2024-05," "2024Q2"), avoiding comparison errors caused by inconsistent time formats. Based on standardized time parameters, the corresponding time point indicator data (such as "sales in May 2024" and "sales in April 2024") are extracted from the query results of the shared context. Then, time comparison calculations (such as difference and growth rate) are performed to finally obtain the time comparison analysis results (such as "sales in May 2024 increased by 12% compared to April"), which provides the core basis for subsequent root cause localization in terms of time dimension.
[0075] To accurately pinpoint the core reasons for significant changes in metrics over time (such as a sharp drop in sales or a surge in profit margin), the attribution analysis agent can delve into the root causes through a systematic "anomaly detection - dimensional breakdown - contribution quantification" process. In one implementation, when the scheduled sub-agent includes the attribution analysis agent, the attribution analysis agent performs root cause analysis, which may include: responding to the assigned attribution analysis task, automatically extracting metric data from two comparison time points based on the data query results in the shared context memory, obtaining a comparison time point dataset; calculating the magnitude of metric value change between the two time points using a difference calculation algorithm based on the comparison time point dataset, obtaining the metric anomaly detection result; and when the metric anomaly detection result meets the significant anomaly condition, initiating a multi-dimensional drill-down analysis process to calculate the comparison for each candidate dimension. The degree of distribution difference of the time point dataset between two time points is used to obtain the dimension importance ranking result; based on the dimension importance ranking result, the dimension with the highest importance is selected, and the absolute contribution and relative contribution of each value of the dimension with the overall indicator change are calculated to obtain the dimension contribution decomposition result; based on the dimension contribution decomposition result and the preset cumulative contribution ratio threshold, the key dimension values with the highest contribution are selected and the long-tail low contribution values are filtered out to obtain the key influencing factor list; the key influencing factor list, the dimension importance ranking result and the dimension contribution decomposition result are integrated to generate a structured attribution report to obtain the indicator anomaly attribution analysis result.
[0076] In practice, the first step is to extract comparative data. Specifically, the indicator anomaly attribution tool automatically extracts indicator data from two comparable time points (e.g., "May 2024 sales revenue" and "April 2024 sales revenue") from the query results of the shared context, forming a comparative time point dataset to lay the data foundation for subsequent anomaly analysis. Then, indicator anomalies are detected. Specifically, a difference calculation algorithm (e.g., calculating the difference or growth rate of indicators at two time points) is used to quantify the magnitude of indicator value changes (e.g., "May sales revenue decreased by 20% compared to April"), determining whether the "significant anomaly condition" is met (e.g., the change exceeds a preset threshold of 15%). Only when significant anomalies are confirmed is subsequent in-depth analysis initiated to avoid invalid calculations. Next, after initiating drill-down analysis, for all candidate dimensions (such as region, channel, and product category), calculate the difference in data distribution between two time points for each dimension (e.g., "sales share in East China decreased from 30% to 20%, while in North China it increased from 25% to 35%), and rank the dimensions according to the degree of difference (e.g., "regional dimension is the most important, channel dimension is the second most important") to identify the core dimensions with the greatest impact on the anomalies. Combining this with a preset cumulative contribution percentage threshold (e.g., 80%), filter out the key dimension values with the highest contribution from the dimension contribution results (e.g., "East China decreased by 8%, South China decreased by 5%, cumulatively contributing 65% of the total decrease"), and filter out long-tail values with minimal impact (e.g., a 0.5% decrease in Northwest China), forming a list of key influencing factors. Finally, the list of key influencing factors, the ranking of dimension importance, and the decomposition results of dimension contribution are integrated to generate a structured attribution report containing "abnormal situation - core dimension - key factor - degree of impact". This results in a clear root cause analysis of indicator abnormalities (e.g., "May sales decreased by 20%, mainly due to an 8% decrease in offline channel sales in East China and a 5% decrease in new product sales in South China that did not meet expectations"), providing a clear basis for subsequent decision-making.
[0077] Here, the step of calculating the degree of distribution difference between two time points for each candidate dimension to obtain the dimension importance ranking result includes: based on the comparison time point dataset, constructing the numerical distribution of each candidate dimension at the first and second time points respectively to obtain dual-time point distribution data; based on the dual-time point distribution data, using the Jensen-Shannon Divergence (JS) divergence algorithm to quantify the degree of distribution difference between the two time points for each candidate dimension to obtain the JS divergence value of each dimension; based on the JS divergence value of each dimension, sorting the candidate dimensions in descending order of JS divergence value to obtain the dimension importance ranking result, wherein the larger the JS divergence value, the stronger the explanatory power of the dimension for indicator anomalies.
[0078] By constructing numerical distributions at "first time point" and "second time point" for each candidate dimension (e.g., "East China's sales accounted for 30% in April and 20% in May"), the dual-time point distribution data for this dimension is formed. Then, the JS divergence algorithm is used to calculate the difference value (JS divergence value) of the dual-time point distribution for each dimension. The larger the value, the more significant the change in the dimension's distribution at the two time points (e.g., if the JS divergence value for the region dimension is higher than that for the channel dimension, it means that the change in regional distribution has a more critical impact on the indicator's fluctuations). Finally, the candidate dimensions are sorted from largest to smallest according to the JS divergence value to obtain the dimension importance ranking result, directly locking in the core dimension with the strongest explanatory power for indicator fluctuations.
[0079] To accurately analyze the root causes of differences in performance metrics among different business entities (such as different regions, channels, and products) at the same point in time (e.g., "Why is sales in Beijing lower than in Shanghai?" or "Offline channels are growing slower than online channels"), attribution analysis agents need to use code value comparison attribution tools to achieve horizontal comparative analysis of multi-dimensional values. The specific implementation method can be as follows:
[0080] In response to the assigned attribution analysis task, based on the data query results in the shared context memory, the code value comparison attribution tool parses the comparison intent in the assigned attribution analysis task, identifies comparison dimensions and filtering conditions, and obtains comparison dimension parsing results. Dimension names and specific code values are extracted from the comparison dimension parsing results and combined to generate comparison groups with business semantics, resulting in a comparison group list. Based on the comparison group list and other constraints in the attribution analysis task, filtering conditions for the SQL WHERE clause are dynamically concatenated for each comparison group, resulting in a comparison query statement with filtering conditions. Based on the comparison query statement with filtering conditions, multi-indicator parallel comparison calculations are performed on the data query results to calculate the absolute difference and relative rate of change between each comparison group, obtaining comparison calculation results. The comparison calculation results are organized using a Node tree data structure, where each node contains dimension labels, values, descriptions, and comparison items, resulting in a tree-structured code value comparison analysis result.
[0081] Here, the code value comparison attribution tool first analyzes the user's comparison needs from the attribution task (e.g., "compare offline sales in Beijing and Shanghai"), identifies the "comparison dimensions" (e.g., "region" and "channel") and "filtering conditions" (e.g., "time: May 2024"), clarifies the core objects and constraints of the comparison analysis, and avoids aimless and blind comparisons. It extracts dimension names (e.g., "region") and specific code values (e.g., "Beijing" and "Shanghai") from the analysis results, combining them into comparison groups that fit the business scenario (e.g., "Region-Beijing vs. Region-Shanghai", "Region-Beijing + Channel-Offline vs. Region-Shanghai + Channel-Offline"), forming a comparison group list to ensure that the comparison objects have actual business significance (rather than unrelated random combinations). Combining the comparison group list with other constraints in the task (e.g., "only new customer orders are counted"), it automatically concatenates the SQL WHERE clause filtering conditions for each comparison group (e.g., "WHERE Region='Beijing' AND Channel='Offline' AND User Type='New Customer'"), generating comparison query statements that can accurately filter the corresponding data, ensuring the accuracy of each set of comparison data. Based on the generated query, the indicator data of each comparison group is calculated in parallel within the query results of the shared context (e.g., calculating offline new customer sales in Beijing and Shanghai simultaneously). The degree of difference is quantified by "absolute difference" (e.g., Beijing is 1 million yuan less than Shanghai) and "relative change rate" (e.g., Beijing is 20% lower than Shanghai), resulting in intuitive comparison calculation results. Finally, the comparison results are organized using a Node tree data structure (e.g., the root node is "Regional Comparison", the child nodes are "Beijing" and "Shanghai", and each child node contains dimension labels such as "Channel-Offline" and "User Type-New Customer", specific values, and comparison items), forming a hierarchical structured result. This allows users to quickly locate the core differences (e.g., "The low offline new customer sales in Beijing are mainly due to insufficient sales of a certain product category"), providing a horizontal comparison basis for root cause analysis.
[0082] In practical implementation, to provide users with key support for predicting future trends based on historical data during the decision-making stage (such as predicting next month's sales and quarterly profit margin trends), the intelligent decision-making agent can complete the entire process from demand judgment to structured prediction result output through time series forecasting tools.
[0083] In one implementation, when the scheduled sub-Agent includes an intelligent decision agent, the intelligent decision agent performs a decision suggestion generation operation, including: responding to an assigned decision task, determining, based on the data query results and attribution analysis results in the shared context memory, whether the assigned decision task requires trend prediction by a time series forecasting tool, and obtaining a prediction demand judgment result; when the prediction demand judgment result indicates that prediction is required, automatically identifying the time dimension column and indicator column in the historical data based on the historical data in the data query results, and performing a data validity check to obtain valid time series data; automatically selecting a time series model in the time series modeling engine and training the model based on the valid time series data and the time granularity parameters extracted from the query metadata, to obtain a trained prediction model; and performing time series prediction calculation based on the trained prediction model and the prediction time range specified by the user, and automatically adding confidence intervals to the prediction results to obtain a structured prediction result containing prediction time points, prediction values, and confidence intervals.
[0084] Here, the intelligent decision-making agent first combines the query results (such as historical sales data) and attribution analysis results (such as the root causes of sales fluctuations) within a shared context. The time series forecasting tool then determines whether the current decision task requires trend forecasting (e.g., "formulating next month's inventory plan" requires sales forecasting, while "analyzing the reasons for last month's profit decline" does not). Subsequent processes are only initiated when forecasting is confirmed, reducing resource waste. If forecasting is required, key columns are automatically identified from historical data: first, "time dimension columns" (such as "date" and "month") to determine the time axis of the time series; second, "indicator columns" (such as "sales" and "order volume") to identify the core indicators to be forecasted. Simultaneously, data validity checks are performed (e.g., removing data with missing time periods and outliers), ultimately obtaining "valid time series data" with standardized format and reliable data, avoiding the impact of poor-quality data on forecast accuracy. Then, time granularity parameters are extracted from the query metadata (e.g., historical data is statistically analyzed by "day," so the forecast granularity is also "day"), and the time series modeling engine automatically matches and adapts the model (e.g., selecting the ARIMA model for linear trends and the Prophet model for seasonal fluctuations), without requiring manual specification of model type and parameters. Subsequently, model training is completed based on valid time-series data, generating a "trained prediction model" that accurately fits historical trends. Finally, combining the trained model with the user-specified prediction time range (e.g., "predicting the next 30 days"), prediction calculations are performed to obtain predicted values for each time point (e.g., "predicted sales of 100,000 yuan on May 1st"). Simultaneously, confidence intervals are automatically added to the predicted values (e.g., "95% confidence interval: 90,000-110,000 yuan") to quantify the uncertainty of the prediction results. The final output is a structured result containing "predicted time point, predicted value, and confidence interval," clearly presenting future trends and providing risk references for decision-making (e.g., inventory levels can be planned according to the upper limit of the confidence interval to cope with fluctuations).
[0085] In practice, in order to match users with decision-making solutions that fit the current scenario (such as "how to increase declining sales" or "how to optimize inefficient channels") based on data facts (such as indicator results) and root cause analysis (such as reasons for anomalies), the intelligent decision agent can complete the transformation from demand mapping to specific action suggestions through strategy knowledge base recall tools. In one implementation, when the scheduled sub-Agent includes an intelligent decision-making agent, the intelligent decision-making agent performs a decision suggestion generation operation, which may include: responding to the assigned decision task, converting the decision task, the data query results, and the attribution analysis results in the shared context memory into a query vector using a strategy knowledge base retrieval tool, to obtain a decision query vector; performing semantic similarity retrieval in the vector database of the strategy knowledge base based on the decision query vector, to obtain a list of semantically matched candidate strategies; performing secondary filtering and sorting of the candidate strategy list based on the candidate strategy list and keywords in the decision task, combined with a keyword matching mechanism, to obtain a sorted strategy list; calculating the fit between each strategy and the current analysis scenario based on the sorted strategy list and the dialogue history and analysis results in the shared context memory, to obtain the optimal matching strategy; and converting the optimal matching strategy into a specific action suggestion for the current business scenario, to obtain a decision suggestion report.
[0086] Here, we first combine the data results from the shared context (e.g., "sales in East China decreased by 15%) with the attribution conclusions (e.g., "due to reduced foot traffic in offline stores") to transform the decision task (e.g., "how to increase sales in East China") into a computer-recognizable decision query vector. This avoids strategy matching biases caused by differences in natural language expression (e.g., "boost sales" and "increase revenue"), ensuring a semantically accurate match between the requirements and the strategies in the knowledge base. Based on the decision query vector, we retrieve semantically similar strategies from the vector database of the strategy knowledge base (e.g., vector matching to historically effective strategies such as "offline store traffic generation activities" and "regional promotion plans") to form a candidate strategy list. We initially filter out solutions that align with the current requirements and exclude irrelevant strategies (e.g., "online advertising"). Combining the core keywords in the decision task (e.g., "East China" and "offline"), we perform a second filtering and sorting of the candidate strategy list. For example, we prioritize retaining strategies containing keywords such as "regional targeting" and "offline stores," while eliminating strategies that are only applicable to "nationwide" and "online," making the candidate list more closely aligned with the specific constraints of the current business scenario. By referencing the shared context's "dialogue history" (e.g., users previously rejected "large-scale price reductions") and "analysis results" (e.g., higher average order value in East China's offline market), the scenario fit of each candidate strategy is calculated (e.g., "offline store discount activities" have a higher fit than "offline discount promotions"). The optimal matching strategy is then selected, ensuring that it aligns with historical interaction intent and current data conclusions. Finally, the optimal strategy (e.g., "offline store discount activities in East China") is transformed into a concrete action plan (e.g., "conduct a 'spend 500, get 100 off' promotion in 30 core offline stores in East China for two weeks, simultaneously with live-streaming to drive traffic to the stores"), generating a structured decision-making suggestion report that allows users to implement directly without further analysis.
[0087] Here, the strategy knowledge base is organized in a hierarchical architecture, including a general strategy layer, an industry strategy layer, and an enterprise strategy layer. The step of performing semantic similarity retrieval in the vector database of the strategy knowledge base to obtain a list of semantically matched candidate strategies includes: based on the decision query vector, first performing semantic similarity retrieval in the vector database of the enterprise strategy layer to obtain enterprise-level candidate strategies; when the number of enterprise-level candidate strategies is less than a preset threshold, performing semantic similarity retrieval in the vector databases of the industry strategy layer and the general strategy layer sequentially, according to the decision query vector, to obtain supplementary candidate strategies; and comprehensively scoring the enterprise-level candidate strategies and the supplementary candidate strategies according to strategy level weight and timeliness weight to obtain the candidate strategy list.
[0088] This approach first retrieves strategies from the enterprise's own accumulated strategy layer, prioritizing the matching of the most suitable customized solutions. If there are not enough enterprise-level strategies, they are then supplemented from the industry layer and general layer in turn to avoid insufficient strategy quantity. Finally, all strategies are scored by combining "layer weight" (enterprise layer > industry layer > general layer) and "timeliness weight" (new strategy > old strategy) to form an ordered candidate list.
[0089] S105: Display the intelligent analysis report.
[0090] In practical implementation, the intelligent analysis report supports integrated content presentation. The report is not merely a collection of fragmented results, but rather contains a complete logical chain. For example, "2024Q2 East China sales declined by 15% (data) → due to stockouts in offline channels (root cause) → recommendation to replenish inventory (decision)," allowing users to clearly understand "what, why, and how." Furthermore, it supports structured displays (tables showing detailed data) and visual presentations (line charts showing trends, pie charts showing root cause percentages), avoiding the dryness of pure text or data, making it quickly understandable even for non-technical users. In addition, the report can link key analytical evidence (such as data sources and attribution algorithm logic). If a user has doubts about a conclusion, they can reverse-engineer the execution process of the corresponding sub-agent (such as the SQL logic of data queries) to ensure the credibility of the analysis results.
[0091] From a user perspective, the solution provided by this disclosure allows enterprise users to quickly get started by simply inputting query requests in natural language. No expertise in SQL, programming, or professional analysis tools is required. This resolves the contradiction between those with technical skills who don't utilize enterprise data resources and those who don't understand technology when using data. This disclosure also helps enterprise users automate the entire process from data querying to attribution and decision-making, eliminating the need for manual data processing, root cause derivation, and recommendation formulation. This significantly shortens the analysis cycle and reduces enterprise labor costs. The final intelligent analysis report integrates the cyclical execution results of multiple agents, allowing users to directly obtain clear conclusions without secondary processing, thus improving data application efficiency.
[0092] In other embodiments, to ensure that the embodiments of this disclosure are deeply adapted to the personalized business needs of enterprises, flexibly expand tool support capabilities, and accurately respond to customized indicator calculation needs, and to avoid problems such as poor scenario adaptability, limited tool access, and insufficient indicator calculation in actual enterprise applications, the embodiments of this disclosure also strengthen capabilities from three key dimensions: "scenario-based semantic configuration, dedicated tool integration, and custom indicator management." These customized configuration capabilities are described below.
[0093] First, customized semantic layer configuration: Business scenario definition data configured by the enterprise is obtained. Based on this data, specific indicator sets, dimension sets, and time granularities are configured for each business scenario to obtain scenario-based semantic configuration. Based on the indicators in the scenario-based semantic configuration, multiple synonym expressions are configured for each indicator through a synonym management module to obtain an indicator synonym library. Based on the dimensions in the scenario-based semantic configuration, a complete value range list and description are configured for each dimension, and synonyms are configured for the dimensions and their code values through a synonym management module to obtain a dimension synonym library. Based on enterprise business terminology data, a business terminology knowledge base is constructed, and vector and keyword indexes are established to obtain a retrievable business terminology knowledge base. This retrievable business terminology knowledge base is used to perform hybrid index retrieval when a user's query request is received, converting business terms into standardized expressions to obtain a standardized query request.
[0094] Here, we first obtain the enterprise's business scenario definition (such as "monthly sales review" and "new product promotion analysis"), and bind a unique set of indicators (such as "sales revenue and average order value" for the sales scenario), a set of dimensions (such as "region and channel"), and a time granularity (such as monthly) to each scenario, forming a scenario-based semantic configuration to ensure that the analysis dimensions fit the scenario requirements. Based on the scenario indicators, we configure multiple synonyms for each indicator through synonym management (such as "sales revenue" corresponding to "revenue" and "turnover"), building an indicator synonym library to solve the problem of user expression differences. We configure value domains (such as "region" dimension including "East China" and "North China") and descriptions for scenario dimensions, and at the same time, we assign synonyms to dimensions and code values (such as "offline channels" corresponding to "stores" and "physical stores") to form a dimension synonym library, improving the accuracy of dimension parsing. We integrate enterprise terminology data to establish a recallable knowledge base with vector + keyword dual indexes; when users query, the dual indexes recall and match terms, converting non-standardized expressions (such as "how much money was sold") into standardized requests (such as "query sales revenue"), ensuring the accuracy of subsequent analysis.
[0095] Optionally, the step of using the recallable business terminology knowledge base for hybrid index recall to convert business terms into standardized expressions and obtain standardized queries includes: based on the user query, converting the user query into a query vector using a vector encoding module to obtain a user query vector; based on the user query vector, performing semantic similarity retrieval in the vector index of the recallable business terminology knowledge base to obtain a semantically recalled terminology candidate set; based on the keywords in the user query, performing exact matching and fuzzy matching in the keyword index of the recallable business terminology knowledge base to obtain a keyword-recalled terminology candidate set; merging the semantically recalled terminology candidate set and the keyword-recalled terminology candidate set, and comprehensively scoring them according to the recall method weight and terminology frequency to obtain a merged terminology candidate set; based on the merged terminology candidate set, selecting the top N terms from high to low scores as the final recalled terms, and mapping the final recalled terms to standardized indicator names or dimension names according to the indicator thesaurus and the dimension thesaurus to obtain the standardized query request.
[0096] Here, the user query is converted into a vector, and semantically similar terms are found in the terminology vector index to form a semantic candidate set (to solve the problem of non-standard expression); user query keywords are extracted, and precise and fuzzy matching is performed in the keyword index to form a keyword candidate set (to ensure that core terms are not missed); the two types of candidate sets are merged, and scored according to "recall method weight (such as higher semantic weight) + term frequency" to select the top N optimal terms; combined with the thesaurus of indicators / dimensions, the optimal terms are converted into standardized indicator / dimension names to obtain a standardized query request.
[0097] Second, customized configuration at the tool layer: Obtain the enterprise's customized tools and their interface definitions, verify whether the tools conform to the unified interface specification, and obtain the interface verification result; when the interface verification result is successful, register the tools to the corresponding Agent's tool library through declarative configuration based on the tool's functional description and calling parameters, resulting in an updated Agent tool library; according to the updated Agent tool library, identify and schedule the tools when calling sub-Agents, obtaining the tool execution result; write the tool execution result into the shared context storage for use in subsequent analysis processes.
[0098] First, we acquire the enterprise's self-developed custom tools (such as internal customer profiling analysis tools and supply chain early warning tools) and their interface definitions (such as call addresses, parameter formats, and return data structures). Through the system's built-in interface verification mechanism, we verify whether the tools conform to the system's unified interface specifications (such as parameter naming rules and data transmission protocols). This step is fundamental, ensuring that the integrated custom tools can communicate normally with the system and each Agent, avoiding call failures due to interface incompatibility. If the interface verification passes, no complex coding development is required. Based on the core information of the custom tool (such as the function description of "customer profiling analysis," call parameters such as "customer ID" and "analysis dimensions"), we register the tool in the corresponding sub-Agent's tool library using a declarative configuration method (such as filling out a configuration form or uploading a configuration file). This approach lowers the technical barrier to tool integration, allowing enterprises to quickly complete the system integration of their custom tools, forming an updated Agent tool library. When scheduling a sub-Agent to execute a task (such as the attribution analysis Agent needing to analyze "customer churn reasons"), the system can automatically search the corresponding Agent tool library to identify whether a suitable custom tool (such as the customer profiling analysis tool) exists. If available, the tool can be directly invoked with the required parameters to execute specific business logic (such as analyzing the profile characteristics of churned customers) and obtain the tool's execution results (e.g., "60% of churned customers are under 30 years old"). The execution results of the dedicated tool can be written to a shared context storage in real time, becoming a public data asset for end-to-end analysis. Subsequent agents or processes (such as intelligent decision-making agents formulating "customer retention strategies") can directly read these results without repeatedly invoking the tool, thus improving analysis efficiency, ensuring data consistency, and maximizing the value of the dedicated tool.
[0099] Third, customized configuration at the logic layer: This involves acquiring custom indicator definition data configured by the enterprise, including indicator names, indicator expressions, and the underlying indicators upon which calculations depend, thus obtaining a custom indicator configuration. Based on the indicator expressions in the custom indicator configuration, an expression parsing engine performs syntax validation and dependency analysis on the indicator expressions, identifying the underlying indicators and operators referenced in the indicator expressions, and obtaining the expression parsing result. According to the expression parsing result, an indicator calculation dependency graph is constructed, identifying the underlying indicators and their calculation order that each custom indicator depends on, thus obtaining an indicator dependency graph. Based on the indicator dependency graph, the custom indicator configuration is registered in the system's indicator template library, and the custom indicator is then configured... The system configures the corresponding SQL expression template or calculation logic template for the custom indicator to obtain an updated indicator template library. When a query request involving the custom indicator is received, the data query agent identifies the basic indicator to be queried based on the query request and the indicator dependency graph, obtaining a basic indicator query list. According to the basic indicator query list, the system performs data query operations on the basic indicators to obtain a basic indicator dataset. Based on the basic indicator dataset and the indicator expression in the custom indicator configuration, the calculation engine executes the calculation logic defined by the indicator expression to obtain the custom indicator calculation result. The custom indicator calculation result is returned as the query result to the shared context storage for use in subsequent analysis processes.
[0100] Here, we first obtain the custom indicator definition data configured by the enterprise. This core includes three key types of information: first, the indicator name (e.g., "new customer repurchase rate" or "store sales per square meter"), clearly identifying the indicator; second, the indicator expression (e.g., "new customer repurchase rate = number of new customers making repeat purchases within 30 days / total number of new customers"), defining the calculation logic; and third, the underlying indicators (e.g., "number of new customers making repeat purchases within 30 days" or "total number of new customers"), clearly identifying the source of the raw data required for the calculation. Through this information, a complete custom indicator configuration is formed, laying the foundation for subsequent calculations. Based on the expression of the custom metric, the built-in expression parsing engine performs two key operations: first, syntax validation, checking whether the expression conforms to the calculation rules (e.g., avoiding issues like "division by zero" and "operator errors," ensuring the "new customer repurchase rate" expression has no syntax flaws); second, dependency analysis, automatically identifying all basic metrics referenced in the expression (e.g., identifying the dependencies "store sales" and "store area" from "store sales per square meter = store sales / store area") and operators (e.g., division " / "), ultimately outputting an accurate expression parsing result to avoid subsequent calculation failures due to expression errors. Based on the expression parsing result, a "metric calculation dependency graph" is constructed: with the custom metric as the target node and its dependent basic metrics as upstream nodes, clearly identifying the relationship and calculation order between each custom metric and the basic metrics (e.g., to calculate "new customer repurchase rate," "30%" must be calculated first). The system uses two fundamental metrics: "Number of new customers making repeat purchases within one day" and "Total number of new customers." This dependency graph ensures that data is retrieved in the correct order during subsequent calculations, avoiding logical errors such as "calculating custom metrics before retrieving fundamental metrics." Based on the metric dependency graph, the custom metric configuration is formally registered in the metric template library, and corresponding SQL expression templates (such as converting the "new customer repeat purchase rate" expression into an executable SQL query template) or calculation logic templates (such as code calculation logic in non-SQL scenarios) are generated for it. After registration, the updated metric template library can store the custom metric permanently, supporting repeated calls without repeated configuration. When a user initiates a query request involving this custom metric (such as "query the sales per square meter of each store in May 2024"), the calculation is performed according to the following steps:
[0101] The data query agent, combining query requests and indicator dependency graphs, automatically identifies the basic indicators that need to be queried first (such as "sales revenue of each store in May 2024" and "area of each store"), and generates a list of basic indicator queries. It then executes the basic indicator queries, retrieving the corresponding basic indicator datasets from the data source. The calculation engine calls expression templates from the indicator template library, performing calculations based on the basic indicator datasets (such as dividing "store sales revenue" by "store area") to obtain the custom indicator calculation results (such as "store A's sales per square meter is 5000 yuan / ㎡, store B's sales per square meter is 4200 yuan / ㎡"). Finally, the custom indicator calculation results are written to a shared context storage, becoming a public data asset. Subsequent attribution analysis, intelligent decision-making processes (such as analyzing "root causes of differences in store sales per square meter" and "developing strategies to improve sales per square meter") can directly read these results without recalculation, improving analysis efficiency and ensuring data consistency throughout the entire process.
[0102] like Figure 2 The diagram illustrates the entire task execution process in the intelligent analysis system of this disclosure, characterized by "Brain Agent leadership and sub-Agent collaboration." First, when a user submits a business query (such as "analyze the reasons for last month's sales decline"), the request is first transmitted to the system's core scheduling module, Brain Agent. The Brain Agent handles user requests by parsing user intent and filling in missing information (e.g., asking if the user meant May when they said "last month") through three logics: looping calls, proactive interaction, and multi-turn conversations. After user confirmation, an Agent Plan (sub-Agent scheduling plan) is generated, specifying which sub-Agents (data query, attribution analysis, and intelligent decision-making) need to be invoked. Then, according to the scheduling strategy, the three types of sub-Agents are scheduled, each bound to a dedicated tool library. The data query agent performs data queries and secondary calculations using storage tools and data processing tools; the attribution analysis agent performs root cause analysis using time comparison, code value comparison, and indicator change tools; and the intelligent decision-making agent generates decision suggestions using search, prediction, and business knowledge tools. Each sub-Agent generates a Tool Plan based on the task, which, after user confirmation, invokes the tool to obtain the tool execution result. The result is then sent back to the Brain Agent, which integrates and outputs the final response, completing the entire process. Throughout the process, user requests, Agent scheduling plans, and tool execution results are all stored in the shared context module. In this process, we ensure data exchange and workflow integration among all modules.
[0103] like Figure 3As shown, this disclosure also provides a query request response device 300, which can be deployed on computer devices such as servers, server clusters, or terminals, and is used for query responses to data resources within an enterprise, including:
[0104] The intent parsing module 31 is used to obtain the query request input by the user, perform intent understanding and context parsing on the query request, and generate an intent parsing result containing query semantics, task type and preliminary subtask decomposition results;
[0105] The scheduling instruction generation module 32 is used to generate agent scheduling instructions based on the intent parsing result; the agent scheduling instructions are used to invoke at least one sub-Agent among the data query agent, attribution analysis agent, or intelligent decision agent;
[0106] The task execution module 33 is used to execute corresponding data query, root cause analysis, or decision suggestion generation operations by the scheduled sub-Agent according to the Agent scheduling instruction, and obtain the sub-Agent execution result; evaluate whether to continue scheduling the sub-Agent based on the sub-Agent execution result; when it is necessary to continue scheduling, call at least one Agent among the data query Agent, attribution analysis Agent, or intelligent decision agent in a loop until the task termination condition is met, and obtain an intelligent analysis report;
[0107] Display module 34 is used to display the intelligent analysis report.
[0108] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0109] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0110] Based on the same technical concept, this disclosure also provides a computer device 400, which can be a server, specifically such as a sports management platform server, or a terminal device, see reference. Figure 4 The diagram shown is a schematic representation of the structure of a computer device according to an exemplary embodiment of this disclosure, comprising:
[0111] The processor 410, memory 420, and bus 430 are included. The memory 420 is used to store execution instructions and includes main memory 421 and external memory 422. The main memory 421, also known as internal memory, is used to temporarily store the operation data in the processor 410 and the data exchanged with external memory 422 such as hard disk. The processor 410 exchanges data with external memory 422 through main memory 421.
[0112] In this embodiment, the memory 420 is specifically used to store application code that executes the scheme of this disclosure, and its execution is controlled by the processor 410. That is, when the electronic device 400 is running, the processor 410 communicates with the memory 420 through the bus 430, or the processor 410 communicates with the memory 420 through other means, so that the processor 410 executes the application code stored in the memory 420, and then executes the steps of the query request response method described in any of the foregoing embodiments.
[0113] The memory 420 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0114] Processor 410 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor.
[0115] It is understood that the structures illustrated in the embodiments of this disclosure do not constitute a specific limitation on the electronic device 400. In other embodiments of this disclosure, the electronic device 400 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0116] This disclosure also provides a computer-readable storage medium including instructions stored thereon, wherein, when executed by a processor, the instructions perform the query request response method as described in any of the preceding claims. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0117] This disclosure also provides a computer program product, on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the query request response method provided in any of the above embodiments of this disclosure. For details, please refer to the above method embodiments, which will not be repeated here.
[0118] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium, which can be a volatile or non-volatile computer-readable storage medium. In another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0119] Furthermore, embodiments of the subject matter and functional operation described in this specification can be implemented in the following ways: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or combinations thereof. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by a data processing apparatus or for controlling the operation of a data processing apparatus. Alternatively or additionally, program instructions may be encoded on artificially generated propagation signals, such as machine-generated electrical, optical, or electromagnetic signals, which are generated to encode information and transmit it to a suitable receiving device for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or combinations thereof.
[0120] The processing and logic flows described in this specification can be executed by one or more programmable computers that execute one or more computer programs to perform corresponding functions by operating on input data and generating output. The processing and logic flows can also be executed by dedicated logic circuits—such as field-programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs), and the device can also be implemented as dedicated logic circuits.
[0121] Suitable computers for executing computer programs include, for example, general-purpose and / or special-purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit receives instructions and data from read-only memory and / or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more mass storage devices for storing data, such as disks, magneto-optical disks, or optical disks, or the computer will be operatively coupled to such mass storage devices to receive data from or transfer data to them, or both. However, a computer is not required to have such devices. Furthermore, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device such as a Universal Serial Bus (USB) flash drive, to name a few.
[0122] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, such as semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. Processors and memory may be supplemented by or incorporated into dedicated logic circuitry.
[0123] While this specification contains numerous specific implementation details, these should not be construed as limiting the scope of any invention or the scope of the claims, but rather are primarily intended to describe features of specific embodiments of a particular invention. Certain features described in the various embodiments herein may also be implemented in combination in a single embodiment. Conversely, various features described in a single embodiment may also be implemented separately in various embodiments or in any suitable sub-combination. Furthermore, while features may function in certain combinations as described above and even initially claimed in this way, one or more features from a claimed combination may be removed from that combination in some cases, and a claimed combination may refer to a sub-combination or a variation thereof.
[0124] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order shown or sequentially, or requiring all illustrated operations to be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be construed as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
[0125] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings are not necessarily shown in a specific order or sequence to achieve the desired result. In some implementations, multitasking and parallel processing may be advantageous.
[0126] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A query request response method, characterized in that, Applied to query responses targeting enterprise data resources, including: Obtain the query request input by the user, perform intent understanding and context parsing on the query request, and generate an intent parsing result that includes query semantics, task type and preliminary subtask decomposition results; Based on the intent parsing result, an agent scheduling instruction is generated; the agent scheduling instruction is used to invoke at least one sub-agent among the data query agent, attribution analysis agent, or intelligent decision agent; According to the Agent scheduling instructions, the scheduled sub-Agent performs corresponding data query, root cause analysis, or decision suggestion generation operations to obtain the sub-Agent execution results; Write the execution result of the sub-Agent, along with the confidence score and dialogue history associated with the execution result of the sub-Agent, into the shared context memory; The execution results of the sub-Agent, the confidence score, and the dialogue history are read from the shared context storage. The completeness of the execution results of the sub-Agent and the complexity of the query request are analyzed to generate a task completion evaluation result. Based on the execution result of the sub-Agent, it is evaluated whether the sub-Agent needs to be continued to be scheduled. If the sub-Agent needs to be continued to be scheduled, at least one of the data query agent, attribution analysis agent, or intelligent decision agent is called in a loop until the task termination condition is met and an intelligent analysis report is obtained. Display the aforementioned intelligent analysis report; The step of evaluating whether to continue scheduling the sub-Agent based on the execution result of the sub-Agent includes: Based on the task completion evaluation result, it is determined whether it is necessary to continue scheduling the sub-Agent. When the task completion evaluation result indicates that it is necessary to continue scheduling, the next scheduling strategy is determined. The scheduling strategy includes at least one of the following: cyclically calling the same Agent, scheduling multiple Agents in parallel, or serially calling different Agents, to obtain a scheduling strategy scheme. Based on the scheduling strategy and the historical execution results in the shared context memory, a new Agent scheduling instruction is generated; Wherein, when the scheduled sub-Agent includes an intelligent decision-making agent, the intelligent decision-making agent performs a decision suggestion generation operation, including: In response to the assigned decision task, the decision task, the data query results, and the attribution analysis results in the shared context memory are converted into a query vector by the strategy knowledge base retrieval tool to obtain the decision query vector. Based on the decision query vector, semantic similarity retrieval is performed in the vector database of the strategy knowledge base to obtain a list of candidate strategies with semantic matching. Based on the candidate strategy list and the keywords in the decision task, the candidate strategy list is further filtered and sorted using a keyword matching mechanism to obtain a sorted strategy list. Based on the sorted strategy list and the dialogue history and analysis results in the shared context memory, the fit between each strategy and the current analysis scenario is calculated to obtain the optimal matching strategy. The optimal matching strategy is then converted into specific action recommendations for the current business scenario, resulting in a decision recommendation report.
2. The method according to claim 1, characterized in that, After generating the intent parsing result, the process also includes: The intent parsing results are then subjected to intent confidence assessment and query entity confidence assessment. When the confidence score of either the intent confidence assessment or the query entity confidence assessment is lower than the corresponding threshold, a structured follow-up question is generated and sent to the user to obtain the missing information to be filled in. The step of generating Agent scheduling instructions based on the intent parsing result includes: Based on the intent parsing result and the missing information provided, an Agent scheduling instruction is generated.
3. The method according to claim 1, characterized in that, When the scheduled sub-Agent includes a data query agent, the data query agent performs a data query operation, including: In response to the assigned query task, the data query agent performs semantic parsing on the query task, identifies the query's indicator entities, dimension entities, filtering conditions, and aggregation intent, and obtains the semantic parsing results; Based on the indicator entities in the semantic parsing results, the SQL expression template corresponding to the indicator entities is retrieved from the predefined indicator template library to obtain the SQL template. Based on the SQL template and the dimension entities, filtering conditions, and aggregation intents in the semantic parsing results, the dimension entities, filtering conditions, and aggregation intents are filled into the SQL template to generate an executable SQL query statement; The SQL query statement is executed on the enterprise's internal data source to obtain the query result dataset.
4. The method according to claim 3, characterized in that, After obtaining the query result dataset, it also includes: The query result dataset is loaded into the in-memory computing engine to obtain an in-memory dataset; Based on the complex computational requirements of the memory dataset and the query task, secondary computational operations that cannot be directly completed by SQL are executed in the memory computing engine. The secondary computational operations include at least one of year-on-year and month-on-month calculations across time periods, composite operations of multiple indicators, or calculations based on custom business rules, to obtain data results after secondary processing. The data results after secondary processing are converted into a standardized data format to obtain refined query results.
5. The method according to claim 3, characterized in that, The data query agent performs data query operations, including: Based on the query task, the semantic parsing result, and the SQL query statement, a unique query identifier is generated using a hash algorithm to obtain the query ID; Based on the query ID, the cache read tool retrieves whether there are any historical query results that match the query ID in its cache storage, and obtains the cache retrieval results. When the cache retrieval result indicates that a matching historical query result exists, the historical query result is read from the cache storage based on the query ID and returned as the result of the current query. When the cache retrieval result indicates that there are no matching historical query results, a query operation is performed on the internal data source of the enterprise based on the SQL query statement to obtain a new query result dataset. The new query result dataset is then associated with the query ID and stored in the cache storage to obtain the cache-updated query result.
6. The method according to claim 1, characterized in that, When the scheduled sub-Agent includes an attribution analysis agent, the attribution analysis agent performs root cause analysis operations, including: In response to the assigned attribution analysis task, based on the data query results in the shared context storage, the time comparison attribution tool parses the time expression in the attribution analysis task by calling the large language model to obtain the time parameter parsing results, which include relative time or absolute time. Based on the time parameter parsing results, the validity of the time parameter parsing results is verified through a time parameter verification mechanism to obtain the verified standardized time parameters. The standardized time parameters support at least one time granularity among day, month, quarter, and year. Based on the standardized time parameters and the data query results, the indicator data at the corresponding time points are extracted and compared and calculated along the time dimension to obtain the time comparison analysis results.
7. The method according to claim 1, characterized in that, When the scheduled sub-Agent includes an attribution analysis agent, the attribution analysis agent performs root cause analysis operations, including: In response to the assigned attribution analysis task, the indicator data at two comparison time points are automatically extracted by the indicator anomaly attribution tool based on the data query results in the shared context memory, resulting in a comparison time point dataset; Based on the comparison time point dataset, the difference calculation algorithm is used to calculate the magnitude of the index value change between the two time points to obtain the index anomaly detection result. When the anomaly detection result of the indicator meets the significant anomaly condition, the multi-dimensional drill-down analysis process is started. For each candidate dimension, the degree of distribution difference of the comparison time point dataset between the two time points is calculated to obtain the dimension importance ranking result. Based on the dimensional importance ranking results, the dimension with the highest importance is selected, and for each value of the dimension with the highest importance, its absolute contribution and relative contribution to the change of the overall index are calculated to obtain the dimensional contribution decomposition results. Based on the dimensional contribution decomposition results and the preset cumulative contribution ratio threshold, the key dimensional values with the highest contribution are selected and the long-tail low contribution values are filtered out to obtain a list of key influencing factors. The key influencing factors list, the dimension importance ranking results, and the dimension contribution decomposition results are integrated to generate a structured attribution report, thus obtaining the attribution analysis results of indicator anomalies.
8. The method according to claim 1, characterized in that, When the scheduled sub-Agent includes an attribution analysis agent, the attribution analysis agent performs root cause analysis operations, including: In response to the assigned attribution analysis task, the code value comparison attribution tool parses the comparison intent in the assigned attribution analysis task based on the data query results in the shared context memory, identifies the comparison dimensions and filtering conditions, and obtains the comparison dimension parsing results. Extract the dimension name and specific code value from the comparison dimension parsing results, combine them to generate comparison groups with business semantics, and obtain a comparison group list; Based on the list of comparison groups and other constraints in the attribution analysis task, the filtering conditions of the SQL WHERE clause are dynamically concatenated for each comparison group to obtain a comparison query statement with filtering conditions. Based on the comparison query statement with filtering conditions, multi-indicator parallel comparison calculation is performed on the data query results to calculate the absolute difference and relative change rate between each comparison group and obtain the comparison calculation results. The comparison calculation results are organized using a Node tree data structure. Each node contains dimension labels, values, descriptions, and comparison items, resulting in a tree-structured code value comparison analysis result.
9. The method according to claim 1, characterized in that, When the scheduled sub-Agent includes an intelligent decision-making agent, the intelligent decision-making agent performs a decision suggestion generation operation, including: In response to the assigned decision task, based on the data query results and attribution analysis results in the shared context memory, the time series forecasting tool determines whether the assigned decision task requires trend forecasting, and obtains the forecasting demand judgment result. When the forecast demand judgment result indicates that forecasting is required, based on the historical data in the data query result, the time dimension column and indicator column in the historical data are automatically identified, and a data validity check is performed to obtain valid time series data; Based on the valid time series data and the time granularity parameters extracted from the query metadata, the time series model is automatically selected in the time series modeling engine and the model is trained to obtain the trained prediction model. Based on the trained prediction model and the user-specified prediction time range, time series prediction calculations are performed, and confidence intervals are automatically added to the prediction results to obtain structured prediction results containing prediction time points, prediction values, and confidence intervals.
10. The method according to claim 1, characterized in that, The method further includes: Obtain the business scenario definition data configured by the enterprise, and configure a specific set of indicators, a set of dimensions and a time granularity for each business scenario based on the business scenario definition data to obtain the scenario-based semantic configuration. Based on the metrics in the contextualized semantic configuration, multiple synonym expressions are configured for each metric through the synonym management module to obtain a metric synonym library; Based on the dimensions in the scenario-based semantic configuration, a complete list of value domains and descriptions are configured for each dimension, and synonyms are configured for the dimensions and their code values through the synonym management module to obtain a dimension synonym library. Based on enterprise business terminology data, a business terminology knowledge base is constructed and vector indexes and keyword indexes are established to obtain a recallable business terminology knowledge base. The recallable business terminology knowledge base is used to perform hybrid index recall when a user's query request is received, converting business terms into standardized expressions to obtain standardized query requests.
11. The method according to claim 1, characterized in that, Also includes: Obtain the enterprise's customized tools and their interface definitions, verify whether the tools conform to the unified interface specification, and obtain the interface verification results. When the interface verification result is successful, based on the function description and calling parameters of the dedicated tool, the dedicated tool is registered to the corresponding Agent tool library through declarative configuration to obtain the updated Agent tool library; Based on the updated Agent tool library, the dedicated tool is identified and scheduled when the sub-Agent is invoked, and the execution result of the dedicated tool is obtained; The execution results of the specialized tool are written into a shared context memory for use in subsequent analysis processes.
12. The method according to claim 1, characterized in that, Also includes: Obtain the custom indicator definition data configured by the enterprise. The custom indicator definition data includes the indicator name, indicator expression and the basic indicators on which the calculation depends, to obtain the custom indicator configuration. Based on the indicator expression in the custom indicator configuration, the expression parsing engine performs syntax verification and dependency analysis on the indicator expression, identifies the basic indicators and operators referenced in the indicator expression, and obtains the expression parsing result. Based on the expression parsing result, construct the indicator calculation dependency graph, identify the basic indicators that each custom indicator depends on and their calculation order, and obtain the indicator dependency relationship graph. Based on the aforementioned indicator dependency graph, the custom indicator configuration is registered in the indicator template library, and a corresponding SQL expression template or calculation logic template is configured for the custom indicator to obtain the updated indicator template library. When a query request involving the custom metric is received, based on the query request and the metric dependency graph, the data query agent identifies the basic metric to be queried and obtains a basic metric query list; according to the basic metric query list, a data query operation for the basic metric is performed to obtain a basic metric dataset; based on the basic metric dataset and the metric expression in the custom metric configuration, the calculation engine executes the operation logic defined by the metric expression to obtain the custom metric calculation result; the custom metric calculation result is returned as the query result to the shared context storage for use in subsequent analysis processes.
13. A query request response device, characterized in that, Applied to query responses targeting enterprise data resources, including: The intent parsing module is used to obtain the query request input by the user, perform intent understanding and context parsing on the query request, and generate intent parsing results that include query semantics, task type and preliminary subtask decomposition results; The scheduling instruction generation module is used to generate agent scheduling instructions based on the intent parsing results; the agent scheduling instructions are used to invoke at least one sub-Agent among the data query agent, attribution analysis agent, or intelligent decision agent; The task execution module is used to, according to the Agent scheduling instructions, have the scheduled sub-Agent perform corresponding data query, root cause analysis, or decision suggestion generation operations to obtain the sub-Agent execution result; write the sub-Agent execution result, along with the confidence score and dialogue history associated with the sub-Agent execution result, into a shared context memory; read the sub-Agent execution result, the confidence score, and the dialogue history from the shared context memory, analyze the completeness of the sub-Agent execution result and the complexity of the query request, and generate a task completion evaluation result; evaluate whether to continue scheduling the sub-Agent based on the sub-Agent execution result, and if continued scheduling is required, cyclically call at least one of the data query agent, attribution analysis agent, or intelligent decision agent until the task termination condition is met, and obtain an intelligent analysis report; wherein, when evaluating whether to continue scheduling the sub-Agent based on the sub-Agent execution result, it is used to determine whether to continue scheduling the sub-Agent based on the task completion evaluation result, and when the task completion evaluation result indicates that continued scheduling is required, determine the next scheduling strategy, the scheduling strategy including cyclically calling the same agent, Multiple agents are scheduled in parallel or at least one of different agents is invoked in series to obtain a scheduling strategy scheme. Based on the scheduling strategy scheme and historical execution results in the shared context memory, new agent scheduling instructions are generated. When the scheduled sub-agent includes an intelligent decision agent, the intelligent decision agent performs a decision suggestion generation operation in response to the assigned decision task. Based on the data query results and attribution analysis results in the shared context memory, the strategy knowledge base retrieval tool converts the decision task, the data query results, and the attribution analysis results into a query vector, obtaining a decision query vector. Based on the decision query vector, semantic similarity retrieval is performed in the vector database of the strategy knowledge base to obtain a list of semantically matched candidate strategies. Based on the candidate strategy list and keywords in the decision task, the candidate strategy list is further filtered and sorted using a keyword matching mechanism to obtain a sorted strategy list. Based on the sorted strategy list and the dialogue history and analysis results in the shared context memory, the fit between each strategy and the current analysis scenario is calculated to obtain the optimal matching strategy. The optimal matching strategy is converted into specific action suggestions for the current business scenario to obtain a decision suggestion report. The display module is used to display the intelligent analysis report.
14. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing computer instructions for responding to queries against data resources within the enterprise, and the processor executing the computer instructions to implement the method of any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store computer instructions for querying data resources within the enterprise, and when executed, the computer instructions are used to implement the method described in any one of claims 1 to 12.
Citation Information
Patent Citations
Index question and answer intelligent platform realized based on large model Agent
CN118964546A
Task completion degree evaluation method for amphibious unmanned vehicle cross-domain login algorithm
CN119692832A
Data attribution method and device
CN120410578A