Data chart generation method and system and readable storage medium
By automatically generating cross-index data query statements and API paths through a large language model, the flexibility and security issues of cross-index data join queries in tools such as Grafana are resolved, enabling efficient and secure data querying and visualization.
Patent Information
- Application Number
- CN202511153792.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2026-01-02
AI Technical Summary
Existing data visualization tools such as Grafana lack flexibility and dynamic adaptability when handling complex data join queries across indexes, requiring manual code modification and deployment, which poses security risks and performance vulnerabilities.
By parsing natural language query requests using a large language model, it automatically generates multi-step data query statements and API paths, enabling cross-index data connections, reducing manual intervention, and is applicable to different databases and query requests.
It lowers the barrier to manual development, improves data query efficiency and flexibility, avoids code injection risks, and adapts to changing query requests and data sources.
Smart Images

Figure CN121256115A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of big data visualization, and particularly relates to a data chart generation method and system and a readable storage medium. BACKGROUND
[0002] Grafana and other data visualization tools are used to generate charts for displaying data queried from various data sources (for example, Elasticsearch, Prometheus, etc.). Since the data query process depends on the underlying data source, Elasticsearch and other non-relational databases do not support native JOIN capabilities and only support user single-index queries, which cannot handle complex connection queries across indexes. However, with the development of cloud computing technology, users' demand for complex data source association analysis and display is increasing. Therefore, a method of calling a fixed application programming interface (API) interface in a pre-deployed external service can be used to enable Grafana to query and visualize complex data across indexes.
[0003] However, in the above method, the API in the external service is strongly coupled with the data source, and in the case of business changes, the code needs to be manually modified and deployed, which lacks flexibility and cannot meet the dynamic adaptation of query requests and data sources. SUMMARY
[0004] The present application discloses a data chart generation method, system and readable storage medium, which automatically generates and executes a multi-index data query statement according to a query request input in natural language and a large language model, realizes multi-index data connection query operation in a non-relational database, can reduce human participation, is widely applicable to different databases and various query requests, thereby reducing labor costs, improving data query efficiency and enhancing data insight.
[0005] In a first aspect, the application provides a data chart generation method, which comprises: in the case of receiving a query request expressed in natural language for driving a multi-index data connection query, a processor calls a large language model (LLM), parses the query request, and generates a first multi-step data query statement, and generates a first application programming interface (API) path according to the first multi-step data query statement, then executes the generated multi-step data query statement according to the first API path, generates a first query result according to the multiple data queried from the data source, and sends the first query result to the user to enable the user to generate a corresponding first chart according to the first query result and a visualization tool.
[0006] In the above process, the processor can automatically generate a dynamically changing multi-step data query statement and an API according to the large language model and the query request expressed in natural language by the user, and automatically implement a cross-index data connection operation. Compared with the current method of writing a data query and connection code by the user and embedding the code into a visualization tool to implement a cross-index data connection processing, the method does not require manual writing of a corresponding query statement, can reduce the manual development threshold, avoid security and performance risks existing in code script injection, ensure data security, and can be applied to changing query requests and data sources, thereby improving query efficiency.
[0007] Exemplarily, the processor determines the specific process of the first multi-step data query statement through the large language model LLM and the query request as follows: the processor determines a parsing result of the query request through the LLM and data source index metadata, the parsing result at least including target indexes corresponding to multiple entities in the query request respectively, multiple fields in the query request, values corresponding to the multiple fields respectively, and cross-index associated fields, wherein the data source index metadata includes indexes, field information, and association relationships between the indexes, and the associated fields are used to connect data corresponding to the multiple indexes; and generates a first multi-step data query statement according to the parsing result and a query syntax of the data source.
[0008] In the above process, the processor parses the query request through the large language model, outputs a parsing result, and generates a specific data query statement in combination with a query syntax of a non-relational database. The multi-step data query statement does not require manual writing of a complex data query code, reduces manual cost, is applicable to current query requests and corresponding data sources, and is decoupled from a visualization tool, and has stronger flexibility.
[0009] Exemplarily, the processor executes the first multi-step data query statement according to the first API path to generate the first query result, and a specific process is as follows: the processor executes the multi-step data query statement to obtain a plurality of data according to the first API path, and integrates the plurality of data according to the cross-index association field to generate the first query result.
[0010] In the above process, since the data source lacks a native JOIN connection capability, the processor obtains a plurality of independent data from a plurality of data sources corresponding to indexes according to the multi-step data query statement, and then generates the first query result according to the cross-index association field and the integration mode (for example, an application layer JOIN mode), thereby realizing execution of a multi-index JOIN operation in a non-relational database.
[0011] Exemplarily, a specific process of generating the first application programming interface path according to the first multi-step data query statement is as follows: the processor replaces the entities with path variables in an API path template according to the parsing result, wherein the API path template is determined according to the parsing result; and the processor replaces the values corresponding to the entities with the path variables corresponding to the entities respectively to generate the first API path.
[0012] In the above process, the first API can be directly called in the case that the user subsequently sends the same query request, thereby avoiding repeated generation of the API by the LLM, reducing the calculation overhead, and avoiding repeated parsing of the query request in the natural language sent by the user.
[0013] Exemplarily, the method further includes: in the case that the processor receives information sent by the user that the first image meets the condition, the processor stores the first API path into a routing rule library.
[0014] In the above process, the user feeds back whether the first image meets the condition, and in the case that the first image meets the condition, the first API path is stored into the routing rule library, so as to facilitate calling in a subsequent process, wherein the routing rule library includes a mapping relationship between the API path and the query request.
[0015] Exemplarily, the method further includes: in the case that the processor receives the query request sent by the user again, the processor calls the first API path and executes the first multi-step data query statement to generate the first query result; and the processor sends the first query result to the user.
[0016] In the above process, the processor can reuse the first API path stored in advance, thereby improving the query efficiency.
[0017] Exemplarily, the method further comprises: in a case where the processor receives information sent by the user that determines that the first graph does not meet the condition, adjusting the LLM, and determining a second multi-step data query statement according to the adjusted LLM and the query request, and generating a second API path according to the second multi-step data query statement; executing the second multi-step data query statement according to the second API path, generating a second query result, and generating a second API path according to the second multi-step data query statement, wherein the second query result is obtained by connecting a plurality of data queried from the data source according to the second multi-step data query statement; and sending the second query result to the user to enable the user to generate a second graph according to the second query result and the visualization tool.
[0018] In the above process, the processor adjusts the LLM according to user feedback to adjust the parsing logic of the LLM to the query request, so as to improve the query accuracy, and generates a new multi-step query statement and a second API path according to the new parsing result, so as to realize the updating of the routing rule library and improve the accuracy of data query and meet the user demand.
[0019] Exemplarily, the data source is a non-relational database.
[0020] In a second aspect, the present application provides a data graph generation system, comprising: a visualization tool plug-in module configured to receive a query request input by a user and send the query request to a monitoring intelligent agent module, the query request being composed of natural language and configured to drive multi-index data connection query; the monitoring intelligent agent module is configured to determine a first multi-step data query statement through a large language model (LLM) and the query request, and generate a first API path according to the first multi-step data query statement; the monitoring intelligent agent module is further configured to execute the first multi-step data query statement according to the first API path, and generate a first query result, wherein the first query result is obtained by connecting a plurality of data queried from a data source according to the first multi-step data query statement; the monitoring intelligent agent module is further configured to send the first query result to the visualization tool plug-in module; and the visualization tool plug-in module is further configured to send the first query result to the user to enable the user to generate a first graph according to the first query result and the visualization tool.
[0021] Exemplarily, the monitoring intelligent agent module is specifically configured to determine a parsing result of the query request through the LLM and data source index metadata, the parsing result at least including a plurality of entities in the query request each corresponding to a target index, a plurality of fields in the query request, a plurality of values each corresponding to a field, and an association field across indexes, wherein the data source index metadata includes indexes, field information, and association relationships between indexes, and the association field is configured to connect data corresponding to a plurality of indexes; and generate a first multi-step data query statement according to the parsing result and a query syntax of the data source.
[0022] Illustratively, the monitoring agent module is specifically configured to execute the first multi-step data query statement to obtain a plurality of data according to the first API path; and integrate the plurality of data according to the cross-indexed associated fields to generate a first query result.
[0023] Illustratively, the monitoring agent module is specifically configured to replace the value of the entity with the path variable corresponding to the entity to generate a first API path, where the first API path is associated with the first multi-step data query statement.
[0024] Illustratively, the monitoring agent module is further configured to, in a case where the information sent by the user to determine that the first image meets the condition is received, store the first API path in a routing rule library of the visualization tool plug-in module.
[0025] Illustratively, in a case where the visualization tool plug-in module receives the query request sent by the user again, the visualization tool plug-in module calls the first API path to enable the monitoring agent module to execute the first multi-step data query statement to generate the first query result; and the visualization tool plug-in module sends the first query result to the user through the visualization tool plug-in module.
[0026] Illustratively, in a case where the visualization tool plug-in module receives the information sent by the user to determine that the first image does not meet the condition, the monitoring agent module adjusts the LLM, and determines a second multi-step data query statement according to the adjusted LLM and the query request, and generates a second API path according to the second multi-step data query statement; executes the second multi-step data query statement according to the second API path to generate a second query result, where the second query result is obtained by connecting a plurality of data queried from the data source according to the second multi-step data query statement; the monitoring agent module sends the second query result to the visualization tool plug-in module, and the visualization tool plug-in module sends the second query result to the user to enable the user to generate a second chart according to the second query result and the visualization tool.
[0027] Illustratively, the data source is a non-relational database.
[0028] In a third aspect, the present application provides a computing device cluster, which includes at least one computing device, each computing device including a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to enable the computing device cluster to perform any possible method of the first aspect.
[0029] In a fourth aspect, the present application provides a computer program product comprising instructions which, when executed by a computing device, cause the computing device to perform any of the possible methods of the first aspect.
[0030] In a fifth aspect, the present application provides a computer-readable storage medium comprising computer program instructions which, when executed on a computing device, cause the computing device to perform any of the possible methods of the first aspect.
[0031] On the basis of the implementation manners of the aspects provided by the present application, further combinations can be made to provide more implementation manners. BRIEF DESCRIPTION OF DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows.
[0033] Figure 1 is a schematic diagram of a Grafana overview page provided by an embodiment of the present application;
[0034] Figure 2 is a page schematic diagram when Grafana configures data provided by an embodiment of the present application;
[0035] Figure 3 is a page schematic diagram of Grafana drawing a table provided by an embodiment of the present application;
[0036] Figure 4 is a structural schematic diagram of a data query system provided by an embodiment of the present application;
[0037] Figure 5 is a schematic diagram of the overall operation of a data chart generation system architecture provided by an embodiment of the present application;
[0038] Figure 6 is a specific process schematic diagram of a data chart generation system provided by an embodiment of the present application;
[0039] Figure 7 is a flowchart of a data chart generation method provided by an embodiment of the present application;
[0040] Figure 8 is a flowchart of generating a data query result by calling an LLM according to a query request provided by an embodiment of the present application;
[0041] Figure 9 is a flowchart of a non-first data query provided by an embodiment of the present application;
[0042] Figure 10 is a structural schematic diagram of a computing device provided by an embodiment of the present application;
[0043] Figure 11 is a structural schematic diagram of a computing device cluster provided by an embodiment of the present application.
[0044] Figure 12 is a structural schematic diagram of one or more computing devices connected through a network provided by an embodiment of the present application. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0046] Some names related to the present application will be defined first.
[0047] Grafana: an open-source data visualization and monitoring tool that can query, visualize, and alert data from various data sources (e.g., Elasticsearch, Prometheus, etc.), widely used in big data analysis, system monitoring, etc.
[0048] Grafana plugin: a modular extension mechanism provided by Grafana, including metadata configuration information, front-end interface, and back-end logic, used to provide a natural language input interface for users and provide visual interaction functions between users and back-end large models.
[0049] Natural language to query (NL2Query): a large language model (LLM) that automatically converts user input natural language (such as Chinese, English) into computer executable query statements (such as Elasticsearch domain-specific language (DSL) queries, structured query language (SQL) statements, etc.).
[0050] Natural language to application programming interface (NL2API): a large model-based natural language input conversion to a standardized API interface request, which can hide the underlying complex data processing logic (such as cross-index association, data cleaning, etc.), so that the front-end application (such as Grafana) can obtain query results by calling the API.
[0051] NoSQL (Not Only SQL) databases are data storage systems that differ from traditional relational databases (such as MySQL). They employ unstructured or semi-structured data models such as key-value pairs, documents, and column families, and feature high scalability and high-concurrency read / write capabilities. Examples include Elasticsearch, MongoDB, and Cassandra. However, due to limitations in their underlying inverted indexes and distributed sharding architecture, they lack native JOIN capabilities.
[0052] Elasticsearch is an open-source distributed search and analytics engine based on Lucene. It is a type of NoSQL database that supports real-time data storage, search, analysis, and high-concurrency queries.
[0053] JOIN is an operation in relational databases used to merge data from two or more tables. It connects records from different tables through association fields (such as primary keys and foreign keys) to achieve joint data queries.
[0054] An index is a data structure used in databases (especially search engines and NoSQL databases) to preprocess field values (such as word segmentation and sorting) to quickly locate and access data records, thereby improving query efficiency.
[0055] like Figure 1 As shown, Figure 1 This is a schematic diagram of a Grafana overview page provided in an embodiment of this application. Figure 1 The top right corner of the chart displays data within a specific time range. The first row shows core business metrics, such as 172 logins, 263 sign-ups, 268 sign-outs, and 80 support calls. The second row shows two sets of memory / central processing unit (CPU) monitoring data and login trends for data comparison. The third row shows server requests and client-side full pageload under different conditions. The fourth row provides an overview of global trends.
[0056] Figure 1 This is merely one possible example provided in this application, and its specific content may vary depending on user requests. This application does not impose any specific limitations on it.
[0057] likeFigure 2 As shown, Figure 2 is a page schematic diagram when Grafana performs data configuration, provided by an embodiment of the present application. Specifically, Figure 2 is a configuration page of “variables” in the Grafana dashboard, and the configuration area of the variables includes a left navigation bar and a variable configuration area, wherein the left navigation bar includes variables, and further includes function modules such as links, versions, permissions, and a JSON model, and the “Save dashboard” function is used to save the dashboard configuration.
[0058] The variable configuration area includes General, which includes Name, Label, Hide, and Description, wherein Name represents the unique identifier of the variable in the dashboard (such as domain), Label represents the name displayed on the interface (such as “domain name”), Hide represents the control of whether the variable is hidden on the interface, and Description represents the description information of the variable, which helps users understand the purpose; the variable configuration area further includes Query Options, which includes Data source, Refresh, Query, Regex, and Sort, wherein Data source is used to indicate the database / data source for obtaining the variable value, Refresh represents the refresh strategy of the variable value (such as “On Dashboard Load” indicating that the latest value is obtained when the dashboard is loaded), Query is an expression for querying the variable optional value through the data source (such as the find query of Elasticsearch in the screenshot, which retrieves the http_host field), Regex is a regular expression to filter the query result (such as / .*(<text>) (?<text>.*) <value>Sort indicates the sorting manner of the control variable value (e.g., "Disabled" indicates no sorting, keeping the query return order); the variable configuration area further includes selection options (Selection Options), which include Multi-value, Include All option, and Custom all value, wherein Multi-value is an option of whether to enable multi-selection function, Include All option is an option of whether to add "All", and Custom all value is used to customize the value corresponding to the "All" option; the variable configuration area further includes experimental functions (Value group tags) for grouping variable values.
[0059] Figure 2 The variable configuration interface shown is the core module of Grafana to realize interaction with users, and through the above variable configuration, the data chart in the data source is converted into a filterable data dashboard to display the data query result of the corresponding variable on the overview page.
[0060] As shown in Figure 3 , the page schematic diagram for drawing a table by Grafana is provided. Figure 3 is a page schematic diagram for drawing a table by Grafana provided in an embodiment of the present application. Figure 3 The data of the configured domain name traffic in the configured time period is displayed, and the trend of "adi" (single domain name) and "total" (total traffic) with time is displayed through a time series line chart. Specifically, the horizontal axis of the chart is the time axis (17:26-17:52), the granularity is 2 seconds, the line in the chart is used to indicate the fluctuation of the traffic of the single domain name, and the total traffic in the time period is displayed through the numerical value 1788.
[0061] Figure 3 The image area in the middle includes query (Query), transformation (Transform), and alert (Alert) configuration, the Query includes the current query condition: http_host:${domain}, the chart Alias uses ${domain:raw}, the ${database} (database variable) is used in the query condition, the dynamic switching of the data source is supported, the Metric is set to Count (statistical event number), the Group By uses Date Histogram to group by time, and the custom time interval ($Inter) is supported; in addition, the Query Inspector is used to check the query execution plan, performance, or raw data, and helps to troubleshoot data exceptions. Compared with Figure 1 The overview page shown can provide more fine-grained data query and visual operation.
[0062] The above Figures 1-3 The process of data query and chart generation by Grafana is provided, specifically, a user manually configures a single index data source (for example, ElasticSearch), obtains data through a predefined fixed query statement, and generates a chart. With the development of cloud computing, the demand of users for data image query and visualization of complex data sources is expanding. However, due to the lack of native JOIN capability of non-relational databases such as ElasticSearch, the above data chart generation method cannot process complex data connection queries across indexes.
[0063] Therefore, the current complex data connection query across indexes is implemented through a script extension method or a predefined API method.
[0064] Specifically, a user writes a Python / JS script that can implement data processing logic and embeds the script in a visualization tool such as Grafana to implement complex data connection query operations across indexes. This method requires a high technical ability of the user, requires mastering ES query syntax, SQL script writing, etc. In the case of adding a new data source, the user needs to continuously develop new scripts, so this method has the problems of complex operation and poor flexibility. In addition, the user writing script code has the risk of command injection attacks, and currently there is a lack of monitoring and management of script execution resources, which may cause system overload or resource waste.
[0065] Specifically, complex data query logic is encapsulated into an external service to enable Grafana to call a fixed API interface generated by the external service to implement complex data connection query operations across indexes. In this method, the API is a predefined fixed interface that only supports predefined parameters, and the external service has strong coupling with the data source. When the index field of the data source changes, the service needs to be restarted to update the logic, so this method has the problem of lacking dynamic generation capability, lacks flexibility, and cannot meet the dynamic adaptation of query requests and data sources.
[0066] To solve the above problems, the embodiment of the present application provides a data image generation method. A processor calls a large language model to parse a query request sent by a user and composed of natural language, generates a corresponding multi-step data query statement, and encapsulates a reusable API to generate a query result according to data sent by a received data source, and sends the query result to the user, so that the user generates a corresponding data chart through a visualization tool. In one possible implementation, the visualization tool mentioned in the embodiment of the present application can be Kibana in addition to Grafana mentioned above, and the type of the visualization tool is not limited in the present application. The above process can generate a dynamically changing multi-step data query statement without human intervention, automatically implement cross-index data connection operations, be applicable to changing query requests, reduce the development threshold of manual work, and thus improve the query efficiency. The above method is applied to Figure 4 a data query system as shown in the specification.
[0067] As Figure 4 shown, Figure 4 is a structural schematic diagram of a data query system provided by the embodiment of the present application. The system includes a storage system 110, a data chart generation system 120, and a client 130. There is a communication connection between the storage system 110, the data chart generation system 120, and the client 130, which can be a wired connection or a wireless connection, and the present application does not make a specific limitation. The number of the storage system 110 and the client 130 that establish a communication connection with the data chart generation system 120 can be one or more, and the present application does not make a specific limitation.
[0068] Optionally, the storage system 110 and the data chart generation system 120 can be deployed on a computing device, wherein the computing device includes a bare metal server (BMS), a virtual machine, a container, or an edge computing device. The BMS refers to a general-purpose physical server, for example, an ARM server or an X86 server; the virtual machine refers to a complete computer system that is implemented by software simulation, has complete hardware system functions, and runs in a completely isolated environment through network function virtualization (NFV) technology; the container refers to a group of processes that are limited in resources and isolated from each other; the edge computing device refers to a device that is closer to a data source and an end user, has low delay and high bandwidth characteristics, such as a smart router, an edge server, and the like. The storage system 110 and the data chart generation system 120 can also be deployed on a computing device cluster, which can include a plurality of the above computing devices.
[0069] Optionally, the storage system 110 is usually a distributed storage system, usually deployed on different computing devices, the data graph generation system 120 can be deployed on different computing devices, or deployed on the same computing device. When the storage system 110 and the data graph generation system 120 are deployed on different computing devices, the storage system 110 and the data graph generation system 120 can be deployed on different computing devices in the same computing device cluster, or deployed on different computing devices in different computing clusters. The specific determination can be made according to the actual application scenario, and the present application does not make specific limitation.
[0070] Optionally, a non-relational database is deployed on the storage system 110, and other types of databases can also be deployed, which are not limited by the present application. The non-relational database has the characteristics of high scalability and high concurrent read and write, but due to its usually only supporting single record or small range transaction, emphasizing the eventual consistency, and the query language of the database does not standardize the JOIN operation, in the complex association query, the weak transaction of the non-relational database cannot provide global transaction support across shards / nodes, resulting in the possibility of partial success and partial failure of the association operation, which may damage the atomicity and consistency of data query; and the non-standard complex association query language needs to manually perform complex association query, which has the problems of performance loss, high complexity and poor scalability.
[0071] Optionally, the storage system 110 also stores a pre-generated large language model for parsing the query request sent by the user, generating a data query statement, and performing data connection.
[0072] Optionally, the client 130 and the data graph generation system 120 can be deployed on different computing devices, or can be deployed on the same computing device, and the client 130 can be deployed on a terminal device and the data graph generation system 120 can be deployed on a computing device. When the client 130 and the data graph generation system 120 are deployed on different computing devices, the client 130 and the data graph generation system 120 can be deployed on different computing devices in the same computing device cluster, or deployed on different computing devices in different computing clusters. The specific determination can be made according to the actual application scenario, and the present application does not make specific limitation.
[0073] Optionally, the client 130 can be deployed on a terminal device or a computing device, wherein the terminal device includes a personal computer, a smart phone, a palm processing device, a tablet computer, a mobile notebook, etc., which are not limited herein. The computing device can be a BMS, a virtual machine, a container, or an edge computing device, and the specific description can refer to the foregoing content, which is not repeated here.
[0074] Optionally, the client 130 can be implemented in software, which can be independent software specially used for data image visualization, including generating corresponding images according to received data query results, and users can use the software by downloading and installing the software Figure 4 The above examples are used for illustration, and the application is not limited in this regard.
[0075] Optionally, the client 130 can also be built into application tools as a plug-in, and users can use the software by upgrading the business software Figure 4 The above examples are used for illustration, and the application is not limited in this regard.
[0076] Optionally, the client 130 can also be a console of a cloud platform, which provides data chart generation functions to users as a sub-service of the cloud platform, and users can use the client by purchasing cloud services Figure 4 The console can be a web-based client, an application program client, or an application programming interface (API), and the application is not limited in this regard.
[0077] It should be understood that the above Figure 4 The data query system shown is only one possible example provided by the embodiments of the application, and the system can further include more devices, and the application is not limited in this regard.
[0078] Further, the data chart generation system 120 can be further divided into multiple unit modules, such as Figure 4 As shown, the data chart generation system 120 includes a visualization tool plug-in module 121 and a monitoring agent module 122. It should be understood that Figure 4 This is an exemplary division manner, and the data chart generation system 120 can further include more or less modules, and the above unit modules can be combined or split, and the application is not limited in this regard.
[0079] The visualization tool plug-in module 121 and the monitoring agent module 122 can be implemented by software or hardware. For example, the implementation of the monitoring agent module 122 is introduced as follows. Similarly, the implementation of the monitoring agent module 122 can refer to the implementation of the monitoring agent module 122.
[0080] As an example of the monitoring agent module 122 as a software functional unit, the monitoring agent module 122 can include code running on a compute instance. The compute instance can include at least one of a physical host (computing device), a virtual machine, a container. Further, the compute instance can be one or more. For example, the monitoring agent module 122 can include code running on multiple hosts / virtual machines / containers. It is noted that the multiple hosts / virtual machines / containers for running the code can be distributed in the same region, or in different regions. Further, the multiple hosts / virtual machines / containers for running the code can be distributed in the same availability zone (AZ), or in different AZs, each AZ including one data center or multiple data centers in close geographical proximity. Typically, a region can include multiple AZs.
[0081] As an example of the monitoring agent module 122 as a hardware functional unit, the monitoring agent module 122 can include at least one computing device, such as a server, etc. Alternatively, the monitoring agent module 122 can also be a device implemented with an application-specific integrated circuit (ASIC), or a programmable logic device (PLD), etc. The PLD can be implemented with a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0082] The functions of the various unit modules of the data chart generation system 120 are described below.
[0083] The visualization tool plug-in module 121 is configured to receive a query request input by a user and send the query request to the monitoring agent module, the query request being composed of a natural language and used to drive a multi-index data connection query; the monitoring agent module is configured to determine a first multi-step data query statement by using a large language model (LLM) and the query request, and generate a first API path according to the first multi-step data query statement; the monitoring agent module is further configured to execute the first multi-step data query statement according to the first API path, and generate a first query result, where the first query result is obtained by connecting a plurality of data from the data source according to the first multi-step data query statement; the monitoring agent module is further configured to send the first query result to the visualization tool plug-in module; and the visualization tool plug-in module is further configured to send the first query result to the user, so that the user generates a first chart according to the first query result and the visualization tool.
[0084] Exemplarily, the monitoring agent module 122 is specifically configured to determine a parsing result of the query request by using the LLM and data source index metadata, the parsing result at least including a plurality of entities in the query request each corresponding to a target index, a plurality of fields in the query request, a plurality of values each corresponding to the plurality of fields, and an association field across indexes, where the data source index metadata includes index, field information, and an association relationship between indexes, and the association field is used to connect data corresponding to the plurality of indexes; and generate a first multi-step data query statement according to the parsing result and a query syntax of the data source.
[0085] In the embodiments of the present application, Grafana is taken as an example of the visualization tool, but the visualization tool can also include other types, for example, Kibana, and the present application does not make a specific limitation in this regard.
[0086] Exemplarily, the monitoring agent module 122 is specifically configured to execute the first multi-step data query statement to obtain a plurality of data according to the first API path, and integrate the plurality of data according to the association field across indexes to generate the first query result.
[0087] Exemplarily, the monitoring agent module 122 is specifically configured to take an entity as a path variable in an API path template according to the parsing result, where the API path template is determined according to the parsing result; and replace the value of the entity with a path variable corresponding to the entity to generate the first API path, where the first API path is associated with the first multi-step data query statement.
[0088] Exemplarily, the monitoring agent module 122 is further configured to, in a case where information that the first image meets a condition is received and sent by the user, store the first API path in a routing rule library of the visualization tool plug-in module.
[0089] Exemplarily, the visualization tool plug-in module 121 calls the first API path in the case of receiving the query request sent by the user again, so that the monitoring agent module executes the first multi-step data query statement to generate the first query result; and sends the first query result to the user through the visualization tool plug-in module.
[0090] Exemplarily, the visualization tool plug-in module 121, in the case of receiving the information sent by the user that the first image does not meet the condition, adjusts the LLM by the monitoring agent module, and determines the second multi-step data query statement according to the adjusted LLM and the query request, and generates the second API path according to the second multi-step data query statement; executes the second multi-step data query statement according to the second API path to generate the second query result, wherein the second query result is obtained by connecting a plurality of data queried from the data source according to the second multi-step data query statement; the monitoring agent module sends the second query result to the visualization tool plug-in module, and the visualization tool plug-in module sends the second query result to the user, so that the user generates a second chart according to the second query result and the visualization tool.
[0091] Exemplarily, the data source is a non-relational database.
[0092] As shown in Figure 5 , Figure 5 is a schematic diagram of the overall operation of a data chart generation system architecture provided by the embodiments of the present application. The diagram includes a visualization tool (Grafana) plug-in module 121, a monitoring agent module (monitor agent) 122, an LLM required by the monitor agent during operation, and an Elasticsearch non-relational database.
[0093] In the case of the user performing cross-index data chart query for the first time, the user inputs a query request expressed in natural language, the Grafana plug-in module sends the NL to the monitor agent, the monitor agent calls the LLM service, generates a multi-step data query statement according to the query request and the multi-index metadata provided by the non-relational database, and generates a data query result and an API path according to the multi-step data query statement. The monitor agent returns the data query result and the API path to the Grafana plug-in module, so that the Grafana plug-in module stores the generated API path, and triggers the monitor agent to execute the corresponding multi-step data query statement according to the API path to obtain the data query result, and sends the data query result to the user through the Grafana plug-in module, so that the user generates a chart according to the data query result.
[0094] In the case that the user performs the same cross-index data chart query again, the Grafana plug-in module determines the corresponding API path according to the query request sent by the user, triggers the monitor agent to execute the corresponding multi-step data query statement, obtains the data query result, and sends the data query result to the user through the Grafana plug-in module, so that the user generates a chart according to the data query result.
[0095] As Figure 6 shown, Figure 6 is a specific process diagram of a data chart generation system provided by an embodiment of the present application. Figure 6 The query editor, the plugin forwarder, and the monitoring intelligent agent module 122 are included in the data chart generation system.
[0096] The user needs to create a data source plug-in integrated into the visualization tool, and needs to configure the plug-in metadata (plugin.json), such as plug-in type (DataSource), name (nl-api-datasource), data source configuration item, and the like. The plug-in is used to obtain data according to the query request expressed in natural language, and to display the corresponding API path and the index. The plug-in is placed in the plugins directory of Grafana, and takes effect after the service is restarted.
[0097] The query editor is an interface for the user to interact with the visualization tool plug-in module, including a configuration bar and a general operation bar, and a multi-line text box for receiving the query request expressed in natural language input by the user, and displaying the API path and the data query result decided by the large language model, or the generated chart. Specifically, the multi-line text box is obtained by using a React component to render in QueryEditor.tsx.
[0098] The plugin forwarder is used to process the query request and the corresponding response result, including a forwarder, a feedback device, a query device, and an API routing rule library. The forwarder is used to forward data between the user and the monitoring intelligent agent module 122, the feedback device is used to collect the satisfaction degree of the user for the data query result, that is, to judge whether the query result meets the condition, the query device is used to interact with the API routing rule library to determine the best API path, and the API routing rule library includes the mapping relationship between the API and the query request, wherein each API corresponds to a synonymous query request.
[0099] Specifically, the query editor receives a query request "Query the top 10 virtual machines with the highest current CPU usage" input by the user, sends the query request to the monitoring agent module 122 through the forwarder in the plugin forwarder, so that the monitoring agent module 122 runs the integrated NL2Query, NL2API service, generates a multi-step data query statement, encapsulates the API path for indicating the multi-step data query statement and the data connection logic, generates a data query result according to the API path, and sends the data query result and the API uniform resource locator (URL) to the query editor through the forwarder for display in the multi-line text box. Then, the user feeds back through the "Is the result satisfactory?" option, and the feedback device sends the information to the monitoring agent module 122, so that the monitoring agent module performs model adjustment and other operations in the case that the user is not satisfied, optimizes the NL2Query, NL2API service, generates a new API, and repeats the above steps to return to the query editor. In the case that the user is satisfied, the API is stored in the API routing rule library.
[0100] In addition, the figure also includes a general index interface, which at least includes indexes Figure 1 and indexes Figure 2 Different index graphs in the general index interface each correspond to a different API. For example, the query node performance index corresponds to two different APIs with the index of the virtual machine with the highest CPU usage. That is, in the case that the user needs the index graph of the virtual machine with the highest CPU usage, the target API in the API routing rule library is determined through the query device, so that the monitoring agent module 122 performs the corresponding data query statement and connection operation, sends the data query result to the query editor through the forwarder, and displays it in the multi-line text box.
[0101] In the above process, the monitoring agent module independently processes data source monitoring, data query statement generation and execution, and API, which can realize automatic execution of data query and cross-index connection operation, without the need for human intervention compared with the prior art; decoupled from the visualization tool plugin module, which can reduce system coupling and improve query accuracy and efficiency; in addition, the API routing rule library is dynamically updated according to user feedback and the function of the monitoring agent module, so as to be applicable to changing query requests and data sources.
[0102] In summary, the data chart generation system provided by the embodiments of the present application automatically implements cross-index data connection operations through a query request expressed in natural language, a dynamically changing query statement generated by an LLM, and a reusable API, without the need for manual programming of corresponding query statements, which can reduce the development threshold, ensure data security, and be applicable to changing query requests and data sources, thereby improving query efficiency.
[0103] As Figure 7 shown, Figure 7 is a flowchart of a data chart generation method provided by the embodiments of the present application, which is applied to Figure 4 a data chart generation system as shown, and the method includes the following steps.
[0104] S210: receiving a query request sent by a user.
[0105] The query request is composed of natural languages such as Chinese or English, and is used to drive multi-index data connection queries, that is, in a multi-data source scenario, data in multiple indexes is associated to implement data connection operations combined with complex conditions.
[0106] The query request can be directly input into a large language model to generate a corresponding multi-step data query statement, without the need for manual conversion of the query request into a complex query code, which is low in labor cost and more convenient to operate.
[0107] S220: determining a first multi-step data query statement through a large language model and a query request, and generating a first API path according to the first multi-step data query statement.
[0108] The large language model is obtained by training a computing device according to historical data. Specifically, the computing device first acquires a data set of natural languages paired with corresponding database query statements, the data set including multiple groups of data, each group of data including a query request expressed in natural language, a multi-step data query domain specified language (DSL), index mapping information, and an association relationship between steps. In addition, data diversity is increased through synonym replacement and query deformation, and a commonly used query template of a data source is extracted. The data set, the data source query template, and a data source document are used for training, so that the trained large language model determines a corresponding multi-step data query statement and a connection operation according to a received query request.
[0109] The multi-step data query statement is a query method for obtaining a data query result through multiple sequentially executed query steps, wherein different data sources can be operated in different steps, and there is a dependency relationship between the steps.
[0110] The API path is a dynamically parameterized RESTful endpoint, the path structure of which semantically represents query logic, carries query parameters through path variables, and indicates the input-output relationship of multi-step data query statements, becoming a repeatable data service interface.
[0111] In a possible implementation, the processor determines a parsing result of the query request through the LLM and the data source index metadata, the parsing result at least including a target index corresponding to each of a plurality of entities in the query request, a plurality of fields in the query request, a value corresponding to each of the plurality of fields, and an associated field across indexes; and generates a multi-step data query statement according to the parsing result and a query syntax of the data source.
[0112] The data source index metadata is used to indicate the structure of the data source index, including the field corresponding to each index and the field type, attribute, etc., the key in the data source metadata is the index name, and the value is index mapping information of the index, the index mapping information including the field name, the field type, and possibly other attributes (such as whether to be indexed, whether to support word segmentation, etc.). Specifically, the data type type of the field, such as keyword, text, date, long, etc., is used to indicate the query syntax for querying the field; the value index indicates whether the field is indexed, and the default is true, if it is false, the field cannot be searched; the relationship is used to indicate the association relationship between indexes, the value is used to indicate the allowed value range of the field, etc., which are not limited by the present application.
[0113] Specifically, after the processor receives the query request sent by the user, the data source index metadata is retrieved, the query request is semantically parsed, the segment with a specific semantic meaning in the query request, that is, the entity, is determined, which has a clear type, a corresponding value is represented, and acts as a specific operation role (for example, a filtering condition, a time window, or an aggregation operation, etc.) in the query process, and has a constraint condition. After the entity is determined, the validity of the value corresponding to the entity is verified according to the data source index metadata, and the corresponding field is determined. Then, the LLM is called to generate a multi-step data query statement according to the parsing result, and to determine the dependency relationship between the multi-step data query statements.
[0114] In the above process, the processor generates a dynamically changing multi-step data query statement through the large language model and the query request, without the need for manual coding of complex query statement codes, which can reduce human intervention, reduce the development threshold, adapt to non-relational database multi-index connection operations, improve query efficiency, support cross-index association analysis, and enhance data insight.
[0115] In a possible implementation, after determining the first multi-step data query statement, the processor can execute the first multi-step data query statement, obtain data returned by the database, and connect the data to obtain a data query result.
[0116] In a possible implementation, the processor encapsulates the corresponding query logic into a first API path according to the multi-step data query statement, and stores the first API path into an API routing rule library. Specifically, the processor takes the entities included in the parsing result as path variables in the first API path template, and replaces each corresponding first API path variable with the value corresponding to the entity, to generate the first API path. The processor generates an API path template by parsing the entities, the query type, and the cross-index association field obtained from the query request, and injects the values of the entities as API path variables into the corresponding positions in the preset API path template (for example, / {index} / {dimension field} / {association index} / {aggregation function}), to generate the first API path. The first API path is associated with the first multi-step data query statement.
[0117] In the above process, an API path is generated according to the multi-step data query statement, which can be directly called in the subsequent process to trigger the processor to execute the corresponding multi-step data query statement and obtain the corresponding query result, without the need to repeatedly call the LLM to generate an API, and the consumption of computing resources can be reduced.
[0118] S230: According to the first API path, the first multi-step data query statement is executed to generate a first query result.
[0119] In a possible implementation, the processor obtains multiple data according to the first multi-step data query statement, and integrates the multiple data according to the cross-index association field to generate the first query result. Specifically, the processor determines multiple query steps and a dependency relationship between the multiple query steps according to the first multi-step data query statement, sends the multiple query steps to a data source according to the dependency relationship, so that the data source returns data queried according to each step to the processor, and the processor integrates the multiple data and the cross-index association field to generate the first query result. The first query result is a data result queried from the data source according to the first multi-step data query statement, and is usually a structured data set, including a final queried data set, metadata, and a visualization prompt.
[0120] In the above process, after generating the first multi-step data query statement and encapsulating the first API path, the processor automatically executes the query logic, which can realize an automated cross-index JOIN operation, improve query efficiency, and enhance data exploration capability.
[0121] In a specific embodiment, the processor determines a multi-step data query statement through a large language model and a query request, and generates an API path and a specific process of a query result according to the multi-step data query statement, as follows. Figure 8 Figure 8 is a flowchart for generating a data query result according to a query request by calling an LLM, provided by an embodiment of the present application. Specifically, after receiving a query request, the monitoring agent module constructs multiple prompts by calling an LLM, and realizes data query and result integration by combining retrieval-augmented generation (RAG) and tool invocation, and outputs the data query result.
[0122] RAG is a large model application technology that enhances the generation model's ability by dynamically introducing external knowledge bases (such as indexes, documents, and databases, etc.), retrieves relevant knowledge, supplements model input, and thus improves the real-time performance, accuracy, and controllability of large language models. In the embodiments of the present application, RAG is used to construct index metadata knowledge, and convert the structured information of data sources (fields, association relationships, and index / table names, etc.) into prompts that can be understood by large language models, to ensure that the queries generated by large language models conform to the actual data structure.
[0123] The prompt is a technology that guides large language models to output specific behaviors (such as generating text, performing reasoning, and invoking tools, etc.) through natural language instructions, and is a "instruction template" for user interaction with large language models.
[0124] Figure 8 The prompt 1 (index / table selection) in the above is used to guide the LLM to parse entities in the query request according to the input query request, and select a matching data source from a pre-defined index / table library, to output the target index / table that needs to be queried. Wherein, the index and the table are actually the same, only the corresponding names are different in the case of different storage system types, and one data source configuration usually points to a database instance or cluster, which can contain multiple indexes in the instance / cluster, which is not limited by the present application; the prompt 2 is used to guide the LLM to generate a multi-step data query statement according to the input target index / table and the target of the query request, to process complex logic such as multi-table association and aggregation calculation, and cross-index associated fields, to output a multi-step data query statement (such as Python code); the prompt 3 is used to guide the large model to integrate multiple data according to the data obtained by the input multi-step data query, to generate a data query result.
[0125] In a specific embodiment, after receiving the query request input by the user, the monitoring agent module selects the target index / table according to the constructed prompt word 1, calls the pre-trained large language model, parses the query request, identifies the entity data in the query request, determines the target index / table in combination with the index metadata constructed by the RAG; based on the target index / table and the prompt word 2, the large language model is called to generate a multi-step data query statement and index connection information, wherein the index connection information is used to indicate the indexes / tables that need to be connected, the connection method, and the cross-index association field, etc., which are not limited by the present application.
[0126] The monitoring agent module performs dynamic processing of the multi-step data query statement returned by the large language model, for example, code verification, permission checking, and environment adaptation of the multi-step data query statement, and then executes the code corresponding to the processed multi-step data query statement by calling the data query tool, for example, sends the SQL query statement to the database engine, sends the text to the Elasticsearch data source, and the like. In addition, in the case of multi-data source data query, the multi-table is processed in a loop, that is, according to the preset query order and connection strategy, the data query operation is performed on each related index until the data source returns the queried multiple data to the monitoring agent module. The data query result is generated according to the cross-index association field by integrating the data of the multi-step query through the prompt word 3, and the data query result is output to the user.
[0127] S240: Send the first query result to the user to enable the user to generate a first chart according to the first query result and the visualization tool.
[0128] The processor sends the first query result to the user, and the user renders the first chart through the visualization tool and the first query result, wherein the first query result is usually a structured data format (for example, a table, JSON, or a SQL result set), and the first image can be a column chart, a heat map, etc., and the type of the first image is not limited by the present application.
[0129] In a possible embodiment, after sending the query result to the user, the user can judge whether the query result meets the condition and return feedback information to the processor whether the user is satisfied or not, so that the processor optimizes the large model according to the feedback information to generate a new multi-step data query statement and update the API routing rule library.
[0130] In a possible implementation, after the processor sends the first API path and the first query result to the user for visual display, if the processor receives feedback information sent by the user indicating that the first image does not meet the condition, that is, the user is not satisfied, the processor adjusts the LLM, and repeatedly performs the steps S220-S240 according to the adjusted LLM and the query request, to determine a second multi-step data query statement; executes the second multi-step data query statement to generate a second query result, and generates a second API path according to the second multi-step data query statement, where the second query result is obtained by connecting a plurality of data queried from the data source according to the second multi-step data query statement; and sends the second query result to the user, so that the user generates a second chart according to the second query result and the visualization tool.
[0131] In the above process, the LLM analysis and generation logic is dynamically adjusted through the feedback information sent by the user, forming a closed loop of user input-result feedback-model optimization, so that the accuracy of data query can be improved, the API routing rule library can be dynamically updated, and the user demand can be met.
[0132] In a possible implementation, after the processor sends the first API path and the first query result to the user for visual display, if the processor receives feedback information sent by the user indicating that the first image does not meet the condition, that is, the user is not satisfied, the processor adjusts the LLM, and repeatedly performs the steps S220-S240 according to the adjusted LLM and the query request, to determine a second multi-step data query statement; executes the second multi-step data query statement to generate a second query result, and generates a second API path according to the second multi-step data query statement, where the second query result is obtained by connecting a plurality of data queried from the data source according to the second multi-step data query statement; and sends the second query result to the user, so that the user generates a second chart according to the second query result and the visualization tool.
[0133] In a possible implementation, when the processor receives the query request sent by the user again, the processor calls the first API path and executes the multi-step data query statement to generate the first query result; and sends the first query result to the user. In the case of non-first-time query, the first API path is directly called, which can reduce repeated calling of the LLM to generate a corresponding API, reduce repeated analysis of the query request sent by the user, and reduce consumption of computing resources.
[0134] The above process of non-first-time data query is specifically as shown in Figure 9 Figure 9 which is a flowchart of non-first-time data query provided by an embodiment of the present application.
[0135] S310: receiving a query request sent by a user.
[0136] S320: determining a first API path according to the query request, and executing a corresponding multi-step data query statement according to the first API path to generate a data query result.
[0137] After receiving the same query request, the processor does not need to call the LLM again to parse the query request. Instead, it can determine the first API path in the API routing rule base based on the mapping relationship between the query request expressed in natural language and the API path, and execute the corresponding multi-step data query statement based on the first API path to generate the data query result.
[0138] S330: Sends the data query results to the user so that the user can generate corresponding charts based on the data query results and visualization tools.
[0139] In summary, the data image generation method provided in this application involves a processor that parses a user's query request, represented in natural language, by calling a large language model. This process generates and executes a multi-step data query statement to obtain a first query result, which is then sent to the user. The user then generates a first chart based on the first query result and a visualization tool. In this process, the processor generates dynamically changing multi-step data query statements and APIs based on the large language model and the query request. This eliminates the need for manually writing corresponding query statements, automatically implements cross-index data join operations, and is adaptable to changing query requests. This reduces the manual development threshold and improves query efficiency.
[0140] like Figure 10 As shown, Figure 10 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application, which is used for deploying... Figure 4 The data chart generation system in the middle, execute Figure 7 The data chart generation method is shown. The computing device 400 includes at least: a processor 410, a memory 420, a communication interface 430, and a bus 440. The processor, memory, and communication interface can communicate via the bus. The processor 410 in the computing device 400 reads the program and data set stored in the memory 420 to execute the aforementioned pipeline and AI integration environment method.
[0141] The processor 410 can be constituted by at least one general-purpose processor, such as a central processing unit (CPU), or a combination of a CPU and a hardware chip. The hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 410 is configured to execute respective corresponding steps to implement corresponding functions. In the case of a computing device being a computing node, the computing node includes one or more processors, and the number of processors is not limited in the present application.
[0142] The memory 420 can be a volatile memory, such as a random access memory (RAM), a dynamic RAM (DRAM), a static RAM (SRAM), a synchronous dynamic RAM (SDRAM), a double data rate RAM (DDR), a cache, or the like, or a combination thereof. The memory 420 stores executable program codes, which can be executable program codes of one or more of the visualization tool plug-in module 121 and the monitoring agent module 122. The processor 410 executes the executable program codes to implement the functions of the visualization tool plug-in module 121 and the monitoring agent module 122, respectively, thereby implementing the data graph generation method. Figure 7 The memory 420 stores instructions for executing the data graph generation method, and can further store more types and quantities of data, such as intermediate data obtained by each query statement, a data query result, and the like, which are not limited in the present application.
[0143] The communication interface 430 supports RDMA and TCP / IP protocols using a transceiver module such as, but not limited to, a network interface card and a transceiver, which is not limited in the present application.
[0144] The bus 440 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 10 only one line is used, but it does not mean that there is only one bus or only one type of bus. The bus 440 can include a path for transmitting information between various components (e.g., the processor 410, the memory 420, the communication interface 430) of the computing device.
[0145] It should be noted that Figure 10 only one possible implementation of the embodiments of the present application, and in actual applications, the computing device can further include more or fewer components, which are not limited herein.
[0146] As Figure 11 shown, the embodiments of the present application also provide a structural diagram of a computing device cluster, which includes at least one computing device 400, wherein the computing devices can communicate with each other. The memory 420 in one or more computing devices 400 in the computing device cluster can store the same instructions for executing the data graph generation method provided by the embodiments of the present application.
[0147] In some possible implementations, the memory 420 of one or more computing devices in the computing device cluster can also respectively store partial instructions for executing the data graph generation method. In other words, the combination of one or more computing devices can collectively execute the instructions for executing the data graph generation method.
[0148] It should be noted that the memories 420 in different computing devices 400 in the computing device cluster can store different instructions, and the memories 420 in different computing devices 400 can store instructions to implement the functions of one or more units of the visualization tool plug-in module 121 and the monitoring agent module 122.
[0149] In some possible implementations, one or more computing devices in the computing device cluster can be connected through a network. The network can be a wide area network or a local area network, etc. Figure 12 shows a possible implementation, Figure 12 is a structural diagram of one or more computing devices connected through a network provided by the embodiments of the present application. As Figure 12 As shown, two computing devices 400A and 400B are connected through a network. Computing device 400A includes processor 410A, memory 420A, communication interface 430A and bus 440A, and computing device 400B includes processor 410B, memory 420B, communication interface 430B and bus 440B. Specifically, one or more computing devices are connected with the network through the communication interface in each computing device.
[0150] In this kind of possible implementation, the memory 420A in the computing device 400A stores instructions for executing the functions of the visualization tool plug-in module 121. Meanwhile, the memory 420B in the computing device 400B stores instructions for executing the functions of the monitoring agent module 122. It should be understood that, Figure 12 The functions of the computing device 400A shown in the above embodiment can also be completed by multiple computing devices 400. Similarly, the functions of the computing device 400B can also be completed by multiple computing devices 400, which are not limited in the present application.
[0151] The present application also provides a computer program product containing instructions. The computer program product can be a software or program product containing instructions, which can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device is caused to execute Figure 7 The data chart generation method shown.
[0152] The present application also provides a computer readable storage medium. The computer readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk) and the like. The computer readable storage medium includes instructions, which instruct the computing device to execute Figure 7 The data chart generation method shown.
[0153] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the protection scope of the technical solutions of the embodiments of the present application.< / value>
Claims
1. A method for generating data charts, characterized in that, The method includes: The processor receives a query request sent by the user, which is composed of natural language and is used to drive multi-index data join queries; The processor determines a first multi-step data query statement using the Large Language Model (LLM) and the query request, and generates a first application programming interface (API) path based on the first multi-step data query statement. The processor executes the first multi-step data query statement according to the first API path to generate a first query result, wherein the first query result is obtained by concatenating multiple data retrieved from the data source according to the first multi-step data query statement. The processor sends the first query result to the user so that the user can generate a first chart based on the first query result and a visualization tool.
2. The method according to claim 1, characterized in that, The processor determines the first multi-step data query statement, including the Large Language Model (LLM) and the query request, as follows: The processor determines the parsing result of the query request through the LLM and the data source index metadata. The parsing result includes at least the target index corresponding to each of the multiple entities in the query request, multiple fields in the query request, the values corresponding to each of the multiple fields, and cross-index association fields. The data source index metadata includes indexes, field information, and the association relationship between indexes. The association fields are used to connect the data corresponding to multiple indexes. The processor generates the first multi-step data query statement based on the parsing result and the query syntax of the data source.
3. The method according to claim 2, characterized in that, The processor executes the first multi-step data query statement according to the first API path, and generates the first query result including: The processor executes the first multi-step data query statement to obtain multiple data items according to the first API path; The processor integrates the multiple data based on the cross-index association fields to generate the first query result.
4. The method according to claim 3, characterized in that, The step of generating the first application programming interface (API) path based on the first multi-step data query statement includes: The processor uses the entity as a path variable in the API path template based on the parsing result, wherein the API path template is determined based on the parsing result; The processor replaces the path variables corresponding to each entity with the values corresponding to the entities to generate the first API path.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: Upon receiving information from the user confirming that the first image meets the conditions, the processor stores the first API path in the routing rule base.
6. The method according to claim 5, characterized in that, The method further includes: When the processor receives the query request sent by the user again, it calls the first API path and executes the first multi-step data query statement to generate the first query result. The processor sends the first query result to the user.
7. The method according to any one of claims 1-6, characterized in that, The method further includes: Upon receiving information from the user indicating that the first image does not meet the conditions, the processor adjusts the LLM, determines a second multi-step data query statement based on the adjusted LLM and the query request, and generates a second API path based on the second multi-step data query statement. The processor executes the second multi-step data query statement according to the second API path to generate a second query result, wherein the second query result is obtained by concatenating multiple data retrieved from the data source according to the second multi-step data query statement; The processor sends the second query result to the user so that the user can generate a second chart based on the second query result and the visualization tool.
8. The method according to any one of claims 1-7, characterized in that, The data source is a non-relational database.
9. A data chart generation system, characterized in that, The system includes: The visualization tool plugin module is used to receive query requests input by the user and send the query requests to the monitoring intelligent agent module. The query requests are composed of natural language and are used to drive multi-index data connection queries. The monitoring agent module is used to determine a first multi-step data query statement through the large language model LLM and the query request, and generate a first application programming interface (API) path based on the first multi-step data query statement. The monitoring agent module is further configured to execute the first multi-step data query statement according to the first API path and generate a first query result, wherein the first query result is obtained by connecting multiple data retrieved from the data source according to the first multi-step data query statement; The monitoring intelligent agent module is also used to send the first query result to the visualization tool plugin module; The visualization tool plugin module is also used to send the first query result to the user, so that the user can generate a first chart based on the first query result and the visualization tool.
10. A computing device cluster, characterized in that, It includes at least one computing device, each computing device including a processor and memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the method as described in any one of claims 1 to 8.
11. A computer program product containing instructions, characterized in that, When the instructions are executed by the computing device, the computing device performs the method as described in any one of claims 1-8.
12. A computer-readable storage medium, characterized in that, Includes computer program instructions that, when executed by a computing device, cause the computing device to perform the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Implementation method and system for integrating multi-field platform based on graph database
CN116304218A
Elasticsearch index association query method and device, storage medium and electronic equipment
CN116894039A
Method and system for generating accurate answer by using large model
CN117931983A
Data visualization method, system and equipment based on retrieval enhancement generation and medium
CN119128134A
Question answering method using graph database, and a computer program recorded on a recording medium for executing the same
KR102733434B1