Data analysis method and device based on artificial intelligence, and electronic equipment
Through artificial intelligence and multi-agent collaborative data analysis methods, user needs are automatically processed, database query statements are generated and optimized, which solves the complex and time-consuming problems of traditional data analysis methods and realizes efficient, intuitive data display and user-friendly interaction.
Patent Information
- Application Number
- CN202510732159.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-09-12
AI Technical Summary
Traditional data analysis methods are complex and time-consuming, resulting in low efficiency in data analysis and presentation, and making it difficult to adapt to rapidly changing business needs.
It adopts an artificial intelligence-based data analysis method, through the collaboration of pre-trained target models and intelligent agent sets, automatically processes user demand information, generates and corrects database query statements, and optimizes data display styles. It combines the front-end page feedback mechanism to realize the automation and precision of data analysis.
It realizes the automation and precision of data analysis, simplifies the data query process, improves the intuitiveness and user-friendliness of data display, adapts to rapidly changing business needs, and improves data analysis efficiency and display effects.
Smart Images

Figure CN120631918A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an artificial intelligence-based data analysis method and device, and electronic equipment. Background Art
[0002] In the digital age, the amount of data generated by civil aviation companies is exploding. This data, sourced from flight operations, customer interactions, market trends, and other aspects, contains crucial information for business decision-making. However, with this surge in data volume, extracting valuable insights from it quickly and accurately has become crucial for enhancing corporate competitiveness.
[0003] Traditional data analysis methods or BI systems typically rely on professional data analysts who use query languages like SQL to extract information from data warehouses and then present it through reports or dashboards. This process is not only time-consuming but also requires a high technical threshold, limiting the widespread and immediate availability of data analysis. Furthermore, fixed report development processes struggle to adapt to rapidly changing business needs, hindering the timeliness and flexibility of decision-making. While flexible, BI systems can be expensive to build and difficult to use.
[0004] In the existing technology, there is a technical problem that the big data analysis method process is too complicated and time-consuming, resulting in low efficiency of data analysis and display.
[0005] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0006] The embodiments of the present invention provide an artificial intelligence-based data analysis method, device, and electronic device to at least solve the technical problem in related technologies that big data analysis methods are too complex and time-consuming, resulting in low efficiency in data analysis and display.
[0007] According to one aspect of an embodiment of the present invention, there is provided a data analysis method based on artificial intelligence, which includes: receiving user demand information, and calling a pre-trained target model and a set of intelligent agents linked to the target model, wherein the intelligent agent set integrates at least: a main intelligent agent and a style sorting intelligent agent; inputting the user demand information into the main intelligent agent, and the main intelligent agent retrieves the table structure knowledge base to obtain data structure information, wherein the data structure information is used to indicate the target data range that the user is concerned about; inputting the user demand information and the data structure information into the target model, and outputting a database query statement; querying the system database based on the database query statement to obtain a query result, wherein the query result is used to record the target data in the target data range; inputting the query result and the user demand information into the style sorting intelligent agent, and the style sorting intelligent agent sorts the display style of the target data, uses the sorting result as the data analysis result, and displays the data analysis result on the front-end page.
[0008] Furthermore, the step of receiving user demand information also includes: obtaining user action information transmitted by the front end, wherein the user action information records the user's operation actions and operation action information on the page controls on the front end page; analyzing the operation actions and operation action information recorded in the user action information to obtain the user demand information.
[0009] Furthermore, the agent set also integrates: an intention recognition agent.
[0010] Furthermore, after receiving user demand information and calling the pre-trained target model and the set of intelligent agents linked to the target model, it also includes: inputting the user demand information into the intention recognition intelligent agent, outputting the nature of the user's question, wherein the nature of the user's question includes: chat nature and data query nature; when the nature of the user's question is chat nature, inputting the user demand information into the target model, outputting the model reply statement, and displaying the model reply statement on the front-end page; or, when the nature of the user's question is data query nature, executing the step of inputting the user demand information into the main intelligent agent.
[0011] Furthermore, the agent set also integrates: an error checking agent.
[0012] Furthermore, after inputting the user demand information and the data structure information into the target model and outputting the database query statement, it also includes: inputting the database query statement into the error checking agent and outputting the inspection result; when the inspection result indicates that it is correct, executing the step of querying the system database based on the database query statement; or, when the inspection result indicates that it is incorrect, correcting the database query statement based on the inspection result and the error checking agent; when the corrected database query statement is checked to be correct, executing the step of querying the system database based on the database query statement.
[0013] Furthermore, the step of querying the system database based on the database query statement also includes: when feedback is given during the query process that the database query statement is executed abnormally, obtaining an abnormal record, interrupting the query step, and recording the interruption point; inputting the abnormal record and the database query statement into the error checking intelligent agent, outputting the abnormal analysis result and the number of abnormal analysis; when the number of abnormal analysis is less than or equal to a preset threshold, correcting the database query statement based on the abnormal analysis result, and injecting the corrected database query statement into the interruption point, and continuing to execute the query step; or, when the number of abnormal analysis is greater than the preset threshold, feeding back the abnormal analysis result to the front-end page, ending the query step, and deleting the interruption point.
[0014] Furthermore, the agent set also integrates: a graphic selection agent.
[0015] Furthermore, after the query results and the user demand information are input into the style organization intelligent agent and the data analysis results are output, it also includes: inputting the data analysis results and the user demand information into the graphic selection intelligent agent, and the graphic selection intelligent agent determines the data display graphic desired by the user based on the user demand information; generating a preview image based on the data display graphic and the data analysis results, and displaying the preview image on the front-end page.
[0016] Furthermore, after displaying the preview image on the front-end page, it also includes: receiving user feedback information on the preview image transmitted by the front-end; when the feedback information indicates that the user is dissatisfied, analyzing the feedback information to obtain a graphic modification strategy, wherein the graphic modification strategy includes any one of the following: graphic type modification, chart style modification; inputting the graphic modification strategy and the preview image into the graphic selection agent, and outputting the modified preview image; until the feedback information transmitted by the front-end indicates that the user is satisfied, determining the preview image as a data display image, and displaying the data display image on the front-end page.
[0017] According to another aspect of an embodiment of the present invention, there is also provided a data analysis device based on artificial intelligence, which includes: a receiving unit for receiving user demand information, and calling a pre-trained target model and a set of intelligent agents linked to the target model, wherein the intelligent agent set at least integrates: a main intelligent agent and a style sorting intelligent agent; a first input unit for inputting the user demand information into the main intelligent agent, and the main intelligent agent retrieves the table structure knowledge base to obtain data structure information, wherein the data structure information is used to indicate the target data range that the user is concerned about; a second input unit for inputting the user demand information and the data structure information into the target model, and outputting a database query statement; a query unit for querying from the system database based on the database query statement to obtain a query result, wherein the query result is used to record the target data in the target data range; a display unit for inputting the query result and the user demand information into the style sorting intelligent agent, and the style sorting intelligent agent sorts the display style of the target data, uses the sorting result as the data analysis result, and displays the data analysis result on the front-end page.
[0018] Furthermore, the receiving unit includes: a first acquisition module, used to obtain user action information transmitted by the front end, wherein the user action information records the user's operation actions and operation action information on the page controls on the front-end page; a first analysis module, used to analyze the operation actions and operation action information recorded in the user action information to obtain the user demand information.
[0019] Furthermore, the agent set also integrates: an intention recognition agent.
[0020] Furthermore, the artificial intelligence-based data analysis device also includes: a first input module, which is used to input the user demand information into the intention recognition agent after receiving the user demand information and calling the pre-trained target model and the set of intelligent agents linked to the target model, and output the nature of the user's question, wherein the nature of the user's question includes: chat nature and data query nature; a second input module, which is used to input the user demand information into the target model when the nature of the user's question is chat nature, output the model reply statement, and display the model reply statement on the front-end page; a first execution module, which is used to execute the step of inputting the user demand information into the main intelligent agent when the nature of the user's question is data query nature.
[0021] Furthermore, the agent set also integrates: an error checking agent.
[0022] Furthermore, the artificial intelligence-based data analysis device also includes: a third input module, which is used to input the user demand information and the data structure information into the target model and output the database query statement, and then input the database query statement into the error checking agent to output the inspection result; a second execution module, which is used to execute the step of querying the system database based on the database query statement when the inspection result indicates that it is correct; a first correction module, which is used to correct the database query statement based on the inspection result and the error checking agent when the inspection result indicates that it is incorrect; and a third execution module, which is used to execute the step of querying the system database based on the database query statement when the corrected database query statement is checked to be correct.
[0023] Furthermore, the query unit includes: a second acquisition module, which is used to obtain an exception record, interrupt the query step, and record the interruption point when feedback is given that the database query statement is executed abnormally during the query process; a fourth input module, which is used to input the exception record and the database query statement into the error checking intelligent body, and output the exception analysis result and the number of exception analyses; a second correction module, which is used to correct the database query statement based on the exception analysis result when the number of exception analyses is less than or equal to a preset threshold, and inject the corrected database query statement into the interruption point to continue executing the query step; a feedback module, which is used to feedback the exception analysis result to the front-end page when the number of exception analyses is greater than the preset threshold, and end the query step and delete the interruption point.
[0024] Furthermore, the agent set also integrates: a graphic selection agent.
[0025] Furthermore, the artificial intelligence-based data analysis device also includes: a fifth input module, used to input the query results and the user demand information into the style organization agent, and after outputting the data analysis results, input the data analysis results and the user demand information into the graphic selection agent, and the graphic selection agent determines the data display graphic desired by the user based on the user demand information; a display module, used to generate a preview image based on the data display graphic and the data analysis results, and display the preview image on the front-end page.
[0026] Furthermore, the artificial intelligence-based data analysis device also includes: a receiving module, which is used to receive user feedback information on the preview image transmitted by the front end after the preview image is displayed on the front end page; a second analysis module, which is used to analyze the feedback information and obtain a graphic modification strategy when the feedback information indicates that the user is dissatisfied, wherein the graphic modification strategy includes any one of the following: graphic type modification, chart style modification; a sixth input module, which is used to input the graphic modification strategy and the preview image into the graphic selection agent and output the modified preview image; a determination module, which is used to determine the preview image as a data display image and display the data display image on the front end page until the feedback information transmitted by the front end indicates that the user is satisfied.
[0027] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned artificial intelligence-based data analysis methods.
[0028] According to another aspect of an embodiment of the present invention, an electronic device is also provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned artificial intelligence-based data analysis methods.
[0029] In the present invention, a data analysis method based on artificial intelligence is proposed, which first receives user demand information, and calls a pre-trained target model and an intelligent agent set linked to the target model, wherein the intelligent agent set integrates at least: a main intelligent agent and a style sorting intelligent agent, and then inputs the user demand information into the main intelligent agent, and the main intelligent agent retrieves the table structure knowledge base to obtain data structure information, wherein the data structure information is used to indicate the target data range that the user cares about, and then inputs the user demand information and the data structure information into the target model, outputs a database query statement, and then queries the system database based on the database query statement to obtain a query result, wherein the query result is used to record the target data in the target data range, and finally inputs the query result and the user demand information into the style sorting intelligent agent, and the style sorting intelligent agent sorts the display style of the target data, uses the sorting result as the data analysis result, and displays the data analysis result on the front-end page.
[0030] In the present invention, the method of integrating artificial intelligence and multi-agent collaboration is adopted. By integrating pre-trained target models and intention recognition, main agents, error checking, style organization and graphic selection agent sets, the purpose of automated and precise data analysis and chart generation is achieved, thereby realizing the technical effects of improving the efficiency of big data analysis, simplifying the data query process, and enhancing the intuitiveness of data display and user interaction friendliness. Specifically, the present invention breaks through the limitations of traditional data analysis and no longer relies on manually written complex SQL query statements. Instead, it allows users to express query requirements in natural language, and with the help of the intelligent parsing and processing capabilities of AI models and agent sets, quickly Generate and correct database query statements to ensure the accuracy and security of data acquisition; at the same time, the graphic selection agent automatically selects the best chart display method according to data characteristics and user preferences, and cooperates with the style organization agent to optimize the display style, which greatly improves the readability and aesthetics of data display; in addition, the present invention allows users to directly participate in the evaluation and adjustment of data display effects through the intuitive display and user feedback mechanism of the front-end page until a satisfactory display effect is achieved, thereby achieving a high degree of customization and humanization of data analysis, and thus solving the technical problem that the big data analysis method process in related technologies is too complicated and time-consuming, resulting in low efficiency of data analysis and display. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0032] Figure 1 is a structural diagram of an optional integrated multi-agent intelligent chart system according to an embodiment of the present invention;
[0033] Figure 2 is a flow chart of an optional artificial intelligence-based data analysis method according to an embodiment of the present invention;
[0034] Figure 3 is a schematic diagram of an optional artificial intelligence-based data analysis device according to an embodiment of the present invention;
[0035] Figure 4 This is a hardware structure block diagram of an electronic device (or mobile device) that executes an artificial intelligence-based data analysis method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0037] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0038] The following embodiments of the present invention can be applied to various systems / applications / devices that require natural language-based big data analysis and intelligent chart display, enabling efficient, intelligent, and customized data query and visualization capabilities. The present invention uses a large language model (LLM) to intelligently identify user query intent and generate database query statements. Then, through a multi-agent collaboration mechanism, including error checking, data style organization, and graphic selection, it can better optimize query efficiency, enhance the intuitiveness of data display, and meet the personalized needs of users.
[0039] The core of this invention is to use artificial intelligence technology and multi-agent collaboration to achieve fast, accurate analysis and intuitive display of big data. It is particularly suitable for scenarios that require frequent data analysis and have high requirements for data visualization, such as business intelligence (BI) systems and enterprise operation monitoring platforms, thereby providing users with a smoother and more efficient data analysis experience.
[0040] The present invention will be described in detail below with reference to various embodiments.
[0041] Example 1
[0042] According to an embodiment of the present invention, an embodiment of a data analysis method based on artificial intelligence is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0043] The present invention is implemented as follows Figure 2 The artificial intelligence-based data analysis method shown in the figure is implemented by an intelligent chart display system, which combines large models and multi-agent collaboration technology and is used in data analysis and visualization display scenarios, especially to solve the problems of complex data query and chart customization for non-professional users. Through the dynamic scheduling of the agent set and the optimization of data processing algorithms, the specific steps are as follows: the user inputs the natural language query requirements through the front-end page, and the application layer calls the intent recognition agent in the agent set to determine the type of requirement after receiving it. The main agent generates an SQL statement for the request of the nature of the data query, the error checking agent ensures that the SQL statement is correct, the style organization agent and the graphic selection agent respectively process the data display style and graphic selection, and finally the processed data and charts are displayed on the front-end page to achieve the purpose of lowering the threshold for data analysis, improving the efficiency of data query and chart display, and enhancing the user experience.
[0044] Figure 1 is a structural diagram of an optional integrated multi-agent intelligent chart system according to an embodiment of the present invention, such as Figure 1 As shown in the figure, the system consists of a front-end module, an application layer, and an agent platform layer. The front-end module allows users to interact with the system through the front-end interface, including entering query requirements, viewing query results, and displaying charts. The application layer is responsible for processing user requests, invoking agents, and querying the database. This layer can be privately deployed to ensure data security. The agent platform layer is the core of the system, with multiple agents collaborating, each performing their own tasks based on prompts. This layer maintains a knowledge base of database table structures, and actual data queries are completed through the application layer to ensure data security.
[0045] Figure 2 is a flow chart of an optional artificial intelligence-based data analysis method according to an embodiment of the present invention, such as Figure 2 As shown, the method includes the following steps:
[0046] Step S201, receiving user demand information, and calling a pre-trained target model and an agent set linked to the target model, wherein the agent set at least integrates: a main agent and a style arrangement agent.
[0047] It should be noted that user demand information refers to specific requirements for data query and display, expressed by users in natural language or SQL query form. In the present invention, user demand information can include data queries related to flight operations, customer behavior, market analysis, and other fields, or it can also be a requirement for the display format of query results, such as a desire to display data in the form of a bar chart, line chart, or pie chart.
[0048] The target model is a large language model (LLM) pre-trained on a large dataset. It possesses the ability to deeply understand natural language queries and generate complex SQL statements. After receiving user request information, the target model parses the query intent and generates preliminary database query statements. It is the core component of the agent collection, responsible for information transmission and coordination between agents.
[0049] An agent ensemble is a system composed of a series of agents with specific functions, built based on a target model. While the agent ensemble includes at least a master agent and a style curation agent, in actual applications it may also include intent recognition agents, error checking agents, and graphic selection agents, working together to complete the entire process from data query to result presentation. Each agent has its own independent task, but through linkage with the target model, they work seamlessly together, improving the efficiency and accuracy of data processing.
[0050] The master agent is responsible for receiving user request information and generating SQL query statements by searching the table structure knowledge base. During the generation process, the master agent leverages the powerful understanding capabilities of the target model to ensure that the SQL statements accurately reflect the user's query intent. If the generated SQL statement encounters problems during execution, the master agent collaborates with the error-checking agent to correct them, ensuring smooth data query execution.
[0051] The Style Organizer agent specializes in processing and optimizing the data display style. After receiving the results from a database query, the Style Organizer agent formats the data according to the front-end display specifications, performing various processing steps, including data sorting, field selection, and data structure conversion, to ensure a clear and intuitive presentation to the user. Furthermore, the Style Organizer agent is responsible for matching the organized data with the display templates generated by the Graphics Selection agent, further enhancing the visual quality of the data display and the user experience.
[0052] Through the collaboration of target models and a collection of agents, this invention enables intelligent parsing of complex user needs, effectively generating and modifying SQL queries, and optimizing data display styles and chart selection, thereby providing efficient, accurate, and user-friendly data analysis services. Dynamic scheduling of agents and optimized data processing algorithms enable the system to provide users with a personalized data query and chart display experience while ensuring data security and privacy.
[0053] Furthermore, the step of receiving user demand information also includes: obtaining user action information transmitted by the front end, wherein the user action information records the user's operation actions and operation action information on the page controls on the front end page; analyzing the operation actions and operation action information recorded in the user action information to obtain user demand information.
[0054] In one specific embodiment, during the user interaction phase of the intelligent chart display system, in addition to directly receiving text queries or SQL statements entered by users, it is also necessary to capture and analyze various user actions and their specific information on page controls on the front-end page. User action information covers all user interaction records with the system, including but not limited to click events, sliding adjustments, option selections, chart zooming, etc.
[0055] For example, a user might click the "Time Filter" button on the front-end page and select "This Year" as the time range, and then zoom in on the "Air Ticket Sales" chart to view detailed sales data for each month in more detail.
[0056] After receiving user action information, the system backend conducts a detailed analysis to identify the user's specific requirements for data query and display. This involves the collaboration of multiple agents, some of which are specifically responsible for parsing user action information and converting it into a parameter format that can be understood by the target model. For example, if the user selects a time range and data type, the agent will parse this information and pass it as parameters to the subsequent data query process, ensuring that the system can accurately locate and analyze the data of interest to the user.
[0057] By capturing and analyzing user action information, the intelligent chart display system can more accurately understand user query needs and provide more personalized and refined data analysis services. The system can dynamically respond to different user interaction behaviors and adjust data query and display strategies in real time, improving the convenience of data query and the flexibility of data display, enhancing the user experience and user-friendliness of the system, so that data analysis is no longer limited to professionals. Even users with non-technical backgrounds can easily complete complex data query and visualization needs through simple control operations.
[0058] In step S202, user demand information is input into the main agent, and the main agent retrieves the table structure knowledge base to obtain data structure information, wherein the data structure information is used to indicate the target data range that the user is concerned about.
[0059] It's important to note that the table structure knowledge base is a key component of the agent platform layer. It contains structural information about all available data tables, including field names, types, and relationships. Vectorized conversion facilitates rapid retrieval and comprehension by the main agent and large models, ensuring accurate and efficient data queries.
[0060] When the main agent receives user request information, it searches the table structure knowledge base for relevant information to understand the user's query intent and the specific data tables or fields that need to be accessed. This data structure information provides the basis for subsequent SQL statement generation, ensuring that the query instruction accurately targets the data range of interest to the user.
[0061] Based on the data structure, the master agent can identify specific datasets or data segments of interest to the user, which are the query objects implicit in the user's request information. This clear definition of the target data scope helps reduce unnecessary data processing burden, ensures the relevance and practicality of query results, and also helps protect data privacy and security.
[0062] Furthermore, the agent collection also integrates: intent recognition agent.
[0063] Furthermore, after receiving user demand information and calling the pre-trained target model and the set of intelligent agents linked to the target model, it also includes: inputting the user demand information into the intention recognition intelligent agent, outputting the nature of the user's question, wherein the nature of the user's question includes: chat nature and data query nature; when the nature of the user's question is chat nature, inputting the user demand information into the target model, outputting the model reply statement, and displaying the model reply statement on the front-end page; or, when the nature of the user's question is data query nature, executing the step of inputting the user demand information into the main intelligent agent.
[0064] In a specific embodiment, the intent recognition agent is a key component of the agent set. Its main task is to quickly determine the nature of the user's question when the system receives the user's demand information, that is, to distinguish whether the user is seeking to chat or make specific data query requirements.
[0065] If the question is casual, meaning the user is likely seeking non-data-related information or chat services, the agent will skip the complex data processing process. Conversely, if the question is data query, the agent will trigger the subsequent data query and chart display process. For example, a user asking "What's the weather like today?" would be identified as casual, while a question like "Please show me the flight delays for each month of the past year" would be identified as a data query.
[0066] Once the system determines that a user's question is chatty in nature, it directly inputs the user's request information into the target model and generates an appropriate model response based on the model's natural language generation capabilities, without requiring any data query or analysis. The model response is then displayed on the front-end page, satisfying the user's chat needs. For example, for the question "What's the weather like today?", the system will call upon the target model to generate a response similar to "Today's weather is sunny and perfect for outdoor activities."
[0067] When a user's question is identified as a data query, the system follows the previously described process, entering the user's requested information into the main agent. The main agent then retrieves the data structure information, generates SQL query statements, executes the database query, retrieves the query results, and displays the data analysis results on the front-end page through the Style Organizer and Graphics Selection Agents.
[0068] The embodiment of this invention introduces an intent recognition agent that intelligently distinguishes user needs, avoiding unnecessary data queries when processing casual inquiries. This reduces the system's computational burden, improves response speed, and improves resource utilization. This design also enhances the system's user-friendliness, ensuring that users receive prompt and tailored responses, whether seeking casual chat services or conducting data queries.
[0069] Step S203: input user demand information and data structure information into the target model, and output database query statements.
[0070] Specifically, SQL (Structured Query Language) is a standardized language used to manage and operate relational databases. In the present invention, SQL query statements are intelligently generated by the target model based on the user's query requirements and the structure of the data tables. These statements can accurately describe the data the user wants to retrieve from the database, including the fields and tables, as well as possible join and filter conditions.
[0071] For example, if the user requirement is "list the monthly ticket sales this year", the target model will generate a SQL statement similar to the following:
[0072] SELECT MONTH(date)AS month,COUNT(ticket_id)AS ticket_sales
[0073] FROM sales
[0074] WHERE YEAR(date)=CURRENT_YEAR()
[0075] GROUP BY MONTH(date);
[0076] The SQL statements here include functions such as extracting the month from the date field (MONTH(date)), counting ticket IDs (COUNT(ticket_id)), limiting the query to the year (YEAR(date) = CURRENT_YEAR()), and grouping by month (GROUP BY MONTH(date)).
[0077] Furthermore, the agent collection also integrates: error checking agent.
[0078] Furthermore, after inputting user demand information and data structure information into the target model and outputting the database query statement, it also includes: inputting the database query statement into the error checking agent and outputting the inspection result; when the inspection result indicates that it is correct, executing the step of querying the system database based on the database query statement; or, when the inspection result indicates that it is incorrect, correcting the database query statement based on the inspection result and the error checking agent; when the corrected database query statement is checked to be correct, executing the step of querying the system database based on the database query statement.
[0079] In one specific embodiment, an error-checking agent is integrated into the intelligent chart display system as a quality control component during the data query process, ensuring the correctness and feasibility of SQL statements. Before being submitted to the system database query, the database query statement generated by the target model is sent to the error-checking agent for strict syntax and logic checking.
[0080] The Error Checking Agent receives database query statements from the target model and performs a thorough analysis to check for syntax errors, logical inconsistencies, or potential execution failures. This check examines the integrity of the SQL statement, correct field names, proper table joins, and appropriate function calls. Upon completion, the agent outputs the results, indicating whether the query statement is error-free.
[0081] For example, for SQL statements containing misspelled field names or undeclared join conditions, the intelligent body will mark the specific error location and type and make modification suggestions.
[0082] If the check indicates the database query statement is correct, the system database is queried based on the query statement. A correct query retrieves accurate results directly from the system database, avoiding data retrieval failures or incorrect data returned due to incorrect statements, ensuring the accuracy and reliability of the query results.
[0083] If the check result indicates an error, the error checking agent will attempt to correct the database query statement based on the check result and known error types. The correction process may involve correcting field names, supplementing missing join conditions, replacing incorrect function parameters, etc. to ensure the syntactic correctness and logical consistency of the SQL statement.
[0084] The corrected database query statement is sent back to the error checking agent for a second check to ensure that all errors have been properly handled. If the second check still indicates no errors, the system will execute the database query based on the corrected SQL statement.
[0085] The implementation of this invention incorporates an error-checking agent that effectively prevents and corrects errors in database query statements, improving the success rate and accuracy of data queries. The technical benefit is reflected in the error-checking agent's dynamic feedback mechanism, which reduces invalid or erroneous database operations, conserves computing resources, and avoids potential system crashes or data contamination.
[0086] Step S204: querying the system database based on the database query statement to obtain a query result, wherein the query result is used to record the target data in the target data range.
[0087] It's important to note that the system database is the central data storage and management hub within the intelligent charting system. It contains historical and real-time data from multiple business areas, including flight operations, customer interactions, and market trends. Within the system database, data is organized into multiple tables, each representing a different dataset or business entity, such as "Flight Information," "Customer Feedback," or "Market Analysis." Tables are composed of different fields (columns), each storing a specific type of information, such as date, amount, or ID. These fields constitute the data's structure.
[0088] The query result is a set of data retrieved by the database according to the requirements of the SQL statement, which directly reflects the target data range mentioned in the user's demand information, including statistics on flight sales in a specific time period, customer satisfaction score distribution, market trend analysis results, etc., depending on the specific content of the user's query.
[0089] Query results are typically presented in a table format, containing the fields and rows specified by the SQL statement. For example, if a user's query is "airline ticket sales per month this year," the query result will be a table with each row representing a month and each column displaying data such as ticket sales.
[0090] Through query results, users can intuitively view the data they care about without having to deeply understand the database structure or write query statements. This greatly simplifies the data analysis process, improving efficiency and user experience. Furthermore, the system database's efficient query mechanism and accurate query result processing ensure the performance and reliability of the entire data analysis system, enabling it to handle a variety of complex query requirements and provide users with timely and accurate data insights.
[0091] Furthermore, the step of querying the system database based on the database query statement also includes: when feedback is given during the query process that the database query statement is executed abnormally, obtaining the abnormal record, interrupting the query step, and recording the interruption point; inputting the abnormal record and the database query statement into the error checking intelligent body, outputting the abnormal analysis result and the number of abnormal analysis; when the number of abnormal analysis is less than or equal to a preset threshold, correcting the database query statement based on the abnormal analysis result, and injecting the corrected database query statement into the interruption point, and continuing to execute the query step; or, when the number of abnormal analysis is greater than the preset threshold, feeding back the abnormal analysis result to the front-end page, ending the query step, and deleting the interruption point.
[0092] In one specific embodiment, the step of querying a system database based on a database query statement may encounter various execution exceptions, such as syntax errors, permission issues, and data type mismatches, hindering the normal execution of the query. When an exception occurs, an exception record is captured, including information such as the error code and error description. The query interruption point, i.e., the stage at which the exception occurred, is also recorded. The exception record and the original database query statement are fed back to an error-checking agent. Based on the information in the exception record, the error-checking agent analyzes the root cause of the error, outputs an exception analysis result, and records the number of exception analyses to ensure that the system's correction mechanism does not fall into an infinite loop. For example, the exception analysis result may indicate that the query failed due to a misspelled field name or the use of an unsupported function in the SQL statement. If the number of exception analyses is less than or equal to a preset threshold (e.g., two), the database query statement is automatically corrected based on the exception analysis result, and the corrected statement replaces the erroneous portion of the original query statement. After the correction is complete, the corrected database query statement is injected back from the interruption point, and the query step is re-executed. This intelligent correction process can effectively resolve minor errors or syntax issues encountered during the query process without manual intervention, significantly improving query efficiency and data availability.
[0093] If the number of exception analyses after correction attempts exceeds the preset threshold, it indicates that the query statement may have a deeper problem that cannot be solved by simple correction. In this case, the exception analysis results are fed back to the front-end page and displayed in a user-friendly manner, informing the user why the query cannot continue. At the same time, the query step is terminated and the interruption point is deleted to avoid inefficient resource usage.
[0094] The embodiment of the present invention achieves dynamic optimization and error prevention of the query process by introducing an exception record, feedback and intelligent correction mechanism during the query process. This mechanism can automatically identify and correct errors that occur during the query process, significantly reducing the number of query failures and improving the stability and efficiency of data queries.
[0095] In step S205, the query results and user demand information are input into the style organization agent, which organizes the display style of the target data, uses the organization results as data analysis results, and displays the data analysis results on the front-end page.
[0096] Specifically, the display style refers to the visual presentation of data on the front-end page, encompassing elements such as data arrangement, color coding, annotations, and titles, as well as chart types, axis labels, legends, and annotations. The Style Management Agent's task is to automatically adjust and optimize the display style based on query results and user requirements, ensuring that it aligns with data characteristics and meets user preferences for information presentation.
[0097] For example, if the query result is the number of air ticket sales each month, the style organization agent may choose a bar chart as the display style, because the bar chart can clearly show the data comparison at different time points; it will also automatically set the horizontal axis of the bar chart to the month and the vertical axis to the sales number, and add appropriate labels and titles, such as "Monthly Air Ticket Sales in 2023".
[0098] Data analysis results are the result of query results processed by a style organization agent and presented to users in the form of charts or reports. These visualizations include not only the raw data but also its structured presentation, chart selection, and style design, aiming to convey the underlying information in an intuitive and accessible manner. Data analysis results serve as a bridge from natural language queries to data insights, enabling users to quickly understand the data's meaning without the need for additional interpretation or analysis.
[0099] The intelligent chart display system displays data analysis results through a front-end page. The front-end page is the interface for users to interact with the system and can be embedded in various business systems. In this invention, the front-end page has a resizable query window in which users enter their query requirements. At the same time, the data analysis results are also displayed in this window, including the query question, data content, and chart display.
[0100] The front-end interface is designed with a focus on user-friendliness and flexible data presentation. The query results display area automatically adjusts its layout based on the data type and size, while charts are presented based on the decisions made by the graph selection agent to present the data in the most appropriate way. Furthermore, the front-end interface supports a variety of chart types, such as bar charts, line charts, and pie charts, to meet users' needs for different data analysis perspectives.
[0101] Furthermore, the agent collection also integrates: graphic selection agent.
[0102] Furthermore, after inputting the query results and user demand information into the style organization intelligent agent and outputting the data analysis results, it also includes: inputting the data analysis results and user demand information into the graphic selection intelligent agent, and the graphic selection intelligent agent determines the data display graphic that the user wants based on the user demand information; generating a preview image based on the data display graphic and the data analysis results, and displaying the preview image on the front-end page.
[0103] In one optional embodiment, the Graphic Selection Agent is responsible for determining the most appropriate graphic type for displaying query results based on user requirements. After the data analysis results are generated, the graphic selection agent does not directly display them. Instead, the graphic selection agent first analyzes the user's requirements and determines the user's preferred data display format.
[0104] When the data analysis results and user requirements are fed into the graph selection agent, the agent comprehensively considers the context of the user's query, the dimensionality of the data, and the magnitude of the data. For example, if the user is querying sales trends over a certain period of time, the graph selection agent recommends a line chart; if the user is interested in market share distribution, a pie chart or donut chart may be recommended.
[0105] After determining the most appropriate data display graphic, a preview is generated based on the data display graphic and the data analysis results. The preview uses the data from the data analysis results and displays it according to the selected graphic type for user confirmation or adjustment. This process not only considers the data visualization requirements but also incorporates the display preferences that users may express during querying, such as time series and categorical comparison.
[0106] A preview is displayed on the front-end page, allowing users to directly check whether the chart meets their expectations or whether adjustments to the data display are needed. If the preview meets their needs, the user can confirm the display. If the user finds any problems with the preview, they can adjust it using the page controls and feedback to the agent collection for further processing.
[0107] The embodiment of the present invention can intelligently select data display graphics based on user demand information through the integrated graphic selection agent, avoiding the display limitations brought by fixed templates, and improving the applicability and user satisfaction of the charts. The graphic selection agent can automatically generate or recommend the best chart display method based on data characteristics and the context of user queries, making data display more intuitive and easy to understand.
[0108] Furthermore, after displaying the preview image on the front-end page, it also includes: receiving user feedback information on the preview image transmitted by the front-end; when the feedback information indicates that the user is dissatisfied, analyzing the feedback information to obtain a graphic modification strategy, wherein the graphic modification strategy includes any one of the following: graphic type modification, chart style modification; inputting the graphic modification strategy and the preview image into the graphic selection agent, and outputting the modified preview image; until the feedback information transmitted by the front-end indicates that the user is satisfied, determining the preview image as a data display image, and displaying the data display image on the front-end page.
[0109] In an optional embodiment, after the preview image is displayed on the front-end page, user feedback on the preview image is received from the front-end. This feedback can be a direct satisfaction rating, such as "unsatisfied" or "satisfied," or a specific modification request, such as "I want to change the chart type to a line chart" or "adjust the chart's color scheme." This feedback is collected by the front-end page and transmitted to the back-end.
[0110] The system backend analyzes user feedback to determine whether the user is satisfied with the preview image display and identifies specific modification requests. If the feedback indicates dissatisfaction, further analysis is conducted to determine the reasons for dissatisfaction, such as the chart type not matching the data trend display, the chart style not meeting the user's aesthetic standards, or other display issues. Based on the analysis results, a corresponding graphic modification strategy is developed.
[0111] Graphic modification strategies can include: graphic type modification, such as changing a bar chart to a line chart to more clearly show the trend of data changes over time; chart style modification, such as adjusting visual elements such as color scheme, font style, line thickness, etc. to improve the aesthetics and readability of the chart.
[0112] After determining the graph modification strategy, the strategy, along with the preview information, is fed into the graph selection agent. The graph selection agent adjusts the graph's presentation and visual style based on the strategy, generating a revised preview. This process involves multiple iterations until the user is satisfied. For example, if a user responds with "I'd like to see a line chart," the graph selection agent will reselect the line chart type, adjust the data presentation, and generate a new preview for the user to view.
[0113] The user views the modified preview image on the front-end page and provides feedback. If the feedback indicates that the user is satisfied, the modification of the graph selection agent is considered to have met the user's requirements, and the preview image is determined as the data display image and finally displayed on the front-end page.
[0114] The embodiment of the present invention achieves personalized and precise matching of chart display by introducing a user feedback mechanism and a graphic modification strategy. This design can dynamically adjust the data display method according to the specific needs of the user, ensuring that each user obtains the chart display that best meets their analysis purpose, thereby improving the efficiency and accuracy of data analysis.
[0115] Through the above steps S201 to S205, user demand information can be received first, and the pre-trained target model and the intelligent agent set linked to the target model can be called, wherein the intelligent agent set at least integrates: a main intelligent agent and a style sorting intelligent agent, and then the user demand information is input into the main intelligent agent, and the main intelligent agent retrieves the table structure knowledge base to obtain data structure information, wherein the data structure information is used to indicate the target data range that the user cares about, and then the user demand information and data structure information are input into the target model, and the database query statement is output, and then the query is performed from the system database based on the database query statement to obtain the query result, wherein the query result is used to record the target data in the target data range, and finally the query result and user demand information are input into the style sorting intelligent agent, and the style sorting intelligent agent sorts the display style of the target data, uses the sorting result as the data analysis result, and displays the data analysis result on the front-end page.
[0116] In the embodiment of the present invention, the method of integrating artificial intelligence and multi-agent collaboration is adopted, and the purpose of automated and precise data analysis and chart generation is achieved by integrating pre-trained target models and intention recognition, main agents, error checking, style organization and graphic selection agent sets, thereby achieving the technical effects of improving the efficiency of big data analysis, simplifying the data query process, and enhancing the intuitiveness of data display and user interaction friendliness. Specifically, the present invention breaks through the limitations of traditional data analysis and no longer relies on manually written complex SQL query statements. Instead, it allows users to express query requirements in natural language, and with the help of the intelligent parsing and processing capabilities of AI models and agent sets, quickly Quickly generate and correct database query statements to ensure the accuracy and security of data acquisition; at the same time, the graphic selection agent automatically selects the best chart display method according to data characteristics and user preferences, and cooperates with the style organization agent to optimize the display style, which greatly improves the readability and aesthetics of data display; in addition, the present invention allows users to directly participate in the evaluation and adjustment of data display effects through the intuitive display and user feedback mechanism of the front-end page until a satisfactory display effect is achieved, thereby achieving a high degree of customization and humanization of data analysis, and thus solving the technical problem that the big data analysis method process in related technologies is too complicated and time-consuming, resulting in low efficiency of data analysis and display.
[0117] The present invention will be described below in conjunction with another specific embodiment.
[0118] based on Figure 1 The intelligent chart system shown in FIG. 1 and the method based on the intelligent chart system proposed in the embodiment of the present invention include the following steps:
[0119] 1. User input: Users enter query requirements through the front-end page, including query questions and the type of charts they want to display, or specific SQL statements;
[0120] 2. Application layer processing: Receives query requests from users, organizes the requests into parameters and passes them to each agent for processing. During the processing, the application layer connects to the real database for query and returns the data results;
[0121] 3. Agent processing: The application layer calls the agent in the following order.
[0122] Intent Recognition Agent: This agent is responsible for understanding the user's query and determining whether it is a chat request or a data query. If it is a chat request, the agent will respond based on the knowledge of the large model. If it is a data query, the application layer will pass the query content to the main agent.
[0123] Main agent: retrieves the data table knowledge base according to the query content entered by the user, passes it to the large model to obtain the SQL statement, and the application layer uses this statement to query the database to obtain data;
[0124] Error checking agent: checks the problems encountered when calling the main agent, corrects the main agent's answer (SQL statement) according to the problem, and the application layer uses this statement to re-query the database to obtain data;
[0125] Style Arrangement Agent: Arrange the style of the results output by the main agent to comply with the front-end style display specifications.
[0126] Graphic selection agent: selects appropriate graphic display templates, such as pie charts, bar charts, and line charts, based on the graphic display method mentioned in the user input.
[0127] 4. Result display: The front end renders the data and displays charts based on the query results and graphic requirements returned by the application layer.
[0128] Specifically, the front-end module provides a page control that can be embedded in the front-end of the implementation system. This control has two modes when displaying the page, namely hidden mode and display mode. The initialization state is hidden mode. A button in the shape of a paper airplane is displayed on any page of the implementation system. Click this button and the control will be in display mode, appearing in the upper right corner of the page. In display mode, you can click to adjust the window size, with sizes of 1.0 times, 1.5 times, and 2 times. The window in display mode is divided into two functional areas, namely the upper area and the lower area. The upper area is the display area, which displays questions raised by the user and the data returned by the application layer. The lower area is the user input area, which provides an input box for user input. After clicking Send, the input content is sent to the application layer.
[0129] The application layer provides a web application that mainly completes four tasks: login verification, agent scheduling, SQL modification and data query.
[0130] The agent platform layer provides five agents, a table structure knowledge base, and a large model. The agent's function is defined by defining prompt words. The table structure knowledge base is the database table creation statement document of the implementation system. This knowledge base is created through slicing, and the slicing rule is one slice per table.
[0131] The following describes the processing process after the web application receives a question request, which goes through three stages.
[0132] Phase 1: Intent recognition.
[0133] After receiving the user question sent by the front-end module, the web application verifies the user's login status. After the verification is passed, the intelligent agent scheduling process is started.
[0134] First, the intent recognition agent is invoked to determine whether the user's question is chatty or data-query-oriented. If the question is chatty, the agent uses the large model to obtain an answer to the user's question and returns the answer and chatty nature to the web application. After determining that the question is chatty, the web application directly returns the answer to the front-end module for display. If the question is data-query-oriented, the agent returns the user's question and data-query nature to the web application. After determining that the question is data-query-oriented, the web application enters the second stage.
[0135] Phase 2: SQL generation and data query.
[0136] Based on the user's question, the main agent searches the table structure knowledge base, obtains all possible slice information, and then passes it along with the user's question to the main model, which understands the semantics and generates the corresponding SQL statement. The SQL statement is returned to the web application in the following JSON format: {"sql":""}.
[0137] After the web application obtains the SQL statement returned by the main agent, it replaces the "*" in "Select*" with the specific field of the database table, and then passes the SQL to the error checking agent, allowing the agent to check for possible problems and correct them, and then return the corrected SQL statement to the web application.
[0138] After obtaining the SQL from the error-checking agent, the web application will query the implementation system database to obtain the corresponding data. If an SQL execution exception occurs during the web application's data acquisition process, the web application will request the error-checking agent again with this exception and the executed SQL. The agent will then continue to analyze the cause of the error and correct the SQL statement, returning the corrected SQL statement to the web application. To avoid an infinite loop and ensure performance, the above process is only processed twice. If the data cannot be obtained, the error information will be returned to the front-end module, which will convert the error information and provide a prompt. If the web application obtains the data normally, it will enter the third stage.
[0139] Phase 3: Data presentation.
[0140] After obtaining the data, the web application calls the style organization agent to process and organize the data and convert it into the Json format required by the front-end module. The format requirements are:
[0141]
[0142]
[0143] After obtaining the organized style data, the web application continues to call the graphics selection agent to accurately display the user's requested display requirements such as bar charts, line charts, or pie charts. The large model then determines which data should be on the X-axis and which should be on the Y-axis, as well as how to group them. This results in JSON data in the following format:
[0144]
[0145]
[0146] The web application returns the data in the above format to the front-end module for data display, and the entire process is completed.
[0147] This embodiment of the present invention disrupts the traditional data analysis paradigm by allowing users to submit queries to the system using natural language, which then matches the appropriate data and display format. To enhance the accuracy and intelligence of queries, this embodiment of the present invention employs a multi-agent collaborative mechanism to gradually pinpoint the required data. In practical application scenarios, these agents do not require a deep understanding of specific business details. Changing business scenarios requires simply updating the table structure knowledge base and the corresponding database, thus achieving universality.
[0148] The present invention is described below in conjunction with another optional embodiment.
[0149] Example 2
[0150] An artificial intelligence-based data analysis device provided in this embodiment includes multiple implementation units, each implementation unit corresponding to each implementation step in the above-mentioned embodiment one.
[0151] Figure 3 is a schematic diagram of an optional artificial intelligence-based data analysis device according to an embodiment of the present invention, such as Figure 3 As shown, the device may include: a receiving unit 31 , a first input unit 32 , a second input unit 33 , a query unit 34 , and a display unit 35 .
[0152] Among them, the receiving unit 31 is used to receive user demand information and call the pre-trained target model and the intelligent agent set linked to the target model, wherein the intelligent agent set at least integrates: a main intelligent agent and a style arrangement intelligent agent.
[0153] The first input unit 32 is used to input user demand information into the main agent, and the main agent retrieves the table structure knowledge base to obtain data structure information, wherein the data structure information is used to indicate the target data range that the user is concerned about.
[0154] The second input unit 33 is used to input user demand information and data structure information into the target model and output a database query statement.
[0155] The query unit 34 is configured to query the system database based on the database query statement to obtain a query result, wherein the query result is used to record target data in the target data range.
[0156] The display unit 35 is used to input the query results and user demand information into the style sorting agent, which sorts the display style of the target data, uses the sorting results as data analysis results, and displays the data analysis results on the front-end page.
[0157] The above-mentioned artificial intelligence-based data analysis device can first receive user demand information through the receiving unit 31, and call the pre-trained target model and the intelligent agent set linked to the target model, wherein the intelligent agent set integrates at least: a main intelligent agent and a style sorting intelligent agent, and then input the user demand information into the main intelligent agent through the first input unit 32, and the main intelligent agent retrieves the table structure knowledge base to obtain data structure information, wherein the data structure information is used to indicate the target data range that the user cares about, and then input the user demand information and data structure information into the target model through the second input unit 33, output the database query statement, and then query the system database based on the database query statement through the query unit 34 to obtain the query result, wherein the query result is used to record the target data in the target data range, and finally input the query result and user demand information into the style sorting intelligent agent through the display unit 35, and the style sorting intelligent agent sorts the display style of the target data, uses the sorting result as the data analysis result, and displays the data analysis result on the front-end page.
[0158] In the embodiment of the present invention, the method of integrating artificial intelligence and multi-agent collaboration is adopted, and the purpose of automated and precise data analysis and chart generation is achieved by integrating pre-trained target models and intention recognition, main agents, error checking, style organization and graphic selection agent sets, thereby achieving the technical effects of improving big data analysis efficiency, simplifying data query processes, and enhancing the intuitiveness of data display and user-friendly interaction. Specifically, the present invention breaks through the limitations of traditional data analysis and no longer relies on manually written complex SQL query statements. Instead, it allows users to express query requirements in natural language, and with the help of the intelligent parsing and processing capabilities of AI models and agent sets, Rapidly generate and correct database query statements to ensure the accuracy and security of data acquisition; at the same time, the graphic selection agent automatically selects the best chart display method according to data characteristics and user preferences, and cooperates with the style organization agent to optimize the display style, greatly improving the readability and aesthetics of data display; in addition, the present invention allows users to directly participate in the evaluation and adjustment of data display effects through the intuitive display and user feedback mechanism of the front-end page until a satisfactory display effect is achieved, thereby achieving a high degree of customization and humanization of data analysis, and thus solving the technical problem that the big data analysis method process in related technologies is too complicated and time-consuming, resulting in low efficiency of data analysis and display.
[0159] Furthermore, the receiving unit includes: a first acquisition module, used to obtain user action information transmitted by the front end, wherein the user action information records the user's operation actions and operation action information on the page controls on the front end page; a first analysis module, used to analyze the operation actions and operation action information recorded in the user action information to obtain user demand information.
[0160] Furthermore, the agent collection also integrates: intent recognition agent.
[0161] Furthermore, the artificial intelligence-based data analysis device also includes: a first input module, which is used to input the user demand information into the intention recognition agent after receiving the user demand information and calling the pre-trained target model and the set of intelligent agents linked to the target model, and output the nature of the user's question, wherein the nature of the user's question includes: chat nature and data query nature; a second input module, which is used to input the user demand information into the target model when the nature of the user's question is chat nature, output the model reply statement, and display the model reply statement on the front-end page; a first execution module, which is used to execute the step of inputting the user demand information into the main intelligent agent when the nature of the user's question is data query nature.
[0162] Furthermore, the agent collection also integrates: error checking agent.
[0163] Furthermore, the artificial intelligence-based data analysis device also includes: a third input module, which is used to input user demand information and data structure information into the target model and output the database query statement, and then input the database query statement into the error checking agent to output the inspection result; a second execution module, which is used to execute the step of querying the system database based on the database query statement when the inspection result indicates that it is correct; a first correction module, which is used to correct the database query statement based on the inspection result and the error checking agent when the inspection result indicates that it is incorrect; and a third execution module, which is used to execute the step of querying the system database based on the database query statement when the corrected database query statement is checked to be correct.
[0164] Furthermore, the query unit includes: a second acquisition module, which is used to obtain abnormal records, interrupt the query step, and record the interruption point when feedback is given of abnormal execution of the database query statement during the query process; a fourth input module, which is used to input the abnormal records and database query statements into the error checking intelligent body, and output the abnormal analysis results and the number of abnormal analyses; a second correction module, which is used to correct the database query statement based on the abnormal analysis results when the number of abnormal analyses is less than or equal to a preset threshold, and inject the corrected database query statement into the interruption point to continue executing the query step; a feedback module, which is used to feedback the abnormal analysis results to the front-end page when the number of abnormal analyses is greater than the preset threshold, and end the query step and delete the interruption point.
[0165] Furthermore, the agent collection also integrates: graphic selection agent.
[0166] Furthermore, the artificial intelligence-based data analysis device also includes: a fifth input module, which is used to input the query results and user demand information into the style organization intelligent body, and after outputting the data analysis results, input the data analysis results and user demand information into the graphic selection intelligent body, and the graphic selection intelligent body determines the data display graphic that the user wants based on the user demand information; a display module, which is used to generate a preview image based on the data display graphic and the data analysis results, and display the preview image on the front-end page.
[0167] Furthermore, the artificial intelligence-based data analysis device also includes: a receiving module, which is used to receive user feedback information on the preview image transmitted by the front end after the preview image is displayed on the front end page; a second analysis module, which is used to analyze the feedback information and obtain a graphic modification strategy when the feedback information indicates that the user is dissatisfied, wherein the graphic modification strategy includes any one of the following: graphic type modification, chart style modification; a sixth input module, which is used to input the graphic modification strategy and the preview image into the graphic selection agent and output the modified preview image; a determination module, which is used to determine the preview image as a data display image and display the data display image on the front end page until the feedback information transmitted by the front end indicates that the user is satisfied.
[0168] The above-mentioned artificial intelligence-based data analysis device may also include a processor and a memory. The above-mentioned receiving unit 31, first input unit 32, second input unit 33, query unit 34, display unit 35, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.
[0169] The processor includes a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured. By adjusting kernel parameters, query results and user requirements are fed into a style organization agent. The style organization agent organizes the display style of the target data, uses the organized results as data analysis results, and displays them on the front-end page.
[0170] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0171] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program initialized with the following method steps: receiving user demand information, and calling a pre-trained target model and a set of intelligent agents linked to the target model, wherein the intelligent agent set integrates at least: a main intelligent agent and a style sorting intelligent agent; inputting user demand information into the main intelligent agent, and the main intelligent agent retrieves the table structure knowledge base to obtain data structure information, wherein the data structure information is used to indicate the target data range that the user is concerned about; inputting user demand information and data structure information into the target model, and outputting a database query statement; querying the system database based on the database query statement to obtain a query result, wherein the query result is used to record the target data in the target data range; inputting the query result and user demand information into the style sorting intelligent agent, and the style sorting intelligent agent sorts the display style of the target data, uses the sorting result as the data analysis result, and displays the data analysis result on the front-end page.
[0172] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the artificial intelligence-based data analysis methods in the above-mentioned embodiment 1.
[0173] According to another aspect of an embodiment of the present invention, an electronic device is also provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the artificial intelligence-based data analysis method of any one of the above-mentioned embodiments.
[0174] Figure 4 1 is a hardware structure block diagram of an electronic device (or mobile device) that performs an artificial intelligence-based data analysis method according to an embodiment of the present invention. Figure 4 As shown, the electronic device may include one or more ( Figure 4 402n are used to illustrate) a processor (the processor may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices), a memory 404 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 4 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 4 More or fewer components than shown, or with Figure 4 Different configurations shown.
[0175] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0176] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0177] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0178] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0179] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0180] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes 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 for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.
[0181] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A data analysis method based on artificial intelligence, characterized in that: include: Receive user demand information, and call a pre-trained target model and an agent set linked to the target model, wherein the agent set at least integrates: a main agent and a style arrangement agent; Inputting the user demand information into the main agent, and having the main agent retrieve the table structure knowledge base to obtain data structure information, wherein the data structure information is used to indicate the target data range that the user is concerned about; Input the user demand information and the data structure information into the target model, and output a database query statement; Performing a query from a system database based on the database query statement to obtain a query result, wherein the query result is used to record target data in the target data range; The query results and the user demand information are input into the style organization agent, and the style organization agent organizes the display style of the target data, uses the organization result as the data analysis result, and displays the data analysis result on the front-end page.
2. The data analysis method according to claim 1, characterized in that The step of receiving user demand information also includes: Acquire user action information transmitted by the front-end, wherein the user action information records the user's operation actions and operation action information on the page controls on the front-end page; The operation action and operation action information recorded in the user action information are analyzed to obtain the user demand information.
3. The data analysis method according to claim 1, wherein: The agent set further includes: an intention recognition agent, which, after receiving user demand information and calling a pre-trained target model and an agent set linked to the target model, also includes: Input the user demand information into the intention recognition agent, and output the nature of the user's question, wherein the nature of the user's question includes: chat nature and data query nature; In the case where the nature of the user's question is chatty, the user's demand information is input into the target model, a model answer statement is output, and the model answer statement is displayed on the front-end page; or, In the case where the nature of the user's question is a data query nature, the step of inputting the user's demand information into the main agent is executed.
4. The data analysis method according to claim 1, wherein: The agent set further includes an error checking agent, which, after inputting the user demand information and the data structure information into the target model and outputting a database query statement, further includes: Inputting the database query statement into the error checking agent and outputting the checking result; If the inspection result indicates that there is no error, executing the step of querying the system database based on the database query statement; or If the check result indicates an error, modifying the database query statement based on the check result and the error checking agent; When the revised database query statement is checked to be correct, the step of querying the system database based on the database query statement is executed.
5. The data analysis method according to claim 4, characterized in that: The step of querying the system database based on the database query statement also includes: If an abnormality is reported during the query process, the database query statement is executed abnormally, and the abnormality record is obtained, the query step is interrupted, and the interruption point is recorded; Input the abnormal record and the database query statement into the error checking agent, and output the abnormality analysis result and the abnormality analysis times; If the number of abnormal analysis times is less than or equal to a preset threshold, the database query statement is corrected based on the abnormal analysis result, and the corrected database query statement is injected into the interruption point to continue executing the query step; or In the case that the number of abnormality analyses is greater than the preset threshold, the abnormality analysis result is fed back to the front-end page, the query step is ended, and the interruption point is deleted.
6. The data analysis method according to claim 1, characterized in that: The agent set further includes: a graphic selection agent, which inputs the query results and the user demand information into the style arrangement agent, and outputs the data analysis results, and further includes: Inputting the data analysis results and the user demand information into the graphic selection agent, and the graphic selection agent determining the data display graphic desired by the user according to the user demand information; A preview image is generated based on the data display graph and the data analysis result, and the preview image is displayed on the front-end page.
7. The data analysis method according to claim 6, characterized in that: After displaying the preview image on the front-end page, the method further includes: receiving user feedback information on the preview image transmitted by the front end; In the case where the feedback information indicates that the user is dissatisfied, analyzing the feedback information to obtain a graphic modification strategy, wherein the graphic modification strategy includes any one of the following: graphic type modification, chart style modification; Inputting the graphic modification strategy and the preview image into the graphic selection agent, and outputting the modified preview image; When the feedback information transmitted by the front end indicates that the user is satisfied, the preview image is determined as the data display image, and the data display image is displayed on the front end page.
8. A data analysis device based on artificial intelligence, characterized in that: include: A receiving unit, configured to receive user demand information and call a pre-trained target model and an agent set linked to the target model, wherein the agent set includes at least: a main agent and a style arrangement agent; A first input unit is configured to input the user demand information into the main agent, and the main agent retrieves the table structure knowledge base to obtain data structure information, wherein the data structure information is used to indicate the target data range that the user is concerned about; A second input unit is used to input the user demand information and the data structure information into the target model and output a database query statement; A query unit, configured to query a system database based on the database query statement to obtain a query result, wherein the query result is used to record target data in the target data range; The display unit is used to input the query results and the user demand information into the style organization agent, and the style organization agent organizes the display style of the target data, uses the organization result as the data analysis result, and displays the data analysis result on the front-end page.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the artificial intelligence-based data analysis method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the artificial intelligence-based data analysis method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Data display method and device, computer equipment and storage medium
CN114416831A
Training data generation method and device, medium and computing equipment
CN118606351A
Method and system for converting natural language into SQL (Structured Query Language) statement
CN118916381A
Data query method and device, equipment and medium
CN119441428A
Multi-agent collaboration method and system for engineering construction project
CN119443147A