Query request response method and device, equipment and storage medium

By understanding the intent and parsing the context of user query requests, and scheduling multiple agents for dynamic analysis, this technology solves the problems of insufficient query accuracy and poor adaptability to complex tasks in existing technologies. It enables accurate and in-depth enterprise data analysis, adapting to the full-process needs of complex business scenarios.

CN121365086AActive Publication Date: 2026-01-20BEIJING DIPEAK TECHNOLOGY CO LTD

Patent Information

Application Number
CN202511947159.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-22
Publication Date
2026-01-20
Estimated Expiration
2045-12-22

AI Technical Summary

Technical Problem

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.

Method used

By acquiring user-input query requests, intent understanding and context parsing are performed to generate intent parsing results. Data query agents, attribution analysis agents, or intelligent decision-making agents are then scheduled. Combined with result evaluation and cyclic scheduling mechanisms, a progressive analysis logic is formed, the execution path is dynamically adjusted, and intelligent analysis reports are generated when task termination conditions are met.

Benefits of technology

It enables precise querying and in-depth analysis, improves the accuracy and reliability of query results, adapts to complex task requirements, forms a complete business analysis chain, reduces R&D and time costs, and supports rapid iteration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121365086A_ABST
    Figure CN121365086A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a query request response method and device, equipment and a storage medium, which are applied to query response for data resources in an enterprise, and the query request response method comprises the following steps: obtaining a query request input by a user, and performing intention understanding and context analysis on the query request; generating an intention analysis result containing the query semantics, the task type and the preliminary subtask disassembly result; generating an agent scheduling instruction based on the intention analysis result; the Agent scheduling instruction is used for calling at least one sub-Agent in a data query Agent, an attribution analysis Agent or an intelligent decision Agent; according to the Agent scheduling instruction, the scheduled sub-Agents execute corresponding data query, root cause analysis or decision suggestion generation operation, and sub-Agent execution results are obtained; whether the sub-Agents need to be scheduled continuously or not is evaluated according to execution results of the sub-Agents, and when the sub-Agents need to be scheduled continuously, at least one Agent in the data query Agent, the attribution analysis Agent or the intelligent decision-making Agent is called circularly until task termination conditions are met, and an intelligent analysis report is obtained; and displaying the intelligent analysis report.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a query request response method and device, equipment and storage medium. BACKGROUND

[0002] With the deepening of digital transformation, enterprises have accumulated a large amount of business data, and business personnel and management personnel have an increasingly urgent demand for directly accessing, analyzing data and obtaining decision support through natural language. In an ideal state, relevant personnel can complete the whole process operation from data fact query, business attribution analysis to action decision suggestion without mastering structured query language (SQL) or professional data analysis tools, thereby reducing the data use threshold and improving the analysis efficiency and decision quality.

[0003] The related technology for enterprise data query and analysis has obvious deficiencies in query accuracy, functional integrity, business adaptability and complex task processing capability, and therefore, there is an urgent need for a technical solution that can break through the above limitations and realize accurate query and deep analysis to meet the whole process needs of enterprises from general data access to exclusive decision support. SUMMARY

[0004] Therefore, the present disclosure provides a query request response method and device, equipment and storage medium to realize accurate query and deep analysis and meet the whole process needs of enterprises from general data access to exclusive decision support.

[0005] In a first aspect, a query request response method is provided, which is applied to query response for enterprise internal data resources, and includes: obtaining a query request input by a user, performing intent understanding and context analysis on the query request, and generating an intent analysis result containing query semantics, task type and preliminary sub-task disassembly result; generating an agent (Agent) scheduling instruction based on the intent analysis result; the Agent scheduling instruction is used to call at least one sub-agent in a data query Agent, an attribution analysis Agent or an intelligent decision Agent; according to the Agent scheduling instruction, a corresponding data query, root cause analysis or decision suggestion generation operation is performed by the dispatched sub-agent to obtain a sub-agent execution result; whether the sub-agent needs to be continuously dispatched is evaluated according to the sub-agent execution result, at least one of the data query Agent, the attribution analysis Agent or the intelligent decision Agent is called in a loop when the sub-agent needs to be continuously dispatched, until a task termination condition is met, an intelligent analysis report is obtained; and the intelligent analysis report is displayed.

[0006] In an optional embodiment, after resolving the user's intention, the confidence of the intention and entity can be evaluated, and if any score is below a threshold, structured follow-up questions are completed to obtain information, and the Agent scheduling instructions are generated in combination with the completed information.

[0007] In an optional embodiment, the sub-Agent execution results, confidence, and dialogue history are stored in a shared context, the task completion degree is evaluated, and it is determined whether to continue scheduling and determine the scheduling strategy of loop, parallel, or series, and generate new instructions.

[0008] In an optional embodiment, the data query Agent parses the query task to obtain indicators, dimensions, and other information, retrieves the corresponding SQL template and fills in the content to generate an executable SQL, and executes the query result dataset on the enterprise data source.

[0009] In an optional embodiment, the query result is loaded into an in-memory computing engine to perform secondary calculations such as same period and relative period, composite operations, and other SQL operations that cannot be completed, and the refined query result is obtained by converting to a standard format.

[0010] In an optional embodiment, the data query Agent generates a query ID, first checks the cache, and if there is a matching historical result, it is directly returned, otherwise a new result is obtained by executing SQL and associated with the ID and stored in the cache.

[0011] In an optional embodiment, the attribution analysis Agent parses the time expression of the attribution task through 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 result.

[0012] In an optional embodiment, the attribution analysis Agent extracts the comparison time point indicator data, detects indicator changes, and if significant, analyzes the dimension differences and sorts them, calculates the core dimension contribution, and filters the key factors to generate a structured attribution report.

[0013] In an optional embodiment, the attribution analysis Agent resolves the comparison intention to determine the dimensions and filtering conditions, generates a comparison group with business semantics and corresponding query statements, and calculates the differences between groups in parallel, and organizes the comparison results in a tree structure.

[0014] In an optional embodiment, the intelligent decision-making Agent determines whether the decision-making task requires prediction, and if so, processes historical data to obtain an effective time series, automatically selects and trains the model, and outputs a structured prediction result with a confidence interval.

[0015] In an optional embodiment, the intelligent decision agent converts the decision task into a query vector, retrieves candidate strategies from the strategy knowledge base, determines the optimal strategy through keyword screening and scene matching degree calculation, and converts it into a specific action suggestion to generate a report.

[0016] In an optional embodiment, enterprise business scene data is obtained, scene-based indicators, dimensions, and time granularity are configured, an indicator / dimension synonym library and a business terminology knowledge base with double indexes are constructed, and a user query is converted into a standardized request.

[0017] In an optional embodiment, it is verified whether the enterprise-specific tool interface conforms to the specification, and if so, it is declared to the corresponding Agent tool library for registration, and the Agent is called when the tool is scheduled, and the result is stored in the shared context for subsequent use.

[0018] In an optional embodiment, enterprise custom indicator configuration is obtained, expressions are parsed and a dependency graph is constructed, and the indicator template library is registered, and when a related query is received, the base indicators are first searched, the custom indicator results are calculated and stored in the shared context.

[0019] In a second aspect, a query request response apparatus is provided for query response to data resources within an enterprise, comprising: an intent analysis module configured to obtain a query request input by a user, perform intent understanding and context analysis on the query request, and generate an intent analysis result containing query semantics, task type, and preliminary sub-task disassembly result; a scheduling instruction generation module configured to generate an agent (Agent) scheduling instruction based on the intent analysis result; the Agent scheduling instruction is used to call at least one sub-Agent in a data query Agent, a root cause analysis Agent, or an intelligent decision Agent; a task execution module configured to perform corresponding data query, root cause analysis, or decision suggestion generation operation by the scheduled sub-Agent according to the Agent scheduling instruction, to obtain a sub-Agent execution result; to evaluate whether the sub-Agent needs to be continuously scheduled according to the sub-Agent execution result, and to cyclically call at least one of the data query Agent, the root cause analysis Agent, or the intelligent decision Agent when continuous scheduling is needed, until a task termination condition is met, to obtain an intelligent analysis report; and a display module configured to display the intelligent analysis report.

[0020] In a third aspect, a computer device is provided, comprising a processor and a memory, the memory storing computer instructions for query response to data resources within an enterprise, and the processor being configured to execute the computer instructions to implement the method of any of the above embodiments.

[0021] In a fourth aspect, a computer readable storage medium is provided for storing computer instructions for responding to a query request for an enterprise internal data resource, the computer instructions, when executed, implementing the method of any of the above embodiments.

[0022] The technical solution of the embodiments of the present disclosure, in the face of enterprise internal business data, when a business personnel uses natural language to make a query, does not directly convert the natural language into a query instruction, but first performs intent understanding and context analysis on the query request to generate an intent analysis result containing query semantics, task type, and preliminary sub-task decomposition. This process can identify ambiguous semantics in advance, supplement context information, reduce semantic deviation from the source, provide accurate task basis for subsequent Agent execution, and avoid query result deviation caused by semantic misunderstanding. The scheduled data query Agent, attribution analysis Agent, and intelligent decision-making Agent are all specialized modules, which, combined with result evaluation and cyclic scheduling mechanism, further improve the accuracy and reliability of the query result.

[0023] In addition, by scheduling the three types of sub-Agents, a complete business analysis link is formed, compared to the single data output of the general enterprise internal data query scheme, the method of the embodiments of the present disclosure realizes an end-to-end closed loop from problem discovery to problem solving, and the business value is upgraded from data presentation to decision support. The three types of sub-Agents are not independently executed, but form a progressive analysis logic through scheduling instructions, with an analysis depth far exceeding the fixed step output of general schemes, and are more in line with the complete thinking chain of human analysts. Moreover, the embodiments of the present disclosure do not rely on pre-defined fixed processes, but dynamically determine the next action through sub-Agent execution result evaluation, can decompose complex tasks into executable sub-steps, and can flexibly adjust the execution path according to the intermediate results to adapt to open and exploratory complex analysis requirements. The task termination condition is not fixed and unified, but is dynamically determined according to the business scenario. It avoids insufficient analysis and over-analysis, balances analysis quality and efficiency, and solves the problem of rigid process of traditional schemes that cannot adapt to complex tasks.

[0024] In addition, the embodiments of the present disclosure also provide customized service technology of the semantic layer, tool layer, and logic layer, which are not isolated, but form a synergistic effect to realize full-process customization support, which can greatly reduce the research and development cost and time cost, and support rapid iteration when subsequent business changes. BRIEF DESCRIPTION OF DRAWINGS

[0025] Figure 1 A query request response method flowchart provided by the embodiments of the present disclosure; Figure 2 A schematic diagram of the task execution full process of the embodiments of the present disclosure; Figure 3 A query request response device schematic diagram provided for an embodiment of the present disclosure; Figure 4 A computer device schematic diagram provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings in which like reference numerals refer to like elements, and the term "exemplary" is used herein to mean "serving as an example, instance, or illustration." Thus, the exemplary embodiments are not intended to be limited to the disclosed embodiments, but are intended to be as broad as possible consistent with the specification and claims. The following description is made with reference to the accompanying drawings in which:

[0027] The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. As used in the description of the present disclosure and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It also will be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0028] It will be understood that, although the terms first, second, third, etc. can be used herein to describe various information, these terms are not intended to denote a temporal or chronological order. Rather, these terms are used solely to distinguish one from another only. For example, a first information can be termed a second information, and similarly, a second information can also be termed a first information, without departing from the scope of the present disclosure. As used herein, the term "if' can be interpreted to mean "when" or "upon" or "in response to determining" depending on the context.

[0029] In addition, the symbol " / " in the present disclosure represents an "or" relationship between the related objects before and after the symbol, or in other words, an exemplary, simultaneous existing relationship between the related objects.

[0030] 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.

[0031] 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.

[0032] The solutions of this disclosure will be further described in detail below through specific embodiments.

[0033] like Figure 1 The diagram illustrates a query request response method provided in this embodiment. The execution entity of this method can be considered as the central agent (Brain Agent) among the deployed agents, including: 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.

[0034] Here, after obtaining the user query request, not only the key information in the query is identified, but also the task type is judged: is it only necessary to query data (corresponding to the data query Agent), is it necessary to analyze the reason (corresponding to the attribution analysis Agent), or is it necessary to give decision suggestions (corresponding to the intelligent decision Agent), so as to avoid the deviation that the user wants to analyze the reason, but only the data is returned. Through sharing the context, the previous dialogue content is automatically connected. For example, the user first asks “2024Q2 sales in East China”, and then asks “how much did it increase compared with the previous period”, which is automatically associated with the “East China” “sales” “2024Q2” of the previous step, without the user repeating the description, and the reference problem of “it” “this data” and the like is solved. Finally, the result containing the query semantics (standardized requirements such as ‘check the sales of product A in the East China region in Q2 2024, excluding returned orders’), the task type (such as ‘data query’), and the preliminary sub-task decomposition (such as ‘first check the basic sales, and then filter the returned data’) is generated, providing a clear basis for subsequent scheduling of the corresponding Agent.

[0035] S102: Based on the intention analysis result, an Agent Agent scheduling instruction is generated; the Agent scheduling instruction is used to call at least one sub-Agent in the data query Agent, the attribution analysis Agent or the intelligent decision Agent.

[0036] This step can match the Agent according to the demand. If data needs to be queried (such as Q2 sales), an instruction for calling the data query Agent is generated; if the reason needs to be found (such as why the sales decreased), the attribution analysis Agent is called; if a solution is needed (such as how to improve the sales), the intelligent decision Agent is called, so as to ensure that the Agent capability and the demand are accurately corresponding.

[0037] According to the preliminary sub-task decomposition result, the number of called Agents is judged. If it is only a single demand (such as only querying data), a single Agent is called; if the demand is complex (such as first querying data and then analyzing the reason), multiple Agents are called, so as to ensure that the multi-step demand is executed in sequence. The scheduling instruction of the embodiment of the disclosure not only “calls the Agent”, but also includes specific parameters (such as querying the sales of “East China region” and “2024Q2”), task targets (such as excluding returned orders) and result requirements (such as returning in the form of a table), so that the sub-Agent clearly knows “what to do, how to do it, and what to output”, and the execution deviation is avoided.

[0038] In an implementation, after the intent resolution result is generated, the method further includes: performing intent confidence evaluation and query entity confidence evaluation on the intent resolution result; when the confidence score of any one of the intent confidence evaluation and the query entity confidence evaluation is lower than a corresponding threshold, generating a structured follow-up question and sending it to the user to obtain the missing information that is completed; and generating the agent scheduling instruction based on the intent resolution result includes: generating the agent scheduling instruction based on the intent resolution result and the missing information that is completed.

[0039] Here, after the intent resolution result is generated, the reliability can be evaluated from two aspects: intent confidence (judging whether the core demand of the user is accurately identified, such as misjudging “analyze sales” as “query profit”), and query entity confidence (judging whether the key information is clear, such as “this month” not specifying the year, “sales” not specifying the region), to avoid bias in scheduling caused by ambiguous understanding. When the confidence is low, actively ask for supplementary information. Specifically, if any confidence is lower than a threshold (such as being uncertain whether “this month” refers to May 2024 or June 2024), a structured follow-up question (such as “What month in 2024 do you refer to by ‘this month’?”) is generated instead of guessing the execution, to ensure that the missing key information is obtained. When the agent scheduling instruction is finally generated, the initial intent resolution result and the information supplemented by the user (such as “May 2024” and “East China region”) are combined, so that the instruction is more accurate (such as calling the data query agent to query “sales in East China region in May 2024”), to improve the accuracy of subsequent execution from the source.

[0040] Specifically, the first step is to conduct a double confidence assessment. Brain Agent will call a special confidence assessment module to score the pre-generated intent parsing results from the dimensions of intent and entity (the score range is usually 0-1, and the threshold can be configured by the enterprise according to the business precision requirements, such as 0.8). When assessing the intent confidence, it is determined whether the understanding of the user's core demand type is clear, and the evaluation object is the task type (data query / cause analysis / decision suggestion) in the intent parsing result, mainly looking at the matching degree of the user's expression and the task type. For example, the user queries "Why is the recent sales not good", and determines that the matching degree of "task type is cause analysis" is high (confidence 0.95), and passes the evaluation; if the user's expression is ambiguous (such as "sales-related analysis"), it cannot be determined whether it is "data query" or "reason finding", and the intent confidence is low (such as 0.6), which does not reach the threshold. When evaluating the query entity confidence, it is determined whether the extraction of "user query core entity information" is complete and clear, and the evaluation object is the key entity (such as index, dimension, time range, filtering condition) contained in the query semantics in the intent parsing result, mainly looking at whether the entity is missing or ambiguous. For example, the user queries "Check the sales of East China in Q2 2024", and extracts "index = sales, dimension = East China region, time = Q2 2024", and the entity is complete and unambiguous (confidence 0.9), and passes the evaluation; if the user only says "check sales", without mentioning time and region (entity missing), or says "check the sales of that region" (the "that region" is ambiguous), the query entity confidence is low (such as 0.5), which does not reach the threshold.

[0041] The second step is to conduct structured follow-up questions. When the intent confidence or query entity confidence is lower than the pre-set threshold, Brain Agent will automatically generate structured follow-up questions instead of open-ended questions (such as not saying "Do you need to supplement any information?", but asking precise questions) to ensure that the user can quickly and clearly supplement. For intent confidence questions: focus on "clear task type", for example, the user says "sales-related analysis", and the follow-up question is: "Do you need to query sales data, analyze sales changes, or get decision suggestions to improve sales?". For query entity confidence questions, focus on "completing missing / ambiguous entities". For example (entity missing), the user says "check sales", and the follow-up question is: "Please tell me which time range (such as Q2 2024, this month) and which region (such as East China, nationwide) do you need to query the sales of?". For example (entity ambiguity), the user says "check the sales of that region" (the "that region" is not mentioned in the previous conversation), and the follow-up question is: "Does the 'that region' you mentioned refer to the 'South China region' mentioned in the previous conversation?".

[0042] Third step: integrate the completed information and perfect the intent analysis result. After the user replies to the follow-up question, Brain Agent will integrate the completed missing information (such as the user's supplement "2024Q2, East China region") with the initial intent analysis result to generate a perfect intent analysis result. For example, the initial intent analysis result is "query semantics = check sales, task type = data query (confidence 0.6)", and after the user supplements "2024Q2, East China region" and clearly states "only check data", the perfect result becomes "query semantics = check 2024Q2 East China region sales, task type = data query (confidence 0.98)", eliminating all ambiguities.

[0043] Fourth step: generate scheduling instructions based on the perfect result to ensure accuracy. The reconstructed Agent scheduling instruction step no longer relies solely on the initial intent analysis result, but rather on the perfect intent analysis result to ensure that the instructions contain complete and clear execution parameters: for example, based on the perfect result "check 2024Q2 East China region sales, task type = data query", the generated scheduling instruction is "target Agent: data query Agent; execution parameters: indicator = sales, dimension = East China region, time = 2024Q2; result requirement: return regional summary and city detail data", avoiding execution deviation due to missing parameters (such as not defaulting to "national" or "2023 data").

[0044] In addition, the confidence score mechanism is not subjective judgment, but is based on historical data matching degree + business rule matching degree calculation. For example, intent confidence will refer to "historical matching records of similar user expressions and task types", and query entity confidence will verify "whether the entity exists in the enterprise business terminology library and whether it meets the data model constraints" (such as "region" must be "East China / South China / North China" defined by the enterprise, avoiding "XX province" which is not standardized). If both intent and entity confidence are low, you can prioritize asking "intent-related questions" (first clarify "what to do", then clarify "how to do it") to avoid logical confusion. For example, first ask "are you checking data or looking for reasons", then ask "which time range do you need to check". In specific implementation, enterprises can adjust the confidence threshold according to business scenarios. For example, the financial analysis scenario requires high precision, and the threshold is set to 0.9; the daily operation query requires high efficiency, and the threshold can be set to 0.7, balancing accuracy and interaction efficiency.

[0045] By using this implementation, the execution accuracy of the Agent can be improved. By completing the missing information and eliminating the intention ambiguity, the subsequent sub-Agent (such as the data query Agent) does not need to "guess" the parameters, the matching degree of the execution result and the user demand is greatly improved, and the situation of "repeated query correction" is reduced. The active questioning avoids the inefficient process of user feedback correction after outputting an incorrect result, so that the user can obtain accurate results with one operation, which is more friendly to non-technical users (such as business personnel). It can also avoid "invalid Agent call" caused by understanding deviation (such as mis-calling the attribution analysis Agent and then re-calling the data query Agent), and reduce the system computing resource and data source access pressure. This implementation is a "error-proof optimization" of the core process, and through quantitative evaluation and active completion, the understanding of the demand changes from "fuzzy possibility" to "clear determination", which lays a precise foundation for subsequent multi-Agent collaborative execution.

[0046] In an implementation, the execution result of the sub-Agent, the result confidence score, and the dialogue history can be stored in a shared context storage, so that all Agents can share information and avoid repeated queries or information fragmentation.

[0047] Specifically, the sub-Agent execution result, the confidence score associated with the sub-Agent execution result, and the dialogue history are written into the shared context storage; the sub-Agent execution result, the confidence score, and the dialogue history are read from the shared context storage, the integrity of the sub-Agent execution result and the complexity of the query request are analyzed, and a task completion degree evaluation result is generated; whether the sub-Agent needs to be continuously dispatched is evaluated according to the sub-Agent execution result, including: based on the task completion degree evaluation result, it is judged whether the sub-Agent needs to be continuously dispatched, when the task completion degree evaluation result indicates that the sub-Agent needs to be continuously dispatched, a next scheduling strategy is determined, the scheduling strategy includes at least one of cyclically calling the same Agent, parallelly dispatching multiple Agents, or serially calling different Agents, to obtain a scheduling strategy scheme; and a new Agent dispatching instruction is generated according to the scheduling strategy scheme and the historical execution result in the shared context storage.

[0048] Here, the stored content contains three types of key information: sub-agent execution results, such as the "2024Q2 East China sales data set" returned by the data query agent and the "root cause list and impact proportion" output by the attribution analysis agent; correlation confidence scores, reflecting the reliability of the results, such as the "data accuracy score (0.92)" of the data query agent result and the "root cause credibility score (0.88)" of the attribution analysis agent (scores based on data matching degree and business rule verification); and dialogue history, which is the record of user interaction with the system, such as "user initial query 'analyze Q2 sales', supplemented after follow-up 'need to include East China + North China regions'", used to associate user demand background. This approach can break the limitations of traditional solutions where "each Agent result is stored independently and cannot be interconnected", for example, the attribution analysis agent does not need to re-call the data query agent and can directly read historical data results from the shared memory, reducing repeated computation and resource waste.

[0049] Task completion evaluation is to convert "fuzzy judgment" to "quantitative basis", this link is the key to connect information storage and scheduling decision, the core is to objectively analyze "whether the current analysis meets the demand" based on shared context information, to avoid subjective evaluation. The evaluation dimension focuses on two core dimensions to ensure comprehensive evaluation, among them, the completeness of sub-agent execution results is used to judge whether the results cover all elements of user demand, such as the user requiring to analyze East China + North China sales, if only East China data is returned, the completeness score is low (0.5); if data and preliminary attribution are returned, the completeness score is high (0.85). The complexity of query request is used to judge whether the user demand is a multi-step, multi-level task, such as "only checking sales" is a simple task (complexity 0.3), "checking sales + analyzing the reason for the decline + providing decision-making suggestions" is a complex task (complexity 0.9). The task completion evaluation result is generated by combining the two dimensions, presented in the form of quantitative score + text description, such as "completion degree 60%: East China sales data has been obtained (completeness 50%), North China data and attribution analysis have not been obtained, the query request is medium-high complexity (0.7), additional analysis is needed", which directly serves as the core basis for subsequent scheduling decisions.

[0050] Based on the task completion evaluation results, it is determined whether to continue to dispatch and how to continue to dispatch, and executable scheduling instructions are generated. When determining whether to continue to dispatch, the task completion evaluation results are used as the basis. If the completion degree reaches the preset threshold (such as the enterprise sets “simple task ≥ 80%, complex task ≥ 90%”), the dispatch is stopped; if it does not meet the standard (such as the completion degree is 60%), the subsequent dispatch strategy is started. According to the type of uncompleted demand, an adaptive dispatch strategy is selected, covering three core scenarios. Among them, the same Agent is called repeatedly, which is suitable for supplementing the same type of information (such as missing data dimensions, refining results), for example, only getting the sales of East China, supplementing the data of North China → calling the data query Agent again; multiple Agents are dispatched in parallel, which is suitable for verifying multiple independent analysis directions at the same time (such as multi-cause attribution), for example, suspecting that the sales decline is due to channel disruption and competitor promotion → calling two attribution analysis Agents at the same time to verify; different Agents are called in series, which is suitable for progressive analysis according to data → attribution → decision (complex task), for example, having obtained sales data → calling the attribution analysis Agent first to find the reason → calling the intelligent decision Agent to make suggestions.

[0051] The scheduling strategy scheme is combined with the historical execution results of the shared context to generate instructions, ensuring that the instructions contain “target Agent, execution parameters, associated historical information”, avoiding parameter omission or repetition. For example, when calling the data query Agent repeatedly, the instruction will clearly “supplement the data of North China region, refer to the ‘2024Q2 time range, sales indicator definition’ in the historical execution results”, ensuring that the new execution results are logically consistent with the historical results and can be connected.

[0052] Here, the Agent scheduling instruction can carry dynamic parameters, such as context parameters including historical query results, executed Agent types and execution order, and task state information including current task completion progress, pending subtask list and exception identification. Among them, the context parameters are to let the Agent know the historical data, such as carrying the historical query results (such as the previously queried "2024Q2 sales data in East China"), the executed Agent types and order (such as first calling the data query Agent, and then calling the attribution analysis Agent), to avoid starting from zero. For example, when the intelligent decision-making Agent receives the instruction, it can directly use the historical query sales data and attribution results to generate suggestions, without the need to repeat the query, and can also link the previous analysis logic. The task state information is to let the Agent know the current execution status, such as including the current task completion progress (such as "60% complete, missing data in North China"), the pending subtask list (such as "need to supplement the sales query in North China and generate national decision-making suggestions"), and the exception identification (such as "there are some missing data in the previous East China data query"), so that the Agent can clearly understand its own task in the overall process. For example, when the data query Agent receives the instruction, it can clearly know that it needs to supplement the data in North China to advance the progress, and can also pay attention to the exception identification to avoid repeated errors.

[0053] With the above implementation, after the sub-Agent execution result is generated, it is written into the shared memory in real time, and read-write separation is supported, each sub-Agent can only read information to avoid unauthorized modification, and information consistency is ensured; only the Brain Agent has write permission to ensure information accuracy. The evaluation threshold is not fixed and uniform, but is dynamically adjusted in combination with business scenarios and user needs. For example, financial statement query requires high integrity (threshold 0.95), and daily operation quick query requires high efficiency (threshold 0.7), balancing accuracy and user experience. If multiple strategies are applicable (such as both data supplement and attribution), the priority can be executed according to the order of first supplementing basic information and then deepening analysis (first calling the data query Agent to supplement data, and then calling the attribution analysis Agent), to avoid logical confusion.

[0054] This implementation makes the multi-Agent collaboration more efficient and accurate. Sharing context reduces repeated data queries and Agent calls, for example, the attribution analysis Agent directly reuses shared data without the need to execute SQL again, shortening the analysis period; parallel scheduling strategies can handle multiple analysis directions simultaneously, further improving efficiency. Quantitative task completion evaluation avoids over-scheduling (such as continuing to call when the completion degree has reached the standard) or under-scheduling (such as blindly attributing without completing the data). Strategies such as serial scheduling and parallel scheduling can handle complex requirements with multiple steps and dimensions.

[0055] S103: According to the Agent scheduling instruction, the corresponding data query, root cause analysis or decision suggestion generation operation is performed by the scheduled sub-Agent to obtain the sub-Agent execution result.

[0056] In this step, the exclusive task is performed according to the Agent type: after receiving the instruction, the data query Agent will complete the operation from parsing the demand to calling the enterprise data source and generating accurate data results; the root cause analysis Agent will analyze the change root cause based on the existing data; the intelligent decision Agent will generate actionable suggestions based on the data and root cause.

[0057] S104: According to the sub-Agent execution result, it is evaluated whether the sub-Agent needs to be continuously scheduled, at least one of the data query Agent, root cause analysis Agent or intelligent decision Agent is called in a loop when the sub-Agent needs to be continuously scheduled, until the task termination condition is met, and an intelligent analysis report is obtained.

[0058] In this step, the Brain Agent combines the sub-Agent execution results (such as data and root cause) and shared context (historical dialogue and business rules) to determine whether the current analysis meets the demand. For example, if only the sales decline is found but the reason is not found, or the root cause is not drilled down to the specific channel, it is determined that the scheduling needs to be continued. If the scheduling needs to be continued, the scheduling mode is selected according to the demand, the data query Agent is called again to supplement the data, the root cause analysis Agent is called again to deepen the root cause, or different Agents are called in series (query data -> find reason -> suggest), or multiple Agents are called in parallel to speed up, and the analysis is gradually improved. Until the termination condition (such as the root cause is found, the suggestion covers the demand, or the user says "enough") is met, the loop stops. The Brain Agent integrates all results to generate an intelligent analysis report containing "data facts, root causes and decision suggestions", and forms a complete analysis loop.

[0059] In an embodiment, when the scheduled sub-Agent comprises a data query Agent, the data query Agent performs a data query operation, comprising: in response to an assigned query task, performing semantic parsing on the query task by the data query Agent (possibly through a query tool) to identify an index entity, a dimension entity, a filtering condition, and an aggregation intent of the query, to obtain a semantic parsing result; based on the index entity in the semantic parsing result, retrieving a SQL expression template corresponding to the index entity from a pre-defined index template library, to obtain a SQL template; according to the SQL template and the dimension entity, the filtering condition, and the aggregation intent in the semantic parsing result, filling the dimension entity, the filtering condition, and the aggregation intent into the SQL template (possibly through a parameterized query construction engine) to generate an executable SQL query statement; executing the SQL query statement on an enterprise internal data source to obtain a query result dataset.

[0060] Here, semantic parsing is the first step of the data query agent. The agent uses a tool to parse the user's query task (such as "query the sales of offline channels in the East China region in Q3 2024") and identify four key pieces of information: the index entity (the core data the user wants to query, such as "sales"), the dimension entity (the analysis angle of the data, such as "time dimension: Q3 2024", "region dimension: East China", "channel dimension: offline"), the filter condition (the constraints for filtering data, such as "only include East China and offline channels"), and the aggregation intent (the statistical method of the data, such as "aggregate the total sales of Q3, not by week / day"). This step can convert ambiguous natural language into a structured list of query elements, providing a precise foundation for generating SQL in the future. In the template matching stage, the enterprise has established a library of index templates for all business indicators (such as sales, profit margin, inventory turnover rate), and each index is bound to a precise SQL expression template. According to the identified index entity (such as "sales"), the data query agent accurately matches the corresponding SQL template from the template library, ensuring that the syntax and business logic of the SQL are consistent with the enterprise database structure (such as multi-table association and field naming rules) from the source. Then, through the parameterized query construction engine, the parsed dimension entity, filter condition, and aggregation intent are filled into the corresponding positions of the SQL template, and a complete SQL statement that can be directly executed in the enterprise database is generated, ensuring the accuracy and compliance of the SQL. Finally, the generated SQL statement is executed in the enterprise's internal data source to directly read the real business data and obtain a structured query result dataset (such as "2024 Q3 East China offline channel sales: 5 million yuan"), which is automatically written into the system's shared context memory and can be directly fed back to the user, and also provides data support for subsequent attribution analysis agents (such as analyzing why sales are high / low) and intelligent decision-making agents (generating suggestions on how to improve sales).

[0061] In summary, through "predefined templates + structured parsing", the pain points of traditional NL2SQL systems are completely solved, with the advantages of high accuracy (avoiding syntax errors and business logic deviations of large models generating SQL), strong adaptability (template library and parameter filling logic can be tailored to enterprise-specific data models), and high efficiency (no need for manual SQL writing, achieving automated conversion from natural language to data results).

[0062] In the above embodiments, the SQL expression template in the predefined index template library can be dynamically bound with the enterprise business index. In an embodiment, the retrieving of the SQL expression template corresponding to the index entity from the predefined index template library to obtain the SQL template can include: performing semantic matching query in the index template library based on the index entity in the semantic analysis result to obtain a candidate SQL template list; calculating the semantic similarity of each candidate SQL template with the query task according to the candidate SQL template list and the context information in the semantic analysis 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.

[0063] Here, in the traditional fixed binding mode, one indicator entity corresponds to one SQL template, which cannot adapt to the differentiated query requirements of the same indicator in different business scenarios. The embodiment filters out the candidate SQL template list related to the indicator entity (such as the "regional summary template", "channel detail template" and "time trend template" associated with "sales") through semantic matching query, and further filters in combination with the context information (such as the "analysis by region" intention in the query), so as to realize the adaptation of one indicator entity to multiple scenario templates, avoid the query result not meeting the business expectation due to the single template, and greatly improve the coverage capability of the template library to diversified query requirements. In addition, when the query task contains a fuzzy intention or multi-dimensional constraint (such as "analyze the sales of new customers in East China this month", which needs to match the "sales" indicator, the "new customer" filtering condition, the "East China" dimension and the "this month" time constraint), it is difficult to locate the most suitable template (such as the "old customer sales template" and "national sales template") through indicator entity retrieval. The embodiment calculates the "semantic similarity between candidate templates and query tasks", and includes the context information (new customers, East China, this month) into the matching dimension. For example, the context of "new customer sales + East China + this month" will produce a higher similarity score with the SQL template containing the "new customer filtering condition", "regional dimension" and "time filtering", so as to accurately select the template that adapts to the complex constraint, avoid the template mismatch caused by ignoring the context, and ensure that the generated SQL statement can completely cover all business semantics of the query. Furthermore, the query logic of enterprise business indicators may be updated with business iteration (such as the "sales" newly added "deduction of returned amount" calculation rule, which needs to add the corresponding SQL template), and if the traditional "one-by-one binding" mode is adopted, the association relationship between the indicator and the template needs to be manually adjusted, which has high maintenance cost and is easy to miss. In the embodiment, the newly added template only needs to input the associated information of the indicator entity, and the system will automatically include it into the candidate list through semantic matching during retrieval, without the need for manual modification of the binding rule; at the same time, the similarity scoring mechanism can ensure that the newly added template is preferentially matched in the corresponding scenario (such as the "sales template with deduction of returned amount", which has a higher similarity score than the old template when the query contains the "net sales" and "deduction of returned amount" context), which not only reduces the maintenance workload of the template library, but also ensures the rapid landing of new business logic through "high similarity priority matching", and guarantees the business logic consistency of the query result in different periods.

[0064] In one embodiment, after obtaining the query result dataset, a secondary processing and refining process (such as through a number of post-processing tools) can be performed on the data, so as to realize the upgrade from basic data query to business data insight.

[0065] Specifically, the query result dataset can be loaded into a memory computing engine (here, a query result post-processing tool can be used) to obtain a memory dataset; based on the memory dataset and the complex computing requirement of the query task, secondary computing operations that cannot be directly completed by SQL in the memory computing engine are performed, the secondary computing operations including at least one of a same-for-different period and a different-for-different period calculation across time periods, a composite operation of multiple indexes, or a self-defined business rule calculation, to obtain a data result after secondary processing; and the data result after secondary processing is converted into a standardized data format to obtain a refined query result.

[0066] Here, the query result is imported into the memory computing engine, which can avoid a disk I / O bottleneck, improve efficiency for complex computing, and perform operations (such as same-for-different period, multiple-index composite calculation, and enterprise self-defined rule calculation) that are difficult to implement by SQL in memory to meet complex business requirements. In addition, the processed data is converted into a unified format, which is convenient for users to understand and can be seamlessly called by subsequent agents (attribution analysis and intelligent decision-making) to ensure smooth data flow in the whole process.

[0067] In an embodiment, the data query agent performs a data query operation, and further includes: generating a unique query identification based on the query task, the semantic analysis result, and the SQL query statement by a hash algorithm to obtain a query ID; retrieving, according to the query ID, whether there is a historical query result matching the query ID in a cache storage of a cache reading tool to obtain a cache retrieval result; when the cache retrieval result indicates that there is a matching historical query result, reading the historical query result from the cache storage based on the query ID as the query result of this time; and when the cache retrieval result indicates that there is no matching historical query result, storing a new query result dataset obtained by performing a query operation on an enterprise internal data source based on the SQL query statement in the cache storage in association with the query ID to obtain a cache-updated query result.

[0068] Here, the unique identification and cache retrieval reuse are used to optimize query efficiency, which can reduce the load and delay caused by repeated database queries (improve user experience) and ensure the consistency of the results of the same semantic query through unique ID binding to avoid data deviation.

[0069] In an implementation, when the scheduled sub-agent includes an attribution analysis agent, an accurate time dimension comparison result can be provided for attribution analysis by parsing the time expression in the attribution task, checking and standardizing the time parameter, and then comparing the index data at the corresponding time point. Specifically, the root cause analysis operation performed by the attribution analysis agent can include: in response to the assigned attribution analysis task, according to the data query result in the shared context memory, the time comparison attribution tool parses the time expression in the attribution analysis task by calling a large language model to obtain a time parameter parsing result, the time parameter parsing result including relative time or absolute time; based on the time parameter parsing result, the time parameter verification mechanism is used to verify the validity of the time parameter parsing result to obtain a standardized time parameter after verification, the standardized time parameter supporting at least one of day, month, quarter, and year time granularity; according to the standardized time parameter and the data query result, the index data at the corresponding time point is extracted and compared in the time dimension to obtain a time comparison analysis result.

[0070] This implementation can convert ambiguous time expressions into standardized parameters and then perform time comparison of index data based on the standardized parameters. The attribution analysis agent calls the time comparison attribution tool to parse the time expression in the task (such as “last year” or “this month vs. last month” or “2024Q1”) by means of a large language model to distinguish relative time (such as “the past 7 days”) or absolute time (such as “May 2024”) and determine the time range required for analysis. Through the time parameter verification mechanism (such as checking whether “February 30” is legal or whether “quarter” matches the enterprise statistical cycle), the parsed time parameter is converted into a standardized time in a unified format (supporting day / month / quarter / year granularity, such as “2024-05” or “2024Q2”), avoiding comparison errors caused by time format confusion. Based on the standardized time parameter, the index data at the corresponding time point (such as “2024 May sales” or “2024 April sales”) is extracted from the query result of the shared context, and then a time comparison operation (such as difference or growth rate) is performed to finally obtain a time comparison analysis result (such as “2024 May sales increased by 12% compared with April”), providing a core basis for subsequent root cause positioning in the time dimension.

[0071] To accurately locate the core reasons for significant changes in indicators in the time dimension (such as a sharp drop in sales and a sharp increase in profit margins), the attribution analysis agent can dig into the root causes through a systematic "abnormal change detection-dimension decomposition-contribution quantification" process. In one implementation, when the scheduled sub-agent includes an attribution analysis agent, the attribution analysis agent performs root cause analysis operations, which can include: in response to an assigned attribution analysis task, querying results according to data in the shared context memory, automatically extracting indicator data at two comparison time points by an indicator abnormal change attribution tool to obtain a comparison time point data set; based on the comparison time point data set, calculating the change amplitude of the indicator value between the two time points using a difference calculation algorithm to obtain an indicator abnormal change detection result; when the indicator abnormal change detection result meets the significant abnormal change condition, starting a multi-dimensional drilling analysis process, calculating the distribution difference between the two time points for each candidate dimension based on the comparison time point data set to obtain a dimension importance ranking result; according to the dimension importance ranking result, selecting the most important dimension, calculating the absolute and relative contributions of each value of the most important dimension to the overall indicator change to obtain a dimension contribution degree decomposition result; based on the dimension contribution degree decomposition result and a preset cumulative contribution proportion threshold, filtering out the key dimension value with the highest contribution degree and filtering out the long-tail low contribution value to obtain a list of key influencing factors; integrating the list of key influencing factors, the dimension importance ranking result, and the dimension contribution degree decomposition result to generate a structured attribution report to obtain an indicator abnormal change attribution analysis result.

[0072] In a specific implementation, first, the comparative data is extracted, specifically, the index fluctuation attribution tool automatically extracts the index data of two time points to be compared (such as "May 2024 sales" and "April 2024 sales") from the query results of the shared context, forms a comparative time point data set, and lays a data foundation for subsequent fluctuation analysis. Then, detect the index fluctuation, specifically, use the difference calculation algorithm (such as calculating the difference and growth rate of the index of the two time points), quantify the change amplitude of the index value (such as "May sales decreased by 20% compared with April"), and judge whether it meets the "significant fluctuation condition" (such as the change amplitude exceeds the preset threshold of 15%). Only when it is confirmed that there is a significant fluctuation, the subsequent in-depth analysis is started, avoiding invalid calculation. Next, after starting the drilling analysis, for all candidate dimensions (such as region, channel, product category), calculate the data distribution difference of each dimension at the two time points (such as "the sales proportion of East China region decreased from 30% to 20%, and the sales proportion of North China region increased from 25% to 35%"), and sort the dimensions according to the difference degree (such as "the importance of the region dimension is the first, and the importance of the channel dimension is the second"), and lock the core dimension with the greatest impact on the fluctuation. Combined with the preset cumulative contribution proportion threshold (such as 80%), the key dimension value with the highest contribution degree (such as "East China region decreased by 8%, South China region decreased by 5%, and the cumulative contribution of the total decrease amplitude is 65%") is selected from the dimension contribution degree result, and the long tail value with small impact (such as Northwest region decreased by 0.5%) is filtered out, forming a list of key influencing factors. Finally, the key influencing factor list, dimension importance ranking, and dimension contribution degree decomposition result are integrated to generate a structured attribution report containing "fluctuation situation-core dimension-key factor-impact degree", and finally a clear index fluctuation root cause analysis conclusion is obtained (such as "May sales decreased by 20%, mainly due to the decrease of 8% in East China offline channel sales and the decrease of 5% in South China new product sales"), which provides a clear basis for subsequent decision-making.

[0073] Here, the distribution difference degree between the two time points for each candidate dimension is calculated to obtain a dimension importance ranking result, including: based on the comparative time point data set, the numerical distribution of each candidate dimension at the first time point and the second time point is constructed respectively to obtain double-time point distribution data; according to the double-time point distribution data, the distribution difference degree between the two time points for each candidate dimension is quantified using the Jensen-Shannon divergence (JS) divergence algorithm to obtain the JS divergence value of each dimension; based on the JS divergence value of each dimension, the candidate dimensions are sorted 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 on the index fluctuation.

[0074] By constructing the numerical distribution of the "first time point" and "second time point" for each candidate dimension (such as region, channel) respectively (for example, "East China region accounts for 30% of sales in April and 20% in May", forming the double-time point distribution data of this dimension); then, use the JS divergence algorithm to calculate the difference value (JS divergence value) of each dimension double-time point distribution, the larger the value, the more significant the distribution change of the dimension at the two time points (such as the region dimension JS divergence value is higher than the channel, which means that the change of regional distribution has a more critical impact on the index anomaly); Finally, sort the candidate dimensions according to the JS divergence value from large to small to get the dimension importance ranking result, and directly lock the core dimension with the strongest explanation power for the index anomaly.

[0075] To accurately analyze the difference reasons of different business subjects (such as different regions, channels, and products) in the performance of the index at the same time point (such as "Why is the sales in Beijing lower than that in Shanghai" and "Offline channels have slower growth than online channels"), the attribution analysis agent needs to use the code value comparison attribution tool to realize horizontal comparison analysis of multi-dimensional values. The specific implementation can be as follows: In response to the assigned attribution analysis task, the code value comparison attribution tool parses the comparison intention in the assigned attribution analysis task according to the data query result in the shared context memory, identifies the comparison dimension and the filtering condition, and obtains the comparison dimension analysis result; extracts the dimension name and specific code value from the comparison dimension analysis result, and combines to generate a comparison group with business semantics, obtaining a comparison group list; according to the comparison group list and other constraint conditions in the attribution analysis task, dynamically splice the filtering conditions of the SQL WHERE clause for each comparison group, obtaining a comparison query statement with filtering conditions; based on the comparison query statement with filtering conditions, perform multi-index parallel comparison calculation on the data query result, calculate the absolute difference and relative change rate between each comparison group, and obtain the comparison calculation result; organize the comparison calculation result using a Node tree structure, each node contains a dimension label, a value, a description, and a comparison item, and obtain a tree-structured code value comparison analysis result.

[0076] Here, the code value comparison attribution tool first parses the user's comparison requirements from the attribution task (such as "compare offline sales in Beijing and Shanghai"), identifies the "comparison dimensions" (such as "region" and "channel") and "filter conditions" (such as "time: May 2024"), and clearly defines the core objects and constraint ranges of the comparison analysis to avoid blind and aimless comparison. From the parsing results, extract the dimension names (such as "region") and specific code values (such as Beijing and Shanghai), combine them into comparison groups that fit the business scenario (such as "region-Beijing vs region-Shanghai" and "region-Beijing + channel-offline vs region-Shanghai + channel-offline"), form a comparison group list, and ensure that the comparison objects have actual business significance (rather than irrelevant random combinations). Combined with the comparison group list and other constraints in the task (such as "only count new customer orders"), automatically splice the WHERE clause filter conditions of the SQL for each comparison group (such as "WHERE region='Beijing' AND channel='offline' AND user type='new customer'"), generate comparison query statements that can accurately filter corresponding data, and ensure the accuracy of each comparison data. Based on the generated query statements, calculate the index data of each comparison group in the query results of the shared context in parallel (such as calculating the offline new customer sales of Beijing and Shanghai at the same time), and quantify the difference degree through "absolute difference" (such as 100 million less than Shanghai) and "relative change rate" (such as 20% lower than Shanghai), to get intuitive comparison calculation results. Finally, organize the comparison results with Node tree data structure (such as the root node is "region comparison", the child nodes are "Beijing" and "Shanghai", each child node contains dimension labels such as "channel-offline" and "user type-new customer", specific values and comparison items), form a structured result with clear hierarchy, and facilitate users to quickly locate the difference core (such as "Beijing offline new customer sales is low, mainly due to insufficient sales of certain product categories"), providing horizontal comparison basis for root cause analysis.

[0077] In specific implementation, to provide users with key support for predicting future trends based on historical data in the decision-making stage (such as predicting next month's sales and predicting the trend of quarterly profit margin), the intelligent decision-making Agent can complete the whole process from demand judgment to structured prediction result output through the time series prediction tool.

[0078] In an implementation, when the scheduled sub-agent includes an intelligent decision agent, the intelligent decision agent performs a decision suggestion generation operation, including: in response to an assigned decision task, determining whether trend prediction is required for the assigned decision task according to data query results and attribution analysis results in the shared context memory by a time series prediction tool, to obtain a prediction requirement determination result; when the prediction requirement determination result indicates that prediction is required, automatically identifying a time dimension column and an index column in historical data in the data query results and performing data validity checking based on the historical data, to obtain valid time series data; automatically selecting a time series model in a time series modeling engine and performing model training according to the valid time series data and a time granularity parameter extracted from query metadata, to obtain a trained prediction model; performing time series prediction calculation based on the trained prediction model and a user-specified prediction time range, and automatically adding a confidence interval to a prediction result, to obtain a structured prediction result including a prediction time point, a prediction value, and a confidence interval.

[0079] Here, the intelligent decision-making agent first combines the query results of shared context (such as historical sales data) with the attribution analysis results (such as the root cause of sales fluctuations), and determines whether trend prediction is needed for the current decision-making task by the time series prediction tool (for example, "formulating next month's inventory plan" needs to predict sales, and "analyzing the reason for last month's profit decline" does not need to predict). Only when it is confirmed that prediction is needed, the subsequent process is started, reducing resource waste. If prediction is needed, the key columns are automatically identified from the historical data: one is the "time dimension column" (such as "date", "month"), which determines the time axis of the time series; the second is the "indicator column" (such as "sales", "order quantity"), which clearly indicates the core indicators that need to be predicted. At the same time, data validity check is carried out (such as excluding missing time and indicator outliers), and finally "valid time series data" with standard format and reliable data is obtained, avoiding the influence of poor data on prediction accuracy. Then, the time granularity parameter is extracted from the query metadata (such as historical data is counted by "day", then the prediction granularity is also "day"), and the adaptive model is automatically matched in the time series modeling engine (such as ARIMA model for linear trend data, Prophet model for seasonal fluctuation data), without the need for manual specification of model type and parameters. Subsequently, based on the valid time series data, the model training is completed, and the "trained prediction model" that can accurately fit the historical trend is generated. Finally, combined with the trained model and the user-specified prediction time range (such as "predict the next 30 days"), the prediction calculation is performed to obtain the predicted value at each time point (such as "sales prediction of 100,000 yuan on May 1st"). At the same time, the prediction value is automatically added with a confidence interval (such as "95% confidence interval: 90,000-110,000 yuan"), quantifying the uncertainty of the prediction result. Finally, the structured result containing "prediction time point, prediction value, confidence interval" is output, which not only clearly presents the future trend, but also provides risk reference for decision-making (such as the inventory quantity can be planned according to the upper limit of the confidence interval to cope with fluctuations).

[0080] In a specific implementation, in order to match the decision scheme (such as "how to improve the declining sales" and "how to optimize the inefficient channel") that fits the current scene for the user based on data facts (such as index results) and root cause analysis (such as transaction reasons), the intelligent decision agent can complete the conversion from demand mapping to specific action suggestions through a strategy knowledge base recall tool. In an embodiment, when the dispatched sub-agent includes an intelligent decision agent, the intelligent decision agent performs a decision suggestion generation operation, which can include: in response to an assigned decision task, converting the decision task, data query results, and attribution analysis results in the shared context memory into a query vector to obtain a decision query vector by a strategy knowledge base recall tool according to the data query results and the attribution analysis results; based on the decision query vector, performing semantic similarity retrieval in a vector database of a strategy knowledge base to obtain a list of semantically matched candidate strategies; according to the candidate strategy list and the keywords in the decision task, combining a keyword matching mechanism to perform secondary screening and sorting on the candidate strategy list to obtain a sorted strategy list; based on the sorted strategy list and the conversation history and analysis results in the shared context memory, calculating the fit degree of each strategy to the current analysis scene to obtain an optimal matching strategy; converting the optimal matching strategy into a specific action suggestion for the current business scene to obtain a decision suggestion report.

[0081] Here, the decision task (such as "how to improve the sales of the East China region") is first converted into a computer-recognizable decision query vector by combining the data results of the shared context (such as "sales in the East China region decreased by 15%") with the attribution conclusion (such as "due to the decrease in offline store customer flow"), avoiding strategy matching bias caused by differences in natural language expression (such as "boost sales" and "increase revenue"), and allowing the demand to accurately connect with the strategy in the knowledge base at the semantic level. Based on the decision query vector, "semantically similar" strategies (such as vector matching to "offline store traffic driving activities" and "regional promotion programs") are retrieved from the vector database of the strategy knowledge base, forming a candidate strategy list, and initially screening out consistent solutions with the current demand direction, excluding irrelevant strategies (such as "online advertising"). Combined with the core keywords in the decision task (such as "East China region" and "offline"), the candidate strategy list is filtered and sorted again, for example, strategies containing "regional targeting" and "offline store" keywords are retained, and strategies only applicable to "nationwide" and "online" are excluded, making the candidate list more suitable for the specific constraints of the current business scenario. Referring to the "dialogue history" (such as the user previously rejecting "massive price reduction") and "analysis results" (such as the higher average single price of offline stores in the East China region) of the shared context, the scenario fit degree of each candidate strategy (such as "offline store buy-one-get-one-free activity" has a higher fit degree than "offline discount promotion") is calculated, and the optimal matching strategy is finally selected to ensure that the strategy not only meets the historical interaction intent but also adapts to the current data conclusion. Finally, the optimal strategy (such as "offline store buy-one-get-one-free activity in the East China region") is converted into a specific action plan (such as "in the East China region, 30 core offline stores will carry out a "buy 500, get 100" activity for 2 weeks, with a simultaneous live streaming event to attract customers"), forming a structured decision recommendation report, allowing users to directly implement without the need for secondary disassembly.

[0082] Here, the strategy knowledge base adopts a hierarchical architecture, including a general strategy layer, an industry strategy layer, and an enterprise strategy layer. The 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, preferentially 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, sequentially performing semantic similarity retrieval in the vector databases of the industry strategy layer and the general strategy layer 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 weights and timeliness weights to obtain the candidate strategy list.

[0083] In this way, first, the strategy layer deposited by the enterprise itself is retrieved, the most suitable exclusive solution is preferentially matched, and when the enterprise-level strategy is not enough, the industry layer and the general layer are sequentially supplemented to avoid insufficient number of strategies. Finally, all strategies are scored in combination with the "hierarchical weight" (enterprise layer > industry layer > general layer) and the "timeliness weight" (new strategy > old strategy) to form an ordered candidate list.

[0084] S105: Display the intelligent analysis report.

[0085] In specific implementations, the intelligent analysis report supports content integration and presentation. Instead of being a scattered pile of results, the report contains a complete logical chain. For example, "2024Q2 East China sales down 15% (data) → due to offline channel out-of-stock (root cause) → suggest replenishing inventory (decision)", which allows users to understand "what, why, and how" at a glance. In addition, structured presentation (table presentation of data details) and visual presentation (line chart to show trends, pie chart to show root cause proportion) can be supported to avoid the dullness of pure text or pure data, so that even non-technical users can quickly understand. In addition, the report can be associated with key analysis basis (such as data source, attribution algorithm logic), and if a user has doubts about a conclusion, the corresponding sub-Agent execution process (such as SQL logic of data query) can be viewed in reverse to ensure the credibility of the analysis results.

[0086] Using the embodiment of the present disclosure, from the user's point of view, enterprise users only need to input query requests through natural language, without the need to master SQL, programming or professional analysis tools. Whether it is a business personnel or a management personnel, they can quickly get started and solve the contradiction that people who understand technology do not use data and people who use data do not understand technology. The embodiment of the present disclosure can help enterprise users to automatically complete the whole process from data query to attribution to decision-making, without the need for manual data sorting, root cause deduction and suggestion making, greatly shortening the analysis period and reducing the enterprise labor cost. The final output of the intelligent analysis report integrates the cyclic execution results of multiple Agents, and the user can directly obtain clear conclusions without the need for secondary processing, thereby improving the data application efficiency.

[0087] In some other implementations, to deeply adapt the embodiment of the present disclosure to the individualized business needs of enterprises, flexibly expand the tool support capability, and accurately respond to the customized index calculation needs, avoid the problems of poor scene adaptability, limited tool calling, and insufficient index calculation of the general system in actual enterprise applications, the embodiment of the present disclosure further strengthens the ability from three key dimensions of "scene-based semantic configuration, special tool integration, and custom index management". The following describes these customized configuration capabilities.

[0088] First, semantic layer customization configuration: obtain enterprise configured business scene definition data, configure specific indicator set, dimension set and time granularity for each business scene according to the business scene definition data, obtain scene semantic configuration; based on the indicators in the scene semantic configuration, configure multiple synonym expressions for each indicator through the synonym management module, obtain the indicator synonym library; according to the dimensions in the scene semantic configuration, configure complete value range list and description for each dimension, and configure synonyms for the dimension and its code value through the synonym management module, obtain the dimension synonym library; based on enterprise business term data, construct business term knowledge base and establish vector index and keyword index, obtain a recallable business term knowledge base; the recallable business term knowledge base is used to convert business terms into standardized expressions when receiving a user's query request, and obtain a standardized query request.

[0089] Here, first, the enterprise business scene definition (such as "monthly sales review" and "new product promotion analysis") is obtained, and for each scene, the exclusive indicator set (such as "sales scene binding "sales, single price"), dimension set (such as "region, channel") and time granularity (such as monthly) are bound, forming a scene semantic configuration, ensuring that the analysis dimension fits the scene requirements. Based on the scene indicators, multiple synonyms are configured for each indicator through the synonym management (such as "sales" corresponding to "revenue, water flow"), and an indicator synonym library is built to solve the problem of user expression difference. The value range (such as "region" dimension containing "East China, North China") and description are configured for the scene dimension, and synonyms are given to the dimension and code value (such as "offline channel" corresponding to "store, physical store"), forming a dimension synonym library, and improving the dimension analysis accuracy. Integrate enterprise term data, establish a recallable knowledge base with double index of vector + keyword; when the user queries, match the terms through double index recall, convert non-standardized expressions (such as "how much money is sold") into standardized requests (such as "query sales"), and ensure the accuracy of subsequent analysis.

[0090] Optionally, the mixed index recall through the recallable business term knowledge base, converting the business term into a standardized expression, obtaining a standardized query, comprises: based on the user query, converting the user query into a query vector through a vector encoding module to obtain a user query vector; according to the user query vector, performing semantic similarity retrieval in the vector index of the recallable business term knowledge base to obtain a semantic recall term candidate set; based on the keywords in the user query, performing exact match and fuzzy match in the keyword index of the recallable business term knowledge base to obtain a keyword recall term candidate set; fusing the semantic recall term candidate set and the keyword recall term candidate set, and comprehensively scoring according to recall mode weight and term frequency to obtain a fused term candidate set; based on the fused term candidate set, selecting the top N terms as the final recall terms according to the score from high to low, and mapping the final recall terms to standardized index names or dimension names according to the index synonym library and the dimension synonym library to obtain the standardized query request.

[0091] Here, the user query is converted into a vector, the semantically similar terms are found in the term library vector index to form a semantic candidate set (to solve the problem of non-standard expression); the user query keywords are extracted, and exact + 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 fused, and the top N optimal terms are selected according to "recall mode weight (such as semantic weight is higher) + term frequency" score; the optimal terms are converted into standardized index / dimension names in combination with the index / dimension synonym library to obtain a standardized query request.

[0092] Second, tool layer customization configuration: obtain a special tool developed by an enterprise and an interface definition thereof, verify whether the special tool conforms to a unified interface specification to obtain an interface verification result; when the interface verification result is a verification pass, register the special tool to a tool library of a corresponding Agent through a declarative configuration based on a function description and a calling parameter of the special tool to obtain an updated Agent tool library; identify and dispatch the special tool when calling a sub-Agent according to the updated Agent tool library to obtain a special tool execution result; and write the special tool execution result into the shared context memory for use by a subsequent analysis process.

[0093] Here, first, the special tool developed by the enterprise itself (such as the customer portrait analysis tool and the supply chain early warning tool) and its interface definition (such as the calling address, parameter format, and return data structure) are obtained. Through the built-in interface verification mechanism of the system, it is verified whether the tool meets the system unified interface specification (such as parameter naming rules and data transmission protocol). This step is the foundation, which ensures that the special tool can communicate normally with the system and each Agent, and avoids the failure of calling due to interface incompatibility. If the interface verification is passed, there is no need for complex coding development. Based on the core information of the special tool (such as the function description of "customer portrait analysis" and the calling parameters such as "customer ID and analysis dimension"), the tool is registered in the tool library of the corresponding sub-Agent (such as registering the customer portrait tool in the tool library of the attribution analysis Agent) through the declarative configuration method (such as filling in the configuration form and uploading the configuration file). This method reduces the technical threshold of tool access, and the enterprise can quickly complete the system integration of the exclusive tool, forming the updated Agent tool library. When the scheduling sub-Agent executes the task (such as the attribution analysis Agent needs to analyze "customer loss reasons"), the corresponding Agent tool library can be automatically searched to identify whether there is an adaptive special tool (such as the customer portrait analysis tool). If there is, the tool is directly called and the required parameters are transmitted to execute the exclusive business logic (such as analyzing the portrait characteristics of the lost customers), and the execution result of the special tool (such as "the proportion of the 30-year-old group in the lost customers is 60%") is obtained. The execution result of the special tool can be written into the shared context storage in real time, becoming a public data asset for the whole process analysis. Subsequent other Agents or processes (such as the intelligent decision-making Agent formulating "customer retention strategies") can directly read the result without the need to call the tool repeatedly, which not only improves the analysis efficiency but also guarantees the data consistency, realizing the maximization of the value of the special tool.

[0094] Third, the logic layer customization configuration: obtain the custom index definition data configured by the enterprise, the custom index definition data including index name, index expression and calculation dependent basic index, to obtain custom index configuration; based on the index expression in the custom index configuration, through the expression analysis engine, the index expression is syntax checked and dependent relationship is analyzed, the basic index and operator cited in the index expression are identified, and the expression analysis result is obtained; according to the expression analysis result, the index calculation dependency graph is constructed, the basic index and the calculation order of each custom index are identified, and the index dependency graph is obtained; based on the index dependency graph, the custom index configuration is registered to the index template library of the system, and the SQL expression template or the calculation logic template corresponding to the custom index configuration is obtained, and the updated index template library is obtained; when receiving the query request involving the custom index, based on the query request and the index dependency graph, the data query Agent identifies the basic index that needs to be queried, and obtains the basic index query list; according to the basic index query list, the data query operation of the basic index is executed, and the basic index data set is obtained; based on the basic index data set and the index expression in the custom index configuration, the operation logic defined by the index expression is executed through the calculation engine, and the custom index calculation result is obtained; the custom index calculation result is returned to the shared context memory as the query result for subsequent analysis process.

[0095] Here, first, the enterprise self-configured custom metric definition data is acquired, which includes three types of key information: first, the metric name (such as "new customer repurchase rate" and "store space efficiency"), which clearly identifies the metric; second, the metric expression (such as "new customer repurchase rate = 30-day repurchase new customer number / total new customer number"), which defines the calculation logic; and third, the dependent basic metrics (such as "30-day repurchase new customer number" and "total new customer number"), which clearly identify the original data sources required for calculation. Through these information, a complete custom metric configuration is formed, laying the foundation for subsequent calculation. Based on the expression of the custom metric, the built-in expression parsing engine performs two key operations: first, syntax checking, which checks whether the expression conforms to the calculation rules (such as avoiding "divisor is 0" and "operator error" problems, ensuring that the "new customer repurchase rate" expression has no syntax vulnerabilities); second, dependency relationship analysis, which automatically identifies all basic metrics (such as "store sales" and "store area") and operators (such as division " / ") referenced in the expression, and finally outputs accurate expression parsing results, avoiding subsequent calculation failures due to expression errors. According to the expression parsing results, a "metric calculation dependency graph" is constructed: taking the custom metric as the target node, its dependent basic metrics as the upstream nodes, clearly identifying the association between each custom metric and basic metric and the calculation order (such as calculating "new customer repurchase rate", which requires calculating "30-day repurchase new customer number" and "total new customer number" first). This dependency graph ensures that data is called in the correct order during subsequent calculations, avoiding logical errors such as "calculating custom metrics before basic metrics are obtained". Based on the metric dependency graph, the custom metric configuration is formally registered in the metric template library, and the corresponding SQL expression template (such as converting the "new customer repurchase rate" expression into an executable SQL query statement template) or calculation logic template (such as code calculation logic in non-SQL scenarios) is generated. After registration, the updated metric template library can store the custom metric for a long time, supporting repeated calls without the need for repeated configuration. When a user initiates a query request involving the custom metric (such as "query store space efficiency in May 2024"), the following steps are performed to calculate: The data query agent combines the query request and the index dependency graph to automatically identify the basic indexes (such as "sales of each store in May 2024" and "area of each store") that need to be queried first, generates a basic index query list, executes the basic index query to obtain the corresponding basic index dataset from the data source, and calculates the expression template in the index template library to perform the operation (such as dividing the "store sales" by the "store area") based on the basic index dataset to obtain the custom index calculation result (such as "store A has a floor efficiency of 5000 yuan / ㎡, and store B has a floor efficiency of 4200 yuan / ㎡"). Finally, the custom index calculation result is written into the shared context storage as a public data asset. Subsequent attribution analysis and intelligent decision-making processes (such as analyzing the "root cause of store floor efficiency difference" and "developing a floor efficiency improvement strategy") can directly read the result without the need for repeated calculation, which not only improves analysis efficiency but also ensures data consistency throughout the process.

[0096] As shown in Figure 2 The task execution process of the intelligent analysis system is shown. First, the user proposes a business query (such as "analyze the reason for the decline in sales last month"), and the request is first transmitted to the core scheduling module Brain Agent of the system. The Brain Agent is responsible for processing user requests: through three types of logic, "cyclic calling, active interaction, and multi-round conversation", the user's intention is analyzed, and missing information is completed (such as asking "do you mean May when you say 'last month'?"); after the user confirms the requirements, an Agent Plan (sub-Agent scheduling plan) is generated, which specifies which sub-Agents (data query, attribution analysis, and intelligent decision-making) need to be called. Then, according to the scheduling strategy, the three types of sub-Agents are scheduled, and each Agent is bound to a dedicated tool library. The data query Agent: through "storage tools and data processing tools", data query and secondary calculation are performed; the attribution analysis Agent: through "time comparison, code value comparison, and index change tools", root cause analysis is completed; the intelligent decision-making Agent: through "search, prediction, and business knowledge tools", decision-making suggestions are generated. Each sub-Agent generates a Tool Plan (tool execution plan) according to the task, and after the user confirms the tool, the "tool execution result" is obtained; the result is returned to the Brain Agent, which integrates and outputs the final response to complete the entire process. In the whole process, user requests, Agent scheduling plans, and tool execution results are stored in the "shared context module", ensuring data interconnection and process connection among modules.

[0097] As shown in Figure 3As shown, the embodiment of the present disclosure also provides a query request response apparatus 300, which can be deployed in a computer device such as a server or a server cluster or a terminal, and is applied to query response for enterprise internal data resources, and comprises: An intention analysis module 31 is configured to acquire a query request input by a user, perform intention understanding and context analysis on the query request, and generate an intention analysis result containing query semantics, a task type, and a preliminary subtask disassembly result; A scheduling instruction generation module 32 is configured to generate an agent (Agent) scheduling instruction based on the intention analysis result; the Agent scheduling instruction is used to call at least one sub-agent in a data query agent, a root cause analysis agent, or an intelligent decision agent; A task execution module 33 is configured to perform corresponding data query, root cause analysis, or decision suggestion generation operations by the scheduled sub-agent according to the Agent scheduling instruction, to obtain a sub-agent execution result; and to evaluate whether the sub-agent needs to be continuously scheduled according to the sub-agent execution result, and to cyclically call at least one of the data query agent, the root cause analysis agent, or the intelligent decision agent when the sub-agent needs to be continuously scheduled, until a task termination condition is met, to obtain an intelligent analysis report; A display module 34 is configured to display the intelligent analysis report.

[0098] The implementation process of the functions and roles of each unit in the above apparatus is specifically described in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0099] For the device embodiment, since it basically corresponds to the method embodiment, the related parts can be referred to the part of the method embodiment. The device embodiment described above is only illustrative, and the units described as separate components can be or can not be physically separated, and the components displayed as units can be or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. According to actual needs, part or all of the modules can be selected to achieve the purpose of the present disclosure. Those skilled in the art can understand and implement without creative labor.

[0100] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device 400, which can be a server, specifically a server of a sports management platform, or a terminal device. Referring to Figure 4 As shown, a structural schematic diagram of a computer device according to an example embodiment of the present disclosure comprises: The processor 410, the memory 420, and the bus 430. The memory 420 is configured to store execution instructions, including the memory 421 and the external memory 422; the memory 421 is also referred to as an internal memory, and is configured to temporarily store operation data in the processor 410 and exchange data with the external memory 422 such as a hard disk, and the processor 410 exchanges data with the external memory 422 through the memory 421.

[0101] In the embodiments of the present disclosure, the memory 420 is specifically configured to store application program codes for implementing the solutions of the present disclosure, and is controlled by the processor 410 to perform. 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 manners, so that the processor 410 executes the application program codes stored in the memory 420, and further executes the steps of the query request response method described in any of the foregoing embodiments.

[0102] The memory 420 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), and the like.

[0103] The processor 410 can be an integrated circuit chip having a processing capability. The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), and the like; or can be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The general processor can be a microprocessor or the processor can also be any conventional processor.

[0104] It can be understood that the structures illustrated by the embodiments of the present disclosure do not constitute a specific limitation on the electronic device 400. In some other embodiments of the present disclosure, the electronic device 400 can include more or fewer components than those illustrated, or combine certain components, or split certain components, or different arrangement of components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.

[0105] The embodiments of the present disclosure also provide a computer readable storage medium, including instructions stored thereon, wherein the instructions are executed by a processor to perform the query request response method according to any one of the above embodiments. The storage medium can be a volatile or non-volatile computer readable storage medium.

[0106] The embodiments of the present disclosure also provide a computer program product, which stores a computer program, and the computer program is executed by a processor to perform the steps of the query request response method according to any one of the above embodiments. For details, refer to the above method embodiments, which will not be repeated here.

[0107] The computer program product can be specifically implemented by hardware, software or a combination thereof. In an optional embodiment, the computer program product is specifically embodied as 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 as a software product, such as a software development kit (Software Development Kit, SDK) and the like.

[0108] In addition, the embodiments of the subject matter and the functional operations described in this specification can be implemented in: digital electronic circuitry, a tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. The embodiments of the subject matter described in this specification can be implemented as one or more computer programs, that is, one or more modules of computer program instructions encoded on a tangible non-transitory program carrier to be executed by, or to control the operation of, data processing apparatus. Alternatively or additionally, the program instructions can be encoded on an artificially generated propagated signal, such as a machine-generated electrical, optical, or electromagnetic signal that is generated to encode information for transmission to suitable receiver apparatus for execution by a data processing apparatus. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.

[0109] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuitry, e.g., an FPGA or an ASIC, and / or by a combination of computer hardware and special purpose logic circuitry. Devices can also be implemented as a combination of computer hardware and special purpose logic circuitry.

[0110] Suitable processors include, by way of example, both general and special purpose microprocessors. Generally, a processor will receive instructions and data from a read-only memory and / or a random access memory. Computer elements can also include one or more storage devices which can be removable and / or built-in, for example, optical, magnetic, or solid state storage devices for storing computer instructions and data structures used in the execution of programs and / or hardware logic components. Generally, a computer will also include, or be operatively coupled to receive data and instructions from or to, or in

[0111] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example 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. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.

[0112] While this specification contains many specifics, these should not be construed as limitations on the scope of any invention, but rather as descriptions of particular implementations of certain embodiments of the inventions. Certain features that are, for clarity, described above in the context of separate implementations can also be provided in combinations, unless explicitly stated otherwise or otherwise apparent from context. Conversely, various features that are, for brevity, described above in the context of a single implementation can also be provided separately or in any subcombination, unless explicitly stated otherwise or otherwise apparent from context. The scope of the subject technology is accordingly intended to embrace all such modifications and variations.

[0113] Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring such order, nor that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing can be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood 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.

[0114] Accordingly, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, actions recited in the claims can be performed in a different order and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In some implementations, multitasking and parallel processing can be advantageous.

[0115] The above descriptions are only preferred embodiments of the present disclosure and are not intended to limit the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the scope of protection of the present disclosure.

Claims

1. A query request response method characterized by, The application is applied to query response for enterprise data resources, including: obtaining a query request input by a user, performing intent understanding and context analysis on the query request, and generating an intent analysis result containing query semantics, task type and preliminary sub-task decomposition result; based on the intent analysis result, generating an agent scheduling instruction; the agent scheduling instruction is used to call at least one sub-agent in a data query agent, a root cause analysis agent or an intelligent decision agent; according to the agent scheduling instruction, the corresponding data query, root cause analysis or decision suggestion generation operation is executed by the scheduled sub-agent to obtain a sub-agent execution result; according to the sub-agent execution result, it is judged whether it is necessary to continue to schedule the sub-agent, and when it is necessary to continue to schedule, at least one of the data query agent, the root cause analysis agent or the intelligent decision agent is called circularly until a task termination condition is met, and an intelligent analysis report is obtained; the intelligent analysis report is displayed.

2. The method of claim 1, wherein, After generating the intent analysis result, the method further includes: performing intent confidence evaluation and query entity confidence evaluation on the intent analysis result; when the confidence score of any one of the intent confidence evaluation and the query entity confidence evaluation is lower than the corresponding threshold, a structured follow-up question is generated and sent to the user to obtain the missing information; the agent scheduling instruction is generated based on the intent analysis result and the missing information. The method further includes:

3. The method of claim 1, wherein, writing the sub-agent execution result, the confidence score associated with the sub-agent execution result and the dialogue history into a shared context memory; reading the sub-agent execution result, the confidence score and the dialogue history from the shared context memory, analyzing the integrity of the sub-agent execution result and the complexity of the query request, and generating a task completion degree evaluation result; based on the task completion degree evaluation result, it is judged whether it is necessary to continue to schedule the sub-agent, when the task completion degree evaluation result indicates that it is necessary to continue to schedule, the next scheduling strategy is determined, the scheduling strategy includes at least one of circularly calling the same agent, parallel scheduling multiple agents or serially calling different agents, and a scheduling strategy scheme is obtained; according to the scheduling strategy scheme and the historical execution result in the shared context memory, a new agent scheduling instruction is generated. 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, performing semantic analysis on the query task by the data query agent, identifying the index entity, dimension entity, filtering condition and aggregation intent of the query, and obtaining a semantic analysis result; 4. The method of claim 1, wherein, ​ ​ retrieve, based on the index entity in the semantic analysis result, an SQL expression template corresponding to the index entity from a predefined index template library to obtain an SQL template; fill, according to the SQL template and dimension entities, filter conditions and aggregation intentions in the semantic analysis result, the dimension entities, the filter conditions and the aggregation intentions into the SQL template to generate an executable SQL query statement; execute the SQL query statement on an enterprise internal data source to obtain a query result dataset.

5. The method of claim 4, wherein, After obtaining the query result dataset, further comprising: loading the query result dataset into a memory computing engine to obtain a memory dataset; performing, based on the memory dataset and complex computing requirements of the query task, secondary computing operations that cannot be directly completed by the memory computing engine, the secondary computing operations including at least one of cross-time period comparison and ratio calculation, multi-index composite operation or custom business rule calculation, to obtain a data result after secondary processing; converting the data result after secondary processing into a standardized data format to obtain a refined query result.

6. The method of claim 4, wherein, The data query agent performs a data query operation, and further comprising: generating, based on the query task, the semantic analysis result and the SQL query statement, a unique query identification through a hash algorithm to obtain a query ID; retrieving, according to the query ID, whether there is a historical query result matching the query ID in a cache storage of a cache reading tool to obtain a cache retrieval result; when the cache retrieval result indicates that there is a matching historical query result, reading the historical query result from the cache storage based on the query ID as the query result of this time and returning; when the cache retrieval result indicates that there is no matching historical query result, storing the new query result dataset associated with the query ID in the cache storage after performing a query operation on the enterprise internal data source based on the SQL query statement to obtain a new query result dataset to obtain a cache updated query result.

7. The method of claim 1, wherein, When the scheduled sub-agent includes an attribution analysis agent, the attribution analysis agent performs a root cause analysis operation, comprising: in response to an assigned attribution analysis task, according to the data query result in the shared context storage, calling a large language model by a time comparison attribution tool to analyze time expressions in the attribution analysis task to obtain a time parameter analysis result, the time parameter analysis result including relative time or absolute time; based on the time parameter analysis result, performing validity verification on the time parameter analysis result through a time parameter verification mechanism to obtain a verified standardized time parameter, the standardized time parameter supporting at least one of day, month, quarter and year time granularity; according to the standardized time parameter and the data query result, extracting index data at a corresponding time point and performing time dimension comparison calculation to obtain a time comparison analysis result.

8. The method of claim 1, wherein, When the scheduled sub-agent includes an attribution analysis agent, the attribution analysis agent performs a root cause analysis operation, including: In response to the assigned attribution analysis task, according to the data query result in the shared context memory, the index fluctuation attribution tool automatically extracts index data of two comparison time points to obtain a comparison time point data set; Based on the comparison time point data set, a difference calculation algorithm is used to calculate the index value change amplitude between the two time points to obtain an index fluctuation detection result; When the index fluctuation detection result meets the significant fluctuation condition, a multi-dimensional drilling analysis process is started, and the distribution difference degree of the comparison time point data set between the two time points is calculated for each candidate dimension to obtain a dimension importance ranking result; According to the dimension importance ranking result, the most important dimension is selected, and the absolute contribution and relative contribution of each value of the most important dimension to the overall index change are calculated to obtain a dimension contribution degree decomposition result; Based on the dimension contribution degree decomposition result and a preset cumulative contribution proportion threshold, the highest contribution degree key dimension value is screened out and long tail low contribution values are filtered to obtain a key influence factor list; The key influence factor list, the dimension importance ranking result and the dimension contribution degree decomposition result are integrated to generate a structured attribution report to obtain an index fluctuation attribution analysis result.

9. The method of claim 1, wherein, When the scheduled sub-agent includes an attribution analysis agent, the attribution analysis agent performs a root cause analysis operation, including: In response to the assigned attribution analysis task, according to the data query result in the shared context memory, the index fluctuation attribution tool automatically extracts index data of two comparison time points to obtain a comparison time point data set; Based on the comparison time point data set, a difference calculation algorithm is used to calculate the index value change amplitude between the two time points to obtain an index fluctuation detection result; When the index fluctuation detection result meets the significant fluctuation condition, a multi-dimensional drilling analysis process is started, and the distribution difference degree of the comparison time point data set between the two time points is calculated for each candidate dimension to obtain a dimension importance ranking result; According to the dimension importance ranking result, the most important dimension is selected, and the absolute contribution and relative contribution of each value of the most important dimension to the overall index change are calculated to obtain a dimension contribution degree decomposition result; Based on the dimension contribution degree decomposition result and a preset cumulative contribution proportion threshold, the highest contribution degree key dimension value is screened out and long tail low contribution values are filtered to obtain a key influence factor list; 10. The method of claim 1, wherein, The key influence factor list, the dimension importance ranking result and the dimension contribution degree decomposition result are integrated to generate a structured attribution report to obtain an index fluctuation attribution analysis result. When the scheduled sub-agent includes an intelligent decision agent, the intelligent decision agent performs a decision suggestion generation operation, including: In response to the assigned decision task, according to the data query result and the attribution analysis result in the shared context memory, the time series prediction tool judges whether the assigned decision task needs to be trend predicted to obtain a prediction demand judgment result; When the prediction demand judgment result indicates that prediction is needed, based on historical data in the data query result, a time dimension column and an index column in the historical data are automatically identified, and data validity checking is performed to obtain valid time series data; According to the valid time series data and a time granularity parameter extracted from the query metadata, a time series model is automatically selected in a time series modeling engine and model training is performed to obtain a trained prediction model; Based on the trained prediction model and a user-specified prediction time range, time series prediction calculation is performed, and a confidence interval is automatically added to the prediction result to obtain a structured prediction result containing a prediction time point, a prediction value, and a confidence interval.

11. The method of claim 1, wherein, When the scheduled sub-agent includes an intelligent decision agent, the intelligent decision agent performs a decision suggestion generation operation, including: In response to an assigned decision task, a decision query vector is obtained by converting the decision task, data query results, and attribution analysis results in a shared context memory into query vectors by a strategy knowledge base recall tool according to the data query results and the attribution analysis results in the shared context memory; Based on the decision query vector, semantic similarity retrieval is performed in a vector database of the strategy knowledge base to obtain a list of semantically matched candidate strategies; According to the candidate strategy list and keywords in the decision task, the candidate strategy list is further screened and sorted in combination with 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 degree of each strategy to the current analysis scene is calculated to obtain an optimal matching strategy; The optimal matching strategy is converted into a specific action suggestion for the current business scene to obtain a decision suggestion report.

12. The method of claim 1, wherein, The method further includes: Obtaining business scene definition data configured by an enterprise, and configuring a specific index set, dimension set, and time granularity for each business scene according to the business scene definition data to obtain a scenario-based semantic configuration; Based on the indexes in the scenario-based semantic configuration, multiple synonymous expressions are configured for each index by a synonym management module to obtain an index synonym library; According to 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 by the synonym management module to obtain a dimension synonym library; Based on enterprise business terminology data, a business terminology knowledge base is constructed, vector indexing and keyword indexing are established, and a recallable business terminology knowledge base is obtained; the recallable business terminology knowledge base is used to convert business terminology into standardized expressions by mixed index recall through the recallable business terminology knowledge base when a user's query request is received to obtain a standardized query request.

13. The method of claim 1, wherein, Further including: Obtaining a special tool developed by an enterprise and its interface definition, verifying whether the special tool conforms to a unified interface specification to obtain an interface verification result; When the interface verification result is a verification pass, based on the function description and the calling parameters of the special tool, the special tool is registered into the tool library of the corresponding Agent through declarative configuration, obtaining an updated Agent tool library; According to the updated Agent tool library, the special tool is identified and scheduled when calling the sub-Agent, obtaining a special tool execution result; The special tool execution result is written into a shared context memory for subsequent analysis processes.

14. The method of claim 1, wherein, Also includes: Obtain the custom indicator definition data configured by the enterprise, the custom indicator definition data including the indicator name, the indicator expression and the calculation dependent basic indicators, obtaining the custom indicator configuration; Based on the indicator expression in the custom indicator configuration, the indicator expression is parsed by the expression parsing engine to perform syntax checking and dependency analysis, identifying the basic indicators and operators referenced in the indicator expression, obtaining an expression parsing result; According to the expression parsing result, a calculation dependency graph is constructed to identify the basic indicators and their calculation order that each custom indicator depends on, obtaining an indicator dependency graph; Based on the indicator dependency graph, the custom indicator configuration is registered in the indicator template library, and the SQL expression template or the calculation logic template corresponding to the custom indicator configuration is obtained, obtaining an updated indicator template library; When receiving a query request involving the custom indicator, based on the query request and the indicator dependency graph, the data query Agent identifies the basic indicators that need to be queried, obtaining a basic indicator query list; according to the basic indicator query list, the data query operation of the basic indicator is executed, obtaining a basic indicator data set; based on the basic indicator data set and the indicator expression in the custom indicator configuration, the calculation logic defined by the indicator expression is executed through the calculation engine, obtaining the custom indicator calculation result; the custom indicator calculation result is returned to the shared context memory as the query result for subsequent analysis processes.

15. A query request response apparatus characterized by comprising: Applied to query response for enterprise data resources, including: An intent analysis module is configured to obtain a query request input by a user, perform intent understanding and context analysis on the query request, and generate an intent analysis result containing query semantics, task type and preliminary sub-task disassembly result; A scheduling instruction generation module is configured to generate an Agent scheduling instruction based on the intent analysis result; the Agent scheduling instruction is used to call at least one sub-Agent of a data query Agent, an attribution analysis Agent or an intelligent decision-making Agent; When the interface verification result is a verification pass, based on the function description and the calling parameters of the special tool, the special tool is registered into the tool library of the corresponding Agent through declarative configuration, obtaining an updated Agent tool library; According to the updated Agent tool library, the special tool is identified and scheduled when calling the sub-Agent, obtaining a special tool execution result; The special tool execution result is written into a shared context memory for subsequent analysis processes. Also includes: Obtain the custom indicator definition data configured by the enterprise, the custom indicator definition data including the indicator name, the indicator expression and the calculation dependent basic indicators, obtaining the custom indicator configuration; Based on the indicator expression in the custom indicator configuration, the indicator expression is parsed by the expression parsing engine to perform syntax checking and dependency analysis, identifying the basic indicators and operators referenced in the indicator expression, obtaining an expression parsing result; According to the expression parsing result, a calculation dependency graph is constructed to identify the basic indicators and their calculation order that each custom indicator depends on, obtaining an indicator dependency graph; Based on the indicator dependency graph, the custom indicator configuration is registered in the indicator template library, and the SQL expression template or the calculation logic template corresponding to the custom indicator configuration is obtained, obtaining an updated indicator template library; When receiving a query request involving the custom indicator, based on the query request and the indicator dependency graph, the data query Agent identifies the basic indicators that need to be queried, obtaining a basic indicator query list; according to the basic indicator query list, the data query operation of the basic indicator is executed, obtaining a basic indicator data set; based on the basic indicator data set and the indicator expression in the custom indicator configuration, the calculation logic defined by the indicator expression is executed through the calculation engine, obtaining the custom indicator calculation result; the custom indicator calculation result is returned to the shared context memory as the query result for subsequent analysis processes. a task execution module, configured to execute a corresponding data query, root cause analysis or decision suggestion generation operation by the scheduled sub-agent according to the agent scheduling instruction, to obtain a sub-agent execution result; and evaluate whether the sub-agent needs to be continuously scheduled according to the sub-agent execution result, and when the sub-agent needs to be continuously scheduled, cyclically invoke at least one of the data query agent, the root cause analysis agent or the intelligent decision agent until a task termination condition is met, to obtain an intelligent analysis report; a display module, configured to display the intelligent analysis report.

16. A computer device, comprising: The computer device comprises a processor and a memory, the memory stores computer instructions for responding to queries on data resources in an enterprise, and the processor is configured to execute the computer instructions to implement the method in any one of claims 1-14.

17. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store computer instructions for responding to queries on data resources in an enterprise, and the computer instructions are configured to implement the method in any one of claims 1-14 when executed.

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

  • Dynamic self-adaptive recommendation strategy optimization method for business handling failure scene

    CN121146474A

  • Multi-agent task management guided by generative artificial intelligence

    US20250356313A1

Cited By

  • A data query analysis method and device based on hybrid retrieval and code generation, equipment and medium

    CN122262180A