Task processing method and electronic equipment
By using an AI-driven chart generation method, user intent is identified and professional visualization charts are generated, solving the problem of low chart generation efficiency in team competition data analysis and realizing a fast and automated chart production process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-03-17
AI Technical Summary
In practical scenarios such as tactical analysis, participant evaluation, and match review in team sports like football, existing technologies suffer from low efficiency in chart creation and generation, and high professional barriers, making it difficult for users to quickly respond to dynamic analysis needs.
Using an AI-based approach, the system identifies user intent and domain knowledge through a first model to determine the target chart type, and then uses a second model to generate rendering code, ultimately outputting a visual chart that meets the user's needs.
It achieves automated conversion from user natural language requirements to professional visual charts, reducing production difficulty, improving generation efficiency, and supporting rapid response to dynamic analysis needs.
Smart Images

Figure CN121681663A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of AI (Artificial Intelligence) driven data visualization and interaction technology, and in particular to a task processing method and an electronic device. Background Technology
[0002] In practical scenarios such as tactical analysis, participant evaluation, and match review in team sports like football, it is often necessary to create various professional charts for data observation or analysis in order to improve the team's competitive level, optimize decision-making, or avoid repeating mistakes.
[0003] In real-world applications, coaches, scouts, and data analysts often face core pain points such as high technical barriers, low efficiency in chart creation and generation, and high complexity. How to solve the complexity and professional barriers in data analysis scenarios such as team events, from user needs to the generation of visual charts, and improve the efficiency of chart creation / generation, has become a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0004] Therefore, this application discloses the following technical solution:
[0005] A task processing method, comprising:
[0006] The task requirement is to obtain instructions to generate a chart;
[0007] The task data upon which the aforementioned task requirements are determined;
[0008] Based on the task data, the target chart type required for the task requirements is determined using the first model;
[0009] Based on the target chart type and at least a portion of the data in the task data, target rendering code for the target visualization chart is generated through a second model; the target visualization chart is a visualization chart of the target chart type that meets the task requirements.
[0010] Rendering is performed based on the target rendering code to output the target visualization chart.
[0011] Optionally, the task requirements are task requirements for motion events or events that meet the association conditions with motion events in a motion analysis scenario.
[0012] Optionally, the task data upon which the task requirements are determined includes:
[0013] The target event data and target domain knowledge must be used to determine the task requirements.
[0014] Optionally, the task requirements include user questions instructing the generation of a chart;
[0015] The target event data and target domain knowledge upon which the task requirements are determined need to be based include:
[0016] The user question is converted into a structured query language statement, and the event database is queried based on the structured query language statement to obtain the target event data;
[0017] Identify the target intent represented by the user question, and query the target domain knowledge that matches the target intent from the domain knowledge base of the domain to which the user question belongs.
[0018] Optionally, based on the task data, the target chart type required for the task requirements is determined using a first model, including:
[0019] Feature extraction is performed on the task requirements, the target event data, and the target domain knowledge respectively to obtain target data features; the target data features include a first data feature of the task requirements, a second data feature of the target event data, and a third data feature of the target domain knowledge;
[0020] The target data features are input into the first model to obtain the target chart type required for the task based on the input information determined by the first model.
[0021] Optionally, the task processing method further includes:
[0022] Obtain feedback information;
[0023] In response to the feedback indicating that the target chart type does not meet the requirements, the target chart type is adjusted, and the recommendation strategy of the first model is optimized based on the feedback.
[0024] Optionally, based on the target chart type and at least a portion of the data in the task data, target rendering code for generating the target visualization chart is generated through a second model, including:
[0025] The task requirements, the target chart type, and the target event data are input into the second model to obtain the target rendering code generated by the second model based on the input information.
[0026] Optionally, the task processing method further includes, before rendering based on the target rendering code:
[0027] At least a portion of the event data in the target event data is injected into the corresponding data variables in the target rendering code to obtain the data-injected target rendering code, and rendering is performed based on the data-injected target rendering code.
[0028] Optionally, before rendering based on the target rendering code, at least one of the following is also included:
[0029] Perform syntax validation on the target rendering code;
[0030] The resource path of the target rendering code is corrected;
[0031] The target rendering code is subjected to security filtering to remove potentially dangerous code that meets the target conditions; the target conditions indicate that the code has security risks.
[0032] Rendering error detection is performed on the target rendering code.
[0033] An electronic device, comprising:
[0034] Memory, used to store at least one set of computer instructions;
[0035] A processor is configured to perform the following processing by executing the instruction set stored in the memory:
[0036] The task requirement is to obtain instructions to generate a chart;
[0037] Determine the task data required to meet the aforementioned task requirements;
[0038] Based on the task data, the target chart type required for the task requirements is determined using the first model;
[0039] Based on the target chart type and at least a portion of the data in the task data, target rendering code for the target visualization chart is generated through a second model; the target visualization chart is a visualization chart of the target chart type that meets the task requirements.
[0040] Rendering is performed based on the target rendering code to output the target visualization chart.
[0041] A storage medium carrying one or more computer instruction sets, which, when executed by an electronic device, enable the electronic device to perform any of the task processing methods provided above. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0043] Figure 1This is a flowchart illustrating one of the task processing methods provided in this application;
[0044] Figure 2 This is an example of automated chart generation provided in this application;
[0045] Figure 3 This is another flowchart illustrating the task processing method provided in this application;
[0046] Figure 4 This is a structural diagram of the electronic device provided in this application. Detailed Implementation
[0047] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0048] This application provides a task processing method and an electronic device to address the complexity and professional barriers in data analysis scenarios, from user needs to the generation of visual charts, and to improve the efficiency of chart creation / generation. The provided task processing method can be applied to electronic devices in numerous general-purpose or dedicated computing environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor devices, etc.
[0049] See Figure 1 The flowchart shown illustrates the task processing method provided in this application embodiment, which may include the following steps 101 to 105, which are described in detail below.
[0050] Step 101: Obtain the task requirements for generating the chart.
[0051] The data analysis scenarios applicable to this application may include, but are not limited to, motion analysis scenarios.
[0052] Optionally, the task requirements are task requirements for motion events or events that meet the association conditions with motion events in a motion analysis scenario.
[0053] Sports events can include, but are not limited to, sports events involved in various team sports such as football and basketball games, such as athletes passing, running, sprinting, and contact. Events that meet the correlation criteria with sports events can include, but are not limited to, events related to sports events that occur before, after, or during the sports event, such as the schedule, tactical arrangements, and player injury / risk events in team sports like football.
[0054] Optionally, the task requirements include user questions instructing the generation of a chart.
[0055] User questions can be input by users in natural language based on their actual analytical needs in a motion analysis scenario. Specifically, user questions can be input via text and / or voice input, but are not limited to these methods. The input user questions are used to instruct the automated generation of charts that meet the user's specified requirements. For example, a user might input a question in natural language such as: "Please show the key passing routes of a certain athlete in the first half of a certain match."
[0056] Step 102: Determine the task data upon which the task requirements are based.
[0057] Optionally, the target event data and target domain knowledge on which the task requirements need to be based can be determined, and the determined target event data and target domain knowledge can be used as the task data.
[0058] Among them, the target event data is used to provide the event data that needs to be based on to generate the target visualization chart (the chart that meets the user's task requirements), thereby providing data support for generating the required chart.
[0059] Optionally, determining the target event data upon which the task requirements should be based can be achieved by: converting user questions into SQL (Structured Query Language) query statements, querying the event database based on the converted SQL query statements to obtain the corresponding SQL query structure set, and using the SQL query result set as the target event data.
[0060] The event database includes event information of motion events or events that meet the association conditions with motion events, and records the actual data information of various events (motion events or events that meet the association conditions with motion events) that need to be analyzed in the motion analysis scenario.
[0061] In implementation, but not limited to, LLM (Large Language Model) can be used to convert user questions into SQL query statements. Then, based on the SQL query statements, queries are performed in the event database to obtain target event data that matches the SQL query statements. Taking ball sports scenarios such as football as an example, the target event data may include, but is not limited to, the field names, data types, value ranges, and / or sample values of the corresponding events related to entities such as players, teams, events, indicators, and time granularity in the SQL query statements.
[0062] The target domain knowledge upon which the task requirements are determined can be implemented, but is not limited to: identifying the target intent represented by the user's question, and querying the target domain knowledge that matches the target intent from the domain knowledge base of the domain to which the user's question belongs.
[0063] Domain knowledge databases may include, but are not limited to, structured terminology dictionaries, indicator logic knowledge bases, and / or entity relationship graphs.
[0064] The structured terminology dictionary is used to collect information such as standard names, common aliases, abbreviations, and / or multilingual synonyms for entities within the domain. For example, a football domain dictionary can be pre-built to cover entities such as players, teams, events, tactical actions, and stadium areas, to collect the standard names, common aliases, abbreviations, and multilingual synonyms for these entities.
[0065] The indicator logic knowledge base is used to define the calculation formulas, data source fields, and business logic (such as the business logic of the indicator, the business logic of the fields involved in the indicator, and the business logic of the indicator calculation process) for domain indicators, to ensure the consistency between indicator semantics and calculation. For example, it defines the calculation formulas, data source fields, and business logic (such as "xG = SUM(shot_xg_value)") for commonly used football data analysis indicators (such as "expected goals xG", "key passes", and "pressing success rate").
[0066] The fields involved in an indicator refer to the fields on which the indicator value is based. An indicator can involve one or more fields, and the indicator can be the field itself or the value obtained after performing corresponding operations on the field (one or more). There is no restriction on this, and it can be determined according to actual needs.
[0067] Entity relationship graphs are responsible for establishing association rules between entities, such as "player-team" and "event-participating teams," to support relation-based semantic feature expansion.
[0068] In implementation, the Transformer model or LLM can be used, but is not limited to, to identify the intent of user questions, thereby obtaining the intent represented by the user question. Then, queries can be performed on the corresponding domain knowledge database based on the user intent. For example, LLM can be used to extract key intents of user questions (such as "comparison," "distribution," "trend," "relationship," "flow"), and based on this intent information, a locally built football terminology dictionary and indicator logic knowledge base can be queried to obtain corresponding semantic tags, synonyms, calculation formulas, etc.
[0069] The Transformer model can be used to identify user intent. Its core is to capture contextual semantics through a self-attention mechanism and combine the contextual semantics to determine the user intent.
[0070] In implementation, optionally, after obtaining user questions, the user questions can first undergo basic cleaning, including but not limited to preprocessing such as removing special characters and standardizing capitalization, to improve data usability and facilitate subsequent efficient and accurate data processing (such as querying target event data and target domain knowledge based on user questions). Additionally, optionally, the SQL query result set, i.e., the target event data, can be sampled and cached for subsequent modules to quickly read and improve processing efficiency.
[0071] The sampling can refer to collecting a portion of the query result data of each type in the SQL query result set and caching it. The purpose is to reduce the processing workload and improve decision-making efficiency when the first model makes a decision to determine the target chart type by using the sampled data for subsequent chart type decisions.
[0072] Step 103: Based on the task data, determine the target chart type required for the task requirements using the first model.
[0073] After obtaining task data containing target event data and target domain knowledge, feature extraction can be performed on the task requirements, the target event data, and the target domain knowledge respectively to obtain target data features; the target data features include the first data features of the task requirements, the second data features of the target event data, and the third data features of the target domain knowledge.
[0074] Subsequently, the target data features can be further input into the first model, which will then perform inference based on the input target data features to determine the target chart type required for the task.
[0075] Optionally, large models such as LLM can be used to extract semantic features from user questions, such as key intents like "comparison," "distribution," "trend," "relationship," and / or "flow," and generate vector representations (such as embeddings) of the extracted semantic features. These vector representations of the semantic features are then used as the first data features of the task requirements.
[0076] For the target event data, metadata can be extracted from the SQL query result set, including but not limited to field names and field data types (numeric, categorical, dimensional, and temporal), and this extracted metadata information can be used as the second data feature of the target event data. It's easy to understand that if sampling was performed on the SQL query result set previously, only the metadata of the sampled data in the SQL query result set can be extracted, and this metadata information can be used as the second data feature of the target event data.
[0077] After matching the target domain knowledge corresponding to the user's question from the domain knowledge base, the target domain knowledge can be vectorized through vectorization processing to obtain the vector information of the target domain knowledge (the semantic features of the target domain knowledge), and this vector information can be used as the third data feature of the target domain knowledge.
[0078] After obtaining the first data features of task requirements, the second data features of target event data, and the third data features of target domain knowledge through multi-dimensional feature extraction, the various data features can optionally be concatenated into a semantic feature package in a unified format for subsequent parsing and chart decision-making by the first model.
[0079] The unified format may be, but is not limited to, JSON (JavaScript Object Notation) format.
[0080] Then, in conjunction with the above, see Figure 2 The automated chart generation example shown can input a semantic feature package, including multi-dimensional features (the three types of features mentioned above, such as semantic features of user questions, metadata of SQL query result sets, and target domain knowledge vectors), into the first model. The first model then makes a joint decision based on the input semantic feature package. Among the multi-feature input, the metadata of the SQL query result set forms the data driver for the first model, while the other features, such as the semantic features of user questions and the semantic features of target domain knowledge, form the intent driver for the first model. Thus, the first model combines the two drivers to make a joint decision and finally determines the chart type that matches the user intent and data structure. This chart type is the target chart type required by the task.
[0081] In other words, this application constructs a chart type classification method based on multi-feature input. This classification method integrates the metadata (data-driven) of the SQL query result set with semantic features (intent-driven) extracted from user questions and target domain knowledge. Through joint decision-making of the first model, it achieves the adaptation of chart type selection to user intent and data structure. For example, in the joint decision-making, if the user intent in intent-driven analysis involves "passing," the data-driven approach formed by combining the corresponding metadata / domain knowledge features may recommend a "passing network diagram"; if the user intent involves "shooting position," the data-driven approach formed by combining the corresponding metadata / domain knowledge features may recommend a "shooting distribution diagram (scatter plot)"; if the user intent involves "player activity area," the data-driven approach formed by combining the corresponding metadata / domain knowledge features may recommend a "heatmap."
[0082] Optionally, the first model can be a lightweight classification model, specifically, but not limited to, a small-scale DNN (Deep Neural Network) model. Its input can be a semantic feature package including the above-mentioned multi-dimensional features, and its output is a target chart type adapted to the user intent and the corresponding data structure.
[0083] In practical applications, the output of the first model may include, but is not limited to, the degree of suggestion or confidence level of various optional chart types. The higher the degree of suggestion or confidence level, the higher the fit between the chart type and the user intent and the corresponding data structure. Subsequently, the chart type that meets the conditions can be selected from the output of the first model (e.g., the chart type with the highest degree of suggestion / confidence level) as the target chart type required by the task requirements.
[0084] Step 104: Based on the target chart type and at least a portion of the data in the task data, generate target rendering code for the target visualization chart using the second model; the target visualization chart is a visualization chart of the target chart type that meets the task requirements.
[0085] The second model is a generative model that can be used to generate rendering code, specifically, but not limited to, large models such as LLM.
[0086] Optionally, the task requirements, target chart type, and target event data can be input into the second model, which will then generate the target rendering code for the target visualization chart of the target chart type based on the task requirements and target event data in the input information.
[0087] For example, taking a large model such as an LLM as the second model, a structured prompt can be constructed. This prompt can include the aforementioned task requirements, target chart type, and target event data, as well as a description of the requirements for the large model, such as "Based on the provided data, please provide the rendering code for generating a visualization chart of the target chart type." Then, the constructed prompt is input into the large model to obtain the target rendering code for the target visualization chart generated by the large model.
[0088] In practical applications, optionally, if necessary, the target domain knowledge mentioned above can also be output to the large model or other second models to provide the necessary auxiliary / reference information for generating target rendering code for the large model or other second models.
[0089] The core function of target rendering code is to transform abstract data, instructions, or code structures into target visualization charts that users can directly perceive or interact with.
[0090] In one possible implementation, the second model can directly embed the target event data and / or data calculated based on the target event data (such as relevant indicator values) into the target rendering code, making the target rendering code the final executable code that carries the target event data and / or data calculated based on the target event data. Subsequently, the target visualization chart can be output by running the target rendering code.
[0091] However, this is not the only possibility. In other possible implementations, the generation of rendering code for the second model can also incorporate variable design. Variables (or examples) can be used to represent at least a portion of the target event data and / or the data calculated based on the target event data. For example, corresponding data variables can be used to represent structured event data such as full-field shooting data, simplifying the rendering code generation logic and improving generation efficiency. In this implementation, after obtaining the target rendering code output by the second model, the portion of the target event data and / or the data calculated based on the target event data corresponding to the data variables, such as structured event data like full-field shooting data, can be dynamically injected into the data variable portion of the target rendering code (replacing the example data) to obtain complete, executable rendering code. Subsequently, the target visualization chart can be output by running the data-injected rendering code.
[0092] Step 105: Render the target based on the target rendering code to output the target visualization chart.
[0093] Based on step 104, the chart can be output by running the target rendering code, so as to output a chart that adapts to the user's intent and conforms to the corresponding data structure.
[0094] In practical scenarios such as tactical analysis, participant evaluation, and match review in team sports like football, when users need to create various professional charts for data observation or analysis, the traditional approach requires users to fully understand data structures, indicator logic, and visualization design principles, manually select chart types, and configure parameters. This is inefficient, has a high barrier to entry, and makes it difficult to quickly respond to dynamic analysis needs. Especially in team sports like football, where data dimensions are complex (such as player movement, passing networks, and shooting hot zones), the creation of professional charts (such as shooting xG charts, passing network diagrams, and tactical formation diagrams) often requires a combination of domain knowledge and visualization skills, further increasing the difficulty of use.
[0095] To address the problems of traditional technologies, the task processing method provided in this application introduces a first model and a second model to collaboratively process tasks, achieving an integrated, end-to-end intelligent solution capable of understanding user natural language intent, automatically adapting to data characteristics in motion analysis scenarios, and generating professional visualization charts. Specifically, the first model uses intelligent decision-making based on user-inputted task requirements and task data determined according to those requirements, adapting the chart type to the user's intent and data structure to determine the target chart type that meets the user's task requirements. Based on this, the second model generates target rendering code for the target visualization chart of the target chart type, and then renders the target visualization chart based on the generated target rendering code.
[0096] Therefore, this application solves the complexity and professional barriers in data analysis scenarios such as team competitions, from user needs to the generation of visual charts. It can improve the efficiency of chart production / generation, reduce the difficulty of use for users, support users to input instructions in natural language to generate charts, and generate and output the required type of structured charts with one click.
[0097] In an alternative embodiment, see reference Figure 2 The task processing method provided in this application may further include at least one of the following processing methods for ad before rendering based on the target rendering code:
[0098] a. Perform syntax validation on the target rendering code.
[0099] Lightweight parsers can be used, but are not limited to, to detect the syntactic validity of the target rendering code. For example, lightweight parsers such as BeautifulSoup or Esprima can be used to check the syntactic validity of the HTML / JS (Hyper TextMarkup Language / JavaScript) rendering code output by the second model.
[0100] b. Correct the resource path of the target rendering code.
[0101] It can perform correctness checks on resource paths such as external library paths and / or local library paths referenced in the target rendering code, and correct any erroneous resource paths detected, such as correcting incorrect links to referenced external libraries (e.g., ECharts CDN) or replacing them with local deployment paths, to ensure the validity of resource paths.
[0102] c. Perform security filtering on the target rendering code to remove potentially dangerous code that meets the target conditions; the target conditions indicate that the code has security risks.
[0103] The target conditions may be set as follows, but are not limited to: the operation, object, and / or logic represented by the current code to be detected belongs to a dangerous operation / object / logic listed in the blacklist, or the operation, object, and / or logic represented by the current code to be detected does not belong to a predefined standard operation / object / logic.
[0104] In this step, based on the set target conditions, the target rendering code can be filtered for security and potentially dangerous code can be removed. For example, eval(), inline event handlers onclick=, etc. can be removed, allowing only standard DOM (Document Object Model) operations and chart rendering logic.
[0105] d. Perform rendering error detection on the target rendering code.
[0106] Optionally, based on preset verification rules (such as coordinate boundary checks and chart element integrity checks), rendering error detection can be performed on the target rendering code (such as the initial target rendering code output by the second model, or the target rendering code after data injection, or the target rendering code after one or more of the above-mentioned AC processing) to identify whether there are rendering errors in the target rendering code, such as coordinate mapping deviations, uneven color mapping, etc., and if a rendering error is identified, a feedback prompt can be constructed, such as "In the above code, the y coordinate is not correctly mapped to the longitudinal direction of the field. Please correct it: y=0 should correspond to the bottom of the field, and y=100 should correspond to the top of the field". Subsequently, the target rendering code can be corrected by calling the second model such as LLM again based on the feedback prompt until the target rendering code passes the preset verification rules.
[0107] In practice, this can be achieved, but is not limited to, by encapsulating relevant target event data from sports scenarios such as football and chart type requirements into personalized prompts containing data samples and format constraints. These prompts can then be input into large models such as LLM to drive the models to directly generate chart rendering code. After automatic data injection, syntax validation and security filtering, and resource path detection are performed on the rendering code, plug-and-play visualization chart files are output, thus achieving zero-code automatic conversion from natural language requirements to interactive charts.
[0108] This embodiment can perform multi-dimensional detection or correction processing on the target rendering code, such as syntax verification, resource path correction, security filtering, and rendering error detection, to ensure the usability and security of the target rendering code. This provides support for the subsequent output of effective visualization charts based on the target rendering code, making it easier to efficiently, accurately, and securely output visualization charts that meet the user's intent and corresponding data structure.
[0109] In an alternative embodiment, see Figure 3 The task processing method flowchart shown in this application may further include the following processing steps:
[0110] Step 106: Obtain feedback information.
[0111] The feedback information can be triggered by the user performing corresponding operations on the output target visualization chart. For example, the user can switch the chart type, or the user can select an option to indicate satisfaction or dissatisfaction with the current chart generation result in the relevant survey information (such as "Are you satisfied with the currently generated chart"), etc.
[0112] Step 107: In response to the feedback information indicating that the target chart type does not meet the requirements, adjust the target chart type and optimize the recommendation strategy of the first model based on the feedback information.
[0113] If the feedback information indicates that the target chart type does not meet the user's needs, such as when the user switches chart types or selects an option indicating dissatisfaction with the current chart generation result, the target chart type can be adjusted, and the target visualization chart output to the user can be adjusted accordingly to meet the user's needs.
[0114] If the user specifies an icon type in the feedback information, the current target icon type can be adjusted to the user-specified icon type; conversely, if the user does not specify an icon type, the current target icon type can be adjusted to another icon type other than the target icon type among the top_k icon types with the highest suggestion level / confidence in the first model output results. For example, the current target icon type can be adjusted to the icon type with the second highest suggestion level / confidence in the model output results.
[0115] Where 1 < k < n, k and n are integers, and n represents the number of selectable chart types in the output of the first model.
[0116] In addition to adjusting the chart type, alternatively, a reinforcement learning (RL) framework can be introduced to optimize the performance of the first model. This framework uses user feedback as a feedback signal to continuously optimize the recommendation / decision strategy of the first model, thereby improving its decision accuracy and making it more and more in line with user preferences.
[0117] Based on this embodiment, when the automatically generated charts do not meet user needs, the chart type can be adjusted in real time based on user feedback to ensure user satisfaction and quickly respond to dynamic analysis requirements. Furthermore, the recommendation / decision-making strategies of the first model can be continuously optimized using user feedback based on frameworks such as reinforcement learning, thereby further improving the accuracy of automated chart generation.
[0118] This application also discloses an electronic device, the composition and structure of which are as follows: Figure 4 As shown, it includes at least:
[0119] Memory 10 is used to store the computer instruction set;
[0120] Computer instruction sets can be implemented in the form of computer programs.
[0121] The processor 20 is configured to implement the task processing method provided in any of the above method embodiments by executing a set of computer instructions in the memory.
[0122] The processor 20 can be a central processing unit (CPU), a graphics processor, an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a neural network processor (NPU), a deep learning processor (DPU), or other programmable logic devices.
[0123] Optionally, the electronic device may also include a display device capable of outputting and displaying glasses-free 3D images.
[0124] Optionally, electronic devices may also include storage resources such as memory and cache.
[0125] Optionally, the electronic device may also include an image acquisition device.
[0126] In addition to these components, electronic devices may also include communication interfaces, communication buses, and other parts. Memory, processor, and communication interface communicate with each other through the communication bus.
[0127] Communication interfaces are used for communication between electronic devices and other devices. Communication buses can be Peripheral Component Interconnect (PCI) buses or Extended Industry Standard Architecture (EISA) buses, and can be categorized into address buses, data buses, control buses, etc.
[0128] This application also discloses a storage medium carrying one or more computer instruction sets, which, when executed by an electronic device, enable the electronic device to implement the task processing method provided in any of the above method embodiments.
[0129] In summary, the solution provided in this application has at least the following technical advantages compared to traditional technologies:
[0130] 1. By synchronously capturing three types of heterogeneous information—"the intent entity of the user's question, the structural statistics (metadata) of the SQL query results, and the terminology-indicators-rules of the knowledge base"—it is possible to inject multi-dimensional features such as text keywords, numerical distribution, field lineage, spatiotemporal dimensions, synonyms, and calculation formulas into a unified feature package at once. This covers the diversity of semantics, syntax, and data, providing rich input information for chart decision-making while ensuring the accuracy of domain applications.
[0131] 2. It innovatively integrates multi-dimensional features (data features, semantic features, and domain features) and adopts a combination of lightweight classification models and reinforcement learning for visualization decision-making, so that the chart recommendation can simultaneously match user intent, data structure and domain scenario, and has continuous optimization capabilities.
[0132] 3. Relying on the parameterized template library and LLM-driven automatic code generation mechanism, it realizes automatic and secure mapping and rendering from structured data to professional visualization charts, which greatly improves analysis efficiency and ensures the domain standardization and usability of the output results.
[0133] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0134] For ease of description, the above systems or devices are described separately as various modules or units based on their functions. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware components.
[0135] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence or the part that makes a creative contribution, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0136] Finally, it should be noted that in this document, relational terms such as first, second, third, and fourth are used to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0137] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A task processing method, comprising: obtaining a task requirement indicating to generate a chart; determining task data on which the task requirement is based; determining, by a first model, a target chart type required by the task requirement according to the task data; generating, by a second model, target rendering code of a target visual chart according to at least part of the target chart type and the task data; the target visual chart being a visual chart of the target chart type meeting the task requirement; rendering based on the target rendering code to output the target visual chart.
2. The task processing method of claim 1, wherein the task requirement is a task requirement in a sports analysis scenario for a sports event or an event meeting a correlation condition with the sports event.
3. The task processing method of claim 1, wherein determining the task data on which the task requirement is based comprises: determining target event data and target domain knowledge on which the task requirement is based.
4. The task processing method of claim 3, wherein the task requirement comprises a user question indicating to generate a chart; determining the target event data and the target domain knowledge on which the task requirement is based comprises: converting the user question into a structured query language statement, querying an event database based on the structured query language statement to obtain the target event data; and identifying a target intent represented by the user question, and querying a domain knowledge base of a domain to which the user question belongs to obtain target domain knowledge matching the target intent.
5. The task processing method of claim 3, wherein determining, by the first model, the target chart type required by the task requirement according to the task data comprises: respectively extracting features of the task requirement, the target event data, and the target domain knowledge to obtain target data features; the target data features comprising first data features of the task requirement, second data features of the target event data, and third data features of the target domain knowledge; inputting the target data features into the first model to obtain the target chart type required by the task requirement determined by the first model based on the input information.
6. The task processing method of claim 5, further comprising: obtaining feedback information; in response to the feedback information representing that the target chart type does not meet the requirement, adjusting the target chart type, and optimizing a recommendation strategy of the first model based on the feedback information.
7. The task processing method of claim 3, wherein generating, by the second model, the target rendering code of the target visual chart according to at least part of the target chart type and the task data comprises: inputting the task requirement, the target chart type, and the target event data into the second model to obtain the target rendering code generated by the second model based on the input information.
8. The task processing method of claim 3 or 7, further comprising, before rendering based on the target rendering code: Inject at least part of the event data in the target event data into a corresponding data variable in the target rendering code to obtain target rendering code after data injection, so as to perform rendering based on the target rendering code after data injection.
9. The task processing method of claim 1, before performing rendering based on the target rendering code, further comprising at least one of the following: performing syntax verification on the target rendering code; performing resource path correction on the target rendering code; security filtering the target rendering code to remove potentially dangerous code that satisfies a target condition; the target condition representation code has a security risk; performing rendering error detection on the target rendering code.
10. An electronic device, comprising: a memory for storing at least a set of computer instructions; a processor for implementing the following processing by executing the set of instructions stored in the memory: obtaining a task requirement indicating generation of a chart; determining task data required to be based on to meet the task requirement; determining a target chart type required by the task requirement according to the task data through a first model; generating target rendering code of a target visual chart according to at least part of the target chart type and the task data through a second model; the target visual chart is a visual chart of the target chart type meeting the task requirement; performing rendering based on the target rendering code to output the target visual chart.