Task processing method, program product, device, and storage medium

By constructing a knowledge graph and a task planning model to break down data analysis tasks into sub-tasks, and combining this with a code generation model to automatically generate code, the problem of inaccurate code logic generated by language models in complex tasks is solved, thus achieving efficient and accurate data analysis.

CN122285731APending Publication Date: 2026-06-26RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD
Filing Date
2026-03-31
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing language model-based data analysis tools lack the ability to structurally decompose complex tasks, resulting in logical jumps and omissions in generated code, leading to poor accuracy of analysis results.

Method used

A knowledge graph is constructed, where nodes represent data analysis methods and edges represent logical relationships. Combining task requirements and data types, a task planning model is used to decompose the data analysis task into multiple sub-tasks, and a code generation model is used to automatically generate sub-task code to verify the processing results.

Benefits of technology

It automates and standardizes data analysis tasks, reduces the threshold for manual operation and the probability of errors, and ensures the accuracy and reliability of analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122285731A_ABST
    Figure CN122285731A_ABST
Patent Text Reader

Abstract

This specification provides a task processing method, program product, device, and storage medium. After obtaining a task requirement in natural language input from a user, a task planning model can be used to generate at least one analysis strategy based on the task requirement, the data type of the data required for the data analysis task, and a pre-built knowledge graph, and then determine the target analysis strategy. Each analysis strategy includes an analysis path and multiple sub-tasks obtained by decomposing the data analysis task based on the data analysis methods represented by each node in the analysis path. Then, a code generation model can be used to automatically generate and execute the task code for each sub-task in the target analysis strategy, and a final analysis report is obtained based on the processing results of each sub-task. By guiding the task planning model to accurately decompose the data analysis task under the constraints of the knowledge graph, the accuracy and reliability of the processing results can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to a task processing method, program product, device and storage medium. Background Technology

[0002] With the development of big data technology, data has become a core asset for enterprises. Data analysis aims to extract valuable information, discover potential patterns, and support business decision-making from massive, multi-source, and heterogeneous business data. Traditional data analysis tasks mainly rely on Business Intelligence (BI) tools, but these tools require business personnel to have certain coding skills, presenting a high technical barrier. With the development of language models, some technologies also allow users to directly describe task requirements using natural language. The system utilizes the code generation capabilities of language models to automatically convert these into executable query statements (such as SQL) or analysis scripts (such as Python), thereby achieving low-barrier self-service data analysis. However, current language model-based data analysis technologies lack the ability to structurally decompose complex tasks. When faced with some complex data analysis tasks, the code generated by language models is often divergent and one-sided, easily resulting in poor accuracy of the analysis results. Summary of the Invention

[0003] To overcome the problems existing in related technologies, embodiments of this specification provide a task processing method, program product, device, and storage medium.

[0004] According to a first aspect of the embodiments of this specification, a task processing method is provided for processing data analysis tasks, the method comprising: The task requirements are obtained in natural language form from user input, and a pre-constructed knowledge graph is also obtained. Each node in the knowledge graph represents a data analysis method, and the edges between nodes are used to represent the logical relationship between data analysis methods and / or applicable scenarios. Each data analysis method defines the processing logic for processing data. Based on the task requirements, obtain the dataset related to the data analysis task, and determine the data type of each data item in the dataset; Using a task planning model, at least one analysis strategy is output based on the task requirements, the data type, and the knowledge graph. Each analysis strategy includes an analysis path consisting of multiple nodes in the knowledge graph, and multiple sub-tasks obtained by decomposing the data analysis task based on the data analysis methods represented by each node in the analysis path. Determine the target analysis strategy from the at least one analysis strategy; The code generation model is used to generate the task code for each of the multiple sub-tasks in the target analysis strategy and run them to obtain the processing results of each of the multiple sub-tasks. If the processing results of each of the multiple subtasks are verified, the processing results of the multiple subtasks are integrated to generate an analysis report for the data analysis task, which is then returned to the user.

[0005] In some embodiments, obtaining the dataset related to the data analysis task based on the task requirements includes: Semantic parsing is performed on the task requirements to extract a set of key entities from them; Semantic clarification is performed on semantically ambiguous target key entities in the aforementioned key entity set; Generate query statements based on a semantically clarified set of key entities using a language model; Execute the query statement to retrieve the dataset related to the data analysis task from the database.

[0006] In some embodiments, the method is used to process data analysis tasks in an on-demand delivery scenario, wherein the entities in the key entity set include one or more of the following: The business objects targeted by the data analysis task, the time range covered by the data analysis task, the business indicators to be analyzed by the data analysis task, the constraints involved in the data analysis task, and the space name.

[0007] In some embodiments, semantic clarification is performed on semantically ambiguous target key entities in the key entity set, including: If the target key entity changes with the user's identity, then the user's permission configuration information is determined based on the user's login account, and the target key entity is parsed into a specific business object identifier based on the permission configuration information; If the target key entity is a business indicator, then the definition and calculation logic of the business indicator are queried from the pre-built business indicator knowledge base, and the data table fields required to calculate the business indicator are determined based on the definition and calculation logic. If the target key entity is a spatial name, then based on a pre-built spatial entity knowledge base, the spatial name is mapped to a standard geospatial code or regional identifier.

[0008] In some embodiments, the knowledge graph is constructed based on the following method: Obtain multiple professional data analysis reports; The knowledge graph is constructed by using pre-built prompt words to guide the language model to extract multiple data analysis methods from the data analysis report, and extracting the logical relationships and applicable scenarios between the data analysis methods.

[0009] In some embodiments, determining a target analysis strategy from the at least one analysis strategy includes: Each analysis strategy in the at least one analysis strategy, along with the corresponding reasoning process text, is displayed to the user; a target analysis strategy is determined from the at least one analysis strategy based on the user's strategy selection instruction, wherein the reasoning process text corresponding to each analysis strategy is output by the task planning model; or The quality assessment model is used to evaluate the quality of at least one analytical strategy to determine a quality score for each analytical strategy, and the analytical strategy with the highest quality score is selected as the target analytical strategy; or The quality assessment model is used to evaluate the quality of the at least one analysis strategy to determine the quality score of each analysis strategy. The analysis strategies in the at least one sub-strategy and the corresponding quality scores of each analysis strategy are displayed to the user. The target analysis strategy is determined from the at least one analysis strategy based on the user's strategy selection instruction.

[0010] In some embodiments, the quality score for each analysis strategy is determined based on information from one or more of the following dimensions: The relevance of the analysis strategy to the task requirements, the support of the data in the dataset for the analysis strategy, and the historical performance of the analysis strategy.

[0011] In some embodiments, after determining the target analysis strategy from the at least one analysis strategy, the method further includes: The target analysis strategy and the corresponding reasoning process text are displayed to the user, wherein the reasoning process text is output by the task planning model; Receive the user's strategy modification instruction, and adjust the target analysis strategy based on the strategy modification instruction; The process of generating task code for each of the multiple sub-tasks in the target analysis strategy using a code generation model and running it to obtain the processing results of each of the multiple sub-tasks includes: The code generation model is used to generate task codes for each of the multiple subtasks in the adjusted target analysis strategy and run them to obtain the processing results of each of the multiple subtasks.

[0012] In some embodiments, the processing result of each subtask is verified in the following ways: The processing result is subjected to a first-level verification, which is used to verify whether the task code can run and whether there are obvious errors in the running result of the task code. If the processing result passes the first level of verification, the processing result is then subjected to a second level of verification, which is used to verify whether there are any logical errors in the task code.

[0013] In some embodiments, a second-level verification is performed on the processing result, including: Based on the task requirements and the data type of the data related to the subtask, the verification rules matching the subtask are obtained from the pre-built verification rule set. The task code is logically validated based on the validation rules.

[0014] In some embodiments, for each subtask, if the processing result of the subtask fails verification, the task code of that subtask is used as the code to be corrected in the current iteration, and the following code correction operation is performed: Using the data types of the code to be corrected, the data related to the subtask, and the verification feedback information of the code to be corrected, prompt words are constructed to guide the code generation model to correct the code to be corrected, resulting in corrected code; wherein, the verification feedback information is used to indicate the reason why the code to be corrected failed the verification. Verify the revised code; If the corrected code fails verification, and / or the number of corrections does not reach the preset number, the code correction operation will be returned to be executed.

[0015] In some embodiments, if the number of corrections reaches a preset number and the processing result corresponding to the corrected code still fails verification, a correction card is displayed to the user. The correction card includes the current task code of the subtask, the task requirements, and the verification feedback information. Receive the user's code modification instruction, adjust the task code based on the code modification instruction, run the adjusted task code, and obtain the processing result of the subtask.

[0016] In some embodiments, the method further includes: Using the error task code generated by the code generation model and the adjusted task code, a sample pair is constructed; The code generation model is supervised and fine-tuned using the sample pairs, and / or the prompt word templates of the code generation model are adjusted.

[0017] In some embodiments, after obtaining a dataset related to the data analysis task based on the task requirements, the method further includes: Determine whether the data in the dataset can meet the analytical requirements of the data analysis task; If so, then execute the step of using the task planning model to output at least one analysis strategy based on the task requirements, the data type, and the knowledge graph; If not, a prompt message will be sent to the user.

[0018] According to a second aspect of the embodiments of this specification, a computer program product is provided, including a computer program that, when executed by a processor, implements the method mentioned in the first aspect above.

[0019] According to a third aspect of the embodiments of this specification, an electronic device is provided, the electronic device including a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the computer program, when executed, implements the method mentioned in the first aspect above.

[0020] According to a fourth aspect of the embodiments of this specification, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, it implements the method mentioned in the first aspect above.

[0021] The beneficial effects of the embodiments in this specification are as follows: A knowledge graph describing the data analysis approach can be pre-constructed. Nodes in this knowledge graph represent data analysis methods, and edges represent the logical relationships and / or applicable scenarios between these methods. After obtaining the user's task requirements in natural language input, a task planning model can be used to generate at least one analysis strategy based on the task requirements, the data types required for the data analysis task, and the pre-constructed knowledge graph. A target analysis strategy is then determined from this strategy. Each analysis strategy includes an analysis path and multiple sub-tasks derived from decomposing the data analysis task based on the data analysis methods represented by the nodes in that analysis path. Then, a code generation model can be used to automatically generate and execute the task code for each sub-task in the target analysis strategy. A final analysis report is obtained based on the processing results of each sub-task.

[0022] By introducing a pre-built knowledge graph and combining it with task requirements and the data types of various data points in the dataset, the task planning model can be guided to accurately decompose the data analysis task under the constraints of the knowledge graph. This avoids the problems of blind and unsystematic task decomposition in traditional data analysis, while ensuring that the analysis path aligns with data characteristics and task requirements. Simultaneously, by automatically generating sub-task code through a code generation model and verifying the processing results, the data analysis task can be automated and standardized, effectively reducing the threshold for manual operation and the probability of errors, and ensuring the accuracy and reliability of the processing results.

[0023] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit the embodiments of this specification. Attached Figure Description

[0024] The accompanying drawings, which are incorporated herein by reference and form part of the embodiments thereof, illustrate embodiments consistent with those described herein and, together with the description, serve to explain the principles of those embodiments.

[0025] Figure 1 This is a schematic diagram illustrating an application scenario as an exemplary embodiment of this specification; Figure 2 A flowchart illustrating a task processing method as shown in an exemplary embodiment of this specification; Figure 3 This is a schematic diagram illustrating a task processing method as an exemplary embodiment of this specification; Figure 4 This is a schematic diagram illustrating a quality assessment of an analysis strategy, as shown in an exemplary embodiment of this specification. Figure 5 This is a schematic diagram illustrating an exemplary embodiment of the present specification, showing the iterative correction of code generated by a code generation model; Figure 6 This is a schematic diagram illustrating a user interface as an exemplary embodiment of this specification; Figure 7 This is a logic block diagram of an electronic device illustrated in an exemplary embodiment of this specification. Detailed Implementation

[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those described in this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the embodiments described in this specification as detailed in the appended claims.

[0027] The terminology used in the embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of this specification. The singular forms “a,” “described,” and “the” as used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

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

[0029] Data analysis aims to extract valuable information, discover potential patterns, and support business decision-making from massive, multi-source, and heterogeneous business data. Traditional data analysis tasks mainly rely on Business Intelligence (BI) tools, but these tools require business personnel to have certain programming skills, presenting a high technical barrier. With the development of language model technology, data analysis tools based on Large Language Models (LLMs) have been gradually applied in the field of data analysis. These tools can directly receive task requirements described by users in natural language, automatically generate task code based on these requirements, and execute it to obtain corresponding data analysis results. Replacing traditional programming / SQL operations with natural language interaction significantly lowers the technical barrier to data analysis. However, current LLM-based data analysis tools typically adopt an "end-to-end" direct generation model, that is, directly generating code blocks based on user-input natural language task requirements. This lacks the ability to plan and structurally decompose complex tasks. When dealing with complex data analysis tasks, the generated code is prone to logical jumps and omissions in steps, resulting in poor accuracy of the final analysis results and making it difficult to pinpoint the cause of errors in the analysis results.

[0030] To improve the accuracy of task code generated by the language model, the applicant conceived of having the language model mimic the human thought process in analyzing problems. This involves breaking down the data analysis task into multiple sub-tasks according to a specific analytical path, and then generating and executing task code for each sub-task individually. This task decomposition breaks down complex tasks into simpler sub-tasks, improving the accuracy of task code generation. Furthermore, it facilitates the identification of errors when task processing results in failure.

[0031] Considering that accurately decomposing data analysis tasks is a prerequisite for obtaining high-quality analysis results, this specification provides a task processing method. To accurately decompose data analysis tasks, a knowledge graph describing the data analysis approach can be pre-constructed. Nodes in this knowledge graph represent data analysis methods, and edges represent the logical relationships and / or applicable scenarios between these methods. The task requirements of the data analysis task, the data types required, and the knowledge graph can be used to construct a context, which is then input into a task planning model. This model generates at least one analysis strategy, where each strategy includes an analysis path defined in the knowledge graph and multiple sub-tasks derived from decomposing the data analysis task based on the data processing logic corresponding to the data analysis methods represented by each node in each analysis path. A target analysis strategy can then be determined from the generated at least one analysis strategy. A code generation model is then used to automatically generate and execute the task code for each of the multiple sub-tasks within the target analysis strategy. The final analysis report is obtained based on the processing results of each sub-task.

[0032] By introducing a pre-built knowledge graph and combining it with task requirements and the data types of various data points in the dataset, the task planning model can be guided to accurately decompose the data analysis task under the constraints of the knowledge graph. This avoids the problems of blind and unsystematic task decomposition in traditional data analysis, while ensuring that the analysis path aligns with data characteristics and task requirements. Simultaneously, by automatically generating sub-task code through a code generation model and verifying the processing results, the data analysis task can be automated and standardized, effectively reducing the threshold and error probability of manual operation, ensuring the accuracy and reliability of the processing results. Finally, by integrating and verifying the sub-task processing results, an analysis report is generated, efficiently outputting analytical conclusions that meet user needs. This improves the processing efficiency, standardization, and result quality of data analysis tasks, adapting to the actual needs of various complex data analysis scenarios.

[0033] The task processing methods provided in the embodiments of this specification can be executed by tools with data analysis functions, such as a data analysis platform. This data analysis platform can be deployed in various electronic devices, such as cloud servers, user computers, mobile phones, etc. The embodiments of this specification do not impose any limitations.

[0034] like Figure 1 The diagram shown is an application scenario illustration of an embodiment of this specification. The data analysis platform 11 can be deployed in a cloud server. Users can communicate with the data analysis platform 11 through a client 12 installed on a terminal device (mobile phone, computer, etc.) and send data analysis tasks. The client 12 can send the data analysis tasks sent by the user to the data analysis platform 11. The data analysis platform 11 generates a corresponding analysis report based on the user's task requirements in natural language form and returns it to the client 12.

[0035] The following combination Figure 2 and Figure 3 The task processing methods provided in the embodiments of this specification are described, such as... Figure 2 As shown, the task processing method may include the following steps: S202. Obtain the task requirements in natural language form input by the user, and a pre-constructed knowledge graph, wherein each node in the knowledge graph represents a data analysis method, the edges between nodes are used to represent the logical relationship between data analysis methods and / or applicable scenarios, and each data analysis method defines the processing logic for processing data. In step S202, the task requirements described by the user in natural language can be obtained. These task requirements describe the data analysis task to be processed. For example, the task requirements can cover information such as analysis objectives, analysis objects, focus dimensions, and constraints. By allowing users to provide task requirements in natural language, users do not need to provide structured instructions or professional code, thus reducing the user's operating threshold.

[0036] Furthermore, to ensure that the task planning model can systematically and scientifically decompose data analysis tasks, avoiding haphazard decomposition, a knowledge graph describing the analytical approach can be pre-constructed. This knowledge graph can be built by offline learning from human expert analysis experience and summarizing common methods in the data analysis field. The knowledge graph consists of multiple nodes and connecting edges. Each node corresponds to a specific data analysis method, and each method clearly defines its specific data processing logic, such as data filtering, statistical calculation, and trend analysis. The edges between nodes define the logical relationships between different data analysis methods, such as predecessor / successor relationships, decomposition / combination relationships, and the specific scenarios in which each method is applicable, such as time series data adapting to trend analysis methods, and comparative analysis adapting to bar chart visualization methods. This knowledge graph can provide standardized and systematic analytical basis for subsequent task planning.

[0037] S204. Based on the task requirements, obtain the dataset related to the data analysis task, and determine the data type of each data item in the dataset; In step S204, after obtaining the task requirements in natural language form, semantic parsing can be performed on the task requirements to extract key entities that represent the task intent of the data analysis task. Then, a query statement can be generated based on these key entities to retrieve the dataset required for the data analysis task from the database. For example, semantic parsing of the task requirements can extract key entities such as the business object to be analyzed, time range, regional range, and business indicators, resulting in structured data representing the task intent. Then, a corresponding query statement can be generated based on this structured data to accurately extract the dataset highly relevant to the current data analysis task from the database.

[0038] Then, qualitative analysis can be performed on the extracted dataset to identify the data types of each data item in the dataset, including but not limited to time series data and spatial data, and to clarify the format, characteristics and processing requirements of each type of data, providing data-level support for the generation of subsequent analysis strategies and the matching of data analysis methods.

[0039] By acquiring the data required for the data analysis task and determining the data type, it is possible to ensure that the subsequent selected analysis methods, generated task code, and data characteristics are compatible, avoiding execution failures or result distortions caused by data type mismatch and analysis method mismatch, and providing data compatibility assurance for the smooth progress of subsequent steps.

[0040] S206. Using a task planning model, output at least one analysis strategy based on the task requirements, the data type, and the knowledge graph. Each analysis strategy includes an analysis path composed of multiple nodes in the knowledge graph, and multiple sub-tasks obtained by decomposing the data analysis task based on the data analysis methods represented by each node in the analysis path.

[0041] In step S206, as Figure 3 As shown, prompts can be constructed using task requirements, the data types required for the data analysis task, and the knowledge graph. These prompts guide the task planning model to output at least one analysis strategy (analysis strategy 1 to analysis strategy n in the figure). Each analysis strategy includes an analysis path and multiple sub-tasks derived from that analysis path. The task planning model can be a general language model or a customized model that has undergone supervised fine-tuning. For example, in some scenarios, the task planning model can use an open-source language model, which can be given task planning capabilities by configuring appropriate prompt templates.

[0042] Task planning models can parse the core intent of task requirements, combine the characteristics of data types, match suitable data analysis methods (nodes) from a knowledge graph, and connect them according to the logical relationships between nodes to form a complete analysis path. Simultaneously, based on the data processing logic of the data analysis methods represented by each node in this analysis path, complex data analysis tasks can be decomposed into multiple independently executable subtasks with clear logical connections (such as...). Figure 3 (Subtasks 1 through n). For example, for each node, one or more subtasks can be obtained, and each subtask corresponds to a specific data analysis operation, such as summing the data, displaying the data using a line chart, etc.

[0043] Nodes in a knowledge graph can represent independent data analysis methods, defining the processing logic for handling data. These nodes cover the complete analytical chain from describing the current situation to predicting the future. Edges in a knowledge graph can represent the logical relationships and applicable scenarios between data analysis methods, reflecting the analytical logic of experts. For example, logical relationships can include the following: (1) Decomposition / combination relationship: A complex analysis task can be decomposed into multiple sub-tasks. For example, "attribution analysis" can be decomposed into steps such as "macro-trend review", "meso-dimensional drill-down", and "micro-individual insight", which correspond to nodes such as "trend analysis", "multi-dimensional analysis" and "individual profile" respectively.

[0044] (2) Precedence / Succession: refers to the order of analytical steps. For example, usually, "descriptive analysis" is used first to understand "what happened", and then "diagnostic analysis" is used to explore "why it happened".

[0045] (3) Applicable conditions / framework: Indicates the application framework of a certain analysis method (node) in a specific scenario. For example, when analyzing "user behavior", the graph will point to the classic framework of "AARRR model".

[0046] (4) Method / Tool Association: Associate the analysis intent with the specific implementation method. For example, when the intent is "comparison", the "visualization" node may recommend using "bar chart"; when the intent is "to see the trend", "line chart" is recommended.

[0047] The process of constructing such a knowledge graph essentially involves extracting, integrating, and processing knowledge from a large number of high-quality analytical reports and expert experience, ultimately forming structured triples (such as "attribution analysis - framework adoption - macro, meso, and micro levels") and storing them in a graph database. A structured triple is the smallest unit of knowledge in a knowledge graph, typically consisting of "entity-relationship-entity". For example, trend analysis - recommended charts - line charts connect the most suitable visualization format for trend analysis (line charts). Another example is diagnostic analysis - preliminary steps - descriptive analysis, where this knowledge defines the logical order of analysis; that is, before exploring "why it happened" (diagnostic analysis), it is usually necessary to clarify "what happened" (descriptive analysis).

[0048] For example, when a user inputs the task request "Analyze why the delivery success rate in Beijing dropped yesterday?", the data analysis platform can use a knowledge graph to plan the following path: Initiating Diagnostic Analysis: The question is "why did it happen?" The map first locates the "Diagnostic Analysis" domain and selects the core node "Attribution Analysis".

[0049] Macro-level review (descriptive analysis): Following the logic of "attribution analysis," the first step is to see the whole picture. The graph calls the "trend analysis" node to show the overall trend, cyclical patterns, and key turning points of the recent delivery rate, confirming the magnitude and duration of the decline in the delivery rate.

[0050] Mid-level drill-down (descriptive analysis): Next, the graph calls the "multidimensional analysis" node to conduct structural insights and comparisons of delivery success rates from different dimensions (such as transportation capacity, region, product category, user group), and to pinpoint which dimension(s) saw the most significant decline in delivery success rate.

[0051] Exploring Correlation (Diagnostic Analysis): The hypothesis is that the delivery success rate decline is most significant among the "new rider" group. The graph will further call the "Correlation Analysis" node to analyze the correlation strength between the new rider's delivery success rate and variables such as "rider's order volume," "rider's order delivery ability," and "rider's order-carrying pressure," to preliminarily identify potential influencing factors.

[0052] Providing guidance and suggestions (guidance analysis): After identifying the core driving factors, the graph can be extended to the "guidance analysis" domain. For example, if it is found that new riders are under great pressure from carrying orders, it can be suggested to call the "user segmentation" node to further segment new riders and use "simulation and optimization analysis" (What-if) to measure the possible effects of different order pressure cap schemes on improving the delivery success rate.

[0053] Results Presentation (Chart Visualization): Throughout the analysis process, the graph will call the "Visualization Presentation" node, automatically selecting a line chart for "Trend Analysis" and a bar chart or tree diagram for "Multidimensional Comparison" to achieve the best information delivery effect.

[0054] By using knowledge graphs as constraints, complex data analysis tasks are systematically and standardizedly decomposed, avoiding problems such as task confusion, logical inconsistencies, and omissions of key steps during the decomposition process. The output of multiple analysis strategies breaks the limitations of a single analysis path, providing users with diverse choices and ensuring that the analysis process aligns with different business needs and preferences. Furthermore, the data analysis methods based on knowledge graphs adapt to the logic, enhancing the scientific rigor and feasibility of the analysis strategies.

[0055] S208. Determine the target analysis strategy from the at least one analysis strategy; In step 208, a flexible strategy selection method can be provided, allowing users to choose independently or for the system to recommend a target analysis strategy from at least one analysis strategy output by the task planning model. The system recommendation can rank the analysis strategies based on indicators such as relevance to task requirements, data adaptability, and historical performance, automatically selecting the best analysis strategy for the user. Alternatively, users can choose the analysis strategy that best suits their specific business experience and analysis needs. Of course, users can also make simple adjustments to the selected analysis strategy to ensure that the target analysis strategy accurately matches the core requirements.

[0056] S210. Use a code generation model to generate task codes for each of the multiple sub-tasks in the target analysis strategy and run them to obtain the processing results of each of the multiple sub-tasks. In step S210, after determining the target analysis strategy, as follows: Figure 3 As shown, for each subtask in the target analysis strategy, a code generation model can be invoked to automatically generate runnable task code (e.g., based on the specific requirements of the subtask, the required data, and the specific data processing logic). Figure 3 The task codes are 1 through n. The code generation model can use a general language model or a custom model obtained through supervised fine-tuning. For example, both the code generation model and the task planning model can use the same language model, but by configuring different prompt word templates, they can be given task planning capabilities and code generation capabilities respectively. Of course, the two models can also use different language models, which can be flexibly set according to actual needs.

[0057] After generating the task code, the task code for each subtask can be run in a secure, isolated execution environment (such as a controlled sandbox environment) to obtain the execution process and output results of each subtask, ultimately yielding the processing results of all subtasks (e.g., ...). Figure 3 The processing results are 1 to n.

[0058] In the process of generating and executing task code for multiple subtasks, a scheduling strategy can be determined based on the dependencies between them. For example, subtasks without dependencies can be executed in parallel, while those with dependencies can be executed sequentially. By rationally scheduling multiple subtasks to execute in parallel or sequentially, task processing efficiency can be greatly improved.

[0059] S212. If the processing results of each of the multiple sub-tasks have been verified, the processing results of each of the multiple sub-tasks are integrated to generate an analysis report of the data analysis task and returned to the user.

[0060] In step S212, after obtaining the processing result of each subtask, the result can be verified to ensure its accuracy. Verification includes checking the logical correctness of the result, data validity, and its compatibility with the subtask requirements, ensuring that the result of each subtask meets expectations. Considering that for dependent subtasks, the processing of a later subtask may require the result of a previous subtask, to avoid wasting resources by using an incorrect result from a subtask, the code for the next subtask can be generated and executed only after the result of the previous subtask has been verified. With all subtask results verified, the results are integrated according to the analysis path and logical order of the target analysis strategy. The analysis logic is clarified, the analysis conclusions are extracted, and a logically coherent, complete, and professionally presented analysis report is generated. Finally, the analysis report is returned to the user, completing the entire data analysis task.

[0061] Considering that user-input natural language task requirements are often vague instructions, inaccurate semantic parsing can lead to inaccurate generated task code if the user's true intent is not accurately identified. For example, in related technologies, generating query statements solely through simple keyword matching or fixed rules lacks a deep understanding of natural language, easily resulting in unclear key entities, such as ambiguous expressions like "my responsible area" or "recent data," leading to inaccurate query statements and ultimately obtaining datasets with irrelevant or missing key information. This not only wastes computational resources but also seriously affects the reliability of subsequent analysis results. Therefore, in some embodiments, when obtaining datasets related to data analysis tasks based on task requirements, semantic parsing of the user-input natural language task requirements can be performed to extract key entities. These key entities can include business objects, time ranges, business metrics, and areas of interest, thus obtaining a set of key entities. For semantically ambiguous key entities within the key entity set, such as user-identity-dependent phrases like "I am responsible for the city," the vaguely defined "high sales volume," or user-defined business metrics like "delivery success rate," semantic clarification can be achieved through various information sources. This transforms ambiguous expressions into clear and unique entity information; for example, "I am responsible for the city" can be transformed into "Beijing," and "high sales volume" can be defined as "single order amount exceeding 5000 yuan." Then, the semantically clarified key entity set can be input into a language model. The language model, combining the semantic relationships between entities and database query specifications, automatically generates a structured query statement containing filtering conditions and required core fields, ensuring that the query logic aligns with task requirements. Finally, the query statement is executed to retrieve the dataset directly related to the data analysis task from the database.

[0062] Semantic clarification can be achieved in several ways. For example, it can query a pre-built domain knowledge base and clarify the semantics of ambiguous entities based on the knowledge in the knowledge base. Alternatively, it can return a query to the user and clarify the semantics of ambiguous entities based on the user's answer. For example, after the user enters a task requirement, it can return, "The meaning of 'high-value order' in your input is unclear. Please clarify what a high-value order is." Alternatively, it can also clarify the semantics of ambiguous entities based on the user's permission configuration information.

[0063] In some embodiments, this method can be used to process data analysis tasks in on-demand delivery scenarios. The entities in the key entity set may include one or more of the following: the business object targeted by the data analysis task, the time range covered by the data analysis task, the business metrics to be analyzed by the data analysis task, the constraints involved in the data analysis task, spatial names, etc. These entities collectively represent the core requirements of the data analysis task. The business object can be riders, merchants, orders, etc. The time range is used to define the time boundary of the data analysis, such as the past year, Q3 2025, etc., ensuring that the time range of data acquisition accurately matches the task requirements. The spatial name is used to clarify the spatial scope of the data analysis, such as Beijing, Wangjing business district, etc., avoiding data deviation caused by ambiguous spatial scope. Business metrics are used to clarify the core content to be analyzed in the task, such as delivery success rate, order volume, average order value, etc., defining the core direction of the analysis. Constraint entities are used to further refine the analysis scope, such as "new riders," "severe weather," "high-value orders," etc., filtering out specific data that meets the task requirements.

[0064] By predefining the categories of key entities to be extracted, the semantic parsing process has a clear basis for extraction, avoiding problems such as chaotic entity extraction, omission of core information, or extraction of irrelevant entities.

[0065] In some embodiments, for semantically ambiguous target key entities in the key entity set, differentiated clarification methods can be adopted according to their type. For example, when the target key entity is a user identity-dependent entity that changes with user identity, it can be parsed into a specific and unique business object identifier by obtaining the permission configuration information of the user's login account. When the target key entity is a business indicator, the unified definition and calculation logic of the business indicator can be obtained by querying a pre-built business indicator knowledge base, and the required data table fields can be determined to ensure the accuracy of the business indicator's meaning. When the target key entity is a spatial name, the spatial name expressed in natural language can be mapped to a standard geospatial code or regional identifier based on a pre-built spatial entity knowledge base, achieving standardized matching of spatial names.

[0066] For example, if a user's task requirement is "Analyze the delivery success rate of riders in the Wangjing business district of the city I am responsible for over the past year," we can first parse out the key entity set from this task requirement: ["city I am responsible for," "over the past year," "rider," "Wangjing business district," "delivery success rate"]. Among these, "city I am responsible for," "Wangjing business district," and "delivery success rate" require semantic clarification. For "city I am responsible for," we can determine the user's permission configuration information based on their login account, i.e., the city they are responsible for, and thus clarify "city I am responsible for" as "Beijing." For "Wangjing business district," we can query a spatial knowledge base to map it to a standard regional identifier. For "delivery success rate," we can query a pre-built business metric knowledge base specifically for instant delivery scenarios to obtain its precise definition: "number of successfully delivered orders completed within the promised delivery time / total number of orders," as well as the data tables and fields required to calculate this metric. After semantic clarification, the language model can generate an SQL query statement containing "City = Beijing", "Time Range = Past Year", "Analysis Object = Rider", "Business District = Wangjing Business District", and "Core Indicator = Delivery Rate" based on the clarified key entity set. Finally, the query is executed to obtain a complete dataset related to the delivery rate of riders in the Wangjing Business District of Beijing over the past year.

[0067] To ensure that the task planning model inherits the analytical thinking of professional analysts and improves the accuracy of task decomposition, in some embodiments, multiple high-quality data analysis reports written by professional data analysts or data scientists can be obtained. These reports contain mature analytical frameworks, methods, reasoning logic, and business application scenarios, truly reflecting the analytical thinking of domain experts. Then, a language model can be guided by pre-designed prompts to perform in-depth analysis and knowledge mining on these professional reports, extracting multiple independent data analysis methods and further identifying the logical relationships between different methods, such as sequential dependencies, decomposition and combination relationships, and causal relationships. Simultaneously, the applicable scenarios for each data analysis method are determined, such as applicable data types (time series data, etc.) and task types. The extracted data analysis methods can be used as nodes, and logical relationships and applicable scenarios as edges to construct a structured, reusable, and reasonable knowledge graph. This construction method eliminates the need for manual compilation of complex rules, efficiently and scalably transforming tacit expert knowledge into explicit structured knowledge, providing reliable expert-level guidance for subsequent task planning, and making the analysis strategies generated by the data analysis platform more systematic, complete, and aligned with actual business needs. In addition, constructing knowledge graphs in this way can also improve the efficiency of knowledge graph updates and iterations and the ability to cover various scenarios.

[0068] In some embodiments, when determining a target analysis strategy from at least one analysis strategy, the user can select the target analysis strategy from the at least one analysis strategy based on their own experience. To facilitate user selection, the language model is also used to output the reasoning process text corresponding to each analysis strategy. This reasoning process text reflects the reasoning basis for the model to generate the analysis strategy, allowing the user to clearly understand the generation logic of the analysis strategy. Then, each analysis strategy and its corresponding reasoning process text can be displayed to the user so that the user can select the target strategy. After receiving the user's strategy selection instruction, the analysis strategy selected by the user can be used as the target analysis strategy.

[0069] In some embodiments, the target analysis strategy can be automatically selected by the system when determining it from at least one analysis strategy. For example, after generating at least one analysis strategy, a quality assessment model can be used to assess the quality of each analysis strategy to determine a quality score for each strategy, and then the analysis strategy with the highest quality score can be directly selected as the target analysis strategy. The quality assessment model can be a general language model or a specialized model that has been supervised and fine-tuned. For example, the language model can be given the ability to assess the quality of analysis strategies by configuring specific prompt words.

[0070] In some embodiments, such as Figure 4 As shown, when determining the target analysis strategy from at least one analysis strategy, a quality assessment model can also be used for at least one analysis strategy (e.g., Figure 4 The system performs quality assessments on analysis strategies 1 through n to determine a quality score for each strategy (as shown in Quality Score 1 through Quality Score n). Then, it displays each analysis strategy within at least one sub-strategy, along with its corresponding quality score, to the user. Based on the user's strategy selection instructions, the target analysis strategy is determined from at least one set of analysis strategies. In other words, this strategy selection method combines automated assessment with manual selection. First, the model obtains the quality score for each analysis strategy. Then, the quality score and analysis strategy are displayed to the user, who makes a selection based on a comprehensive consideration of the quality score and business experience.

[0071] By organically combining multiple strategy selection methods, it supports both fully automated and efficient processing as well as interpretable and interventionist human-machine collaborative modes. It can adapt to the usage habits and scenario needs of different users, improve the flexibility, credibility and practicality of analysis strategy selection, avoid the one-sidedness and black box problems caused by the system's single decision, and fully retain the user's control over the analysis process. This makes the final target analysis strategy more in line with the actual business scenario and the user's true intention, while taking into account both processing efficiency and decision accuracy.

[0072] In some embodiments, when evaluating the quality of analysis strategies, the quality score of each strategy can be determined by combining information from one or more of the following dimensions: the relevance of the analysis strategy to the task requirements, the support of the data in the dataset for the analysis strategy, and the historical performance of the analysis strategy. The relevance of the analysis strategy to the task requirements is used to determine whether the analysis strategy can directly and accurately respond to the user's analytical intent, and whether there is any deviation or redundancy. The support of the data in the dataset for the analysis strategy is used to determine whether the currently acquired data fields, data types, and data coverage are sufficient to fully execute the analysis strategy, and whether there are any missing or mismatched data. The historical performance of the analysis strategy is a comprehensive evaluation of the strategy's overall performance by combining information such as the success rate, analysis effect, and user satisfaction in similar historical tasks. Through the fusion and calculation of the above multi-dimensional information, a more comprehensive, objective, and reliable quality score can be obtained, rather than relying on a single indicator for a one-sided judgment. This can improve the accuracy and rationality of the analysis strategy quality evaluation and effectively select analysis strategies that are more suitable for the task.

[0073] In some embodiments, to ensure the finalized analysis strategy aligns with users' actual needs and enhances flexibility, a visualization and interactive adjustment process can be added after determining the target analysis strategy. For example, the target analysis strategy and its corresponding reasoning process text can be presented to the user first, allowing them to clearly understand the strategy's structure, execution path, and generation basis. Then, the user can submit strategy modification instructions, adjusting the target analysis strategy according to their actual business needs or professional experience. The adjustments can be to the analysis path or the final decomposed subtasks. If the user adjusts the analysis path, the data analysis task can be directly re-decomposed based on the adjusted path to obtain the final subtasks. For example, the user can adjust the order of nodes in the analysis path, add, delete, or modify nodes, and add or delete subtasks. Then, based on the adjusted target analysis strategy, a code generation model can be used to generate corresponding task code for each subtask and run it, ultimately obtaining the processing results of each subtask. By introducing a human-machine collaborative strategy confirmation and adjustment mechanism, the traditional black-box model of automated analysis can be broken, allowing users to deeply participate in and intervene in the analysis process. This improves the interpretability and controllability of the analysis strategy, ensuring that the final executed strategy is more in line with the user's true intentions and business scenarios. It effectively avoids analysis failures or unusable results caused by system strategy deviations, while enhancing users' trust in the entire data analysis process and their user experience.

[0074] In some embodiments, to ensure the accuracy of the processing results of each subtask, the processing results of each subtask can be verified. To improve verification efficiency and accuracy, a two-layer progressive verification scheme can be adopted. For example, layered verification can be performed on the processing results of each subtask. The first layer is basic runtime verification, verifying whether the task code can execute successfully, whether the results contain explicit errors such as null values, type mismatches, and missing data, and quickly filtering out unusable processing results. If the first layer of verification passes, the second layer, deep logic verification, is performed, which verifies whether the internal logic of the task code conforms to preset business rules, processing logic, etc. For example, for time-series data, it can verify whether there are abnormal breakpoints; for business metrics, it can verify whether the calculation methods are consistent; or it can verify whether the data processing logic of the code conforms to preset logic (e.g., whether it follows statistical logic). By performing deep logic verification on the code, the internal logic of the analysis results can be ensured to be correct.

[0075] This two-tiered, progressive verification scheme employs a layered design: first, it quickly filters explicit errors, and then it deeply verifies business and statistical logic. This design significantly improves verification efficiency and avoids invalid calculations at the first level, while at the second level, it accurately verifies business definitions, data logic, and statistical standards. This effectively balances verification efficiency and accuracy, identifying not only surface-level issues like code malfunctions but also deeper defects such as logical errors and inconsistencies in definitions that allow for normal execution. This comprehensively ensures the accuracy and reliability of the results from each subtask, providing solid and reliable data support for generating high-quality analysis reports.

[0076] In some embodiments, when performing second-level logical verification on the processing results, to avoid failing to detect business logic errors due to a lack of domain-specific rules, a domain verification rule set can be pre-built. This rule set can then be used to verify the internal logic of the task code. For example, after the processing results pass the first-level runtime verification, based on the core objectives of the task requirements and the data type of the data associated with the subtask (such as time-series data, structured data, spatial data, etc.), one or more verification rules most relevant to the current subtask can be automatically matched from the pre-built verification rule set. These verification rules integrate the business experience and analytical logic of domain experts. For instance, for the subtask of "delivery success rate calculation," the verification rules would explicitly require the code to include "comparison logic between promised delivery time and actual delivery time" and "filtering conditions for valid orders." Then, based on these matched verification rules, the execution logic, data processing flow, and indicator calculation logic of the task code can be verified to determine whether there are deviations or errors in the code regarding business logic, data processing flow, and indicator definitions. The second level of verification described above moves logic validation beyond the code syntax level and delves into the core aspects of business logic and data processing. It can effectively identify issues such as data that is executable but contains logical errors or analysis that deviates from business objectives, ensuring the business correctness and analytical value of the final analysis results and improving the quality and reliability of data analysis tasks.

[0077] In related technologies, after automatically generated task code verification fails, the process typically involves only a simple retry or sending a prompt to the user for intervention. This lack of an intelligent, iterative correction mechanism leads to frequent analysis task failures and low efficiency. Therefore, some embodiments provide an automated code closed-loop correction scheme based on verification feedback, such as… Figure 5As shown, when the processing result of each subtask fails verification, a prompt word can be constructed based on the current code to be corrected for that subtask, combined with relevant information about the subtask (i.e., task requirements, data types, etc.) and verification feedback information, i.e., detailed indication of the specific reasons for failure (such as "missing time series stationarity verification steps" or "indicator calculation fields mismatch"), and input into the code generation model. The model is then guided to analyze the root cause of the error based on the prompt word and determine the direction of correction, automatically generating the corrected code. The corrected code can then be re-executed through the complete verification process. If the corrected code still fails verification, and the number of corrections has not yet reached the preset limit, the code correction operation is resumed, entering the next round of the "generate-verify-correct" loop until the processing result passes verification or the maximum number of corrections is reached. This solution achieves an intelligent closed-loop iteration from error feedback to code optimization. Each correction is precisely optimized for a specific problem, avoiding the resource consumption caused by blind retries, improving the efficiency and success rate of code correction, and enabling the data analysis platform to have self-diagnosis and self-evolution capabilities, effectively ensuring the smooth completion of complex data analysis tasks.

[0078] In some embodiments, considering that task code may fail verification even after multiple rounds of automatic correction, user intervention can be allowed to assist in task completion. For example, if the number of corrections reaches a preset number and the processing result corresponding to the corrected code still fails verification, a correction card is displayed to the user. This correction card includes the current task code for the subtask, the task requirements, and verification feedback information. The user can locate the root cause of the error in the task code based on the information in the correction card and then correct the task code. The system can receive code modification instructions from the user, adjust the task code based on the instructions, and run the adjusted task code to obtain the processing result of the subtask. By organically combining fully automatic intelligent correction with expert human intervention, a complete anomaly handling closed loop is formed. This fully leverages the efficiency of automated correction while leveraging human expertise to overcome bottlenecks in complex error scenarios, effectively preventing unexpected task interruptions, improving the stability and fault tolerance of the data analysis platform, and enhancing human-machine collaboration capabilities to ensure the smooth completion of data analysis tasks in various complex scenarios.

[0079] In some embodiments, the correction card carries a card link, which a user can copy and forward to other users. After receiving the card link, other users can click on the card link to enter the task code correction page. This page can display the current task code, task requirements, and verification feedback information of the subtask. Other users can directly modify and debug the task code on this page.

[0080] In some embodiments, to enable the code generation model to continuously optimize and improve performance during data analysis tasks, a model self-learning and continuous optimization mechanism can be introduced. This involves constructing sample pairs using erroneous task code generated by the code generation model and user-adjusted task code. These sample pairs can then be used for supervised fine-tuning of the code generation model and / or targeted optimization of the prompt word templates used by the model. This allows the model to directly learn and reuse the professional logic and processing experience gained from the manual corrections during subsequent code generation and correction of similar sub-tasks. By collecting typical cases from the task processing process as samples, the model can continuously accumulate business knowledge and expert experience, constantly reducing the recurrence of similar errors, improving the accuracy, first-time success rate, and business adaptability of code generation, and enabling the entire data analysis platform to continuously evolve.

[0081] In related technologies, after obtaining the task requirements, the dataset related to the data analysis task is often directly acquired, and task code is generated and run. However, in actual task processing, there are many scenarios where analysis may fail or the analysis results may be invalid due to insufficient data, missing fields, or insufficient dimensions in the dataset, wasting a lot of computing resources and time. To avoid the above problems, in some embodiments, after obtaining the dataset based on the task requirements and before executing task decomposition and code generation, a pre-processing data support capability judgment step can be added. For example, based on the data conditions required by the task requirements, it can be checked whether the currently acquired dataset can meet the analysis requirements, such as whether the fields are complete, the coverage, the data volume, and the granularity meet the analysis requirements, and whether it can effectively support the complete execution of the data analysis task. If it is determined that it cannot support the task, for example, due to missing core fields, incomplete time range, or missing spatial data, a prompt message is immediately issued to the user, informing them of the specific reasons for the insufficient data and the missing content. By proactively preventing analysis failures, logical errors, or invalid calculations caused by unmet data requirements from the outset, unnecessary resource consumption such as task breakdown, code generation, and verification and correction can be avoided. At the same time, users can quickly identify problems with the source data and supplement or adjust it in a timely manner, which greatly improves the efficiency, stability, and user experience of the overall data analysis process.

[0082] The above task processing method will be further explained below with a specific example.

[0083] Taking a data analysis task in the on-demand delivery sector as an example, a Beijing city manager of a food delivery platform wants to gain a deeper understanding of the order fulfillment performance of riders in several core business districts within their assigned city and to predict future trends. They can input their data analysis task requirements in natural language through the data analysis platform's front-end interface: "Comprehensively analyze and predict the order delivery rate of riders in my assigned city over the past year, focusing on the Wangjing and Dawanglu business districts, and identify the key factors contributing to the sluggish growth in delivery rate." The data analysis platform can perform the following steps to automatically output analysis results: (1) Entity extraction and clarification After obtaining the above task requirements, the data analysis platform can perform entity recognition on the task requirement text and extract key entities: ["I am responsible for the city", "Past year", "Rider", "Wangjing business district", "Delivery success rate", "Dawanglu business district", "Factors of weak growth"].

[0084] Clarifying "I am responsible for the city": The data analysis platform identified "I am responsible for the city" as a vague entity that needs to be clarified in conjunction with the user's identity. Therefore, it can query the permission system associated with the manager account to confirm that the city he is responsible for is "Beijing".

[0085] Clarifying the definition of the indicator: The data analysis platform has identified "order delivery success rate" as a key business indicator. You can query the business indicator knowledge base to obtain its precise definition: "number of successfully delivered orders completed within the promised delivery time / total number of orders", as well as the data table and fields required to calculate this indicator.

[0086] Clarifying the names of the business districts: The data analysis platform queries the spatial entity knowledge base to obtain the precise spatial entity names corresponding to "Wangjing Business District" and "Dawanglu Business District".

[0087] (2) Automatic SQL generation and data retrieval Based on all the clarified information, the data analytics platform automatically generates a complex SQL query statement. This statement includes the time range (past year), city filter (Beijing), spatial entity filter (business districts: Wangjing, Dawanglu), and the required core fields. The data analytics platform executes this SQL, pulling the necessary data directly from the data warehouse into the analytics environment.

[0088] (3) Qualitative data analysis Data analysis platforms can perform qualitative analysis on the acquired datasets and identify the data types of each data item (such as time series data, spatial data, etc.).

[0089] (4) Task breakdown The task decomposition process is designed as a dynamic process that integrates expert knowledge inheritance and human-machine collaborative decision-making. It includes core steps such as knowledge internalization, generation of multiple analysis strategies and interactive decision-making, and task graph generation.

[0090] Step 1: Internalizing Expert Knowledge (Offline Learning) During the construction and continuous optimization of the data analytics platform, a dedicated module is responsible for offline "learning" from a large number of real-world analytical reports written by professional business analysts and data scientists. This process aims to internalize the analytical thinking, insight patterns, and narrative logic of human experts into knowledge that the data analytics platform can access.

[0091] The data analysis platform can parse these reports, extract key data analysis methods, as well as the logical relationships between these methods and their applicable scenarios (such as applicable task types, data types, etc.).

[0092] For example, it will learn: When conducting "attribution analysis", a commonly used framework is to drill down layer by layer from "macro-meta-micro".

[0093] When analyzing user behavior, the "AARRR model" (Acquisition, Activation, Retention, Revenue, Referral) is a classic framework.

[0094] When comparing two entities, we should not only compare the "results" but also the "processes" and "efficiencies".

[0095] Data analytics platforms can construct knowledge graphs of analytical approaches. These extracted data analysis solutions are built into a structured knowledge graph. The nodes of the graph are data analysis methods (such as "trend analysis" and "user profiling"), and the edges are the logical relationships and applicable scenarios between them. This knowledge graph becomes the "second brain" for the data analytics platform's planning, enabling it to think in a way that resembles that of human experts.

[0096] Step 2: Generating Multiple Analysis Strategies Once the user inputs their task requirements, the data analysis platform no longer mechanically applies a fixed analytical approach, but instead initiates a divergent and convergent thinking process based on a "knowledge graph".

[0097] The data analytics platform combines user-input task requirements ("attribution of declining delivery rate"), data types ("time series, geospatial"), and knowledge graphs to generate multi-dimensional and diverse analysis strategies, and outputs the reasoning process text for each strategy.

[0098] The data analytics platform evaluates the quality of the generated analytics strategies and provides a recommended ranking. The evaluation criteria include the following dimensions: Relevance to the question: Can this approach answer the user's core question most directly? Insight into potential: Has this approach historically yielded any high-value, non-obvious insights? Data feasibility: Is the currently available data sufficient to support a complete analysis of this approach? Step 3: Interactive Decision-Making and Confirmation Data analytics platforms can present the generated analytics strategies to users in a clear and interactive way.

[0099] For example, such as Figure 6 As shown, a card will pop up on the front-end interface, displaying to the city manager: "Regarding your issue, I have devised the following analysis strategies. Please confirm or select one:" Strategy 1: Macro-Micro Drill-Down Analysis (Recommended) Strategy Two: Multi-dimensional Factor Decomposition Analysis Strategy 3: Spatiotemporal Anomaly Detection and Analysis Additionally, the following interactive controls will be displayed: [Confirm Use of Recommended Strategy], [Select Other Strategy], [Customize or Modify Strategy] User decision-making: Default / Quick Path: If users trust the data analysis platform, they can directly click [Confirm Use of Recommended Strategy].

[0100] Expert guidance: If a manager has his own specific ideas, he can choose a strategy that he is more interested in, or even fine-tune a strategy (for example, adding a dimension that he thinks is important, "whether it is a new rider") to strategy two.

[0101] Step 4: Task Graph Generation Once the user confirms the analysis strategy, the central controller precisely parses the selected strategy into a specific, dependent task graph (DAG). For example, if the user selects strategy one, the system will generate a series of dependent sub-task nodes, such as "calculate the citywide trend," "calculate the Wangjing trend," "calculate the Dawanglu trend," and "draw a three-line comparison chart."

[0102] (5) Task code generation and execution Based on the task graph, the data analysis platform intelligently schedules the parallel and serial execution of tasks according to whether there are dependencies between subtasks in the task. For each subtask, the data analysis platform "compiles" it into high-precision task code and executes it in a controlled sandbox.

[0103] (6) Verification of processing results After execution, the process enters the verification phase, which employs a two-level progressive verification strategy and can include the following two levels of verification.

[0104] (a) First-level verification: Verify whether the code can be executed and quickly filter out obvious errors such as empty results, type errors, and blank images.

[0105] (b) Second-level verification: If the first-level verification passes, the data analysis platform switches to the role of "logic arbitrator". At this time, it not only performs general logical consistency arbitration, but also determines the verification rules that match the current subtask from the verification rule set based on the task requirements and the data types of the data to be used, and verifies the logic of the task code based on the verification rules.

[0106] Scenario Example 1: If the data is determined to be time series data, the system will automatically check whether there are obvious breakpoints or trend anomalies in the results.

[0107] Scenario Example 2: Suppose a subtask is "building a delivery success rate prediction model". During validation, the data analysis platform calls `TimeSeries_Validation_Rules.json`. When it detects that the generated model is an ARIMA model, the rule set triggers a rule requiring the platform to check if the code includes a step to perform differencing on the time series data to ensure stationarity. If this crucial domain operation is missing, even if the code runs, the platform will still determine validation failure, citing "Logical error: The time series prediction model was built without performing necessary stationarity checks, violating basic statistical principles." (7) Automatic correction of task code (a) Self-dialogue-based correction: When validation fails, the data analytics platform performs a self-dialogue-based correction. This process repeats until success is achieved or a preset automatic retry limit (e.g., 3 times) is reached. For example, in the case of "no stationarity test performed," the data analytics platform, acting as a "diagnostic repair engine," initiates a self-dialogue-based correction. It reasones: "The logic arbitrator indicates a lack of stationarity testing. I should insert a step before model training to perform the test using statsmodels.tsa.stattools.adfuller and determine whether differencing the sequence is necessary based on the p-value." The data analytics platform then generates the corrected code and automatically retrys.

[0108] (b) Human-machine collaborative correction: If the automated correction fails after reaching the limit, the data analysis platform will pause and trigger the human-machine collaborative correction process.

[0109] The data analytics platform pushes an interactive correction card to the user, displaying the task objective, failure code, and the platform's diagnostic opinion: "The model repeatedly reports errors when processing geographic coordinate transformations, and we suspect that the parameters of the to_crs function are set incorrectly." The platform requests the user's intervention to make changes.

[0110] Human expert intervention: Users can either do it themselves or share the card link with their team's data scientists. After expert intervention, the code in the card is modified, and then the user clicks "Submit".

[0111] Adoption and Learning: The data analysis platform adopts the corrected code to complete the task. Simultaneously, the "failure code output by the data analysis platform after adjusting the task code using the aforementioned code modification instructions - expert-corrected code" is marked as a sample pair and sent to the meta-learning module.

[0112] (8) Meta-learning The data analytics platform continuously runs a meta-learning loop in the background, enabling long-term self-evolution.

[0113] (a) Sample collection: Automatically record all samples generated in each PEVA loop closure (successful code, corrected code, user-corrected code).

[0114] (b) System self-optimization: The system automatically performs optimization tasks periodically or after collecting sufficient samples. This includes: The model is fine-tuned using collected positive and negative samples to improve its original code generation and correction capabilities. Analyze common failure modes and automatically optimize the prompt word templates used to generate code or fix instructions.

[0115] (9) Analysis report generation After all subtasks have been validated, the data analysis platform integrates all valid intermediate results and analytical insights to generate a logically coherent and professionally written final analysis report for the user.

[0116] Corresponding to the memory allocation method embodiments provided in this specification, this specification also provides a computer program product, including a computer program that, when executed by a processor, implements the method mentioned in any of the above embodiments.

[0117] This description also provides an electronic device, such as... Figure 7 The diagram shown is a structural schematic of an electronic device according to an embodiment of this specification, except... Figure 7In addition to the processor 72 and memory 74 shown, the device may also include other hardware, such as a forwarding device responsible for processing messages; from a hardware structure perspective, the device may also be a distributed device, possibly including multiple interface cards to extend message processing at the hardware level. The memory 74 stores computer instructions, and when the processor 72 executes the computer instructions, it implements the methods mentioned in any of the above embodiments.

[0118] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. The collection, use and processing of the relevant data shall comply with relevant laws, regulations and standards, and corresponding operation entry points shall be provided for users to choose to authorize or refuse.

[0119] Since the parts of the embodiments in this specification that contribute to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, the computer software product is stored in a storage medium and includes several instructions to cause a terminal device to execute all or part of the steps of the methods in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0120] The above description is merely a preferred embodiment of the embodiments of this specification and is not intended to limit the embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this specification should be included within the scope of protection of the embodiments of this specification.

Claims

1. A task processing method for processing data analysis tasks, the method comprising: The task requirements are obtained in natural language form from user input, and a pre-constructed knowledge graph is also obtained. Each node in the knowledge graph represents a data analysis method, and the edges between nodes are used to represent the logical relationship between data analysis methods and / or applicable scenarios. Each data analysis method defines the processing logic for processing data. Based on the task requirements, obtain the dataset related to the data analysis task, and determine the data type of each data item in the dataset; Using a task planning model, at least one analysis strategy is output based on the task requirements, the data type, and the knowledge graph. Each analysis strategy includes an analysis path consisting of multiple nodes in the knowledge graph, and multiple sub-tasks obtained by decomposing the data analysis task based on the data analysis methods represented by each node in the analysis path. Determine the target analysis strategy from the at least one analysis strategy; The code generation model is used to generate the task code for each of the multiple sub-tasks in the target analysis strategy and run them to obtain the processing results of each of the multiple sub-tasks. If the processing results of each of the multiple subtasks are verified, the processing results of the multiple subtasks are integrated to generate an analysis report for the data analysis task, which is then returned to the user.

2. The method according to claim 1, wherein obtaining the dataset related to the data analysis task based on the task requirements includes: Semantic parsing is performed on the task requirements to extract a set of key entities from them; Semantic clarification is performed on semantically ambiguous target key entities in the aforementioned key entity set; Generate query statements based on a semantically clarified set of key entities using a language model; Execute the query statement to retrieve the dataset related to the data analysis task from the database.

3. The method according to claim 2, wherein the method is used to process data analysis tasks in an on-demand delivery scenario, and the entities in the key entity set include one or more of the following: The business objects targeted by the data analysis task, the time range covered by the data analysis task, the business indicators to be analyzed by the data analysis task, the constraints involved in the data analysis task, and the space name.

4. The method according to claim 2 or 3, wherein semantic clarification is performed on semantically ambiguous target key entities in the key entity set, comprising: If the target key entity changes with the user's identity, then the user's permission configuration information is determined based on the user's login account, and the target key entity is parsed into a specific business object identifier based on the permission configuration information; If the target key entity is a business indicator, then the definition and calculation logic of the business indicator are queried from the pre-built business indicator knowledge base, and the data table fields required to calculate the business indicator are determined based on the definition and calculation logic. If the target key entity is a spatial name, then based on a pre-built spatial entity knowledge base, the spatial name is mapped to a standard geospatial code or regional identifier.

5. The method according to claim 1, wherein the knowledge graph is constructed based on the following method: Obtain multiple professional data analysis reports; The knowledge graph is constructed by using pre-built prompt words to guide the language model to extract multiple data analysis methods from the data analysis report, and extracting the logical relationships and applicable scenarios between the data analysis methods.

6. The method according to claim 1, wherein determining a target analysis strategy from the at least one analysis strategy comprises: The analysis strategies in the at least one analysis strategy, as well as the text of the reasoning process corresponding to each analysis strategy, are displayed to the user; The target analysis strategy is determined from the at least one analysis strategy based on the user's strategy selection instruction, wherein the reasoning process text corresponding to each analysis strategy is output by the task planning model; or The quality assessment model is used to evaluate the quality of at least one analytical strategy to determine a quality score for each analytical strategy, and the analytical strategy with the highest quality score is selected as the target analytical strategy; or The quality assessment model is used to evaluate the quality of the at least one analysis strategy to determine the quality score of each analysis strategy. The analysis strategies in the at least one sub-strategy and the corresponding quality scores of each analysis strategy are displayed to the user. The target analysis strategy is determined from the at least one analysis strategy based on the user's strategy selection instruction.

7. The method of claim 6, wherein the quality score for each analytical strategy is determined based on information from one or more of the following dimensions: The relevance of the analysis strategy to the task requirements, the support of the data in the dataset for the analysis strategy, and the historical performance of the analysis strategy.

8. The method according to claim 1, further comprising, after determining the target analysis strategy from the at least one analysis strategy: The target analysis strategy and the corresponding reasoning process text are displayed to the user, wherein the reasoning process text is output by the task planning model; Receive the user's strategy modification instruction, and adjust the target analysis strategy based on the strategy modification instruction; The process of generating task code for each of the multiple sub-tasks in the target analysis strategy using a code generation model and running it to obtain the processing results of each of the multiple sub-tasks includes: The code generation model is used to generate task codes for each of the multiple subtasks in the adjusted target analysis strategy and run them to obtain the processing results of each of the multiple subtasks.

9. The method according to claim 1, wherein the processing result of each subtask is verified in the following manner: The processing result is subjected to a first-level verification, which is used to verify whether the task code can run and whether there are obvious errors in the running result of the task code. If the processing result passes the first level of verification, the processing result is then subjected to a second level of verification, which is used to verify whether there are any logical errors in the task code.

10. The method according to claim 9, wherein the processing result is subjected to a second-level verification, comprising: Based on the task requirements and the data type of the data related to the subtask, the verification rules matching the subtask are obtained from the pre-built verification rule set. The task code is logically validated based on the validation rules.